Create  Edit  Diff  FrontPage  Index  Search  Changes  Login

はじめてのひき - FizzBuzzAsm_x86-64 Diff

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.

* ! Version

% gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.3-5' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.3 (Debian 4.3.3-5)

* ! Optimized


fizzbuzz.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <main>:
    0: 41 55                 push   %r13
    2: 41 54                 push   %r12
    4: 55                   push   %rbp
    5: 53                   push   %rbx
    6: 48 83 ec 08           sub    $0x8,%rsp
    a: bb 01 00 00 00       mov    $0x1,%ebx
    f: bd 89 88 88 88       mov    $0x88888889,%ebp
   14: 41 bc 67 66 66 66     mov    $0x66666667,%r12d
   1a: 41 bd 56 55 55 55     mov    $0x55555556,%r13d
   20: 89 d8                 mov    %ebx,%eax
   22: f7 ed                 imul   %ebp
   24: 01 da                 add    %ebx,%edx
   26: c1 fa 03             sar    $0x3,%edx
   29: 89 d8                 mov    %ebx,%eax
   2b: c1 f8 1f             sar    $0x1f,%eax
   2e: 29 c2                 sub    %eax,%edx
   30: 89 d0                 mov    %edx,%eax
   32: c1 e0 04             shl    $0x4,%eax
   35: 29 d0                 sub    %edx,%eax
   37: 39 c3                 cmp    %eax,%ebx
   39: 75 0c                 jne    47 <main+0x47>
   3b: bf 00 00 00 00       mov    $0x0,%edi
3c: R_X86_64_32 .rodata.str1.1
   40: e8 00 00 00 00       callq  45 <main+0x45>
41: R_X86_64_PC32 puts+0xfffffffffffffffc
   45: eb 51                 jmp    98 <main+0x98>
   47: 89 d8                 mov    %ebx,%eax
   49: 41 f7 ec             imul   %r12d
   4c: d1 fa                 sar    %edx
   4e: 89 d8                 mov    %ebx,%eax
   50: c1 f8 1f             sar    $0x1f,%eax
   53: 29 c2                 sub    %eax,%edx
   55: 8d 14 92             lea    (%rdx,%rdx,4),%edx
   58: 39 d3                 cmp    %edx,%ebx
   5a: 75 0c                 jne    68 <main+0x68>
   5c: bf 00 00 00 00       mov    $0x0,%edi
5d: R_X86_64_32 .rodata.str1.1+0x9
   61: e8 00 00 00 00       callq  66 <main+0x66>
62: R_X86_64_PC32 puts+0xfffffffffffffffc
   66: eb 30                 jmp    98 <main+0x98>
   68: 89 d8                 mov    %ebx,%eax
   6a: 41 f7 ed             imul   %r13d
   6d: 89 d8                 mov    %ebx,%eax
   6f: c1 f8 1f             sar    $0x1f,%eax
   72: 29 c2                 sub    %eax,%edx
   74: 8d 14 52             lea    (%rdx,%rdx,2),%edx
   77: 39 d3                 cmp    %edx,%ebx
   79: 75 0c                 jne    87 <main+0x87>
   7b: bf 00 00 00 00       mov    $0x0,%edi
7c: R_X86_64_32 .rodata.str1.1+0xe
   80: e8 00 00 00 00       callq  85 <main+0x85>
81: R_X86_64_PC32 puts+0xfffffffffffffffc
   85: eb 11                 jmp    98 <main+0x98>
   87: 89 de                 mov    %ebx,%esi
   89: bf 00 00 00 00       mov    $0x0,%edi
8a: R_X86_64_32 .rodata.str1.1+0x13
   8e: b8 00 00 00 00       mov    $0x0,%eax
   93: e8 00 00 00 00       callq  98 <main+0x98>
94: R_X86_64_PC32 printf+0xfffffffffffffffc
   98: 83 c3 01             add    $0x1,%ebx
   9b: 83 fb 65             cmp    $0x65,%ebx
   9e: 75 80                 jne    20 <main+0x20>
   a0: 48 83 c4 08           add    $0x8,%rsp
   a4: 5b                   pop    %rbx
   a5: 5d                   pop    %rbp
   a6: 41 5c                 pop    %r12
   a8: 41 5d                 pop    %r13
   aa: c3                   retq  

* ! Normal


fizzbuzz.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <main>:
    0: 55                   push   %rbp
    1: 48 89 e5             mov    %rsp,%rbp
    4: 53                   push   %rbx
    5: 48 83 ec 28           sub    $0x28,%rsp
    9: c7 45 f4 01 00 00 00 movl   $0x1,-0xc(%rbp)
   10: e9 e1 00 00 00       jmpq   f6 <main+0xf6>
   15: 8b 4d f4             mov    -0xc(%rbp),%ecx
   18: c7 45 d4 89 88 88 88 movl   $0x88888889,-0x2c(%rbp)
   1f: 8b 45 d4             mov    -0x2c(%rbp),%eax
   22: f7 e9                 imul   %ecx
   24: 8d 04 0a             lea    (%rdx,%rcx,1),%eax
   27: 89 c2                 mov    %eax,%edx
   29: c1 fa 03             sar    $0x3,%edx
   2c: 89 c8                 mov    %ecx,%eax
   2e: c1 f8 1f             sar    $0x1f,%eax
   31: 89 d3                 mov    %edx,%ebx
   33: 29 c3                 sub    %eax,%ebx
   35: 89 5d dc             mov    %ebx,-0x24(%rbp)
   38: 8b 45 dc             mov    -0x24(%rbp),%eax
   3b: c1 e0 04             shl    $0x4,%eax
   3e: 2b 45 dc             sub    -0x24(%rbp),%eax
   41: 89 ca                 mov    %ecx,%edx
   43: 29 c2                 sub    %eax,%edx
   45: 89 55 dc             mov    %edx,-0x24(%rbp)
   48: 83 7d dc 00           cmpl   $0x0,-0x24(%rbp)
   4c: 75 0f                 jne    5d <main+0x5d>
   4e: bf 00 00 00 00       mov    $0x0,%edi
4f: R_X86_64_32 .rodata
   53: e8 00 00 00 00       callq  58 <main+0x58>
54: R_X86_64_PC32 puts+0xfffffffffffffffc
   58: e9 95 00 00 00       jmpq   f2 <main+0xf2>
   5d: 8b 4d f4             mov    -0xc(%rbp),%ecx
   60: c7 45 d4 67 66 66 66 movl   $0x66666667,-0x2c(%rbp)
   67: 8b 45 d4             mov    -0x2c(%rbp),%eax
   6a: f7 e9                 imul   %ecx
   6c: d1 fa                 sar    %edx
   6e: 89 c8                 mov    %ecx,%eax
   70: c1 f8 1f             sar    $0x1f,%eax
   73: 89 d3                 mov    %edx,%ebx
   75: 29 c3                 sub    %eax,%ebx
   77: 89 5d e0             mov    %ebx,-0x20(%rbp)
   7a: 8b 45 e0             mov    -0x20(%rbp),%eax
   7d: c1 e0 02             shl    $0x2,%eax
   80: 03 45 e0             add    -0x20(%rbp),%eax
   83: 89 ca                 mov    %ecx,%edx
   85: 29 c2                 sub    %eax,%edx
   87: 89 55 e0             mov    %edx,-0x20(%rbp)
   8a: 83 7d e0 00           cmpl   $0x0,-0x20(%rbp)
   8e: 75 0c                 jne    9c <main+0x9c>
   90: bf 00 00 00 00       mov    $0x0,%edi
91: R_X86_64_32 .rodata+0x9
   95: e8 00 00 00 00       callq  9a <main+0x9a>
96: R_X86_64_PC32 puts+0xfffffffffffffffc
   9a: eb 56                 jmp    f2 <main+0xf2>
   9c: 8b 5d f4             mov    -0xc(%rbp),%ebx
   9f: 89 5d d0             mov    %ebx,-0x30(%rbp)
   a2: c7 45 d4 56 55 55 55 movl   $0x55555556,-0x2c(%rbp)
   a9: 8b 45 d4             mov    -0x2c(%rbp),%eax
   ac: f7 6d d0             imull  -0x30(%rbp)
   af: 89 d1                 mov    %edx,%ecx
   b1: 8b 45 d0             mov    -0x30(%rbp),%eax
   b4: c1 f8 1f             sar    $0x1f,%eax
   b7: 89 cb                 mov    %ecx,%ebx
   b9: 29 c3                 sub    %eax,%ebx
   bb: 89 5d e4             mov    %ebx,-0x1c(%rbp)
   be: 8b 45 e4             mov    -0x1c(%rbp),%eax
   c1: 01 c0                 add    %eax,%eax
   c3: 03 45 e4             add    -0x1c(%rbp),%eax
   c6: 8b 55 d0             mov    -0x30(%rbp),%edx
   c9: 29 c2                 sub    %eax,%edx
   cb: 89 55 e4             mov    %edx,-0x1c(%rbp)
   ce: 83 7d e4 00           cmpl   $0x0,-0x1c(%rbp)
   d2: 75 0c                 jne    e0 <main+0xe0>
   d4: bf 00 00 00 00       mov    $0x0,%edi
d5: R_X86_64_32 .rodata+0xe
   d9: e8 00 00 00 00       callq  de <main+0xde>
da: R_X86_64_PC32 puts+0xfffffffffffffffc
   de: eb 12                 jmp    f2 <main+0xf2>
   e0: 8b 75 f4             mov    -0xc(%rbp),%esi
   e3: bf 00 00 00 00       mov    $0x0,%edi
e4: R_X86_64_32 .rodata+0x13
   e8: b8 00 00 00 00       mov    $0x0,%eax
   ed: e8 00 00 00 00       callq  f2 <main+0xf2>
ee: R_X86_64_PC32 printf+0xfffffffffffffffc
   f2: 83 45 f4 01           addl   $0x1,-0xc(%rbp)
   f6: 83 7d f4 64           cmpl   $0x64,-0xc(%rbp)
   fa: 0f 8e 15 ff ff ff     jle    15 <main+0x15>
  100: 48 83 c4 28           add    $0x28,%rsp
  104: 5b                   pop    %rbx
  105: c9                   leaveq
  106: c3                   retq