Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .file "problem1.c"
- .section .rodata
- .LC0:
- .string "max= %d\n"
- .text
- .globl main
- .type main, @function
- main:
- leal 4(%esp), %ecx
- andl $-16, %esp
- pushl -4(%ecx)
- pushl %ebp
- movl %esp, %ebp
- pushl %ecx
- subl $52, %esp
- movl $1, -28(%ebp)
- movl $45, -24(%ebp)
- movl $67, -20(%ebp)
- movl $7, -16(%ebp)
- movl $4, -12(%ebp)
- movl -12(%ebp), %eax
- movl %eax, 4(%esp)
- leal -28(%ebp), %eax
- movl %eax, (%esp)
- call max
- movl %eax, -8(%ebp)
- movl -8(%ebp), %eax
- movl %eax, 4(%esp)
- movl $.LC0, (%esp)
- call printf
- movl $0, %eax
- addl $52, %esp
- popl %ecx
- popl %ebp
- leal -4(%ecx), %esp
- ret
- .size main, .-main
- .globl max
- .type max, @function
- max:
- pushl %ebp
- movl %esp, %ebp
- subl $16, %esp
- movl $1, -8(%ebp)
- movl 8(%ebp), %eax
- movl (%eax), %eax
- movl %eax, -4(%ebp)
- jmp .L4
- .L5:
- movl -8(%ebp), %eax
- sall $2, %eax
- addl 8(%ebp), %eax
- movl (%eax), %eax
- cmpl -4(%ebp), %eax
- jle .L6
- movl -8(%ebp), %eax
- sall $2, %eax
- addl 8(%ebp), %eax
- movl (%eax), %eax
- movl %eax, -4(%ebp)
- .L6:
- addl $1, -8(%ebp)
- .L4:
- movl 12(%ebp), %eax
- subl $1, %eax
- cmpl -8(%ebp), %eax
- jg .L5
- movl -4(%ebp), %eax
- leave
- ret
- .size max, .-max
- .ident "GCC: (GNU) 4.1.2 20080704 (Red Hat 4.1.2-52)"
- .section .note.GNU-stack,"",@progbits
Add Comment
Please, Sign In to add comment