Skip to content

Instantly share code, notes, and snippets.

@main--
Created January 6, 2015 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save main--/59e6b71d21783bad9c36 to your computer and use it in GitHub Desktop.
Save main--/59e6b71d21783bad9c36 to your computer and use it in GitHub Desktop.
$ clang++-3.5 -O3 -c look_boy_why_you_so_mad.cpp -o lbwysm.o
$ objdump -CdMintel lbwysm.o
lbwysm.o: Dateiformat elf64-x86-64
Disassembly of section .text:
0000000000000000 <findStuff(int)>:
0: 89 f8 mov eax,edi
2: c1 e8 1f shr eax,0x1f
5: 01 f8 add eax,edi
7: 83 e0 fe and eax,0xfffffffe
a: 39 f8 cmp eax,edi
c: 0f 95 c0 setne al
f: c3 ret
$ g++ -O3 -c look_boy_why_you_so_mad.cpp -o lbwysm2.o
$ objdump -CdMintel lbwysm2.o
lbwysm2.o: Dateiformat elf64-x86-64
Disassembly of section .text:
0000000000000000 <findStuff(int)>:
0: 89 f8 mov eax,edi
2: 83 e0 01 and eax,0x1
5: c3 ret
$ cat look_boy_why_you_so_mad.cpp
bool findStuff(int x)
{
return x - ((x / 2) * 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment