// File: /workspace/github_cpp_makefile_star2_O1/chahk0129[P]hash_bench/./index/cuckoo_hash.h
// Function: CuckooHash<char [32]>::Get(char (&) [32])
char* CuckooHash<Key_t>::Get(Key_t& key) {
  if (resizing_lock) {
    for (unsigned i = 0; i < kNumHash; ++i) {
	    int idx;
	    if constexpr(sizeof(Key_t) > 8)
		    idx = hash_funcs[i](key, sizeof(Key_t), _seed) % old_cap;
	    else
		    idx = hash_funcs[i](&key, sizeof(Key_t), _seed) % old_cap;
      std::shared_lock<std::shared_mutex> lock(mutex[idx/locksize]);
      if constexpr(sizeof(Key_t) > 8){
	      if(memcmp(old_tab[idx].key, key, sizeof(Key_t)) == 0)
		      return (char*)old_tab[idx].value;
      }
      else
	      if(memcmp(&old_tab[idx].key, &key, sizeof(Key_t)) == 0)
		      return (char*)old_tab[idx].value;
      }

  } else {
    for (int i = 0; i < kNumHash; i++) {
	    int idx;
	    if constexpr(sizeof(Key_t) > 8)
		    idx = hash_funcs[i](key, sizeof(Key_t), _seed) % capacity;
	    else
		    idx = hash_funcs[i](&key, sizeof(Key_t), _seed) % capacity;
      std::shared_lock<std::shared_mutex> lock(mutex[idx/locksize]);
      if constexpr(sizeof(Key_t) > 8){
	      if(memcmp(table[idx].key, key, sizeof(Key_t)) == 0)
		      return (char*)table[idx].value;
      }
      else
	      if(memcmp(&table[idx].key, &key, sizeof(Key_t)) == 0)
		      return (char*)table[idx].value;
      }
    }
    return (char*)NONE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rax
testq %rax, %rax
setne %cl
cmpl $0x0, 0xc8(%rdi)
je 0xad77
testq %rax, %rax
je 0xae35
movl $0x1, %r15d
xorl %eax, %eax
movl %ecx, %ebp
movq 0x8(%r14), %rdx
movl $0x20, %esi
movq %rbx, %rdi
leaq 0x8f71(%rip), %rcx      # 0x13c40
callq *(%rcx,%rax,8)
xorl %edx, %edx
divq 0xb8(%r14)
movq %rdx, %r13
movl %r13d, %eax
cltd
idivl 0xdc(%r14)
cltq
imulq $0x38, %rax, %r12
addq 0xd0(%r14), %r12
movq %r12, %rdi
callq 0xa118
movq 0xc0(%r14), %rax
movslq %r13d, %rcx
leaq (%rcx,%rcx,4), %rcx
movdqu (%rax,%rcx,8), %xmm0
movdqu 0x10(%rax,%rcx,8), %xmm1
movdqu (%rbx), %xmm2
pcmpeqb %xmm0, %xmm2
movdqu 0x10(%rbx), %xmm0
pcmpeqb %xmm1, %xmm0
pand %xmm2, %xmm0
pmovmskb %xmm0, %edx
xorl %r13d, %r13d
cmpl $0xffff, %edx           # imm = 0xFFFF
setne %dl
jne 0xad4b
leaq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movq %rax, 0x10(%rsp)
movb %dl, %r13b
movq %r12, %rdi
callq 0x2240
testl %r13d, %r13d
je 0xae37
movl %r15d, %eax
incl %r15d
cmpq %rax, 0x18(%r14)
seta %cl
ja 0xacba
jmp 0xae3f
testq %rax, %rax
je 0xae35
leaq 0x8eb9(%rip), %r15      # 0x13c40
xorl %ebp, %ebp
movb %cl, 0xf(%rsp)
movq 0x8(%r14), %rdx
movl $0x20, %esi
movq %rbx, %rdi
callq *(%r15)
xorl %edx, %edx
divq 0x30(%r14)
movq %rdx, %r13
movl %r13d, %eax
cltd
idivl 0xdc(%r14)
cltq
imulq $0x38, %rax, %r12
addq 0xd0(%r14), %r12
movq %r12, %rdi
callq 0xa118
movq 0x38(%r14), %rax
movslq %r13d, %rcx
leaq (%rcx,%rcx,4), %rcx
movdqu (%rax,%rcx,8), %xmm0
movdqu 0x10(%rax,%rcx,8), %xmm1
movdqu (%rbx), %xmm2
pcmpeqb %xmm0, %xmm2
movdqu 0x10(%rbx), %xmm0
pcmpeqb %xmm1, %xmm0
pand %xmm2, %xmm0
pmovmskb %xmm0, %edx
xorl %r13d, %r13d
cmpl $0xffff, %edx           # imm = 0xFFFF
setne %dl
jne 0xae0f
leaq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movq %rax, 0x10(%rsp)
movb %dl, %r13b
movq %r12, %rdi
callq 0x2240
testl %r13d, %r13d
je 0xae3b
incq %rbp
addq $0x8, %r15
cmpq %rbp, 0x18(%r14)
seta %cl
ja 0xad89
jmp 0xae3f
jmp 0xae3f
movl %ebp, %ecx
jmp 0xae3f
movb 0xf(%rsp), %cl
testb $0x1, %cl
movq 0x10(%rsp), %rax
jne 0xae4b
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq