// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: cuckoo_get
struct kv *
cuckoo_get(struct cuckoo * const map, const struct kv * const key, struct kv * const out)
{
  const u64 hash2[2] = {cuckoo_hash(key, 0), cuckoo_hash(key, 1), };
  const u64 pkey = kvmap_pkey(key->hash);

  cuckoo_lock_two(map, key);
  for (u64 x = 0; x < 2; x++) {
    struct __kvmap_slot * const slot = cuckoo_hash_slot(map, hash2[x]);
    for (u64 k = 0; k < 8; k++) {
      if (slot->e[k].pkey == pkey) {
        const struct kv * const curr = __u64_to_ptr(slot->e[k].ptr);
        if (kv_keymatch(key, curr)) {
          if (map->mm.hf) map->mm.hf(curr, map->mm.hp);
          struct kv * const ret = kv_dup2(curr, out);
          cuckoo_unlock_two(map, key);
          return ret;
        }
      }
    }
  }
  cuckoo_unlock_two(map, key);
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, -0x70(%rbp)
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rax
movq %rax, -0x90(%rbp)
rorxq $0x2d, %rax, %rcx
movq %rcx, -0x88(%rbp)
movq %rax, %rcx
shrq $0x20, %rcx
xorq %rax, %rcx
movq %rcx, %r15
shrq $0x10, %r15
xorq %rcx, %r15
callq 0xe0a9
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, -0x30(%rbp)
leaq 0x10118(%r14), %r12
leaq 0x10(%rbx), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x48(%rbp)
xorl %r8d, %r8d
movq %rbx, -0x38(%rbp)
movq %r15, -0x40(%rbp)
movq %r12, -0x58(%rbp)
movq -0x90(%rbp,%r8,8), %rbx
movq -0x30(%rbp), %rax
movq 0x100d8(%rax), %rax
testq %rax, %rax
movq %r8, -0x68(%rbp)
je 0xdf12
movq %rbx, %rcx
shrq $0x6, %rcx
movl %ecx, %edx
andl $0x3ff, %edx            # imm = 0x3FF
cmpq %rdx, (%rax)
jbe 0xdf16
shrl $0x6, %edx
shrxq %rcx, 0x10(%rax,%rdx,8), %rax
andl $0x1, %eax
jmp 0xdf18
xorl %eax, %eax
jmp 0xdf1c
xorl %eax, %eax
movq -0x38(%rbp), %rsi
leaq (%rax,%rax,2), %r15
movq 0x10(%r12,%r15,8), %r14
cmpq $0x0, (%r12,%r15,8)
je 0xe073
leaq (%r12,%r15,8), %rax
bzhiq %r14, %rbx, %rcx
shlq $0x6, %rcx
addq (%rax), %rcx
xorl %r14d, %r14d
xorl %r13d, %r13d
movq %rcx, -0x50(%rbp)
movq (%rcx,%r13,8), %r12
movl %edi, %eax
xorw %r12w, %ax
jne 0xe036
movq %r12, %rbx
shrq $0x10, %rbx
cmpq $0x10000, %r12          # imm = 0x10000
jb 0xdf9b
movq (%rsi), %rax
cmpq (%rbx), %rax
jne 0xdf9b
movl 0x8(%rsi), %edx
cmpl 0x8(%rbx), %edx
jne 0xdf9b
leaq 0x10(%rbx), %rsi
movq -0x60(%rbp), %rdi
callq 0x63d0
movq -0x50(%rbp), %rcx
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
testl %eax, %eax
sete %r15b
jmp 0xdf9e
xorl %r15d, %r15d
testb %r15b, %r15b
je 0xe031
movq -0x30(%rbp), %rdi
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0xdfc5
movq -0x30(%rbp), %rcx
movq 0x28(%rcx), %rsi
movq %rbx, %rdi
callq *%rax
movq -0x30(%rbp), %rdi
cmpq $0x10000, %r12          # imm = 0x10000
jae 0xdfd3
xorl %r12d, %r12d
jmp 0xe016
movl 0x8(%rbx), %eax
movl 0xc(%rbx), %ecx
leaq (%rax,%rcx), %rdx
addq $0x10, %rdx
movq -0x70(%rbp), %rax
movq %rax, %r12
testq %rax, %rax
jne 0xe007
movq %rdx, %rdi
movq %rdx, %r12
callq 0x63a0
movq %r12, %rdx
movq -0x30(%rbp), %rdi
movq %rax, %r12
testq %rax, %rax
je 0xe016
movq %r12, %rdi
movq %rbx, %rsi
callq 0x6340
movq -0x30(%rbp), %rdi
movq %r12, -0x78(%rbp)
movq -0x38(%rbp), %rbx
movq %rbx, %rsi
callq 0xe140
movq %rbx, %rsi
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rcx
testb %r15b, %r15b
jne 0xe04f
cmpq $0x7, %r13
leaq 0x1(%r13), %rax
setae %r14b
movq %rax, %r13
cmpq $0x8, %rax
jne 0xdf4a
testb $0x1, %r14b
movq -0x58(%rbp), %r12
movq -0x68(%rbp), %rcx
je 0xe085
leaq 0x1(%rcx), %r8
testq %rcx, %rcx
setne %cl
movq %rcx, -0x48(%rbp)
je 0xded3
jmp 0xe085
callq 0x66ef
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
jmp 0xdf30
testb $0x1, -0x48(%rbp)
movq -0x78(%rbp), %rax
je 0xe09a
movq -0x30(%rbp), %rdi
callq 0xe140
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq