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

  cuckoo_lock_two(map, kv);
  // try update
  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(kv, curr)) {
          kvmap_put_entry(&(map->mm), &(slot->e[k]), kv);
          cuckoo_unlock_two(map, kv);
          return true;
        }
      }
    }
  }

  // cuckoo
  for (u64 depth = 0; depth < 3; depth++) {
    for (u64 x = 0; x < 2; x++) {
      if (cuckoo_cuckoo_depth(map, hash2[x], kv, depth)) {
        cuckoo_unlock_two(map, kv);
        return true;
      }
    }
  }
  cuckoo_unlock_two(map, kv);
  if (map->bm) cuckoo_expand(map);
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x10bb0
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x10bb0
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x10c00
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x10c40
movq $0x0, -0x40(%rbp)
cmpq $0x2, -0x40(%rbp)
jae 0x1119a
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rax
movq -0x30(%rbp,%rax,8), %rsi
callq 0x10cf0
movq %rax, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
cmpq $0x8, -0x50(%rbp)
jae 0x11187
movq -0x48(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq -0x38(%rbp), %rax
jne 0x11174
movq -0x48(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
shrq $0x10, %rdi
callq 0xf220
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0xe110
testb $0x1, %al
jne 0x11140
jmp 0x11172
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x11390
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x10dc0
movb $0x1, -0x1(%rbp)
jmp 0x11233
jmp 0x11174
jmp 0x11176
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x110f1
jmp 0x11189
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x110c8
movq $0x0, -0x60(%rbp)
cmpq $0x3, -0x60(%rbp)
jae 0x1120b
movq $0x0, -0x68(%rbp)
cmpq $0x2, -0x68(%rbp)
jae 0x111fb
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rax
movq -0x30(%rbp,%rax,8), %rsi
movq -0x18(%rbp), %rdx
movq -0x60(%rbp), %rcx
callq 0x18d10
testb $0x1, %al
jne 0x111d8
jmp 0x111eb
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x10dc0
movb $0x1, -0x1(%rbp)
jmp 0x11233
jmp 0x111ed
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x111b1
jmp 0x111fd
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x111a2
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x10dc0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x100d8(%rax)
je 0x1122f
movq -0x10(%rbp), %rdi
callq 0x18f10
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
nop