#include <stdio.h>
int main()
{
int a = 11;
printf("%d\n", a / 11);
return 0;
}
#if 0
/*
* intel
*/
0000000000001149 <main>:
1149: f3 0f 1e fa endbr64
114d: 55 push %rbp
114e: 48 89 e5 mov %rsp,%rbp
1151: 48 83 ec 10 sub $0x10,%rsp
1155: c7 45 fc 0b 00 00 00 movl $0xb,-0x4(%rbp) // (rbp-0x4)=0xb
115c: 8b 45 fc mov -0x4(%rbp),%eax // eax=(rbp-0x4)
115f: 48 63 d0 movslq %eax,%rdx // rdx=eax
1162: 48 69 d2 e9 a2 8b 2e imul $0x2e8ba2e9,%rdx,%rdx // 0x2e8ba2e9=780903145, rdx=780903145*11=8589934595=0x200000003
1169: 48 c1 ea 20 shr $0x20,%rdx // rdx = 0x200000003 >> 0x20 = 2
116d: d1 fa sar %edx // edx = 2>>1 = 1
116f: c1 f8 1f sar $0x1f,%eax // eax = 0xb>>0x1f = 0
1172: 29 c2 sub %eax,%edx // edx = edx - eax = 1-0 = 1
1174: 89 d0 mov %edx,%eax // eax=edx
1176: 89 c6 mov %eax,%esi // esi=eax
1178: 48 8d 3d 85 0e 00 00 lea 0xe85(%rip),%rdi # 2004 <_IO_stdin_used+0x4>
117f: b8 00 00 00 00 mov $0x0,%eax
1184: e8 c7 fe ff ff callq 1050 <printf@plt>
1189: b8 00 00 00 00 mov $0x0,%eax
118e: c9 leaveq
118f: c3 retq
1852

被折叠的 条评论
为什么被折叠?



