LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/bin/unterm.c
// Function: dump_cell_color
static int dump_cell_color(const VTermColor *col, int sgri, int sgr[], int fg)
{
    /* Reset the color if the given color is the default color */
    if (fg && VTERM_COLOR_IS_DEFAULT_FG(col)) {
        sgr[sgri++] = 39;
        return sgri;
    }
    if (!fg && VTERM_COLOR_IS_DEFAULT_BG(col)) {
        sgr[sgri++] = 49;
        return sgri;
    }

    /* Decide whether to send an indexed color or an RGB color */
    if (VTERM_COLOR_IS_INDEXED(col)) {
        const uint8_t idx = col->indexed.idx;
        if (idx < 8) {
            sgr[sgri++] = (idx + (fg ? 30 : 40));
        }
        else if (idx < 16) {
            sgr[sgri++] = (idx - 8 + (fg ? 90 : 100));
        }
        else {
            sgr[sgri++] = (fg ? 38 : 48);
            sgr[sgri++] = 5;
            sgr[sgri++] = idx;
        }
    }
    else if (VTERM_COLOR_IS_RGB(col)) {
        sgr[sgri++] = (fg ? 38 : 48);
        sgr[sgri++] = 2;
        sgr[sgri++] = col->rgb.red;
        sgr[sgri++] = col->rgb.green;
        sgr[sgri++] = col->rgb.blue;
    }
    return sgri;
}

// Assembly:
movl %esi, %eax
movb (%rdi), %sil
testl %ecx, %ecx
je 0x18fe
testb $0x2, %sil
je 0x1904
movslq %eax, %rcx
incl %eax
movl $0x27, (%rdx,%rcx,4)
retq
testb $0x4, %sil
jne 0x1954
testb $0x1, %sil
jne 0x1943
testl %ecx, %ecx
movl $0x30, %ecx
movl $0x26, %esi
cmovel %ecx, %esi
movslq %eax, %rcx
movl %esi, (%rdx,%rcx,4)
movl $0x2, 0x4(%rdx,%rcx,4)
movzbl 0x1(%rdi), %esi
movl %esi, 0x8(%rdx,%rcx,4)
movzbl 0x2(%rdi), %esi
movl %esi, 0xc(%rdx,%rcx,4)
movzbl 0x3(%rdi), %esi
addl $0x5, %eax
movl %esi, 0x10(%rdx,%rcx,4)
retq
movzbl 0x1(%rdi), %esi
cmpl $0x7, %esi
ja 0x1961
leal 0x1e(%rsi), %edi
addl $0x28, %esi
jmp 0x196d
movslq %eax, %rcx
incl %eax
movl $0x31, (%rdx,%rcx,4)
retq
cmpb $0xf, %sil
ja 0x197b
leal 0x52(%rsi), %edi
addl $0x5c, %esi
testl %ecx, %ecx
cmovnel %edi, %esi
movslq %eax, %rcx
incl %eax
movl %esi, (%rdx,%rcx,4)
retq
testl %ecx, %ecx
movl $0x30, %ecx
movl $0x26, %edi
cmovel %ecx, %edi
movslq %eax, %rcx
movl %edi, (%rdx,%rcx,4)
movl $0x5, 0x4(%rdx,%rcx,4)
addl $0x3, %eax
movl %esi, 0x8(%rdx,%rcx,4)
retq
// File: /workspace/github_c_makefile_star2_O3/neovim[P]libvterm/bin/unterm.c
// Function: screen_sb_pushline
static int screen_sb_pushline(int cols, const VTermScreenCell *cells, void *user)
{
  VTermScreenCell prevcell = { 0 };
  vterm_state_get_default_colors(vterm_obtain_state(vt), &prevcell.fg, &prevcell.bg);

  for(int col = 0; col < cols; col++) {
    dump_cell(cells + col, &prevcell);
    prevcell = cells[col];
  }

  dump_eol(&prevcell);

  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movl %edi, %ebp
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r14
movaps %xmm0, -0x10(%r14)
movaps %xmm0, -0x20(%r14)
movq $0x0, (%r14)
movq 0x2757(%rip), %rdi      # 0x4138
callq 0x10f0
leaq 0x24(%rsp), %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x1110
testl %ebp, %ebp
jle 0x1a2d
movl %ebp, %r15d
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x13be
movq 0x20(%rbx), %rax
movq %rax, 0x20(%rsp)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
addq $0x28, %rbx
decq %r15
jne 0x1a00
movl 0x1c(%rsp), %edi
callq 0x16b8
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/dwelch67[P]lc3/lc3asm.c
// Function: parse_immed
unsigned int parse_immed ( unsigned int ra )
{
    unsigned int rb;

    if((newline[ra]==0x30)&&((newline[ra+1]=='x')||(newline[ra+1]=='X')))
    {
        ra+=2;
        rb=0;
        for(;newline[ra];ra++)
        {
            if(newline[ra]==0x20) break;
            if(!hexchar[newline[ra]])
            {
                printf("<%u> Error: invalid number\n",line);
                return(0);
            }
            cstring[rb++]=newline[ra];
        }
        cstring[rb]=0;
        if(rb==0)
        {
            printf("<%u> Error: invalid number\n",line);
            return(0);
        }
        rx=strtoul(cstring,NULL,16);
    }
    else
    {
        rb=0;
        for(;newline[ra];ra++)
        {
            if(newline[ra]==0x20) break;
            if(!numchar[newline[ra]])
            {
                printf("<%u> Error: invalid number\n",line);
                return(0);
            }
            cstring[rb++]=newline[ra];
        }
        cstring[rb]=0;
        if(rb==0)
        {
            printf("<%u> Error: invalid number\n",line);
            return(0);
        }
        rx=strtoul(cstring,NULL,10);
    }
    for(;newline[ra];ra++) if(newline[ra]!=0x20) break;
    return(ra);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
movl %edi, %eax
leaq 0x4f8b(%rip), %r14      # 0x62c0
movb (%rax,%r14), %al
cmpb $0x30, %al
jne 0x1386
leal 0x1(%rbx), %ecx
movzbl (%rcx,%r14), %ecx
orl $0x20, %ecx
cmpl $0x78, %ecx
jne 0x1386
movl %ebx, %ecx
addl $0x2, %ecx
xorl %eax, %eax
leaq 0x4d55(%rip), %rsi      # 0x60b0
leaq 0x536e(%rip), %rdx      # 0x66d0
leal (%rcx,%rax), %ebx
movzbl (%rbx,%r14), %edi
testb $-0x21, %dil
je 0x13e5
movsbq %dil, %r8
cmpb $0x0, (%r8,%rsi)
je 0x13f4
movl %eax, %r8d
incl %eax
movb %dil, (%r8,%rdx)
jmp 0x1362
xorl %ecx, %ecx
leaq 0x4e21(%rip), %rsi      # 0x61b0
leaq 0x533a(%rip), %rdx      # 0x66d0
testb $-0x21, %al
je 0x13b3
movsbq %al, %rdi
cmpb $0x0, (%rdi,%rsi)
je 0x13f4
movl %ecx, %edi
incl %ecx
movb %al, (%rdi,%rdx)
incl %ebx
movb (%rbx,%r14), %al
jmp 0x1396
movl %ecx, %eax
movb $0x0, (%rax,%rdx)
movl $0xa, %edx
testl %ecx, %ecx
je 0x13f4
leaq 0x5307(%rip), %rdi      # 0x66d0
xorl %esi, %esi
callq 0x10c0
movl %eax, 0x56fa(%rip)      # 0x6ad0
movl %ebx, %eax
incl %ebx
cmpb $0x20, (%rax,%r14)
je 0x13d6
decl %ebx
jmp 0x140a
movl %eax, %ecx
movb $0x0, (%rcx,%rdx)
movl $0x10, %edx
testl %eax, %eax
jne 0x13c2
movl 0x52c6(%rip), %esi      # 0x66c0
leaq 0x2c6d(%rip), %rdi      # 0x406e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1060
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/dwelch67[P]lc3/lc3asm.c
// Function: parse_reg
unsigned int parse_reg ( unsigned int ra )
{
    unsigned int rb;

    for(;newline[ra];ra++) if(newline[ra]!=0x20) break;
    rb=0;
    for(;newline[ra];ra++)
    {
        if(newline[ra]==',') break;
        if(newline[ra]==0x20) break;
        cstring[rb++]=newline[ra];
    }
    cstring[rb]=0;
    if(get_reg_number(cstring,&rx))
    {
        printf("<%u> Error: not a register\n",line);
        return(0);
    }
    for(;newline[ra];ra++) if(newline[ra]!=0x20) break;
    return(ra);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x4e98(%rip), %r15      # 0x62c0
movl %ebx, %eax
movb (%rax,%r15), %al
incl %ebx
cmpb $0x20, %al
je 0x1428
xorl %ecx, %ecx
leaq 0x5293(%rip), %r14      # 0x66d0
movabsq $0x100100000001, %rdx   # imm = 0x100100000001
movl %ecx, %esi
cmpb $0x2c, %al
ja 0x1456
movzbl %al, %edi
btq %rdi, %rdx
jb 0x1466
incl %ecx
movb %al, (%rsi,%r14)
movl %ebx, %eax
movb (%rax,%r15), %al
incl %ebx
jmp 0x1447
movb $0x0, (%rsi,%r14)
addl $-0x2, %ebx
xorl %r12d, %r12d
leaq 0x4c08(%rip), %r13      # 0x6080
leaq (%r12,%r13), %rsi
movq %r14, %rdi
callq 0x1090
testl %eax, %eax
je 0x14aa
addq $0x5, %r12
cmpq $0x28, %r12
jne 0x1478
movl 0x5228(%rip), %esi      # 0x66c0
leaq 0x2beb(%rip), %rdi      # 0x408a
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1060
jmp 0x14bf
movzbl 0x4(%r12,%r13), %eax
movl %eax, 0x561a(%rip)      # 0x6ad0
incl %ebx
cmpb $0x20, (%rbx,%r15)
je 0x14b6
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/dwelch67[P]lc3/lc3asm.c
// Function: parse_three_regs
unsigned int parse_three_regs ( unsigned int ra )
{
    ra=parse_reg(ra); if(ra==0) return(0);
    rd=rx;
    ra=parse_comma(ra); if(ra==0) return(0);
    ra=parse_reg(ra); if(ra==0) return(0);
    rs=rx;
    ra=parse_comma(ra); if(ra==0) return(0);
    ra=parse_reg(ra); if(ra==0) return(0);
    rt=rx;
    return(ra);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x1411
xorl %ebx, %ebx
testl %eax, %eax
je 0x15cb
movl 0x5551(%rip), %ecx      # 0x6ad0
movl %ecx, 0x554f(%rip)      # 0x6ad4
movl %eax, %edi
callq 0x14d0
testl %eax, %eax
je 0x15cb
movl %eax, %edi
callq 0x1411
testl %eax, %eax
je 0x15cb
movl 0x552f(%rip), %ecx      # 0x6ad0
movl %ecx, 0x5531(%rip)      # 0x6ad8
movl %eax, %edi
callq 0x14d0
testl %eax, %eax
je 0x15cb
movl %eax, %edi
callq 0x1411
testl %eax, %eax
je 0x15cb
movl 0x550d(%rip), %ecx      # 0x6ad0
movl %ecx, 0x5513(%rip)      # 0x6adc
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/dwelch67[P]lc3/lc3asm.c
// Function: parse_two_regs
unsigned int parse_two_regs ( unsigned int ra )
{
    ra=parse_reg(ra); if(ra==0) return(0);
    rd=rx;
    ra=parse_comma(ra); if(ra==0) return(0);
    ra=parse_reg(ra); if(ra==0) return(0);
    rs=rx;
    return(ra);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x1411
xorl %ebx, %ebx
testl %eax, %eax
je 0x1615
movl 0x54e5(%rip), %ecx      # 0x6ad0
movl %ecx, 0x54e3(%rip)      # 0x6ad4
movl %eax, %edi
callq 0x14d0
testl %eax, %eax
je 0x1615
movl %eax, %edi
callq 0x1411
testl %eax, %eax
je 0x1615
movl 0x54c3(%rip), %ecx      # 0x6ad0
movl %ecx, 0x54c5(%rip)      # 0x6ad8
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/dwelch67[P]lc3/lc3asm.c
// Function: parse_branch_label
unsigned int parse_branch_label ( unsigned int ra )
{
    unsigned int rb;
    unsigned int rc;

    is_const=0;
    is_label=0;
    for(;newline[ra];ra++) if(newline[ra]!=0x20) break;
    if(numchar[newline[ra]])
    {
        ra=parse_immed(ra); if(ra==0) return(0);
        is_const=1;
    }
    else
    {
        //assume label, find space or eol.
        for(rb=ra;newline[rb];rb++)
        {
            if(newline[rb]==0x20) break; //no spaces in labels
        }
        //got a label
        rc=rb-ra;
        if(rc==0)
        {
            printf("<%u> Error: Invalid label\n",line);
            return(0);
        }
        rc--;
        if(rc>=LABLEN)
        {
            printf("<%u> Error: Label too long\n",line);
            return(0);
        }
        for(rb=0;rb<=rc;rb++)
        {
            lab_struct[nlabs].name[rb]=newline[ra++];
        }
        lab_struct[nlabs].name[rb]=0;
        lab_struct[nlabs].addr=curradd;
        lab_struct[nlabs].line=line;
        lab_struct[nlabs].type=1;
        nlabs++;
        rx=0;
        is_label=1;
    }
    return(ra);
}

// Assembly:
xorl %eax, %eax
movl %eax, 0x544e(%rip)      # 0x6ae0
movl %eax, 0x544c(%rip)      # 0x6ae4
leaq 0x4c21(%rip), %rax      # 0x62c0
movl %edi, %ecx
movsbq (%rcx,%rax), %rcx
incl %edi
cmpq $0x20, %rcx
je 0x169f
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x4af5(%rip), %rdx      # 0x61b0
leal -0x1(%rdi), %ebx
cmpb $0x0, (%rcx,%rdx)
je 0x16e0
movl %ebx, %edi
callq 0x1323
testl %eax, %eax
je 0x170d
movl %eax, %ebx
movl $0x1, 0x5405(%rip)      # 0x6ae0
jmp 0x1795
xorl %edx, %edx
testb $-0x21, %cl
je 0x16f1
leal (%rdi,%rdx), %ecx
incl %edx
movb (%rcx,%rax), %cl
jmp 0x16e2
testl %edx, %edx
je 0x1714
movl %edx, %ecx
negl %ecx
cmpl $-0x40, %ecx
jae 0x172c
movl 0x4fbc(%rip), %esi      # 0x66c0
leaq 0x29d0(%rip), %rdi      # 0x40db
jmp 0x1721
xorl %ebx, %ebx
jmp 0x1795
movl 0x4fa6(%rip), %esi      # 0x66c0
leaq 0x299f(%rip), %rdi      # 0x40c0
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1060
jmp 0x1795
movl 0x4c53be(%rip), %ecx    # 0x4c6af0
imulq $0x4c, %rcx, %rsi
leaq 0x53b3(%rip), %rdi      # 0x6af0
leaq (%rdi,%rsi), %r8
movl %edx, %edx
xorl %r9d, %r9d
movl %ebx, %r10d
incl %ebx
movb (%r10,%rax), %r10b
movb %r10b, (%r8,%r9)
incq %r9
cmpq %r9, %rdx
jne 0x1746
movb $0x0, (%r8,%rdx)
movl 0x4c538e(%rip), %eax    # 0x4c6af4
movl %eax, 0x40(%rsi,%rdi)
movl 0x4f50(%rip), %eax      # 0x66c0
movl %eax, 0x44(%rsi,%rdi)
movl $0x1, %eax
movl %eax, 0x48(%rsi,%rdi)
incl %ecx
movl %ecx, 0x4c536b(%rip)    # 0x4c6af0
movl $0x0, 0x5341(%rip)      # 0x6ad0
movl %eax, 0x534f(%rip)      # 0x6ae4
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/dwelch67[P]lc3/lc3asm.c
// Function: parse_two_label
unsigned int parse_two_label ( unsigned int ra )
{
    ra=parse_reg(ra); if(ra==0) return(0);
    rt=rx;
    ra=parse_comma(ra); if(ra==0) return(0);
    ra=parse_reg(ra); if(ra==0) return(0);
    rs=rx;
    ra=parse_comma(ra); if(ra==0) return(0);
    ra=parse_branch_label(ra); if(ra==0) return(0);
    rd=rx;
    return(ra);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x1411
xorl %ebx, %ebx
testl %eax, %eax
je 0x1801
movl 0x531b(%rip), %ecx      # 0x6ad0
movl %ecx, 0x5321(%rip)      # 0x6adc
movl %eax, %edi
callq 0x14d0
testl %eax, %eax
je 0x1801
movl %eax, %edi
callq 0x1411
testl %eax, %eax
je 0x1801
movl 0x52f9(%rip), %ecx      # 0x6ad0
movl %ecx, 0x52fb(%rip)      # 0x6ad8
movl %eax, %edi
callq 0x14d0
testl %eax, %eax
je 0x1801
movl %eax, %edi
callq 0x168a
testl %eax, %eax
je 0x1801
movl 0x52d7(%rip), %ecx      # 0x6ad0
movl %ecx, 0x52d5(%rip)      # 0x6ad4
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/dwelch67[P]lc3/lc3asm.c
// Function: parse_one_label
unsigned int parse_one_label ( unsigned int ra )
{
    ra=parse_reg(ra); if(ra==0) return(0);
    rs=rx;
    ra=parse_comma(ra); if(ra==0) return(0);
    ra=parse_branch_label(ra); if(ra==0) return(0);
    rd=rx;
    return(ra);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x1411
xorl %ebx, %ebx
testl %eax, %eax
je 0x184b
movl 0x52af(%rip), %ecx      # 0x6ad0
movl %ecx, 0x52b1(%rip)      # 0x6ad8
movl %eax, %edi
callq 0x14d0
testl %eax, %eax
je 0x184b
movl %eax, %edi
callq 0x168a
testl %eax, %eax
je 0x184b
movl 0x528d(%rip), %ecx      # 0x6ad0
movl %ecx, 0x528b(%rip)      # 0x6ad4
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: opt_key
bool opt_key(const char* arg, const char* keyword) {
   do { // check for a keyword option and nothing after it
      if (tolower(*arg++) != *keyword++) return false; }
   while (*keyword);
   return *arg == '\0'; }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x1160
movq (%rax), %rax
movb (%r14), %dl
xorl %ecx, %ecx
movsbq (%rbx,%rcx), %rsi
movsbl %dl, %edx
cmpl %edx, (%rax,%rsi,4)
jne 0x1433
movb 0x1(%r14,%rcx), %dl
incq %rcx
testb %dl, %dl
jne 0x1411
cmpb $0x0, (%rbx,%rcx)
sete %al
jmp 0x1435
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: opt_int
bool opt_int(const char* arg, const char* keyword, int *pval, int min, int max) {
   do { // check for a "keyword=integer" option and nothing after it
      if (tolower(*arg++) != *keyword++)
         return false; }
   while (*keyword);
   if (*arg == '=') ++arg; // = is optional, actually
   int num, nch;
   if (sscanf(arg, *arg == '0' && *(arg + 1) == 'x' ? "%x%n" : "%d%n", &num, &nch) != 1) return false;
   if (num < min || num > max || arg[nch] != '\0') return false;
   *pval = num;
   return true; }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
callq 0x1160
movq (%rax), %rax
movb (%r15), %cl
incq %r15
movsbq (%r12), %rdx
movsbl %cl, %ecx
cmpl %ecx, (%rax,%rdx,4)
jne 0x14ef
incq %r12
movb (%r15), %cl
incq %r15
testb %cl, %cl
jne 0x1466
leaq 0x1(%r12), %r15
cmpb $0x3d, (%r12)
cmovneq %r12, %r15
cmpb $0x30, (%r15)
jne 0x14ad
cmpb $0x78, 0x1(%r15)
leaq 0x3bde(%rip), %rax      # 0x507e
leaq 0x3bdc(%rip), %rsi      # 0x5083
cmoveq %rax, %rsi
jmp 0x14b4
leaq 0x3bcf(%rip), %rsi      # 0x5083
xorl %r12d, %r12d
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %r15, %rdi
xorl %eax, %eax
callq 0x1100
cmpl $0x1, %eax
jne 0x14f2
movl 0xc(%rsp), %eax
cmpl %r14d, %eax
setl %cl
cmpl %ebp, %eax
setg %dl
orb %cl, %dl
jne 0x14ef
movslq 0x8(%rsp), %rcx
cmpb $0x0, (%r15,%rcx)
je 0x1502
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, (%rbx)
movb $0x1, %r12b
jmp 0x14f2
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: opt_str
bool opt_str(const char* arg, const char* keyword, const char** str) {
   do { // check for a "keyword=string" option
      if (tolower(*arg++) != *keyword++) return false; }
   while (*keyword);
   *str = arg; // ptr to "string" part, which could be null
   return true; }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0x1160
movq (%rax), %rax
movb (%r15), %cl
incq %r15
movsbq (%r14), %rdx
movl (%rax,%rdx,4), %edx
movsbl %cl, %esi
cmpl %esi, %edx
jne 0x1543
incq %r14
movb (%r15), %cl
incq %r15
testb %cl, %cl
jne 0x1525
movq %r14, (%rbx)
cmpl %esi, %edx
sete %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: midi_error
void midi_error(char *msg, byte *bufptr) {
   fprintf(stderr, "---> MIDI file error at position %04X (%d): %s\n",
           (uint16_t)(bufptr - buffer), (uint16_t)(bufptr - buffer), msg);
   byte *ptr = bufptr - 16;   // print some bytes surrounding the error
   if (ptr < buffer) ptr = buffer;
   for (; ptr <= bufptr + 16 && ptr < buffer + buflen; ++ptr)
      fprintf(stderr, ptr == bufptr ? " [%02X]  " : "%02X ", *ptr);
   fprintf(stderr, "\n");
   exit(8); }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r8
movq 0x74dc(%rip), %r14      # 0x8ff8
movq (%r14), %rdi
movl 0x76bb(%rip), %eax      # 0x91e0
movl %ebx, %ecx
subl %eax, %ecx
movzwl %cx, %ecx
leaq 0x3ed3(%rip), %rsi      # 0x5a06
movl %ecx, %edx
xorl %eax, %eax
callq 0x10b0
leaq -0x10(%rbx), %r15
movq 0x7699(%rip), %rax      # 0x91e0
cmpq %rax, %r15
cmovbq %rax, %r15
leaq 0x10(%rbx), %r12
cmpq %r12, %r15
ja 0x1ba4
addq 0x768a(%rip), %rax      # 0x91e8
cmpq %rax, %r15
jae 0x1ba4
leaq 0x3ecc(%rip), %r13      # 0x5a36
leaq 0x3ecf(%rip), %rbp      # 0x5a40
movq (%r14), %rdi
cmpq %rbx, %r15
movq %rbp, %rsi
cmoveq %r13, %rsi
movzbl (%r15), %edx
xorl %eax, %eax
callq 0x10b0
incq %r15
cmpq %r12, %r15
ja 0x1ba4
movq 0x7648(%rip), %rax      # 0x91e0
addq 0x7649(%rip), %rax      # 0x91e8
cmpq %rax, %r15
jb 0x1b71
movq (%r14), %rsi
movl $0xa, %edi
callq 0x1090
movl $0x8, %edi
callq 0x1140
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: miditones_strlcpy
size_t miditones_strlcpy (char *dst, const char *src, size_t siz) {
   char *d = dst;
   const char *s = src;
   size_t n = siz;
   if (n != 0) {   /* Copy as many bytes as will fit */
      while (--n != 0) {
         if ((*d++ = *s++) == '\0') break; } }
   if (n == 0) {   /* Not enough room in dst, add NUL and traverse rest of src */
      if (siz != 0) *d = '\0';  /* NUL-terminate dst */
      while (*s++) ; }
   return (s - src - 1);        /* count does not include NUL */
}

// Assembly:
movq %rsi, %rax
movq %rsi, %rcx
testq %rdx, %rdx
je 0x1c00
decq %rdx
xorl %ecx, %ecx
cmpq %rcx, %rdx
je 0x1bf9
movb (%rax,%rcx), %sil
movb %sil, (%rdi,%rcx)
incq %rcx
testb %sil, %sil
jne 0x1bdc
addq %rax, %rcx
movq %rcx, %rdx
jmp 0x1c0c
movb $0x0, (%rdi,%rcx)
addq %rax, %rcx
leaq 0x1(%rcx), %rdx
cmpb $0x0, (%rcx)
movq %rdx, %rcx
jne 0x1c00
notq %rax
addq %rdx, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: miditones_strlcat
size_t miditones_strlcat (char *dst, const char *src, size_t siz) {
   char *d = dst;
   const char *s = src;
   size_t n = siz;
   size_t dlen;
   /* Find the end of dst and adjust bytes left but don't go past end */
   while (n-- != 0 && *d != '\0') d++;
   dlen = d - dst;
   n = siz - dlen;
   if (n == 0) return (dlen + strlength (s));
   while (*s != '\0') {
      if (n != 1) {
         *d++ = *s;
         n--; }
      s++; }
   *d = '\0';
   return (dlen + (s - src));   /* count does not include NUL */
}

// Assembly:
movq %rdi, %r8
testq %rdx, %rdx
je 0x1c36
leaq (%rdi,%rdx), %rax
movq %rdx, %rcx
movq %rdi, %r8
cmpb $0x0, (%r8)
je 0x1c36
incq %r8
decq %rcx
jne 0x1c25
movq %rax, %r8
movq %r8, %rcx
subq %rdi, %rcx
subq %rcx, %rdx
je 0x1c7b
movb (%rsi), %dil
movq %rsi, %rax
testb %dil, %dil
je 0x1c72
movl $0x1, %r9d
cmpq $0x1, %rdx
jne 0x1c5d
movq %r9, %rdx
jmp 0x1c66
movb %dil, (%r8)
incq %r8
decq %rdx
movb 0x1(%rax), %dil
incq %rax
testb %dil, %dil
jne 0x1c52
movb $0x0, (%r8)
subq %rsi, %rax
jmp 0x1c9f
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movabsq $0x100000000, %rdx      # imm = 0x100000000
addq %rdx, %rax
cmpb $0x0, (%rsi)
leaq 0x1(%rsi), %rsi
jne 0x1c8f
sarq $0x20, %rax
addq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: charcmp
int charcmp (const char *buf, const char *match) {
   int len, i;
   len = strlength (match);
   for (i = 0; i < len; ++i)
      if (buf[i] != match[i]) return 0;
   return 1; }

// Assembly:
movq $-0x1, %rax
cmpb $0x0, 0x1(%rsi,%rax)
leaq 0x1(%rax), %rax
jne 0x1caa
testq %rax, %rax
je 0x1cdb
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
xorl %eax, %eax
xorl %edx, %edx
movb (%rdi,%rdx), %r8b
cmpb (%rsi,%rdx), %r8b
jne 0x1ce0
incq %rdx
cmpq %rdx, %rcx
jne 0x1cc9
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: outfile_items
void outfile_items(int n) {
   outfile_bytecount += n;
   outfile_itemcount += n;
   if (!binaryoutput) {
      if (outfile_itemcount >= outfile_maxitems) {
         if (asm_output) fprintf(outfile, "\n%s", byteop);
         else fprintf(outfile, ",\n");
         outfile_itemcount = 0; }
      else fprintf(outfile, ", "); } }

// Assembly:
movslq %edi, %rax
addq %rax, 0x746c(%rip)      # 0x9188
addl 0x7412(%rip), %eax      # 0x9134
movl %eax, 0x740c(%rip)      # 0x9134
cmpb $0x0, 0x7491(%rip)      # 0x91c0
jne 0x1da5
cmpl 0x73b1(%rip), %eax      # 0x90e8
jge 0x1d56
movq 0x74b0(%rip), %rcx      # 0x91f0
leaq 0x4b19(%rip), %rdi      # 0x6860
movl $0x2, %esi
movl $0x1, %edx
jmp 0x1150
pushq %rax
movq 0x7492(%rip), %rcx      # 0x91f0
cmpb $0x1, 0x7465(%rip)      # 0x91ca
jne 0x1d81
movq 0x7372(%rip), %rdx      # 0x90e0
leaq 0x4b0d(%rip), %rsi      # 0x6882
movq %rcx, %rdi
xorl %eax, %eax
callq 0x10b0
jmp 0x1d97
leaq 0x3ccb(%rip), %rdi      # 0x5a53
movl $0x2, %esi
movl $0x1, %edx
callq 0x1150
movl $0x0, 0x7393(%rip)      # 0x9134
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: describe
char *describe(struct noteinfo *np) { // create a description of a note
   // WARNING: returns a pointer to a static string, so only call once per line, in a printf!
   static char notedescription[100];
   int secs = np->time_usec / 1000000;
   sprintf(notedescription, "at %3lu.%06lu sec (%d:%02d), note %d (0x%02X) track %d channel %d volume %d instrument %d",
           secs, np->time_usec % 1000000,
           secs/60, secs % 60,
           np->note, np->note,
           np->track, np->channel, np->volume, np->instrument);
   return notedescription; }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl (%rdi), %eax
movl 0x4(%rdi), %r10d
imulq $0x431bde83, %rax, %rdx # imm = 0x431BDE83
shrq $0x32, %rdx
imull $0xf4240, %edx, %esi    # imm = 0xF4240
movl %eax, %ecx
subl %esi, %ecx
shrl $0x8, %eax
imulq $0x11e54c7, %rax, %r8   # imm = 0x11E54C7
shrq $0x2a, %r8
imull $0x2223, %edx, %eax     # imm = 0x2223
shrl $0x13, %eax
imull $0x3c, %eax, %eax
movl %edx, %esi
subl %eax, %esi
movzwl %si, %r9d
movl 0xc(%rdi), %r11d
movl 0x8(%rdi), %r14d
movl 0x14(%rdi), %r15d
movl 0x10(%rdi), %r12d
leaq 0x937e(%rip), %rbx      # 0xb180
leaq 0x3c4d(%rip), %rsi      # 0x5a56
movq %rbx, %rdi
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r14
pushq %r10
pushq %r11
pushq %r11
callq 0x1130
addq $0x30, %rsp
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: show_queue
void show_queue(void) { // for debugging: dump the whole event queue
   FILE *fid = logfile;
   if (!logfile) fid = stdout;
   fprintf(fid, "***at output time %lu.%03lu  queue has %d items; oldest at %d, newest at %d\n",
           output_usec / 1000, output_usec % 1000, queue_numitems, queue_oldest_ndx, queue_newest_ndx);
   int ndx = queue_oldest_ndx;
   if (queue_numitems > 0) while (1) {
         struct queue_entry *q = &queue[ndx];
         fprintf(fid, "%2d: %s %s %s\n", ndx, q->cmd == CMD_PLAYNOTE ? "PLAY" : "STOP", q->delete ? "deleted" : "", describe(&q->note));
         if (ndx == queue_newest_ndx) break;
         if (++ndx >= QUEUE_SIZE) ndx = 0; } }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x7394(%rip), %rbx      # 0x91d8
testq %rbx, %rbx
jne 0x1e53
movq 0x7188(%rip), %rax      # 0x8fd8
movq (%rax), %rbx
movl 0x734f(%rip), %ecx      # 0x91a8
imulq $0x10624dd3, %rcx, %rdx # imm = 0x10624DD3
shrq $0x26, %rdx
imull $0x3e8, %edx, %eax      # imm = 0x3E8
subl %eax, %ecx
movl 0x9371(%rip), %r8d      # 0xb1e4
movl 0x936e(%rip), %r9d      # 0xb1e8
movl 0x936c(%rip), %eax      # 0xb1ec
movl %eax, (%rsp)
leaq 0x3c26(%rip), %rsi      # 0x5ab0
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10b0
cmpl $0x0, 0x9349(%rip)      # 0xb1e4
jle 0x1f33
movl 0x9341(%rip), %eax      # 0xb1e8
leaq 0x3c4f(%rip), %r14      # 0x5afd
leaq 0x92cb(%rip), %r15      # 0xb180
movslq %eax, %r12
leaq (%r12,%r12,8), %rax
leaq (%rax,%rax,2), %rax
addq %r12, %rax
leaq 0x9336(%rip), %rcx      # 0xb200
leaq (%rcx,%rax), %rdi
addq $0x4, %rdi
cmpb $-0x70, -0x4(%rdi)
leaq 0x3c34(%rip), %r13      # 0x5b11
leaq 0x3c28(%rip), %rax      # 0x5b0c
cmoveq %rax, %r13
cmpb $0x0, -0x3(%rdi)
leaq 0x3c23(%rip), %rbp      # 0x5b16
leaq 0x4790(%rip), %rax      # 0x668a
cmoveq %rax, %rbp
callq 0x1da6
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
movq %r13, %rcx
movq %rbp, %r8
xorl %ebp, %ebp
movq %r15, %r9
xorl %eax, %eax
callq 0x10b0
leal 0x1(%r12), %eax
cmpl $0x63, %r12d
cmovgel %ebp, %eax
cmpl 0x92bb(%rip), %r12d     # 0xb1ec
jne 0x1eb5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: show_tonegens
void show_tonegens(void) { // for debugging: dump tone generator status
   FILE *fid = logfile;
   if (!logfile) fid = stdout;
   fprintf(fid, "*** tone generator status at output time %lu.%03lu\n", output_usec / 1000, output_usec % 1000);
   for (int tgnum = 0; tgnum < num_tonegens; ++tgnum) {
      struct tonegen_status *tg = &tonegen[tgnum];
      if (tg->playing)
         fprintf(fid, "#%d: playing note %d (%02X), instrument %d, track %d channel %d%s\n",
                 tgnum, tg->note.note, tg->note.note, tg->note.instrument, tg->note.track, tg->note.channel,
                 tg->stopnote_pending ? ", stopnote pending\n" : "");
      else fprintf(fid, "#%d: idle\n", tgnum); } }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x7284(%rip), %rbx      # 0x91d8
testq %rbx, %rbx
jne 0x1f63
movq 0x7078(%rip), %rax      # 0x8fd8
movq (%rax), %rbx
movl 0x723f(%rip), %ecx      # 0x91a8
imulq $0x10624dd3, %rcx, %rdx # imm = 0x10624DD3
shrq $0x26, %rdx
imull $0x3e8, %edx, %eax      # imm = 0x3E8
subl %eax, %ecx
leaq 0x3b9b(%rip), %rsi      # 0x5b1e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10b0
cmpl $0x0, 0x7158(%rip)      # 0x90ec
jle 0x2025
leaq 0x725f(%rip), %r13      # 0x9200
leaq 0x3baa(%rip), %r14      # 0x5b52
leaq 0x3bfa(%rip), %r15      # 0x5ba9
xorl %r12d, %r12d
cmpb $0x1, (%r13)
jne 0x2002
movl 0x10(%r13), %ecx
movl 0x14(%r13), %r9d
movl 0x8(%r13), %r10d
cmpb $0x0, 0x1(%r13)
movl 0xc(%r13), %r11d
leaq 0x46b5(%rip), %rbp      # 0x668a
leaq 0x3bb9(%rip), %rax      # 0x5b95
cmovneq %rax, %rbp
subq $0x8, %rsp
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %ecx, %r8d
xorl %eax, %eax
pushq %rbp
pushq %r11
pushq %r10
callq 0x10b0
addq $0x20, %rsp
jmp 0x2012
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
xorl %eax, %eax
callq 0x10b0
incq %r12
movslq 0x70d0(%rip), %rax      # 0x90ec
addq $0x1c, %r13
cmpq %rax, %r12
jl 0x1fb2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: generate_delay
void generate_delay(unsigned long delta_msec) { // output a delay command
   if (delta_msec > 0) {
      assert(delta_msec <= 0x7fff, "time delta too big");
      if (last_output_was_delay) {
         ++consecutive_delays;
         if (loggen) fprintf(logfile, "      *** this is a consecutive delay, of %d msec\n", delta_msec); }
      last_output_was_delay = true;
      if (binaryoutput) { // output a 15-bit delay in big-endian format
         putc((byte)(delta_msec >> 8), outfile);
         putc((byte)(delta_msec & 0xff), outfile);
         outfile_bytecount += 2; }
      else if (asm_output) {
         fprintf(outfile, "%s%02X", hex, (byte)(delta_msec >> 8));
         outfile_items(1);
         fprintf(outfile, "%s%02X", hex, (byte)(delta_msec & 0xff));
         outfile_items(1); }
      else {
         fprintf(outfile, "%ld,%ld", delta_msec >> 8, delta_msec & 0xff);
         outfile_items(2); } } }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x270f
movq %rdi, %rbx
xorl %edi, %edi
cmpq $0x8000, %rbx           # imm = 0x8000
setb %dil
leaq 0x36a5(%rip), %rsi      # 0x5d3f
callq 0x1af6
cmpb $0x1, 0x6aba(%rip)      # 0x9160
jne 0x26cf
incl 0x6aae(%rip)            # 0x915c
cmpb $0x1, 0x6b0e(%rip)      # 0x91c3
jne 0x26cf
movq 0x6b1a(%rip), %rdi      # 0x91d8
leaq 0x368d(%rip), %rsi      # 0x5d52
movq %rbx, %rdx
xorl %eax, %eax
callq 0x10b0
movb $0x1, 0x6a8a(%rip)      # 0x9160
cmpb $0x1, 0x6ae3(%rip)      # 0x91c0
jne 0x2714
movl %ebx, %edi
shrl $0x8, %edi
movl $0xff, %ebp
andl %ebp, %edi
movq 0x6afe(%rip), %rsi      # 0x91f0
callq 0x10a0
andl %ebp, %ebx
movq 0x6af0(%rip), %rsi      # 0x91f0
movl %ebx, %edi
callq 0x10a0
addq $0x2, 0x6a79(%rip)      # 0x9188
popq %rbx
popq %r14
popq %rbp
retq
movq 0x6ad5(%rip), %rdi      # 0x91f0
cmpb $0x1, 0x6aa8(%rip)      # 0x91ca
jne 0x2775
movq 0x69ad(%rip), %rdx      # 0x90d8
movl %ebx, %ecx
shrl $0x8, %ecx
movl $0xff, %ebp
andl %ebp, %ecx
leaq 0x3574(%rip), %r14      # 0x5cb2
movq %r14, %rsi
xorl %eax, %eax
callq 0x10b0
movl $0x1, %edi
callq 0x1d12
movq 0x6a97(%rip), %rdi      # 0x91f0
movq 0x6978(%rip), %rdx      # 0x90d8
andl %ebp, %ebx
movq %r14, %rsi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x10b0
movl $0x1, %edi
jmp 0x2792
movq %rbx, %rdx
shrq $0x8, %rdx
movzbl %bl, %ecx
leaq 0x35ff(%rip), %rsi      # 0x5d85
xorl %eax, %eax
callq 0x10b0
movl $0x2, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x1d12
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: queue_find_playnote
int queue_find_playnote(int search_ndx) {
   if (loggen) fprintf(logfile, "      queue_find_playnote(%d), %s: ", search_ndx, describe(&queue[search_ndx].note));
   for (int ndx = queue_newest_ndx;;) {
      if (ndx != search_ndx // don't look at the entry we're trying to match
            && !queue[ndx].delete // don't re-find queue entries already deleted
            && queue[ndx].cmd == CMD_PLAYNOTE // must match playnote
            && queue[ndx].note.channel == queue[search_ndx].note.channel //also channel, track, note, and instrument
            && queue[ndx].note.track == queue[search_ndx].note.track
            && queue[ndx].note.note == queue[search_ndx].note.note
            && queue[ndx].note.instrument == queue[search_ndx].note.instrument ) {
         if (loggen) fprintf(logfile, "found ndx %d\n", ndx);
         return ndx; }
      if (ndx == queue_oldest_ndx) break;
      if (--ndx < 0) ndx = QUEUE_SIZE - 1; }
   if (loggen) fprintf(logfile, "not found\n");
   return -1; }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebp
cmpb $0x0, 0x674d(%rip)      # 0x91c3
je 0x2abd
movq 0x6759(%rip), %rbx      # 0x91d8
movslq %ebp, %r14
leaq (%r14,%r14,8), %rax
leaq (%rax,%rax,2), %rax
addq %r14, %rax
leaq 0x876c(%rip), %rcx      # 0xb200
leaq (%rcx,%rax), %rdi
addq $0x4, %rdi
callq 0x1da6
leaq 0x3408(%rip), %rsi      # 0x5eb0
leaq 0x86d1(%rip), %rcx      # 0xb180
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x10b0
jmp 0x2ac0
movslq %ebp, %r14
movl 0x8726(%rip), %ebx      # 0xb1ec
leaq (%r14,%r14,8), %rax
leaq (%rax,%rax,2), %rcx
addq %r14, %rcx
leaq 0x8728(%rip), %rax      # 0xb200
addq %rax, %rcx
addq $0x4, %rcx
movl 0x8703(%rip), %edx      # 0xb1e8
movl $0x63, %esi
cmpl %ebp, %ebx
je 0x2b31
movslq %ebx, %r8
leaq (%r8,%r8,8), %rdi
leaq (%rdi,%rdi,2), %rdi
addq %r8, %rdi
cmpb $0x0, 0x1(%rax,%rdi)
jne 0x2b31
addq %rax, %rdi
cmpb $-0x70, (%rdi)
jne 0x2b31
movl 0xc(%rdi), %r8d
cmpl 0x8(%rcx), %r8d
jne 0x2b31
movl 0x8(%rdi), %r8d
cmpl 0x4(%rcx), %r8d
jne 0x2b31
movl 0x10(%rdi), %r8d
cmpl 0xc(%rcx), %r8d
jne 0x2b31
movl 0x14(%rdi), %edi
cmpl 0x10(%rcx), %edi
je 0x2b73
cmpl %edx, %ebx
je 0x2b41
testl %ebx, %ebx
leal -0x1(%rbx), %edi
cmovlel %esi, %edi
movl %edi, %ebx
jmp 0x2aea
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, 0x6676(%rip)      # 0x91c3
jne 0x2b6c
movq 0x6682(%rip), %rcx      # 0x91d8
leaq 0x3385(%rip), %rdi      # 0x5ee2
movl $0xa, %esi
movl $0x1, %edx
callq 0x1150
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
cmpb $0x1, 0x6649(%rip)      # 0x91c3
jne 0x2b6c
movq 0x6655(%rip), %rdi      # 0x91d8
leaq 0x334a(%rip), %rsi      # 0x5ed4
movl %ebx, %edx
xorl %eax, %eax
callq 0x10b0
jmp 0x2b6c
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: queue_find_stopnote
int queue_find_stopnote(int search_ndx) {
   if (loggen) fprintf(logfile, "      queue_find_stopnote(%d), %s: ", search_ndx, describe(&queue[search_ndx].note));
   for (int ndx = queue_newest_ndx;;) {
      if (ndx != search_ndx // don't look at the entry we're trying to match
            && !queue[ndx].delete // don't re-find queue entries already deleted
            && queue[ndx].cmd == CMD_STOPNOTE // must match stopnote
            && queue[ndx].note.time_usec == queue[search_ndx].note.time_usec // also time, note, and instrument
            && queue[ndx].note.note == queue[search_ndx].note.note
            && queue[ndx].note.instrument == queue[search_ndx].note.instrument) {
         if (loggen) fprintf(logfile, "found ndx %d\n", ndx);
         return ndx; }
      if (ndx == queue_oldest_ndx) break;
      if (--ndx < 0) ndx = QUEUE_SIZE - 1; }
   if (loggen) fprintf(logfile, "not found\n");
   return -1; }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebp
cmpb $0x0, 0x6621(%rip)      # 0x91c3
je 0x2be9
movq 0x662d(%rip), %rbx      # 0x91d8
movslq %ebp, %r14
leaq (%r14,%r14,8), %rax
leaq (%rax,%rax,2), %rax
addq %r14, %rax
leaq 0x8640(%rip), %rcx      # 0xb200
leaq (%rcx,%rax), %rdi
addq $0x4, %rdi
callq 0x1da6
leaq 0x3319(%rip), %rsi      # 0x5eed
leaq 0x85a5(%rip), %rcx      # 0xb180
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x10b0
jmp 0x2bec
movslq %ebp, %r14
movl 0x85fa(%rip), %ebx      # 0xb1ec
leaq (%r14,%r14,8), %rax
leaq (%rax,%rax,2), %rcx
addq %r14, %rcx
leaq 0x85fc(%rip), %rax      # 0xb200
addq %rax, %rcx
addq $0x4, %rcx
movl 0x85d7(%rip), %edx      # 0xb1e8
movl $0x63, %esi
xorl %edi, %edi
cmpl %ebp, %ebx
je 0x2c57
movslq %ebx, %r9
leaq (%r9,%r9,8), %r8
leaq (%r8,%r8,2), %r8
addq %r9, %r8
cmpb $0x0, 0x1(%rax,%r8)
jne 0x2c57
addq %rax, %r8
cmpb (%r8), %dil
jno 0x2c57
movl 0x4(%r8), %r9d
cmpl (%rcx), %r9d
jne 0x2c57
movl 0x10(%r8), %r9d
cmpl 0xc(%rcx), %r9d
jne 0x2c57
movl 0x14(%r8), %r8d
cmpl 0x10(%rcx), %r8d
je 0x2c9c
cmpl %edx, %ebx
je 0x2c6a
testl %ebx, %ebx
leal -0x1(%rbx), %r8d
cmovlel %esi, %r8d
movl %r8d, %ebx
jmp 0x2c18
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x1, 0x654d(%rip)      # 0x91c3
jne 0x2c95
movq 0x6559(%rip), %rcx      # 0x91d8
leaq 0x325c(%rip), %rdi      # 0x5ee2
movl $0xa, %esi
movl $0x1, %edx
callq 0x1150
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
cmpb $0x1, 0x6520(%rip)      # 0x91c3
jne 0x2c95
movq 0x652c(%rip), %rdi      # 0x91d8
leaq 0x3221(%rip), %rsi      # 0x5ed4
movl %ebx, %edx
xorl %eax, %eax
callq 0x10b0
jmp 0x2c95
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: remove_queue_duplicates
void remove_queue_duplicates(int stop_ndx) {
   int play_ndx, dup_play_ndx, dup_stop_ndx;
   if ((play_ndx = queue_find_playnote(stop_ndx)) >= 0 // find its matching playnote
         && (dup_stop_ndx = queue_find_stopnote(stop_ndx)) >= 0  // find another stopnote for the same note at the same time
         && (dup_play_ndx = queue_find_playnote(dup_stop_ndx)) >= 0 // find its matching playnote
         && queue[dup_play_ndx].note.time_usec == queue[play_ndx].note.time_usec) {  // if it starts at the same time, delete it
      if (loggen) fprintf(logfile, "    remove duplicate, ndxs %d, %d: %s\n", dup_play_ndx, dup_stop_ndx, describe(&queue[dup_play_ndx].note));
      queue[dup_play_ndx].delete = queue[dup_stop_ndx].delete = true; } }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebx
callq 0x2a69
testl %eax, %eax
js 0x2d7e
movl %eax, %r14d
movl %ebx, %edi
callq 0x2b95
testl %eax, %eax
js 0x2d7e
movl %eax, %ebx
movl %eax, %edi
callq 0x2a69
testl %eax, %eax
js 0x2d7e
movl %eax, %ebp
movl %eax, %ecx
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rcx, %rax
leaq 0x84f2(%rip), %r15      # 0xb200
movl 0x4(%r15,%rax), %ecx
movl %r14d, %edx
leaq (%rdx,%rdx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rdx, %rsi
cmpl 0x4(%r15,%rsi), %ecx
jne 0x2d7e
leaq (%r15,%rax), %r12
cmpb $0x1, 0x6490(%rip)      # 0x91c3
jne 0x2d65
leaq (%r15,%rax), %rdi
addq $0x4, %rdi
movq 0x6494(%rip), %r14      # 0x91d8
callq 0x1da6
leaq 0x31c1(%rip), %rsi      # 0x5f11
leaq 0x8429(%rip), %r8       # 0xb180
movq %r14, %rdi
movl %ebp, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x10b0
movl %ebx, %eax
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rax, %rcx
movb $0x1, %al
movb %al, 0x1(%r15,%rcx)
movb %al, 0x1(%r12)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: show_queue_cmd
void show_queue_cmd(timestamp time_usec, byte cmd, int note) {
   printf("debug queue %s note %02X at %6ld\n", cmd == CMD_PLAYNOTE ? "PLAY" : "STOP", note, time_usec);
   struct noteinfo notedata;
   notedata.time_usec = time_usec;
   notedata.track = 0;
   notedata.channel = 0;
   notedata.note = note;
   notedata.instrument = 1;
   notedata.volume = 100;
   queue_cmd(cmd, &notedata);
   show_queue(); }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebx
movl %esi, %ebp
movl %edi, %r14d
cmpl $0x90, %esi
leaq 0x2b48(%rip), %rax      # 0x5b0c
leaq 0x2b46(%rip), %rsi      # 0x5b11
cmoveq %rax, %rsi
leaq 0x2fbf(%rip), %rdi      # 0x5f95
movl %r14d, %ecx
xorl %eax, %eax
callq 0x1080
leaq 0x8(%rsp), %rsi
movl %r14d, (%rsi)
movq $0x0, 0x4(%rsi)
movl %ebx, 0xc(%rsi)
movabsq $0x6400000001, %rax     # imm = 0x6400000001
movq %rax, 0x10(%rsi)
movl %ebp, %edi
callq 0x2d87
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x1e32
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: process_file_header
void process_file_header (void) {
   struct midi_header *hdr;
   unsigned int time_division;

   chk_bufdata (hdrptr, sizeof (struct midi_header));
   hdr = (struct midi_header *) hdrptr;
   if (!charcmp ((char *) hdr->MThd, "MThd"))
      midi_error ("Missing 'MThd'", hdrptr);
   num_tracks = rev_short (hdr->number_of_tracks);
   time_division = rev_short (hdr->time_division);
   if (time_division < 0x8000)
      ticks_per_beat = time_division;
   else
      ticks_per_beat = ((time_division >> 8) & 0x7f) /* SMTE frames/sec */ *(time_division & 0xff);     /* ticks/SMTE frame */
   if (logparse) {
      fprintf (logfile, "Header size %" PRId32 "\n", rev_long (hdr->header_size));
      fprintf (logfile, "Format type %d\n", rev_short (hdr->format_type));
      fprintf (logfile, "Number of tracks %d\n", num_tracks);
      fprintf (logfile, "Time division %04X\n", time_division);
      fprintf (logfile, "Ticks/beat = %d\n", ticks_per_beat); }
   hdrptr += rev_long (hdr->header_size) + 8;   /* point past header to track header, presumably. */
   return; }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq 0x8cd1(%rip), %rbx      # 0xbcf0
movl 0x61bb(%rip), %eax      # 0x91e0
movl %ebx, %ecx
subl %eax, %ecx
addl $0x10, %ecx
cmpq 0x61b5(%rip), %rcx      # 0x91e8
ja 0x3154
xorl %eax, %eax
leaq 0x2f75(%rip), %rcx      # 0x5fb7
movb (%rbx,%rax), %dl
cmpb (%rax,%rcx), %dl
jne 0x3145
incq %rax
cmpq $0x4, %rax
jne 0x3042
movzwl 0xa(%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x8c90(%rip)      # 0xbcf8
movzwl 0xc(%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %ebp
movl %ebp, %eax
shrl $0x8, %eax
andl $0x7f, %eax
movzbl %bpl, %ecx
imull %eax, %ecx
testw %bp, %bp
cmovnsl %ebp, %ecx
movl %ecx, 0x607e(%rip)      # 0x910c
cmpb $0x1, 0x6130(%rip)      # 0x91c5
movq %rbx, %rax
jne 0x312c
movq 0x6133(%rip), %rdi      # 0x91d8
movl 0x4(%rbx), %edx
bswapl %edx
leaq 0x2f1a(%rip), %rsi      # 0x5fcb
xorl %eax, %eax
callq 0x10b0
movq 0x6119(%rip), %rdi      # 0x91d8
movzwl 0x8(%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %edx
leaq 0x2f0a(%rip), %rsi      # 0x5fdb
xorl %eax, %eax
callq 0x10b0
movq 0x60f9(%rip), %rdi      # 0x91d8
movl 0x8c13(%rip), %edx      # 0xbcf8
leaq 0x2eff(%rip), %rsi      # 0x5feb
xorl %eax, %eax
callq 0x10b0
movq 0x60de(%rip), %rdi      # 0x91d8
leaq 0x2eff(%rip), %rsi      # 0x6000
movl %ebp, %edx
xorl %eax, %eax
callq 0x10b0
movq 0x60c7(%rip), %rdi      # 0x91d8
movl 0x5ff5(%rip), %edx      # 0x910c
leaq 0x2ef6(%rip), %rsi      # 0x6014
xorl %eax, %eax
callq 0x10b0
movq 0x8bc4(%rip), %rax      # 0xbcf0
movl 0x4(%rbx), %ecx
bswapl %ecx
addl $0x8, %ecx
addq %rax, %rcx
movq %rcx, 0x8bb2(%rip)      # 0xbcf0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x2e70(%rip), %rdi      # 0x5fbc
movq %rbx, %rsi
callq 0x1b04
leaq 0x28eb(%rip), %rdi      # 0x5a46
jmp 0x314c
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: process_track_header
void process_track_header (int tracknum) {
   struct track_header *hdr;
   unsigned long tracklen;

   chk_bufdata (hdrptr, sizeof (struct track_header));
   hdr = (struct track_header *) hdrptr;
   if (!charcmp ((char *) (hdr->MTrk), "MTrk"))
      midi_error ("Missing 'MTrk'", hdrptr);
   tracklen = rev_long (hdr->track_size);
   if (logparse) fprintf (logfile, "\nTrack %d length %ld\n", tracknum, tracklen);
   hdrptr += sizeof (struct track_header);      /* point past header */
   chk_bufdata (hdrptr, tracklen);
   track[tracknum].trkptr = hdrptr;
   hdrptr += tracklen;          /* point to the start of the next track */
   track[tracknum].trkend = hdrptr;     /* the point past the end of the track */
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x8b88(%rip), %rsi      # 0xbcf0
movq 0x6071(%rip), %rcx      # 0x91e0
movl %esi, %eax
subl %ecx, %eax
addl $0x8, %eax
movq 0x606b(%rip), %rdx      # 0x91e8
cmpq %rdx, %rax
ja 0x3238
movl %edi, %ebx
xorl %eax, %eax
leaq 0x2e94(%rip), %rdi      # 0x6025
movb (%rsi,%rax), %r8b
cmpb (%rax,%rdi), %r8b
jne 0x322c
incq %rax
cmpq $0x4, %rax
jne 0x3191
movl 0x4(%rsi), %r14d
bswapl %r14d
cmpb $0x1, 0x600f(%rip)      # 0x91c5
jne 0x31e7
movq 0x6019(%rip), %rdi      # 0x91d8
leaq 0x2e73(%rip), %rsi      # 0x6039
movl %ebx, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x10b0
movq 0x8b17(%rip), %rsi      # 0xbcf0
movq 0x6000(%rip), %rcx      # 0x91e0
movq 0x6001(%rip), %rdx      # 0x91e8
leaq 0x8(%rsi), %rax
movq %rax, 0x8afe(%rip)      # 0xbcf0
addq %r14, %rsi
addq $0x8, %rsi
movl %esi, %edi
subl %ecx, %edi
cmpq %rdx, %rdi
ja 0x3244
movslq %ebx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
leaq 0x61ac(%rip), %rdx      # 0x93c0
movq %rax, (%rcx,%rdx)
movq %rsi, 0x8ad1(%rip)      # 0xbcf0
movq %rsi, 0x8(%rcx,%rdx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x2df7(%rip), %rdi      # 0x602a
callq 0x1b04
leaq 0x2807(%rip), %rdi      # 0x5a46
callq 0x1b04
leaq 0x27fb(%rip), %rdi      # 0x5a46
movq %rax, %rsi
callq 0x1b04
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: get_varlen
unsigned long get_varlen (uint8_t ** ptr) { // get a MIDI-style integer
   /* Get a 1-4 byte variable-length value and adjust the pointer past it.
   These are a succession of 7-bit values with a MSB bit of zero marking the end */
   unsigned long val = 0;
   for (int i = 0; i < 4; ++i) {
      byte b = *(*ptr)++;
      val = (val << 7) | (b & 0x7f);
      if (!(b & 0x80))
         return val; }
   return val; }

// Assembly:
movq (%rdi), %rcx
incq %rcx
movl $0x3, %edx
xorl %eax, %eax
movq %rcx, (%rdi)
movzbl -0x1(%rcx), %r8d
movq %rax, %rsi
shlq $0x7, %rsi
movl %r8d, %eax
andl $0x7f, %eax
orq %rsi, %rax
subl $0x1, %edx
setb %sil
testb %r8b, %r8b
jns 0x328c
incq %rcx
testb %sil, %sil
je 0x3260
retq
// File: /workspace/github_c_makefile_star2_O3/LenShustek[P]miditones/miditones.c
// Function: show_noteinfo_slots
void show_noteinfo_slots(int channum) {
   struct channel_status *cp = &channel[channum];
   if (loggen) {
      fprintf(logfile, "notes playing for channel %d:\n", channum);
      for (int ndx = 0; ndx < MAX_CHANNELNOTES; ++ndx)
         if (cp->note_playing[ndx]) {
            struct noteinfo *np = &cp->notes_playing[ndx];
            fprintf(logfile, "  %2d: %s\n", ndx, describe(np)); } } }

// Assembly:
cmpb $0x1, 0x5684(%rip)      # 0x91c3
jne 0x3bd7
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq %edi, %rdx
imulq $0x194, %rdx, %rbx      # imm = 0x194
leaq 0x5cdf(%rip), %r14      # 0x9840
leaq (%r14,%rbx), %rbp
movq 0x566c(%rip), %rdi      # 0x91d8
leaq 0x27e6(%rip), %rsi      # 0x6359
xorl %eax, %eax
callq 0x10b0
addq %r14, %rbx
addq $0x14, %rbx
leaq 0x27f0(%rip), %r14      # 0x6378
leaq 0x75f1(%rip), %r15      # 0xb180
xorl %r12d, %r12d
cmpb $0x1, 0x4(%rbp,%r12)
jne 0x3bbc
movq 0x5637(%rip), %r13      # 0x91d8
movq %rbx, %rdi
callq 0x1da6
movq %r13, %rdi
movq %r14, %rsi
movl %r12d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x10b0
incq %r12
addq $0x18, %rbx
cmpq $0x10, %r12
jne 0x3b92
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/niho[P]elmc/src/estack.c
// Function: elmS_stack_delete
void elmS_stack_delete(elmS_stack_t *stack) {
    while(1) {
        if(elmS_stack_pop(stack) == NULL)
            break;
    }
    stack->head = NULL;
    stack->size = 0;
    free(stack);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x1355
movq 0x8(%rdi), %rax
movq %rax, (%rbx)
decl 0x8(%rbx)
movq (%rdi), %r14
callq 0x1030
testq %r14, %r14
jne 0x1336
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/aap[P]rx-0/misc/texas.c
// Function: listsyms
void
listsyms(void)
{
	Sym *s;

	qsort(symtab, MAXSYM, sizeof(Sym), cmpsym);
	fprintf(lstfp, "\n    SYMBOL TABLE\n");
	for(s = symtab; s < &symtab[MAXSYM]; s++){
		if((s->type&7) != SymValue)
			continue;
		if(s->supress)
			continue;
		fprintf(lstfp, "%-07s %06o\n", s->name, s->val);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x3ec0(%rip), %rbx      # 0x54a0
leaq -0x22(%rip), %rcx       # 0x15c5
movl $0xfa0, %esi            # imm = 0xFA0
movl $0x18, %edx
movq %rbx, %rdi
callq 0x1050
movq 0x3e90(%rip), %rcx      # 0x5490
leaq 0x1a47(%rip), %rdi      # 0x304e
movl $0x12, %esi
movl $0x1, %edx
callq 0x1160
leaq 0x1a44(%rip), %r14      # 0x3061
xorl %r15d, %r15d
movl 0x8(%r15,%rbx), %eax
andl $0x7, %eax
cmpl $0x1, %eax
jne 0x164f
cmpl $0x0, 0xc(%r15,%rbx)
jne 0x164f
leaq (%rbx,%r15), %rdx
movq 0x3e50(%rip), %rdi      # 0x5490
movl 0x10(%r15,%rbx), %ecx
movq %r14, %rsi
xorl %eax, %eax
callq 0x10d0
leaq 0x18(%r15), %rax
cmpq $0x176e8, %r15          # imm = 0x176E8
movq %rax, %r15
jb 0x1620
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq