// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: cuckoo_cuckoo_depth
static bool
cuckoo_cuckoo_depth(struct cuckoo * const map, const u64 hash, const struct kv * const kv, const u64 max_cuckoo)
{
  if (max_cuckoo == 0) {
    return cuckoo_cuckoo_local(map, hash, kv);
  }

  struct __kvmap_slot * const slot = cuckoo_hash_slot(map, hash);
  const u64 lidx0 = kvmap_hlocks_index(hash);
  for (u64 k = 0; k < 8; k++) {
    if (slot->e[k].ptr == 0) { // some slots may be released by other threads
      //cuckoo_put_entry(map, &(slot->e[k]), kv);
      kvmap_put_entry(&(map->mm), &(slot->e[k]), kv);
      return true;
    }
    const struct kv * const curr = __u64_to_ptr(slot->e[k].ptr);
    const u64 hash2[2] = {cuckoo_hash(curr, 0), cuckoo_hash(curr, 1), };
    for (u64 x = 0; x < 2; x++) {
      const u64 lidx1 = kvmap_hlocks_index(hash2[x]);
      if ((lidx1 != lidx0) && (cuckoo_trylock(map, lidx1))) {
        const bool r = cuckoo_cuckoo_depth(map, hash2[x], curr, max_cuckoo - 1lu);
        cuckoo_unlock(map, lidx1);
        if (r) {
          slot->e[k].ptr = 0;
          slot->e[k].pkey = 0;
          //cuckoo_put_entry(map, &(slot->e[k]), kv);
          kvmap_put_entry(&(map->mm), &(slot->e[k]), kv);
          return true;
        }
      }
    }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x18d4d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x18f80
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x18ef8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x10cf0
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x12d40
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
cmpq $0x8, -0x40(%rbp)
jae 0x18ef4
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x10, %rax
cmpq $0x0, %rax
jne 0x18db9
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
callq 0x11390
movb $0x1, -0x1(%rbp)
jmp 0x18ef8
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
shrq $0x10, %rdi
callq 0xf220
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x10bb0
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rdi
movl $0x1, %esi
callq 0x10bb0
movq %rax, -0x58(%rbp)
movq $0x0, -0x68(%rbp)
cmpq $0x2, -0x68(%rbp)
jae 0x18ee1
movq -0x68(%rbp), %rax
movq -0x60(%rbp,%rax,8), %rdi
callq 0x12d40
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpq -0x38(%rbp), %rax
je 0x18ece
movq -0x10(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x19010
testb $0x1, %al
jne 0x18e3e
jmp 0x18ece
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rax
movq -0x60(%rbp,%rax,8), %rsi
movq -0x48(%rbp), %rdx
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
callq 0x18d10
andb $0x1, %al
movb %al, -0x71(%rbp)
movq -0x10(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x18ce0
testb $0x1, -0x71(%rbp)
je 0x18ecc
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
andq $0xffff, %rdx           # imm = 0xFFFF
orq $0x0, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
andq $-0x10000, %rdx         # imm = 0xFFFF0000
orq $0x0, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
callq 0x11390
movb $0x1, -0x1(%rbp)
jmp 0x18ef8
jmp 0x18ece
jmp 0x18ed0
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x18dfd
jmp 0x18ee3
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x18d73
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)