LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: bptree_intm_locate
static u64
bptree_intm_locate(struct bpnode * const node, const struct kv * const key)
{
  if (node->nr < 2) {
    return 0;
  }
  u64 l = 0;
  u64 r = node->nr - 1;
  while (l < r) {
    const u64 m = (l + r + 1) >> 1;
    const int cmp = kv_keycompare(key, node->iarray[m].key);
    if (cmp < 0) {
      r = m - 1;
    } else if (cmp > 0) {
      l = m;
    } else {
      return m;
    }
  }
  return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x2, 0x8(%rax)
jae 0x14118
movq $0x0, -0x8(%rbp)
jmp 0x141a9
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
subq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x141a1
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
addq $0x1, %rax
shrq %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq -0x30(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0xe250
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x14183
movq -0x30(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1419f
cmpl $0x0, -0x34(%rbp)
jle 0x14193
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x1419d
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x141a9
jmp 0x1419f
jmp 0x14130
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: bptree_set_rec
static bool
bptree_set_rec(struct bptree * const tree, struct bpnode * const parent, const u64 subidx, const struct kv * const kv)
{
  debug_assert(parent->leaf == false);

  struct bpnode * const sub = parent->iarray[subidx].sub;
  if (sub->leaf) {
    if (sub->nr == BPTREE_LEAF_FO) {
      bptree_split_leaf(parent, subidx);
      const u64 subidx1 = bptree_intm_locate(parent, kv);
      return bptree_set_rec(tree, parent, subidx1, kv);
    } else {
      return bptree_set_leaf(tree, sub, kv);
    }
  } else {
    if (sub->nr == BPTREE_INTM_FO) {
      bptree_split_intm(parent, subidx);
      const u64 subidx1 = bptree_intm_locate(parent, kv);
      return bptree_set_rec(tree, parent, subidx1, kv);
    } else {
      const u64 subsubidx = bptree_intm_locate(sub, kv);
      return bptree_set_rec(tree, sub, subsubidx, kv);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
movzbl %al, %edi
andl $0x1, %edi
callq 0x7640
movq -0x18(%rbp), %rax
addq $0x20, %rax
movq -0x20(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
testb $0x1, (%rax)
je 0x1427b
movq -0x30(%rbp), %rax
cmpq $0x1f4, 0x8(%rax)       # imm = 0x1F4
jne 0x14263
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x19cd0
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x140f0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x141c0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x142ee
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x13f50
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x142ee
movq -0x30(%rbp), %rax
cmpq $0xfa, 0x8(%rax)
jne 0x142c3
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x19d80
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x140f0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x141c0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x142ee
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x140f0
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x141c0
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: bptree_clean_rec
void
bptree_clean_rec(struct bptree * const tree, struct bpnode * const node)
{
  if (node->leaf) {
    for (u64 i = 0; i < node->nr; i++) {
      struct kv * const victim = (typeof(victim))(node->karray[i]);
      if (victim && tree->mm.rf) tree->mm.rf(victim, tree->mm.rp);
    }
  } else {
    for (u64 i = 0; i < node->nr; i++) {
      struct kv * const victim = (typeof(victim))(node->iarray[i].key);
      free(victim);
      bptree_clean_rec(tree, node->iarray[i].sub);
    }
  }
  pages_unmap(node, PGSZ);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, (%rax)
je 0x143ba
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x143b8
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x143a8
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x143a8
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rsi
callq *%rax
jmp 0x143aa
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x14361
jmp 0x14423
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x14421
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq -0x28(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x6060
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq -0x28(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
callq 0x14340
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x143c2
jmp 0x14423
movq -0x10(%rbp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x8c10
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: bptree_iter_create
struct bptree_iter *
bptree_iter_create(struct bptree * const tree)
{
  struct bptree_iter * const iter = (typeof(iter))malloc(sizeof(*iter));
  struct bpnode * node = tree->root;
  while (node->leaf == false) {
    node = node->iarray[0].sub;
  }
  u64 i = 1;
  while (i >= node->nr) {
    i = 0;
    node = node->next;
  }
  iter->curr = node;
  iter->i = i;
  debug_assert(node->karray[0] == NULL);
  return iter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x10, %edi
callq 0x6380
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x14524
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x14506
movq $0x1, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jb 0x14550
movq $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x1452c
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
sete %al
movzbl %al, %edi
andl $0x1, %edi
callq 0x7640
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: bptree_iter_next
struct kv *
bptree_iter_next(struct bptree_iter * const iter, struct kv * const out)
{
  struct bpnode * curr = iter->curr;
  if (curr == NULL) {
    return NULL;
  }
  debug_assert(curr->nr);
  u64 i = iter->i;
  struct kv * const ret = kv_dup2(curr->karray[i], out);
  i++;
  if (i >= curr->nr) {
    i = 0;
    curr = curr->next;
    iter->curr = curr;
  }
  iter->i = i;
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x145bf
movq $0x0, -0x8(%rbp)
jmp 0x14649
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
setne %al
movzbl %al, %edi
andl $0x1, %edi
callq 0x7640
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x20(%rax,%rcx,8), %rdi
movq -0x18(%rbp), %rsi
callq 0xdfb0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jb 0x14635
movq $0x0, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: bptree_api_create
struct kvmap_api *
bptree_api_create(struct bptree * const map)
{
  if (map == NULL) return NULL;
  const struct kvmap_api api = {
    .map = map,
    .get = (typeof(api.get))bptree_get,
    .probe = (typeof(api.probe))bptree_probe,
    .set = (typeof(api.set))bptree_set,
    .del = (typeof(api.del))bptree_del,
    .clean = (typeof(api.clean))bptree_clean,
    .destroy = (typeof(api.destroy))bptree_destroy,
    .fprint = (typeof(api.fprint))bptree_fprint,
    .iter_create = (typeof(api.iter_create))bptree_iter_create,
    .iter_next = (typeof(api.iter_next))bptree_iter_next,
    .iter_destroy = (typeof(api.iter_destroy))bptree_iter_destroy,
  };
  struct kvmap_api * const papi = (typeof(papi))malloc(sizeof(*papi));
  *papi = api;
  return papi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x146a0
movq $0x0, -0x8(%rbp)
jmp 0x1473e
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0xd4f(%rip), %rax      # 0x13960
movq %rax, -0x60(%rbp)
leaq -0xc7a(%rip), %rax      # 0x13a40
movq %rax, -0x58(%rbp)
leaq -0x905(%rip), %rax      # 0x13dc0
movq %rax, -0x50(%rbp)
leaq -0x3d0(%rip), %rax      # 0x14300
movq %rax, -0x48(%rbp)
leaq -0x29b(%rip), %rax      # 0x14440
movq %rax, -0x40(%rbp)
leaq -0x256(%rip), %rax      # 0x14490
movq %rax, -0x38(%rbp)
leaq -0x221(%rip), %rax      # 0x144d0
movq %rax, -0x30(%rbp)
leaq -0x21c(%rip), %rax      # 0x144e0
movq %rax, -0x28(%rbp)
leaq -0x177(%rip), %rax      # 0x14590
movq %rax, -0x20(%rbp)
leaq -0xb2(%rip), %rax       # 0x14660
movq %rax, -0x18(%rbp)
movl $0x58, %edi
callq 0x6380
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movl $0x58, %edx
callq 0x6320
movq -0x70(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: tcpmap_create
struct tcpmap *
tcpmap_create(const char * const host, const int port)
{
  struct stream2 * const s = stream2_create(host, port);
  if (s == NULL) {
    return NULL;
  }

  struct tcpmap * const tcpmap = (typeof(tcpmap))malloc(sizeof(*tcpmap));
  tcpmap->stream2 = s;
  tcpmap->ok = true;
  return tcpmap;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xda00
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x14780
movq $0x0, -0x8(%rbp)
jmp 0x147a9
movl $0x10, %edi
callq 0x6380
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movb $0x1, 0x8(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: tcpmap_get
struct kv *
tcpmap_get(struct tcpmap * const map, const struct kv * const key, struct kv * const out)
{
  bool ret = false;
  const bool req = __tcpmap_request('G', map, key, &ret);
  if (req == false || ret == false) {
    return NULL;
  }

  struct kv head = {};
  if (fread(&head, sizeof(head), 1, map->stream2->r) != 1) {
    map->ok = false;
    return NULL;
  }
  const bool alloc = (out == NULL) ? true : false;
  struct kv * const kv = alloc ? (typeof(kv))malloc(kv_size(&head)) : out;
  if (kv == NULL) {
    return NULL;
  }
  memcpy(kv, &head, sizeof(head));
  if (fread(kv->kv, kv->klen + kv->vlen, 1, map->stream2->r) != 1) {
    map->ok = false;
    if (alloc) free(kv);
    return NULL;
  }
  return kv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movb $0x0, -0x21(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x47, %edi
leaq -0x21(%rbp), %rcx
callq 0x14940
andb $0x1, %al
movb %al, -0x22(%rbp)
movb -0x22(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x1480d
movb -0x21(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1481a
movq $0x0, -0x8(%rbp)
jmp 0x1492f
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x6200
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
leaq -0x38(%rbp), %rdi
movl $0x10, %esi
movl $0x1, %edx
callq 0x60f0
cmpq $0x1, %rax
je 0x14863
movq -0x10(%rbp), %rax
movb $0x0, 0x8(%rax)
movq $0x0, -0x8(%rbp)
jmp 0x1492f
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl $0x1, %ecx
cmpq $0x0, %rdx
cmovel %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x39(%rbp)
testb $0x1, -0x39(%rbp)
je 0x1489d
leaq -0x38(%rbp), %rdi
callq 0xdbe0
movq %rax, %rdi
callq 0x6380
movq %rax, -0x50(%rbp)
jmp 0x148a5
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x148be
movq $0x0, -0x8(%rbp)
jmp 0x1492f
movq -0x48(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rdi
addq $0x10, %rdi
movq -0x48(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x48(%rbp), %rcx
addl 0xc(%rcx), %eax
movl %eax, %eax
movl %eax, %esi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
movl $0x1, %edx
callq 0x60f0
cmpq $0x1, %rax
je 0x14927
movq -0x10(%rbp), %rax
movb $0x0, 0x8(%rax)
testb $0x1, -0x39(%rbp)
je 0x1491d
movq -0x48(%rbp), %rdi
callq 0x6060
movq $0x0, -0x8(%rbp)
jmp 0x1492f
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: _tcpmap_request
static bool
__tcpmap_request(const char op, struct tcpmap * const map, const struct kv * const kv, bool * const ret)
{
  if (map->ok == false) {
    return false;
  }
  if (fwrite(&op, sizeof(op), 1, map->stream2->w) != 1) {
    map->ok = false;
    return false;
  }
  const size_t sz = (op == 'S') ? kv_size(kv) : key_size(kv);
  if (fwrite(kv, sz, 1, map->stream2->w) != 1) {
    map->ok = false;
    return false;
  }
  fflush(map->stream2->w);

  if (fread(ret, sizeof(*ret), 1, map->stream2->r) != 1) {
    map->ok = false;
    return false;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %dil, %al
movb %al, -0x2(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movb 0x8(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x14974
movb $0x0, -0x1(%rbp)
jmp 0x14a46
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
leaq -0x2(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x6520
cmpq $0x1, %rax
je 0x149a6
movq -0x10(%rbp), %rax
movb $0x0, 0x8(%rax)
movb $0x0, -0x1(%rbp)
jmp 0x14a46
movsbl -0x2(%rbp), %eax
cmpl $0x53, %eax
jne 0x149be
movq -0x18(%rbp), %rdi
callq 0xdbe0
movq %rax, -0x30(%rbp)
jmp 0x149cb
movq -0x18(%rbp), %rdi
callq 0xdc80
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
movl $0x1, %edx
callq 0x6520
cmpq $0x1, %rax
je 0x14a03
movq -0x10(%rbp), %rax
movb $0x0, 0x8(%rax)
movb $0x0, -0x1(%rbp)
jmp 0x14a46
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
callq 0x6390
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
movl $0x1, %edx
movq %rdx, %rsi
callq 0x60f0
cmpq $0x1, %rax
je 0x14a42
movq -0x10(%rbp), %rax
movb $0x0, 0x8(%rax)
movb $0x0, -0x1(%rbp)
jmp 0x14a46
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: tcpmap_clean
void
tcpmap_clean(struct tcpmap * const map)
{
  if (map->ok == false) return;
  const char op = 'C';
  if (fwrite(&op, sizeof(op), 1, map->stream2->w) != 1) {
    map->ok = false;
    return;
  }
  fflush(map->stream2->w);
  bool ret = false;
  if (fread(&ret, sizeof(ret), 1, map->stream2->r) != 1) {
    map->ok = false;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb 0x8(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x14b6f
jmp 0x14bdb
movb $0x43, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
leaq -0x9(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x6520
cmpq $0x1, %rax
je 0x14b9e
movq -0x8(%rbp), %rax
movb $0x0, 0x8(%rax)
jmp 0x14bdb
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
callq 0x6390
movb $0x0, -0xa(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
leaq -0xa(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x60f0
cmpq $0x1, %rax
je 0x14bdb
movq -0x8(%rbp), %rax
movb $0x0, 0x8(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: tcpmap_api_create
struct kvmap_api *
tcpmap_api_create(struct tcpmap * const map)
{
  if (map == NULL) return NULL;
  const struct kvmap_api api = {
    .map = map,
    .get = (typeof(api.get))tcpmap_get,
    .probe = (typeof(api.probe))tcpmap_probe,
    .set = (typeof(api.set))tcpmap_set,
    .del = (typeof(api.del))tcpmap_del,
    .clean = (typeof(api.clean))tcpmap_clean,
    .destroy = (typeof(api.destroy))tcpmap_destroy,
  };
  struct kvmap_api * const papi = (typeof(papi))malloc(sizeof(*papi));
  *papi = api;
  return papi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x14c40
movq $0x0, -0x8(%rbp)
jmp 0x14cd2
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x48f(%rip), %rax      # 0x147c0
movq %rax, -0x60(%rbp)
leaq -0x1fa(%rip), %rax      # 0x14a60
movq %rax, -0x58(%rbp)
leaq -0x1b5(%rip), %rax      # 0x14ab0
movq %rax, -0x50(%rbp)
leaq -0x170(%rip), %rax      # 0x14b00
movq %rax, -0x48(%rbp)
leaq -0x12b(%rip), %rax      # 0x14b50
movq %rax, -0x40(%rbp)
leaq -0x96(%rip), %rax       # 0x14bf0
movq %rax, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x58, %edi
callq 0x6380
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movl $0x58, %edx
callq 0x6320
movq -0x70(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: icache_get
struct kv *
icache_get(struct icache * const cache, const struct kv * const key, struct kv * const out)
{
  const u64 hash = key->hash;
  const u64 idx = (hash >> KVMAP_BASE_LEVEL) % cache->nr_slots;
  struct __icache_slot * const slot = &(cache->table[idx]);
  __builtin_prefetch(slot, 0, 3);
  const u64 pkey = kvmap_pkey(hash);
  icache_lock_hash(cache, hash);
  for (u64 i = 0; i < ICACHE_ENTRY_NR; i++) {
    if (slot->e[i].pkey == pkey) {
      struct kv * const curr = __u64_to_ptr(slot->e[i].ptr);
      if (kv_keymatch(curr, key)) {
        icache_amap_inc(slot, i);
        struct kv * const ret = kv_dup2(curr, out);
        icache_unlock_hash(cache, hash);
        // cache hit
        return ret;
      }
    }
  }
  struct kv * const ret2 = cache->map_api->get(cache->map_api->map, key, out);
  // index hit/miss
  icache_unlock_hash(cache, hash);
  return ret2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
shrq $0x6, %rax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divq 0x10120(%rcx)
movq %rdx, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x10130(%rax), %rax
movq -0x30(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
prefetcht0 (%rax)
movq -0x28(%rbp), %rdi
callq 0x10c00
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x14e40
movq $0x0, -0x48(%rbp)
cmpq $0x7, -0x48(%rbp)
jae 0x14df6
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq -0x40(%rbp), %rax
jne 0x14de3
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
shrq $0x10, %rdi
callq 0xf220
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xe110
testb $0x1, %al
jne 0x14dac
jmp 0x14de1
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x14e80
movq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xdfb0
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x14f10
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x14e36
jmp 0x14de3
jmp 0x14de5
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x14d5b
movq -0x10(%rbp), %rax
movq 0x10150(%rax), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10150(%rcx), %rcx
movq (%rcx), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq *%rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x14f10
movq -0x60(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: icache_probe
bool
icache_probe(struct icache * const cache, const struct kv * const key)
{
  const u64 hash = key->hash;
  const u64 idx = (hash >> KVMAP_BASE_LEVEL) % cache->nr_slots;
  struct __icache_slot * const slot = &(cache->table[idx]);
  __builtin_prefetch(slot, 0, 3);
  const u64 pkey = kvmap_pkey(hash);
  icache_lock_hash(cache, hash);
  for (u64 i = 0; i < ICACHE_ENTRY_NR; i++) {
    if (slot->e[i].pkey == pkey) {
      struct kv * const curr = __u64_to_ptr(slot->e[i].ptr);
      if (kv_keymatch(curr, key)) {
        icache_amap_inc(slot, i);
        // cache hit
        icache_unlock_hash(cache, hash);
        return true;
      }
    }
  }
  const bool r = cache->map_api->probe(cache->map_api->map, key);
  // index hit/miss
  icache_unlock_hash(cache, hash);
  return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
shrq $0x6, %rax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divq 0x10120(%rcx)
movq %rdx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x10130(%rax), %rax
movq -0x28(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
prefetcht0 (%rax)
movq -0x20(%rbp), %rdi
callq 0x10c00
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x14e40
movq $0x0, -0x40(%rbp)
cmpq $0x7, -0x40(%rbp)
jae 0x15046
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq -0x38(%rbp), %rax
jne 0x15036
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
shrq $0x10, %rdi
callq 0xf220
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xe110
testb $0x1, %al
jne 0x15014
jmp 0x15034
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x14e80
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x14f10
movb $0x1, -0x1(%rbp)
jmp 0x15083
jmp 0x15036
jmp 0x15038
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x14fc7
movq -0x10(%rbp), %rax
movq 0x10150(%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10150(%rcx), %rcx
movq (%rcx), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
andb $0x1, %al
movb %al, -0x49(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x14f10
movb -0x49(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: icache_set
bool
icache_set(struct icache * const cache, const struct kv * const kv)
{
  const u64 hash = kv->hash;
  icache_lock_hash(cache, hash);
  const bool ret = cache->map_api->set(cache->map_api->map, kv);
  icache_unlock_hash(cache, hash);
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x14e40
movq -0x8(%rbp), %rax
movq 0x10150(%rax), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10150(%rcx), %rcx
movq (%rcx), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x14f10
movb -0x19(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: icache_del
bool
icache_del(struct icache * const cache, const struct kv * const key)
{
  const u64 hash = key->hash;
  icache_lock_hash(cache, hash);
  const bool ret = cache->map_api->del(cache->map_api->map, key);
  icache_unlock_hash(cache, hash);
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x14e40
movq -0x8(%rbp), %rax
movq 0x10150(%rax), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10150(%rcx), %rcx
movq (%rcx), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x14f10
movb -0x19(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: icache_clean
void
icache_clean(struct icache * const cache)
{
  for (u64 i = 0; i < KVMAP_HLOCK_NR; i++) {
    spinlock_lock(&(cache->hlocks[i]));
  }
  if (cache->map_api) {
    cache->map_api->clean(cache->map_api->map);
  }
  for (u64 i = 0; i < cache->nr_slots; i++) {
    struct __icache_slot * const slot = &(cache->table[i]);
    memset(slot, 0, sizeof(*slot));
  }
  for (u64 i = 0; i < KVMAP_HLOCK_NR; i++) {
    spinlock_unlock(&(cache->hlocks[i]));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
cmpq $0x400, -0x10(%rbp)     # imm = 0x400
jae 0x151b7
movq -0x8(%rbp), %rdi
addq $0xe0, %rdi
movq -0x10(%rbp), %rax
shlq $0x6, %rax
addq %rax, %rdi
callq 0x6e50
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x15184
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10150(%rax)
je 0x151e4
movq -0x8(%rbp), %rax
movq 0x10150(%rax), %rax
movq 0x28(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10150(%rcx), %rcx
movq (%rcx), %rdi
callq *%rax
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10120(%rcx), %rax
jae 0x15235
movq -0x8(%rbp), %rax
movq 0x10130(%rax), %rax
movq -0x18(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x6200
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x151ec
movq $0x0, -0x28(%rbp)
cmpq $0x400, -0x28(%rbp)     # imm = 0x400
jae 0x15270
movq -0x8(%rbp), %rdi
addq $0xe0, %rdi
movq -0x28(%rbp), %rax
shlq $0x6, %rax
addq %rax, %rdi
callq 0x6ed0
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1523d
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: icache_fprint
void
icache_fprint(struct icache * const cache, FILE * const out)
{
  const u64 cap = cache->nr_slots * ICACHE_ENTRY_NR;
  u64 nr = 0;
  for (u64 i = 0; i < cache->nr_slots; i++) {
    struct __icache_slot * const slot = &(cache->table[i]);
    for (u64 j = 0; j < ICACHE_ENTRY_NR; j++) {
      if (slot->e[j].ptr) nr++;
    }
  }
  //for (u64 i = 0; i < KVMAP_HLOCK_NR; i++) {
  //  fprintf(out, "%"PRIu64"%c", cache->hlocks[i].padding[7], ((i % 32) == 31) ? '\n' : ' ');
  //}
  fprintf(out, "ICACHE CAP %"PRIu64"/%"PRIu64"\n", nr, cap);
  if (cache->map_api && cache->map_api->fprint) {
    cache->map_api->fprint(cache->map_api->map, out);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
imulq $0x7, 0x10120(%rax), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10120(%rcx), %rax
jae 0x1532d
movq -0x8(%rbp), %rax
movq 0x10130(%rax), %rax
movq -0x28(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x7, -0x38(%rbp)
jae 0x1531d
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
shrq $0x10, %rax
cmpq $0x0, %rax
je 0x1530d
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x1530f
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x152e3
jmp 0x1531f
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x152b0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq 0x629c(%rip), %rsi      # 0x1b5dc
movb $0x0, %al
callq 0x62e0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10150(%rax)
je 0x1538a
movq -0x8(%rbp), %rax
movq 0x10150(%rax), %rax
cmpq $0x0, 0x38(%rax)
je 0x1538a
movq -0x8(%rbp), %rax
movq 0x10150(%rax), %rax
movq 0x38(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10150(%rcx), %rcx
movq (%rcx), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: icache_iter_create
struct icache_iter *
icache_iter_create(struct icache * const cache)
{
  if (cache->map_api == NULL) return NULL;
  void * const map_iter = cache->map_api->iter_create(cache->map_api->map);
  struct icache_iter * const iter = (typeof(iter))malloc(sizeof(*iter));
  iter->map_api = cache->map_api;
  iter->map_iter = map_iter;
  return iter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10150(%rax)
jne 0x153b4
movq $0x0, -0x8(%rbp)
jmp 0x1540b
movq -0x10(%rbp), %rax
movq 0x10150(%rax), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10150(%rcx), %rcx
movq (%rcx), %rdi
callq *%rax
movq %rax, -0x18(%rbp)
movl $0x10, %edi
callq 0x6380
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10150(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: icache_invalidate
static inline void
icache_invalidate(struct icache * const cache, const struct kv * const key)
{
  const u64 hash = key->hash;
  const u64 idx = (hash >> KVMAP_BASE_LEVEL) % cache->nr_slots;
  struct __icache_slot * const slot = &(cache->table[idx]);
  const u64 pkey = kvmap_pkey(hash);
  for (u64 i = 0; i < ICACHE_ENTRY_NR; i++) {
    if ((slot->e[i].pkey == pkey) && slot->e[i].ptr) {
      icache_put_entry(&(slot->e[i]), NULL);
      slot->used--;
      icache_amap_clear(slot, i);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
shrq $0x6, %rax
movq -0x8(%rbp), %rcx
xorl %edx, %edx
divq 0x10120(%rcx)
movq %rdx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10130(%rax), %rax
movq -0x20(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10c00
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x7, -0x38(%rbp)
jae 0x15627
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq -0x30(%rbp), %rax
jne 0x15614
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
shrq $0x10, %rax
cmpq $0x0, %rax
je 0x15614
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
movq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x16520
movq -0x28(%rbp), %rax
movq (%rax), %rdx
shrq $0x3c, %rdx
addq $-0x1, %rdx
movq (%rax), %rcx
andq $0xf, %rdx
shlq $0x3c, %rdx
movabsq $0xfffffffffffffff, %rsi # imm = 0xFFFFFFFFFFFFFFF
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x165b0
jmp 0x15616
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x15583
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: icache_hint
inline void
icache_hint(struct icache * const cache, const struct kv * const kv)
{
  const u64 hash = kv->hash;
  const u64 idx = (hash >> KVMAP_BASE_LEVEL) % cache->nr_slots;
  struct __icache_slot * const slot = &(cache->table[idx]);
  if ((slot->used < ICACHE_ENTRY_NR) || ((random_u64() & 0xfff) < 0x80)) {
    struct __icache_hist * const hist = &(cache->hists[(hash >> KVMAP_BASE_LEVEL) % cache->nr_hists]);
    const u64 rep = icache_hist_update(hist, kvmap_pkey(hash));
    if (rep) {
      if (icache_update(slot, rep, kv)) {
        // replaced
      }
    }
  }
  if (cache->map_mm.hf) cache->map_mm.hf(kv, cache->map_mm.hp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
shrq $0x6, %rax
movq -0x8(%rbp), %rcx
xorl %edx, %edx
divq 0x10120(%rcx)
movq %rdx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10130(%rax), %rax
movq -0x20(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
shrq $0x3c, %rax
cmpl $0x7, %eax
jl 0x156f1
callq 0x8fb0
andq $0xfff, %rax            # imm = 0xFFF
cmpq $0x80, %rax
jae 0x15769
movq -0x8(%rbp), %rax
movq 0x10148(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
shrq $0x6, %rax
movq -0x8(%rbp), %rcx
xorl %edx, %edx
divq 0x10138(%rcx)
movq -0x48(%rbp), %rax
shlq $0x4, %rdx
addq %rdx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10c00
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x15790
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x15767
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x15820
testb $0x1, %al
jne 0x15763
jmp 0x15765
jmp 0x15765
jmp 0x15767
jmp 0x15769
movq -0x8(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x1578a
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq 0x78(%rcx), %rsi
callq *%rax
addq $0x50, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: icache_hist_update
static inline u64
icache_hist_update(struct __icache_hist * const hist, const u64 pkey)
{
  u64 rep = 0;
  for (u64 i = 0; i < ICACHE_HIST_NR; i++) {
    if (pkey == hist->tags[i]) {
      rep++;
    }
  }
  hist->tags[hist->head] = pkey;
  hist->head = (hist->head + 1) % ICACHE_HIST_NR;
  return rep;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x7, -0x20(%rbp)
jae 0x157e5
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %rdx
movzwl 0x2(%rcx,%rdx,2), %ecx
cmpq %rcx, %rax
jne 0x157d5
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x157d7
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x157ac
movq -0x10(%rbp), %rax
movw %ax, %dx
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movzwl (%rcx), %ecx
movw %dx, 0x2(%rax,%rcx,2)
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
addl $0x1, %eax
movl $0x7, %ecx
cltd
idivl %ecx
movw %dx, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
movq -0x18(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: icache_update
static inline bool
icache_update(struct __icache_slot * const slot, const u64 rep, const struct kv * const kv)
{
  if (slot->used < ICACHE_ENTRY_NR) {
    for (u64 i = 0; i < ICACHE_ENTRY_NR; i++) {
      if (slot->e[i].ptr == 0) {
        icache_put_entry(&(slot->e[i]), kv);
        slot->used++;
        return false;
      }
    }
    debug_assert(false);
  }

  const u64 victim = random_u64() % ICACHE_ENTRY_NR;
  icache_amap_dec(slot, victim);

  for (u64 i = 0; i < ICACHE_ENTRY_NR; i++) {
    const u64 vi = (i + victim) % ICACHE_ENTRY_NR;
    const u64 rep1 = icache_amap_get(slot, vi);
    if (rep1 < rep) {
      icache_put_entry(&(slot->e[vi]), kv);
      icache_amap_set(slot, vi, rep);
      return true;
    }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
shrq $0x3c, %rax
cmpl $0x7, %eax
jge 0x158d7
movq $0x0, -0x28(%rbp)
cmpq $0x7, -0x28(%rbp)
jae 0x158d0
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
shrq $0x10, %rax
cmpq $0x0, %rax
jne 0x158c0
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x16520
movq -0x10(%rbp), %rax
movq (%rax), %rdx
shrq $0x3c, %rdx
addq $0x1, %rdx
movq (%rax), %rcx
andq $0xf, %rdx
shlq $0x3c, %rdx
movabsq $0xfffffffffffffff, %rsi # imm = 0xFFFFFFFFFFFFFFF
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x1597e
jmp 0x158c2
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x15850
xorl %edi, %edi
callq 0x7640
callq 0x8fb0
movl $0x7, %ecx
xorl %edx, %edx
divq %rcx
movq %rdx, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x19e20
movq $0x0, -0x38(%rbp)
cmpq $0x7, -0x38(%rbp)
jae 0x1597a
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movl $0x7, %ecx
xorl %edx, %edx
divq %rcx
movq %rdx, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x19eb0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x1596a
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x40(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x16520
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x19ee0
movb $0x1, -0x1(%rbp)
jmp 0x1597e
jmp 0x1596c
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x158ff
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: ucache_get
struct kv *
ucache_get(struct icache * const cache, const struct kv * const key, struct kv * const out)
{
  const u64 hash = key->hash;
  const u64 idx = (hash >> KVMAP_BASE_LEVEL) % cache->nr_slots;
  struct __icache_slot * const slot = &(cache->table[idx]);
  __builtin_prefetch(slot, 0, 3);
  const u64 pkey = kvmap_pkey(hash);
  for (u64 i = 0; i < ICACHE_ENTRY_NR; i++) {
    if (slot->e[i].pkey == pkey) {
      struct kv * const curr = __u64_to_ptr(slot->e[i].ptr);
      if (kv_keymatch(curr, key)) {
        icache_amap_inc(slot, i);
        struct kv * const ret = kv_dup2(curr, out);
        // cache hit
        return ret;
      }
    }
  }
  struct kv * const ret2 = cache->map_api->get(cache->map_api->map, key, out);
  return ret2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
shrq $0x6, %rax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divq 0x10120(%rcx)
movq %rdx, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x10130(%rax), %rax
movq -0x30(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
prefetcht0 (%rax)
movq -0x28(%rbp), %rdi
callq 0x10c00
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
cmpq $0x7, -0x48(%rbp)
jae 0x15b5c
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq -0x40(%rbp), %rax
jne 0x15b49
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
shrq $0x10, %rdi
callq 0xf220
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xe110
testb $0x1, %al
jne 0x15b1f
jmp 0x15b47
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x14e80
movq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xdfb0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x15b8f
jmp 0x15b49
jmp 0x15b4b
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x15ace
movq -0x10(%rbp), %rax
movq 0x10150(%rax), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10150(%rcx), %rcx
movq (%rcx), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq *%rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: ucache_probe
bool
ucache_probe(struct icache * const cache, const struct kv * const key)
{
  const u64 hash = key->hash;
  const u64 idx = (hash >> KVMAP_BASE_LEVEL) % cache->nr_slots;
  struct __icache_slot * const slot = &(cache->table[idx]);
  __builtin_prefetch(slot, 0, 3);
  const u64 pkey = kvmap_pkey(hash);
  for (u64 i = 0; i < ICACHE_ENTRY_NR; i++) {
    if (slot->e[i].pkey == pkey) {
      struct kv * const curr = __u64_to_ptr(slot->e[i].ptr);
      if (kv_keymatch(curr, key)) {
        icache_amap_inc(slot, i);
        // cache hit
        return true;
      }
    }
  }
  const bool r = cache->map_api->probe(cache->map_api->map, key);
  // index hit/miss
  return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
shrq $0x6, %rax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divq 0x10120(%rcx)
movq %rdx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x10130(%rax), %rax
movq -0x28(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
prefetcht0 (%rax)
movq -0x20(%rbp), %rdi
callq 0x10c00
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
cmpq $0x7, -0x40(%rbp)
jae 0x15c7c
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq -0x38(%rbp), %rax
jne 0x15c6c
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
shrq $0x10, %rdi
callq 0xf220
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xe110
testb $0x1, %al
jne 0x15c57
jmp 0x15c6a
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x14e80
movb $0x1, -0x1(%rbp)
jmp 0x15cac
jmp 0x15c6c
jmp 0x15c6e
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x15c0a
movq -0x10(%rbp), %rax
movq 0x10150(%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10150(%rcx), %rcx
movq (%rcx), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
andb $0x1, %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: rcache_get_hash
void *
rcache_get_hash(struct rcache * const cache, const void * const key, const u64 hash)
{
  const u64 idx = (hash >> KVMAP_BASE_LEVEL) % cache->nr_slots;
  struct __icache_slot * const slot = &(cache->table[idx]);
  __builtin_prefetch(slot, 0, 3);
  const u64 pkey = kvmap_pkey(hash);
  rcache_lock_hash(cache, hash);
  for (u64 i = 0; i < ICACHE_ENTRY_NR; i++) {
    if (slot->e[i].pkey == pkey) {
      void * const curr = (void *)(u64)(slot->e[i].ptr);
      if (curr && cache->match(curr, key)) {
        icache_amap_inc(slot, i);
        rcache_unlock_hash(cache, hash);
        return curr;
      }
    }
  }
  rcache_unlock_hash(cache, hash);
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
shrq $0x6, %rax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divq 0x10038(%rcx)
movq %rdx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x10048(%rax), %rax
movq -0x28(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
prefetcht0 (%rax)
movq -0x20(%rbp), %rdi
callq 0x10c00
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x16080
movq $0x0, -0x40(%rbp)
cmpq $0x7, -0x40(%rbp)
jae 0x16054
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq -0x38(%rbp), %rax
jne 0x16041
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
shrq $0x10, %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x1603f
movq -0x10(%rbp), %rax
movq 0x10068(%rax), %rax
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x1601b
jmp 0x1603f
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x14e80
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x160c0
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x16069
jmp 0x16041
jmp 0x16043
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x15fc0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x160c0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/lib1.c
// Function: rcache_hint_hash
void
rcache_hint_hash(struct rcache * const cache, const void * const kv, const u64 hash)
{
  const u64 idx = (hash >> KVMAP_BASE_LEVEL) % cache->nr_slots;
  struct __icache_slot * const slot = &(cache->table[idx]);
  if ((slot->used < ICACHE_ENTRY_NR) || ((random_u64() & 0xfff) < 0x80)) {
    struct __icache_hist * const hist = &(cache->hists[(hash >> KVMAP_BASE_LEVEL) % cache->nr_hists]);
    rcache_lock_hash(cache, hash);
    const u64 rep = icache_hist_update(hist, kvmap_pkey(hash));
    if (rep) {
      (void)rcache_update(slot, rep, kv, hash);
    }
    rcache_unlock_hash(cache, hash);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
shrq $0x6, %rax
movq -0x8(%rbp), %rcx
xorl %edx, %edx
divq 0x10038(%rcx)
movq %rdx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10048(%rax), %rax
movq -0x20(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
shrq $0x3c, %rax
cmpl $0x7, %eax
jl 0x161ae
callq 0x8fb0
andq $0xfff, %rax            # imm = 0xFFF
cmpq $0x80, %rax
jae 0x16238
movq -0x8(%rbp), %rax
movq 0x10060(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
shrq $0x6, %rax
movq -0x8(%rbp), %rcx
xorl %edx, %edx
divq 0x10050(%rcx)
movq -0x48(%rbp), %rax
shlq $0x4, %rdx
addq %rdx, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x16080
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10c00
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x15790
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x1622b
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x16240
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x160c0
addq $0x50, %rsp
popq %rbp
retq
nop