rendered paste body .file "main.c"
.text
.globl Factorial
.type Factorial, @function
Factorial:
pushl %ebp
movl %esp, %ebp
subl $4, %esp
cmpl $0, 8(%ebp)
jne .L2
movl $1, -4(%ebp)
jmp .L4
.L2:
movl 8(%ebp), %eax
decl %eax
subl $12, %esp
pushl %eax
call Factorial
addl $16, %esp
movl %eax, %edx
imull 8(%ebp), %edx
movl %edx, -4(%ebp)
.L4:
movl -4(%ebp), %eax
leave
ret
.size Factorial, .-Factorial
.section .rodata
.LC0:
.string "%d factorial: %d\n"
.text
.globl main
.type main, @function
main:
pushl %ebp
movl %esp, %ebp
subl $24, %esp
andl $-16, %esp
movl $0, %eax
addl $15, %eax
addl $15, %eax
shrl $4, %eax
sall $4, %eax
subl %eax, %esp
movl $5, -4(%ebp)
pushl -4(%ebp)
call Factorial
addl $4, %esp
subl $4, %esp
pushl %eax
pushl -4(%ebp)
pushl $.LC0
call printf
addl $16, %esp
movl $0, %eax
leave
ret
.size main, .-main
.ident "GCC: (GNU) 4.0.2 20051125 (Red Hat 4.0.2-8)"
.section .note.GNU-stack,"",@progbits