LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movslq %edi, %r15
movl %r15d, %eax
imull %esi, %eax
cltq
shlq $0x2, %rax
leaq (%rax,%r15,8), %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
callq 0x1150
movq %rax, %r14
testq %rax, %rax
je 0x15ea
movl %r15d, (%r14)
movl %ebx, 0x4(%r14)
leaq 0x1a0(%r14), %rax
movq %rax, 0x20(%r14)
leaq (%r14,%r15,8), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movq %rax, 0x28(%r14)
movq %r14, %rdi
callq 0x15f3
movb $0x0, 0x19d(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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:
andq $0x0, 0x8(%rdi)
andl $0x0, 0x10(%rdi)
movl (%rdi), %ecx
leal -0x1(%rcx), %eax
movl %eax, 0x14(%rdi)
movl $0x70000580, 0x18(%rdi) # imm = 0x70000580
movabsq $0x200000000, %rax      # imm = 0x200000000
movq %rax, 0x30(%rdi)
andl $0x0, 0x38(%rdi)
andq $0x0, 0x60(%rdi)
leaq 0x16c(%rdi), %rax
movq 0x5be0(%rip), %rdx      # 0x7210
movb 0x16c(%rdi), %sil
cmpb (%rdx), %sil
je 0x1643
movb $0x1, 0x19d(%rdi)
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups 0x20(%rdx), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movb $0x0, 0x19c(%rdi)
xorl %eax, %eax
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x16ad
movl 0x4(%rdi), %ecx
movl %eax, %edx
imull %ecx, %edx
movslq %edx, %rdx
shlq $0x2, %rdx
addq 0x28(%rdi), %rdx
movq 0x20(%rdi), %rsi
movq %rdx, (%rsi,%rax,8)
xorl %edx, %edx
movslq %ecx, %rcx
cmpq %rcx, %rdx
jge 0x16a6
movq 0x20(%rdi), %rcx
movq (%rcx,%rax,8), %rcx
movl $0x70000020, (%rcx,%rdx,4) # imm = 0x70000020
incq %rdx
movl 0x4(%rdi), %ecx
jmp 0x1687
incq %rax
movl (%rdi), %ecx
jmp 0x1662
movq 0x8(%rdi), %rax
movq %rax, 0x3c(%rdi)
jmp 0x281c
// File: /workspace/github_c_makefile_star2_O2/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), %r15b
movb 0x1b(%rdi), %r14b
movl 0x4(%rdi), %eax
movl 0xc(%rdi), %edx
cmpl %eax, %edx
jl 0x25dc
testb $-0x80, 0x18(%rbx)
jne 0x25bc
decl %eax
movl %eax, 0xc(%rbx)
movl %eax, %edx
jmp 0x25dc
andl $0x0, 0xc(%rbx)
movl 0x8(%rbx), %eax
cmpl 0x14(%rbx), %eax
jge 0x25d1
incl %eax
movl %eax, 0x8(%rbx)
xorl %edx, %edx
jmp 0x25dc
movq %rbx, %rdi
callq 0x2845
movl 0xc(%rbx), %edx
movl 0x8(%rbx), %esi
movq %rbx, %rdi
callq 0x28c0
testl %eax, %eax
je 0x2612
testb $0x2, 0x18(%rbx)
jne 0x261d
movq 0x20(%rbx), %rax
movslq 0x8(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movslq 0xc(%rbx), %rcx
movw %bp, (%rax,%rcx,4)
movb %r15b, 0x2(%rax,%rcx,4)
movb %r14b, 0x3(%rax,%rcx,4)
incl 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movslq 0xc(%rbx), %rax
movslq 0x4(%rbx), %rcx
cmpq %rcx, %rax
jge 0x260f
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 %r15b, 0x2(%rcx,%rax,4)
movb %r14b, 0x3(%rcx,%rax,4)
incq %rax
movl %edi, %r14d
movl %esi, %r15d
movl %edx, %ebp
jmp 0x2621
// File: /workspace/github_c_makefile_star2_O2/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:
andl $0x0, -0x4(%rsp)
movzbl 0x6c(%rdi), %ecx
xorl %eax, %eax
cmpl $0x50, %ecx
je 0x2764
cmpl $0x52, %ecx
jne 0x2818
leaq 0x16c(%rdi), %rax
movq 0x4ae4(%rip), %rcx      # 0x7210
movb 0x16c(%rdi), %dl
cmpb (%rcx), %dl
je 0x273d
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)
movl $0x1, %eax
jmp 0x2818
cmpl $0x8, 0x64(%rdi)
jne 0x2818
xorl %eax, %eax
cmpq $0x7, %rax
je 0x27da
movb 0x6d(%rdi,%rax), %cl
incq %rax
leal -0x30(%rcx), %edx
cmpb $0x9, %dl
ja 0x279c
movl %eax, %ecx
shrl %ecx
movb -0x4(%rsp,%rcx), %sil
shlb $0x4, %sil
orb %dl, %sil
movb %sil, -0x4(%rsp,%rcx)
jmp 0x2770
leal -0x61(%rcx), %edx
cmpb $0x5, %dl
ja 0x27b9
movl %eax, %edx
shrl %edx
movb -0x4(%rsp,%rdx), %sil
shlb $0x4, %sil
addb %sil, %cl
addb $-0x57, %cl
jmp 0x27d4
leal -0x41(%rcx), %edx
cmpb $0x5, %dl
ja 0x2819
movl %eax, %edx
shrl %edx
movb -0x4(%rsp,%rdx), %sil
shlb $0x4, %sil
addb %sil, %cl
addb $-0x37, %cl
movb %cl, -0x4(%rsp,%rdx)
jmp 0x2770
movzbl -0x4(%rsp), %eax
leaq (%rax,%rax,2), %rax
leaq (%rdi,%rax), %rcx
addq $0x16c, %rcx            # imm = 0x16C
xorl %edx, %edx
movl $0x1, %eax
cmpq $0x3, %rdx
je 0x2818
movb -0x3(%rsp,%rdx), %sil
cmpb %sil, (%rcx,%rdx)
je 0x2813
movb %sil, (%rcx,%rdx)
movw $0x101, 0x19c(%rdi)     # imm = 0x101
incq %rdx
jmp 0x27f5
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/lecram[P]congif/term.c
// Function: save_misc
static void
save_misc(Term *term)
{
    term->save_misc.row = term->row;
    term->save_misc.col = term->col;
    term->save_misc.origin_on = term->mode & M_ORIGIN;
    term->save_misc.attr = term->attr;
    term->save_misc.pair = term->pair;
    term->save_misc.cs_array[0] = term->cs_array[0];
    term->save_misc.cs_array[1] = term->cs_array[1];
    term->save_misc.cs_index = term->cs_index;
}

// Assembly:
movq 0x8(%rdi), %rax
movq %rax, 0x44(%rdi)
movzwl 0x18(%rdi), %eax
andl $0x40, %eax
movl %eax, 0x4c(%rdi)
movzwl 0x1a(%rdi), %eax
movw %ax, 0x50(%rdi)
movq 0x30(%rdi), %rax
movq %rax, 0x54(%rdi)
movl 0x38(%rdi), %eax
movl %eax, 0x5c(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x28c0
testl %eax, %eax
je 0x28be
movl 0x14(%rbx), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x28c0
testl %eax, %eax
je 0x28be
movq 0x20(%rbx), %rax
movslq 0x10(%rbx), %rdx
movq (%rax,%rdx,8), %rax
movslq 0x14(%rbx), %rcx
movq 0x20(%rbx), %rsi
cmpq %rcx, %rdx
jge 0x288f
movq 0x8(%rsi,%rdx,8), %rdi
movq %rdi, (%rsi,%rdx,8)
incq %rdx
jmp 0x2878
movq %rax, (%rsi,%rcx,8)
xorl %eax, %eax
movslq 0x4(%rbx), %rcx
cmpq %rcx, %rax
jge 0x28be
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
jmp 0x2895
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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
movl (%rdi), %ecx
testl %esi, %esi
js 0x28dc
cmpl %esi, %ecx
setle %al
testl %edx, %edx
sets %r8b
orb %al, %r8b
jne 0x28dc
cmpl %edx, 0x4(%rdi)
jge 0x28f8
incl %esi
incl %edx
movl 0x4(%rdi), %r8d
leaq 0x1f3d(%rip), %rdi      # 0x4828
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x265f
movl %ebx, %eax
popq %rbx
retq
pushq $0x1
popq %rbx
jmp 0x28f4
// File: /workspace/github_c_makefile_star2_O2/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 0x28c0
testl %eax, %eax
je 0x2976
movl 0x14(%rbx), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x28c0
testl %eax, %eax
je 0x2976
movq 0x20(%rbx), %rax
movslq 0x14(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x10(%rbx), %rdx
movq 0x20(%rbx), %rsi
cmpq %rdx, %rcx
jle 0x2947
movq -0x8(%rsi,%rcx,8), %rdi
movq %rdi, (%rsi,%rcx,8)
decq %rcx
jmp 0x2930
movq %rax, (%rsi,%rdx,8)
xorl %eax, %eax
movslq 0x4(%rbx), %rcx
cmpq %rcx, %rax
jge 0x2976
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
jmp 0x294d
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2b1e
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 0x2b92
cmpl $0xe7, %edi
ja 0x2b76
pushq %rbx
addl $-0x10, %edi
movzbl %dil, %ecx
movb $0x24, %dl
movl %ecx, %eax
divb %dl
movzbl %al, %edx
movb $0x6, %sil
movl %ecx, %eax
divb %sil
movzbl %ah, %ecx
movzbl %al, %eax
divb %sil
movzbl %ah, %ebx
imull $0x28, %edx, %eax
addl $0x37, %eax
xorl %r8d, %r8d
cmpl $0x24, %edi
cmovbl %r8d, %eax
imull $0x28, %ebx, %esi
addl $0x37, %esi
testb %bl, %bl
cmovel %r8d, %esi
imull $0x28, %ecx, %edx
addl $0x37, %edx
testb %cl, %cl
cmovel %r8d, %edx
popq %rbx
jmp 0x2b92
cmpl $0xff, %edi
ja 0x2b89
imull $0xa, %edi, %edx
addl $0xfffff6f8, %edx       # imm = 0xFFFFF6F8
jmp 0x2b8e
movl $0x7f, %edx
movl %edx, %esi
movl %edx, %eax
movl %eax, %edi
jmp 0x2b96
// File: /workspace/github_c_makefile_star2_O2/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
movl %edx, %r8d
leal (%rsi,%rdi), %ecx
addl %edx, %ecx
movl $0x3, %r9d
movl %ecx, %eax
cltd
idivl %r9d
xorl %edx, %edx
cmpl %r8d, %eax
setle %r9b
xorl %r10d, %r10d
cmpl %esi, %eax
setle %bl
xorl %r11d, %r11d
cmpl %edi, %eax
setle %al
xorl %esi, %edi
xorl %r8d, %esi
orl %edi, %esi
jne 0x2bdc
cmpl $0x27e, %ecx            # imm = 0x27E
jle 0x2bfc
movl $0x7, %eax
jmp 0x2bec
movb %al, %r11b
movb %bl, %r10b
leal (%r11,%r10,2), %eax
movb %r9b, %dl
leal (%rax,%rdx,4), %eax
xorl %edx, %edx
cmpl $0x180, %ecx            # imm = 0x180
setge %dl
leal (%rax,%rdx,8), %eax
popq %rbx
retq
cmpl $0x17f, %ecx            # imm = 0x17F
jle 0x2c0b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x2bec
xorl %eax, %eax
cmpl $0x81, %ecx
setge %al
shll $0x3, %eax
jmp 0x2bec
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x2d0a
movl %eax, %ebx
leaq 0x14(%rsp), %r14
pushq $0x4
popq %rdx
movl %eax, %edi
movq %r14, %rsi
callq 0x10f0
movl $0x146424d, %eax        # imm = 0x146424D
movl %eax, 0x10(%rsp)
cmpl %eax, (%r14)
je 0x2c69
xorl %r14d, %r14d
jmp 0x2d03
leaq 0xa(%rsp), %r14
pushq $0x6
popq %rdx
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 0x2c61
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_O2/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
xorl %r8d, %r8d
pushq $-0x1
popq %rax
xorl %edx, %edx
cmpq %r8, %rcx
je 0x2d5a
movq 0x10(%rdi), %r10
movzwl (%r10,%r8,4), %r9d
cmpw %si, %r9w
ja 0x2d5a
movzwl 0x2(%r10,%r8,4), %r10d
leal (%r10,%r9), %r11d
cmpl %esi, %r11d
ja 0x2d53
addl %r10d, %edx
incq %r8
jmp 0x2d28
addl %esi, %edx
subl %r9d, %edx
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x6(%rsp), %r14
movw %si, (%r14)
movabsq $0x20003ffffd, %rax     # imm = 0x20003FFFFD
movq %rax, 0x2(%r14)
pushq $-0x1
popq %rbp
movzwl (%r14), %eax
testw %ax, %ax
je 0x2d9f
movzwl %ax, %esi
movq %rbx, %rdi
callq 0x2d1c
addq $0x2, %r14
cmpl $-0x1, %eax
je 0x2d80
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
callq 0x1110
testq %rax, %rax
je 0x2f11
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)
pushq $0x10
popq %rsi
movq %rbp, %rdx
callq 0x10c0
movq %r13, %rdi
movl $0x1b6, %esi            # imm = 0x1B6
callq 0x11e0
movl %eax, 0x4(%rbx)
cmpl $-0x1, %eax
je 0x2f09
leaq 0x1bb3(%rip), %rsi      # 0x49e8
pushq $0x6
popq %rdx
movl %eax, %edi
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0xc(%rsp), %rsi
movw %r12w, (%rsi)
pushq $0x2
popq %r12
movq %r12, %rdx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0xa(%rsp), %rsi
movw %r15w, (%rsi)
movq %r12, %rdx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x12(%rsp), %rsi
movw $0xf3, (%rsi)
movb $0x0, 0x2(%rsi)
pushq $0x3
popq %rdx
callq 0x1080
movl 0x4(%rbx), %edi
pushq $0x30
popq %rdx
movq %r14, %rsi
callq 0x1080
movl 0x4(%rsp), %ebp
cmpl $0xffff, %ebp           # imm = 0xFFFF
ja 0x2f13
movl 0x4(%rbx), %edi
leaq 0x15(%rsp), %rsi
movw $0xff21, (%rsi)         # imm = 0xFF21
movb $0xb, 0x2(%rsi)
pushq $0x3
popq %rdx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x1b30(%rip), %rsi      # 0x49f1
pushq $0xb
popq %rdx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x10(%rsp), %rsi
movw $0x103, (%rsi)          # imm = 0x103
pushq $0x2
popq %r14
movq %r14, %rdx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0xe(%rsp), %rsi
movw %bp, (%rsi)
movq %r14, %rdx
callq 0x1080
movl 0x4(%rbx), %edi
leaq 0x1b04(%rip), %rsi      # 0x4a03
pushq $0x1
popq %rdx
callq 0x1080
jmp 0x2f13
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_O2/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 %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x33d7
movq %rax, %r14
movl %ebp, (%rbx)
cmpl $0xf, %ebp
jg 0x332d
movzwl %bp, %edi
callq 0x33d7
movslq (%rbx), %rcx
movq %rax, 0x8(%r14,%rcx,8)
leal 0x1(%rcx), %ebp
jmp 0x3311
addl $0x2, %ebp
movl %ebp, (%rbx)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
movl 0x8(%rdi), %eax
pushq $0x8
popq %rcx
cltd
idivl %ecx
movl %edx, %r14d
movl %r14d, %ecx
shll %cl, %esi
orl 0x28(%rdi), %esi
movl %esi, 0x28(%rdi)
addl %ebp, %r14d
leaq 0x2d(%rdi), %r15
leaq 0x1692(%rip), %r12      # 0x4a01
pushq $0x1
popq %r13
cmpl $0x8, %r14d
jl 0x33b8
movslq %eax, %rcx
incl %eax
movb %sil, (%r15,%rcx)
cmpl $0xff, %eax
jne 0x33a9
movl 0x4(%rbx), %edi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1080
movl 0x4(%rbx), %edi
movl $0xff, %edx
movq %r15, %rsi
callq 0x1080
xorl %eax, %eax
movl 0x28(%rbx), %esi
shrl $0x8, %esi
movl %esi, 0x28(%rbx)
addl $-0x8, %r14d
jmp 0x3373
addl 0x8(%rbx), %ebp
movl $0x7f8, %ecx            # imm = 0x7F8
movl %ebp, %eax
cltd
idivl %ecx
movl %edx, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/lecram[P]congif/gif.c
// Function: new_node
static Node *
new_node(uint16_t key)
{
    Node *node = calloc(1, sizeof(*node));
    if (node)
        node->key = key;
    return node;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
pushq $0x1
popq %rdi
movl $0x88, %esi
callq 0x1110
testq %rax, %rax
je 0x33ef
movw %bx, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3424
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %r14
cmpq $0x11, %r14
je 0x3415
movq (%rbx,%r14,8), %rdi
callq 0x33f1
incq %r14
jmp 0x3401
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1030
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x3447
cmpl %esi, 0x8(%rdi)
jne 0x3447
cmpl %edx, 0xc(%rdi)
jne 0x3447
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 0x3481
movb $0x6, %sil
testb $0x8, %cl
jne 0x3481
movl %edx, %esi
shrb $0x4, %sil
testb $0x2, %cl
movzbl %sil, %edi
pushq $0x8
popq %rsi
cmovel %edi, %esi
andb $0xf, %dl
xorl %edi, %edi
testl %eax, %eax
sete %dil
testb $0x20, %cl
cmovel %eax, %edi
testl %edi, %edi
movzbl %sil, %eax
movzbl %dl, %edx
movl %eax, %esi
cmovel %edx, %esi
cmovel %eax, %edx
leal (,%rcx,8), %eax
orb %dl, %al
movl %ecx, %edx
shrb %dl
andb $0x8, %dl
orb %sil, %dl
testb $0x40, %cl
movzbl %al, %ecx
movzbl %dl, %eax
cmovnel %eax, %ecx
shlb $0x4, %cl
orb %cl, %al
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2d5b
cmpl $-0x1, %eax
je 0x3591
movzbl 0x3(%r15), %edi
imull 0x8(%r15), %eax
imull %edi, %eax
cltq
addq 0x18(%r15), %rax
imull %edi, %ebp
movl %r12d, %esi
shrb $0x4, %sil
andb $0xf, %r12b
xorl %ecx, %ecx
movzbl %r12b, %edx
movzbl %sil, %esi
movzbl %dil, %edi
cmpl %edi, %ecx
jae 0x3591
movzbl 0x2(%r15), %r10d
movl %r10d, %edi
imull %ebx, %edi
movslq %edi, %rdi
movslq %ebp, %r8
xorl %r9d, %r9d
movzbl %r10b, %r10d
cmpl %r10d, %r9d
jae 0x3580
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)
movb 0x2(%r15), %r10b
incq %r9
jmp 0x3536
incl %ebp
movslq 0x8(%r15), %rdi
addq %rdi, %rax
incl %ecx
movb 0x3(%r15), %dil
jmp 0x351a
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rsi, %r15
movq %rdi, %r14
xorl %r12d, %r12d
movslq (%r14), %rax
cmpq %rax, %r12
jge 0x3604
xorl %r13d, %r13d
movslq 0x4(%r14), %rax
cmpq %rax, %r13
jge 0x35ff
movq 0x20(%r14), %rax
movq (%rax,%r12,8), %rax
movzwl (%rax,%r13,4), %ebp
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x3428
movzbl %al, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
movl %r12d, %r8d
movl %r13d, %r9d
callq 0x34c8
incq %r13
jmp 0x35c0
incq %r12
jmp 0x35b5
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 0x2f25
// File: /workspace/github_c_makefile_star2_O2/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:
cmpq $0x0, 0x8238(%rip)      # 0xb4a0
je 0x3293
pushq %rbx
xorl %eax, %eax
testl %edi, %edi
cmovgl %edi, %eax
movl $0xf0, %ebx
cmovnel %eax, %ebx
subl $0x1, %ebx
jb 0x3292
movq 0x821a(%rip), %rsi      # 0xb4a0
movl $0x80, %edi
callq 0x20d0
jmp 0x327a
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x809d(%rip)      # 0xb338
je 0x32b9
cmpb $0x0, 0x8099(%rip)      # 0xb33d
jne 0x32b9
pushq %rax
movswl 0x8152(%rip), %esi      # 0xb400
xorl %edi, %edi
callq 0x5e87
addq $0x8, %rsp
movb $0x0, 0x8078(%rip)      # 0xb338
andw $0x0, 0x8138(%rip)      # 0xb400
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x80ed(%rip), %rdi      # 0xb550
leaq 0x3fa0(%rip), %rsi      # 0x740a
callq 0x2140
testq %rax, %rax
je 0x3599
movq %rax, %rbx
leaq 0x44fb(%rip), %rdi      # 0x797d
pushq $0x1b
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
movq %rax, %rcx
callq 0x2180
leaq 0x44fe(%rip), %rdi      # 0x7999
pushq $0x12
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2180
movl 0x7f41(%rip), %eax      # 0xb3f0
leaq 0x44fd(%rip), %r14      # 0x79b3
leaq 0x44ef(%rip), %r15      # 0x79ac
xorl %r12d, %r12d
xorl %r13d, %r13d
movslq %eax, %rcx
cmpq %rcx, %r13
jge 0x3508
movq 0x7f16(%rip), %rcx      # 0xb3e8
movl (%rcx,%r12), %edx
notl %edx
testb $0x5, %dl
jne 0x34ff
addq %r12, %rcx
addq $0x4, %rcx
movswl 0x8(%rcx), %r8d
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2110
movl 0x7ef1(%rip), %eax      # 0xb3f0
incq %r13
addq $0x18, %r12
jmp 0x34c3
leaq 0x44a4(%rip), %r14      # 0x79b3
leaq 0x43e7(%rip), %r15      # 0x78fd
xorl %r12d, %r12d
xorl %r13d, %r13d
movslq %eax, %rcx
cmpq %rcx, %r13
jge 0x3573
movq 0x7ebd(%rip), %rcx      # 0xb3e8
movl (%rcx,%r12), %edx
movl %edx, %esi
notl %esi
testb $0x43, %sil
je 0x356a
movl %edx, %esi
andl $0x2, %esi
je 0x356a
andl $0x5, %edx
cmpl $0x5, %edx
je 0x356a
addq %r12, %rcx
addq $0x4, %rcx
movswl 0x8(%rcx), %r8d
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2110
movl 0x7e86(%rip), %eax      # 0xb3f0
incq %r13
addq $0x18, %r12
jmp 0x351c
leaq 0x4448(%rip), %rdi      # 0x79c2
pushq $0x11
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x2180
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2090
pushq $0x2
popq %rdi
callq 0x2170
// File: /workspace/github_c_makefile_star2_O2/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: clearLiteralTable
void clearLiteralTable()
{
  int i;

  for (i = 0; i < DIM(cp); i++)
  {
    cp[i].loc = 0200;             /* Points to end of page for [] operands.  */
    cp[i].last_punched = 0200;    /* Points to end of page for [] operands.  */
  }
  memset(max_page_used, 0, sizeof(max_page_used));
}

// Assembly:
pushq $0x2
popq %rax
leaq 0x7ec3(%rip), %rcx      # 0xb650
cmpq $0x2082, %rax           # imm = 0x2082
je 0x37a5
movl $0x800080, -0x2(%rax,%rcx) # imm = 0x800080
addq $0x104, %rax            # imm = 0x104
jmp 0x378d
xorps %xmm0, %xmm0
movaps %xmm0, 0x9f91(%rip)     # 0xd740
movaps %xmm0, 0x9f7a(%rip)     # 0xd730
movaps %xmm0, 0x9f63(%rip)     # 0xd720
movaps %xmm0, 0x9f4c(%rip)     # 0xd710
movaps %xmm0, 0x9f35(%rip)     # 0xd700
movaps %xmm0, 0x9f1e(%rip)     # 0xd6f0
movaps %xmm0, 0x9f07(%rip)     # 0xd6e0
movaps %xmm0, 0x9ef0(%rip)     # 0xd6d0
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
pushq %rax
movl 0x9eef(%rip), %eax      # 0xd804
movl %eax, 0x9ef9(%rip)      # 0xd814
movl 0x9eeb(%rip), %eax      # 0xd80c
movl %eax, 0xa0e9(%rip)      # 0xda10
movslq 0x9eee(%rip), %rbx      # 0xd81c
leaq 0x9e4b(%rip), %r14      # 0xd780
movq %rbx, %rax
addq %r14, %rax
movabsq $0x4000000100001200, %rcx # imm = 0x4000000100001200
movzbl (%rax), %r15d
cmpq $0x3e, %r15
ja 0x3962
btq %r15, %rcx
jae 0x3962
incl %ebx
movl %ebx, 0x9ebf(%rip)      # 0xd81c
incq %rax
jmp 0x3945
movsbq %r15b, %r12
movl %ebx, 0x9e98(%rip)      # 0xd804
callq 0x21a0
movq (%rax), %rax
testb $0x8, (%rax,%r12,2)
jne 0x39b6
testb %r15b, %r15b
je 0x39df
movzbl %r12b, %eax
cmpl $0xa, %eax
je 0x39df
cmpl $0x2f, %eax
je 0x39df
cmpl $0x22, %eax
jne 0x39d3
leal 0x2(%rbx), %eax
cmpl 0x9e84(%rip), %eax      # 0xd820
jl 0x39d7
leaq 0x78e3(%rip), %rdi      # 0xb288
movl %ebx, %esi
callq 0x52fe
movl 0x9e6a(%rip), %eax      # 0xd81c
incl %eax
jmp 0x39d7
movslq %ebx, %rcx
addq %rcx, %r14
movsbq (%r14), %rcx
testb $0x8, (%rax,%rcx,2)
je 0x39df
incl %ebx
movl %ebx, 0x9e4e(%rip)      # 0xd81c
incq %r14
jmp 0x39bc
incl %ebx
movl %ebx, %eax
movl %eax, 0x9e3f(%rip)      # 0xd81c
movl %eax, %ebx
movl %ebx, 0x9e27(%rip)      # 0xd80c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7c55(%rip), %rdi      # 0xb650
pushq $0x1
popq %rsi
callq 0x3c84
cmpb $0x0, 0x9dfe(%rip)      # 0xd808
je 0x3a61
movb $0x1, 0x9d45(%rip)      # 0xd758
movzwl 0x9d36(%rip), %eax      # 0xd750
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, 0x9d1b(%rip)       # 0xd750
leaq 0x780c(%rip), %rdi      # 0xb248
pushq $-0x1
popq %rsi
callq 0x52fe
movzwl 0x9d05(%rip), %eax      # 0xd750
andl %eax, %ebx
incl %eax
andl %ebp, %eax
orl %ebx, %eax
movw %ax, 0x9cf6(%rip)       # 0xd750
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5c2b
// File: /workspace/github_c_makefile_star2_O2/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: punchLiteralPool
void punchLiteralPool( LPOOL_T *p, BOOL punch_page0 )
{
  WORD16  loc;
  WORD16  tmplc;
  int lpool_page = 0; /* Silence false uninitialized error from GCC */
  int i;

  for (i = MAX_PAGES-1; i >= 0;  i--) {
    lpool_page = (i << 7) & 07600;

    if ( p[i].loc != p[i].last_punched && (punch_page0 || lpool_page != 0) )
    {
      if( !rim_mode )
      {
        /* Put out origin if not in rim mode.                                 */
        punchOrigin( p[i].loc | lpool_page );
      }
      /* Put the literals in the object file.                                 */
      for( loc = p[i].loc; loc < p[i].last_punched; loc++ )
      {
        tmplc = loc + lpool_page;
        printLine( line, (field | tmplc), p[i].pool[loc], LOC_VAL );
        punchLocObject( tmplc, p[i].pool[loc] );
      }
      p[i].last_punched = p[i].loc;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x4(%rdi), %rax
movq %rax, 0x18(%rsp)
pushq $0x1f
popq %r9
movl $0xf80, %r12d           # imm = 0xF80
leaq 0x9ad4(%rip), %r15      # 0xd780
pushq $0x3
popq %rbp
movl %esi, 0xc(%rsp)
movq %rdi, 0x20(%rsp)
testl %r9d, %r9d
js 0x3da2
movl %r9d, %r14d
testb %sil, %sil
setne %dl
movl %r9d, %ecx
shll $0x7, %ecx
imulq $0x104, %r14, %rbx      # imm = 0x104
andl $0xf80, %ecx            # imm = 0xF80
movzwl (%rdi,%rbx), %eax
setne %r8b
cmpw 0x2(%rdi,%rbx), %ax
je 0x3d96
orb %r8b, %dl
je 0x3d96
addq %rdi, %rbx
cmpb $0x0, 0x763a(%rip)      # 0xb33d
movl %r9d, 0x14(%rsp)
jne 0x3d1a
movzwl %cx, %ecx
orl %eax, %ecx
movswl %cx, %edi
callq 0x37e1
movzwl (%rbx), %eax
movl %r12d, 0x10(%rsp)
movl %r12d, %ecx
andl $0xf80, %ecx            # imm = 0xF80
imulq $0x104, %r14, %r14      # imm = 0x104
addq 0x18(%rsp), %r14
movswq %ax, %r12
movzwl %cx, %r13d
addl %eax, %r13d
movswq 0x2(%rbx), %rax
cmpq %rax, %r12
jge 0x3d7c
movzwl 0x9a02(%rip), %eax      # 0xd752
orw %r13w, %ax
movswl (%r14,%r12,2), %edx
movswl %ax, %esi
movq %r15, %rdi
movl %ebp, %ecx
callq 0x3db1
movswl (%r14,%r12,2), %esi
movswl %r13w, %edi
callq 0x5e87
incq %r12
incl %r13d
jmp 0x3d3f
movzwl (%rbx), %eax
movw %ax, 0x2(%rbx)
movl 0xc(%rsp), %esi
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %r9d
movl 0x10(%rsp), %r12d
decl %r9d
addl $-0x80, %r12d
jmp 0x3cb8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: printLine
void printLine( char *line, WORD16 loc, WORD16 val, LINESTYLE_T linestyle )
{
  char rlc;

  if( listfile == NULL )
  {
    save_error_count = 0;
    return;
  }

  printPageBreak();

  list_lineno++;
  page_lineno++;

  if (reloc == 0)
  {
    rlc = ' ';
  }
  else
  {
    rlc = '*';
  }

  switch( linestyle )
  {
  default:
  case LINE:
    fprintf(listfile, "%5d              ", lineno );
    fputs( line, listfile );
    listed = TRUE;
    break;

  case LINE_VAL:
    fprintf(listfile, "%5d        %4.4o  ", lineno, val );
    fputs( line, listfile );
    listed = TRUE;
    break;

  case LINE_LOC_VAL:
    if( !listed )
    {
      if( indirect_generated )
      {
        fprintf( listfile, "%5d %5.5o%c %4.4o@ ", lineno, loc, rlc, val );
      }
      else
      {
        fprintf( listfile, "%5d %5.5o%c %4.4o  ", lineno, loc, rlc, val );
      }
      fputs( line, listfile );
      listed = TRUE;
    }
    else
    {
      fprintf( listfile, "      %5.5o%c %4.4o\n", loc, rlc, val );
    }
    break;

  case LOC_VAL:
    fprintf( listfile, "      %5.5o%c %4.4o\n", loc, rlc, val );
    break;
  }
  printErrorMessages();
}

// Assembly:
cmpq $0x0, 0x7777(%rip)      # 0xb530
je 0x3e21
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r15d
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
callq 0x5c51
incl 0x998c(%rip)            # 0xd764
incl 0x7626(%rip)            # 0xb404
cmpw $0x0, 0x9970(%rip)      # 0xd756
pushq $0x20
popq %rcx
pushq $0x2a
popq %rax
cmovel %ecx, %eax
cmpl $0x1, %r15d
je 0x3e53
cmpl $0x2, %r15d
je 0x3e29
cmpl $0x3, %r15d
je 0x3e32
movq 0x7728(%rip), %rdi      # 0xb530
movl 0x994e(%rip), %edx      # 0xd75c
leaq 0x3ad8(%rip), %rsi      # 0x78ed
xorl %eax, %eax
callq 0x2110
jmp 0x3eab
andl $0x0, 0x75b4(%rip)      # 0xb3dc
retq
cmpb $0x0, 0x9928(%rip)      # 0xd758
je 0x3e73
movq 0x76f7(%rip), %rdi      # 0xb530
movswl %r14w, %edx
movswl %bp, %r8d
leaq 0x3af2(%rip), %rsi      # 0x793a
movl %eax, %ecx
xorl %eax, %eax
callq 0x2110
jmp 0x3ec1
movq 0x76d6(%rip), %rdi      # 0xb530
movl 0x98fc(%rip), %edx      # 0xd75c
movswl %bp, %ecx
leaq 0x3a95(%rip), %rsi      # 0x78ff
xorl %eax, %eax
callq 0x2110
jmp 0x3eab
cmpb $0x0, 0x999e(%rip)      # 0xd818
movq 0x76af(%rip), %rdi      # 0xb530
movl 0x98d5(%rip), %edx      # 0xd75c
movswl %r14w, %ecx
movswl %bp, %r9d
leaq 0x3a90(%rip), %r8       # 0x7926
leaq 0x3a75(%rip), %rsi      # 0x7912
cmoveq %r8, %rsi
movl %eax, %r8d
xorl %eax, %eax
callq 0x2110
movq 0x767e(%rip), %rsi      # 0xb530
movq %rbx, %rdi
callq 0x20c0
movb $0x1, 0x9897(%rip)      # 0xd758
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5d90
// File: /workspace/github_c_makefile_star2_O2/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: lookup
SYM_T *lookup( char *name )
{
  int     ix;                   /* Insertion index                            */
  int     lx;                   /* Left index                                 */
  int     rx;                   /* Right index                                */

  /* First search the permanent symbols.                                      */
  lx = 0;
  ix = binarySearch( name, lx, number_of_fixed_symbols );

  /* If symbol not in permanent symbol table.                                 */
  if( ix < 0 )
  {
    /* Now try the user symbol table.                                         */
    ix = binarySearch( name, number_of_fixed_symbols, symbol_top );

    /* If symbol not in user symbol table.                                    */
    if( ix < 0 )
    {
      /* Must put symbol in table if index is negative.                       */
      ix = ~ix;
      if( symbol_top + 1 >= SYMBOL_TABLE_SIZE )
      {
        errorSymbol( &symbol_table_full, name, lexstart );
        exit( 1 );
      }

      for( rx = symbol_top; rx >= ix; rx-- )
      {
        symtab[rx + 1] = symtab[rx];
      }
      symbol_top++;

      /* Enter the symbol as UNDEFINED with a value of zero.                  */
      strcpy( symtab[ix].name, name );
      symtab[ix].type = UNDEFINED;
      symtab[ix].val  = 0;
      symtab[ix].xref_count = 0;
      if( xref && pass == 2 )
      {
        xreftab[symtab[ix].xref_index] = 0;
      }
    }
  }

  return( &symtab[ix] );        /* Return the location of the symbol.         */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl 0x7513(%rip), %r15d     # 0xb3f4
xorl %esi, %esi
movl %r15d, %edx
callq 0x5edb
testl %eax, %eax
js 0x3ef6
movl %eax, %ebx
jmp 0x3fa9
movl 0x74f4(%rip), %ebp      # 0xb3f0
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x5edb
movl %eax, %ebx
testl %eax, %eax
jns 0x3fa9
cmpl $0xffe, %ebp            # imm = 0xFFE
jg 0x3fc1
movslq %ebp, %rdx
notl %ebx
movq 0x74bd(%rip), %rax      # 0xb3e8
movl %ebx, %ecx
imulq $0x18, %rdx, %rsi
addq %rax, %rsi
cmpq %rcx, %rdx
jl 0x3f51
movq 0x10(%rsi), %rdi
movq %rdi, 0x28(%rsi)
movups (%rsi), %xmm0
movups %xmm0, 0x18(%rsi)
decq %rdx
addq $-0x18, %rsi
jmp 0x3f34
incl %ebp
movl %ebp, 0x7497(%rip)      # 0xb3f0
imulq $0x18, %rcx, %r15
leaq (%rax,%r15), %rdi
addq $0x4, %rdi
movq %r14, %rsi
callq 0x2070
movq 0x7474(%rip), %rax      # 0xb3e8
andl $0x0, (%rax,%r15)
andw $0x0, 0xc(%rax,%r15)
andl $0x0, 0x14(%rax,%r15)
cmpb $0x0, 0x73b4(%rip)      # 0xb341
je 0x3fa9
cmpl $0x2, 0x744a(%rip)      # 0xb3e0
jne 0x3fa9
movq 0x75a1(%rip), %rcx      # 0xb540
movslq 0x10(%rax,%r15), %rax
andw $0x0, (%rcx,%rax,2)
movl %ebx, %eax
imulq $0x18, %rax, %rax
addq 0x7432(%rip), %rax      # 0xb3e8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x983d(%rip), %edx      # 0xd804
leaq 0x72fa(%rip), %rdi      # 0xb2c8
movq %r14, %rsi
callq 0x4045
pushq $0x1
popq %rdi
callq 0x2170
// File: /workspace/github_c_makefile_star2_O2/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: lexemeToName
char *lexemeToName( char *name, int from, int term )
{
  int  to;

  to = 0;

  while( from < term && to < ( SYMLEN - 1 ))
  {
    name[to++] = toupper( line[from++] );
  }

  while( to < SYMLEN )
  {
    name[to++] = '\0';
  }
  return( name );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq %esi, %r15
movslq %edx, %r12
xorl %r14d, %r14d
leaq 0x9784(%rip), %r13      # 0xd780
leaq (%r15,%r14), %rbp
cmpq %r12, %rbp
jge 0x402d
cmpq $0x6, %r14
jae 0x402d
callq 0x2030
movq (%rax), %rax
movsbq (%r13,%rbp), %rcx
movb (%rax,%rcx,4), %al
movb %al, (%rbx,%r14)
incq %r14
jmp 0x3ffc
movb $0x0, (%rbx,%r14)
incq %r14
cmpq $0x6, %r14
jbe 0x4025
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq