Compiler generated code to deal with the stack can be tricky and confusing. Each compiler has its own convention for how subroutines are called, and how arguments are passed to subroutines and I won't try to explain all that here, simply to warn you about it. If you are going to get deep into reverse engineering some compiler generated code or if you want to write assembly language routines called from C, you will need to master it.
One convention is very common, and that is that the register r0 (if there is a register r0!) returns values from functions. Arguments (the first few anyway) may be passed in registers. The rest (or all of the arguments) may be pushed onto the stack.
Tom's Computer Info / tom@mmto.org