Advertisement
Guest User

Untitled

a guest
Oct 19th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // gcc -S -O0
  2.     .file   "x.cpp"
  3.     .text
  4.     .globl  main
  5.     .type   main, @function
  6. main:
  7. .LFB0:
  8.     .cfi_startproc
  9.     pushq   %rbp
  10.     .cfi_def_cfa_offset 16
  11.     .cfi_offset 6, -16
  12.     movq    %rsp, %rbp
  13.     .cfi_def_cfa_register 6
  14.     movl    $10, -20(%rbp)
  15.     movl    $20, -4(%rbp)
  16.     leaq    -20(%rbp), %rax
  17.     movq    %rax, -16(%rbp)
  18.     movq    -16(%rbp), %rax
  19.     movl    -4(%rbp), %edx
  20.     movl    %edx, (%rax)
  21.     movl    $0, %eax
  22.     popq    %rbp
  23.     .cfi_def_cfa 7, 8
  24.     ret
  25.     .cfi_endproc
  26. .LFE0:
  27.     .size   main, .-main
  28.     .globl  _Z1rv
  29.     .type   _Z1rv, @function
  30. _Z1rv:
  31. .LFB1:
  32.     .cfi_startproc
  33.     pushq   %rbp
  34.     .cfi_def_cfa_offset 16
  35.     .cfi_offset 6, -16
  36.     movq    %rsp, %rbp
  37.     .cfi_def_cfa_register 6
  38.     movl    $0, -20(%rbp)
  39.     movl    $0, -4(%rbp)
  40.     leaq    -20(%rbp), %rax
  41.     movq    %rax, -16(%rbp)
  42.     movq    -16(%rbp), %rax
  43.     movl    -4(%rbp), %edx
  44.     movl    %edx, (%rax)
  45.     nop
  46.     popq    %rbp
  47.     .cfi_def_cfa 7, 8
  48.     ret
  49.     .cfi_endproc
  50. .LFE1:
  51.     .size   _Z1rv, .-_Z1rv
  52.     .ident  "GCC: (SUSE Linux) 6.2.1 20160830 [gcc-6-branch revision 239856]"
  53.     .section    .note.GNU-stack,"",@progbits
  54.  
  55. // source
  56. int main() {
  57.     int a = 10;
  58.     int b = 20;
  59.     int *x = &a;
  60.    *x = b;
  61.  
  62.     return 0;
  63. }
  64.  
  65. void r() {
  66.     int a = 0;
  67.     int b = 0;
  68.     int &c = a;
  69.     c = b;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement