LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: kvmap2_del
bool
kvmap2_del(struct kvmap2 * const map2, const struct kv * const key)
{
  u64 i = UINT64_MAX;
  u64 j = UINT64_MAX;
  u64 k = UINT64_MAX;
  kvmap1_lock_hash(map2->maps[0], key);
  for (u64 x = 0; x < 2; x++) {
    struct kvmap1 * const map = map2->maps[x];
    if (kvmap1_locate_key(map, key, &i, &j, &k)) {
      struct __kvmap_entry * const e = &(map->levels[i].table[j].e[k]);
      //(void)atomic_fetch_sub(&(map->nr_kv), 1);
      (void)atomic_fetch_sub(&(map->levels[i].nr_kv), 1);
      kvmap1_put_entry(map, e, NULL);
      kvmap1_unlock_hash(map2->maps[x], key);
      return true;
    }
    if (x == 0) {
      kvmap1_lock_hash(map2->maps[1], key);
    }
    kvmap1_unlock_hash(map2->maps[x], key);
  }
  return false;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r13
movq %rdi, %r14
movq $-0x1, %rax
movq %rax, -0x48(%rbp)
movq %rax, -0x40(%rbp)
movq %rax, -0x38(%rbp)
movq 0x58(%rdi), %rax
movq (%rsi), %rdx
movb 0x50(%rax), %cl
rolq %cl, %rdx
andl $0xffc0, %edx           # imm = 0xFFC0
leaq (%rax,%rdx), %rdi
addq $0xe8, %rdi
callq 0x6050
cmpl $0x23, %eax
je 0xd3d8
movb $0x1, %bl
xorl %r12d, %r12d
movq %r13, %rsi
movq %r14, %r15
movq 0x58(%r14,%r12,8), %r13
movq %r13, %rdi
movq %rsi, %r14
leaq -0x48(%rbp), %rdx
leaq -0x40(%rbp), %rcx
leaq -0x38(%rbp), %r8
callq 0xc4f9
movb %al, -0x29(%rbp)
testb %al, %al
jne 0xd34f
testb $0x1, %bl
je 0xd3a7
movq 0x60(%r15), %rax
movq %r14, %r13
movq (%r14), %rdx
movb 0x50(%rax), %cl
rolq %cl, %rdx
andl $0xffc0, %edx           # imm = 0xFFC0
leaq (%rax,%rdx), %rdi
addq $0xe8, %rdi
callq 0x6050
cmpl $0x23, %eax
je 0xd3d8
movq 0x58(%r15,%r12,8), %rax
movq (%r13), %rdx
movb 0x50(%rax), %cl
rolq %cl, %rdx
andl $0xffc0, %edx           # imm = 0xFFC0
leaq (%rax,%rdx), %rdi
addq $0xe8, %rdi
callq 0x6320
movl $0x1, %r12d
testb $0x1, %bl
movl $0x0, %ebx
movq %r15, %r14
jne 0xd2b0
jmp 0xd3c6
movq -0x48(%rbp), %rax
shlq $0x5, %rax
movq -0x40(%rbp), %rbx
shlq $0x6, %rbx
addq 0x10128(%r13,%rax), %rbx
movq -0x38(%rbp), %rcx
lock
decq 0x10140(%r13,%rax)
movq (%rbx,%rcx,8), %rdi
cmpq $0x10000, %rdi          # imm = 0x10000
jb 0xd39a
movq 0x10(%r13), %rax
testq %rax, %rax
je 0xd39a
shrq $0x10, %rdi
movq 0x18(%r13), %rsi
movq %rcx, %r13
callq *%rax
movq %r13, %rcx
movq $0x0, (%rbx,%rcx,8)
movq 0x58(%r15,%r12,8), %r13
movq (%r14), %rax
movb 0x50(%r13), %cl
rolq %cl, %rax
andl $0xffc0, %eax           # imm = 0xFFC0
leaq (%rax,%r13), %rdi
addq $0xe8, %rdi
callq 0x6320
movb -0x29(%rbp), %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x6530
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: kvmap2_fprint
void
kvmap2_fprint(struct kvmap2 * const map2, FILE * const out)
{
  //u64 sum_kv = 0;
  //for (u64 x = 0; x < 2; x++) {
  //  sum_kv += atomic_load(&(map2->maps[x]->nr_kv));
  //}
  //const double sum100 = ((double)sum_kv) * 0.01;

  //fprintf(out, "KVMAP2 sz_shift %"PRIu64" nr_kv %"PRIu64"\n", map2->sz_shift, sum_kv);
  for (u64 x = 0; x < 2; x++) {
    //const u64 nr_kv = atomic_load(&(map2->maps[x]->nr_kv));
    //fprintf(out, "  KVMAP2 %"PRIu64" %.2lf%% ||| ", x, ((double)nr_kv) / sum100);
    kvmap1_fprint(map2->maps[x], out);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, -0x30(%rbp)
movq %rdi, -0x48(%rbp)
movb $0x1, %cl
xorl %eax, %eax
movl %ecx, -0x3c(%rbp)
movq -0x48(%rbp), %rcx
movq 0x58(%rcx,%rax,8), %rdx
leaq 0x10128(%rdx), %r14
xorl %eax, %eax
xorl %r15d, %r15d
cmpq $0x0, (%r14,%rax)
je 0xd6aa
cmpq $0x0, 0x8(%r14,%rax)
je 0xd6aa
movq 0x18(%r14,%rax), %rcx
addq %rcx, %r15
addq $0x20, %rax
cmpq $0x800, %rax            # imm = 0x800
jne 0xd693
movq %rdx, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x50(%rax), %rdx
movq -0x30(%rbp), %rdi
leaq 0x709c(%rip), %rsi      # 0x14769
movq %r15, %rcx
xorl %eax, %eax
callq 0x6300
movq -0x38(%rbp), %rcx
vcvtusi2sd %r15, %xmm2, %xmm0
vmulsd 0x69cf(%rip), %xmm0, %xmm0 # 0x140b8
vmovsd %xmm0, -0x50(%rbp)
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %eax, %eax
xorl %r15d, %r15d
cmpq $0x0, (%r14)
je 0xd7aa
cmpq $0x0, 0x8(%r14)
je 0xd7aa
movq %rax, -0x58(%rbp)
movq 0x18(%r14), %r13
movq 0x8(%r14), %rax
movq 0x8(%rax), %r8
vcvtusi2sd %r8, %xmm2, %xmm0
movl $0x1, %eax
shlxq %r15, %rax, %r9
vcvtusi2sd %r9, %xmm2, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmulsd 0x6929(%rip), %xmm0, %xmm0 # 0x14068
cmpq 0x68(%rcx), %r15
movl $0x20, %edx
movl $0x2a, %eax
cmovel %eax, %edx
movl $0x8, %eax
shlxq %r15, %rax, %r10
vcvtusi2sd %r13, %xmm2, %xmm1
vdivsd -0x50(%rbp), %xmm1, %xmm1
movq -0x30(%rbp), %rdi
leaq 0x7012(%rip), %rsi      # 0x14782
movq %r15, %rcx
movb $0x2, %al
pushq %r10
pushq %r13
callq 0x6300
movq -0x38(%rbp), %rcx
addq $0x10, %rsp
movq %r15, %rax
subq 0x68(%rcx), %rax
jae 0xd796
movq 0x58(%rcx), %rax
addq %rbx, %rax
addq %r13, %r12
incq %rax
imulq %r13, %rax
movq -0x58(%rbp), %rsi
addq %rax, %rsi
movq %rsi, %rax
incq %r15
decq %rbx
addq $0x20, %r14
cmpq $-0x40, %rbx
jne 0xd6f8
vcvtusi2sd %rax, %xmm2, %xmm0
vcvtusi2sd %r12, %xmm2, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
movq -0x30(%rbp), %rdi
leaq 0x6fda(%rip), %rsi      # 0x147b3
movb $0x1, %al
callq 0x6300
movl $0x1, %eax
testb $0x1, -0x3c(%rbp)
movl $0x0, %ecx
jne 0xd67b
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: kvmap2_iter_create
inline struct kvmap2_iter *
kvmap2_iter_create(struct kvmap2 * const map2)
{
  struct kvmap2_iter * const iter2 = (typeof(iter2))malloc(sizeof(*iter2));
  iter2->map2 = map2;
  iter2->map_id = 0;
  for (u64 x = 0; x < 2; x++) {
    iter2->iters[x] = kvmap1_iter_create(map2->maps[x]);
  }
  iter2->iter = iter2->iters[0];
  return iter2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl $0x28, %edi
callq 0x63a0
movq %rbx, -0x38(%rbp)
movq %rbx, (%rax)
movq %rax, -0x30(%rbp)
movq $0x0, 0x8(%rax)
movb $0x1, %r12b
xorl %r13d, %r13d
movq -0x38(%rbp), %rax
movq 0x58(%rax,%r13,8), %rbx
movl $0x20, %edi
callq 0x63a0
movq %rax, %r15
testq %rax, %rax
je 0xd89c
movl $0xe8, %r14d
leaq (%rbx,%r14), %rdi
callq 0x6050
cmpl $0x23, %eax
je 0xd8d2
addq $0x40, %r14
cmpq $0x100e8, %r14          # imm = 0x100E8
jne 0xd85b
leaq 0x100e8(%rbx), %rdi
callq 0x6050
cmpl $0x23, %eax
je 0xd8d2
movq %rbx, (%r15)
movq 0x58(%rbx), %rax
movq %rax, 0x8(%r15)
vxorps %xmm0, %xmm0, %xmm0
vmovups %xmm0, 0x10(%r15)
movq -0x30(%rbp), %rax
movq %r15, 0x18(%rax,%r13,8)
movl $0x1, %r13d
testb $0x1, %r12b
movl $0x0, %r12d
jne 0xd83a
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x10(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x6530
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: kvmap2_iter_next
struct kv *
kvmap2_iter_next(struct kvmap2_iter * const iter2, struct kv * const out)
{
  struct kv * const ret = kvmap1_iter_next(iter2->iter, out);
  if (ret == NULL) {
    iter2->iter = NULL;
    iter2->map_id++;
    if (iter2->map_id < 2) {
      iter2->iter = iter2->iters[iter2->map_id];
      return kvmap1_iter_next(iter2->iter, out);
    }
  }
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rdi
callq 0xd927
testq %rax, %rax
jne 0xd922
movq $0x0, 0x10(%r14)
movq 0x8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%r14)
cmpq $0x1, %rcx
ja 0xd920
movq 0x20(%r14,%rax,8), %rdi
movq %rdi, 0x10(%r14)
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xd927
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: kvmap1_iter_next
static struct kv *
kvmap1_iter_next(struct kvmap1_iter * const iter, struct kv * const out)
{
  u64 i = iter->i;
  u64 j = iter->j;
  u64 k = iter->k;
  struct kv * ret = NULL;
  while (i >= KVMAP_MIN_LEVEL) {
    if (iter->map->levels[i].table == NULL) {
      i--;
      continue;
    }
    struct __kvmap1_level * const level = &(iter->map->levels[i]);
    if (k == 0) { // try skip empty slots at every new j
      while ((j < (1lu << i)) && (bitmap_test(level->bm, j) == false)) j++;
      if (j >= (1lu << i)) {
        j = 0;
        i--;
        continue;
      }
    }
    if (level->table[j].e[k].ptr) {
      struct kv * const kv = __u64_to_ptr(level->table[j].e[k].ptr);
      ret = kv_dup2(kv, out);
    }
    // shift next
    k++;
    if (k >= 8) {
      k = 0;
      j++;
      if (j >= (1lu << i)) {
        j = 0;
        i--;
      }
    }
    if (ret) break;
  }
  iter->i = i;
  iter->j = j;
  iter->k = k;
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %r14
movq 0x10(%rdi), %r13
movq 0x18(%rdi), %r8
cmpq $0x10, %r14
jb 0xda7d
xorl %r9d, %r9d
movq (%rbx), %rax
movq %r14, %rcx
shlq $0x5, %rcx
addq %rax, %rcx
addq $0x10130, %rcx          # imm = 0x10130
movq -0x8(%rcx), %rax
testq %rax, %rax
jne 0xd983
decq %r14
addq $-0x20, %rcx
cmpq $0xf, %r14
ja 0xd968
jmp 0xda77
testq %r8, %r8
je 0xd9a7
movq %r13, %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq (%rax,%r8,8), %r12
cmpq $0x10000, %r12          # imm = 0x10000
jae 0xd9e6
xorl %r15d, %r15d
jmp 0xda38
shrxq %r14, %r13, %rdx
testq %rdx, %rdx
jne 0xd9db
movq (%rcx), %rcx
movq (%rcx), %rdx
cmpq %r13, %rdx
jbe 0xd9ce
movq %r13, %rdi
shrq $0x6, %rdi
movq 0x10(%rcx,%rdi,8), %rdi
btq %r13, %rdi
jb 0xd988
incq %r13
shrxq %r14, %r13, %rdi
testq %rdi, %rdi
je 0xd9b7
decq %r14
xorl %r8d, %r8d
xorl %r13d, %r13d
jmp 0xda60
movq %r8, -0x30(%rbp)
shrq $0x10, %r12
movl 0x8(%r12), %eax
movl 0xc(%r12), %ecx
leaq (%rax,%rcx), %rdx
addq $0x10, %rdx
movq %rsi, %r15
movq %rsi, -0x38(%rbp)
testq %rsi, %rsi
jne 0xda22
movq %rdx, %rdi
movq %rdx, %r15
callq 0x63a0
movq %r15, %rdx
movq %rax, %r15
testq %rax, %rax
je 0xda72
movq %r15, %rdi
movq %r12, %rsi
callq 0x6340
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %r8
xorl %r9d, %r9d
incq %r8
cmpq $0x8, %r8
jb 0xda5b
incq %r13
shrxq %r14, %r13, %rax
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
cmovneq %r9, %r13
subq %rcx, %r14
xorl %r8d, %r8d
testq %r15, %r15
jne 0xda80
movl $0x0, %r15d
cmpq $0xf, %r14
ja 0xd954
jmp 0xda80
xorl %r15d, %r15d
jmp 0xda2d
movl $0xf, %r14d
xorl %r15d, %r15d
movq %r14, 0x8(%rbx)
movq %r13, 0x10(%rbx)
movq %r8, 0x18(%rbx)
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: cuckoo_create
struct cuckoo *
cuckoo_create(const struct kvmap_mm * const mm)
{
  struct cuckoo * const map = xalloc(64, sizeof(*map));
  memset(map, 0, sizeof(*map));

  map->mm = mm ? (*mm) : __kvmap_mm_default;
  for (u64 j = 0; j < KVMAP_HLOCK_NR; j++) {
    spinlock_init(&(map->hlocks[j]));
  }
  mutexlock_init(&(map->expand_lock));

  map->fixed_power = 0;
  if (map->fixed_power == 0) {
    map->bm = bitmap_create(KVMAP_HLOCK_NR);
  }

  cuckoo_init(map);
  return map;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq -0x18(%rbp), %rdi
movl $0x40, %esi
movl $0x10148, %edx          # imm = 0x10148
callq 0x6570
xorl %ebx, %ebx
testl %eax, %eax
jne 0xdbda
movq -0x18(%rbp), %rbx
movl $0x10148, %edx          # imm = 0x10148
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6210
testq %r14, %r14
je 0xdc0b
vmovups (%r14), %ymm0
vmovups 0x20(%r14), %ymm1
vmovups 0x30(%r14), %ymm2
vmovups %ymm2, 0x30(%rbx)
vmovups %ymm1, 0x20(%rbx)
jmp 0xdc2d
vmovups 0xc1a5(%rip), %ymm0     # 0x19db8
vmovups %ymm0, 0x30(%rbx)
vmovups 0xc188(%rip), %ymm0     # 0x19da8
vmovups %ymm0, 0x20(%rbx)
vmovups 0xc15b(%rip), %ymm0     # 0x19d88
vmovups %ymm0, (%rbx)
movl $0x50, %r14d
leaq (%rbx,%r14), %rdi
movl $0x1, %esi
vzeroupper
callq 0x62e0
addq $0x40, %r14
cmpq $0x10050, %r14          # imm = 0x10050
jne 0xdc37
leaq 0x10050(%rbx), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x65d0
movq %r14, 0x100d0(%rbx)
movl $0x1, %edi
movl $0x90, %esi
callq 0x62d0
movq $0x400, (%rax)          # imm = 0x400
xchgq %r14, 0x8(%rax)
movq %rax, 0x100d8(%rbx)
movq %rbx, %rdi
callq 0xdca2
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: cuckoo_init
static void
cuckoo_init(struct cuckoo * const map)
{
  const u64 power = map->fixed_power > KVMAP_MIN_LEVEL ? map->fixed_power : KVMAP_MIN_LEVEL;
  map->levels[0].power = power;
  map->levels[0].table = pages_alloc_best(KVMAP_SIZE_OF_LEVEL(power), true, &(map->levels[0].alloc_size));
  if (map->fixed_power == 0) {
    bitmap_set_all0(map->bm);
  }
  debug_assert(map->levels[0].table);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x100d0(%rdi), %rax
cmpq $0x11, %rax
movl $0x10, %ecx
cmovaeq %rax, %rcx
movq %rcx, 0x10128(%rdi)
addb $-0x6, %cl
movl $0x1000, %eax           # imm = 0x1000
shlxq %rcx, %rax, %rdi
leaq 0x10120(%rbx), %rdx
movl $0x1, %esi
callq 0x82a0
movq %rax, 0x10118(%rbx)
cmpq $0x0, 0x100d0(%rbx)
jne 0xdd28
movq 0x100d8(%rbx), %r14
leaq 0x10(%r14), %rdi
movq (%r14), %rdx
addq $0x3f, %rdx
shrq $0x3, %rdx
andq $-0x8, %rdx
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x6210
xchgq %r15, 0x8(%r14)
movq 0x10118(%rbx), %rax
addq $0x8, %rsp
testq %rax, %rax
je 0xdd38
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x66ef
// File: /workspace/github_c_makefile_star2_O3/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 $0x38, %rsp
movq %rdx, -0x50(%rbp)
movq %rsi, %r15
movq %rdi, %rbx
movq (%rsi), %r13
rorxq $0x2d, %r13, %rax
movq %rax, -0x58(%rbp)
movq %r13, %rax
shrq $0x20, %rax
xorq %r13, %rax
movq %rax, %r14
shrq $0x10, %r14
xorq %rax, %r14
movq %r13, %rsi
callq 0xdf01
movq %r15, %rsi
leaq 0x10118(%rbx), %rax
movq %rax, -0x48(%rbp)
leaq 0x10(%r15), %rax
movq %rax, -0x60(%rbp)
movb $0x1, %al
movq %rbx, -0x40(%rbp)
movq %r15, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movq 0x100d8(%rbx), %rax
testq %rax, %rax
je 0xddd9
movq %r13, %rcx
shrq $0x6, %rcx
movl %ecx, %edx
andl $0x3ff, %edx            # imm = 0x3FF
cmpq %rdx, (%rax)
jbe 0xddd9
shrl $0x6, %edx
shrxq %rcx, 0x10(%rax,%rdx,8), %rax
andl $0x1, %eax
jmp 0xdddb
xorl %eax, %eax
leaq (%rax,%rax,2), %rcx
movq -0x48(%rbp), %rdx
movq (%rdx,%rcx,8), %rax
movq 0x10(%rdx,%rcx,8), %rbx
testq %rax, %rax
je 0xde66
bzhiq %rbx, %r13, %r12
shlq $0x6, %r12
addq %rax, %r12
xorl %r15d, %r15d
movq (%r12,%r15,8), %r13
movl %r14d, %eax
xorw %r13w, %ax
jne 0xde44
cmpq $0x10000, %r13          # imm = 0x10000
jb 0xde44
shrq $0x10, %r13
movq (%rsi), %rax
cmpq (%r13), %rax
jne 0xde44
movl 0x8(%rsi), %ebx
cmpl 0x8(%r13), %ebx
jne 0xde44
leaq 0x10(%r13), %rsi
movq -0x60(%rbp), %rdi
movq %rbx, %rdx
callq 0x63d0
movq -0x30(%rbp), %rsi
testl %eax, %eax
je 0xde7f
incq %r15
cmpq $0x8, %r15
jne 0xde00
movq -0x58(%rbp), %r13
testb $0x1, -0x34(%rbp)
movl $0x0, %eax
movq -0x40(%rbp), %rbx
jne 0xdda7
jmp 0xdedc
movq -0x48(%rbp), %rax
leaq (%rax,%rcx,8), %r15
callq 0x66ef
movq -0x30(%rbp), %rsi
movq (%r15), %rax
jmp 0xddf1
movq -0x40(%rbp), %r15
movq 0x20(%r15), %rax
testq %rax, %rax
je 0xde99
movq 0x28(%r15), %rsi
movq %r13, %rdi
callq *%rax
movl 0x8(%r13), %ebx
movl 0xc(%r13), %eax
addq %rax, %rbx
addq $0x10, %rbx
movq -0x50(%rbp), %r14
testq %r14, %r14
jne 0xdebd
movq %rbx, %rdi
callq 0x63a0
movq %rax, %r14
testq %rax, %rax
je 0xdefc
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x6340
movq -0x30(%rbp), %rax
movq (%rax), %rsi
movq %r15, %rdi
callq 0xdf98
jmp 0xdeea
movq (%rsi), %rsi
movq %rbx, %rdi
callq 0xdf98
xorl %r14d, %r14d
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
jmp 0xdecb
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: cuckoo_lock_two
static void
cuckoo_lock_two(struct cuckoo * const map, const struct kv * const key)
{
  const u64 hash2[2] = {cuckoo_hash(key, 0), cuckoo_hash(key, 1), };
  const u64 i1 = kvmap_hlocks_index(hash2[0]);
  const u64 i2 = kvmap_hlocks_index(hash2[1]);
  if (i1 < i2) {
    cuckoo_lock(map, i1);
    cuckoo_lock(map, i2);
  } else if (i1 > i2) {
    cuckoo_lock(map, i2);
    cuckoo_lock(map, i1);
  } else { // equal
    cuckoo_lock(map, i1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %r15
shrq $0x33, %r15
shrl $0x6, %r14d
andl $0x3ff, %r14d           # imm = 0x3FF
andl $0x3ff, %r15d           # imm = 0x3FF
cmpq %r15, %r14
jae 0xdf55
shll $0x6, %r14d
leaq (%rbx,%r14), %rdi
addq $0x50, %rdi
callq 0x6050
cmpl $0x23, %eax
je 0xdf91
addq $0x50, %rbx
shll $0x6, %r15d
addq %rbx, %r15
movq %r15, %rdi
jmp 0xdf7c
addq $0x50, %rbx
cmpl %r15d, %r14d
jbe 0xdf72
shll $0x6, %r15d
addq %rbx, %r15
movq %r15, %rdi
callq 0x6050
cmpl $0x23, %eax
je 0xdf91
shll $0x6, %r14d
addq %r14, %rbx
movq %rbx, %rdi
callq 0x6050
cmpl $0x23, %eax
je 0xdf91
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x6530
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: cuckoo_unlock_two
static void
cuckoo_unlock_two(struct cuckoo * const map, const struct kv * const key)
{
  const u64 hash2[2] = {cuckoo_hash(key, 0), cuckoo_hash(key, 1), };
  const u64 i1 = kvmap_hlocks_index(hash2[0]);
  const u64 i2 = kvmap_hlocks_index(hash2[1]);
  if (i1 < i2) {
    cuckoo_unlock(map, i1);
    cuckoo_unlock(map, i2);
  } else if (i1 > i2) {
    cuckoo_unlock(map, i2);
    cuckoo_unlock(map, i1);
  } else { // equal
    cuckoo_unlock(map, i1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %r15
shrq $0x33, %r15
shrl $0x6, %ebx
andl $0x3ff, %ebx            # imm = 0x3FF
andl $0x3ff, %r15d           # imm = 0x3FF
cmpq %r15, %rbx
jae 0xdfe2
shll $0x6, %ebx
leaq (%r14,%rbx), %rdi
addq $0x50, %rdi
callq 0x6320
shll $0x6, %r15d
leaq (%r14,%r15), %rbx
addq $0x50, %rbx
jmp 0xe000
addq $0x50, %r14
cmpl %r15d, %ebx
jbe 0xdffa
shll $0x6, %r15d
addq %r14, %r15
movq %r15, %rdi
callq 0x6320
shll $0x6, %ebx
addq %r14, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6320
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: cuckoo_probe
bool
cuckoo_probe(struct cuckoo * const map, const struct kv * const key)
{
  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);
          cuckoo_unlock_two(map, key);
          return true;
        }
      }
    }
  }
  cuckoo_unlock_two(map, key);
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %r12
rorxq $0x2d, %r12, %rax
movq %rax, -0x48(%rbp)
movq %r12, %rax
shrq $0x20, %rax
xorq %r12, %rax
movq %rax, %rbx
shrq $0x10, %rbx
xorq %rax, %rbx
movq %r12, %rsi
callq 0xdf01
movq %r15, %rsi
leaq 0x10118(%r14), %rax
movq %rax, -0x40(%rbp)
leaq 0x10(%r15), %rax
movq %rax, -0x50(%rbp)
movb $0x1, %al
movq %r14, -0x38(%rbp)
movq %r15, -0x58(%rbp)
movl %eax, -0x2c(%rbp)
movq 0x100d8(%r14), %rax
testq %rax, %rax
je 0xe0a4
movq %r12, %rcx
shrq $0x6, %rcx
movl %ecx, %edx
andl $0x3ff, %edx            # imm = 0x3FF
cmpq %rdx, (%rax)
jbe 0xe0a4
shrl $0x6, %edx
shrxq %rcx, 0x10(%rax,%rdx,8), %rax
andl $0x1, %eax
jmp 0xe0a6
xorl %eax, %eax
leaq (%rax,%rax,2), %rcx
movq -0x40(%rbp), %rdx
movq (%rdx,%rcx,8), %rax
movq 0x10(%rdx,%rcx,8), %r14
testq %rax, %rax
je 0xe12f
bzhiq %r14, %r12, %r15
shlq $0x6, %r15
addq %rax, %r15
xorl %r14d, %r14d
movq (%r15,%r14,8), %r12
movl %ebx, %eax
xorw %r12w, %ax
jne 0xe10d
cmpq $0x10000, %r12          # imm = 0x10000
jb 0xe10d
shrq $0x10, %r12
movq (%rsi), %r13
cmpq (%r12), %r13
jne 0xe10d
movl 0x8(%rsi), %edx
cmpl 0x8(%r12), %edx
jne 0xe10d
leaq 0x10(%r12), %rsi
movq -0x50(%rbp), %rdi
callq 0x63d0
movq -0x58(%rbp), %rsi
testl %eax, %eax
je 0xe14a
incq %r14
cmpq $0x8, %r14
jne 0xe0cb
movq -0x48(%rbp), %r12
testb $0x1, -0x2c(%rbp)
movl $0x0, %eax
movq -0x38(%rbp), %r14
jne 0xe072
jmp 0xe175
movq -0x40(%rbp), %rax
leaq (%rax,%rcx,8), %r15
movq %rsi, %r13
callq 0x66ef
movq %r13, %rsi
movq (%r15), %rax
jmp 0xe0bc
movq -0x38(%rbp), %rbx
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0xe166
movq %rsi, %r14
movq 0x28(%rbx), %rsi
movq %r12, %rdi
callq *%rax
movq (%r14), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0xdf98
movb $0x1, %al
jmp 0xe182
movq (%rsi), %rsi
movq %r14, %rdi
callq 0xdf98
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: cuckoo_set
bool
cuckoo_set(struct cuckoo * const map, const struct kv * const kv)
{
  const struct kv * const new = kv_alloc_dup(kv, &(map->mm));
  if (new == NULL) return false;
  if (map->fixed_power) {
    for (u64 i = 0; i < 8; i++) {
      if (cuckoo_try_set(map, new)) return true;
    }
    return false;
  } else {
    while (cuckoo_try_set(map, new) == false);
    return true;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
movl 0x8(%r15), %eax
movl 0xc(%r15), %ecx
leaq (%rax,%rcx), %r12
addq $0x10, %r12
movq %r12, %rdi
callq *(%rbx)
testq %rax, %rax
je 0xe21b
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x6340
cmpq $0x0, 0x100d0(%rbx)
je 0xe1ff
movq $-0x1, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe231
testb %al, %al
jne 0xe20e
incq %r15
cmpq $0x7, %r15
jne 0xe1e2
setb %bl
jmp 0xe210
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe231
testb %al, %al
je 0xe1ff
movb $0x1, %bl
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x66ef
xorl %ebx, %ebx
xorl %edi, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x6340
jmp 0xe210
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: cuckoo_del
bool
cuckoo_del(struct cuckoo * const map, const struct kv * const key)
{
  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)) {
          kvmap_put_entry(&(map->mm), &(slot->e[k]), NULL);
          cuckoo_unlock_two(map, key);
          return true;
        }
      }
    }
  }
  cuckoo_unlock_two(map, key);
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %r12
rorxq $0x2d, %r12, %rax
movq %rax, -0x48(%rbp)
movq %r12, %rax
shrq $0x20, %rax
xorq %r12, %rax
movq %rax, %r13
shrq $0x10, %r13
xorq %rax, %r13
movq %r12, %rsi
callq 0xdf01
leaq 0x10118(%rbx), %rax
movq %rax, -0x40(%rbp)
leaq 0x10(%r14), %rax
movq %rax, -0x50(%rbp)
movb $0x1, %al
movq %rbx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movq 0x100d8(%rbx), %rax
testq %rax, %rax
je 0xe544
movq %r12, %rcx
shrq $0x6, %rcx
movl %ecx, %edx
andl $0x3ff, %edx            # imm = 0x3FF
cmpq %rdx, (%rax)
jbe 0xe544
shrl $0x6, %edx
shrxq %rcx, 0x10(%rax,%rdx,8), %rax
andl $0x1, %eax
jmp 0xe546
xorl %eax, %eax
leaq (%rax,%rax,2), %rcx
movq -0x40(%rbp), %rdx
movq (%rdx,%rcx,8), %rax
movq 0x10(%rdx,%rcx,8), %rbx
testq %rax, %rax
je 0xe5cd
bzhiq %rbx, %r12, %rbx
shlq $0x6, %rbx
addq %rax, %rbx
xorl %r15d, %r15d
movq (%rbx,%r15,8), %r12
movl %r13d, %eax
xorw %r12w, %ax
jne 0xe5ab
cmpq $0x10000, %r12          # imm = 0x10000
jb 0xe5ab
shrq $0x10, %r12
movq (%r14), %rax
cmpq (%r12), %rax
jne 0xe5ab
movl 0x8(%r14), %edx
cmpl 0x8(%r12), %edx
jne 0xe5ab
leaq 0x10(%r12), %rsi
movq -0x50(%rbp), %rdi
callq 0x63d0
testl %eax, %eax
je 0xe5e2
incq %r15
cmpq $0x8, %r15
jne 0xe56b
movq -0x48(%rbp), %r12
testb $0x1, -0x34(%rbp)
movl $0x0, %eax
movq -0x30(%rbp), %rbx
jne 0xe512
jmp 0xe610
movq -0x40(%rbp), %rax
leaq (%rax,%rcx,8), %r15
callq 0x66ef
movq (%r15), %rax
jmp 0xe55c
movq -0x30(%rbp), %rdi
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0xe5fc
movq 0x18(%rdi), %rsi
movq %r12, %rdi
callq *%rax
movq -0x30(%rbp), %rdi
movq $0x0, (%rbx,%r15,8)
movq (%r14), %rsi
callq 0xdf98
movb $0x1, %al
jmp 0xe61d
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xdf98
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: cuckoo_clean
void
cuckoo_clean(struct cuckoo * const map)
{
  mutexlock_lock(&(map->expand_lock));
  for (u64 i = 0; i < KVMAP_HLOCK_NR; i++) {
    spinlock_lock(&(map->hlocks[i]));
  }
  for (u64 x = 0; x < 2; x++) {
    if (map->levels[x].table == NULL) continue;
    const u64 nr_slots = UINT64_C(1) << map->levels[x].power;
    for (u64 j = 0; j < nr_slots; j++) {
      struct __kvmap_slot * const slot = &(map->levels[x].table[j]);
      for (u64 k = 0; k < 8; k++) {
        if (slot->e[k].ptr) {
          kvmap_put_entry(&(map->mm), &(slot->e[k]), NULL);
        }
      }
    }
    pages_unmap(map->levels[x].table, map->levels[x].alloc_size);
    map->levels[x].table = NULL;
  }
  cuckoo_init(map);
  for (u64 i = 0; i < KVMAP_HLOCK_NR; i++) {
    spinlock_unlock(&(map->hlocks[i]));
  }
  mutexlock_unlock(&(map->expand_lock));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
leaq 0x10050(%rdi), %rbx
movq %rbx, %rdi
callq 0x65f0
cmpl $0xb, %eax
je 0xe647
movq %rbx, -0x48(%rbp)
testl %eax, %eax
jne 0xe78f
leaq 0x50(%r14), %rax
movq %rax, -0x40(%rbp)
movl $0x50, %ebx
leaq (%r14,%rbx), %rdi
callq 0x6050
cmpl $0x23, %eax
je 0xe78f
addq $0x40, %rbx
cmpq $0x10050, %rbx          # imm = 0x10050
jne 0xe66d
leaq 0x10118(%r14), %rcx
movb $0x1, %dl
xorl %eax, %eax
movq %rcx, -0x50(%rbp)
leaq (%rax,%rax,2), %rax
cmpq $0x0, (%rcx,%rax,8)
je 0xe734
movl %edx, -0x2c(%rbp)
leaq (%rcx,%rax,8), %rax
movq %rax, -0x38(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
xorl %r12d, %r12d
xorl %r13d, %r13d
movq -0x38(%rbp), %rax
movq (%rax), %rbx
addq %r12, %rbx
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rdi
cmpq $0x10000, %rdi          # imm = 0x10000
jb 0xe6f8
movq 0x10(%r14), %rax
testq %rax, %rax
je 0xe6f0
shrq $0x10, %rdi
movq 0x18(%r14), %rsi
callq *%rax
movq $0x0, (%rbx,%r15,8)
incq %r15
cmpq $0x8, %r15
jne 0xe6d0
incq %r13
movq -0x58(%rbp), %rax
shrxq %rax, %r13, %rax
addq $0x40, %r12
testq %rax, %rax
je 0xe6c3
movq -0x38(%rbp), %rbx
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
callq 0x6410
movq $0x0, (%rbx)
movq -0x50(%rbp), %rcx
movl -0x2c(%rbp), %edx
movl $0x1, %eax
testb $0x1, %dl
movl $0x0, %edx
jne 0xe69b
movq %r14, %rdi
callq 0xdca2
xorl %ebx, %ebx
movq -0x40(%rbp), %r14
leaq (%r14,%rbx), %rdi
callq 0x6320
addq $0x40, %rbx
cmpq $0x10000, %rbx          # imm = 0x10000
jne 0xe755
movq -0x48(%rbp), %rbx
movq %rbx, %rdi
callq 0x6390
cmpl $0xb, %eax
je 0xe76f
testl %eax, %eax
jne 0xe78f
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x6530
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: cuckoo_destroy
void
cuckoo_destroy(struct cuckoo * const map)
{
  cuckoo_clean(map);
  for (u64 x = 0; x < 2; x++) {
    if (map->levels[x].table) {
      pages_unmap(map->levels[x].table, map->levels[x].alloc_size);
    }
  }
  free(map->bm);
  free(map);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xe62c
leaq 0x10118(%rbx), %r14
movb $0x1, %r15b
xorl %eax, %eax
leaq (%rax,%rax,2), %rax
movq (%r14,%rax,8), %rdi
testq %rdi, %rdi
je 0xe7ce
leaq (%r14,%rax,8), %rax
movq 0x8(%rax), %rsi
callq 0x6410
movl $0x1, %eax
testb $0x1, %r15b
movl $0x0, %r15d
jne 0xe7b4
movq 0x100d8(%rbx), %rdi
callq 0x6060
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6060
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: cuckoo_fprint
void
cuckoo_fprint(struct cuckoo * const map, FILE * const out)
{
  mutexlock_lock(&(map->expand_lock));
  for (u64 x = 0; x < 2; x++) {
    if (map->levels[x].table == NULL) continue;
    const u64 power = map->levels[x].power;
    const u64 nr_slots = KVMAP_SLOTS_OF(power);
    const u64 nr_entries = nr_slots * 8;
    fprintf(out, "CUCKOO POWER %"PRIu64" ENTRY %"PRIu64"\n", power, nr_entries);
  }
  mutexlock_unlock(&(map->expand_lock));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
leaq 0x10050(%rdi), %rbx
movq %rbx, %rdi
callq 0x65f0
cmpl $0xb, %eax
je 0xe818
testl %eax, %eax
jne 0xe897
addq $0x10118, %r15          # imm = 0x10118
movb $0x1, %r13b
leaq 0x5cfa(%rip), %r12      # 0x14534
xorl %eax, %eax
leaq (%rax,%rax,2), %rax
cmpq $0x0, (%r15,%rax,8)
je 0xe866
leaq (%r15,%rax,8), %rax
movq 0x10(%rax), %rdx
movl $0x8, %eax
shlxq %rdx, %rax, %rcx
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x6300
movl $0x1, %eax
testb $0x1, %r13b
movl $0x0, %r13d
jne 0xe83c
movq %rbx, %rdi
callq 0x6390
cmpl $0xb, %eax
je 0xe877
testl %eax, %eax
jne 0xe897
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x6530
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: cuckoo_iter_create
struct cuckoo_iter *
cuckoo_iter_create(struct cuckoo * const map)
{
  struct cuckoo_iter * const iter = (typeof(iter))malloc(sizeof(*iter));
  if (iter == NULL) {
    return NULL;
  }
  mutexlock_lock(&(map->expand_lock));
  for (u64 i = 0; i < KVMAP_HLOCK_NR; i++) {
    spinlock_lock(&(map->hlocks[i]));
  }
  iter->map = map;
  iter->level = map->levels[0].table ? &map->levels[0] : &map->levels[1];
  iter->j = 0;
  iter->k = 0;
  return iter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x20, %edi
callq 0x63a0
movq %rax, %rbx
testq %rax, %rax
je 0xe920
leaq 0x10050(%r14), %r15
movq %r15, %rdi
callq 0x65f0
cmpl $0xb, %eax
je 0xe8c4
testl %eax, %eax
jne 0xe92e
movl $0x50, %r15d
leaq (%r14,%r15), %rdi
callq 0x6050
cmpl $0x23, %eax
je 0xe92e
addq $0x40, %r15
cmpq $0x10050, %r15          # imm = 0x10050
jne 0xe8db
movq %r14, (%rbx)
leaq 0x10118(%r14), %rax
cmpq $0x0, 0x10118(%r14)
leaq 0x10130(%r14), %rcx
cmoveq %rcx, %rax
movq %rax, 0x8(%rbx)
vxorps %xmm0, %xmm0, %xmm0
vmovups %xmm0, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x6530
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: cuckoo_iter_next
struct kv *
cuckoo_iter_next(struct cuckoo_iter * const iter, struct kv * const out)
{
  u64 j = iter->j;
  u64 k = iter->k;
  struct __cuckoo_level * const level= iter->level;

  const u64 nr = KVMAP_SLOTS_OF(level->power);
  if (j >= nr) return NULL;
  while ((j < nr) && (level->table[j].e[k].ptr == 0)) {
    k++;
    if (k == 8) {
      j++;
      k = 0;
    }
  }
  struct kv * ret = NULL;
  if (j < nr) {
    struct kv * kv = __u64_to_ptr(level->table[j].e[k].ptr);
    ret = kv_dup2(kv, out);
    k++;
    if (k == 8) {
      k = 0;
      j++;
    }
  }
  iter->j = j;
  iter->k = k;
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %r13
movb 0x10(%rax), %cl
movl $0x1, %edx
shlxq %rcx, %rdx, %rcx
cmpq %rcx, %r13
jae 0xe99e
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %r12
movq (%rax), %rdx
xorl %eax, %eax
movq %r13, %rsi
shlq $0x6, %rsi
addq %rdx, %rsi
movq (%rsi,%r12,8), %r15
cmpq $0xffff, %r15           # imm = 0xFFFF
ja 0xe9a2
incq %r12
xorl %esi, %esi
cmpq $0x8, %r12
sete %sil
cmoveq %rax, %r12
addq %rsi, %r13
cmpq %rcx, %r13
jb 0xe96c
jmp 0xe9f4
xorl %eax, %eax
jmp 0xe9fc
shrq $0x10, %r15
movl 0x8(%r15), %eax
movl 0xc(%r15), %ecx
leaq (%rax,%rcx), %rdx
addq $0x10, %rdx
testq %r14, %r14
jne 0xe9d1
movq %rdx, %rdi
movq %rdx, %r14
callq 0x63a0
movq %r14, %rdx
movq %rax, %r14
testq %rax, %rax
je 0xea0b
movq %r14, %rdi
movq %r15, %rsi
callq 0x6340
incq %r12
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x8, %r12
sete %cl
cmoveq %rax, %r12
addq %rcx, %r13
movq %r14, %rax
movq %r13, 0x10(%rbx)
movq %r12, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
jmp 0xe9dc
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: cuckoo_iter_destroy
void
cuckoo_iter_destroy(struct cuckoo_iter * const iter)
{
  struct cuckoo * const map = iter->map;
  for (u64 i = 0; i < KVMAP_HLOCK_NR; i++) {
    spinlock_unlock(&(map->hlocks[i]));
  }
  mutexlock_unlock(&(map->expand_lock));
  free(iter);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
leaq 0x50(%r14), %r15
xorl %r12d, %r12d
leaq (%r15,%r12), %rdi
callq 0x6320
addq $0x40, %r12
cmpq $0x10000, %r12          # imm = 0x10000
jne 0xea28
addq $0x10050, %r14          # imm = 0x10050
movq %r14, %rdi
callq 0x6390
cmpl $0xb, %eax
je 0xea45
testl %eax, %eax
jne 0xea66
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6060
xorl %edi, %edi
callq 0x6530
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: skiplist_create_f
struct skiplist *
skiplist_create_f(const struct kvmap_mm * const mm, kv_compare_func comp)
{
  struct skiplist * const head = (typeof(head))malloc(sizeof(*head));
  memset(head, 0, sizeof(*head));
  head->mm = mm ? (*mm) : __kvmap_mm_default;
  head->comp = comp;
  head->height = 1;
  head->factors[0] = 1.0;
  const double factor = 0.25;
  const double mul = fabs(factor) > 0.5 ? 0.5 : fabs(factor);
  for (u64 i = 1; i < 64; i++) {
    head->factors[i] = head->factors[i-1] * mul;
  }
  return head;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x468, %esi            # imm = 0x468
callq 0x62d0
testq %r14, %r14
je 0xeb42
vmovups (%r14), %ymm0
vmovups 0x20(%r14), %ymm1
vmovups 0x30(%r14), %ymm2
vmovups %ymm2, 0x30(%rax)
vmovups %ymm1, 0x20(%rax)
jmp 0xeb64
vmovups 0xb26e(%rip), %ymm0     # 0x19db8
vmovups %ymm0, 0x30(%rax)
vmovups 0xb251(%rip), %ymm0     # 0x19da8
vmovups %ymm0, 0x20(%rax)
vmovups 0xb224(%rip), %ymm0     # 0x19d88
vmovups %ymm0, (%rax)
movq %rbx, 0x50(%rax)
movq $0x1, 0x258(%rax)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x58(%rax)
vmovsd 0x54eb(%rip), %xmm0     # 0x14078
movl $0xc, %ecx
vmovsd 0x5526(%rip), %xmm1     # 0x140c0
vmulsd %xmm1, %xmm0, %xmm0
vmovsd %xmm0, (%rax,%rcx,8)
incq %rcx
cmpq $0x4b, %rcx
jne 0xeb9a
popq %rbx
popq %r14
popq %rbp
vzeroupper
retq
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: skiplist_probe
bool
skiplist_probe(struct skiplist * const list, const struct kv * const key)
{
  u64 h = list->height - 1;
  struct skipnode * left = &(list->n0);
  struct skipnode * right = NULL;
  while (h) {
    while (left->next[h]) {
      right = left->next[h];
      struct kv * const curr = __u64_to_ptr(right->e.ptr);
      debug_assert(curr);
      const int cmp = list->comp(key, curr);
      if (cmp == 0) {
        if (list->mm.hf) list->mm.hf(curr, list->mm.hp);
        return true;
      } else if (cmp < 0) {
        break;
      } else {
        left = right;
      }
    }
    h--;
  }
  const u64 pkey = kvmap_pkey(key->hash);
  if (left) left = left->next[0];
  while (left && (left != right)) {
    struct kv * const curr = __u64_to_ptr(left->e.ptr);
    if (kvmap_pkey(curr->hash) == pkey) {
      if (kv_keymatch(curr, key)) {
        if (list->mm.hf) list->mm.hf(curr, list->mm.hp);
        return true;
      }
    }
    left = left->next[0];
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x30(%rbp)
movq %rdi, %r14
movq 0x258(%rdi), %r13
leaq 0x260(%rdi), %r12
xorl %ebx, %ebx
decq %r13
je 0xee03
movq 0x8(%r12,%r13,8), %rax
testq %rax, %rax
je 0xeda1
movq %rax, %rbx
movq (%rax), %r15
cmpq $0xffff, %r15           # imm = 0xFFFF
jbe 0xedde
shrq $0x10, %r15
movq -0x30(%rbp), %rdi
movq %r15, %rsi
callq *0x50(%r14)
testl %eax, %eax
je 0xede5
js 0xeda1
movq 0x8(%rbx,%r13,8), %rax
movq %rbx, %r12
jmp 0xedab
callq 0x66ef
jmp 0xedbf
movq 0x20(%r14), %rax
movb $0x1, %r12b
testq %rax, %rax
je 0xee94
movq 0x28(%r14), %rsi
movq %r15, %rdi
callq *%rax
jmp 0xee94
movq 0x8(%r12), %r15
xorl %r12d, %r12d
testq %r15, %r15
je 0xee94
movq %r14, -0x38(%rbp)
cmpq %rbx, %r15
je 0xee94
movq -0x30(%rbp), %rax
movq (%rax), %rsi
movq %rsi, %r14
shrq $0x20, %r14
xorq %rsi, %r14
addq $0x10, %rax
movq %rax, -0x40(%rbp)
movq (%r15), %r13
shrq $0x10, %r13
movq (%r13), %rax
movq %rax, %rcx
shrq $0x20, %rcx
xorl %eax, %ecx
movl %ecx, %edx
xorl %r14d, %edx
shrl $0x10, %edx
xorl %r14d, %edx
xorw %cx, %dx
jne 0xee83
cmpq %rsi, %rax
jne 0xee83
movl 0x8(%r13), %edx
movq -0x30(%rbp), %rax
cmpl 0x8(%rax), %edx
jne 0xee83
leaq 0x10(%r13), %rdi
movq %rsi, %r12
movq -0x40(%rbp), %rsi
callq 0x63d0
movq %r12, %rsi
testl %eax, %eax
je 0xeea6
movq 0x8(%r15), %r15
xorl %r12d, %r12d
testq %r15, %r15
je 0xee94
cmpq %rbx, %r15
jne 0xee36
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x38(%rbp), %rcx
movq 0x20(%rcx), %rax
movb $0x1, %r12b
testq %rax, %rax
je 0xee94
movq 0x28(%rcx), %rsi
movq %r13, %rdi
jmp 0xedfc
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: skiplist_del
bool
skiplist_del(struct skiplist * const list, const struct kv * const key)
{
  u64 h = list->height - 1;
  struct skipnode * left = &(list->n0);
  struct skipnode * right = NULL;
  struct skipnode * del = NULL;
  while ((h < 64) && (del == NULL)) {
    while (left->next[h]) {
      right = left->next[h];
      struct kv * const curr = __u64_to_ptr(right->e.ptr);
      debug_assert(curr);
      const int cmp = list->comp(key, curr);
      if (cmp == 0) {
        del = right;
        break;
      } else if (cmp < 0) {
        break;
      } else {
        left = right;
      }
    }
    h--;
  }

  if (del == NULL) {
    return false;
  }
  h++;
  const u64 depth = h+1;
  struct skipnode *path[depth];
  while (h < 64) {
    while (left->next[h] != del) {
      left = left->next[h];
    }
    path[h] = left;
    h--;
  }
  for (u64 i = 0; i < depth; i++) {
    path[i]->next[i] = del->next[i];
  }
  kvmap_put_entry(&(list->mm), &(del->e), NULL);
  free(del);
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x38(%rbp)
movq 0x258(%rdi), %rcx
leaq -0x1(%rcx), %rax
cmpq $0x3f, %rax
ja 0xf297
movq %rdi, %rbx
leaq 0x260(%rdi), %r13
movq %rax, %rsi
movq %rcx, -0x30(%rbp)
xorl %r14d, %r14d
movq %rax, -0x40(%rbp)
movq 0x8(%r13,%rsi,8), %r15
testq %r15, %r15
je 0xf1e5
movq (%r15), %r12
cmpq $0xffff, %r12           # imm = 0xFFFF
jbe 0xf1de
shrq $0x10, %r12
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq *0x50(%rbx)
testl %eax, %eax
cmoveq %r15, %r14
cmovgq %r15, %r13
movq -0x40(%rbp), %rsi
jg 0xf1a8
jmp 0xf1e5
callq 0x66ef
jmp 0xf1be
leaq -0x1(%rsi), %rax
cmpq $0x3f, %rax
movq -0x30(%rbp), %rcx
ja 0xf1fb
decq %rcx
testq %r14, %r14
je 0xf19a
testq %r14, %r14
je 0xf297
movq %rsp, %r15
leaq 0x1(%rsi), %rcx
movq %rsp, %rax
leaq 0x17(,%rsi,8), %rdx
andq $-0x10, %rdx
subq %rdx, %rax
movq %rax, %rsp
cmpq $0x3f, %rsi
ja 0xf243
movq %r13, %rdx
movq %rdx, %r13
movq 0x8(%rdx,%rsi,8), %rdx
cmpq %r14, %rdx
jne 0xf229
movq %r13, (%rax,%rsi,8)
decq %rsi
cmpq $0x40, %rsi
jb 0xf226
testq %rcx, %rcx
movq -0x30(%rbp), %rdi
je 0xf265
xorl %ecx, %ecx
movq 0x8(%r14,%rcx), %rdx
movq (%rax,%rcx), %rsi
movq %rdx, 0x8(%rsi,%rcx)
addq $0x8, %rcx
decq %rdi
jne 0xf24e
movq (%r14), %rdi
cmpq $0x10000, %rdi          # imm = 0x10000
jb 0xf284
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0xf284
shrq $0x10, %rdi
movq 0x18(%rbx), %rsi
callq *%rax
testq %r14, %r14
setne %bl
movq %r14, %rdi
callq 0x6060
movq %r15, %rsp
jmp 0xf299
xorl %ebx, %ebx
movl %ebx, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: skiplist_clean
void
skiplist_clean(struct skiplist * const list)
{
  struct skipnode * iter = list->n0.next[0];
  while (iter) {
    struct skipnode * const next = iter->next[0];
    kvmap_put_entry(&(list->mm), &(iter->e), NULL);
    free(iter);
    iter = next;
  }
  for (u64 i = 0; i < 64; i++) {
    list->n0.next[i] = NULL;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x268(%rdi), %rbx
movq 0x268(%rdi), %r12
testq %r12, %r12
je 0xf300
movq %rdi, %r14
movq %r12, %r15
movq (%r12), %rdi
movq 0x8(%r12), %r12
cmpq $0x10000, %rdi          # imm = 0x10000
jb 0xf2f3
movq 0x10(%r14), %rax
testq %rax, %rax
je 0xf2f3
shrq $0x10, %rdi
movq 0x18(%r14), %rsi
callq *%rax
movq %r15, %rdi
callq 0x6060
testq %r12, %r12
jne 0xf2cb
movl $0x200, %edx            # imm = 0x200
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6210
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: skiplist_fprint
void
skiplist_fprint(struct skiplist * const list, FILE * const out)
{
  struct skipnode * iter = list->n0.next[0];
  u64 count = 0;
  while (iter) {
    count++;
    iter = iter->next[0];
  }
  fprintf(out, "%s count %"PRIu64" height %"PRIu64"\n", __func__, count, list->height);
}

// Assembly:
movq %rsi, %rax
movq 0x268(%rdi), %rdx
testq %rdx, %rdx
je 0xf357
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
incq %rcx
movq 0x8(%rdx), %rdx
testq %rdx, %rdx
jne 0xf348
popq %rbp
jmp 0xf359
xorl %ecx, %ecx
movq 0x258(%rdi), %r8
leaq 0x51e9(%rip), %rsi      # 0x14550
leaq 0x51fb(%rip), %rdx      # 0x14569
movq %rax, %rdi
xorl %eax, %eax
jmp 0x6300
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: skiplist_head
struct kv *
skiplist_head(struct skiplist * const list, struct kv * const out)
{
  if (list->n0.next[0] == NULL) return NULL;
  struct kv * const curr = __u64_to_ptr(list->n0.next[0]->e.ptr);
  struct kv * const ret = kv_dup2(curr, out);
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x268(%rdi), %rax
testq %rax, %rax
je 0xf397
movq (%rax), %rbx
cmpq $0x10000, %rbx          # imm = 0x10000
jae 0xf39e
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
shrq $0x10, %rbx
movl 0x8(%rbx), %eax
movl 0xc(%rbx), %ecx
leaq (%rax,%rcx), %r14
addq $0x10, %r14
testq %rsi, %rsi
jne 0xf3c5
movq %r14, %rdi
callq 0x63a0
movq %rax, %rsi
testq %rax, %rax
je 0xf397
movq %rsi, %rdi
movq %rbx, %rsi
movq %r14, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x6340
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: skiplist_tail
struct kv *
skiplist_tail(struct skiplist * const list, struct kv * const out)
{
  if (list->n0.next[0] == NULL) return NULL;
  u64 i = list->height - 1;
  struct skipnode * iter = &(list->n0);
  while (i) {
    while (iter->next[i]) iter = iter->next[i];
    i--;
  }
  while (iter->next[0]) iter = iter->next[0];
  struct kv * const curr = __u64_to_ptr(iter->e.ptr);
  struct kv * const ret = kv_dup2(curr, out);
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpq $0x0, 0x268(%rdi)
je 0xf425
movq 0x258(%rdi), %rax
addq $0x260, %rdi            # imm = 0x260
decq %rax
je 0xf40d
movq %rdi, %rcx
movq %rcx, %rdi
movq 0x8(%rcx,%rax,8), %rcx
testq %rcx, %rcx
jne 0xf3fe
jmp 0xf3f6
movq %rdi, %rax
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
jne 0xf40d
movq (%rax), %rbx
cmpq $0x10000, %rbx          # imm = 0x10000
jae 0xf42c
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
shrq $0x10, %rbx
movl 0x8(%rbx), %eax
movl 0xc(%rbx), %ecx
leaq (%rax,%rcx), %r14
addq $0x10, %r14
testq %rsi, %rsi
jne 0xf453
movq %r14, %rdi
callq 0x63a0
movq %rax, %rsi
testq %rax, %rax
je 0xf425
movq %rsi, %rdi
movq %rbx, %rsi
movq %r14, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x6340
// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: skiplist_iter_next
struct kv *
skiplist_iter_next(struct skiplist_iter * const iter, struct kv * const out)
{
  if (iter->iter == NULL) return NULL;
  struct kv * const curr = __u64_to_ptr(iter->iter->e.ptr);
  struct kv * const ret = kv_dup2(curr, out);
  iter->iter = iter->iter->next[0];
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r13
testq %r13, %r13
je 0xf4b7
movq %rdi, %r14
movq (%r13), %r15
cmpq $0x10000, %r15          # imm = 0x10000
jae 0xf4bb
xorl %ebx, %ebx
jmp 0xf4f8
xorl %ebx, %ebx
jmp 0xf4ff
movq %rsi, %rbx
shrq $0x10, %r15
movl 0x8(%r15), %eax
movl 0xc(%r15), %ecx
leaq (%rax,%rcx), %r12
addq $0x10, %r12
testq %rsi, %rsi
jne 0xf4e7
movq %r12, %rdi
callq 0x63a0
movq %rax, %rbx
testq %rax, %rax
je 0xf4b3
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x6340
movq (%r14), %r13
movq 0x8(%r13), %rax
movq %rax, (%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq