tl; dr Using the code in your question, we cannot say.
The order in which local variables appear on the stack depends on the compiler. It can change the order of things or even not allocate stack space for certain variables (since they have been optimized or allocated to registers).
Valid function arguments are pushed onto the stack - if at all! - dictated by your ABI platform. In my case (x86-64), three arguments are passed to the registers ( %edi , %esi and %edx ):
main: ... movl $3, %edx movl $2, %esi movl $.LC7, %edi call func
In order to compile code that accepts addresses a1 , a2 and a3 , the compiler must reject its path in order to store the values โโof the three registers in what effectively represents three unnamed local variables:
func: ... movq %rdi, -56(%rbp) movl %esi, -60(%rbp) movl %edx, -64(%rbp)
So the code in your question is not enough to conclude to what extent the stack grows.
Fortunately, we know such a thing a priori, or we can understand it using another code: What is the direction of stack growth in most modern systems? p>
source share