Disassembly of section .text: 0000000000400410
: #include #include int main(int argc, char **argv) { 400410: 53 push %rbx 400411: 66 0f 57 c9 xorpd %xmm1,%xmm1 for (int i = 0; i < 10000; i++) { 400415: 31 db xor %ebx,%ebx #include #include int main(int argc, char **argv) { 400417: 48 83 ec 50 sub $0x50,%rsp 40041b: 66 0f 28 e9 movapd %xmm1,%xmm5 40041f: 66 0f 28 c1 movapd %xmm1,%xmm0 400423: f2 0f 10 25 3d 03 00 movsd 0x33d(%rip),%xmm4 # 400768 <_IO_stdin_used+0x48> 40042a: 00 40042b: f2 0f 10 15 4d 03 00 movsd 0x34d(%rip),%xmm2 # 400780 <_IO_stdin_used+0x60> 400432: 00 400433: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) for (int i = 0; i < 10000; i++) { double y = (double)i / 5; printf("==== %d/5 = %f ====\n"); 400438: bf 24 07 40 00 mov $0x400724,%edi 40043d: 31 c0 xor %eax,%eax 40043f: f2 0f 11 14 24 movsd %xmm2,(%rsp) 400444: f2 0f 11 64 24 10 movsd %xmm4,0x10(%rsp) #include #include int main(int argc, char **argv) { for (int i = 0; i < 10000; i++) { 40044a: 83 c3 01 add $0x1,%ebx double y = (double)i / 5; printf("==== %d/5 = %f ====\n"); 40044d: f2 0f 11 4c 24 20 movsd %xmm1,0x20(%rsp) 400453: f2 0f 11 6c 24 30 movsd %xmm5,0x30(%rsp) 400459: f2 0f 11 44 24 40 movsd %xmm0,0x40(%rsp) 40045f: e8 7c ff ff ff callq 4003e0 printf("ceil : %f", ceil(y)); 400464: f2 0f 10 44 24 40 movsd 0x40(%rsp),%xmm0 40046a: bf 39 07 40 00 mov $0x400739,%edi 40046f: b8 01 00 00 00 mov $0x1,%eax 400474: e8 67 ff ff ff callq 4003e0 printf(" floor : %f", floor(y)); 400479: f2 0f 10 6c 24 30 movsd 0x30(%rsp),%xmm5 40047f: bf 43 07 40 00 mov $0x400743,%edi 400484: b8 01 00 00 00 mov $0x1,%eax 400489: 66 0f 28 c5 movapd %xmm5,%xmm0 40048d: e8 4e ff ff ff callq 4003e0 printf(" round : %f\n", round(y)); 400492: f2 0f 10 4c 24 20 movsd 0x20(%rsp),%xmm1 400498: bf 4f 07 40 00 mov $0x40074f,%edi 40049d: b8 01 00 00 00 mov $0x1,%eax 4004a2: 66 0f 28 c1 movapd %xmm1,%xmm0 4004a6: e8 35 ff ff ff callq 4003e0 #include #include int main(int argc, char **argv) { for (int i = 0; i < 10000; i++) { 4004ab: 81 fb 10 27 00 00 cmp $0x2710,%ebx 4004b1: f2 0f 10 14 24 movsd (%rsp),%xmm2 4004b6: f2 0f 10 64 24 10 movsd 0x10(%rsp),%xmm4 4004bc: 0f 84 b6 00 00 00 je 400578 4004c2: f2 0f 2a cb cvtsi2sd %ebx,%xmm1 4004c6: f2 0f 59 0d 92 02 00 mulsd 0x292(%rip),%xmm1 # 400760 <_IO_stdin_used+0x40> 4004cd: 00 #include #include int main(int argc, char **argv) { 4004ce: 66 0f 28 d9 movapd %xmm1,%xmm3 4004d2: 66 0f 28 c1 movapd %xmm1,%xmm0 4004d6: 66 0f 54 da andpd %xmm2,%xmm3 4004da: 66 0f 2e e3 ucomisd %xmm3,%xmm4 4004de: 76 23 jbe 400503 4004e0: f2 48 0f 2c c1 cvttsd2si %xmm1,%rax 4004e5: 66 0f 28 e9 movapd %xmm1,%xmm5 4004e9: f2 0f 10 05 7f 02 00 movsd 0x27f(%rip),%xmm0 # 400770 <_IO_stdin_used+0x50> 4004f0: 00 4004f1: f2 48 0f 2a d8 cvtsi2sd %rax,%xmm3 4004f6: f2 0f c2 eb 06 cmpnlesd %xmm3,%xmm5 4004fb: 66 0f 54 c5 andpd %xmm5,%xmm0 4004ff: f2 0f 58 c3 addsd %xmm3,%xmm0 400503: 66 0f 28 d9 movapd %xmm1,%xmm3 400507: 66 0f 28 e9 movapd %xmm1,%xmm5 40050b: 66 0f 54 da andpd %xmm2,%xmm3 40050f: 66 0f 2e e3 ucomisd %xmm3,%xmm4 400513: 76 27 jbe 40053c 400515: f2 48 0f 2c c1 cvttsd2si %xmm1,%rax 40051a: f2 0f 10 35 4e 02 00 movsd 0x24e(%rip),%xmm6 # 400770 <_IO_stdin_used+0x50> 400521: 00 400522: f2 48 0f 2a d8 cvtsi2sd %rax,%xmm3 400527: 66 0f 28 eb movapd %xmm3,%xmm5 40052b: f2 0f c2 e9 06 cmpnlesd %xmm1,%xmm5 400530: 66 0f 54 ee andpd %xmm6,%xmm5 400534: f2 0f 5c dd subsd %xmm5,%xmm3 400538: 66 0f 28 eb movapd %xmm3,%xmm5 40053c: 66 0f 28 d9 movapd %xmm1,%xmm3 400540: 66 0f 54 da andpd %xmm2,%xmm3 400544: 66 0f 2e e3 ucomisd %xmm3,%xmm4 400548: 0f 86 ea fe ff ff jbe 400438 40054e: f2 0f 58 1d 22 02 00 addsd 0x222(%rip),%xmm3 # 400778 <_IO_stdin_used+0x58> 400555: 00 400556: 66 0f 28 f2 movapd %xmm2,%xmm6 40055a: 66 0f 55 f1 andnpd %xmm1,%xmm6 40055e: 66 0f 28 ce movapd %xmm6,%xmm1 400562: f2 48 0f 2c c3 cvttsd2si %xmm3,%rax 400567: f2 48 0f 2a d8 cvtsi2sd %rax,%xmm3 40056c: 66 0f 56 cb orpd %xmm3,%xmm1 400570: e9 c3 fe ff ff jmpq 400438 400575: 0f 1f 00 nopl (%rax) printf("ceil : %f", ceil(y)); printf(" floor : %f", floor(y)); printf(" round : %f\n", round(y)); } return 0; } 400578: 48 83 c4 50 add $0x50,%rsp 40057c: 31 c0 xor %eax,%eax 40057e: 5b pop %rbx 40057f: c3 retq