LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/kopytjuk[P]wasm-image-converter/src/utils.cpp
// Function: utils::read_file_to_char_array(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char*, int)
void utils::read_file_to_char_array(std::string fn, char *arr, int size){

  std::ifstream file (fn, std::ios::in | std::ios::binary);

  if (file.is_open())
  {
      file.seekg (0, std::ios::beg);
      file.read(arr, size);
      file.close();

  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %rsi
leaq -0x218(%rbp), %rdi
movl $0xc, %edx
callq 0x47a0
leaq -0x1a0(%rbp), %rdi
callq 0x4150
testb %al, %al
je 0xdade
leaq -0x218(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4620
movslq %r14d, %rdx
leaq -0x218(%rbp), %rdi
movq %rbx, %rsi
callq 0x45e0
leaq -0x218(%rbp), %rdi
callq 0x4120
leaq -0x218(%rbp), %rdi
callq 0x4170
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x4170
movq %rbx, %rdi
callq 0x48b0
// File: /workspace/github_c_makefile_star2_O1/kopytjuk[P]wasm-image-converter/src/utils.cpp
// Function: utils::write_char_array_to_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char*, int)
void utils::write_char_array_to_file(const std::string fn, char *arr, int size){
    
    std::ofstream file (fn, std::ios::out | std::ios::binary);

    if (file.is_open())
    {
        file.write(arr, size);
        file.close();

    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %rsi
leaq -0x210(%rbp), %rdi
movl $0x14, %edx
callq 0x4920
leaq -0x1a0(%rbp), %rdi
callq 0x4150
testb %al, %al
je 0xdc14
movslq %r14d, %rdx
leaq -0x210(%rbp), %rdi
movq %rbx, %rsi
callq 0x4600
leaq -0x210(%rbp), %rdi
callq 0x4670
movq 0x63a5(%rip), %rax      # 0x13fc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x208(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x210(%rbp,%rcx)
callq 0x4490
leaq -0x118(%rbp), %rdi
callq 0x4210
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x210(%rbp), %rdi
callq 0x46d0
movq %rbx, %rdi
callq 0x48b0
// File: /workspace/github_c_makefile_star2_O1/kopytjuk[P]wasm-image-converter/src/utils.cpp
// Function: utils::filesize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int utils::filesize(std::string fn){
    
    int size;

    std::ifstream file (fn, std::ios::in | std::ios::binary | std::ios::ate);

    if (file.is_open())
    {
        file.seekg(0, std::ios::end);
        size = file.tellg();
        file.close();
        return size;

    } else{
        return -1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rsi
leaq -0x210(%rbp), %rdi
movl $0xe, %edx
callq 0x47a0
leaq -0x198(%rbp), %rdi
callq 0x4150
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testb %al, %al
je 0xdcd0
leaq -0x210(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x4620
leaq -0x210(%rbp), %rdi
callq 0x4870
movq %rax, %rbx
leaq -0x210(%rbp), %rdi
callq 0x4120
leaq -0x210(%rbp), %rdi
callq 0x4170
movl %ebx, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %rbp
retq
jmp 0xdcea
movq %rax, %rbx
leaq -0x210(%rbp), %rdi
callq 0x4170
movq %rbx, %rdi
callq 0x48b0
// File: /workspace/github_c_makefile_star2_O1/giometti[P]mastering_UNIX_programming/chapter_01/group.c
// Function: main
int main(void) {
	struct group *grp;

	setgrent();
	while((grp = getgrent()) != NULL)
		printf("gid=%d name=%s\n",
			grp->gr_gid, grp->gr_name);
	endgrent();

	return 0;
}

// Assembly:
pushq %rbx
callq 0x1060
callq 0x1040
testq %rax, %rax
je 0x119d
leaq 0xe81(%rip), %rbx       # 0x2004
movl 0x10(%rax), %esi
movq (%rax), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1050
callq 0x1040
testq %rax, %rax
jne 0x1183
callq 0x1030
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/gumbo/util.c
// Function: trim
static int trim(lua_State *L)
{
    size_t len;
    const char *str = luaL_checklstring(L, 1, &len);
    const char *trimmed = do_trim(str, &len);
    lua_pushlstring(L, trimmed, len);
    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r14
movl $0x1, %esi
movq %r14, %rdx
callq 0x1070
movq %rax, %rdi
movq %r14, %rsi
callq 0x1337
movq (%r14), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x10a0
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/gumbo/util.c
// Function: trim_and_collapse
static int trim_and_collapse(lua_State *L)
{
    luaL_Buffer b;
    size_t len;
    const char *str = luaL_checklstring(L, 1, &len);
    str = do_trim(str, &len);

    #if LUA_VERSION_NUM >= 502
        char *out = luaL_buffinitsize(L, &b, len);
        size_t pos = 0;
    #else
        luaL_buffinit(L, &b);
    #endif

    for (size_t i = 0; i < len; ) {
        char ch = str[i++];
        if (ascii_isspace(ch)) {
            while (i < len && ascii_isspace(str[i])) {
                i++;
            }
            ch = ' ';
        }
        #if LUA_VERSION_NUM >= 502
            out[pos++] = ch;
        #else
            luaL_addchar(&b, ch);
        #endif
    }

    #if LUA_VERSION_NUM >= 502
        luaL_addsize(&b, pos);
    #endif

    luaL_pushresult(&b);
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x2030, %rsp           # imm = 0x2030
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdx
callq 0x1070
movq %rax, %rdi
movq %r15, %rsi
callq 0x1337
movq %rax, %rbx
movq (%r15), %rdx
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x1090
movq (%r15), %rdi
testq %rdi, %rdi
je 0x1299
xorl %edx, %edx
leaq 0xdfa(%rip), %rsi       # 0x2050
xorl %ecx, %ecx
movzbl (%rbx,%rdx), %r8d
incq %rdx
testb $0x1, (%rsi,%r8)
je 0x1286
movb $0x20, %r8b
cmpq %rdi, %rdx
jae 0x1286
movzbl (%rbx,%rdx), %r9d
testb $0x1, (%rsi,%r9)
je 0x1286
incq %rdx
cmpq %rdx, %rdi
jne 0x126f
movq %rdi, %rdx
movb %r8b, (%rax,%rcx)
incq %rcx
movq 0x8(%rsp), %rdi
cmpq %rdi, %rdx
jb 0x1258
jmp 0x129b
xorl %ecx, %ecx
leaq 0x10(%rsp), %rdi
addq %rcx, 0x10(%rdi)
callq 0x1060
movl $0x1, %eax
addq $0x2030, %rsp           # imm = 0x2030
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/gumbo/util.c
// Function: createtable
static int createtable(lua_State *L)
{
    lua_Integer narr = luaL_checkinteger(L, 1);
    lua_Integer nrec = luaL_checkinteger(L, 2);
    if (unlikely(narr < 0 || narr > INT_MAX)) {
        luaL_argerror(L, 1, "value outside valid range");
    }
    if (unlikely(nrec < 0 || nrec > INT_MAX)) {
        luaL_argerror(L, 2, "value outside valid range");
    }
    lua_createtable(L, (int)narr, (int)nrec);
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, %esi
callq 0x1080
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1080
movq %rax, %r15
testq $-0x80000000, %r14      # imm = 0x80000000
jne 0x130b
movq %r15, %rax
shrq $0x1f, %rax
jne 0x1321
movq %rbx, %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x1050
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0xd21(%rip), %rdx       # 0x2033
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1040
jmp 0x12e9
leaq 0xd0b(%rip), %rdx       # 0x2033
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1040
jmp 0x12f2
// File: /workspace/github_c_makefile_star2_O1/craigbarnes[P]lua-gumbo/gumbo/util.c
// Function: do_trim
static const char *do_trim(const char *str, size_t *n)
{
    size_t len = *n;
    while (len && ascii_isspace(*str)) {
        len--;
        str++;
    }

    const char *end = str + len - 1;
    while (len && ascii_isspace(*end)) {
        len--;
        end--;
    }

    *n = len;
    return str;
}

// Assembly:
movq (%rsi), %rcx
testq %rcx, %rcx
je 0x1361
leaq (%rdi,%rcx), %rax
leaq 0xd06(%rip), %rdx       # 0x2050
movzbl (%rdi), %r8d
testb $0x1, (%rdx,%r8)
je 0x1361
incq %rdi
decq %rcx
jne 0x134a
xorl %ecx, %ecx
jmp 0x1364
movq %rdi, %rax
testq %rcx, %rcx
je 0x1382
leaq 0xce0(%rip), %rdx       # 0x2050
movzbl -0x1(%rax,%rcx), %edi
testb $0x1, (%rdx,%rdi)
je 0x1382
decq %rcx
jne 0x1370
xorl %ecx, %ecx
movq %rcx, (%rsi)
retq
nop
// File: /workspace/github_c_makefile_star2_O1/skoren[P]bacValidation/samToErrorRate.C
// Function: rc(char*, int)
char *rc(char *input, int len) {
   char *seq = new char[len+1];
   input+=len-1;
   for (int i = 0; i < len; i++) {
      seq[i]=basemap[*input];
      input--;
   }
   return seq;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leal 0x1(%r14), %eax
movslq %eax, %rdi
callq 0x3030
testl %r14d, %r14d
jle 0xa6a8
movl %r14d, %ecx
leaq 0x3330(%rip), %rdx      # 0xd9c0
movq %rax, %rsi
movsbq -0x1(%rbx,%rcx), %rdi
movb (%rdi,%rdx), %dil
movb %dil, (%rsi)
incq %rsi
decq %rcx
jne 0xa693
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/term.c
// Function: new_term
Term *
new_term(int rows, int cols)
{
    size_t size = sizeof(Term) + rows*sizeof(Cell *) + rows*cols*sizeof(Cell);
    Term *term = malloc(size);
    if (!term)
        return NULL;
    term->rows = rows;
    term->cols = cols;
    term->addr = (Cell **) &term[1];
    term->cells = (Cell *) &term->addr[rows];
    reset(term);
    term->plt_dirty = 0;
    return term;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movslq %edi, %r14
movl %r14d, %eax
imull %esi, %eax
cltq
shlq $0x2, %rax
leaq (%rax,%r14,8), %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
callq 0x1150
testq %rax, %rax
je 0x1757
movq %rax, %rbx
movl %r14d, (%rax)
movl %ebp, 0x4(%rax)
addq $0x1a0, %rax            # imm = 0x1A0
movq %rax, 0x20(%rbx)
leaq (%rbx,%r14,8), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movq %rax, 0x28(%rbx)
movq %rbx, %rdi
callq 0x1761
movb $0x0, 0x19d(%rbx)
jmp 0x1759
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/term.c
// Function: reset
static void
reset(Term *term)
{
    int i, j;

    term->row = term->col = 0;
    term->top = 0;
    term->bot = term->rows - 1;
    term->mode = def_mode;
    term->attr = def_attr;
    term->pair = def_pair;
    term->cs_array[0] = CS_BMP;
    term->cs_array[1] = CS_VTG;
    term->cs_index = 0;
    term->state = S_ANY;
    term->parlen = 0;
    if (memcmp(term->plt, def_plt, sizeof(term->plt) != 0)) {
        term->plt_dirty = 1;
    }
    memcpy(term->plt, def_plt, sizeof(term->plt));
    term->plt_local = 0;
    for (i = 0; i < term->rows; i++) {
        term->addr[i] = &term->cells[i*term->cols];
        for (j = 0; j < term->cols; j++)
            term->addr[i][j] = (Cell) {EMPTY, def_attr, def_pair};
    }
    save_cursor(term);
    save_misc(term);
}

// Assembly:
xorl %eax, %eax
movq %rax, 0x8(%rdi)
movl %eax, 0x10(%rdi)
movl (%rdi), %ecx
decl %ecx
movl %ecx, 0x14(%rdi)
movl $0x70000580, 0x18(%rdi) # imm = 0x70000580
movabsq $0x200000000, %rcx      # imm = 0x200000000
movq %rcx, 0x30(%rdi)
movl %eax, 0x38(%rdi)
movq %rax, 0x60(%rdi)
leaq 0x16c(%rdi), %rax
movq 0x6a75(%rip), %rcx      # 0x8210
movb 0x16c(%rdi), %dl
cmpb (%rcx), %dl
je 0x17ac
movb $0x1, 0x19d(%rdi)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movb $0x0, 0x19c(%rdi)
cmpl $0x0, (%rdi)
jle 0x1819
xorl %eax, %eax
movslq 0x4(%rdi), %rcx
movslq %eax, %rdx
imulq %rcx, %rdx
shlq $0x2, %rdx
addq 0x28(%rdi), %rdx
movq 0x20(%rdi), %rcx
movq %rdx, (%rcx,%rax,8)
cmpl $0x0, 0x4(%rdi)
jle 0x180e
xorl %ecx, %ecx
movq 0x20(%rdi), %rdx
movq (%rdx,%rax,8), %rdx
movl $0x70000020, (%rdx,%rcx,4) # imm = 0x70000020
incq %rcx
movslq 0x4(%rdi), %rdx
cmpq %rdx, %rcx
jl 0x17f3
incq %rax
movslq (%rdi), %rcx
cmpq %rcx, %rax
jl 0x17d0
movl 0x8(%rdi), %eax
movl 0xc(%rdi), %ecx
movl %eax, 0x3c(%rdi)
movl %ecx, 0x40(%rdi)
movl %eax, 0x44(%rdi)
movl %ecx, 0x48(%rdi)
movzwl 0x18(%rdi), %eax
andl $0x40, %eax
movl %eax, 0x4c(%rdi)
movzwl 0x1a(%rdi), %eax
movw %ax, 0x50(%rdi)
movl 0x30(%rdi), %eax
movl %eax, 0x54(%rdi)
movq 0x34(%rdi), %rax
movq %rax, 0x58(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/term.c
// Function: addchar
static void
addchar(Term *term, uint16_t code)
{
    Cell cell = (Cell) {code, term->attr, term->pair};
    if (term->col >= term->cols) {
        if (term->mode & M_AUTOWRAP) {
            term->col = 0;
            if (term->row < term->bot)
                term->row++;
            else
                scroll_down(term);
        } else {
            term->col = term->cols - 1;
        }
    }
    if (!within_bounds(term, term->row, term->col))
        return;
    if (term->mode & M_INSERT) {
        Cell next;
        int col;
        for (col = term->col; col < term->cols; col++) {
            next = term->addr[term->row][col];
            term->addr[term->row][col] = cell;
            cell = next;
        }
    } else {
        term->addr[term->row][term->col] = cell;
    }
    term->col++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movb 0x1a(%rdi), %r14b
movb 0x1b(%rdi), %r15b
movl 0x4(%rdi), %eax
cmpl %eax, 0xc(%rdi)
jl 0x27ec
testb $-0x80, 0x18(%rbx)
jne 0x27ce
decl %eax
movl %eax, 0xc(%rbx)
jmp 0x27ec
movl $0x0, 0xc(%rbx)
movl 0x8(%rbx), %eax
cmpl 0x14(%rbx), %eax
jge 0x27e4
incl %eax
movl %eax, 0x8(%rbx)
jmp 0x27ec
movq %rbx, %rdi
callq 0x2a29
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movq %rbx, %rdi
callq 0x2ab2
testl %eax, %eax
je 0x286c
testb $0x2, 0x18(%rbx)
jne 0x2824
movq 0x20(%rbx), %rax
movslq 0x8(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movslq 0xc(%rbx), %rcx
movw %bp, (%rax,%rcx,4)
movb %r14b, 0x2(%rax,%rcx,4)
movb %r15b, 0x3(%rax,%rcx,4)
jmp 0x2869
movslq 0xc(%rbx), %rax
cmpl 0x4(%rbx), %eax
jge 0x2869
movq 0x20(%rbx), %rcx
movslq 0x8(%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
movzwl (%rcx,%rax,4), %edx
movb 0x2(%rcx,%rax,4), %sil
movb 0x3(%rcx,%rax,4), %dil
movw %bp, (%rcx,%rax,4)
movb %r14b, 0x2(%rcx,%rax,4)
movb %r15b, 0x3(%rcx,%rax,4)
incq %rax
movslq 0x4(%rbx), %rcx
movl %edx, %ebp
movl %esi, %r14d
movl %edi, %r15d
cmpq %rcx, %rax
jl 0x282d
incl 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/term.c
// Function: do_linux_osc
static int
do_linux_osc(Term *term)
{
    int i;
    uint8_t buf[4] = {0,0,0,0};
    if (term->partial[0] == 'R')
    {
        if (memcmp(term->plt, def_plt, sizeof(term->plt) != 0))
            term->plt_dirty = 1;
        memcpy(term->plt, def_plt, sizeof(term->plt));
        term->plt_local = 0;
        return 1;
    }
    if (term->partial[0] != 'P' || term->parlen != 8)
        return 0;

    for (i=1; i<8; i++) {
        /* isxdigit is locale broken */
        int ch = term->partial[i];
        if (ch >= '0' && ch <= '9')
            buf[i>>1] = (buf[i>>1] << 4) + (ch - '0');
        else if (ch >= 'a' && ch <= 'f')
            buf[i>>1] = (buf[i>>1] << 4) + (ch - 'a' + 10);
        else if (ch >= 'A' && ch <= 'F')
            buf[i>>1] = (buf[i>>1] << 4) + (ch - 'A' + 10);
        else
            return 0;
    }
    for(i=0; i<3; i++) {
        if (term->plt[buf[0]*3+i] != buf[i+1]) {
            term->plt[buf[0]*3+i] = buf[i+1];
            term->plt_local = term->plt_dirty = 1;
        }
    }

    return 1;
}

// Assembly:
movl $0x0, -0x4(%rsp)
movzbl 0x6c(%rdi), %ecx
xorl %eax, %eax
cmpl $0x50, %ecx
je 0x297a
cmpl $0x52, %ecx
jne 0x2a25
leaq 0x16c(%rdi), %rax
movq 0x58c9(%rip), %rcx      # 0x8210
movb 0x16c(%rdi), %dl
cmpb (%rcx), %dl
je 0x2958
movb $0x1, 0x19d(%rdi)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movb $0x0, 0x19c(%rdi)
jmp 0x2a20
cmpl $0x8, 0x64(%rdi)
jne 0x2a25
xorl %eax, %eax
movb 0x6d(%rdi,%rax), %cl
incq %rax
leal -0x30(%rcx), %edx
cmpb $0x9, %dl
ja 0x29ac
movl %eax, %ecx
shrl %ecx
movb -0x4(%rsp,%rcx), %sil
shlb $0x4, %sil
orb %dl, %sil
movb %sil, -0x4(%rsp,%rcx)
jmp 0x29e8
leal -0x61(%rcx), %edx
cmpb $0x5, %dl
ja 0x29c9
movl %eax, %edx
shrl %edx
movb -0x4(%rsp,%rdx), %sil
shlb $0x4, %sil
addb %sil, %cl
addb $-0x57, %cl
jmp 0x29e4
leal -0x41(%rcx), %edx
cmpb $0x5, %dl
ja 0x2a26
movl %eax, %edx
shrl %edx
movb -0x4(%rsp,%rdx), %sil
shlb $0x4, %sil
addb %sil, %cl
addb $-0x37, %cl
movb %cl, -0x4(%rsp,%rdx)
cmpq $0x7, %rax
jne 0x2986
movzbl -0x4(%rsp), %eax
leaq (%rax,%rax,2), %rax
addq %rdi, %rax
addq $0x16c, %rax            # imm = 0x16C
xorl %ecx, %ecx
movb -0x3(%rsp,%rcx), %dl
cmpb %dl, (%rax,%rcx)
je 0x2a17
movb %dl, (%rax,%rcx)
movw $0x101, 0x19c(%rdi)     # imm = 0x101
incq %rcx
cmpq $0x3, %rcx
jne 0x2a02
movl $0x1, %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/term.c
// Function: scroll_down
static void
scroll_down(Term *term)
{
    int row, col;
    Cell *addr;

    if (!within_bounds(term, term->top, 0))
        return;
    if (!within_bounds(term, term->bot, 0))
        return;
    addr = term->addr[term->top];
    for (row = term->top; row < term->bot; row++)
        term->addr[row] = term->addr[row+1];
    term->addr[term->bot] = addr;
    for (col = 0; col < term->cols; col++)
        term->addr[term->bot][col] = BLANK;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x10(%rdi), %esi
xorl %edx, %edx
callq 0x2ab2
testl %eax, %eax
je 0x2ab0
movl 0x14(%rbx), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2ab2
testl %eax, %eax
je 0x2ab0
movq 0x20(%rbx), %rax
movslq 0x10(%rbx), %rdx
movq (%rax,%rdx,8), %rax
movslq 0x14(%rbx), %rcx
cmpl %ecx, %edx
jge 0x2a79
movq 0x20(%rbx), %rsi
movq 0x8(%rsi,%rdx,8), %rdi
movq %rdi, (%rsi,%rdx,8)
leaq 0x1(%rdx), %rsi
movq %rsi, %rdx
cmpq %rsi, %rcx
jne 0x2a60
movq 0x20(%rbx), %rdx
movq %rax, (%rdx,%rcx,8)
cmpl $0x0, 0x4(%rbx)
jle 0x2ab0
xorl %eax, %eax
movq 0x20(%rbx), %rcx
movslq 0x14(%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
movzwl 0x1a(%rbx), %edx
movw $0x20, (%rcx,%rax,4)
movw %dx, 0x2(%rcx,%rax,4)
incq %rax
movslq 0x4(%rbx), %rcx
cmpq %rcx, %rax
jl 0x2a89
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/term.c
// Function: within_bounds
static int
within_bounds(Term *term, int row, int col)
{
    if (row < 0 || row >= term->rows || col < 0 || col > term->cols) {
        logfmt("position %d,%d is out of bounds %d,%d\n",
               row+1, col+1, term->rows, term->cols);
        return 0;
    } else {
        return 1;
    }
}

// Assembly:
pushq %rbx
testl %esi, %esi
js 0x2ac9
testl %edx, %edx
js 0x2ac9
cmpl %esi, (%rdi)
jle 0x2ac9
movl $0x1, %ebx
cmpl %edx, 0x4(%rdi)
jge 0x2ae3
incl %esi
incl %edx
movl (%rdi), %ecx
movl 0x4(%rdi), %r8d
leaq 0x2d4e(%rip), %rdi      # 0x5828
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2877
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/term.c
// Function: scroll_up
static void
scroll_up(Term *term)
{
    int row, col;
    Cell *addr;

    if (!within_bounds(term, term->top, 0))
        return;
    if (!within_bounds(term, term->bot, 0))
        return;
    addr = term->addr[term->bot];
    for (row = term->bot; row > term->top; row--)
        term->addr[row] = term->addr[row-1];
    term->addr[term->top] = addr;
    for (col = 0; col < term->cols; col++)
        term->addr[term->top][col] = BLANK;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x10(%rdi), %esi
xorl %edx, %edx
callq 0x2ab2
testl %eax, %eax
je 0x2b6a
movl 0x14(%rbx), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2ab2
testl %eax, %eax
je 0x2b6a
movq 0x20(%rbx), %rax
movslq 0x14(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x10(%rbx), %rdx
cmpl %edx, %ecx
jle 0x2b33
movq 0x20(%rbx), %rsi
movq -0x8(%rsi,%rcx,8), %rdi
movq %rdi, (%rsi,%rcx,8)
decq %rcx
cmpq %rdx, %rcx
jg 0x2b1e
movq 0x20(%rbx), %rcx
movq %rax, (%rcx,%rdx,8)
cmpl $0x0, 0x4(%rbx)
jle 0x2b6a
xorl %eax, %eax
movq 0x20(%rbx), %rcx
movslq 0x10(%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
movzwl 0x1a(%rbx), %edx
movw $0x20, (%rcx,%rax,4)
movw %dx, 0x2(%rcx,%rax,4)
incq %rax
movslq 0x4(%rbx), %rcx
cmpq %rcx, %rax
jl 0x2b43
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/term.c
// Function: fake_colour_256
static int
fake_colour_256(int colnum){
    int nr, ng, nb;
    if (colnum < 16) {
        nr = (colnum&1) ? 170:0;
        ng = (colnum&2) ? 170:0;
        nb = (colnum&4) ? 170:0;
        if (colnum&8) { nr += 85; ng += 85; nb += 85; }
        if (colnum == 3) ng = 85;
    } else if (colnum < 232) {
        int i = colnum - 16;
        nr = i / 36; ng = (i / 6) % 6; nb = i % 6;
        nr = nr ? nr * 40 + 55 : 0;
        ng = ng ? ng * 40 + 55 : 0;
        nb = nb ? nb * 40 + 55 : 0;
    } else if (colnum < 256) {
        int i = colnum - 232;
        nr = ng = nb = i * 10 + 8;
    } else
        nr=ng=nb = 127;

    return fake_colour_16m(nr, ng, nb);
}

// Assembly:
cmpl $0xf, %edi
jg 0x2d18
movl %edi, %ecx
andl $0x1, %ecx
negl %ecx
movl $0xaa, %eax
andl %eax, %ecx
movl %edi, %esi
shll $0x1e, %esi
sarl $0x1f, %esi
andl %eax, %esi
movl %edi, %r8d
shll $0x1d, %r8d
sarl $0x1f, %r8d
andl %eax, %r8d
leal 0x55(%rcx), %eax
leal 0x55(%rsi), %r9d
leal 0x55(%r8), %edx
testb $0x8, %dil
cmovel %r8d, %edx
cmovel %esi, %r9d
cmovel %ecx, %eax
cmpl $0x3, %edi
movl $0x55, %esi
cmovnel %r9d, %esi
jmp 0x2db9
cmpl $0xe7, %edi
jg 0x2d94
addl $-0x10, %edi
imulq $0x38e38e39, %rdi, %rax # imm = 0x38E38E39
shrq $0x23, %rax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rdi, %rcx
shrq $0x22, %rcx
imulq $0x2aaaaaab, %rcx, %rdx # imm = 0x2AAAAAAB
shrq $0x20, %rdx
addl %edx, %edx
leal (%rdx,%rdx,2), %edx
movl %ecx, %r8d
subl %edx, %r8d
addl %ecx, %ecx
leal (%rcx,%rcx,2), %ecx
movl %edi, %r9d
subl %ecx, %r9d
xorl %ecx, %ecx
cmpl $0x24, %edi
leal (%rax,%rax,4), %eax
leal 0x37(,%rax,8), %eax
cmovbl %ecx, %eax
testl %r8d, %r8d
leal (%r8,%r8,4), %ecx
leal 0x37(,%rcx,8), %esi
cmovel %r8d, %esi
testl %r9d, %r9d
leal (%r9,%r9,4), %ecx
leal 0x37(,%rcx,8), %edx
cmovel %r9d, %edx
jmp 0x2db9
movl $0x7f, %edx
movl $0x7f, %esi
movl $0x7f, %eax
cmpl $0xff, %edi
jg 0x2db9
leal (%rdi,%rdi,4), %eax
leal -0x908(,%rax,2), %edx
movl %edx, %esi
movl %edx, %eax
movl %eax, %edi
jmp 0x2dbd
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/term.c
// Function: fake_colour_16m
static int
fake_colour_16m(int red, int green, int blue)
{
    int av = (red+green+blue)/3;
    int palno = 1*(red>=av) + 2*(green>=av) + 4*(blue>=av);
    if (red==green && green==blue) {
        if (av > 212) palno = 15-8;
        else if (av > 127) palno = 7-8;
        else if (av > 42) palno = 8;
        else palno = 0;
    }
    return palno + 8*(av>127);
}

// Assembly:
pushq %rbx
leal (%rsi,%rdi), %eax
addl %edx, %eax
movslq %eax, %rcx
imulq $0x55555556, %rcx, %rbx # imm = 0x55555556
movq %rbx, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rbx
addl %ecx, %ebx
xorl %ecx, %ecx
cmpl %edx, %ebx
setle %r8b
xorl %r9d, %r9d
cmpl %esi, %ebx
setle %r11b
xorl %r10d, %r10d
cmpl %edi, %ebx
setle %bl
xorl %esi, %edi
xorl %edx, %esi
orl %edi, %esi
jne 0x2e22
movl $0x7, %ecx
cmpl $0x27e, %eax            # imm = 0x27E
jg 0x2e32
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x17f, %eax            # imm = 0x17F
jg 0x2e32
xorl %ecx, %ecx
cmpl $0x81, %eax
setge %cl
shll $0x3, %ecx
jmp 0x2e32
movb %bl, %r10b
movb %r11b, %r9b
leal (%r10,%r9,2), %edx
movb %r8b, %cl
leal (%rdx,%rcx,4), %ecx
xorl %edx, %edx
cmpl $0x180, %eax            # imm = 0x180
setge %dl
leal (%rcx,%rdx,8), %eax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/mbf.c
// Function: load_font
Font *
load_font(const char *fname)
{
    int fd;
    char sig[4];
    Header header;
    int stride;
    size_t ranges_size, data_size;
    Font *font;

    fd = open(fname, O_RDONLY);
    if (fd == -1)
        return NULL;
    read(fd, sig, sizeof(sig));
    if (memcmp(sig, (char []) {'M', 'B', 'F', 0x01}, sizeof(sig))) {
        close(fd);
        return NULL;
    }
    read(fd, &header, sizeof(header));
    /* stride = ceil(w / 8) = floor(w / 8) + (w % 8 ? 1 : 0) */
    stride = (header.w >> 3) + !!(header.w & 7);
    ranges_size = header.nr * sizeof(Range);
    data_size = header.ng * stride * header.h;
    font = malloc(sizeof(Font) + ranges_size + data_size);
    if (!font) {
        close(fd);
        return NULL;
    }
    font->stride = stride;
    font->header = header;
    font->ranges = (Range *) &font[1];
    read(fd, font->ranges, ranges_size);
    font->data = (uint8_t *) &font->ranges[header.nr];
    read(fd, font->data, data_size);
    close(fd);
    return font;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %r14d, %r14d
xorl %esi, %esi
xorl %eax, %eax
callq 0x1180
cmpl $-0x1, %eax
je 0x2f36
movl %eax, %ebx
leaq 0x14(%rsp), %r14
movl $0x4, %edx
movl %eax, %edi
movq %r14, %rsi
callq 0x10f0
movl $0x146424d, %eax        # imm = 0x146424D
movl %eax, 0x10(%rsp)
cmpl %eax, (%r14)
je 0x2e93
xorl %r14d, %r14d
jmp 0x2f2f
leaq 0xa(%rsp), %r14
movl $0x6, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x10f0
movzbl 0x2(%r14), %eax
movl %eax, %ebp
shrl $0x3, %ebp
andl $0x7, %eax
cmpl $0x1, %eax
sbbl $-0x1, %ebp
movzwl 0x4(%r14), %r15d
leal (,%r15,4), %r13d
movzwl (%r14), %eax
movzbl 0x3(%r14), %r12d
imull %eax, %r12d
imull %ebp, %r12d
leaq (%r12,%r13), %rdi
addq $0x20, %rdi
callq 0x1150
testq %rax, %rax
je 0x2e8b
movq %rax, %r14
movl %ebp, 0x8(%rax)
movl 0xa(%rsp), %eax
movl %eax, (%r14)
movzwl 0xe(%rsp), %eax
movw %ax, 0x4(%r14)
movq %r14, %rsi
addq $0x20, %rsi
movq %rsi, 0x10(%r14)
movl %ebx, %edi
movq %r13, %rdx
callq 0x10f0
shll $0x2, %r15d
addq 0x10(%r14), %r15
movq %r15, 0x18(%r14)
movl %ebx, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x10f0
movl %ebx, %edi
callq 0x10e0
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/mbf.c
// Function: search_glyph
int
search_glyph(Font *font, uint16_t code)
{
    int index, i;
    Range r;

    index = 0;
    for (i = 0; i < font->header.nr; i++) {
        r = font->ranges[i];
        if (code < r.offset)
            return -1;
        if (code < r.offset + r.length)
            return index + code - r.offset;
        index += r.length;
    }
    return -1;
}

// Assembly:
movzwl 0x4(%rdi), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rcx, %rcx
je 0x2f91
pushq %rbx
movq 0x10(%rdi), %r8
movzwl %si, %edx
xorl %r9d, %r9d
xorl %edi, %edi
movzwl (%r8,%r9,4), %r10d
cmpw %si, %r10w
ja 0x2f90
movzwl 0x2(%r8,%r9,4), %r11d
leal (%r11,%r10), %ebx
cmpl %edx, %ebx
ja 0x2f89
addl %r11d, %edi
incq %r9
cmpq %r9, %rcx
jne 0x2f63
jmp 0x2f90
addl %edx, %edi
subl %r10d, %edi
movl %edi, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/mbf.c
// Function: get_index
int
get_index(Font *font, uint16_t code)
{
    int index;
    uint16_t *cur_code;
    uint16_t codes[] = {code, 0xFFFD, 0x003F, 0x0020, 0};

    for (cur_code = &codes[0]; *cur_code; cur_code++) {
        index = search_glyph(font, *cur_code);
        if (index != -1)
            break;
    };
    return index;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movw %si, 0x6(%rsp)
movabsq $0x20003ffffd, %rax     # imm = 0x20003FFFFD
movq %rax, 0x8(%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %esi, %esi
je 0x2fe1
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movzwl %si, %esi
movq %r14, %rdi
callq 0x2f48
cmpl $-0x1, %eax
jne 0x2fdf
movzwl (%r15), %esi
addq $0x2, %r15
testw %si, %si
jne 0x2fc0
jmp 0x2fe1
movl %eax, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/gif.c
// Function: new_gif
GIF *
new_gif(const char *fname, uint16_t w, uint16_t h, uint8_t *gct, int loop)
{
    GIF *gif = calloc(1, sizeof(*gif) + 2*w*h);
    if (!gif)
        goto no_gif;
    gif->w = w; gif->h = h;
    gif->cur = (uint8_t *) &gif[1];
    gif->old = &gif->cur[w*h];
    /* fill back-buffer with invalid pixels to force overwrite */
    memset(gif->old, 0x10, w*h);
    gif->fd = creat(fname, 0666);
    if (gif->fd == -1)
        goto no_fd;
    write(gif->fd, "GIF89a", 6);
    write_num(gif->fd, w);
    write_num(gif->fd, h);
    write(gif->fd, (uint8_t []) {0xF3, 0x00, 0x00}, 3);
    write(gif->fd, gct, 0x30);
    if (loop >= 0 && loop <= 0xFFFF)
        put_loop(gif, (uint16_t) loop);
    return gif;
no_fd:
    free(gif);
no_gif:
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, 0x4(%rsp)
movq %rcx, %r14
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %r13
movl %esi, %ebp
imull %edx, %ebp
leal 0x130(,%rbp,2), %esi
movl $0x1, %edi
callq 0x1110
testq %rax, %rax
je 0x3165
movq %rax, %rbx
movw %r12w, (%rax)
movw %r15w, 0x2(%rax)
addq $0x130, %rax            # imm = 0x130
movq %rax, 0x10(%rbx)
leaq 0x130(%rbx,%rbp), %rdi
movq %rdi, 0x18(%rbx)
movl $0x10, %esi
movq %rbp, %rdx
callq 0x10c0
movq %r13, %rdi
movl $0x1b6, %esi            # imm = 0x1B6
callq 0x11e0
movl %eax, 0x4(%rbx)
cmpl $-0x1, %eax
je 0x315d
leaq 0x296b(%rip), %rsi      # 0x59e8
movl $0x6, %edx
movl %eax, %edi
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0xc(%rsp), %rsi
movw %r12w, (%rsi)
movl $0x2, %edx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0xa(%rsp), %rsi
movw %r15w, (%rsi)
movl $0x2, %edx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x12(%rsp), %rsi
movw $0xf3, (%rsi)
movb $0x0, 0x2(%rsi)
movl $0x3, %edx
callq 0x1080
movl 0x4(%rbx), %edi
movl $0x30, %edx
movq %r14, %rsi
callq 0x1080
movl 0x4(%rsp), %ebp
cmpl $0xffff, %ebp           # imm = 0xFFFF
ja 0x3167
movl 0x4(%rbx), %edi
leaq 0x15(%rsp), %rsi
movw $0xff21, (%rsi)         # imm = 0xFF21
movb $0xb, 0x2(%rsi)
movl $0x3, %edx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x28e0(%rip), %rsi      # 0x59f1
movl $0xb, %edx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x10(%rsp), %rsi
movw $0x103, (%rsi)          # imm = 0x103
movl $0x2, %edx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0xe(%rsp), %rsi
movw %bp, (%rsi)
movl $0x2, %edx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x28b2(%rip), %rsi      # 0x5a03
movl $0x1, %edx
callq 0x1080
jmp 0x3167
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/gif.c
// Function: new_trie
static Node *
new_trie(int *nkeys)
{
    Node *root = new_node(0);
    /* Create nodes for single pixels. */
    for (*nkeys = 0; *nkeys < 0x10; (*nkeys)++)
        root->children[*nkeys] = new_node(*nkeys);
    *nkeys += 2; /* skip clear code and stop code */
    return root;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, %edi
movl $0x88, %esi
callq 0x1110
movq %rax, %r14
testq %rax, %rax
je 0x361c
movw $0x0, (%r14)
xorl %r15d, %r15d
movl $0x1, %edi
movl $0x88, %esi
callq 0x1110
testq %rax, %rax
je 0x3637
movw %r15w, (%rax)
movq %rax, 0x8(%r14,%r15,8)
incq %r15
cmpq $0x10, %r15
jne 0x361f
movl $0x12, (%rbx)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/gif.c
// Function: put_key
static void
put_key(GIF *gif, uint16_t key, int key_size)
{
    int byte_offset, bit_offset, bits_to_write;
    byte_offset = gif->offset / 8;
    bit_offset = gif->offset % 8;
    gif->partial |= ((uint32_t) key) << bit_offset;
    bits_to_write = bit_offset + key_size;
    while (bits_to_write >= 8) {
        gif->buffer[byte_offset++] = gif->partial & 0xFF;
        if (byte_offset == 0xFF) {
            write(gif->fd, "\xFF", 1);
            write(gif->fd, gif->buffer, 0xFF);
            byte_offset = 0;
        }
        gif->partial >>= 8;
        bits_to_write -= 8;
    }
    gif->offset = (gif->offset + key_size) % (0xFF * 8);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x8(%rdi), %ecx
leal 0x7(%rcx), %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
movl %eax, %edi
andl $-0x8, %edi
subl %edi, %ecx
shll %cl, %esi
orl %esi, 0x28(%rbx)
movl %edx, %r14d
leal (%rcx,%r14), %edx
cmpl $0x8, %edx
jl 0x36d8
sarl $0x3, %eax
leaq 0x2d(%rbx), %r15
leal (%rcx,%r14), %ebp
addl $0x8, %ebp
leaq 0x236a(%rip), %r12      # 0x5a01
movb 0x28(%rbx), %cl
movslq %eax, %rdx
incl %eax
movb %cl, 0x2d(%rbx,%rdx)
cmpl $0xff, %eax
jne 0x36cc
movl 0x4(%rbx), %edi
movl $0x1, %edx
movq %r12, %rsi
callq 0x1080
movl 0x4(%rbx), %edi
movl $0xff, %edx
movq %r15, %rsi
callq 0x1080
xorl %eax, %eax
shrl $0x8, 0x28(%rbx)
addl $-0x8, %ebp
cmpl $0xf, %ebp
jg 0x3697
addl 0x8(%rbx), %r14d
movslq %r14d, %rax
imulq $-0x7f7f7f7f, %rax, %rcx # imm = 0x80808081
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0xa, %ecx
addl %edx, %ecx
imull $0x7f8, %ecx, %ecx      # imm = 0x7F8
subl %ecx, %eax
movl %eax, 0x8(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/gif.c
// Function: del_trie
static void
del_trie(Node *root)
{
    int i;

    if (!root)
        return;
    for (i = 0; i < 0x10; i++)
        del_trie(root->children[i]);
    free(root);
}

// Assembly:
testq %rdi, %rdi
je 0x373d
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %r14d
movq (%rbx,%r14,8), %rdi
callq 0x370a
incq %r14
cmpq $0x11, %r14
jne 0x371c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1030
retq
nop
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/main.c
// Function: get_pair
uint8_t
get_pair(Term *term, int row, int col)
{
    Cell cell;
    uint8_t fore, back;
    int inverse;

    inverse = term->mode & M_REVERSE;
    if (term->mode & M_CURSORVIS)
        inverse = term->row == row && term->col == col ? !inverse : inverse;
    cell = term->addr[row][col];
    inverse = cell.attr & A_INVERSE ? !inverse : inverse;
    fore = cell.pair >> 4;
    back = cell.pair & 0xF;
    if (cell.attr & (A_ITALIC | A_CROSSED))
        fore = 0x2;
    else if (cell.attr & A_UNDERLINE)
        fore = 0x6;
    else if (cell.attr & A_DIM)
        fore = 0x8;
    if (inverse) {
        uint8_t t;
        t = fore; fore = back; back = t;
    }
    if (cell.attr & A_BOLD)
        fore |= 0x8;
    if (cell.attr & A_BLINK)
        back |= 0x8;
    if ((cell.attr & A_INVISIBLE) != 0) fore = back;
    return (fore << 4) | (back & 0xF);
}

// Assembly:
movzwl 0x18(%rdi), %ecx
movl %ecx, %eax
andl $0x20, %eax
btl $0xa, %ecx
jae 0x375f
cmpl %esi, 0x8(%rdi)
jne 0x375f
cmpl %edx, 0xc(%rdi)
jne 0x375f
shrl $0x5, %eax
xorl $0x1, %eax
movq 0x20(%rdi), %rcx
movslq %esi, %rsi
movq (%rcx,%rsi,8), %rsi
movslq %edx, %rdx
movzbl 0x2(%rsi,%rdx,4), %ecx
movb 0x3(%rsi,%rdx,4), %dl
movb $0x2, %sil
testb $-0x7c, %cl
jne 0x379b
movb $0x6, %sil
testb $0x8, %cl
jne 0x379b
movl %edx, %esi
shrb $0x4, %sil
testb $0x2, %cl
movzbl %sil, %edi
movl $0x8, %esi
cmovel %edi, %esi
xorl %edi, %edi
testl %eax, %eax
sete %dil
testb $0x20, %cl
cmovel %eax, %edi
testl %edi, %edi
movzbl %dl, %eax
movzbl %sil, %edx
movl %edx, %esi
cmovel %eax, %esi
cmovel %edx, %eax
leal (,%rcx,8), %edx
orb %al, %dl
movl %ecx, %eax
shrb %al
andb $0x8, %al
orb %sil, %al
testb $0x40, %cl
movzbl %dl, %ecx
movzbl %al, %eax
cmovnel %eax, %ecx
shlb $0x4, %cl
andb $0xf, %al
orb %cl, %al
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/main.c
// Function: draw_char
void
draw_char(Font *font, GIF *gif, uint16_t code, uint8_t pair, int row, int col)
{
    int i, j;
    int x, y;
    int index;
    int pixel;
    uint8_t *strip;

    index = get_index(font, code);
    if (index == -1)
        return;
    strip = &font->data[font->stride * font->header.h * index];
    y = font->header.h * row;
    for (i = 0; i < font->header.h; i++) {
        x = font->header.w * col;
        for (j = 0; j < font->header.w; j++) {
            pixel = strip[j >> 3] & (1 << (7 - (j & 7)));
            gif->cur[y * gif->w + x] = pixel ? pair >> 4 : pair & 0xF;
            x++;
        }
        y++;
        strip += font->stride;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r9d, %ebx
movl %r8d, %ebp
movl %ecx, %r12d
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %esi
callq 0x2f92
cmpl $-0x1, %eax
je 0x38ab
cmpb $0x0, 0x3(%r15)
je 0x38ab
movzbl 0x3(%r15), %ecx
imull %ecx, %ebp
imull 0x8(%r15), %eax
imull %ecx, %eax
cltq
addq 0x18(%r15), %rax
movl %r12d, %esi
shrb $0x4, %sil
andb $0xf, %r12b
xorl %ecx, %ecx
movzbl %r12b, %edx
movzbl %sil, %esi
movzbl 0x2(%r15), %edi
testl %edi, %edi
je 0x3897
imull %ebx, %edi
movslq %edi, %rdi
movslq %ebp, %r8
xorl %r9d, %r9d
movl %r9d, %r10d
shrl $0x3, %r10d
movzbl (%rax,%r10), %r10d
movl %r9d, %r11d
notb %r11b
movzbl %r11b, %r11d
andl $0x7, %r11d
btl %r11d, %r10d
movl %esi, %r10d
cmovael %edx, %r10d
movzwl (%r14), %r11d
imulq %r8, %r11
addq 0x10(%r14), %r11
addq %rdi, %r11
movb %r10b, (%r9,%r11)
movzbl 0x2(%r15), %r10d
incq %r9
cmpl %r10d, %r9d
jb 0x3852
incl %ebp
movslq 0x8(%r15), %rdi
addq %rdi, %rax
incl %ecx
movzbl 0x3(%r15), %edi
cmpl %edi, %ecx
jb 0x383d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/main.c
// Function: render
void
render(Term *term, Font *font, GIF *gif, uint16_t delay)
{
    int i, j;
    uint16_t code;
    uint8_t pair;

    for (i = 0; i < term->rows; i++) {
        for (j = 0; j < term->cols; j++) {
            code = term->addr[i][j].code;
            pair = get_pair(term, i, j);
            draw_char(font, gif, code, pair, i, j);
        }
    }

    if (term->plt_local)
        gif->plt = term->plt;
    else
        gif->plt = 0;
    gif->plt_dirty |= term->plt_dirty;
    term->plt_dirty = 0;

    add_frame(gif, delay);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, 0x4(%rsp)
movq %rdx, %rbx
movq %rdi, %r14
cmpl $0x0, (%rdi)
jle 0x3926
movq %rsi, %r15
xorl %r12d, %r12d
cmpl $0x0, 0x4(%r14)
jle 0x391b
xorl %r13d, %r13d
movq 0x20(%r14), %rax
movq (%rax,%r12,8), %rax
movzwl (%rax,%r13,4), %ebp
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x3740
movzbl %al, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
movl %r12d, %r8d
movl %r13d, %r9d
callq 0x37e0
incq %r13
movslq 0x4(%r14), %rax
cmpq %rax, %r13
jl 0x38de
incq %r12
movslq (%r14), %rax
cmpq %rax, %r12
jl 0x38d4
xorl %eax, %eax
cmpb $0x0, 0x19c(%r14)
leaq 0x16c(%r14), %rcx
cmovneq %rcx, %rax
movq %rax, 0x20(%rbx)
movb 0x19d(%r14), %al
orb %al, 0x2c(%rbx)
movb $0x0, 0x19d(%r14)
movzwl 0x4(%rsp), %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3179
// File: /workspace/github_c_makefile_star2_O1/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: punchLeader
void punchLeader( int count )
{
  int ix;

  /* If value is zero, set to the default of 2 feet of leader.                */
  count = ( count == 0 ) ? 240 : count;

  if( objectfile != NULL )
  {
    for( ix = 0; ix < count; ix++ )
    {
      fputc( 0200, objectfile );
    }
  }
}

// Assembly:
pushq %rbx
testl %edi, %edi
movl $0xf0, %ebx
cmovnel %edi, %ebx
cmpq $0x0, 0x7fff(%rip)      # 0xb4b0
sete %al
testl %ebx, %ebx
setle %cl
orb %al, %cl
jne 0x34d2
movq 0x7fec(%rip), %rsi      # 0xb4b0
movl $0x80, %edi
callq 0x20e0
decl %ebx
jne 0x34bd
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: punchChecksum
void punchChecksum()
{
  /* If the assembler has output any BIN data output the checksum.            */
  if( binary_data_output && !rim_mode )
  {
    punchLocObject( 0, checksum );
  }
  binary_data_output = FALSE;
  checksum = 0;
}

// Assembly:
cmpb $0x0, 0x7e6d(%rip)      # 0xb348
je 0x34f9
cmpb $0x0, 0x7e69(%rip)      # 0xb34d
jne 0x34f9
pushq %rax
movswl 0x7f22(%rip), %esi      # 0xb410
xorl %edi, %edi
callq 0x69fc
addq $0x8, %rsp
movb $0x0, 0x7e48(%rip)      # 0xb348
movw $0x0, 0x7f07(%rip)      # 0xb410
retq
// File: /workspace/github_c_makefile_star2_O1/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: printPermanentSymbolTable
void printPermanentSymbolTable()
{
  int     ix;
  FILE   *permfile;
  char  *s_type;

  if(( permfile = fopen( permpathname, "w" )) == NULL )
  {
    exit( 2 );
  }

  fprintf( permfile, "/ PERMANENT SYMBOL TABLE\n/\n" );
  fprintf( permfile, "        EXPUNGE\n/\n" );
  /* Print the memory reference instructions first.                           */
  s_type = "FIXMRI";
  for( ix = 0; ix < symbol_top; ix++ )
  {
    if( M_MRI( symtab[ix].type ))
    {
      fprintf( permfile, "%-7s %s=%4.4o\n",
                                    s_type, symtab[ix].name, symtab[ix].val );
    }
  }

  s_type = " ";
  for( ix = 0; ix < symbol_top; ix++ )
  {
    if( M_FIXED( symtab[ix].type ))
    {
      if( !M_MRI( symtab[ix].type ) && !M_PSEUDO( symtab[ix].type ))
      {
        fprintf( permfile, "%-7s %s=%4.4o\n",
                                    s_type, symtab[ix].name, symtab[ix].val );
      }
    }
  }
  fprintf( permfile, "/\n        FIXTAB\n" );
  fclose( permfile );
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x7eb0(%rip), %rdi      # 0xb560
leaq 0x3d53(%rip), %rsi      # 0x740a
callq 0x2160
testq %rax, %rax
je 0x37f3
movq %rax, %rbx
leaq 0x42ae(%rip), %rdi      # 0x797d
movl $0x1b, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x21a0
leaq 0x42b1(%rip), %rdi      # 0x7999
movl $0x12, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21a0
cmpl $0x0, 0x7cff(%rip)      # 0xb400
jle 0x3759
leaq 0x42a9(%rip), %r14      # 0x79b3
leaq 0x429b(%rip), %r15      # 0x79ac
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x7cda(%rip), %rax      # 0xb3f8
movl (%rax,%r12), %ecx
notl %ecx
testb $0x5, %cl
jne 0x3746
leaq (%rax,%r12), %rcx
addq $0x4, %rcx
movswl 0x8(%rcx), %r8d
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2120
incq %r13
movslq 0x7cb0(%rip), %rax      # 0xb400
addq $0x18, %r12
cmpq %rax, %r13
jl 0x3717
cmpl $0x0, 0x7ca0(%rip)      # 0xb400
jle 0x37c9
leaq 0x424a(%rip), %r14      # 0x79b3
leaq 0x418d(%rip), %r15      # 0x78fd
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x7c7b(%rip), %rax      # 0xb3f8
movl (%rax,%r12), %ecx
movl %ecx, %edx
notl %edx
testb $0x43, %dl
je 0x37b6
movl %ecx, %edx
andl $0x2, %edx
je 0x37b6
andl $0x5, %ecx
cmpl $0x5, %ecx
je 0x37b6
leaq (%rax,%r12), %rcx
addq $0x4, %rcx
movswl 0x8(%rcx), %r8d
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2120
incq %r13
movslq 0x7c40(%rip), %rax      # 0xb400
addq $0x18, %r12
cmpq %rax, %r13
jl 0x3776
leaq 0x41f2(%rip), %rdi      # 0x79c2
movl $0x11, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x21a0
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2090
movl $0x2, %edi
callq 0x2190
// File: /workspace/github_c_makefile_star2_O1/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: nextLexeme
void nextLexeme()
{
  /* Save start column of previous lexeme for diagnostic messages.            */
  lexstartprev = lexstart;
  lextermprev = lexterm;

  while( is_blank( line[cc] )) { cc++; }
  lexstart = cc;

  if( isalnum( line[cc] ))
  {
    while( isalnum( line[cc] )) { cc++; }
  }
  else if( isend( line[cc] ))
  {
    /* End-of-Line, don't advance cc!                                         */
  }
  else
  {
    switch( line[cc] )
    {
    case '"':     /* Quoted letter                                            */
      if( cc + 2 < maxcc )
      {
        cc++;
        cc++;
      }
      else
      {
        errorMessage( &no_literal_value, lexstart );
        cc++;
      }
      break;

    case '/':     /* Comment, don't advance cc!                               */
      break;

    default:      /* All other punctuation.                                   */
      cc++;
      break;
    }
  }
  lexterm = cc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl 0x9c85(%rip), %eax      # 0xd814
movl %eax, 0x9c8f(%rip)      # 0xd824
movl 0x9c81(%rip), %eax      # 0xd81c
movl %eax, 0x9e7f(%rip)      # 0xda20
movslq 0x9c84(%rip), %rbx      # 0xd82c
leaq 0x9be1(%rip), %r14      # 0xd790
movq %rbx, %rax
addq %r14, %rax
movabsq $0x4000000100001200, %rcx # imm = 0x4000000100001200
movzbl (%rax), %edx
cmpq $0x3e, %rdx
ja 0x3bdb
btq %rdx, %rcx
jae 0x3bdb
incl %ebx
movl %ebx, 0x9c56(%rip)      # 0xd82c
incq %rax
jmp 0x3bbf
movsbq %dl, %r15
movl %ebx, 0x9c2f(%rip)      # 0xd814
callq 0x21c0
movq (%rax), %rcx
testb $0x8, (%rcx,%r15,2)
jne 0x3c08
movzbl %r15b, %eax
cmpl $0x21, %eax
jg 0x3c33
testl %eax, %eax
je 0x3c6a
cmpl $0xa, %eax
je 0x3c6a
jmp 0x3c60
movl 0x9c1e(%rip), %eax      # 0xd82c
movslq %eax, %rdx
movsbq (%rdx,%r14), %rsi
testb $0x8, (%rcx,%rsi,2)
je 0x3c6a
addq %r14, %rdx
incq %rdx
movsbq (%rdx), %rsi
incl %eax
incq %rdx
testb $0x8, (%rcx,%rsi,2)
jne 0x3c22
jmp 0x3c64
cmpl $0x2f, %eax
je 0x3c6a
cmpl $0x22, %eax
jne 0x3c60
leal 0x2(%rbx), %eax
cmpl 0x9bea(%rip), %eax      # 0xd830
jl 0x3c64
leaq 0x7649(%rip), %rdi      # 0xb298
movl %ebx, %esi
callq 0x5ab5
movl 0x9bd0(%rip), %eax      # 0xd82c
incl %eax
jmp 0x3c64
incl %ebx
movl %ebx, %eax
movl %eax, 0x9bc2(%rip)      # 0xd82c
movl 0x9bbc(%rip), %eax      # 0xd82c
movl %eax, 0x9ba6(%rip)      # 0xd81c
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: endOfBinary
void endOfBinary()
{
  /* Punch page 0 also.                                   */
  punchLiteralPool( cp, 1 );
  if( error_in_line )
  {
    listed = TRUE;
    clc = ( clc & 070000 ) + (( clc - 1 ) & 07777 );
    errorMessage( &end_of_file, -1 );
    clc = ( clc & 070000 ) + (( clc + 1 ) & 07777 );
  }
  else
  {
    listLine();             /* List line if not done yet.                     */
  }
  return;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
leaq 0x79da(%rip), %rdi      # 0xb660
movl $0x1, %esi
callq 0x3f8c
cmpb $0x0, 0x9b81(%rip)      # 0xd818
je 0x3cf0
movb $0x1, 0x9ac8(%rip)      # 0xd768
movzwl 0x9ab9(%rip), %eax      # 0xd760
movl $0x7000, %ebx           # imm = 0x7000
movl %eax, %ecx
andl %ebx, %ecx
decl %eax
movl $0xfff, %ebp            # imm = 0xFFF
andl %ebp, %eax
orl %ecx, %eax
movw %ax, 0x9a9e(%rip)       # 0xd760
leaq 0x758f(%rip), %rdi      # 0xb258
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5ab5
movzwl 0x9a86(%rip), %eax      # 0xd760
andl %eax, %ebx
incl %eax
andl %ebp, %eax
orl %ebx, %eax
movw %ax, 0x9a77(%rip)       # 0xd760
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x6796