LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/db.c
// Function: JFDB_close
JFDB *JFDB_close(JFDB *db) {
  // NB: after calling close, it is not safe to call any other db operations
  //     however, if close fails, it is safe to try and call close again
  // if for some strange reason we can't flush, don't free our resources yet
  if (db->isModified)
    if (JFDB_has_error(JFDB_flush(db)))
      return db;

  // release the mmaps and buffers
  JFDB_mmap_release(db, JFDB_KEYS);
  JFDB_mmap_release(db, JFDB_VALS);
  JFDB_mbuf_release(db, 0);
  JFDB_mbuf_release(db, 1);

  // possibly wipe the files, not normally failable as we just had the path open
  if (db->flags & JFDB_TEMPORARY)
    if (JFDB_wipe(db->path))
      return JFDB_set_error(db, JFDB_EFILE, "failed to wipe files");

  // completely free
  free(db->path);
  free(db);
  return NULL;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x980(%rdi)
je 0x21d8
movq %rbx, %rdi
callq 0x224b
cmpl $0x0, 0x88(%rbx)
jne 0x2241
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x23f2
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x23f2
movq %rbx, %rdi
xorl %esi, %esi
callq 0x243b
movq %rbx, %rdi
movl %ebp, %esi
callq 0x243b
testb $0x1, 0x8c(%rbx)
je 0x222f
movq (%rbx), %rdi
callq 0x1878
testl %eax, %eax
je 0x222f
leaq 0x2ee7(%rip), %rdx      # 0x5107
pushq $0x4
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1af6
jmp 0x2241
movq (%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/db.c
// Function: JFDB_mmap_release
static void JFDB_mmap_release(JFDB *db, int kv) {
  JFDB_MMap *m = kv == JFDB_KEYS ? &db->kmap : &db->vmap;
  if (m->map != MAP_FAILED)
    munmap(m->map, m->size);
  if (m->fd >= 0)
    close(m->fd);
  m->size = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x1, %esi
movl $0x90, %eax
movl $0xa8, %r14d
cmoveq %rax, %r14
movq 0x8(%rdi,%r14), %rdi
cmpq $-0x1, %rdi
je 0x2420
movq 0x10(%rbx,%r14), %rsi
callq 0x1170
movl (%rbx,%r14), %edi
testl %edi, %edi
js 0x242d
callq 0x1100
andq $0x0, 0x10(%rbx,%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/db.c
// Function: JFDB_annul
JFDB *JFDB_annul(JFDB *db, const JFT_Stem *primary, int flags) {
  JFT_Leaf leaf = (JFT_Leaf) {};
  JFT *tx = JFT_atom(primary, &leaf, NULL, 0, db->scratch[0], db->scratch[1]);
  if (!tx)
    return JFDB_set_error(db, JFDB_ETRIE, "failed to create atom");
  return JFDB_write(db, tx, flags);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %rax
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movq 0x988(%rdi), %r8
movq 0x990(%rdi), %r9
movq %rax, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3f05
testq %rax, %rax
je 0x2942
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x2467
jmp 0x2956
leaq 0x2839(%rip), %rdx      # 0x5182
pushq $0x6
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1af6
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/db.c
// Function: JFDB_store
JFDB *JFDB_store(JFDB *db,
                 const JFT_Stem *restrict primary,
                 const JFT_Stem *restrict value,
                 const JFT_Stem *restrict indices,
                 JFT_Count numIndices,
                 int flags) {
  JFDB_Region region = JFDB_valloc(db, value->size);
  if (JFDB_has_error(db))
    return db;
  if (pwrite(db->vmap.fd, value->data, value->size, JFDB_voffset(region)) < value->size)
    return JFDB_set_error(db, JFDB_EFILE, "failed to write value");

  JFT_Leaf leaf = (JFT_Leaf) {.size = 1, .data = (JFT_Word *)&region};
  JFT *tx = JFT_atom(primary, &leaf, indices, numIndices, db->scratch[0], db->scratch[1]);
  if (!tx)
    return JFDB_set_error(db, JFDB_ETRIE, "failed to create atom");
  return JFDB_write(db, tx, flags);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, 0x8(%rsp)
movl %r8d, 0xc(%rsp)
movq %rcx, %r15
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %rbx
movzwl 0x8(%rdx), %r13d
movl %r13d, %ecx
addl $0xff, %ecx
movl %ecx, %eax
shrl $0x8, %eax
andl $0x1ff00, %ecx          # imm = 0x1FF00
pushq $0x19
popq %rdx
cmpq $0x21, %rdx
je 0x29c1
movl 0xc(%rbx,%rdx,8), %esi
incq %rdx
subl %ecx, %esi
jb 0x29a0
movl (%rbx,%rdx,8), %r14d
addl %r14d, %eax
movl %eax, (%rbx,%rdx,8)
movl %esi, 0x4(%rbx,%rdx,8)
jmp 0x2a1b
movl $0xff, %esi
addq 0x118(%rbx), %rsi
movq %rsi, %r14
shrq $0x8, %r14
andl $0xffffff00, %esi       # imm = 0xFFFFFF00
addq %r13, %rsi
movq %rsi, 0x118(%rbx)
movl 0xa8(%rbx), %edi
callq 0x10e0
testl %eax, %eax
je 0x2a07
leaq 0x2958(%rip), %rdx      # 0x5352
pushq $0x4
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1af6
movq 0x118(%rbx), %rdx
pushq $0x2
popq %rcx
movq %rbx, %rdi
movl %ecx, %esi
callq 0x1c70
movq %r13, %rax
shlq $0x20, %rax
movl %r14d, %ecx
orq %rcx, %rax
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x88(%rbx)
jne 0x2aba
movl 0xa8(%rbx), %edi
movq 0x10(%rbp), %rsi
shll $0x8, %ecx
movq %r13, %rdx
callq 0x1180
cmpq %r13, %rax
jge 0x2a5f
leaq 0x273d(%rip), %rdx      # 0x5198
pushq $0x4
jmp 0x2aaf
leaq 0x18(%rsp), %rsi
movl $0x1, (%rsi)
leaq 0x10(%rsp), %rax
movq %rax, 0x8(%rsi)
movq 0x988(%rbx), %r8
movq 0x990(%rbx), %r9
movq %r12, %rdi
movq %r15, %rdx
movl 0xc(%rsp), %ecx
callq 0x3f05
testq %rax, %rax
je 0x2aa6
movq %rbx, %rdi
movq %rax, %rsi
movl 0x8(%rsp), %edx
callq 0x2467
jmp 0x2aba
leaq 0x26d5(%rip), %rdx      # 0x5182
pushq $0x6
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1af6
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/db.c
// Function: JFDB_add_to_free_list
static void JFDB_add_to_free_list(JFDB *db, JFDB_Region region) {
  uint32_t lower = region.block;
  uint32_t upper = region.block + NBLOCKS(region.size);
  if (lower < db->freeList.lower)
    db->freeList.lower = lower;
  if (upper > db->freeList.upper)
    db->freeList.upper = upper;
  db->freeList.data[db->freeList.size++] = region;
}

// Assembly:
movq %rsi, %rax
shrq $0x20, %rax
leal 0xff(%rax), %ecx
shrl $0x8, %ecx
addl %esi, %ecx
cmpl %esi, 0x130(%rdi)
jbe 0x2aec
movl %esi, 0x130(%rdi)
cmpl 0x134(%rdi), %ecx
jbe 0x2afa
movl %ecx, 0x134(%rdi)
movq 0x138(%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x138(%rdi)
movl %esi, 0x140(%rdi,%rcx,8)
movl %eax, 0x144(%rdi,%rcx,8)
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/db.c
// Function: JFDB_get_value
JFT_Stem *JFDB_get_value(JFDB *db, JFT *node, JFT_Stem *value) {
  JFT_Leaf leaf = JFT_leaf(node);
  if (leaf.size == 0)
    return NULL;
  JFDB_Region region = *(JFDB_Region *)leaf.data;
  value->size = region.size;
  value->data = db->vmap.map + JFDB_voffset(region);
  return value;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2d28
testl %eax, %eax
je 0x2d1b
movzwl 0x4(%rdx), %eax
movl (%rdx), %ecx
movw %ax, 0x8(%rbx)
shll $0x8, %ecx
addq 0xb0(%r14), %rcx
movq %rcx, 0x10(%rbx)
jmp 0x2d1d
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.h
// Function: JFT_leaf
static inline JFT_Leaf JFT_leaf(const JFT *trie) {
  JFT_TypeInfo size = JFT_type_info(trie);
  const uint8_t *data = JFT_type_data(trie);
  if (size == 0xFF) {
    size = *(JFT_Count *)data;
    data += sizeof(JFT_Count);
  }
  return (JFT_Leaf) {
    .size = size,
    .data = (JFT_Word *)data
  };
}

// Assembly:
movq (%rdi), %rcx
movq %rcx, %rax
shrq $0x28, %rax
movl $0xff, %esi
andl %esi, %eax
shrq $0x30, %rcx
andl $0xfff, %ecx            # imm = 0xFFF
leaq (%rdi,%rcx), %rdx
addq $0x8, %rdx
cmpl %esi, %eax
jne 0x2d55
movl (%rdx), %eax
addq $0x4, %rdx
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/db.c
// Function: JFDB_find
JFT_Cursor *JFDB_find(JFDB *db, JFT_Cursor *cursor, const JFT_Stem *key) {
  JFT *trie;
  for (JFT_Offset pos = db->tip.cp.offset; pos; pos = JFT_parent_offset(trie)) {
    trie = JFDB_get_trie(db, pos);
    JFT_cursor_init(cursor, In, trie);
    if (JFT_cursor_find(cursor, key) != JFT_SYMBOL_NIL)
      return cursor;
  }
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq 0x128(%rdi), %r12
pushq $0x1
popq %rbp
movabsq $0xffffffffff, %r13     # imm = 0xFFFFFFFFFF
testq %r12, %r12
je 0x2db1
addq 0x98(%r15), %r12
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x30f8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3312
cmpq $-0x2, %rax
jne 0x2db3
movq (%r12), %r12
andq %r13, %r12
jmp 0x2d7e
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/db.c
// Function: JFDB_fold
JFT_Status JFDB_fold(JFDB *db,
                     JFT_Stem *stem,
                     JFT_Symbol *stop,
                     JFDB_FoldFun fun,
                     void *restrict acc,
                     int flags) {
  // fold all active tries in the DB simultaneously, in order
  // as usual, stem serves as both input and output
  JFT_Amount N = db->tip.level, i = 0;
  JFT_Cursor cursors[N];
  JFT *trie;
  for (JFT_Offset pos = db->tip.cp.offset; pos; pos = JFT_parent_offset(trie)) {
    // we want all the cursors to be at the same position, so only add them if they have the prefix
    trie = JFDB_get_trie(db, pos);
    cursors[i] = JFT_cursor(trie);
    if (JFT_cursor_find(&cursors[i], stem) < JFT_SYMBOL_NIL)
      i++;
  }
  JFDB_Slice slice = (JFDB_Slice) {
    .db = db,
    .stem = stem,
    .stop = stop,
    .zero = stem->size,
    .fun = fun,
    .acc = acc
  };
  if (i)
    return JFT_cursor_merge(cursors, i, &splice_fold, &slice, flags);
  return Ok;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %r9d, -0x2c(%rbp)
movq %r8, -0x58(%rbp)
movq %rcx, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
movq %rsi, -0x40(%rbp)
movzbl 0xc8(%rdi), %eax
movq %rsp, %rbx
imull $0x38, %eax, %eax
addl $0xf, %eax
andl $-0x10, %eax
subq %rax, %rbx
movq %rbx, %rsp
movq %rdi, -0x38(%rbp)
movq 0x128(%rdi), %r12
xorl %r13d, %r13d
testq %r12, %r12
je 0x2e91
movq -0x38(%rbp), %rax
movq 0x98(%rax), %r14
leaq (%r14,%r12), %rsi
imulq $0x38, %r13, %r15
leaq (%rbx,%r15), %rax
movq %rax, -0x60(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x28d7
movq -0x68(%rbp), %rax
movq %rax, 0x30(%rbx,%r15)
movups -0x98(%rbp), %xmm0
movups -0x88(%rbp), %xmm1
movups -0x78(%rbp), %xmm2
movups %xmm2, 0x20(%rbx,%r15)
movups %xmm1, 0x10(%rbx,%r15)
movups %xmm0, (%rbx,%r15)
movq -0x60(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x3312
cmpq $-0x2, %rax
adcq $0x0, %r13
movq (%r14,%r12), %r12
movabsq $0xffffffffff, %rax     # imm = 0xFFFFFFFFFF
andq %rax, %r12
jmp 0x2e11
movq -0x38(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x48(%rbp), %rcx
movq %rcx, -0x88(%rbp)
movzwl 0x8(%rax), %eax
movw %ax, -0x80(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x70(%rbp)
testq %r13, %r13
je 0x2eee
leaq 0x29(%rip), %rdx        # 0x2eff
leaq -0x98(%rbp), %rcx
movq %rbx, %rdi
movq %r13, %rsi
movl -0x2c(%rbp), %r8d
callq 0x3419
jmp 0x2ef0
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/db.c
// Function: splice_fold
static JFT_Status splice_fold(JFT_Cursor *cursors, JFT_MergeContext *ctx, JFT_Phase phase) {
  JFT_MergeFrame *frame = ctx->frame;
  JFDB_Slice *slice = (JFDB_Slice *)ctx->acc;
  JFT_Cursor *cursor = cursors + ffsll(frame->active) - 1;
  JFT_KeySize depth = frame - ctx->stack;

  if (phase == Out)
    return Ok;

  if ((slice->stem->size = slice->zero + depth))
    JFT_set_symbol_at_point(slice->stem, slice->stem->size - 1, cursor->symbol);

  if (JFT_cursor_at_terminal(cursor)) {
    return slice->fun(cursor, slice, True);
  } else if (slice->stop && cursor->symbol == *slice->stop && depth) {
    return slice->fun(cursor, slice, False);
  }
  return Step;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rsi), %r15
movq 0x8(%r15), %rax
bsfq %rax, %rcx
pushq $-0x1
popq %rax
cmovneq %rcx, %rax
cmpl $-0x1, %edx
je 0x2f7f
movq 0x20(%rsi), %rbx
imulq $0x38, %rax, %r14
leaq (%r14,%rdi), %r12
addq $0x38, %r12
addq %rdi, %r14
subq (%rsi), %r15
movl %r15d, %eax
shrl $0x5, %eax
movq 0x8(%rbx), %rdi
addw 0x18(%rbx), %ax
movw %ax, 0x8(%rdi)
je 0x2f59
movzwl %ax, %esi
decq %rsi
movq -0x8(%r12), %rdx
callq 0x30a7
movq %r14, %rdi
callq 0x30d3
testl %eax, %eax
je 0x2f8d
pushq $0x1
popq %rdx
movq 0x20(%rbx), %rax
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmpq *%rax
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x10(%rbx), %rcx
pushq $0x1
popq %rax
testq %rcx, %rcx
je 0x2f81
testl $0x1fffe0, %r15d        # imm = 0x1FFFE0
je 0x2f81
movq (%rcx), %rcx
xorl %edx, %edx
cmpq %rcx, -0x8(%r12)
je 0x2f68
jmp 0x2f81
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/db.c
// Function: JFDB_vfree
static void JFDB_vfree(JFDB *db, JFDB_Region region) {
  if (db->freeList.size < JFDB_MAX_FREE - 1)
    JFDB_add_to_free_list(db, region);
  if (db->freeList.size >= JFDB_MAX_FREE)
    db->oughtFlush = True;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x138(%rdi), %rax
cmpq $0xfe, %rax
ja 0x3093
movq %rbx, %rdi
callq 0x2acc
movq 0x138(%rbx), %rax
cmpq $0x100, %rax            # imm = 0x100
jb 0x30a5
movl $0x1, 0x984(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: JFT_cursor_init
JFT_Symbol JFT_cursor_init(JFT_Cursor *cursor, JFT_Phase phase, JFT *node) {
  // initialize the cursor at node, if it exists, and return the symbol
  // we assume non-root branches always have children
  // it is impossible to construct such a node without children
  // we assume non-root nodes cannot have an empty stem
  // although technically it is possible to construct such a node, it would be invalid
  if (node == NULL)
    return cursor->symbol = JFT_SYMBOL_NIL;
  switch (JFT_node_type(node)) {
    case Root:
      cursor->node = node;
      cursor->stem = (JFT_Stem) {0};
      cursor->point = 0;
      cursor->symbol = JFT_SYMBOL_TOP;
      break;
    default:
      cursor->node = node;
      cursor->stem = JFT_stem(node);
      cursor->point = phase == In ? 0 : cursor->stem.size - 1;
      cursor->symbol = JFT_cursor_symbol_at_point(cursor);
      break;
  }
  return cursor->symbol;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdx, %rdx
je 0x312b
movq (%rdx), %rax
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rdx, 0x8(%rbx)
jne 0x3138
leaq 0x10(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $-0x3, 0x30(%rbx)
pushq $-0x3
jmp 0x3135
movq $-0x2, 0x30(%rbx)
pushq $-0x2
popq %rax
jmp 0x3187
btq $0x3d, %rax
jb 0x3147
addq $0x8, %rdx
xorl %ecx, %ecx
jmp 0x3156
movzbl 0x8(%rdx), %ecx
orq $-0x100, %rcx
addq $0x9, %rdx
shrq $0x30, %rax
andl $0xfff, %eax            # imm = 0xFFF
movq %rcx, 0x10(%rbx)
movw %ax, 0x18(%rbx)
movq %rdx, 0x20(%rbx)
decq %rax
xorl %ecx, %ecx
cmpl $0x1, %esi
cmovneq %rax, %rcx
movq %rcx, 0x28(%rbx)
movq %rbx, %rdi
callq 0x3189
movq %rax, 0x30(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.h
// Function: JFT_cursor_symbol_at_point
static inline JFT_Symbol JFT_symbol_at_point(const JFT_Stem *stem, JFT_StemPos point) {
  // NB: assumes point is valid
  if (stem->pre)
    return point == 0 ? stem->pre : stem->data[point - 1];
  return stem->data[point];
}

// Assembly:
movq 0x10(%rdi), %rax
movq 0x28(%rdi), %rcx
testq %rax, %rax
je 0x31a7
testq %rcx, %rcx
je 0x31ae
movq 0x20(%rdi), %rax
addq %rax, %rcx
decq %rcx
jmp 0x31ab
addq 0x20(%rdi), %rcx
movzbl (%rcx), %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: JFT_cursor_step
JFT_Symbol JFT_cursor_step(JFT_Cursor *cursor, JFT_Direction direction) {
  if (cursor->symbol == JFT_SYMBOL_NIL)
    return cursor->symbol;
  if (++cursor->point >= cursor->stem.size)
    switch (JFT_node_type(cursor->node)) {
      case Leaf:
        return cursor->symbol = JFT_SYMBOL_ANY;
      default:
        return JFT_cursor_init(cursor, In, JFT_child(cursor->node, JFT_SYMBOL_NIL, direction));
    }
  return cursor->symbol = JFT_cursor_symbol_at_point(cursor);
}

// Assembly:
pushq %rbx
cmpq $-0x2, 0x30(%rdi)
jne 0x3206
pushq $-0x2
popq %rax
jmp 0x3229
movq %rdi, %rbx
movq 0x28(%rdi), %rax
incq %rax
movq %rax, 0x28(%rdi)
movzwl 0x18(%rdi), %ecx
cmpq %rcx, %rax
jge 0x322b
movq %rbx, %rdi
callq 0x3189
movq %rax, 0x30(%rbx)
popq %rbx
retq
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
shrq $0x3e, %rax
cmpl $0x3, %eax
jb 0x3244
orq $-0x1, 0x30(%rbx)
pushq $-0x1
jmp 0x3203
movl %esi, %edx
pushq $-0x2
popq %rsi
callq 0x325d
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
popq %rbx
jmp 0x30f8
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: JFT_cursor_next
JFT_Symbol JFT_cursor_next(JFT_Cursor *cursor, JFT_Direction direction) {
  if (cursor->symbol == JFT_SYMBOL_ANY)
    return cursor->symbol;
  if (cursor->point == 0)
    return JFT_cursor_init(cursor, In, JFT_child(JFT_parent(cursor->node), cursor->symbol, direction));
  if (cursor->symbol == JFT_SYMBOL_NIL && cursor->point < cursor->stem.size)
    return cursor->symbol = JFT_cursor_symbol_at_point(cursor);
  return cursor->symbol = JFT_SYMBOL_NIL;
}

// Assembly:
pushq %rbx
movl %esi, %edx
movq 0x30(%rdi), %rsi
cmpq $-0x1, %rsi
je 0x32d9
movq %rdi, %rbx
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x32ea
cmpq $-0x2, %rsi
jne 0x32dd
movzwl 0x18(%rbx), %ecx
cmpq %rcx, %rax
jge 0x32dd
movq %rbx, %rdi
callq 0x3189
movq %rax, 0x30(%rbx)
jmp 0x32e8
pushq $-0x1
jmp 0x32e7
movq $-0x2, 0x30(%rbx)
pushq $-0x2
popq %rax
popq %rbx
retq
movq 0x8(%rbx), %rdi
movabsq $0xffffffffff, %rax     # imm = 0xFFFFFFFFFF
andq (%rdi), %rax
subq %rax, %rdi
callq 0x325d
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
popq %rbx
jmp 0x30f8
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: JFT_cursor_find
JFT_Symbol JFT_cursor_find(JFT_Cursor *cursor, const JFT_Stem *stem) {
  if (stem->pre && stem->size)
    if (JFT_cursor_init(cursor, In, JFT_child(cursor->node, stem->pre, 0)) == JFT_SYMBOL_NIL)
      return cursor->symbol;
  JFT_KeySize size = stem->pre && stem->size ? stem->size - 1 : stem->size;
  for (JFT_KeySize i = 0; i < size; i++) {
    if (cursor->symbol == JFT_SYMBOL_NIL)
      return cursor->symbol;
    if (++cursor->point >= cursor->stem.size)
      switch (JFT_node_type(cursor->node)) {
        case Leaf:
          return cursor->symbol = JFT_SYMBOL_ANY;
        default:
          JFT_cursor_init(cursor, In, JFT_child(cursor->node, stem->data[i], 0));
      }
    if ((cursor->symbol = JFT_cursor_symbol_at_point(cursor)) != stem->data[i])
      return cursor->symbol = JFT_SYMBOL_NIL;
  }
  return cursor->symbol;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rsi
testq %rsi, %rsi
je 0x336f
cmpw $0x0, 0x8(%r14)
je 0x336f
movq 0x8(%rbx), %rdi
xorl %edx, %edx
callq 0x325d
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x30f8
cmpq $-0x2, %rax
jne 0x335b
movq 0x30(%rbx), %r15
jmp 0x3407
cmpq $0x0, (%r14)
je 0x336f
movzwl 0x8(%r14), %eax
testw %ax, %ax
je 0x336f
decl %eax
jmp 0x3374
movzwl 0x8(%r14), %eax
movzwl %ax, %r12d
xorl %r13d, %r13d
pushq $-0x2
popq %r15
pushq $0x1
popq %rbp
movq 0x30(%rbx), %rax
cmpq %r13, %r12
je 0x33f9
cmpq $-0x2, %rax
je 0x3407
movq 0x28(%rbx), %rax
incq %rax
movq %rax, 0x28(%rbx)
movzwl 0x18(%rbx), %ecx
cmpq %rcx, %rax
jl 0x33d2
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
shrq $0x3e, %rax
cmpl $0x3, %eax
jae 0x33fe
movq 0x10(%r14), %rax
movzbl (%rax,%r13), %esi
xorl %edx, %edx
callq 0x325d
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x30f8
movq %rbx, %rdi
callq 0x3189
movq %rax, 0x30(%rbx)
movq 0x10(%r14), %rcx
movzbl (%rcx,%r13), %ecx
incq %r13
cmpq %rcx, %rax
je 0x3382
movq $-0x2, 0x30(%rbx)
jmp 0x3407
movq %rax, %r15
jmp 0x3407
orq $-0x1, 0x30(%rbx)
pushq $-0x1
popq %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: move_into_frame
static JFT_MergeFrame *move_into_frame(JFT_Cursor *cursors,
                                       JFT_CursorFun advance,
                                       JFT_Mask relevant,
                                       JFT_MergeFrame *frame,
                                       JFT_Direction direction) {
  // compute the new active set and bound from the relevant cursors
  // advance the active cursors (assumed to be a subset of relevant)
  JFT_Symbol bound = JFT_SYMBOL_NIL, symbol;
  JFT_Mask definite = 0, possible = 0, preclude = 0;
  for (JFT_Amount b = ffsll(relevant); b; b = ffsll(relevant &= relevant - 1)) {
    JFT_Amount i = b - 1;
    JFT_Mask m = 1LLU << i;
    if (frame->active & m)
      advance(&cursors[i], direction);
    symbol = cursors[i].symbol;
    if (symbol == JFT_SYMBOL_NIL) {
      // the symbol is NIL: not active and has no more siblings
      preclude |= m;
    } else if (symbol == JFT_SYMBOL_ANY) {
      // the symbol is ANY: definitely active, but does not tighten the bound
      definite |= m;
    } else if (symbol == bound) {
      // the symbol matches the bound: potentially include it in active set
      possible |= m;
    } else if ((direction == Forward && symbol < bound) ||
               (direction == Reverse && symbol > bound) ||
               (bound == JFT_SYMBOL_NIL)) {
      // the symbol beats the bound: replace the potential active set
      bound = symbol;
      possible = m;
    }
  }
  frame->bound = bound;
  frame->active = possible | definite;
  frame->done = preclude;
  return frame;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, 0x4(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
movq %rdi, %r12
bsfq %rdx, %r13
pushq $-0x1
popq %rax
cmoveq %rax, %r13
incq %r13
pushq $-0x2
popq %r15
movq $0x0, 0x10(%rsp)
xorl %ebx, %ebx
movq $0x0, 0x8(%rsp)
testq %r13, %r13
je 0x370b
decq %r13
pushq $0x1
popq %rbp
movl %r13d, %ecx
shlq %cl, %rbp
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
btq %r13, %rax
jae 0x368f
imulq $0x38, %r13, %rdi
addq %r12, %rdi
movl 0x4(%rsp), %esi
callq *0x20(%rsp)
imulq $0x38, %r13, %rax
movq 0x30(%r12,%rax), %rax
cmpq $-0x1, %rax
je 0x36ab
cmpq $-0x2, %rax
jne 0x36d3
orq %rbp, 0x8(%rsp)
jmp 0x36b0
orq %rbp, 0x10(%rsp)
movq %rbx, %rbp
movq %r15, %rax
leaq -0x1(%r14), %rcx
andq %rcx, %r14
bsfq %r14, %r13
pushq $-0x1
popq %rcx
cmoveq %rcx, %r13
incq %r13
movq %rbp, %rbx
movq %rax, %r15
jmp 0x365c
cmpq %r15, %rax
jne 0x36dd
orq %rbx, %rbp
jmp 0x36b3
cmpl $0x1, 0x4(%rsp)
jne 0x36e9
cmpq %r15, %rax
jb 0x36b6
cmpl $-0x1, 0x4(%rsp)
je 0x36f8
cmpq $-0x2, %r15
jne 0x36b0
jmp 0x36b6
cmpq %r15, %rax
seta %cl
cmpq $-0x2, %r15
sete %dl
orb %cl, %dl
je 0x36b0
jmp 0x36b6
movq 0x18(%rsp), %rax
movq %r15, (%rax)
orq 0x10(%rsp), %rbx
movq %rbx, 0x8(%rax)
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: JFT_cursor_merge_new
JFT *JFT_cursor_merge_new(JFT_Cursor *cursors,
                          JFT_Amount num,
                          JFT_Buffer *output,
                          int flags) {
  // perform a cursor merge to produce a new trie
  // if 'atoms' are the base case, this is the induction step
  JFT_Cons cons = (JFT_Cons) {.buffer = JFT_buffer_reset(output)};
  JFT_Status result = JFT_cursor_merge(cursors, num, splice_new, &cons, flags);
  free(cons.stem.data);
  free(cons.iters);
  if (cons.TLBs) {
    for (JFT_Amount k = 0; k < num; k++)
      free(cons.TLBs[k]);
    free(cons.TLBs);
  }
  free(cons.TLBSizes);
  if (result != Ok)
    return NULL;
  return (JFT *)output->data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movl %ecx, %r8d
movq %rdx, %rbx
movq %rsi, %r14
xorps %xmm0, %xmm0
leaq 0x8(%rsp), %r15
movups %xmm0, 0x58(%r15)
movups %xmm0, 0x48(%r15)
movups %xmm0, 0x38(%r15)
movups %xmm0, 0x28(%r15)
movups %xmm0, 0x18(%r15)
movups %xmm0, 0x8(%r15)
andq $0x0, 0x68(%r15)
andq $0x0, 0x10(%rdx)
movq %rdx, (%r15)
leaq 0x65(%rip), %rdx        # 0x37e6
movq %r15, %rcx
callq 0x3419
movl %eax, %ebp
movq 0x50(%r15), %rdi
callq 0x1030
movq 0x58(%r15), %rdi
callq 0x1030
xorl %eax, %eax
cmpq %rax, 0x60(%r15)
je 0x37c5
xorl %r15d, %r15d
movq 0x68(%rsp), %rdi
cmpq %r15, %r14
je 0x37c0
movq (%rdi,%r15,8), %rdi
callq 0x1030
incq %r15
jmp 0x37a8
callq 0x1030
movq 0x70(%rsp), %rdi
callq 0x1030
testl %ebp, %ebp
je 0x37d7
xorl %eax, %eax
jmp 0x37db
movq 0x18(%rbx), %rax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: make_root
static inline JFT_Offset make_root(JFT_Buffer *buf) {
  // just make space, as a root head initializes to nil (technically an impl detail)
  if (!JFT_buffer_ample(buf, sizeof(JFT_Root)))
    return 0;
  return JFT_buffer_equal(buf, JFT_Root, (JFT_Root) {.head = JFT_head(Root, False, 0, 0, 0)});
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x30
popq %rsi
callq *0x20(%rdi)
movl %eax, %ecx
xorl %eax, %eax
testq %rbx, %rbx
je 0x4265
testl %ecx, %ecx
jne 0x4265
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rcx,%rax)
movups %xmm0, 0x10(%rcx,%rax)
movups %xmm0, (%rcx,%rax)
movq 0x10(%rbx), %rax
addq $0x30, %rax
movq %rax, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: make_leaf
static inline JFT_Offset make_leaf(JFT_Buffer *buf,
                                   JFT_Offset parentPos,
                                   const JFT_Stem *stem,
                                   const JFT_Leaf *leaf) {
  // write the node and copy all the leaf data words into the buffer
  JFT_Offset size = prep_leaf(buf, parentPos, stem, leaf->size);
  for (int i = 0; i < leaf->size; i++)
    JFT_buffer_equal(buf, JFT_Word, leaf->data[i]);
  return size;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdi, %r14
movl (%rcx), %ecx
callq 0x4a42
movl (%rbx), %ecx
xorl %edx, %edx
cmpq %rcx, %rdx
jae 0x429f
movq 0x8(%rbx), %rsi
movq (%rsi,%rdx,8), %rsi
movq 0x10(%r14), %rdi
movq 0x18(%r14), %r8
movq %rsi, (%r8,%rdi)
addq $0x8, 0x10(%r14)
incq %rdx
jmp 0x427c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: JFT_iter_any_next
JFT_Boolean JFT_iter_any_next(JFT_Iter *iter) {
  // if all iterators are exhausted we are done
  if (!iter->sub.many.active)
    return False;

  JFT_Word *words = iter->batch.data = iter->words;
  for (iter->batch.size = 0; iter->batch.size < JFT_ITER_WORDS; ) {
    // scour the active iters for the next min element, until we fill a batch
    JFT_Mask hasMin = 0;
    JFT_Word min = -1, elem;
    JFT_Mask active = iter->sub.many.active;
    for (int b = ffsll(active); b; b = ffsll(active &= active - 1)) {
      JFT_Amount k = b - 1;
      JFT_Iter *i = iter->sub.many.iters + k;
      // as long as the position is out of bounds on the iter, reload it
      // if the iter is exhausted, remove it from active and skip to next
      while (i->batch.position >= i->batch.size)
        if (!JFT_iter_next(i)) {
          iter->sub.many.active &= ~(1LLU << k);
          goto nextActive;
        }
      if ((elem = i->batch.data[i->batch.position]) == min) {
        hasMin |= (1LLU << k);
      } else if (elem < min) {
        min = elem;
        hasMin = (1LLU << k);
      }
    nextActive:
      /* done with the active iter, move on to next */;
    }
    // if we can't find another min, all iters are exhausted and we are done
    // add the min to the batch always (main difference b/w any & all)
    if (!hasMin)
      break;
    else
      words[iter->batch.size++] = min;
    // advance any iters we found the min on
    for (int b = ffsll(hasMin); b; b = ffsll(hasMin &= hasMin - 1))
      iter->sub.many.iters[b - 1].batch.position++;
  }
  return True;
}

// Assembly:
cmpq $0x0, 0xb0(%rdi)
je 0x44d4
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x18(%rdi), %rax
movq %rax, 0x10(%rdi)
andl $0x0, 0xc(%rdi)
xorl %eax, %eax
cmpl $0xf, %eax
ja 0x44c2
movq 0xb0(%r14), %r13
bsfq %r13, %r15
pushq $-0x1
popq %rbp
xorl %ebx, %ebx
testq %r13, %r13
je 0x4471
imulq $0xc8, %r15, %r12
addq 0xa0(%r14), %r12
movl 0x8(%r12), %eax
cmpl 0xc(%r12), %eax
jb 0x443c
andl $0x0, 0x8(%r12)
movq %r12, %rdi
callq *(%r12)
testl %eax, %eax
jne 0x440d
pushq $-0x2
popq %rax
movl %r15d, %ecx
rolq %cl, %rax
andq %rax, 0xb0(%r14)
jmp 0x4464
movq 0x10(%r12), %rcx
movq (%rcx,%rax,8), %rax
cmpq %rbp, %rax
jne 0x4450
btsq %r15, %rbx
jmp 0x4464
pushq $0x1
popq %rdx
movl %r15d, %ecx
shlq %cl, %rdx
cmpq %rbp, %rax
cmovbq %rax, %rbp
cmovbq %rdx, %rbx
leaq -0x1(%r13), %rax
andq %rax, %r13
bsfq %r13, %r15
jmp 0x43fa
testq %rbx, %rbx
je 0x44c2
movl 0xc(%r14), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0xc(%r14)
movq %rbp, 0x18(%r14,%rcx,8)
bsfq %rbx, %rcx
incl %ecx
xorl %esi, %esi
testl %ecx, %ecx
je 0x43e1
movq 0xa0(%r14), %rdx
movl %ecx, %ecx
imulq $0xc8, %rcx, %rcx
incl -0xc0(%rdx,%rcx)
leaq -0x1(%rbx), %rcx
andq %rcx, %rbx
bsfq %rbx, %rcx
incl %ecx
testq %rbx, %rbx
cmovel %esi, %ecx
jmp 0x448e
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: JFT_membuf_ensure
int JFT_membuf_ensure(JFT_Buffer *buf, size_t more) {
  size_t minSize = buf->mark + more;
  if (buf->size < minSize) {
    size_t newSize = buf->factor * minSize;
    uint8_t *data = realloc(buf->data, newSize);
    if (data == NULL)
      return ENoMem;
    buf->size = newSize;
    buf->data = data;
  }
  return Ok;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
addq 0x10(%rdi), %r14
xorl %ebx, %ebx
cmpq %r14, 0x8(%rdi)
jae 0x47c5
movq %rdi, %r15
movslq (%rdi), %rax
imulq %rax, %r14
movq 0x18(%rdi), %rdi
movq %r14, %rsi
callq 0x1160
testq %rax, %rax
je 0x47c2
movq %r14, 0x8(%r15)
movq %rax, 0x18(%r15)
jmp 0x47c5
pushq $0x5
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: JFT_membuf
JFT_Buffer *JFT_membuf() {
  JFT_Buffer *buf = calloc(1, sizeof(JFT_Buffer));
  if (buf == NULL)
    return NULL;
  buf->factor = 2;
  buf->ensure = JFT_membuf_ensure;
  return buf;
}

// Assembly:
pushq %rax
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x1120
testq %rax, %rax
je 0x47ef
movl $0x2, (%rax)
leaq -0x62(%rip), %rcx       # 0x4789
movq %rcx, 0x20(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.h
// Function: JFT_jump_child_slot
static inline JFT_Offset *JFT_jump_child_slot(const JFT *trie,
                                              JFT_Symbol symbol,
                                              int delta) {
  JFT_TypeInfo rangeId = JFT_type_info(trie);
  JFT_Offset *offsets = (JFT_Offset *)JFT_type_data(trie);
  JFT_Range range = JumpTableRanges[rangeId];
  JFT_Symbol min = range.min, max = range.max;

  // if its NIL, handle it first
  if (symbol == JFT_SYMBOL_NIL) {
    if (delta > 0)
      goto searchForward; // range.min, range.max
    if (delta < 0)
      goto searchReverse; // range.max, range.min
    return NULL;
  }

  // otherwise, figure out if its in the range of the table and search appropriately
  if (symbol < range.min) {
    if (delta > 0)
      goto searchForward; // range.min, range.max
  } else if (symbol <= range.max) {
    if (delta == 0) {
      return offsets + symbol - range.min;
    } else if (delta < 0) {
      max = symbol - 1;
      goto searchReverse; // symbol - 1, range.min
    } else if (delta > 0) {
      min = symbol + 1;
      goto searchForward; // symbol + 1, range.max
    }
  } else {
    if (delta < 0)
      goto searchReverse; // range.max, range.min
  }
  return NULL;

 searchForward:
  offsets += min - range.min;
  for (JFT_Symbol i = min; i <= max; i++, offsets++)
    if (*offsets)
      return offsets;
  return NULL;

 searchReverse:
  offsets += max - range.min;
  for (JFT_Symbol i = max; i >= min; i--, offsets--)
    if (*offsets)
      return offsets;
  return NULL;
}

// Assembly:
movq (%rdi), %rax
movq %rax, %rcx
shrq $0x28, %rcx
movzbl %cl, %ecx
shrq $0x30, %rax
andl $0xfff, %eax            # imm = 0xFFF
addq %rdi, %rax
addq $0x8, %rax
shll $0x4, %ecx
leaq 0xb7f(%rip), %r8        # 0x53b0
movq (%rcx,%r8), %rdi
movq 0x8(%rcx,%r8), %rcx
cmpq $-0x2, %rsi
jne 0x484b
movq %rdi, %rsi
testl %edx, %edx
jg 0x486e
jns 0x4862
jmp 0x489e
cmpq %rsi, %rdi
jbe 0x4859
movq %rdi, %rsi
testl %edx, %edx
jg 0x486e
jmp 0x4862
cmpq %rsi, %rcx
jae 0x4865
testl %edx, %edx
js 0x489e
xorl %eax, %eax
retq
testl %edx, %edx
je 0x488c
js 0x4898
incq %rsi
movq %rsi, %rdx
subq %rdi, %rdx
leaq (%rax,%rdx,8), %rax
cmpq %rcx, %rsi
ja 0x4862
cmpq $0x0, (%rax)
jne 0x4897
incq %rsi
addq $0x8, %rax
jmp 0x4878
leaq (%rax,%rsi,8), %rax
shlq $0x3, %rdi
subq %rdi, %rax
retq
decq %rsi
movq %rsi, %rcx
movq %rcx, %rdx
subq %rdi, %rdx
leaq (%rax,%rdx,8), %rax
cmpq %rdi, %rcx
jb 0x4862
cmpq $0x0, (%rax)
jne 0x4897
decq %rcx
addq $-0x8, %rax
jmp 0x48a8
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.h
// Function: JFT_scan_child_slot
static inline JFT_Offset *JFT_scan_child_slot(const JFT *trie,
                                              JFT_Symbol symbol,
                                              int delta) {
  JFT_TypeInfo length = JFT_type_info(trie);
  const uint8_t *symbols = JFT_type_data(trie);
  JFT_Offset *offsets = (JFT_Offset *)(symbols + length);
  JFT_Offset lo = 0, hi = length, mid = 0;
  JFT_Symbol at = 0;

  // if looking for nil, return min, max, or nil (children can be missing, so search)
  if (symbol == JFT_SYMBOL_NIL) {
    if (delta > 0) {
      for (int i = lo; i < hi; i++)
        if (offsets[i])
          return offsets + i;
    } else if (delta < 0) {
      for (int i = hi - 1; i >= lo; i--)
        if (offsets[i])
          return offsets + i;
    }
    return 0;
  }

  // first binary search for the symbol, then adjust according to delta
  while (lo < hi) {
    mid = (lo + hi) / 2;
    at = *(symbols + mid);
    if (at < symbol)
      lo = mid + 1;
    else if (at > symbol)
      hi = mid;
    else
      break;
  }

  // we either found the symbol, or the bounds collapsed
  if (delta == 0) {
    // we want the symbol, only return if bounds are slack
    if (lo < hi)
      return offsets + mid;
  } else if (delta > 0) {
    // we want the symbol after, return either this or the next (if exists)
    if (at > symbol)
      return offsets + mid;
    else if (mid < length - 1)
      return offsets + mid + 1;
  } else if (delta < 0) {
    // we want the symbol before, return either this or the prev (if exists)
    if (at < symbol)
      return offsets + mid;
    else if (mid > 0)
      return offsets + mid - 1;
  }
  return NULL;
}

// Assembly:
pushq %rbx
movq (%rdi), %rax
movq %rax, %rcx
shrq $0x28, %rcx
movzbl %cl, %ecx
shrq $0x30, %rax
andl $0xfff, %eax            # imm = 0xFFF
cmpq $-0x2, %rsi
jne 0x4900
testl %edx, %edx
jle 0x496a
addq %rcx, %rax
addq %rax, %rdi
subq $0x1, %rcx
jb 0x496c
leaq 0x8(%rdi), %rax
cmpq $0x0, 0x8(%rdi)
movq %rax, %rdi
je 0x48e7
jmp 0x49b5
leaq (%rdi,%rax), %r8
addq %rdi, %rax
addq $0x8, %rax
leaq (%rcx,%r8), %rdi
addq $0x8, %rdi
xorl %r9d, %r9d
movq %rcx, %r8
xorl %ebx, %ebx
xorl %r10d, %r10d
movq %r8, %r11
movq %rbx, %r8
cmpq %r11, %r9
jae 0x494d
leaq (%r11,%r9), %r8
shrq %r8
movzbl (%rax,%r8), %r10d
cmpq %rsi, %r10
jb 0x4941
movq %r8, %rbx
ja 0x491e
jmp 0x494d
leaq 0x1(%r8), %r9
movq %r8, %rbx
movq %r11, %r8
jmp 0x491e
testl %edx, %edx
je 0x4970
jle 0x497f
cmpq %rsi, %r10
ja 0x4984
leal -0x1(%rcx), %eax
cmpq %rax, %r8
jae 0x496c
leaq (%rdi,%r8,8), %rax
addq $0x8, %rax
jmp 0x49b5
js 0x498a
xorl %eax, %eax
jmp 0x49b5
xorl %eax, %eax
cmpq %r11, %r9
leaq (%rdi,%r8,8), %rcx
cmovbq %rcx, %rax
jmp 0x49b5
cmpq %rsi, %r10
jae 0x49a8
leaq (%rdi,%r8,8), %rax
jmp 0x49b5
leaq (%rcx,%rcx,8), %rcx
addq %rax, %rcx
addq %rdi, %rcx
addq $0x8, %rcx
leaq -0x8(%rcx), %rax
cmpq $0x0, -0x8(%rcx)
movq %rax, %rcx
je 0x4998
jmp 0x49b5
testq %r8, %r8
je 0x496c
leaq (%rdi,%r8,8), %rax
addq $-0x8, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.h
// Function: JFT_head
static inline JFT_Head JFT_head(JFT_NodeType nodeType,
                                JFT_Boolean isSpecial,
                                JFT_KeySize stemSize,
                                JFT_TypeInfo typeInfo,
                                JFT_Offset parentOffset) {
  return ((((JFT_Head)(nodeType)) << 62) |
          (((JFT_Head)(isSpecial > 0)) << 61) |
          (((JFT_Head)(stemSize & 0b111111111111)) << 48) |
          (((JFT_Head)(typeInfo & 0b11111111)) << 40) |
          (((JFT_Head)(parentOffset & 0xFFFFFFFFFF))));
}

// Assembly:
xorl %eax, %eax
testl %esi, %esi
setne %al
shlq $0x3e, %rdi
shlq $0x3d, %rax
orq %rdi, %rax
andl $0xfff, %edx            # imm = 0xFFF
shlq $0x30, %rdx
orq %rdx, %rax
movzbl %cl, %ecx
shlq $0x28, %rcx
orq %rax, %rcx
movabsq $0xffffffffff, %rax     # imm = 0xFFFFFFFFFF
andq %r8, %rax
orq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: prep_leaf
static inline JFT_Offset prep_leaf(JFT_Buffer *buf,
                                   JFT_Offset parentPos,
                                   const JFT_Stem *stem,
                                   JFT_Count maxWords) {
  // write the node, although it may be updated later
  // ensure space for maxWords and return a pointer where one can write words
  JFT_Offset size = JFT_leaf_size(stem->size, maxWords);
  if (!JFT_buffer_ample(buf, size))
    return 0;

  JFT_Offset parentOffset = offset_parent(buf, parentPos, stem);

  if (maxWords < 0xFF) {
    write_node(buf, Leaf, stem, maxWords, parentOffset);
  } else {
    write_node(buf, Leaf, stem, 0xFF, parentOffset);
    JFT_buffer_equal(buf, JFT_Count, maxWords);
  }

  return size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, %ebx
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
movzwl 0x8(%rdx), %eax
xorl %ecx, %ecx
cmpl $0xff, %ebx
setae %cl
movl %ebx, %edx
shlq $0x2, %rcx
leaq (%rcx,%rdx,8), %rcx
leaq (%rax,%rcx), %r15
addq $0x8, %r15
movq %r15, %rsi
callq *0x20(%rdi)
movl %eax, %ecx
xorl %eax, %eax
testq %r14, %r14
je 0x4ade
testl %ecx, %ecx
jne 0x4ade
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x4ae8
pushq $0x3
popq %rsi
cmpl $0xfe, %ebx
ja 0x4ab5
movq %r14, %rdi
movq %r12, %rdx
movl %ebx, %ecx
movq %rax, %r8
callq 0x4b40
jmp 0x4adb
movq %r14, %rdi
movq %r12, %rdx
movl $0xff, %ecx
movq %rax, %r8
callq 0x4b40
movq 0x10(%r14), %rax
movq 0x18(%r14), %rcx
movl %ebx, (%rcx,%rax)
addq $0x4, %rax
movq %rax, 0x10(%r14)
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: offset_parent
static inline JFT_Offset offset_parent(JFT_Buffer *buf,
                                       JFT_Offset parentPos,
                                       const JFT_Stem *stem) {
  // once we are ready to write the child, its parent slot can be updated, so do so
  return JFT_set_child_offset(buf->data + parentPos,
                              JFT_symbol_at_point(stem, 0),
                              buf->mark - parentPos);
}

// Assembly:
movq %rsi, %rax
movq %rdi, %rcx
movq 0x18(%rdi), %rdi
addq %rsi, %rdi
movq (%rdx), %rsi
testq %rsi, %rsi
jne 0x4b04
movq 0x10(%rdx), %rdx
movzbl (%rdx), %esi
pushq %rbx
movq 0x10(%rcx), %rbx
subq %rax, %rbx
movq (%rdi), %rax
shrq $0x3e, %rax
leaq 0x886(%rip), %rcx       # 0x53a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edx, %edx
callq 0x480a
jmp 0x4b33
xorl %edx, %edx
callq 0x48bc
testq %rax, %rax
je 0x4b3b
movq %rbx, (%rax)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: write_node
static inline void write_node(JFT_Buffer *buf,
                              JFT_NodeType nodeType,
                              const JFT_Stem *stem,
                              JFT_TypeInfo typeInfo,
                              JFT_Offset parentOffset) {
  // take care of the common node head + stem details for leaves & branches
  if (stem->pre) {
    JFT_buffer_equal(buf, JFT_Head, JFT_head(nodeType, stem->pre, stem->size, typeInfo, parentOffset));
    JFT_buffer_equal(buf, uint8_t, JFT_SpToB(stem->pre));
    JFT_buffer_paste(buf, stem->data, stem->size - 1);
  } else {
    JFT_buffer_equal(buf, JFT_Head, JFT_head(nodeType, stem->pre, stem->size, typeInfo, parentOffset));
    JFT_buffer_paste(buf, stem->data, stem->size);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
movq (%rdx), %rax
testq %rax, %rax
je 0x4ba4
movzwl 0x8(%r14), %edx
movl %esi, %edi
movl %eax, %esi
callq 0x49b7
movq 0x10(%rbx), %rcx
movq 0x18(%rbx), %rdx
leaq 0x10(%rbx), %r12
movq %rax, (%rdx,%rcx)
movq 0x10(%rbx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x10(%rbx)
movb (%r14), %cl
movb %cl, 0x8(%rdx,%rax)
movq 0x10(%rbx), %rdi
incq %rdi
movq %rdi, 0x10(%rbx)
movq 0x10(%r14), %rsi
movzwl 0x8(%r14), %r15d
decq %r15
addq 0x18(%rbx), %rdi
jmp 0x4bfe
movzwl 0x8(%r14), %r15d
shlq $0x3e, %rsi
movl %r15d, %eax
andl $0xfff, %eax            # imm = 0xFFF
shlq $0x30, %rax
orq %rsi, %rax
movzbl %cl, %ecx
shlq $0x28, %rcx
orq %rax, %rcx
movabsq $0xffffffffff, %rax     # imm = 0xFFFFFFFFFF
andq %rax, %r8
orq %rcx, %r8
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
leaq 0x10(%rbx), %r12
movq %r8, (%rcx,%rax)
movq 0x10(%rbx), %rax
leaq 0x8(%rax), %rdx
movq %rdx, 0x10(%rbx)
movq 0x10(%r14), %rsi
leaq (%rcx,%rax), %rdi
addq $0x8, %rdi
movq %r15, %rdx
callq 0x1140
addq %r15, (%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.h
// Function: JFT_mark_symbol
static inline int JFT_mark_symbol(JFT_Range *range,
                                  JFT_SymbolSet *set,
                                  JFT_Symbol symbol) {
  if (symbol < range->min)
    range->min = symbol;
  if (symbol > range->max)
    range->max = symbol;
  JFT_symbol_set_bit(set, symbol);
  return 0;
}

// Assembly:
movq %rdx, %rcx
cmpq %rdx, (%rdi)
jbe 0x4c21
movq %rcx, (%rdi)
cmpq %rcx, 0x8(%rdi)
jae 0x4c2b
movq %rcx, 0x8(%rdi)
pushq $0x1
popq %rax
shlq %cl, %rax
shrq $0x6, %rcx
orq %rax, (%rsi,%rcx,8)
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: make_scan_list
static inline JFT_Offset make_scan_list(JFT_Buffer *buf,
                                        JFT_Offset parentPos,
                                        const JFT_Stem *stem,
                                        JFT_SymbolSet *symbols,
                                        int numSymbols) {
  // first create the list of symbols for searching, then the list of offsets
  JFT_Offset size = JFT_scan_size(stem->size, numSymbols);
  if (!JFT_buffer_ample(buf, size))
    return 0;

  JFT_Offset parentOffset = offset_parent(buf, parentPos, stem);
  write_node(buf, ScanList, stem, numSymbols, parentOffset);

  uint64_t word;
  for (int w = 0; w < 4; w++)
    for (int b = ffsll(word = (*symbols)[w]); b; b = ffsll(word &= word - 1))
      JFT_buffer_equal(buf, uint8_t, 64 * w + b - 1);

  for (int i = 0; i < numSymbols; i++)
    JFT_buffer_equal(buf, JFT_Offset, 0);

  return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
movzwl 0x8(%rdx), %eax
movl %r8d, %ecx
leaq (%rcx,%rcx,8), %rcx
leaq (%rax,%rcx), %r14
addq $0x8, %r14
movq %r14, %rsi
callq *0x20(%rdi)
movl %eax, %ecx
xorl %eax, %eax
testq %rbx, %rbx
je 0x4d18
testl %ecx, %ecx
jne 0x4d18
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x4ae8
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %r12, %rdx
movl %ebp, %ecx
movq %rax, %r8
callq 0x4b40
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x4, %rcx
je 0x4cf5
movq (%r15,%rcx,8), %rdx
bsfq %rdx, %rsi
incl %esi
testq %rdx, %rdx
cmovel %eax, %esi
movl %ecx, %edi
shll $0x6, %edi
testl %esi, %esi
je 0x4cf0
addl %edi, %esi
decb %sil
movq 0x10(%rbx), %r8
movq 0x18(%rbx), %r9
movb %sil, (%r9,%r8)
incq 0x10(%rbx)
leaq -0x1(%rdx), %rsi
andq %rsi, %rdx
bsfq %rdx, %rsi
incl %esi
testq %rdx, %rdx
cmovel %eax, %esi
jmp 0x4cc2
incq %rcx
jmp 0x4ca7
xorl %eax, %eax
testl %ebp, %ebp
cmovgl %ebp, %eax
subl $0x1, %eax
jb 0x4d15
movq 0x10(%rbx), %rcx
movq 0x18(%rbx), %rdx
andq $0x0, (%rdx,%rcx)
addq $0x8, 0x10(%rbx)
jmp 0x4cfc
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jflatow[P]jfdb/src/trie.c
// Function: make_jump_table
static inline JFT_Offset make_jump_table(JFT_Buffer *buf,
                                         JFT_Offset parentPos,
                                         const JFT_Stem *stem,
                                         JFT_TypeInfo rangeId) {
  // just create an offset for each symbol in the range
  int rangeSize = JumpTableRanges[rangeId].max - JumpTableRanges[rangeId].min + 1;
  JFT_Offset size = JFT_jump_size(stem->size, rangeSize);
  if (!JFT_buffer_ample(buf, size))
    return 0;

  JFT_Offset parentOffset = offset_parent(buf, parentPos, stem);
  write_node(buf, JumpTable, stem, rangeId, parentOffset);

  for (int i = 0; i < rangeSize; i++)
    JFT_buffer_equal(buf, JFT_Offset, 0);

  return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r12
movl %ecx, %eax
shlq $0x4, %rax
leaq 0x669(%rip), %rcx       # 0x53b0
movl 0x8(%rax,%rcx), %r13d
subl (%rax,%rcx), %r13d
movq %rdi, %rbx
incl %r13d
movzwl 0x8(%rdx), %eax
leaq (%rax,%r13,8), %r14
addq $0x8, %r14
movq %r14, %rsi
callq *0x20(%rdi)
movl %eax, %ecx
xorl %eax, %eax
testq %rbx, %rbx
je 0x4dbb
testl %ecx, %ecx
jne 0x4dbb
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4ae8
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %r15, %rdx
movl %ebp, %ecx
movq %rax, %r8
callq 0x4b40
xorl %eax, %eax
testl %r13d, %r13d
cmovgl %r13d, %eax
subl $0x1, %eax
jb 0x4db8
movq 0x10(%rbx), %rcx
movq 0x18(%rbx), %rdx
andq $0x0, (%rdx,%rcx)
addq $0x8, 0x10(%rbx)
jmp 0x4d9f
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/USArmyResearchLab[P]ARL_OpenSHMEM/src/autogen/shmem_int_atomic_fetch_add.c
// Function: shmem_int_atomic_fetch_add
int shmem_int_atomic_fetch_add( int* ptr, int val, int pe)
{
	int* remote_ptr = (int*)shmem_ptr((void*)ptr, pe ); 
	long* x = (long*)shmem_ptr((const void*)&__shmem.lock_atomic_int, pe);
	__set_spin_lock(x);
	int r = *remote_ptr;
	*remote_ptr = __sum(r,val);
	__clear_spin_lock(x);
	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movl %edx, %esi
callq 0x1ba4
movq %rax, %r14
leaq 0x33c0(%rip), %rdi      # 0x61f0
addq $0x10, %rdi
movl %ebx, %esi
callq 0x1ba4
movq %rax, %rbx
movq %rax, %rdi
callq 0x30cc
movl (%r14), %r15d
addl %r15d, %ebp
movl %ebp, (%r14)
movq %rbx, %rdi
callq 0x30bc
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)