Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 KB | None | 0 0
  1. Disassembly of section .text:
  2.  
  3. 0000000000400410 <main>:
  4. #include <math.h>
  5. #include <stdio.h>
  6.  
  7. int main(int argc, char **argv) {
  8. 400410: 53 push %rbx
  9. 400411: 66 0f 57 c9 xorpd %xmm1,%xmm1
  10. for (int i = 0; i < 10000; i++) {
  11. 400415: 31 db xor %ebx,%ebx
  12. #include <math.h>
  13. #include <stdio.h>
  14.  
  15. int main(int argc, char **argv) {
  16. 400417: 48 83 ec 50 sub $0x50,%rsp
  17. 40041b: 66 0f 28 e9 movapd %xmm1,%xmm5
  18. 40041f: 66 0f 28 c1 movapd %xmm1,%xmm0
  19. 400423: f2 0f 10 25 3d 03 00 movsd 0x33d(%rip),%xmm4 # 400768 <_IO_stdin_used+0x48>
  20. 40042a: 00
  21. 40042b: f2 0f 10 15 4d 03 00 movsd 0x34d(%rip),%xmm2 # 400780 <_IO_stdin_used+0x60>
  22. 400432: 00
  23. 400433: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
  24. for (int i = 0; i < 10000; i++) {
  25. double y = (double)i / 5;
  26. printf("==== %d/5 = %f ====\n");
  27. 400438: bf 24 07 40 00 mov $0x400724,%edi
  28. 40043d: 31 c0 xor %eax,%eax
  29. 40043f: f2 0f 11 14 24 movsd %xmm2,(%rsp)
  30. 400444: f2 0f 11 64 24 10 movsd %xmm4,0x10(%rsp)
  31. #include <math.h>
  32. #include <stdio.h>
  33.  
  34. int main(int argc, char **argv) {
  35. for (int i = 0; i < 10000; i++) {
  36. 40044a: 83 c3 01 add $0x1,%ebx
  37. double y = (double)i / 5;
  38. printf("==== %d/5 = %f ====\n");
  39. 40044d: f2 0f 11 4c 24 20 movsd %xmm1,0x20(%rsp)
  40. 400453: f2 0f 11 6c 24 30 movsd %xmm5,0x30(%rsp)
  41. 400459: f2 0f 11 44 24 40 movsd %xmm0,0x40(%rsp)
  42. 40045f: e8 7c ff ff ff callq 4003e0 <printf@plt>
  43. printf("ceil : %f", ceil(y));
  44. 400464: f2 0f 10 44 24 40 movsd 0x40(%rsp),%xmm0
  45. 40046a: bf 39 07 40 00 mov $0x400739,%edi
  46. 40046f: b8 01 00 00 00 mov $0x1,%eax
  47. 400474: e8 67 ff ff ff callq 4003e0 <printf@plt>
  48. printf(" floor : %f", floor(y));
  49. 400479: f2 0f 10 6c 24 30 movsd 0x30(%rsp),%xmm5
  50. 40047f: bf 43 07 40 00 mov $0x400743,%edi
  51. 400484: b8 01 00 00 00 mov $0x1,%eax
  52. 400489: 66 0f 28 c5 movapd %xmm5,%xmm0
  53. 40048d: e8 4e ff ff ff callq 4003e0 <printf@plt>
  54. printf(" round : %f\n", round(y));
  55. 400492: f2 0f 10 4c 24 20 movsd 0x20(%rsp),%xmm1
  56. 400498: bf 4f 07 40 00 mov $0x40074f,%edi
  57. 40049d: b8 01 00 00 00 mov $0x1,%eax
  58. 4004a2: 66 0f 28 c1 movapd %xmm1,%xmm0
  59. 4004a6: e8 35 ff ff ff callq 4003e0 <printf@plt>
  60. #include <math.h>
  61. #include <stdio.h>
  62.  
  63. int main(int argc, char **argv) {
  64. for (int i = 0; i < 10000; i++) {
  65. 4004ab: 81 fb 10 27 00 00 cmp $0x2710,%ebx
  66. 4004b1: f2 0f 10 14 24 movsd (%rsp),%xmm2
  67. 4004b6: f2 0f 10 64 24 10 movsd 0x10(%rsp),%xmm4
  68. 4004bc: 0f 84 b6 00 00 00 je 400578 <main+0x168>
  69. 4004c2: f2 0f 2a cb cvtsi2sd %ebx,%xmm1
  70. 4004c6: f2 0f 59 0d 92 02 00 mulsd 0x292(%rip),%xmm1 # 400760 <_IO_stdin_used+0x40>
  71. 4004cd: 00
  72. #include <math.h>
  73. #include <stdio.h>
  74.  
  75. int main(int argc, char **argv) {
  76. 4004ce: 66 0f 28 d9 movapd %xmm1,%xmm3
  77. 4004d2: 66 0f 28 c1 movapd %xmm1,%xmm0
  78. 4004d6: 66 0f 54 da andpd %xmm2,%xmm3
  79. 4004da: 66 0f 2e e3 ucomisd %xmm3,%xmm4
  80. 4004de: 76 23 jbe 400503 <main+0xf3>
  81. 4004e0: f2 48 0f 2c c1 cvttsd2si %xmm1,%rax
  82. 4004e5: 66 0f 28 e9 movapd %xmm1,%xmm5
  83. 4004e9: f2 0f 10 05 7f 02 00 movsd 0x27f(%rip),%xmm0 # 400770 <_IO_stdin_used+0x50>
  84. 4004f0: 00
  85. 4004f1: f2 48 0f 2a d8 cvtsi2sd %rax,%xmm3
  86. 4004f6: f2 0f c2 eb 06 cmpnlesd %xmm3,%xmm5
  87. 4004fb: 66 0f 54 c5 andpd %xmm5,%xmm0
  88. 4004ff: f2 0f 58 c3 addsd %xmm3,%xmm0
  89. 400503: 66 0f 28 d9 movapd %xmm1,%xmm3
  90. 400507: 66 0f 28 e9 movapd %xmm1,%xmm5
  91. 40050b: 66 0f 54 da andpd %xmm2,%xmm3
  92. 40050f: 66 0f 2e e3 ucomisd %xmm3,%xmm4
  93. 400513: 76 27 jbe 40053c <main+0x12c>
  94. 400515: f2 48 0f 2c c1 cvttsd2si %xmm1,%rax
  95. 40051a: f2 0f 10 35 4e 02 00 movsd 0x24e(%rip),%xmm6 # 400770 <_IO_stdin_used+0x50>
  96. 400521: 00
  97. 400522: f2 48 0f 2a d8 cvtsi2sd %rax,%xmm3
  98. 400527: 66 0f 28 eb movapd %xmm3,%xmm5
  99. 40052b: f2 0f c2 e9 06 cmpnlesd %xmm1,%xmm5
  100. 400530: 66 0f 54 ee andpd %xmm6,%xmm5
  101. 400534: f2 0f 5c dd subsd %xmm5,%xmm3
  102. 400538: 66 0f 28 eb movapd %xmm3,%xmm5
  103. 40053c: 66 0f 28 d9 movapd %xmm1,%xmm3
  104. 400540: 66 0f 54 da andpd %xmm2,%xmm3
  105. 400544: 66 0f 2e e3 ucomisd %xmm3,%xmm4
  106. 400548: 0f 86 ea fe ff ff jbe 400438 <main+0x28>
  107. 40054e: f2 0f 58 1d 22 02 00 addsd 0x222(%rip),%xmm3 # 400778 <_IO_stdin_used+0x58>
  108. 400555: 00
  109. 400556: 66 0f 28 f2 movapd %xmm2,%xmm6
  110. 40055a: 66 0f 55 f1 andnpd %xmm1,%xmm6
  111. 40055e: 66 0f 28 ce movapd %xmm6,%xmm1
  112. 400562: f2 48 0f 2c c3 cvttsd2si %xmm3,%rax
  113. 400567: f2 48 0f 2a d8 cvtsi2sd %rax,%xmm3
  114. 40056c: 66 0f 56 cb orpd %xmm3,%xmm1
  115. 400570: e9 c3 fe ff ff jmpq 400438 <main+0x28>
  116. 400575: 0f 1f 00 nopl (%rax)
  117. printf("ceil : %f", ceil(y));
  118. printf(" floor : %f", floor(y));
  119. printf(" round : %f\n", round(y));
  120. }
  121. return 0;
  122. }
  123. 400578: 48 83 c4 50 add $0x50,%rsp
  124. 40057c: 31 c0 xor %eax,%eax
  125. 40057e: 5b pop %rbx
  126. 40057f: c3 retq
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement