Skip to content

Instantly share code, notes, and snippets.

@main--
Created January 6, 2015 20:44
Show Gist options
  • Select an option

  • Save main--/59e6b71d21783bad9c36 to your computer and use it in GitHub Desktop.

Select an option

Save main--/59e6b71d21783bad9c36 to your computer and use it in GitHub Desktop.

Revisions

  1. main-- created this gist Jan 6, 2015.
    33 changes: 33 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    $ 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);
    }