Advertisement
ascendant

disassembled array indexing

Nov 5th, 2012
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     .file   "vectorArrayOp.cpp"
  2.     .section    .text._Z7runTestIPiiE11ReturnValueRT_T0_,"axG",@progbits,_Z7runTestIPiiE11ReturnValueRT_T0_,comdat
  3.     .p2align 4,,15
  4.     .weak   _Z7runTestIPiiE11ReturnValueRT_T0_
  5.     .type   _Z7runTestIPiiE11ReturnValueRT_T0_, @function
  6. _Z7runTestIPiiE11ReturnValueRT_T0_:
  7. .LFB1273:
  8.     .cfi_startproc
  9.     pushq   %rbp
  10.     .cfi_def_cfa_offset 16
  11.     .cfi_offset 6, -16
  12.     movl    %esi, %ebp
  13.     xorl    %esi, %esi
  14.     pushq   %rbx
  15.     .cfi_def_cfa_offset 24
  16.     .cfi_offset 3, -24
  17.     movq    %rdi, %rbx
  18.     subq    $56, %rsp
  19.     .cfi_def_cfa_offset 80
  20.     leaq    16(%rsp), %rdi
  21.     call    gettimeofday
  22.     movq    (%rbx), %rdx
  23.     movl    $65536, %ecx
  24.     xorl    %ebx, %ebx
  25.     .p2align 4,,10
  26.     .p2align 3
  27. .L2:
  28.     xorl    %eax, %eax
  29.     .p2align 4,,10
  30.     .p2align 3
  31. .L3:
  32. #APP
  33. # 23 "vectorArrayOp.cpp" 1
  34.     preassign
  35. # 0 "" 2
  36. #NO_APP
  37.     movl    %ebp, (%rdx,%rax)
  38. #APP
  39. # 25 "vectorArrayOp.cpp" 1
  40.     postassign
  41. # 0 "" 2
  42. #NO_APP
  43.     addq    $4, %rax
  44.     cmpq    $4096, %rax
  45.     jne .L3
  46.     xorw    %ax, %ax
  47.     .p2align 4,,10
  48.     .p2align 3
  49. .L4:
  50. #APP
  51. # 29 "vectorArrayOp.cpp" 1
  52.     preadd
  53. # 0 "" 2
  54. #NO_APP
  55.     addl    (%rdx,%rax), %ebx
  56. #APP
  57. # 31 "vectorArrayOp.cpp" 1
  58.     postadd
  59. # 0 "" 2
  60. #NO_APP
  61.     addq    $4, %rax
  62.     cmpq    $4096, %rax
  63.     jne .L4
  64.     subl    $1, %ecx
  65.     jne .L2
  66.     leaq    32(%rsp), %rdi
  67.     xorl    %esi, %esi
  68.     salq    $32, %rbx
  69.     call    gettimeofday
  70.     movq    32(%rsp), %rax
  71.     subq    16(%rsp), %rax
  72.     cvtsi2sdq   %rax, %xmm0
  73.     movq    40(%rsp), %rax
  74.     subq    24(%rsp), %rax
  75.     cvtsi2sdq   %rax, %xmm1
  76.     divsd   .LC0(%rip), %xmm1
  77.     addsd   %xmm1, %xmm0
  78.     unpcklpd    %xmm0, %xmm0
  79.     cvtpd2ps    %xmm0, %xmm0
  80.     movss   %xmm0, 12(%rsp)
  81.     movl    12(%rsp), %eax
  82.     addq    $56, %rsp
  83.     .cfi_def_cfa_offset 24
  84.     orq %rbx, %rax
  85.     popq    %rbx
  86.     .cfi_def_cfa_offset 16
  87.     popq    %rbp
  88.     .cfi_def_cfa_offset 8
  89.     ret
  90.     .cfi_endproc
  91. .LFE1273:
  92.     .size   _Z7runTestIPiiE11ReturnValueRT_T0_, .-_Z7runTestIPiiE11ReturnValueRT_T0_
  93.     .section    .text._Z7runTestISt6vectorIiSaIiEEiE11ReturnValueRT_T0_,"axG",@progbits,_Z7runTestISt6vectorIiSaIiEEiE11ReturnValueRT_T0_,comdat
  94.     .p2align 4,,15
  95.     .weak   _Z7runTestISt6vectorIiSaIiEEiE11ReturnValueRT_T0_
  96.     .type   _Z7runTestISt6vectorIiSaIiEEiE11ReturnValueRT_T0_, @function
  97. _Z7runTestISt6vectorIiSaIiEEiE11ReturnValueRT_T0_:
  98. .LFB1274:
  99.     .cfi_startproc
  100.     pushq   %rbp
  101.     .cfi_def_cfa_offset 16
  102.     .cfi_offset 6, -16
  103.     movl    %esi, %ebp
  104.     xorl    %esi, %esi
  105.     pushq   %rbx
  106.     .cfi_def_cfa_offset 24
  107.     .cfi_offset 3, -24
  108.     movq    %rdi, %rbx
  109.     subq    $56, %rsp
  110.     .cfi_def_cfa_offset 80
  111.     leaq    16(%rsp), %rdi
  112.     call    gettimeofday
  113.     movq    (%rbx), %rdx
  114.     movl    $65536, %ecx
  115.     xorl    %ebx, %ebx
  116.     .p2align 4,,10
  117.     .p2align 3
  118. .L10:
  119.     xorl    %eax, %eax
  120.     .p2align 4,,10
  121.     .p2align 3
  122. .L11:
  123. #APP
  124. # 23 "vectorArrayOp.cpp" 1
  125.     preassign
  126. # 0 "" 2
  127. #NO_APP
  128.     movl    %ebp, (%rdx,%rax)
  129. #APP
  130. # 25 "vectorArrayOp.cpp" 1
  131.     postassign
  132. # 0 "" 2
  133. #NO_APP
  134.     addq    $4, %rax
  135.     cmpq    $4096, %rax
  136.     jne .L11
  137.     xorw    %ax, %ax
  138.     .p2align 4,,10
  139.     .p2align 3
  140. .L12:
  141. #APP
  142. # 29 "vectorArrayOp.cpp" 1
  143.     preadd
  144. # 0 "" 2
  145. #NO_APP
  146.     addl    (%rdx,%rax), %ebx
  147. #APP
  148. # 31 "vectorArrayOp.cpp" 1
  149.     postadd
  150. # 0 "" 2
  151. #NO_APP
  152.     addq    $4, %rax
  153.     cmpq    $4096, %rax
  154.     jne .L12
  155.     subl    $1, %ecx
  156.     jne .L10
  157.     leaq    32(%rsp), %rdi
  158.     xorl    %esi, %esi
  159.     salq    $32, %rbx
  160.     call    gettimeofday
  161.     movq    32(%rsp), %rax
  162.     subq    16(%rsp), %rax
  163.     cvtsi2sdq   %rax, %xmm0
  164.     movq    40(%rsp), %rax
  165.     subq    24(%rsp), %rax
  166.     cvtsi2sdq   %rax, %xmm1
  167.     divsd   .LC0(%rip), %xmm1
  168.     addsd   %xmm1, %xmm0
  169.     unpcklpd    %xmm0, %xmm0
  170.     cvtpd2ps    %xmm0, %xmm0
  171.     movss   %xmm0, 12(%rsp)
  172.     movl    12(%rsp), %eax
  173.     addq    $56, %rsp
  174.     .cfi_def_cfa_offset 24
  175.     orq %rbx, %rax
  176.     popq    %rbx
  177.     .cfi_def_cfa_offset 16
  178.     popq    %rbp
  179.     .cfi_def_cfa_offset 8
  180.     ret
  181.     .cfi_endproc
  182. .LFE1274:
  183.     .size   _Z7runTestISt6vectorIiSaIiEEiE11ReturnValueRT_T0_, .-_Z7runTestISt6vectorIiSaIiEEiE11ReturnValueRT_T0_
  184.     .section    .rodata.str1.1,"aMS",@progbits,1
  185. .LC1:
  186.     .string "Duration "
  187.     .section    .text.startup,"ax",@progbits
  188.     .p2align 4,,15
  189.     .globl  main
  190.     .type   main, @function
  191. main:
  192. .LFB1259:
  193.     .cfi_startproc
  194.     .cfi_personality 0x3,__gxx_personality_v0
  195.     .cfi_lsda 0x3,.LLSDA1259
  196.     pushq   %rbp
  197.     .cfi_def_cfa_offset 16
  198.     .cfi_offset 6, -16
  199.     movl    $4096, %edi
  200.     pushq   %rbx
  201.     .cfi_def_cfa_offset 24
  202.     .cfi_offset 3, -24
  203.     subq    $72, %rsp
  204.     .cfi_def_cfa_offset 96
  205. .LEHB0:
  206.     call    _Znam
  207.     movl    $4096, %edi
  208.     movq    %rax, 48(%rsp)
  209.     movq    $0, 16(%rsp)
  210.     movq    $0, 24(%rsp)
  211.     movq    $0, 32(%rsp)
  212.     call    _Znwm
  213. .LEHE0:
  214.     movq    %rax, %rdi
  215.     leaq    4096(%rax), %r11
  216.     movq    %rax, 16(%rsp)
  217.     andl    $15, %edi
  218.     movq    %rax, %rdx
  219.     shrq    $2, %rdi
  220.     movq    %r11, 32(%rsp)
  221.     negq    %rdi
  222.     andl    $3, %edi
  223.     je  .L37
  224.     movl    $1024, %esi
  225.     movl    $1025, %r8d
  226.     jmp .L18
  227.     .p2align 4,,10
  228.     .p2align 3
  229. .L38:
  230.     movq    %rcx, %rsi
  231. .L18:
  232.     movq    %r8, %r9
  233.     movl    $0, (%rdx)
  234.     addq    $4, %rdx
  235.     subq    %rsi, %r9
  236.     leaq    -1(%rsi), %rcx
  237.     cmpq    %r9, %rdi
  238.     ja  .L38
  239. .L17:
  240.     movl    $1024, %r10d
  241.     subq    %rdi, %r10
  242.     movq    %r10, %r8
  243.     shrq    $2, %r8
  244.     leaq    0(,%r8,4), %r9
  245.     testq   %r9, %r9
  246.     je  .L40
  247.     pxor    %xmm0, %xmm0
  248.     leaq    (%rax,%rdi,4), %rsi
  249.     xorl    %eax, %eax
  250.     .p2align 4,,10
  251.     .p2align 3
  252. .L20:
  253.     addq    $1, %rax
  254.     movdqa  %xmm0, (%rsi)
  255.     addq    $16, %rsi
  256.     cmpq    %r8, %rax
  257.     jb  .L20
  258.     subq    %r9, %rcx
  259.     cmpq    %r9, %r10
  260.     leaq    (%rdx,%r9,4), %rdx
  261.     je  .L21
  262.     .p2align 4,,10
  263.     .p2align 3
  264. .L40:
  265.     movl    $0, (%rdx)
  266.     addq    $4, %rdx
  267.     subq    $1, %rcx
  268.     jne .L40
  269. .L21:
  270.     leaq    48(%rsp), %rdi
  271.     movl    $1, %esi
  272.     movq    %r11, 24(%rsp)
  273.     call    _Z7runTestIPiiE11ReturnValueRT_T0_
  274.     leaq    16(%rsp), %rdi
  275.     movl    $1, %esi
  276.     movq    %rax, %rbp
  277.     call    _Z7runTestISt6vectorIiSaIiEEiE11ReturnValueRT_T0_
  278.     movl    $.LC1, %esi
  279.     movl    $_ZSt4cout, %edi
  280.     movq    %rax, %rbx
  281.     movl    %ebp, 12(%rsp)
  282. .LEHB1:
  283.     call    _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
  284.     movss   12(%rsp), %xmm0
  285.     movq    %rax, %rdi
  286.     cvtps2pd    %xmm0, %xmm0
  287.     call    _ZNSo9_M_insertIdEERSoT_
  288.     movq    %rax, %rdi
  289.     call    _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
  290.     movl    $.LC1, %esi
  291.     movl    $_ZSt4cout, %edi
  292.     movl    %ebx, 12(%rsp)
  293.     call    _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
  294.     movss   12(%rsp), %xmm0
  295.     movq    %rax, %rdi
  296.     cvtps2pd    %xmm0, %xmm0
  297.     call    _ZNSo9_M_insertIdEERSoT_
  298.     movq    %rax, %rdi
  299.     call    _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
  300. .LEHE1:
  301.     movq    48(%rsp), %rdi
  302.     testq   %rdi, %rdi
  303.     je  .L25
  304.     call    _ZdaPv
  305. .L25:
  306.     movq    16(%rsp), %rdi
  307.     testq   %rdi, %rdi
  308.     je  .L30
  309.     call    _ZdlPv
  310. .L30:
  311.     addq    $72, %rsp
  312.     .cfi_remember_state
  313.     .cfi_def_cfa_offset 24
  314.     xorl    %eax, %eax
  315.     popq    %rbx
  316.     .cfi_def_cfa_offset 16
  317.     popq    %rbp
  318.     .cfi_def_cfa_offset 8
  319.     ret
  320. .L37:
  321.     .cfi_restore_state
  322.     movl    $1024, %ecx
  323.     jmp .L17
  324. .L39:
  325.     movq    16(%rsp), %rdi
  326.     movq    %rax, %rbx
  327.     testq   %rdi, %rdi
  328.     je  .L36
  329.     call    _ZdlPv
  330. .L36:
  331.     movq    %rbx, %rdi
  332. .LEHB2:
  333.     call    _Unwind_Resume
  334. .LEHE2:
  335.     .cfi_endproc
  336. .LFE1259:
  337.     .globl  __gxx_personality_v0
  338.     .section    .gcc_except_table,"a",@progbits
  339. .LLSDA1259:
  340.     .byte   0xff
  341.     .byte   0xff
  342.     .byte   0x1
  343.     .uleb128 .LLSDACSE1259-.LLSDACSB1259
  344. .LLSDACSB1259:
  345.     .uleb128 .LEHB0-.LFB1259
  346.     .uleb128 .LEHE0-.LEHB0
  347.     .uleb128 0
  348.     .uleb128 0
  349.     .uleb128 .LEHB1-.LFB1259
  350.     .uleb128 .LEHE1-.LEHB1
  351.     .uleb128 .L39-.LFB1259
  352.     .uleb128 0
  353.     .uleb128 .LEHB2-.LFB1259
  354.     .uleb128 .LEHE2-.LEHB2
  355.     .uleb128 0
  356.     .uleb128 0
  357. .LLSDACSE1259:
  358.     .section    .text.startup
  359.     .size   main, .-main
  360.     .p2align 4,,15
  361.     .type   _GLOBAL__sub_I_main, @function
  362. _GLOBAL__sub_I_main:
  363. .LFB1330:
  364.     .cfi_startproc
  365.     subq    $8, %rsp
  366.     .cfi_def_cfa_offset 16
  367.     movl    $_ZStL8__ioinit, %edi
  368.     call    _ZNSt8ios_base4InitC1Ev
  369.     movl    $__dso_handle, %edx
  370.     movl    $_ZStL8__ioinit, %esi
  371.     movl    $_ZNSt8ios_base4InitD1Ev, %edi
  372.     addq    $8, %rsp
  373.     .cfi_def_cfa_offset 8
  374.     jmp __cxa_atexit
  375.     .cfi_endproc
  376. .LFE1330:
  377.     .size   _GLOBAL__sub_I_main, .-_GLOBAL__sub_I_main
  378.     .section    .ctors,"aw",@progbits
  379.     .align 8
  380.     .quad   _GLOBAL__sub_I_main
  381.     .local  _ZStL8__ioinit
  382.     .comm   _ZStL8__ioinit,1,1
  383.     .weakref    _ZL20__gthrw_pthread_oncePiPFvvE,pthread_once
  384.     .weakref    _ZL27__gthrw_pthread_getspecificj,pthread_getspecific
  385.     .weakref    _ZL27__gthrw_pthread_setspecificjPKv,pthread_setspecific
  386.     .weakref    _ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_,pthread_create
  387.     .weakref    _ZL20__gthrw_pthread_joinmPPv,pthread_join
  388.     .weakref    _ZL21__gthrw_pthread_equalmm,pthread_equal
  389.     .weakref    _ZL20__gthrw_pthread_selfv,pthread_self
  390.     .weakref    _ZL22__gthrw_pthread_detachm,pthread_detach
  391.     .weakref    _ZL22__gthrw_pthread_cancelm,pthread_cancel
  392.     .weakref    _ZL19__gthrw_sched_yieldv,sched_yield
  393.     .weakref    _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t,pthread_mutex_lock
  394.     .weakref    _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t,pthread_mutex_trylock
  395.     .weakref    _ZL31__gthrw_pthread_mutex_timedlockP15pthread_mutex_tPK8timespec,pthread_mutex_timedlock
  396.     .weakref    _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t,pthread_mutex_unlock
  397.     .weakref    _ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t,pthread_mutex_init
  398.     .weakref    _ZL29__gthrw_pthread_mutex_destroyP15pthread_mutex_t,pthread_mutex_destroy
  399.     .weakref    _ZL30__gthrw_pthread_cond_broadcastP14pthread_cond_t,pthread_cond_broadcast
  400.     .weakref    _ZL27__gthrw_pthread_cond_signalP14pthread_cond_t,pthread_cond_signal
  401.     .weakref    _ZL25__gthrw_pthread_cond_waitP14pthread_cond_tP15pthread_mutex_t,pthread_cond_wait
  402.     .weakref    _ZL30__gthrw_pthread_cond_timedwaitP14pthread_cond_tP15pthread_mutex_tPK8timespec,pthread_cond_timedwait
  403.     .weakref    _ZL28__gthrw_pthread_cond_destroyP14pthread_cond_t,pthread_cond_destroy
  404.     .weakref    _ZL26__gthrw_pthread_key_createPjPFvPvE,pthread_key_create
  405.     .weakref    _ZL26__gthrw_pthread_key_deletej,pthread_key_delete
  406.     .weakref    _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t,pthread_mutexattr_init
  407.     .weakref    _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti,pthread_mutexattr_settype
  408.     .weakref    _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t,pthread_mutexattr_destroy
  409.     .section    .rodata.cst8,"aM",@progbits,8
  410.     .align 8
  411. .LC0:
  412.     .long   0
  413.     .long   1093567616
  414.     .ident  "GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3"
  415.     .section    .note.GNU-stack,"",@progbits
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement