Guest User

Untitled

a guest
Jul 16th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. .file "problem1.c"
  2. .section .rodata
  3. .LC0:
  4. .string "max= %d\n"
  5. .text
  6. .globl main
  7. .type main, @function
  8. main:
  9. leal 4(%esp), %ecx
  10. andl $-16, %esp
  11. pushl -4(%ecx)
  12. pushl %ebp
  13. movl %esp, %ebp
  14. pushl %ecx
  15. subl $52, %esp
  16. movl $1, -28(%ebp)
  17. movl $45, -24(%ebp)
  18. movl $67, -20(%ebp)
  19. movl $7, -16(%ebp)
  20. movl $4, -12(%ebp)
  21. movl -12(%ebp), %eax
  22. movl %eax, 4(%esp)
  23. leal -28(%ebp), %eax
  24. movl %eax, (%esp)
  25. call max
  26. movl %eax, -8(%ebp)
  27. movl -8(%ebp), %eax
  28. movl %eax, 4(%esp)
  29. movl $.LC0, (%esp)
  30. call printf
  31. movl $0, %eax
  32. addl $52, %esp
  33. popl %ecx
  34. popl %ebp
  35. leal -4(%ecx), %esp
  36. ret
  37. .size main, .-main
  38. .globl max
  39. .type max, @function
  40. max:
  41. pushl %ebp
  42. movl %esp, %ebp
  43. subl $16, %esp
  44. movl $1, -8(%ebp)
  45. movl 8(%ebp), %eax
  46. movl (%eax), %eax
  47. movl %eax, -4(%ebp)
  48. jmp .L4
  49. .L5:
  50. movl -8(%ebp), %eax
  51. sall $2, %eax
  52. addl 8(%ebp), %eax
  53. movl (%eax), %eax
  54. cmpl -4(%ebp), %eax
  55. jle .L6
  56. movl -8(%ebp), %eax
  57. sall $2, %eax
  58. addl 8(%ebp), %eax
  59. movl (%eax), %eax
  60. movl %eax, -4(%ebp)
  61. .L6:
  62. addl $1, -8(%ebp)
  63. .L4:
  64. movl 12(%ebp), %eax
  65. subl $1, %eax
  66. cmpl -8(%ebp), %eax
  67. jg .L5
  68. movl -4(%ebp), %eax
  69. leave
  70. ret
  71. .size max, .-max
  72. .ident "GCC: (GNU) 4.1.2 20080704 (Red Hat 4.1.2-52)"
  73. .section .note.GNU-stack,"",@progbits
Add Comment
Please, Sign In to add comment