Created
October 18, 2013 23:19
-
-
Save sbp/7049660 to your computer and use it in GitHub Desktop.
GCC compiled output of fibonacci.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.file "fibonacci.c" | |
.text | |
.globl fib | |
.type fib, @function | |
fib: | |
pushl %ebx | |
subl $24, %esp | |
cmpl $1, 32(%esp) | |
jg .L2 | |
movl 32(%esp), %eax | |
jmp .L3 | |
.L2: | |
movl 32(%esp), %eax | |
subl $1, %eax | |
movl %eax, (%esp) | |
call fib | |
movl %eax, %ebx | |
movl 32(%esp), %eax | |
subl $2, %eax | |
movl %eax, (%esp) | |
call fib | |
leal (%ebx,%eax), %eax | |
.L3: | |
addl $24, %esp | |
popl %ebx | |
ret | |
.size fib, .-fib | |
.ident "GCC: (Ubuntu 4.4.3-4ubuntu5) 4.4.3" | |
.section .note.GNU-stack,"",@progbits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment