// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %r13
movq (%rsi), %r15
rorxq $0x2d, %r15, %rax
movq %rax, -0x50(%rbp)
movq %r15, %rax
shrq $0x20, %rax
xorq %r15, %rax
movq %rax, %rbx
shrq $0x10, %rbx
xorq %rax, %rbx
movq %r15, %rsi
callq 0xdf01
movq %r14, %r8
leaq 0x10118(%r13), %rax
movq %rax, -0x48(%rbp)
leaq 0x10(%r14), %rax
movq %rax, -0x60(%rbp)
movb $0x1, %al
movq %r15, -0x58(%rbp)
movq %r14, -0x30(%rbp)
movq %r13, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
movq 0x100d8(%r13), %rax
testq %rax, %rax
je 0xe2c7
movq %r15, %rcx
shrq $0x6, %rcx
movl %ecx, %edx
andl $0x3ff, %edx            # imm = 0x3FF
cmpq %rdx, (%rax)
jbe 0xe2c7
shrl $0x6, %edx
shrxq %rcx, 0x10(%rax,%rdx,8), %rax
andl $0x1, %eax
jmp 0xe2c9
xorl %eax, %eax
leaq (%rax,%rax,2), %rcx
movq -0x48(%rbp), %rdx
movq (%rdx,%rcx,8), %rax
movq 0x10(%rdx,%rcx,8), %r14
testq %rax, %rax
je 0xe353
bzhiq %r14, %r15, %r15
shlq $0x6, %r15
addq %rax, %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %r13
movl %ebx, %eax
xorw %r13w, %ax
jne 0xe331
cmpq $0x10000, %r13          # imm = 0x10000
jb 0xe331
movq %r13, %r14
shrq $0x10, %r14
movq (%r8), %rax
cmpq (%r14), %rax
jne 0xe331
movl 0x8(%r8), %edx
cmpl 0x8(%r14), %edx
jne 0xe331
leaq 0x10(%r14), %rsi
movq -0x60(%rbp), %rdi
callq 0x63d0
movq -0x30(%rbp), %r8
testl %eax, %eax
je 0xe36d
incq %r12
cmpq $0x8, %r12
jne 0xe2ee
movq -0x50(%rbp), %r15
testb $0x1, -0x3c(%rbp)
movl $0x0, %eax
movq -0x38(%rbp), %r13
jne 0xe295
jmp 0xe38f
movq -0x48(%rbp), %rax
leaq (%rax,%rcx,8), %r12
callq 0x66ef
movq -0x30(%rbp), %r8
movq (%r12), %rax
jmp 0xe2df
movq -0x38(%rbp), %rcx
movq 0x40(%rcx), %rax
testq %rax, %rax
je 0xe413
movq 0x48(%rcx), %rdx
movq %r14, %rdi
movq %r8, %rsi
callq *%rax
jmp 0xe429
xorl %r12d, %r12d
movq -0x58(%rbp), %r14
movb $0x1, %bl
movq %r14, %rsi
movq %r13, %rdi
movq %r8, %rdx
movq %r12, %rcx
callq 0x1328b
testb %al, %al
jne 0xe407
movq -0x50(%rbp), %rsi
testb $0x1, %bl
movl $0x0, %ebx
movq -0x30(%rbp), %r8
jne 0xe39b
incq %r12
cmpq $0x3, %r12
jne 0xe396
movq (%r8), %rsi
movq %r13, %rdi
callq 0xdf98
cmpq $0x0, 0x100d8(%r13)
je 0xe402
leaq 0x10050(%r13), %r14
movq %r14, %rdi
callq 0x6280
cmpl $0xb, %eax
je 0xe3e4
testl %eax, %eax
je 0xe482
cmpl $0x10, %eax
jne 0xe4b2
xorl %r14d, %r14d
jmp 0xe470
movq -0x30(%rbp), %rax
movq (%rax), %rsi
movq %r13, %rdi
jmp 0xe468
movq 0x10(%rcx), %rax
testq %rax, %rax
je 0xe432
movq -0x38(%rbp), %rcx
movq 0x18(%rcx), %rsi
movq %r14, %rdi
callq *%rax
movzwl (%r15,%r12,8), %r13d
movq -0x30(%rbp), %r8
movq %r8, %rax
shlq $0x10, %rax
movzwl %r13w, %ecx
orq %rax, %rcx
movq %rcx, (%r15,%r12,8)
movq (%r8), %rcx
movq %rcx, %rdx
shrq $0x20, %rdx
xorl %ecx, %edx
movl %edx, %ecx
shrl $0x10, %ecx
xorl %edx, %ecx
movzwl %cx, %ecx
orq %rax, %rcx
movq %rcx, (%r15,%r12,8)
movq (%r8), %rsi
movq -0x38(%rbp), %rdi
callq 0xdf98
movb $0x1, %r14b
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10090(%r13), %rdi
leaq 0x50d8(%rip), %rdx      # 0x13568
xorl %r14d, %r14d
xorl %esi, %esi
movq %r13, %rcx
callq 0x6430
movq 0x10090(%r13), %rdi
leaq 0x631e(%rip), %rsi      # 0x147c9
callq 0x61d0
jmp 0xe470
xorl %edi, %edi
callq 0x6530