Skip to content

Instantly share code, notes, and snippets.

@ytlvy
Created January 5, 2016 04:35
Show Gist options
  • Save ytlvy/4664487b328f5213911c to your computer and use it in GitHub Desktop.
Save ytlvy/4664487b328f5213911c to your computer and use it in GitHub Desktop.
.section __TEXT,__text,regular,pure_instructions
.globl _insert
.align 4, 0x90
_insert: ## @insert
.cfi_startproc
## BB#0:
pushq %rbp
Ltmp2:
.cfi_def_cfa_offset 16
Ltmp3:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp4:
.cfi_def_cfa_register %rbp
movb (%rdi), %r8b
movl $5381, %ecx ## imm = 0x1505
testb %r8b, %r8b
je LBB0_3
## BB#1: ## %.lr.ph.i.preheader
leaq 1(%rdi), %rax
movl $5381, %ecx ## imm = 0x1505
.align 4, 0x90
LBB0_2: ## %.lr.ph.i
## =>This Inner Loop Header: Depth=1
movzbl %r8b, %r8d
imull $33, %ecx, %ecx
xorl %r8d, %ecx
movb (%rax), %r8b
incq %rax
testb %r8b, %r8b
jne LBB0_2
LBB0_3: ## %hash.exit
xorl %r8d, %r8d
.align 4, 0x90
LBB0_4: ## =>This Inner Loop Header: Depth=1
movl $-1, %eax
cmpl $1048575, %r8d ## imm = 0xFFFFF
ja LBB0_7
## BB#5: ## in Loop: Header=BB0_4 Depth=1
leal (%rcx,%r8), %eax
andl $1048575, %eax ## imm = 0xFFFFF
shlq $4, %rax
incl %r8d
cmpq $0, (%rdx,%rax)
jne LBB0_4
## BB#6:
leaq (%rdx,%rax), %rcx
movq %rdi, (%rcx)
movl %esi, 8(%rdx,%rax)
xorl %eax, %eax
LBB0_7: ## %.loopexit
popq %rbp
ret
.cfi_endproc
.subsections_via_symbols
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment