LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_external.c
// Function: cram_cid2ds_query
int *cram_cid2ds_query(cram_cid2ds_t *c2d, int content_id, int *n) {
    *n = 0;
    if (!c2d || !c2d->hash)
        return NULL;

    khiter_t k = kh_get(cid, c2d->hash, content_id);
    if (k == kh_end(c2d->hash))
        return NULL;

    if (!c2d->ds_a) {
        c2d->ds_a = malloc(c2d->ds_idx * sizeof(int));
        if (!c2d->ds_a)
            return NULL;
    }

    int dsi = kh_value(c2d->hash, k); // initial ds array index from hash
    int idx = 0;
    while (dsi >= 0) {
        c2d->ds_a[idx++] = c2d->ds[dsi].data_series;
        dsi = c2d->ds[dsi].next;      // iterate over list within ds array
    }

    *n = idx;
    return c2d->ds_a;
}

// Assembly:
andl $0x0, (%rdx)
testq %rdi, %rdi
je 0x7598c
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x10(%rdi), %r15
xorl %r12d, %r12d
testq %r15, %r15
je 0x7599f
movq %rdx, %rbx
movl (%r15), %edx
testl %edx, %edx
je 0x7599a
leal -0x1(%rdx), %edi
movl %edi, %r8d
andl %esi, %r8d
movq 0x10(%r15), %r9
pushq $0x1
popq %r10
xorl %eax, %eax
movl %r8d, %r12d
movl %r12d, %ecx
shrl $0x4, %ecx
movl (%r9,%rcx,4), %r11d
leal (%r12,%r12), %ecx
andl $0x1e, %ecx
movl %r11d, %ebp
shrl %cl, %ebp
testb $0x2, %bpl
jne 0x7598f
testb $0x1, %bpl
jne 0x7597c
movq 0x18(%r15), %r13
movl %r12d, %ebp
cmpl %esi, (%r13,%rbp,4)
je 0x7598f
addl %r10d, %r12d
andl %edi, %r12d
incl %r10d
cmpl %r8d, %r12d
jne 0x7594c
jmp 0x759e8
xorl %eax, %eax
retq
shrl %cl, %r11d
testb $0x3, %r11b
cmovnel %edx, %r12d
cmpl %edx, %r12d
jne 0x759a3
xorl %eax, %eax
jmp 0x759e8
movq 0x18(%r14), %rax
testq %rax, %rax
jne 0x759c2
movslq 0xc(%r14), %rdi
shlq $0x2, %rdi
callq 0x14840
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x7599f
movq 0x20(%r15), %rcx
movl %r12d, %edx
movl (%rcx,%rdx,8), %edx
xorl %ecx, %ecx
testl %edx, %edx
js 0x759e6
movq (%r14), %rsi
movl %edx, %edx
movl (%rsi,%rdx,8), %edi
movl %edi, (%rax,%rcx,4)
incq %rcx
movl 0x4(%rsi,%rdx,8), %edx
jmp 0x759ce
movl %ecx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_external.c
// Function: cram_describe_encodings
int cram_describe_encodings(cram_block_compression_hdr *hdr, kstring_t *ks) {
    cram_codec_iter citer;
    cram_codec_iter_init(hdr, &citer);
    cram_codec *codec;
    int key, r = 0;

    while ((codec = cram_codec_iter_next(&citer, &key))) {
        char key_s[4] = {0};
        int key_i = 0;
        if (key>>16) key_s[key_i++] = key>>16;
        key_s[key_i++] = (key>>8)&0xff;
        key_s[key_i++] = key&0xff;
        r |= ksprintf(ks, "\t%s\t", key_s) < 0;
        r |= cram_codec_describe(codec, ks) < 0;
        r |= kputc('\n', ks) < 0;
    }

    return r ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
leaq 0x10(%rsp), %r14
movq %rdi, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
xorl %r15d, %r15d
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
callq 0x75851
testq %rax, %rax
je 0x75afd
movq %rax, %r12
andl $0x0, 0x8(%rsp)
movl 0xc(%rsp), %eax
xorl %ecx, %ecx
cmpl $0x10000, %eax          # imm = 0x10000
jb 0x75a52
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x8(%rsp)
pushq $0x1
popq %rcx
movl %ecx, %ecx
rolw $0x8, %ax
movw %ax, 0x8(%rsp,%rcx)
movq %rbx, %rdi
leaq 0x36299(%rip), %rsi     # 0xabd00
leaq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x143a0
movl %eax, %ebp
movq %r12, %rdi
movq %rbx, %rsi
callq 0x155d0
movl %eax, %r12d
movq (%rbx), %rcx
leaq 0x2(%rcx), %rax
cmpq %rax, 0x8(%rbx)
jae 0x75ace
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
testq %rcx, %rcx
movl $0x0, %r13d
cmoveq %rdx, %r13
addq %rax, %r13
movq 0x10(%rbx), %rdi
movq %r13, %rsi
callq 0x16380
pushq $-0x1
popq %rcx
testq %rax, %rax
je 0x75aeb
movq %rax, 0x10(%rbx)
movq %r13, 0x8(%rbx)
movq (%rbx), %rcx
jmp 0x75ad2
movq 0x10(%rbx), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movb $0xa, (%rax,%rcx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
pushq $0xa
popq %rcx
orl %ebp, %r12d
orl %ecx, %r12d
shrl $0x1f, %r12d
orl %r12d, %r15d
jmp 0x75a1b
xorl %eax, %eax
negl %r15d
sbbl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_external.c
// Function: cram_slice_hdr_get_coords
void cram_slice_hdr_get_coords(cram_block_slice_hdr *h,
                               int *refid, hts_pos_t *start, hts_pos_t *span) {
    if (refid)
        *refid = h->ref_seq_id;
    if (start)
        *start = h->ref_seq_start;
    if (span)
        *span  = h->ref_seq_span;
}

// Assembly:
testq %rsi, %rsi
je 0x75b25
movl 0x4(%rdi), %eax
movl %eax, (%rsi)
testq %rdx, %rdx
je 0x75b31
movq 0x8(%rdi), %rax
movq %rax, (%rdx)
testq %rcx, %rcx
je 0x75b3d
movq 0x10(%rdi), %rax
movq %rax, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_external.c
// Function: cram_block_append
int cram_block_append(cram_block *b, const void *data, int size) {
    BLOCK_APPEND(b, data, size);
    return 0;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movslq %edx, %r14
movq 0x30(%rdi), %r12
addq %r14, %r12
movq 0x28(%rdi), %rax
cmpq %r12, %rax
ja 0x75bdd
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r12, %rax
cmovaq %rax, %r12
movq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0x16380
testq %rax, %rax
je 0x75bfd
movq %r12, 0x28(%rbx)
movq %rax, 0x20(%rbx)
xorl %r12d, %r12d
testl %ebp, %ebp
je 0x75c01
movq 0x20(%rbx), %rdi
addq 0x30(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x165f0
addq %r14, 0x30(%rbx)
jmp 0x75c01
pushq $-0x1
popq %r12
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/cram/cram_external.c
// Function: cram_copy_slice
int cram_copy_slice(cram_fd *in, cram_fd *out, int32_t num_slice) {
    int32_t i, j;

    for (i = 0; i < num_slice; i++) {
        cram_block *blk;
        cram_block_slice_hdr *hdr;

        if (!(blk = cram_read_block(in)))
            return -1;
        if (!(hdr = cram_decode_slice_header(in, blk))) {
            cram_free_block(blk);
            return -1;
        }

        if (cram_write_block(out, blk) != 0) {
            cram_free_block(blk);
            return -1;
        }
        cram_free_block(blk);

        int num_blocks = cram_slice_hdr_get_num_blocks(hdr);
        for (j = 0; j < num_blocks; j++) {
            blk = cram_read_block(in);
            if (!blk || cram_write_block(out, blk) != 0) {
                if (blk) cram_free_block(blk);
                return -1;
            }
            cram_free_block(blk);
        }
        cram_free_slice_header(hdr);
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
testl %edx, %edx
cmovlel %eax, %ebp
xorl %ebx, %ebx
cmpl %ebp, %ebx
je 0x75f36
movq %r15, %rdi
callq 0x14930
testq %rax, %rax
je 0x75f24
movq %rax, %r13
movq %r15, %rdi
movq %rax, %rsi
callq 0x16320
testq %rax, %rax
je 0x75f1c
movq %rax, %r12
movq %r14, %rdi
movq %r13, %rsi
callq 0x15810
testl %eax, %eax
jne 0x75f1c
movl %ebx, 0x4(%rsp)
movq %r13, %rdi
callq 0x15100
movl 0x28(%r12), %ebx
testl %ebx, %ebx
movl $0x0, %eax
cmovlel %eax, %ebx
subl $0x1, %ebx
jb 0x75f09
movq %r15, %rdi
callq 0x14930
testq %rax, %rax
je 0x75f24
movq %rax, %r13
movq %r14, %rdi
movq %rax, %rsi
callq 0x15810
testl %eax, %eax
jne 0x75f1c
movq %r13, %rdi
callq 0x15100
jmp 0x75edb
movq %r12, %rdi
callq 0x15920
movl 0x4(%rsp), %ebx
incl %ebx
jmp 0x75e82
movq %r13, %rdi
callq 0x15100
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x75f27
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: dump_stack
void dump_stack() {
  CELL i;
  if (sp == 0)
    return;
  printf("\nStack: ");
  for (i = 1; i <= sp; i++) {
    if (i == sp)
      printf("[ TOS: %lld ]", (long long)data[i]);
    else
      printf("%lld ", (long long)data[i]);
  }
  printf("\n");
}

// Assembly:
cmpl $0x0, 0x2f6d(%rip)      # 0x41b0
je 0x12af
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0xdc4(%rip), %rdi       # 0x2018
xorl %eax, %eax
callq 0x1080
pushq $0x1
popq %rbx
leaq 0x2f5b(%rip), %r14      # 0x41c0
leaq 0xdb5(%rip), %r15       # 0x2021
leaq 0xdbc(%rip), %r12       # 0x202f
movslq 0x2f36(%rip), %rax      # 0x41b0
cmpq %rax, %rbx
jg 0x129c
movl %eax, %eax
movq %r15, %rdi
cmpq %rax, %rbx
je 0x128c
movq %r12, %rdi
movslq (%r14,%rbx,4), %rsi
xorl %eax, %eax
callq 0x1080
incq %rbx
jmp 0x1273
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1030
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: include_file
int include_file(char *fname) {
  FILE *fp;
  char source[2049];
  int inBlock = 0;
  int tokens = 0;
  fp = fopen(fname, "r");
  if (fp == NULL)
    return 0;
  while (!feof(fp))
  {
    read_token(fp, source, 0, 2048);
    if (strcmp(source, "~~~") == 0) {
      if (inBlock == 0)
        inBlock = 1;
      else
        inBlock = 0;
    } else {
      if (inBlock == 1) {
        evaluate(source);
        tokens++;
      }
    }
  }
  fclose(fp);
  return tokens;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x810, %rsp            # imm = 0x810
leaq 0xddb(%rip), %rsi       # 0x20a1
callq 0x1100
testq %rax, %rax
je 0x1330
movq %rax, %rbx
xorl %r12d, %r12d
movq %rsp, %r14
pushq $0x1
popq %r15
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x10d0
testl %eax, %eax
jne 0x1326
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl $0x800, %ecx            # imm = 0x800
callq 0x1344
cmpl $0x7e7e7e, (%rsp)       # imm = 0x7E7E7E
jne 0x130c
xorl $0x1, %r12d
jmp 0x12df
testl %r12d, %r12d
movl $0x0, %r12d
je 0x12df
movq %r14, %rdi
callq 0x13ff
incl %ebp
movl %r15d, %r12d
jmp 0x12df
movq %rbx, %rdi
callq 0x1060
jmp 0x1332
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x810, %rsp            # imm = 0x810
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: read_token
void read_token(FILE *file, char *token_buffer, int echo, int max) {
  int ch, count;
  ch = getc(file);
  if (echo != 0)
    putchar(ch);
  count = 0;
  while (not_eol(ch))
  {
    if ((ch == 8 || ch == 127) && count > 0) {
      count--;
      if (echo != 0) {
        putchar(8);
        putchar(32);
        putchar(8);
      }
    } else {
      token_buffer[count++] = ch;
    }
    if (count == max) {
      break;
    }
    ch = getc(file);
    if (echo != 0)
      putchar(ch);
  }
  token_buffer[count] = '\0';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r12d
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %r15
callq 0x1130
movl %eax, %r13d
xorl %ebp, %ebp
testl %r14d, %r14d
jne 0x13dc
leal 0x1(%r13), %eax
cmpl $0x21, %eax
ja 0x1383
movabsq $0x200004803, %rcx      # imm = 0x200004803
btq %rax, %rcx
jb 0x13e9
cmpl $0x8, %r13d
setne %al
cmpl $0x7f, %r13d
setne %cl
andb %al, %cl
testl %ebp, %ebp
setle %al
orb %cl, %al
jne 0x13c1
decl %ebp
testl %r14d, %r14d
je 0x13ca
pushq $0x8
popq %r13
movl %r13d, %edi
callq 0x1030
pushq $0x20
popq %rdi
callq 0x1030
movl %r13d, %edi
callq 0x1030
jmp 0x13ca
movslq %ebp, %rax
incl %ebp
movb %r13b, (%rbx,%rax)
cmpl %r12d, %ebp
je 0x13e6
movq %r15, %rdi
callq 0x1130
movl %eax, %r13d
jmp 0x1365
movl %r13d, %edi
callq 0x1030
jmp 0x136a
movl %r12d, %ebp
movslq %ebp, %rax
movb $0x0, (%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/crcx[P]retroforth/tools/retro-extend.c
// Function: evaluate
void evaluate(char *s) {
  if (strlen(s) == 0)
    return;
  string_inject(s, TIB);
  stack_push(TIB);
  execute(interpret);
}

// Assembly:
cmpb $0x0, (%rdi)
je 0x143e
pushq %rax
movl 0x31e1(%rip), %esi      # 0x45ec
callq 0x1612
movl 0x31d6(%rip), %eax      # 0x45ec
movslq 0x2d93(%rip), %rcx      # 0x41b0
leaq 0x1(%rcx), %rdx
movl %edx, 0x2d89(%rip)      # 0x41b0
leaq 0x2d92(%rip), %rdx      # 0x41c0
movl %eax, 0x4(%rdx,%rcx,4)
movl 0x2051b4(%rip), %edi    # 0x2065ec
popq %rax
jmp 0x179c
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: main
int main(int argc, char **argv) {
  int tokens, i;
  FILE *fp;
  ngaPrepare();
  max_sp = 0;
  max_rsp = 0;
  ngaLoadImage(argv[1]);
  update_rx();
  printf("Initial Image Size: %lld\n", (long long)Heap);
  for (i = 2; i < argc; i++) {
    tokens = include_file(argv[i]);
    printf("   + %lld tokens from %s\n", (long long)tokens, argv[i]);
  }
  update_rx();
  printf("New Image Size: %lld\n", (long long)Heap);
  printf("MAX SP: %lld, RP: %lld\n", (long long)max_sp, (long long)max_rsp);
  if ((fp = fopen(argv[1], "wb")) == NULL) {
    printf("Unable to save the ngaImage!\n");
    exit(2);
  }
  fwrite(&memory, sizeof(CELL), memory[3] + 1, fp);
  fclose(fp);
  if (sp != 0) {
    printf("Stack not empty!\n");
    dump_stack();
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
callq 0x196b
andl $0x0, 0x3168(%rip)      # 0x45c0
andl $0x0, 0x3165(%rip)      # 0x45c4
movq 0x8(%rbx), %rdi
callq 0x155f
callq 0x173f
movslq 0x3154(%rip), %rsi      # 0x45c8
leaq 0xbba(%rip), %rdi       # 0x2035
xorl %eax, %eax
callq 0x1080
movslq %ebp, %r15
pushq $0x2
popq %r12
leaq 0xbbf(%rip), %r14       # 0x204f
cmpq %r15, %r12
jge 0x14b4
movq (%rbx,%r12,8), %rdi
callq 0x12b0
movslq %eax, %rsi
movq (%rbx,%r12,8), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x1080
incq %r12
jmp 0x1490
callq 0x173f
movslq 0x3108(%rip), %rsi      # 0x45c8
leaq 0xba2(%rip), %rdi       # 0x2069
xorl %eax, %eax
callq 0x1080
movslq 0x30eb(%rip), %rsi      # 0x45c0
movslq 0x30e8(%rip), %rdx      # 0x45c4
leaq 0xb9c(%rip), %rdi       # 0x207f
xorl %eax, %eax
callq 0x1080
movq 0x8(%rbx), %rdi
leaq 0xba2(%rip), %rsi       # 0x2097
callq 0x1100
testq %rax, %rax
je 0x154b
movq %rax, %rbx
leaq 0x30c7(%rip), %rdi      # 0x45d0
movslq 0x30cc(%rip), %rdx      # 0x45dc
incq %rdx
pushq $0x4
popq %rsi
movq %rax, %rcx
callq 0x1120
movq %rbx, %rdi
callq 0x1060
cmpl $0x0, 0x2c83(%rip)      # 0x41b0
je 0x1540
leaq 0xbb9(%rip), %rdi       # 0x20ef
callq 0x1040
callq 0x123c
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbae(%rip), %rdi       # 0x2100
callq 0x1040
pushq $0x2
popq %rdi
callq 0x1110
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: string_inject
int string_inject(char *str, int buffer) {
  int m = strlen(str);
  int i = 0;
  while (m > 0) {
    memory[buffer + i] = (CELL)str[i];
    memory[buffer + i + 1] = 0;
    m--; i++;
  }
  return buffer;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x1070
movslq %ebx, %rcx
leaq 0x2fa6(%rip), %rdx      # 0x45d0
leaq (%rdx,%rcx,4), %rcx
addq $0x4, %rcx
xorl %edx, %edx
testl %eax, %eax
jle 0x164c
movsbl (%r14,%rdx), %esi
movl %esi, -0x4(%rcx,%rdx,4)
andl $0x0, (%rcx,%rdx,4)
decl %eax
incq %rdx
jmp 0x1634
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: string_extract
char *string_extract(CELL at) {
  CELL starting = at;
  CELL i = 0;
  while(memory[starting] && i < 8192)
    string_data[i++] = (char)memory[starting++];
  string_data[i] = 0;
  return (char *)string_data;
}

// Assembly:
movslq %edi, %rcx
shlq $0x2, %rcx
xorl %edx, %edx
leaq 0x2f6a(%rip), %rsi      # 0x45d0
leaq 0x202f73(%rip), %rax    # 0x2045e0
leaq (%rcx,%rdx,4), %rdi
movl (%rsi,%rdi), %edi
testl %edi, %edi
je 0x168a
cmpq $0x1fff, %rdx           # imm = 0x1FFF
ja 0x168a
movb %dil, (%rdx,%rax)
incq %rdx
jmp 0x166d
movb $0x0, (%rdx,%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: d_lookup
int d_lookup(CELL Dictionary, char *name) {
  CELL dt = 0;
  CELL i = Dictionary;
  char *dname;
  while (memory[i] != 0 && i != 0) {
    dname = string_extract(d_name(i));
    if (strcmp(dname, name) == 0) {
      dt = i;
      i = 0;
    } else {
      i = memory[i];
    }
  }
  return dt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
xorl %ebp, %ebp
leaq 0x2f1b(%rip), %r15      # 0x45d0
leaq 0x202f24(%rip), %r14    # 0x2045e0
movl %edi, %r12d
testl %r12d, %r12d
je 0x16f4
movslq %r12d, %r13
cmpl $0x0, (%r15,%r13,4)
je 0x16f4
leal 0x9(%r12), %edi
callq 0x1656
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10a0
testl %eax, %eax
je 0x16ed
movl (%r15,%r13,4), %r12d
jmp 0x16bf
xorl %edi, %edi
movl %r12d, %ebp
jmp 0x16bc
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: update_rx
void update_rx() {
  Dictionary = memory[2];
  Heap = memory[3];
  Compiler = d_xt_for("Compiler", Dictionary);
  notfound = d_xt_for("err:notfound", Dictionary);
  interpret = d_xt_for("interpret", Dictionary);
}

// Assembly:
pushq %rax
movl 0x2e92(%rip), %esi      # 0x45d8
movl %esi, 0x204e94(%rip)    # 0x2065e0
movl 0x2e8a(%rip), %eax      # 0x45dc
movl %eax, 0x2e70(%rip)      # 0x45c8
leaq 0x93b(%rip), %rdi       # 0x209a
callq 0x1705
movl %eax, 0x204e7a(%rip)    # 0x2065e4
movl 0x204e70(%rip), %esi    # 0x2065e0
leaq 0x92c(%rip), %rdi       # 0x20a3
callq 0x1705
movl %eax, 0x204e66(%rip)    # 0x2065e8
movl 0x204e58(%rip), %esi    # 0x2065e0
leaq 0x921(%rip), %rdi       # 0x20b0
callq 0x1705
movl %eax, 0x204e52(%rip)    # 0x2065ec
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: execute
void execute(CELL cell) {
  CELL opcode, a, i;
  rp = 1;
  ip = cell;
  while (ip < IMAGE_SIZE) {
    opcode = memory[ip];
    if (ip == notfound) {
      printf("%s ?\n", string_extract(TIB));
    }
    if (ngaValidatePackedOpcodes(opcode) != 0) {
      ngaProcessPackedOpcodes(opcode);
    } else {
      printf("\nERROR: Invalid instruction!\n");
      printf("At %lld, opcode %lld\n", (long long)ip, (long long)opcode);
      printf("Instructions: ");
      a = opcode;
      for (i = 0; i < 4; i++) {
        printf("%lldd ", (long long)a & 0xFF);
        a = a >> 8;
      }
      printf("\n");
      exit(1);
    }
    ip++;
    if (sp > max_sp)  max_sp  = sp;
    if (rp > max_rsp) max_rsp = rp;
    if (rp == 0)
      ip = IMAGE_SIZE;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl $0x1, 0x204e42(%rip)    # 0x2065f0
leaq 0x2e1b(%rip), %r12      # 0x45d0
leaq 0x8fe(%rip), %r14       # 0x20ba
leaq 0x202e1d(%rip), %r15    # 0x2045e0
movl %edi, 0x204e2b(%rip)    # 0x2065f4
cmpl $0x7ffff, %edi          # imm = 0x7FFFF
jg 0x184e
movslq %edi, %rax
movl (%r12,%rax,4), %ebx
cmpl 0x204e0a(%rip), %edi    # 0x2065e8
jne 0x17f8
movl 0x2e06(%rip), %edi      # 0x45ec
callq 0x1656
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x1080
movl %ebx, %edi
callq 0x18bd
testl %eax, %eax
je 0x1857
movl %ebx, %edi
callq 0x18de
movl 0x204de4(%rip), %edi    # 0x2065f4
incl %edi
movl %edi, 0x204ddc(%rip)    # 0x2065f4
movl 0x2992(%rip), %eax      # 0x41b0
cmpl 0x2d9c(%rip), %eax      # 0x45c0
jle 0x182c
movl %eax, 0x2d94(%rip)      # 0x45c0
movl 0x204dbe(%rip), %eax    # 0x2065f0
cmpl 0x2d8c(%rip), %eax      # 0x45c4
jle 0x1840
movl %eax, 0x2d84(%rip)      # 0x45c4
testl %eax, %eax
jne 0x17c9
movl $0x80000, %edi          # imm = 0x80000
jmp 0x17c3
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movslq %ebx, %r14
leaq 0x8d9(%rip), %rdi       # 0x213a
callq 0x1040
movslq 0x204d87(%rip), %rsi    # 0x2065f4
leaq 0x84c(%rip), %rdi       # 0x20c0
movq %r14, %rdx
xorl %eax, %eax
callq 0x1080
leaq 0x851(%rip), %rdi       # 0x20d6
xorl %eax, %eax
callq 0x1080
pushq $0x4
popq %rbp
leaq 0x84f(%rip), %r14       # 0x20e5
subl $0x1, %ebp
jb 0x18ad
movzbl %bl, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1080
sarl $0x8, %ebx
jmp 0x1896
pushq $0xa
popq %rdi
callq 0x1030
pushq $0x1
popq %rdi
callq 0x1110
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: ngaValidatePackedOpcodes
int ngaValidatePackedOpcodes(CELL opcode) {
  CELL raw = opcode;
  CELL current;
  int valid = -1;
  int i;
  for (i = 0; i < 4; i++) {
    current = raw & 0xFF;
    if (!(current >= 0 && current <= 29))
      valid = 0;
    raw = raw >> 8;
  }
  return valid;
}

// Assembly:
pushq $-0x1
popq %rax
pushq $0x4
popq %rcx
xorl %edx, %edx
subl $0x1, %ecx
jb 0x18dd
movl %edi, %esi
andl $0xfe, %esi
cmpl $0x1e, %esi
cmovael %edx, %eax
sarl $0x8, %edi
jmp 0x18c5
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: ngaProcessPackedOpcodes
void ngaProcessPackedOpcodes(CELL opcode) {
  if (INST(0))  instructions[opcode & 0xFF]();
  if (INST(8))  instructions[(opcode >> 8) & 0xFF]();
  if (INST(16)) instructions[(opcode >> 16) & 0xFF]();
  if (INST(24)) instructions[(opcode >> 24) & 0xFF]();
}

// Assembly:
pushq %rbx
movl %edi, %eax
andl $0xff, %eax
movq %rdi, %rbx
je 0x18fa
movl %eax, %eax
leaq 0x27bc(%rip), %rcx      # 0x40b0
callq *(%rcx,%rax,8)
movq %rbx, %rdi
movl %edi, %eax
shrl $0x8, %eax
andl $0xff, %eax
je 0x1915
movl %eax, %eax
leaq 0x27a1(%rip), %rcx      # 0x40b0
callq *(%rcx,%rax,8)
movq %rbx, %rdi
movl %edi, %eax
shrl $0x10, %eax
andl $0xff, %eax
je 0x1930
movl %eax, %eax
leaq 0x2786(%rip), %rcx      # 0x40b0
callq *(%rcx,%rax,8)
movq %rbx, %rdi
cmpl $0x1000000, %edi        # imm = 0x1000000
jae 0x193a
popq %rbx
retq
shrl $0x18, %edi
leaq 0x276c(%rip), %rax      # 0x40b0
popq %rbx
jmpq *(%rax,%rdi,8)
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: ngaPrepare
void ngaPrepare() {
  ip = sp = rp = 0;
  for (ip = 0; ip < IMAGE_SIZE; ip++)
    memory[ip] = 0;  /* 0 is the opcode for "no", a no-operation instruction */
  for (ip = 0; ip < STACK_DEPTH; ip++)
    data[ip] = 0;
  for (ip = 0; ip < ADDRESSES; ip++)
    address[ip] = 0;
}

// Assembly:
andl $0x0, 0x204c7e(%rip)    # 0x2065f0
andl $0x0, 0x2837(%rip)      # 0x41b0
xorl %eax, %eax
leaq 0x2c4e(%rip), %rcx      # 0x45d0
cmpq $0x200000, %rax         # imm = 0x200000
je 0x1994
andl $0x0, (%rax,%rcx)
addq $0x4, %rax
jmp 0x1982
xorl %eax, %eax
leaq 0x2823(%rip), %rcx      # 0x41c0
cmpq $0x400, %rax            # imm = 0x400
je 0x19af
andl $0x0, (%rax,%rcx)
addq $0x4, %rax
jmp 0x199d
xorl %eax, %eax
leaq 0x204c48(%rip), %rcx    # 0x206600
cmpq $0x400, %rax            # imm = 0x400
je 0x19ca
andl $0x0, (%rax,%rcx)
addq $0x4, %rax
jmp 0x19b8
movl $0x100, 0x204c20(%rip)  # imm = 0x100
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: inst_call
void inst_call() {
  rp++;
  TORS = ip;
  ip = TOS - 1;
  inst_drop();
}

// Assembly:
movslq 0x204ae3(%rip), %rax    # 0x2065f0
leaq 0x1(%rax), %rcx
movl %ecx, 0x204ad9(%rip)    # 0x2065f0
movl 0x204ad7(%rip), %ecx    # 0x2065f4
leaq 0x204adc(%rip), %rdx    # 0x206600
movl %ecx, 0x4(%rdx,%rax,4)
movslq 0x2681(%rip), %rax      # 0x41b0
leaq 0x268a(%rip), %rcx      # 0x41c0
movl (%rcx,%rax,4), %eax
decl %eax
movl %eax, 0x204ab3(%rip)    # 0x2065f4
jmp 0x1a2f
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: inst_ccall
void inst_ccall() {
  CELL quote, flag;
  quote = stack_pop();
  flag = stack_pop();
  if (flag != 0) {
    rp++;
    TORS = ip;
    ip = quote - 1;
  }
}

// Assembly:
movslq 0x2663(%rip), %rcx      # 0x41b0
leaq 0x266c(%rip), %rdx      # 0x41c0
movl (%rdx,%rcx,4), %eax
leal -0x2(%rcx), %esi
movl %esi, 0x2650(%rip)      # 0x41b0
cmpl $0x0, -0x4(%rdx,%rcx,4)
je 0x1b91
movslq 0x204a82(%rip), %rcx    # 0x2065f0
leaq 0x1(%rcx), %rdx
movl %edx, 0x204a78(%rip)    # 0x2065f0
movl 0x204a76(%rip), %edx    # 0x2065f4
leaq 0x204a7b(%rip), %rsi    # 0x206600
movl %edx, 0x4(%rsi,%rcx,4)
decl %eax
movl %eax, 0x204a63(%rip)    # 0x2065f4
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: inst_fetch
void inst_fetch() {
  switch (TOS) {
    case -1: TOS = sp - 1; break;
    case -2: TOS = rp; break;
    case -3: TOS = IMAGE_SIZE; break;
    case -4: TOS = CELL_MIN; break;
    case -5: TOS = CELL_MAX; break;
    default: TOS = memory[TOS]; break;
  }
}

// Assembly:
movslq 0x255f(%rip), %rax      # 0x41b0
leaq 0x2568(%rip), %rcx      # 0x41c0
movslq (%rcx,%rax,4), %rdx
leal 0x5(%rdx), %esi
cmpl $0x4, %esi
ja 0x1c96
leaq 0x399(%rip), %rdx       # 0x2004
movslq (%rdx,%rsi,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
movl $0x7ffffffe, %edx       # imm = 0x7FFFFFFE
jmp 0x1ca0
leal -0x1(%rax), %edx
jmp 0x1ca0
movl $0x80000, %edx          # imm = 0x80000
jmp 0x1ca0
movl 0x204963(%rip), %edx    # 0x2065f0
jmp 0x1ca0
movl $0x80000001, %edx       # imm = 0x80000001
jmp 0x1ca0
leaq 0x2933(%rip), %rsi      # 0x45d0
movl (%rsi,%rdx,4), %edx
movl %edx, (%rcx,%rax,4)
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: inst_store
void inst_store() {
  if (TOS <= IMAGE_SIZE && TOS >= 0) {
    memory[TOS] = NOS;
    inst_drop();
    inst_drop();
  } else {
    ip = IMAGE_SIZE;
  }
}

// Assembly:
movslq 0x2505(%rip), %rax      # 0x41b0
leaq 0x250e(%rip), %rdx      # 0x41c0
movl (%rdx,%rax,4), %ecx
cmpq $0x80000, %rcx          # imm = 0x80000
ja 0x1cd8
pushq %rax
movl -0x4(%rdx,%rax,4), %eax
leaq 0x2906(%rip), %rdx      # 0x45d0
movl %eax, (%rdx,%rcx,4)
callq 0x1a2f
popq %rax
jmp 0x1a2f
movl $0x80000, 0x204912(%rip) # imm = 0x80000
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: inst_divmod
void inst_divmod() {
  CELL a, b;
  a = TOS;
  b = NOS;
  TOS = b / a;
  NOS = b % a;
}

// Assembly:
movslq 0x2473(%rip), %rcx      # 0x41b0
leaq 0x247c(%rip), %rsi      # 0x41c0
movl -0x4(%rsi,%rcx,4), %eax
cltd
idivl (%rsi,%rcx,4)
movl %eax, (%rsi,%rcx,4)
movl %edx, -0x4(%rsi,%rcx,4)
retq
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: inst_shift
void inst_shift() {
  CELL y = TOS;
  CELL x = NOS;
  if (TOS < 0)
    NOS = NOS << (TOS * -1);
  else {
    if (x < 0 && y > 0)
      NOS = x >> y | ~(~0U >> y);
    else
      NOS = x >> y;
  }
  inst_drop();
}

// Assembly:
movslq 0x2407(%rip), %rax      # 0x41b0
leaq 0x2410(%rip), %rdx      # 0x41c0
movl -0x4(%rdx,%rax,4), %esi
movl (%rdx,%rax,4), %ecx
testl %ecx, %ecx
js 0x1dd9
testl %esi, %esi
setns %dil
testl %ecx, %ecx
sete %r8b
sarl %cl, %esi
orb %dil, %r8b
jne 0x1ddd
pushq $-0x1
popq %rdi
shrl %cl, %edi
notl %edi
orl %edi, %esi
jmp 0x1ddd
negb %cl
shll %cl, %esi
movl %esi, -0x4(%rdx,%rax,4)
jmp 0x1a2f
// File: /workspace/github_c_makefile_star2_O2/crcx[P]retroforth/tools/retro-extend.c
// Function: inst_zret
void inst_zret() {
  if (TOS == 0) {
    inst_drop();
    ip = TORS;
    rp--;
  }
}

// Assembly:
movslq 0x23c3(%rip), %rax      # 0x41b0
leaq 0x23cc(%rip), %rcx      # 0x41c0
cmpl $0x0, (%rcx,%rax,4)
je 0x1dfb
retq
pushq %rax
callq 0x1a2f
movslq 0x2047e8(%rip), %rax    # 0x2065f0
leaq 0x2047f1(%rip), %rcx    # 0x206600
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x2047dc(%rip)    # 0x2065f4
decl %eax
movl %eax, 0x2047d0(%rip)    # 0x2065f0
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_06/atoi.c
// Function: atoi
int atoi(const char *s)
{
  int i = 0;

  while (*s != '\0' && *s > '0' && *s < '9')
  {
    i = i * 10 + *s - '0';
    ++s;
  }

  return i;
}

// Assembly:
xorl %eax, %eax
movzbl (%rdi), %ecx
leal -0x31(%rcx), %edx
cmpb $0x7, %dl
ja 0x1177
imull $0xa, %eax, %eax
addl %ecx, %eax
addl $-0x30, %eax
incq %rdi
jmp 0x115f
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/pi64cipher128v2/ref2/encrypt.c
// Function: crypto_aead_encrypt
int crypto_aead_encrypt(
	unsigned char *c,unsigned long long *clen,
	const unsigned char *m,unsigned long long mlen,
	const unsigned char *ad,unsigned long long adlen,
	const unsigned char *nsec,
	const unsigned char *npub,
	const unsigned char *k
)
{
/*
...
... the code for the cipher implementation goes here,
... generating a ciphertext c[0],c[1],...,c[*clen-1]
... from a plaintext m[0],m[1],...,m[mlen-1]
... and associated data ad[0],ad[1],...,ad[adlen-1]
... and secret message number nsec[0],nsec[1],...
... and public message number npub[0],npub[1],...
... and secret key k[0],k[1],...
...
*/
	size_t x, v;
	PI_ENCRYPT_SIMPLE(
			c,
			&x,
			&c[mlen + (nsec ? PI_CT_BLOCK_LENGTH_BYTES : 0)],
			&v,
			m,
			mlen,
			ad,
			adlen,
			nsec,
			npub,
			CRYPTO_NPUBBYTES,
			k,
			CRYPTO_KEYBYTES );
	*clen = x + PI_TAG_BYTES;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r9, %r10
movq %r8, %rax
movq %rcx, %r9
movq %rdx, %r8
movq %rsi, %rbx
movq 0x30(%rsp), %r11
xorl %edx, %edx
testq %r11, %r11
setne %dl
shll $0x6, %edx
addq %rdi, %rcx
addq %rcx, %rdx
subq $0x8, %rsp
pushq $0x10
popq %r15
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %rcx
movq %r14, %rsi
pushq %r15
pushq 0x50(%rsp)
pushq %r15
pushq 0x58(%rsp)
pushq %r11
pushq %r10
pushq %rax
callq 0x10e0
addq $0x40, %rsp
movq (%r14), %rax
addq $0x40, %rax
movq %rax, (%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/pi64cipher128v2/ref2/pi-cipher.c
// Function: store_u64_little
static void store_u64_little(void *mem, uint64_t val)
{
	uint8_t *x = (uint8_t *)mem;
	x[0] = val & 0xff; val >>= 8;
	x[1] = val & 0xff; val >>= 8;
	x[2] = val & 0xff; val >>= 8;
	x[3] = val & 0xff; val >>= 8;
	x[4] = val & 0xff; val >>= 8;
	x[5] = val & 0xff; val >>= 8;
	x[6] = val & 0xff; val >>= 8;
	x[7] = val & 0xff;
}

// Assembly:
movb %sil, (%rdi)
vpbroadcastq %rsi, %ymm0
vpsrlvq 0x16b3(%rip), %ymm0, %ymm0 # 0x3000
vpmovqb %ymm0, 0x1(%rdi)
movq %rsi, %rax
shrq $0x28, %rax
movb %al, 0x5(%rdi)
movq %rsi, %rax
shrq $0x30, %rax
movb %al, 0x6(%rdi)
shrq $0x38, %rsi
movb %sil, 0x7(%rdi)
vzeroupper
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/extracters/cpytap/cpytap.c
// Function: usage
void usage(void)
{
  fprintf(stderr,
          "Usage: cpytap src dst [-r len] [-S n] [-I n,file] [-R n,file] [-A file]\n");
  fprintf(stderr,
          "  Copy src .tap file to destination maintaining the internal\n"
          "  record structure. The switches control file level changes to\n"
          "  destination tape.\n");
  fprintf(stderr, "\nSwitches:\n\n");
  fprintf(stderr,
          "-r len        - Specify max record size when writing new files.\n"
          "                There may be multiple \"-r\" switches on the\n"
          "                command line if the new files need different\n"
          "                record sizes. (%u <= len <= %u, default %u)\n"
          "                If len is outside the supported range, it will be\n"
          "                quietly modified to the minimum or maximum value.\n",
          MINRECLEN, MAXRECLEN, DEFRECLEN);
  fprintf(stderr,
          "-I n,file     - Insert specified file before file n of the source tape.\n");
  fprintf(stderr,
          "-R n,file     - Replace file n of the source tape with the specified file.\n");
  fprintf(stderr,
          "-S n          - Skip file n from the source tape.\n");
  fprintf(stderr,
          "-A file       - Append the specified file after all the files on\n"
          "                the source tape have been copied to the destination.\n");
  fprintf(stderr,
          "\nFiles are number 1 - N according to their position on the\n"
          "source tape.\n");
  exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x2d9e(%rip), %r15      # 0x3ff8
movq (%r15), %rcx
leaq 0xda0(%rip), %rdi       # 0x2004
pushq $0x48
popq %rbx
pushq $0x1
popq %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1130
movq (%r15), %rcx
leaq 0xdcd(%rip), %rdi       # 0x204d
movl $0x90, %esi
movq %r14, %rdx
callq 0x1130
movq (%r15), %rcx
leaq 0xe47(%rip), %rdi       # 0x20de
pushq $0xc
popq %rsi
movq %r14, %rdx
callq 0x1130
movq (%r15), %rdi
leaq 0xe3f(%rip), %rsi       # 0x20eb
pushq $0x1
popq %rbp
movl %ebp, %edx
movl $0x10000, %ecx          # imm = 0x10000
movl $0x2800, %r8d           # imm = 0x2800
xorl %eax, %eax
callq 0x10a0
movq (%r15), %rcx
leaq 0xf97(%rip), %rdi       # 0x2264
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1130
movq (%r15), %rcx
leaq 0xfcb(%rip), %rdi       # 0x22ad
pushq $0x4b
popq %rsi
movq %r14, %rdx
callq 0x1130
movq (%r15), %rcx
leaq 0x1002(%rip), %rdi      # 0x22f9
pushq $0x32
popq %rsi
movq %r14, %rdx
callq 0x1130
movq (%r15), %rcx
leaq 0x1020(%rip), %rdi      # 0x232c
movl $0x86, %esi
movq %r14, %rdx
callq 0x1130
movq (%r15), %rcx
leaq 0x1090(%rip), %rdi      # 0x23b3
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1130
movl %ebp, %edi
callq 0x1120
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/extracters/cpytap/cpytap.c
// Function: parse
int parse(
  char *arg,
  int *file,
  char **name
)
{
  char *endptr;

  *file = strtoul(arg, &endptr, 0);

  if ((*endptr == ',') && (*++endptr == '\0'))
    return -1;
  if ((*file == 0) || (*file > MAXFILES))
    return -1;

  *name = endptr;
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rsi
xorl %edx, %edx
callq 0x1110
movq %rax, %rcx
movl %ecx, (%r14)
movq (%r15), %rdx
cmpb $0x2c, (%rdx)
pushq $-0x1
popq %rax
jne 0x136d
cmpb $0x0, 0x1(%rdx)
je 0x1383
incq %rdx
testl %ecx, %ecx
sete %sil
cmpl $0x65, %ecx
setge %cl
orb %sil, %cl
jne 0x1383
movq %rdx, (%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/extracters/cpytap/cpytap.c
// Function: writeFile
static void writeFile(
  char *filename,
  int rlen
)
{
  FILE *file;
  size_t datalen;
  char record[MAXRCLNT];

  if ((file = fopen(filename, "r")) != NULL) {
    while ((datalen = fread(record, sizeof(char), rlen, file)) != 0) {
      if (ferror(file)) {
        fprintf(stderr, "Error reading %s\n", filename);
        exit(4);
      }
      if (WriteTapeRecord(dst, record, rlen) != 0) {
        fprintf(stderr, "Error writing record to destination tape\n");
        exit(5);
      }
    }
    if (WriteTapeMark(dst, 0) != 0) {
      fprintf(stderr, "Error writing tape mark to destination tape\n");
      exit(5);
    }
    fclose(file);
    return;
  }
  fprintf(stderr, "Failed to open file - %s\n", filename);
  exit(3);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10008, %rsp          # imm = 0x10008
movl %esi, %ebp
movq %rdi, %rbx
leaq 0xd0b(%rip), %rsi       # 0x2570
callq 0x10f0
testq %rax, %rax
je 0x1926
movq %rax, %r14
movslq %ebp, %r15
movq %rsp, %r12
pushq $0x1
popq %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x1060
testq %rax, %rax
je 0x18d7
movq %r14, %rdi
callq 0x1050
testl %eax, %eax
jne 0x1903
movq 0x283f(%rip), %rdi      # 0x40e8
movq %r12, %rsi
movl %ebp, %edx
callq 0x1dc7
testl %eax, %eax
je 0x1880
movq 0x273a(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xcbc(%rip), %rdi       # 0x2584
pushq $0x29
popq %rsi
pushq $0x1
popq %rdx
callq 0x1130
pushq $0x5
jmp 0x1920
movq 0x280a(%rip), %rdi      # 0x40e8
xorl %esi, %esi
callq 0x1ec2
testl %eax, %eax
jne 0x1945
movq %r14, %rdi
callq 0x1070
addq $0x10008, %rsp          # imm = 0x10008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x26ee(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xc5e(%rip), %rsi       # 0x2572
movq %rbx, %rdx
xorl %eax, %eax
callq 0x10a0
pushq $0x4
popq %rdi
callq 0x1120
movq 0x26cb(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xca4(%rip), %rsi       # 0x25db
movq %rbx, %rdx
xorl %eax, %eax
callq 0x10a0
pushq $0x3
jmp 0x1920
movq 0x26ac(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xc58(%rip), %rdi       # 0x25ae
pushq $0x2c
jmp 0x18ca
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/extracters/cpytap/cpytap.c
// Function: copyFile
static unsigned int copyFile(void)
{
  char record[MAXRCLNT];
  uint32 len;

  for (;;) {
    switch (len = ReadTapeRecord(src, record, sizeof(record))) {
        case ST_EOM:
          return ST_EOM;

        case ST_TM:
          if (WriteTapeMark(dst, 0) == 0)
            return ST_TM;
          fprintf(stderr, "Error writing tape mark to destination tape\n");
          exit(6);

        default:
          if (WriteTapeRecord(dst, record, len) == 0)
            continue;
          fprintf(stderr, "Error writing record to destination tape\n");
          exit(6);
      }
  }
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x10008, %rsp          # imm = 0x10008
movq %rsp, %rbx
movq 0x2770(%rip), %rdi      # 0x40e0
movq %rbx, %rsi
movl $0x10000, %edx          # imm = 0x10000
callq 0x1c64
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x19d3
testl %ebp, %ebp
je 0x19c1
movq 0x2759(%rip), %rdi      # 0x40e8
movq %rbx, %rsi
movl %ebp, %edx
callq 0x1dc7
testl %eax, %eax
je 0x1969
movq 0x2654(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xbd6(%rip), %rdi       # 0x2584
pushq $0x29
popq %rsi
pushq $0x1
popq %rdx
callq 0x1130
pushq $0x6
popq %rdi
callq 0x1120
movq 0x2720(%rip), %rdi      # 0x40e8
xorl %esi, %esi
callq 0x1ec2
testl %eax, %eax
jne 0x19df
movl %ebp, %eax
addq $0x10008, %rsp          # imm = 0x10008
popq %rbx
popq %rbp
retq
movq 0x2612(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xbbe(%rip), %rdi       # 0x25ae
pushq $0x2c
jmp 0x19b0
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/extracters/cpytap/tapeio.c
// Function: OpenTapeForRead
int OpenTapeForRead(
  FILE **handle,
  char *name
)
{
  FILE *tfile;

  if ((tfile = fopen(name, "r")) != NULL) {
    int status;

    status = verifyFormat(tfile);
    rewind(tfile);
    if ((status != TIO_SUCCESS) && (status != TIO_ERROR))
      CloseTape(tfile);
    else *handle = tfile;
    return status;
  }
  return TIO_OPENFAIL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
leaq 0xb6b(%rip), %rsi       # 0x2570
movq %rax, %rdi
callq 0x10f0
testq %rax, %rax
je 0x1a3a
movq %rax, %r14
movq %rax, %rdi
callq 0x1a49
movl %eax, %ebp
movq %r14, %rdi
callq 0x1080
movl %ebp, %eax
decl %eax
cmpl $-0x3, %eax
ja 0x1a3f
movq %r14, %rdi
callq 0x1070
jmp 0x1a42
pushq $-0x3
popq %rbp
jmp 0x1a42
movq %r14, (%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/extracters/cpytap/tapeio.c
// Function: OpenTapeForWrite
int OpenTapeForWrite(
  FILE **handle,
  char *name
)
{
  FILE *tfile;

  /*
   * Fail if the file exists
   */
  if (access(name, F_OK) == 0)
    return TIO_CREATEFAIL;

  if ((tfile = fopen(name, "w+")) != NULL) {
    uint32 tm = 0;
    int status = TIO_SUCCESS;

    /*
     * Write 2 tape marks
     */
    if (fwrite(&tm, sizeof(tm), 2, tfile) != 2)
      status = TIO_IOERROR;

    if (status == TIO_SUCCESS) {
      rewind(tfile);
      *handle = tfile;
      return TIO_SUCCESS;
    }

    /*
     * Failed to write the 2 tape marks. Try to delete the file before
     * returning an error.
     */
    CloseTape(tfile);
    unlink(name);
    return TIO_IOERROR;
  }
  return TIO_CREATEFAIL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
xorl %esi, %esi
callq 0x10e0
pushq $-0x4
popq %rbp
testl %eax, %eax
je 0x1c0c
leaq 0xa37(%rip), %rsi       # 0x25f5
movq %rbx, %rdi
callq 0x10f0
testq %rax, %rax
je 0x1c0c
movq %rax, %r15
leaq 0x4(%rsp), %rdi
andl $0x0, (%rdi)
pushq $0x4
popq %rsi
pushq $0x2
popq %rdx
movq %rax, %rcx
callq 0x1130
cmpq $0x2, %rax
jne 0x1bf9
movq %r15, %rdi
callq 0x1080
movq %r15, (%r14)
xorl %ebp, %ebp
jmp 0x1c0c
movq %r15, %rdi
callq 0x1070
movq %rbx, %rdi
callq 0x1030
pushq $-0x5
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/extracters/cpytap/tapeio.c
// Function: OpenTapeForAppend
int OpenTapeForAppend(
  FILE **handle,
  char *name
)
{
  FILE *tfile;

  if ((tfile =fopen(name, "r+")) != NULL) {
    int status;

    status = verifyFormat(tfile);
    if ((status != TIO_SUCCESS) && (status != TIO_ERROR))
      CloseTape(tfile);
    else *handle = tfile;
    return status;
  }
  return TIO_OPENFAIL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x9ce(%rip), %rsi       # 0x25f8
movq %rax, %rdi
callq 0x10f0
testq %rax, %rax
je 0x1c55
movq %rax, %r14
movq %rax, %rdi
callq 0x1a49
movl %eax, %ebp
decl %eax
cmpl $-0x3, %eax
ja 0x1c5a
movq %r14, %rdi
callq 0x1070
jmp 0x1c5d
pushq $-0x3
popq %rbp
jmp 0x1c5d
movq %r14, (%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/extracters/cpytap/tapeio.c
// Function: ReadTapeRecordLength
uint32 ReadTapeRecordLength(
  FILE *handle
)
 {
   long pos = ftell(handle);
   uint8 meta[4];
   uint32 bc, erflag;

   /*
    * Note: any I/O errors are treated as "end of medium" detection.
    */
   if (fread(meta, sizeof(meta), 1, handle) != 1)
     return ST_EOM;

   bc = (((unsigned int)meta[3]) << 24) |
        (((unsigned int)meta[2]) << 16) |
        (((unsigned int)meta[1]) << 8) |
        (unsigned int)meta[0];

   switch (bc) {
     case ST_EOM:
     case ST_TM:
       return bc;

     default:
       erflag = bc & ST_ERROR;
       bc &= ST_LENGTH;

       /*
        * Now position the file after this record.
        */
       pos += RECLEN(bc) + (2 * sizeof(meta));
       if (fseek(handle, pos, SEEK_SET) != 0)
         return ST_EOM;

       return erflag | bc;
   }
   return ST_EOM;
 }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
callq 0x10b0
movq %rax, %r15
leaq 0xc(%rsp), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x1060
pushq $-0x1
popq %rbx
cmpq $0x1, %rax
jne 0x1dae
movzbl 0xf(%rsp), %r12d
shll $0x18, %r12d
movzwl 0xd(%rsp), %eax
shll $0x8, %eax
movzbl 0xc(%rsp), %r13d
orl %eax, %r13d
leal (%r12,%r13), %eax
incl %eax
cmpl $0x2, %eax
jae 0x1d91
orl %r12d, %r13d
movl %r13d, %ebx
jmp 0x1dae
leal 0x1(%r13), %eax
andl $-0x2, %eax
leaq (%rax,%r15), %rsi
addq $0x8, %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x10d0
testl %eax, %eax
je 0x1dbe
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
andl $0x80000000, %r12d      # imm = 0x80000000
jmp 0x1d89
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/extracters/cpytap/tapeio.c
// Function: WriteTapeRecord
int WriteTapeRecord(
  FILE *handle,
  void *buf,
  int len
)
{
  uint8 meta[4];
  int datalen;

  meta[0] = len & 0xFF;
  meta[1] = (len >> 8) & 0xFF;
  meta[2] = (len >> 16) & 0xFF;
  meta[3] = (len >> 24) & 0xFF;

  datalen = ((len + 1)  & ST_LENGTH) & ~1;

  if (fwrite(meta, sizeof(meta), 1, handle) != 1)
    return -1;

  if (fwrite(buf, datalen, 1, handle) != 1)
    return -1;

  if (fwrite(meta, sizeof(meta), 1, handle) != 1)
    return -1;

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x4(%rsp), %rdi
movl %edx, (%rdi)
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x1130
pushq $-0x1
popq %rbp
cmpq $0x1, %rax
jne 0x1e35
incl %r14d
andl $0xfffffe, %r14d        # imm = 0xFFFFFE
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
callq 0x1130
cmpq $0x1, %rax
jne 0x1e35
leaq 0x4(%rsp), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x1130
xorl %ebp, %ebp
cmpq $0x1, %rax
setne %bpl
negl %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/extracters/cpytap/tapeio.c
// Function: SkipToNextTapeMark
unsigned int SkipToNextTapeMark(
  FILE *handle
)
{
  long pos = ftell(handle);
  uint8 meta[4];
  uint32 bc;

  for (;;) {
    /*
     * Note: any I/O errors are treated as "end of medium" detection.
     */
    if (fread(meta, sizeof(meta), 1, handle) != 1)
      return ST_EOM;

    bc = (((unsigned int)meta[3]) << 24) |
         (((unsigned int)meta[2]) << 16) |
         (((unsigned int)meta[1]) << 8) |
         (unsigned int)meta[0];

    switch (bc) {
      case ST_EOM:
      case ST_TM:
        return bc;

      default:
        bc &= ST_LENGTH;

        /*
         * Now position the file after this record.
         */
        pos += RECLEN(bc) + (2 * sizeof(meta));
        if (fseek(handle, pos, SEEK_SET) != 0)
          return ST_EOM;
        break;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x10b0
movq %rax, %r14
leaq 0x4(%rsp), %r15
pushq $0x4
popq %r12
pushq $0x1
popq %r13
pushq $-0x1
popq %rbp
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x1060
cmpq $0x1, %rax
jne 0x1eb1
movl 0x4(%rsp), %eax
leal 0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x1eaf
andl $0xffffff, %eax         # imm = 0xFFFFFF
incl %eax
andl $-0x2, %eax
addq %rax, %r14
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x10d0
testl %eax, %eax
je 0x1e68
jmp 0x1eb1
movl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/extracters/cpytap/tapeio.c
// Function: WriteTapeMark
int WriteTapeMark(
  FILE *handle,
  int backup
)
{
  uint32 tm = 0;

  if (fwrite(&tm, sizeof(tm), 1, handle) != 1)
    return -1;

  if (backup)
    if (fseek(handle, -sizeof(tm), SEEK_CUR) != 0)
      return -1;

  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %r14
leaq 0xc(%rsp), %rdi
andl $0x0, (%rdi)
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x1130
pushq $-0x1
popq %rbx
cmpq $0x1, %rax
jne 0x1f06
testl %ebp, %ebp
je 0x1f04
pushq $-0x4
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x10d0
testl %eax, %eax
jne 0x1f06
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/extracters/cpytap/tapeio.c
// Function: writeTapeBuffering
int writeTapeBuffering(
  FILE *handle,
  char ch
)
{
  buffer[occupied++] = ch;

  if (occupied == rLength) {
    occupied = 0;
    return WriteTapeRecord(handle, buffer, rLength);
  }
  return 0;
}

// Assembly:
movslq 0xaabe(%rip), %rax      # 0xca04
leal 0x1(%rax), %edx
movl %edx, 0xaab5(%rip)      # 0xca04
leaq 0xaaba(%rip), %rcx      # 0xca10
movb %sil, (%rax,%rcx)
cmpl 0xaaa0(%rip), %edx      # 0xca00
jne 0x1f75
andl $0x0, 0xaa9b(%rip)      # 0xca04
leaq 0xaaa0(%rip), %rsi      # 0xca10
jmp 0x1dc7
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/evilwombat[P]gopro-fw-tools/goprom.c
// Function: print_usage
static void print_usage(void)
{
	fprintf(stderr, "Usage:\n");
	fprintf(stderr, "	goprom --unpack romfs_section > unpack-romfs.sh\n");
	fprintf(stderr, "	Generate shell script to unpack a romfs section\n");
	fprintf(stderr, "\n");
	fprintf(stderr, "	goprom --update romfs_section > update-romfs.sh\n");
	fprintf(stderr, "	Generate shell script to update files in an existing romfs section\n");
	fprintf(stderr, "	DO NOT DO THIS UNLESS YOU *REALLY* KNOW WHAT YOU ARE DOING.\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x2bce(%rip), %r15      # 0x3ff8
movq (%r15), %rcx
leaq 0xd76(%rip), %rdi       # 0x21aa
pushq $0x7
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x10d0
movq (%r15), %rcx
leaq 0xd66(%rip), %rdi       # 0x21b2
pushq $0x31
popq %r14
movq %r14, %rsi
movq %rbx, %rdx
callq 0x10d0
movq (%r15), %rcx
leaq 0xd7f(%rip), %rdi       # 0x21e4
movq %r14, %rsi
movq %rbx, %rdx
callq 0x10d0
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x1070
movq (%r15), %rcx
leaq 0xd91(%rip), %rdi       # 0x2216
movq %r14, %rsi
movq %rbx, %rdx
callq 0x10d0
movq (%r15), %rcx
leaq 0xdae(%rip), %rdi       # 0x2248
pushq $0x44
popq %rsi
movq %rbx, %rdx
callq 0x10d0
movq (%r15), %rcx
leaq 0xdde(%rip), %rdi       # 0x228d
pushq $0x3d
popq %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x10d0