LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: readReal
double
readReal(FILE *fp)
    {
    int result;
    double x;
    result = fscanf(fp," %lf",&x);
    if (result == EOF)
        {
        return 0.0;
        }
    if (result == 0)
        {
        fprintf(stderr,"SCAN ERROR: attempt to read a real number failed\n");
        fprintf(stderr,"offending character was <%c>\n",fgetc(fp));
        exit(2);
        }
    return x;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x166d(%rip), %rsi      # 0x3754
leaq -0x20(%rbp), %rdx
movb $0x0, %al
callq 0x1040
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x2105
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x2162
cmpl $0x0, -0x14(%rbp)
jne 0x2158
movq 0x3ee6(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x163d(%rip), %rsi      # 0x3759
movb $0x0, %al
callq 0x10c0
movq 0x3ece(%rip), %rax      # 0x5ff8
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10a0
movq -0x28(%rbp), %rdi
movl %eax, %edx
leaq 0x15ef(%rip), %rsi      # 0x3736
movb $0x0, %al
callq 0x10c0
movl $0x2, %edi
callq 0x1170
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: readChar
char
readChar(FILE *fp)
    {
    int result;
    char x;
    result = fscanf(fp," %c",&x);
    if (result == EOF)
        {
        return -1;
        }
    if (result == 0)
        {
        fprintf(stderr,"SCAN ERROR: attempt to read a non-whitespace character failed\n");
        fprintf(stderr,"offending character was <%c>\n",fgetc(fp));
        exit(2);
        }
    return x;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x1604(%rip), %rsi      # 0x378b
leaq -0x15(%rbp), %rdx
movb $0x0, %al
callq 0x1040
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x21a1
movb $-0x1, -0x1(%rbp)
jmp 0x21fa
cmpl $0x0, -0x14(%rbp)
jne 0x21f4
movq 0x3e4a(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x15d7(%rip), %rsi      # 0x378f
movb $0x0, %al
callq 0x10c0
movq 0x3e32(%rip), %rax      # 0x5ff8
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10a0
movq -0x20(%rbp), %rdi
movl %eax, %edx
leaq 0x1553(%rip), %rsi      # 0x3736
movb $0x0, %al
callq 0x10c0
movl $0x2, %edi
callq 0x1170
movb -0x15(%rbp), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: readRawChar
char
readRawChar(FILE *fp)
    {
    int result;
    char x;
    result = fscanf(fp,"%c",&x);
    if (result == EOF)
        {
        return -1;
        }
    if (result == 0)
        {
        fprintf(stderr,"SCAN ERROR: attempt to read a raw character failed\n");
        fprintf(stderr,"offending character was <%c>\n",fgetc(fp));
        exit(2);
        }
    return x;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x1565(%rip), %rsi      # 0x378c
leaq -0x15(%rbp), %rdx
movb $0x0, %al
callq 0x1040
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x2241
movb $-0x1, -0x1(%rbp)
jmp 0x229a
cmpl $0x0, -0x14(%rbp)
jne 0x2294
movq 0x3daa(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x1576(%rip), %rsi      # 0x37ce
movb $0x0, %al
callq 0x10c0
movq 0x3d92(%rip), %rax      # 0x5ff8
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10a0
movq -0x20(%rbp), %rdi
movl %eax, %edx
leaq 0x14b3(%rip), %rsi      # 0x3736
movb $0x0, %al
callq 0x10c0
movl $0x2, %edi
callq 0x1170
movb -0x15(%rbp), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: skipWhiteSpace
static void
skipWhiteSpace(FILE *fp)
    {
    int ch;

    /* read chars until a non-whitespace character is encountered */

    while ((ch = fgetc(fp)) != EOF && isspace(ch))
        continue;

    /* a non-space character got us out of the loop, so push it back */

    ungetc(ch,fp);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10a0
movl %eax, %ecx
movl %ecx, -0xc(%rbp)
xorl %eax, %eax
cmpl $-0x1, %ecx
movb %al, -0xd(%rbp)
je 0x24c2
callq 0x1180
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0xd(%rbp)
movb -0xd(%rbp), %al
testb $0x1, %al
jne 0x24cb
jmp 0x24cd
jmp 0x248c
movl -0xc(%rbp), %edi
movq -0x8(%rbp), %rsi
callq 0x1110
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: allocateMsg
void *
allocateMsg(size_t size,char *where)
    {
    char *s;
    s = malloc(size);
    if (s == 0)
        {
        fprintf(stderr,"%s: could not allocate string, out of memory\n",
            where);
        exit(3);
        }

    return s;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1100
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x252a
movq 0x3aed(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x1382(%rip), %rsi      # 0x389b
movb $0x0, %al
callq 0x10c0
movl $0x3, %edi
callq 0x1170
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: reallocateMsg
static void *
reallocateMsg(void *s,size_t size,char *where)
    {
    char *t;
    t = realloc(s,size);
    if (t == 0)
        {
        fprintf(stderr,"%s: could not reallocate string, out of memory\n",
            where);
        exit(3);
        }

    return t;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1120
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x2592
movq 0x3a85(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x1348(%rip), %rsi      # 0x38c9
movb $0x0, %al
callq 0x10c0
movl $0x3, %edi
callq 0x1170
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: convertEscapedChar
static char
convertEscapedChar(int ch)
    {
    switch (ch)
        {
        case 'n':  return '\n';
        case 't':  return '\t';
        case '"':  return '\"';
        case '\\': return '\\';
        }
    return ch;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
subl $0x22, %eax
je 0x25de
jmp 0x25b4
movl -0xc(%rbp), %eax
subl $0x5c, %eax
je 0x25e4
jmp 0x25be
movl -0xc(%rbp), %eax
subl $0x6e, %eax
je 0x25d2
jmp 0x25c8
movl -0xc(%rbp), %eax
subl $0x74, %eax
je 0x25d8
jmp 0x25ea
movb $0xa, -0x1(%rbp)
jmp 0x25f0
movb $0x9, -0x1(%rbp)
jmp 0x25f0
movb $0x22, -0x1(%rbp)
jmp 0x25f0
movb $0x5c, -0x1(%rbp)
jmp 0x25f0
movl -0x8(%rbp), %eax
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: readToken
char *
readToken(FILE *fp)
    {
    int ch,index;
    char *buffer;
    int size = 80;

    skipWhiteSpace(fp);

    ch = fgetc(fp);
    if (ch == EOF) return 0;

    buffer = allocateMsg(size,"readToken");

    index = 0;
    while (!isspace(ch))
        {
        if (ch == EOF) break;
        if (index > size - 2)
            {
            ++size;
            buffer = reallocateMsg(buffer,size,"readToken");
            }
        buffer[index] = ch;
        ++index;
        ch = fgetc(fp);
        }

    /* push back the character that got us out of this loop */

    ungetc(ch,fp);

    if (index > 0)              //there is something in the buffer
        clearerr(fp);           //so force the read to be good

    buffer[index] = '\0';

    return buffer;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl $0x50, -0x24(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2480
movq -0x10(%rbp), %rdi
callq 0x10a0
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x263b
movq $0x0, -0x8(%rbp)
jmp 0x2705
movslq -0x24(%rbp), %rdi
leaq 0x1242(%rip), %rsi      # 0x3888
callq 0x24e0
movq %rax, -0x20(%rbp)
movl $0x0, -0x18(%rbp)
callq 0x1180
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x2679
jmp 0x26d6
cmpl $-0x1, -0x14(%rbp)
jne 0x2681
jmp 0x26d6
movl -0x18(%rbp), %eax
movl -0x24(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jle 0x26af
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x24(%rbp), %rsi
leaq 0x11e2(%rip), %rdx      # 0x3888
callq 0x2540
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
movb %al, %dl
movq -0x20(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10a0
movl %eax, -0x14(%rbp)
jmp 0x2656
movl -0x14(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x1110
cmpl $0x0, -0x18(%rbp)
jle 0x26f1
movq -0x10(%rbp), %rdi
callq 0x10e0
movq -0x20(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: readLine
char *
readLine(FILE *fp)
    {
    int ch,index;
    char *buffer;
    int size = 512;
    
    ch = fgetc(fp);
    if (ch == EOF) return 0;

    buffer = allocateMsg(size,"readLine");

    index = 0;
    while (ch != '\n')
        {
        if (ch == EOF) break;
        if (index > size - 2)
            {
            ++size;
            buffer = reallocateMsg(buffer,size,"readLine");
            }
        buffer[index] = ch;
        ++index;
        ch = fgetc(fp);
        }


    if (index > 0)              //there is something in the buffer
        clearerr(fp);           //so force the read to be good

    buffer[index] = '\0';

    return buffer;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl $0x200, -0x24(%rbp)     # imm = 0x200
movq -0x10(%rbp), %rdi
callq 0x10a0
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x2742
movq $0x0, -0x8(%rbp)
jmp 0x27e3
movslq -0x24(%rbp), %rdi
leaq 0x1145(%rip), %rsi      # 0x3892
callq 0x24e0
movq %rax, -0x20(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0xa, -0x14(%rbp)
je 0x27c0
cmpl $-0x1, -0x14(%rbp)
jne 0x276b
jmp 0x27c0
movl -0x18(%rbp), %eax
movl -0x24(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jle 0x2799
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x24(%rbp), %rsi
leaq 0x1102(%rip), %rdx      # 0x3892
callq 0x2540
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
movb %al, %dl
movq -0x20(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10a0
movl %eax, -0x14(%rbp)
jmp 0x275d
cmpl $0x0, -0x18(%rbp)
jle 0x27cf
movq -0x10(%rbp), %rdi
callq 0x10e0
movq -0x20(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: allocate
void *
allocate(size_t size)
    {
    char *s;
    s = malloc(size);
    if (s == 0)
        {
        fprintf(stderr,"could not allocate string, out of memory\n");
        exit(3);
        }

    return s;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1100
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2832
movq 0x37e1(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x107e(%rip), %rsi      # 0x389f
movb $0x0, %al
callq 0x10c0
movl $0x3, %edi
callq 0x1170
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/phrases/scanner.c
// Function: reallocate
void *
reallocate(void *s,size_t size)
    {
    char *t;
    t = realloc(s,size);
    if (t == 0)
        {
        fprintf(stderr,"could not reallocate string, out of memory\n");
        exit(3);
        }

    return t;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1120
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x288a
movq 0x3789(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x1054(%rip), %rsi      # 0x38cd
movb $0x0, %al
callq 0x10c0
movl $0x3, %edi
callq 0x1170
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/test/jfdb.c
// Function: main
int main(int argc, char **argv) {
  test_region_map_pos();
  test_region_map_neg();
  test_db(argc, argv);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x13c0
callq 0x1a50
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x1320
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/test/jfdb.c
// Function: test_db
static int test_db(int argc, char **argv) {
  JFDB *db = JFDB_open(argc > 1 ? argv[1] : "", 0);

  if (JFDB_pif_error(db, "Failed to open"))
    return -1;

  test_store(db);
  test_find(db);
  test_crush(db);

  JFDB_close(db);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x1, -0x8(%rbp)
jle 0x1343
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x1350
leaq 0x7cdb(%rip), %rax      # 0x9025
movq %rax, -0x20(%rbp)
jmp 0x1350
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x1f80
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x7ca5(%rip), %rsi      # 0x900f
callq 0x1b30
cmpl $0x0, %eax
je 0x137d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13a8
movq -0x18(%rbp), %rdi
callq 0x1ba0
movq -0x18(%rbp), %rdi
callq 0x1bf0
movq -0x18(%rbp), %rdi
callq 0x1c50
movq -0x18(%rbp), %rdi
callq 0x2c30
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/test/jfdb.c
// Function: test_region_map_pos
static int test_region_map_pos() {
  JFDB_Region gaps[JFDB_NUM_GAPS];
  JFDB_RegionMap *map = JFDB_region_map_alloc(0, 256, 0);
  JFDB_region_map_store(map, (JFDB_Region) {
      .block = 3,
      .size = 512
  });
  JFDB_region_map_store(map, (JFDB_Region) {
      .block = 10,
      .size = 512
  });
  JFDB_region_map_store(map, (JFDB_Region) {
      .block = 60,
      .size = 10000
  });
  JFDB_region_map_clear(map, (JFDB_Region) {
      .block = 11,
      .size = 256,
  });
  JFDB_region_map_gaps(map, gaps);
  JFDB_region_map_free(map);

  for (int i = 0; i < JFDB_NUM_GAPS; i++)
    printf("GAP %u %u\n", gaps[i].block, gaps[i].size);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
xorl %edx, %edx
movl $0x100, %esi            # imm = 0x100
movl %edx, %edi
callq 0x14a0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movl $0x3, -0x50(%rbp)
movl $0x200, -0x4c(%rbp)     # imm = 0x200
movq -0x50(%rbp), %rsi
callq 0x15c0
movq -0x48(%rbp), %rdi
movl $0xa, -0x58(%rbp)
movl $0x200, -0x54(%rbp)     # imm = 0x200
movq -0x58(%rbp), %rsi
callq 0x15c0
movq -0x48(%rbp), %rdi
movl $0x3c, -0x60(%rbp)
movl $0x2710, -0x5c(%rbp)    # imm = 0x2710
movq -0x60(%rbp), %rsi
callq 0x15c0
movq -0x48(%rbp), %rdi
movl $0xb, -0x68(%rbp)
movl $0x100, -0x64(%rbp)     # imm = 0x100
movq -0x68(%rbp), %rsi
callq 0x16f0
movq -0x48(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1820
movq -0x48(%rbp), %rdi
callq 0x1a30
movl $0x0, -0x6c(%rbp)
cmpl $0x8, -0x6c(%rbp)
jge 0x1492
movslq -0x6c(%rbp), %rax
movl -0x40(%rbp,%rax,8), %esi
movslq -0x6c(%rbp), %rax
movl -0x3c(%rbp,%rax,8), %edx
leaq 0x7b84(%rip), %rdi      # 0x9004
movb $0x0, %al
callq 0x10c0
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x1463
xorl %eax, %eax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/test/../src/db.h
// Function: JFDB_region_map_alloc
static inline JFDB_RegionMap *JFDB_region_map_alloc(uint32_t lower, uint32_t upper, int invert) {
  // NB: lower <= S < upper
  size_t numBytes = RUP(upper - lower, 8);
  size_t numWords = RUP(numBytes, sizeof(uint64_t));
  JFDB_RegionMap *map = malloc(sizeof(JFDB_RegionMap) + numWords * sizeof(uint64_t));
  if (map) {
    map->begin = (lower / 64) * 64;
    map->size = numWords;
    memset(map->data, invert ? 0xFF : 0, numWords * sizeof(uint64_t));
    if (lower % 64)
      map->data[0] |= -1LLU >> (64 - (lower % 64));
    if (upper % 64)
      map->data[numWords - 1] |= -1LLU << (upper % 64);
  }
  return map;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl -0x8(%rbp), %eax
subl -0x4(%rbp), %eax
addl $0x8, %eax
subl $0x1, %eax
shrl $0x3, %eax
movl %eax, %eax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
subq $0x1, %rax
shrq $0x3, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
shlq $0x3, %rdi
addq $0x8, %rdi
callq 0x1150
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x15aa
movl -0x4(%rbp), %ecx
shrl $0x6, %ecx
shll $0x6, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
movl -0xc(%rbp), %edx
xorl %eax, %eax
movl $0xff, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movq -0x20(%rbp), %rdx
shlq $0x3, %rdx
movzbl %al, %esi
callq 0x10f0
movl -0x4(%rbp), %eax
andl $0x3f, %eax
cmpl $0x0, %eax
je 0x1573
movl -0x4(%rbp), %ecx
andl $0x3f, %ecx
movl $0x40, %eax
subl %ecx, %eax
movl %eax, %eax
movl %eax, %ecx
movq $-0x1, %rax
shrq %cl, %rax
movq %rax, %rcx
movq -0x28(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movl -0x8(%rbp), %eax
andl $0x3f, %eax
cmpl $0x0, %eax
je 0x15a8
movl -0x8(%rbp), %eax
andl $0x3f, %eax
movl %eax, %eax
movl %eax, %ecx
movq $-0x1, %rdx
shlq %cl, %rdx
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
subq $0x1, %rcx
orq 0x8(%rax,%rcx,8), %rdx
movq %rdx, 0x8(%rax,%rcx,8)
jmp 0x15aa
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/test/../src/db.h
// Function: JFDB_region_map_store
static inline void JFDB_region_map_store(JFDB_RegionMap *map, JFDB_Region region) {
  // set numSlots bits from start
  //  * region.block must be in map range
  // otherwise behavior is undefined
  if (region.size) {
    size_t numSlots = RUP(region.size, JFDB_BLOCK_SIZE);
    size_t start = region.block - map->begin, stop = start + numSlots - 1;
    size_t startWord = start / 64, stopWord = stop / 64;
    if (startWord == stopWord) {
      map->data[startWord] |=
        (-1LLU << (start % 64)) &
        (-1LLU >> (63 - (stop % 64)));
    } else {
      map->data[startWord] |= -1LLU << (start % 64);
      while (++startWord < stopWord)
        map->data[startWord] = -1LLU;
      map->data[stopWord] |= -1LLU >> (63 - (stop % 64));
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rsi, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
cmpl $0x0, -0x4(%rbp)
je 0x16e5
movl -0x4(%rbp), %eax
addl $0x100, %eax            # imm = 0x100
subl $0x1, %eax
shrl $0x8, %eax
movl %eax, %eax
movq %rax, -0x18(%rbp)
movl -0x8(%rbp), %eax
movq -0x10(%rbp), %rcx
subl (%rcx), %eax
movl %eax, %eax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq -0x18(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
shrq $0x6, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
shrq $0x6, %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
jne 0x166e
movq -0x20(%rbp), %rcx
andq $0x3f, %rcx
movq $-0x1, %rdx
shlq %cl, %rdx
movq -0x28(%rbp), %rax
andq $0x3f, %rax
movl $0x3f, %ecx
subq %rax, %rcx
movq $-0x1, %rax
shrq %cl, %rax
andq %rax, %rdx
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
orq 0x8(%rax,%rcx,8), %rdx
movq %rdx, 0x8(%rax,%rcx,8)
jmp 0x16e3
movq -0x20(%rbp), %rcx
andq $0x3f, %rcx
movq $-0x1, %rdx
shlq %cl, %rdx
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
orq 0x8(%rax,%rcx,8), %rdx
movq %rdx, 0x8(%rax,%rcx,8)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
cmpq -0x38(%rbp), %rax
jae 0x16b7
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movq $-0x1, 0x8(%rax,%rcx,8)
jmp 0x1692
movq -0x28(%rbp), %rax
andq $0x3f, %rax
movl $0x3f, %ecx
subq %rax, %rcx
movq $-0x1, %rdx
shrq %cl, %rdx
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
orq 0x8(%rax,%rcx,8), %rdx
movq %rdx, 0x8(%rax,%rcx,8)
jmp 0x16e5
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/test/../src/db.h
// Function: JFDB_region_map_clear
static inline void JFDB_region_map_clear(JFDB_RegionMap *map, JFDB_Region region) {
  // clear numSlots bits from start
  // same caveats as with store
  if (region.size) {
    size_t numSlots = RUP(region.size, JFDB_BLOCK_SIZE);
    size_t start = region.block - map->begin, stop = start + numSlots - 1;
    size_t startWord = start / 64, stopWord = stop / 64;
    if (startWord == stopWord) {
      map->data[startWord] &=
        (-1LLU >> (64 - (start % 64))) |
        (-1LLU << ((stop % 64) + 1));
    } else {
      map->data[startWord] &= -1LLU >> (64 - (start % 64));
      while (++startWord < stopWord)
        map->data[startWord] = 0;
      map->data[stopWord] &= -1LLU << ((stop % 64) + 1);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rsi, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
cmpl $0x0, -0x4(%rbp)
je 0x181d
movl -0x4(%rbp), %eax
addl $0x100, %eax            # imm = 0x100
subl $0x1, %eax
shrl $0x8, %eax
movl %eax, %eax
movq %rax, -0x18(%rbp)
movl -0x8(%rbp), %eax
movq -0x10(%rbp), %rcx
subl (%rcx), %eax
movl %eax, %eax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq -0x18(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
shrq $0x6, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
shrq $0x6, %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
jne 0x17a2
movq -0x20(%rbp), %rax
andq $0x3f, %rax
movl $0x40, %ecx
subq %rax, %rcx
movq $-0x1, %rdx
shrq %cl, %rdx
movq -0x28(%rbp), %rcx
andq $0x3f, %rcx
addq $0x1, %rcx
movq $-0x1, %rax
shlq %cl, %rax
orq %rax, %rdx
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
andq 0x8(%rax,%rcx,8), %rdx
movq %rdx, 0x8(%rax,%rcx,8)
jmp 0x181b
movq -0x20(%rbp), %rax
andq $0x3f, %rax
movl $0x40, %ecx
subq %rax, %rcx
movq $-0x1, %rdx
shrq %cl, %rdx
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
andq 0x8(%rax,%rcx,8), %rdx
movq %rdx, 0x8(%rax,%rcx,8)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
cmpq -0x38(%rbp), %rax
jae 0x17f3
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movq $0x0, 0x8(%rax,%rcx,8)
jmp 0x17ce
movq -0x28(%rbp), %rcx
andq $0x3f, %rcx
addq $0x1, %rcx
movq $-0x1, %rdx
shlq %cl, %rdx
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
andq 0x8(%rax,%rcx,8), %rdx
movq %rdx, 0x8(%rax,%rcx,8)
jmp 0x181d
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/test/jfdb.c
// Function: test_store
static int test_store(JFDB *db) {
  int flags = 0;
  store_basic(db, flags);
  store_small(db, flags);
  return JFDB_pif_error(db, "Failed to store");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x1ce0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x1e50
movq -0x8(%rbp), %rdi
leaq 0x7461(%rip), %rsi      # 0x9037
callq 0x1b30
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/test/jfdb.c
// Function: test_find
static int test_find(JFDB *db) {
  JFT_Cursor cursor;
  for (uint64_t i = 0; i < 10000; i++) {
    JFT_Stem k = (JFT_Stem) {
      .pre = JFT_SYMBOL_PRIMARY,
      .size = 8,
      .data = (uint8_t *)&i
    };
    JFDB_find(db, &cursor, &k);
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x48(%rbp)
cmpq $0x2710, -0x48(%rbp)    # imm = 0x2710
jae 0x1c43
movq $-0x5, -0x60(%rbp)
movw $0x8, -0x58(%rbp)
leaq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x4280
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x1c04
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/test/jfdb.c
// Function: store_basic
static void store_basic(JFDB *db, int flags) {
  const JFT_Stem w[] = {
    JFTK("k1"),
    JFTK("k2"),
    JFTK("value"),
    JFTK("other"),
    JFTK("these"),
    JFTK("are"),
    JFTK("just"),
    JFTK("some"),
    JFTK("strings, maybe a little bit longer this time although not long enough")
  };

  JFDB_store(db, w + 0, w + 2, NULL, 0, flags);  // k1
  JFDB_store(db, w + 1, w + 3, NULL, 0, flags);  // k2
  JFDB_store(db, w + 0, w + 3, NULL, 0, flags);  // k1
  JFDB_store(db, w + 1, w + 2, NULL, 0, flags);  // k2
  JFDB_store(db, w + 4, w + 8, NULL, 0, flags);  // these
  JFDB_store(db, w + 6, w + 7, NULL, 0, flags);  // just
  JFDB_store(db, w + 5, w + 6, w + 2, 6, flags); // are
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq -0xf0(%rbp), %rdi
leaq 0xa010(%rip), %rsi      # 0xbd10
movl $0xd8, %edx
callq 0x1140
movq -0x8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
addq $0x30, %rdx
movl -0xc(%rbp), %r9d
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x3840
movq -0x8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
addq $0x18, %rsi
leaq -0xf0(%rbp), %rdx
addq $0x48, %rdx
movl -0xc(%rbp), %r9d
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x3840
movq -0x8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
addq $0x48, %rdx
movl -0xc(%rbp), %r9d
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x3840
movq -0x8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
addq $0x18, %rsi
leaq -0xf0(%rbp), %rdx
addq $0x30, %rdx
movl -0xc(%rbp), %r9d
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x3840
movq -0x8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
addq $0x60, %rsi
leaq -0xf0(%rbp), %rdx
addq $0xc0, %rdx
movl -0xc(%rbp), %r9d
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x3840
movq -0x8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
addq $0x90, %rsi
leaq -0xf0(%rbp), %rdx
addq $0xa8, %rdx
movl -0xc(%rbp), %r9d
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x3840
movq -0x8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
addq $0x78, %rsi
leaq -0xf0(%rbp), %rdx
addq $0x90, %rdx
leaq -0xf0(%rbp), %rcx
addq $0x30, %rcx
movl -0xc(%rbp), %r9d
movl $0x6, %r8d
callq 0x3840
addq $0xf0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/test/jfdb.c
// Function: store_small
static void store_small(JFDB *db, int flags) {
  for (uint64_t i = 0; i < 10000; i++) {
    JFT_Stem k = (JFT_Stem) {
      .size = 8,
      .data = (uint8_t *)&i
    };
    JFDB_store(db, &k, &k, NULL, 0, flags);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x2710, -0x18(%rbp)    # imm = 0x2710
jae 0x1eb0
movq $0x0, -0x30(%rbp)
movw $0x8, -0x28(%rbp)
leaq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %r9d
leaq -0x30(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
movq %rdx, %rsi
callq 0x3840
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1e67
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/src/db.c
// Function: JFDB_wipe
int JFDB_wipe(const char *path) {
  // remove keys & vals, flag if either one fails
  int failed = 0;
  char fp[JFDB_MAX_PATH + 6];
  snprintf(fp, sizeof(fp), "%s.keys", path);
  remove(fp);
  switch (errno) {
    case 0:
    case ENOENT:
      break;
    default:
      failed |= JFDB_KEYS;
      break;
  }
  snprintf(fp, sizeof(fp), "%s.vals", path);
  remove(fp);
  switch (errno) {
    case 0:
    case ENOENT:
      break;
    default:
      failed |= JFDB_VALS;
      break;
  }
  return failed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rcx
leaq 0x71dc(%rip), %rdx      # 0x90bd
xorl %eax, %eax
leaq -0x420(%rbp), %rdi
movq %rdi, -0x428(%rbp)
movl $0x406, %esi            # imm = 0x406
callq 0x10d0
movq -0x428(%rbp), %rdi
callq 0x1060
callq 0x1040
movl (%rax), %eax
testl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
je 0x1f17
jmp 0x1f19
jmp 0x1f22
movl -0xc(%rbp), %eax
orl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rcx
leaq 0x7198(%rip), %rdx      # 0x90c5
xorl %eax, %eax
leaq -0x420(%rbp), %rdi
movq %rdi, -0x430(%rbp)
movl $0x406, %esi            # imm = 0x406
callq 0x10d0
movq -0x430(%rbp), %rdi
callq 0x1060
callq 0x1040
movl (%rax), %eax
testl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
je 0x1f63
jmp 0x1f65
jmp 0x1f6e
movl -0xc(%rbp), %eax
orl $0x2, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/src/db.h
// Function: JFDB_set_error
static inline JFDB *JFDB_set_error(JFDB *db, int code, const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  db->error = code;
  vsnprintf(db->errstr, JFDB_MAX_ERRSTR, fmt, ap);
  va_end(ap);
  return db;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0x2358
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0xe0(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x30, -0x2c(%rbp)
movl $0x18, -0x30(%rbp)
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x88(%rax)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rdx
movl $0x80, %esi
leaq -0x30(%rbp), %rcx
callq 0x1070
movq -0x8(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/src/db.c
// Function: JFDB_file_open
static int JFDB_file_open(JFDB *db, const char *path) {
  // get the fd for keys & vals, and sanity check that they look like valid files
  // vals has a different header, but the magic / version are the same
  int fd;
  if ((fd = open(path, O_RDWR, 0644)) < 0) {
    if (errno == ENOENT) {
      if ((fd = open(path, O_RDWR | O_CREAT | O_EXCL, 0644)) < 0) {
        JFDB_set_error(db, JFDB_EFILE, "could not create ('%.32s')", path);
      } else {
        // new file: write the header
        db->tip.magic = JFDB_MAGIC;
        db->tip.version = JFDB_VERSION;
        if (write(fd, &db->tip, sizeof(db->tip)) < sizeof(db->tip))
          JFDB_set_error(db, JFDB_EFILE, "failed to write ('%.32s')", path);
      }
    } else {
      JFDB_set_error(db, JFDB_EFILE, "cannot open file ('%.32s')", path);
    }
  } else {
    // existing file: read the header
    if (read(fd, &db->tip, sizeof(db->tip)) < sizeof(db->tip))
      JFDB_set_error(db, JFDB_EFILE, "failed to read ('%.32s')", path);
    else if (db->tip.magic != JFDB_MAGIC && db->tip.version != JFDB_VERSION)
      JFDB_set_error(db, JFDB_EFILE, "invalid file ('%.32s')", path);
  }
  return fd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2, %esi
movl $0x1a4, %edx            # imm = 0x1A4
movb $0x0, %al
callq 0x1190
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jge 0x24bf
callq 0x1040
cmpl $0x2, (%rax)
jne 0x24a2
movq -0x10(%rbp), %rdi
movl $0xc2, %esi
movl $0x1a4, %edx            # imm = 0x1A4
movb $0x0, %al
callq 0x1190
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jge 0x2449
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x4, %esi
leaq 0x6e83(%rip), %rdx      # 0x92c3
movb $0x0, %al
callq 0x2320
jmp 0x24a0
movq -0x8(%rbp), %rax
movl $0x7fdb, 0xc0(%rax)     # imm = 0x7FDB
movq -0x8(%rbp), %rax
movl $0x0, 0xc4(%rax)
movl -0x14(%rbp), %edi
movq -0x8(%rbp), %rsi
addq $0xc0, %rsi
movl $0x70, %edx
callq 0x1080
cmpq $0x70, %rax
jae 0x249e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x4, %esi
leaq 0x6e47(%rip), %rdx      # 0x92de
movb $0x0, %al
callq 0x2320
jmp 0x24a0
jmp 0x24bd
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x4, %esi
leaq 0x6e42(%rip), %rdx      # 0x92f8
movb $0x0, %al
callq 0x2320
jmp 0x2536
movl -0x14(%rbp), %edi
movq -0x8(%rbp), %rsi
addq $0xc0, %rsi
movl $0x70, %edx
callq 0x1110
cmpq $0x70, %rax
jae 0x24fa
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x4, %esi
leaq 0x6e22(%rip), %rdx      # 0x9313
movb $0x0, %al
callq 0x2320
jmp 0x2534
movq -0x8(%rbp), %rax
cmpl $0x7fdb, 0xc0(%rax)     # imm = 0x7FDB
je 0x2532
movq -0x8(%rbp), %rax
cmpl $0x0, 0xc4(%rax)
je 0x2532
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x4, %esi
leaq 0x6e01(%rip), %rdx      # 0x932c
movb $0x0, %al
callq 0x2320
jmp 0x2534
jmp 0x2536
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x980(%rax)
je 0x2c6e
movq -0x10(%rbp), %rdi
callq 0x2d10
movq %rax, %rdi
callq 0x2540
cmpl $0x0, %eax
je 0x2c6c
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2d02
jmp 0x2c6e
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x2f30
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x2f30
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x2fc0
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x2fc0
movq -0x10(%rbp), %rax
movl 0x8c(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2ce5
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x1ec0
cmpl $0x0, %eax
je 0x2ce3
movq -0x10(%rbp), %rdi
movl $0x4, %esi
leaq 0x6431(%rip), %rdx      # 0x9107
movb $0x0, %al
callq 0x2320
movq %rax, -0x8(%rbp)
jmp 0x2d02
jmp 0x2ce5
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x1030
movq -0x10(%rbp), %rdi
callq 0x1030
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0x2f55
movq -0x8(%rbp), %rax
addq $0x90, %rax
movq %rax, -0x20(%rbp)
jmp 0x2f63
movq -0x8(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq $-0x1, %rcx
cmpq %rcx, 0x8(%rax)
je 0x2f91
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x1170
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jl 0x2fa5
movq -0x18(%rbp), %rax
movl (%rax), %edi
callq 0x1100
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x10f0
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x988(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x990(%rax), %r9
leaq -0x30(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x61c0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x3814
movq -0x10(%rbp), %rdi
movl $0x6, %esi
leaq 0x597b(%rip), %rdx      # 0x9182
movb $0x0, %al
callq 0x2320
movq %rax, -0x8(%rbp)
jmp 0x3828
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x3010
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/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl %r9d, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movzwl 0x8(%rax), %eax
movl %eax, %esi
callq 0x3980
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2540
cmpl $0x0, %eax
je 0x3892
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3972
movq -0x10(%rbp), %rax
movl 0xa8(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x8(%rax), %eax
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rdi
callq 0x3ad0
movl -0x64(%rbp), %edi
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %rax, %rcx
callq 0x1180
movq -0x20(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
cmpq %rcx, %rax
jge 0x38fd
movq -0x10(%rbp), %rdi
movl $0x4, %esi
leaq 0x58a8(%rip), %rdx      # 0x9198
movb $0x0, %al
callq 0x2320
movq %rax, -0x8(%rbp)
jmp 0x3972
movl $0x1, -0x48(%rbp)
leaq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movq 0x988(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x990(%rax), %r9
leaq -0x48(%rbp), %rsi
callq 0x61c0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x395e
movq -0x10(%rbp), %rdi
movl $0x6, %esi
leaq 0x5831(%rip), %rdx      # 0x9182
movb $0x0, %al
callq 0x2320
movq %rax, -0x8(%rbp)
jmp 0x3972
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x30(%rbp), %edx
callq 0x3010
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/src/db.c
// Function: JFDB_valloc
static JFDB_Region JFDB_valloc(JFDB *db, size_t size) {
  JFDB_CheckPoint *cp = &db->tip.cp;
  uint32_t block;
  size_t blockSize = RTM(size, JFDB_BLOCK_SIZE);
  for (int i = 0; i < JFDB_NUM_GAPS; i++) {
    JFDB_Region *gap = &cp->gaps[i];
    if (blockSize <= gap->size) {
      // we found a big enough gap to hold the value
      // adjust the gap and return a block beginning where it was
      block = gap->block;
      gap->block += blockSize / JFDB_BLOCK_SIZE;
      gap->size -= blockSize;
      return (JFDB_Region) {
        .block = block,
        .size = size
      };
    }
  }

  // otherwise append to next block at the end of file
  // return a region no matter what, but db may have error
  block = NBLOCKS(cp->lengthVals);
  cp->lengthVals = block * JFDB_BLOCK_SIZE + size;
  if (ftruncate(db->vmap.fd, cp->lengthVals))
    JFDB_set_error(db, JFDB_EFILE, "failed to truncate vals");
  JFDB_mmap_file(db, JFDB_VALS, cp->lengthVals, 2);
  return (JFDB_Region) {
    .block = block,
    .size = size
  };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0xc0, %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x100, %rax            # imm = 0x100
subq $0x1, %rax
shrq $0x8, %rax
shlq $0x8, %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x8, -0x34(%rbp)
jge 0x3a38
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
ja 0x3a2b
movq -0x40(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x30(%rbp), %rdx
shrq $0x8, %rdx
movq -0x40(%rbp), %rax
movl (%rax), %ecx
addq %rdx, %rcx
movl %ecx, (%rax)
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %rax
movl 0x4(%rax), %ecx
subq %rdx, %rcx
movl %ecx, 0x4(%rax)
movl -0x24(%rbp), %eax
movl %eax, -0x8(%rbp)
movq -0x18(%rbp), %rax
movl %eax, -0x4(%rbp)
jmp 0x3abf
jmp 0x3a2d
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x39c3
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
addq $0x100, %rax            # imm = 0x100
subq $0x1, %rax
shrq $0x8, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
shll $0x8, %eax
movl %eax, %eax
movl %eax, %ecx
addq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movl 0xa8(%rax), %edi
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x10e0
cmpl $0x0, %eax
je 0x3a9a
movq -0x10(%rbp), %rdi
movl $0x4, %esi
leaq 0x58bf(%rip), %rdx      # 0x9352
movb $0x0, %al
callq 0x2320
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rdx
movl $0x2, %ecx
movl %ecx, %esi
callq 0x2570
movl -0x24(%rbp), %eax
movl %eax, -0x8(%rbp)
movq -0x18(%rbp), %rax
movl %eax, -0x4(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rsi, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
movl -0x4(%rbp), %ecx
addl $0x100, %ecx            # imm = 0x100
subl $0x1, %ecx
shrl $0x8, %ecx
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x130(%rcx), %eax
jae 0x3b35
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x130(%rax)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x134(%rcx), %eax
jbe 0x3b51
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x134(%rax)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rdx
movq 0x138(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x138(%rdx)
movq -0x8(%rbp), %rdx
movq %rdx, 0x140(%rax,%rcx,8)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/src/db.c
// Function: JFDB_crush
JFDB *JFDB_crush(JFDB *db) {
  // compact the DB (only) if there are multiple levels
  // NB: this doesn't guarantee nothing would change if we were to compact
  //     e.g. currently it may take multiple compactions to optimize branches after pruning
  if (db->tip.cp.levels > 1)
    return JFDB_compact(db, NULL);
  return db;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1, 0x120(%rax)
jbe 0x402d
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x26f0
movq %rax, -0x8(%rbp)
jmp 0x4035
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/src/db.c
// Function: JFDB_calculate_gaps
static JFDB *JFDB_calculate_gaps(JFDB *db, const JFT *trie) {
  // create a region map to cover all the vals
  uint32_t lower = NBLOCKS(sizeof(JFDB_Header));
  uint32_t upper = NBLOCKS(db->tip.cp.lengthVals);
  JFDB_RegionMap *map = JFDB_region_map_alloc(lower, upper, 0);
  if (!map)
    return JFDB_set_error(db, JFDB_ENOMEM, "failed to create region map");

  // add all the regions in the trie (values of primary keys)
  JFT_Cursor cursor = JFT_cursor((JFT *)trie);
  JFT_Stem stem = (JFT_Stem) {
    .pre = JFT_SYMBOL_PRIMARY,
    .size = 1,
    .data = db->keyData
  };
  JFT_Keys keys = JFT_keys(&cursor, &stem, Forward);
  for (int i = 0; JFT_keys_next(&keys); i++) {
    JFT_Leaf leaf = JFT_leaf(cursor.node);
    if (leaf.size)
      JFDB_region_map_store(map, *(JFDB_Region *)leaf.data);
  }

  // determine gaps
  JFDB_region_map_gaps(map, db->tip.cp.gaps);
  JFDB_region_map_free(map);

  return db;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x1, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x118(%rax), %rax
addq $0x100, %rax            # imm = 0x100
subq $0x1, %rax
shrq $0x8, %rax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %edi
movl -0x20(%rbp), %esi
xorl %edx, %edx
callq 0x3b80
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x40ae
movq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq 0x52cc(%rip), %rdx      # 0x936a
movb $0x0, %al
callq 0x2320
movq %rax, -0x8(%rbp)
jmp 0x417a
movq -0x18(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x34a0
movq $-0x5, -0x78(%rbp)
movw $0x1, -0x70(%rbp)
movq -0x10(%rbp), %rax
addq $0x998, %rax            # imm = 0x998
movq %rax, -0x68(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x78(%rbp), %rdx
movl $0x1, %ecx
callq 0x4610
movl $0x0, -0x9c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x4670
cmpq $0x0, %rax
je 0x4151
movq -0x58(%rbp), %rdi
callq 0x4220
movl %eax, -0xb0(%rbp)
movq %rdx, -0xa8(%rbp)
cmpl $0x0, -0xb0(%rbp)
je 0x413e
movq -0x28(%rbp), %rdi
movq -0xa8(%rbp), %rax
movq (%rax), %rsi
callq 0x4a20
jmp 0x4140
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x40fa
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0xc0, %rsi
addq $0x10, %rsi
callq 0x3dd0
movq -0x28(%rbp), %rdi
callq 0x3fe0
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopw (%rax,%rax)