Skip to content

Instantly share code, notes, and snippets.

@fefe982
Created March 2, 2015 02:57
Show Gist options
  • Save fefe982/0eee323731d478cfc35c to your computer and use it in GitHub Desktop.
Save fefe982/0eee323731d478cfc35c to your computer and use it in GitHub Desktop.
test.s
.file "test.cpp"
.section .text.unlikely._ZN5TimerD2Ev,"axG",@progbits,_ZN5TimerD5Ev,comdat
.align 2
.LCOLDB0:
.section .text._ZN5TimerD2Ev,"axG",@progbits,_ZN5TimerD5Ev,comdat
.LHOTB0:
.align 2
.p2align 4,,15
.weak _ZN5TimerD2Ev
.type _ZN5TimerD2Ev, @function
_ZN5TimerD2Ev:
.LFB2009:
.cfi_startproc
rep ret
.cfi_endproc
.LFE2009:
.size _ZN5TimerD2Ev, .-_ZN5TimerD2Ev
.section .text.unlikely._ZN5TimerD2Ev,"axG",@progbits,_ZN5TimerD5Ev,comdat
.LCOLDE0:
.section .text._ZN5TimerD2Ev,"axG",@progbits,_ZN5TimerD5Ev,comdat
.LHOTE0:
.weak _ZN5TimerD1Ev
.set _ZN5TimerD1Ev,_ZN5TimerD2Ev
.section .text.unlikely._ZN5TimerD0Ev,"axG",@progbits,_ZN5TimerD5Ev,comdat
.align 2
.LCOLDB1:
.section .text._ZN5TimerD0Ev,"axG",@progbits,_ZN5TimerD5Ev,comdat
.LHOTB1:
.align 2
.p2align 4,,15
.weak _ZN5TimerD0Ev
.type _ZN5TimerD0Ev, @function
_ZN5TimerD0Ev:
.LFB2011:
.cfi_startproc
jmp _ZdlPv
.cfi_endproc
.LFE2011:
.size _ZN5TimerD0Ev, .-_ZN5TimerD0Ev
.section .text.unlikely._ZN5TimerD0Ev,"axG",@progbits,_ZN5TimerD5Ev,comdat
.LCOLDE1:
.section .text._ZN5TimerD0Ev,"axG",@progbits,_ZN5TimerD5Ev,comdat
.LHOTE1:
.section .text.unlikely,"ax",@progbits
.align 2
.LCOLDB2:
.text
.LHOTB2:
.align 2
.p2align 4,,15
.type _ZNSs4_Rep10_M_disposeERKSaIcE.part.1, @function
_ZNSs4_Rep10_M_disposeERKSaIcE.part.1:
.LFB5699:
.cfi_startproc
movl $_ZL28__gthrw___pthread_key_createPjPFvPvE, %eax
testq %rax, %rax
je .L4
movl $-1, %eax
lock xaddl %eax, 16(%rdi)
.L5:
testl %eax, %eax
jle .L8
rep ret
.L4:
movl 16(%rdi), %eax
leal -1(%rax), %edx
movl %edx, 16(%rdi)
jmp .L5
.L8:
jmp _ZNSs4_Rep10_M_destroyERKSaIcE
.cfi_endproc
.LFE5699:
.size _ZNSs4_Rep10_M_disposeERKSaIcE.part.1, .-_ZNSs4_Rep10_M_disposeERKSaIcE.part.1
.section .text.unlikely
.LCOLDE2:
.text
.LHOTE2:
.section .rodata.str1.1,"aMS",@progbits,1
.LC4:
.string "== took:"
.LC5:
.string ".compare took:"
.LC6:
.string "strcmp took:"
.section .text.unlikely
.LCOLDB7:
.section .text.startup,"ax",@progbits
.LHOTB7:
.p2align 4,,15
.globl main
.type main, @function
main:
.LFB5372:
.cfi_startproc
.cfi_personality 0x3,__gxx_personality_v0
.cfi_lsda 0x3,.LLSDA5372
pushq %r14
.cfi_def_cfa_offset 16
.cfi_offset 14, -16
pushq %r13
.cfi_def_cfa_offset 24
.cfi_offset 13, -24
xorl %edi, %edi
pushq %r12
.cfi_def_cfa_offset 32
.cfi_offset 12, -32
pushq %rbp
.cfi_def_cfa_offset 40
.cfi_offset 6, -40
pushq %rbx
.cfi_def_cfa_offset 48
.cfi_offset 3, -48
subq $80, %rsp
.cfi_def_cfa_offset 128
movq %fs:40, %rax
movq %rax, 72(%rsp)
xorl %eax, %eax
call time
movl %eax, %edi
call srand
call random
movq %rax, %rcx
movslq len(%rip), %rsi
leaq 16(%rsp), %rdi
sarq $63, %rcx
shrq $57, %rcx
leaq (%rax,%rcx), %rdx
andl $127, %edx
subq %rcx, %rdx
leaq 48(%rsp), %rcx
.LEHB0:
call _ZNSsC1EmcRKSaIcE
.LEHE0:
call random
movq %rax, %rcx
movslq len(%rip), %rsi
leaq 32(%rsp), %rdi
sarq $63, %rcx
shrq $57, %rcx
leaq (%rax,%rcx), %rdx
andl $127, %edx
subq %rcx, %rdx
leaq 48(%rsp), %rcx
.LEHB1:
call _ZNSsC1EmcRKSaIcE
.LEHE1:
call _ZNSt6chrono3_V212steady_clock3nowEv
movq %rax, 56(%rsp)
call _ZNSt6chrono3_V212steady_clock3nowEv
movq %rax, 64(%rsp)
call _ZNSt6chrono3_V212steady_clock3nowEv
movq itr(%rip), %rbp
movq %rax, %r12
movq %rax, 56(%rsp)
testq %rbp, %rbp
je .L25
movq 16(%rsp), %rdi
movq 32(%rsp), %rsi
xorl %ebx, %ebx
movq -24(%rsi), %rdx
cmpq -24(%rdi), %rdx
je .L53
.L10:
call _ZNSt6chrono3_V212steady_clock3nowEv
pxor %xmm0, %xmm0
movq %rax, 64(%rsp)
subq %r12, %rax
movl $.LC4, %esi
movl $_ZSt4cout, %edi
cvtsi2sdq %rax, %xmm0
divsd .LC3(%rip), %xmm0
movsd %xmm0, 8(%rsp)
.LEHB2:
call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
movsd 8(%rsp), %xmm0
movq %rax, %rdi
call _ZNSo9_M_insertIdEERSoT_
movq %rax, %rdi
call _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
call _ZNSt6chrono3_V212steady_clock3nowEv
movq itr(%rip), %r12
movq %rax, %r13
movq %rax, 56(%rsp)
testq %r12, %r12
je .L14
movq 16(%rsp), %rdi
movq 32(%rsp), %rsi
movq -24(%rdi), %rbp
movq -24(%rsi), %r14
movq %rbp, %rdx
cmpq %rbp, %r14
cmovbe %r14, %rdx
subq %r14, %rbp
call memcmp
movl $2147483648, %edx
addq %rbp, %rdx
testl %eax, %eax
jne .L14
testl %ebp, %ebp
jne .L14
movl $4294967295, %eax
subq $1, %r12
cmpq %rax, %rdx
cmovbe %r12, %rbx
.L14:
call _ZNSt6chrono3_V212steady_clock3nowEv
pxor %xmm0, %xmm0
movq %rax, 64(%rsp)
subq %r13, %rax
movl $.LC5, %esi
movl $_ZSt4cout, %edi
cvtsi2sdq %rax, %xmm0
divsd .LC3(%rip), %xmm0
movsd %xmm0, 8(%rsp)
call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
movsd 8(%rsp), %xmm0
movq %rax, %rdi
call _ZNSo9_M_insertIdEERSoT_
movq %rax, %rdi
call _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
call _ZNSt6chrono3_V212steady_clock3nowEv
movq itr(%rip), %rbp
movq %rax, %r12
movq %rax, 56(%rsp)
testq %rbp, %rbp
je .L16
movq 32(%rsp), %rsi
movq 16(%rsp), %rdi
subq $1, %rbp
call strcmp
testl %eax, %eax
cmovne %rbp, %rbx
.L16:
call _ZNSt6chrono3_V212steady_clock3nowEv
pxor %xmm0, %xmm0
movq %rax, 64(%rsp)
subq %r12, %rax
movl $.LC6, %esi
movl $_ZSt4cout, %edi
cvtsi2sdq %rax, %xmm0
divsd .LC3(%rip), %xmm0
movsd %xmm0, 8(%rsp)
call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
movsd 8(%rsp), %xmm0
movq %rax, %rdi
call _ZNSo9_M_insertIdEERSoT_
movq %rax, %rdi
call _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.LEHE2:
movl %ebx, %eax
movq 32(%rsp), %rbx
leaq -24(%rbx), %rdi
cmpq $_ZNSs4_Rep20_S_empty_rep_storageE, %rdi
jne .L54
.L18:
movq 16(%rsp), %rbx
leaq -24(%rbx), %rdi
cmpq $_ZNSs4_Rep20_S_empty_rep_storageE, %rdi
jne .L55
.L19:
movq 72(%rsp), %rbx
xorq %fs:40, %rbx
jne .L56
addq $80, %rsp
.cfi_remember_state
.cfi_def_cfa_offset 48
popq %rbx
.cfi_def_cfa_offset 40
popq %rbp
.cfi_def_cfa_offset 32
popq %r12
.cfi_def_cfa_offset 24
popq %r13
.cfi_def_cfa_offset 16
popq %r14
.cfi_def_cfa_offset 8
ret
.L53:
.cfi_restore_state
call memcmp
xorl %edx, %edx
.p2align 4,,10
.p2align 3
.L13:
testl %eax, %eax
cmove %rdx, %rbx
addq $1, %rdx
cmpq %rbp, %rdx
jne .L13
jmp .L10
.L55:
leaq 48(%rsp), %rsi
movl %eax, 8(%rsp)
call _ZNSs4_Rep10_M_disposeERKSaIcE.part.1
movl 8(%rsp), %eax
jmp .L19
.L54:
leaq 48(%rsp), %rsi
movl %eax, 8(%rsp)
call _ZNSs4_Rep10_M_disposeERKSaIcE.part.1
movl 8(%rsp), %eax
jmp .L18
.L25:
xorl %ebx, %ebx
jmp .L10
.L28:
movq %rax, %rbx
movq 32(%rsp), %rax
leaq -24(%rax), %rdi
cmpq $_ZNSs4_Rep20_S_empty_rep_storageE, %rdi
je .L22
leaq 48(%rsp), %rsi
call _ZNSs4_Rep10_M_disposeERKSaIcE.part.1
.L22:
movq 16(%rsp), %rax
leaq -24(%rax), %rdi
cmpq $_ZNSs4_Rep20_S_empty_rep_storageE, %rdi
je .L23
leaq 48(%rsp), %rsi
call _ZNSs4_Rep10_M_disposeERKSaIcE.part.1
.L23:
movq %rbx, %rdi
.LEHB3:
call _Unwind_Resume
.LEHE3:
.L27:
movq %rax, %rbx
jmp .L22
.L56:
call __stack_chk_fail
.cfi_endproc
.LFE5372:
.globl __gxx_personality_v0
.section .gcc_except_table,"a",@progbits
.LLSDA5372:
.byte 0xff
.byte 0xff
.byte 0x1
.uleb128 .LLSDACSE5372-.LLSDACSB5372
.LLSDACSB5372:
.uleb128 .LEHB0-.LFB5372
.uleb128 .LEHE0-.LEHB0
.uleb128 0
.uleb128 0
.uleb128 .LEHB1-.LFB5372
.uleb128 .LEHE1-.LEHB1
.uleb128 .L27-.LFB5372
.uleb128 0
.uleb128 .LEHB2-.LFB5372
.uleb128 .LEHE2-.LEHB2
.uleb128 .L28-.LFB5372
.uleb128 0
.uleb128 .LEHB3-.LFB5372
.uleb128 .LEHE3-.LEHB3
.uleb128 0
.uleb128 0
.LLSDACSE5372:
.section .text.startup
.size main, .-main
.section .text.unlikely
.LCOLDE7:
.section .text.startup
.LHOTE7:
.section .text.unlikely
.LCOLDB8:
.section .text.startup
.LHOTB8:
.p2align 4,,15
.type _GLOBAL__sub_I_itr, @function
_GLOBAL__sub_I_itr:
.LFB5697:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
movl $_ZStL8__ioinit, %edi
call _ZNSt8ios_base4InitC1Ev
movl $__dso_handle, %edx
movl $_ZStL8__ioinit, %esi
movl $_ZNSt8ios_base4InitD1Ev, %edi
addq $8, %rsp
.cfi_def_cfa_offset 8
jmp __cxa_atexit
.cfi_endproc
.LFE5697:
.size _GLOBAL__sub_I_itr, .-_GLOBAL__sub_I_itr
.section .text.unlikely
.LCOLDE8:
.section .text.startup
.LHOTE8:
.section .init_array,"aw"
.align 8
.quad _GLOBAL__sub_I_itr
.globl len
.data
.align 4
.type len, @object
.size len, 4
len:
.long 100
.globl itr
.align 8
.type itr, @object
.size itr, 8
itr:
.quad 10000000000
.local _ZStL8__ioinit
.comm _ZStL8__ioinit,1,1
.weakref _ZL28__gthrw___pthread_key_createPjPFvPvE,__pthread_key_create
.section .rodata.cst8,"aM",@progbits,8
.align 8
.LC3:
.long 0
.long 1093567616
.hidden __dso_handle
.ident "GCC: (Ubuntu 4.9.1-16ubuntu6) 4.9.1"
.section .note.GNU-stack,"",@progbits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment