Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. $ echo 'int foo(int c) { int a, b; a = (c%10); b = (c/10); return a+b; }' | gcc -S -x c - -O3 -o /dev/stdout
  2. .file ""
  3. .text
  4. .p2align 4,,15
  5. .globl foo
  6. .type foo, @function
  7. foo:
  8. pushl %ebp
  9. movl $1717986919, %edx
  10. movl %esp, %ebp
  11. movl 8(%ebp), %ecx
  12. popl %ebp
  13. movl %ecx, %eax
  14. imull %edx
  15. movl %ecx, %eax
  16. sarl $31, %eax
  17. sarl $2, %edx
  18. subl %eax, %edx
  19. leal (%edx,%edx,4), %eax
  20. addl %eax, %eax
  21. subl %eax, %ecx
  22. leal (%edx,%ecx), %eax
  23. ret
  24. .size foo, .-foo
  25. .ident "GCC: (Ubuntu 4.4.3-4ubuntu5) 4.4.3"
  26. .section .note.GNU-stack,"",@progbits
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement