int factorial (int n) {
if (n <= 1)
return 1;
return n * factorial(n-1);
}


int main() {
int result = factorial(5);
return 0;
}


factorial:
push ebp
mov ebp, esp
sub esp, 8
cmp DWORD PTR [ebp+8], 1
jg .L2
mov eax, 1
jmp .L3
.L2:
mov eax, DWORD PTR [ebp+8]
dec eax
sub esp, 12
push eax
call factorial
add esp, 16
imul eax, DWORD PTR [ebp+8]
.L3:
leave
ret

main:
lea ecx, [esp+4]
and esp, -16
push DWORD PTR [ecx-4]
push ebp
mov ebp, esp
push ecx
sub esp, 20
sub esp, 12
push 5
call factorial
add esp, 16
mov DWORD PTR [ebp-12], eax
mov eax, 0
mov ecx, DWORD PTR [ebp-4]
leave
lea esp, [ecx-4]
ret



lea ecx, [esp+4]
and esp, -16
push DWORD PTR [ecx-4]

저기서 다 이해가다가 이구간에서 대가리가 멈춤
구글링해보니까 스택 정렬하고 뭐 어쩌구라던데
재귀함수에서 왜 저런게 쓰이는지 설명좀 부탁해요 ㅇㅅㅇ