Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [small]
  2. Disassembly of section .text:
  3.  
  4. 0000000000000000 <global_func>:
  5. static int static_arr[100] = {9, 7};
  6. int global_arr_big[50000] = {5, 6};
  7. static int static_arr_big[50000] = {10, 20};
  8.  
  9. int global_func(int param)
  10. {
  11.    0:   55                      push   %rbp
  12.    1:   48 89 e5                mov    %rsp,%rbp
  13.    4:   89 7d fc                mov    %edi,-0x4(%rbp)
  14.     return param * 10;
  15.    7:   8b 55 fc                mov    -0x4(%rbp),%edx
  16.    a:   89 d0                   mov    %edx,%eax
  17.    c:   c1 e0 02                shl    $0x2,%eax
  18.    f:   01 d0                   add    %edx,%eax
  19.   11:   01 c0                   add    %eax,%eax
  20. }
  21.   13:   5d                      pop    %rbp
  22.   14:   c3                      retq  
  23.  
  24. 0000000000000015 <main>:
  25.  
  26. int main(int argc, const char* argv[])
  27. {
  28.   15:   55                      push   %rbp
  29.   16:   48 89 e5                mov    %rsp,%rbp
  30.   19:   48 83 ec 20             sub    $0x20,%rsp
  31.   1d:   89 7d ec                mov    %edi,-0x14(%rbp)
  32.   20:   48 89 75 e0             mov    %rsi,-0x20(%rbp)
  33.     int t = global_func(argc);
  34.   24:   8b 45 ec                mov    -0x14(%rbp),%eax
  35.   27:   89 c7                   mov    %eax,%edi
  36.   29:   e8 00 00 00 00          callq  2e <main+0x19>  
  37.   2e:   89 45 fc                mov    %eax,-0x4(%rbp)
  38.     t += global_arr[7];
  39.   31:   8b 05 00 00 00 00       mov    0x0(%rip),%eax        # 37 <main+0x22>
  40.   37:   01 45 fc                add    %eax,-0x4(%rbp)
  41.     t += static_arr[7];
  42.   3a:   8b 05 00 00 00 00       mov    0x0(%rip),%eax        # 40 <main+0x2b>
  43.   40:   01 45 fc                add    %eax,-0x4(%rbp)
  44.     t += global_arr_big[7];
  45.   43:   8b 05 00 00 00 00       mov    0x0(%rip),%eax        # 49 <main+0x34>
  46.   49:   01 45 fc                add    %eax,-0x4(%rbp)
  47.     t += static_arr_big[7];
  48.   4c:   8b 05 00 00 00 00       mov    0x0(%rip),%eax        # 52 <main+0x3d>
  49.   52:   01 45 fc                add    %eax,-0x4(%rbp)
  50.     return t;
  51.   55:   8b 45 fc                mov    -0x4(%rbp),%eax
  52. }
  53.   58:   c9                      leaveq
  54.   59:   c3                      retq
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement