I'm compiling the following snippet into assembly
void function(int a, int b, int c) {
char buffer1[5];
char buffer2[10];
}
void main() {
function(1,2,3);
}
This is the assembly snippet of function
function:
pushq %rbp
movq %rsp, %rbp
subq $48, %rsp ; why is 48 being subtracted from the stack pointer?
movl %edi, -36(%rbp)
movl %esi, -40(%rbp)
movl %edx, -44(%rbp)
movq %fs:40, %rax
movq %rax, -8(%rbp)
xorl %eax, %eax
I'm running this on a 64-bit machine, so I thought three 8-byte words was enough to hold both buffer1
and buffer2
.