// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x0, 0xc8(%rdi)
movq 0x18(%rdi), %rax
je 0xba0f
testq %rax, %rax
je 0xbaab
movl $0x1, %ebp
leaq 0x92c9(%rip), %rbx      # 0x14c40
xorl %eax, %eax
movq 0x8(%r15), %rdx
movl $0x20, %esi
movq %r14, %rdi
callq *(%rbx,%rax,8)
xorl %edx, %edx
divq 0xb8(%r15)
movq %rdx, %r13
movl %r13d, %eax
cltd
idivl 0xdc(%r15)
cltq
imulq $0x38, %rax, %r12
addq 0xd0(%r15), %r12
movq %r12, %rdi
callq 0xad9a
movq 0xc0(%r15), %rax
movslq %r13d, %rcx
leaq (%rcx,%rcx,4), %rcx
movdqu (%rax,%rcx,8), %xmm0
movdqu 0x10(%rax,%rcx,8), %xmm1
movdqu (%r14), %xmm2
pcmpeqb %xmm0, %xmm2
movdqu 0x10(%r14), %xmm0
pcmpeqb %xmm1, %xmm0
pand %xmm2, %xmm0
pmovmskb %xmm0, %edx
cmpl $0xffff, %edx           # imm = 0xFFFF
je 0xbaaf
movq %r12, %rdi
callq 0x2240
movl %ebp, %eax
incl %ebp
cmpq %rax, 0x18(%r15)
ja 0xb979
jmp 0xbaab
testq %rax, %rax
je 0xbaab
leaq 0x9221(%rip), %rbp      # 0x14c40
xorl %ebx, %ebx
movq 0x8(%r15), %rdx
movl $0x20, %esi
movq %r14, %rdi
callq *(%rbp)
xorl %edx, %edx
divq 0x30(%r15)
movq %rdx, %r13
movl %r13d, %eax
cltd
idivl 0xdc(%r15)
cltq
imulq $0x38, %rax, %r12
addq 0xd0(%r15), %r12
movq %r12, %rdi
callq 0xad9a
movq 0x38(%r15), %rax
movslq %r13d, %rcx
leaq (%rcx,%rcx,4), %rcx
movdqu (%rax,%rcx,8), %xmm0
movdqu 0x10(%rax,%rcx,8), %xmm1
movdqu (%r14), %xmm2
pcmpeqb %xmm0, %xmm2
movdqu 0x10(%r14), %xmm0
pcmpeqb %xmm1, %xmm0
pand %xmm2, %xmm0
pmovmskb %xmm0, %edx
cmpl $0xffff, %edx           # imm = 0xFFFF
je 0xbaaf
movq %r12, %rdi
callq 0x2240
incq %rbx
addq $0x8, %rbp
cmpq %rbx, 0x18(%r15)
ja 0xba21
xorl %ebx, %ebx
jmp 0xbabf
leaq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rbx
movq %r12, %rdi
callq 0x2240
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop