LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/cell.c
// Function: add
Cell add(Cell x, Cell y)
{   /* This is kinda clumsy. Should I combine code at the cost (?) of speed */
    /* and functional style? */
    if (sign_bit(x) == sign_bit(y)) {
        long sum = magnitude(x) + magnitude(y);
        long magnitude_of_sum = magnitude(sum);
        if (magnitude_of_sum != sum) overflow = true;
        return sign_bit(x) | magnitude_of_sum;
    } else {
        long diff = magnitude(x) - magnitude(y);
        return diff < 0 ? sign_bit (y) | -diff : sign_bit (x) | diff;
    }
}

// Assembly:
movl $0x40000000, %eax       # imm = 0x40000000
movq %rdi, %rcx
andq %rax, %rcx
andq %rsi, %rax
movl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andq %rdx, %rdi
andq %rdx, %rsi
cmpq %rax, %rcx
jne 0x3b11
addq %rdi, %rsi
movl %esi, %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
cmpq $0x40000000, %rsi       # imm = 0x40000000
jb 0x3b0d
movl $0x1, 0xc033(%rip)      # 0xfb40
orq %rcx, %rax
retq
subq %rsi, %rdi
movq %rdi, %rdx
negq %rdx
orq %rdx, %rax
orq %rdi, %rcx
testq %rdi, %rdi
cmovsq %rax, %rcx
movq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/cell.c
// Function: divide
void divide(Cell n1, Cell n0, Cell d, Cell *quotient, Cell *remainder)
{
    long magn1 = magnitude(n1);
    long magd = magnitude(d);
    if (magd == 0) {
        overflow = true;
        *quotient = *remainder = zero;  /* just so they have -some- valid value */
    } else if (magn1 == 0) {    /* special-cased for speed */
        *quotient = (sign_bit(n1) ^ sign_bit(d)) | (magnitude(n0) / magd);
        *remainder = sign_bit(n1) | (magnitude(n0) % magd);
    } else if (magd <= magn1) {
        overflow = true;
        *quotient = *remainder = zero;
    } else {
        long q = magnitude(n0);
        long r = magn1;
        unsigned i;
        for (i = 30; i != 0; --i) {
            r <<= 1;
            if (q & (1L << 29))
                ++r;
            q = (q << 1) & ((1L << 30) - 1);
            if (magd <= r)
                ++q, r -= magd;
        }
        *quotient = (sign_bit(n1) ^ sign_bit(d)) | q;
        *remainder = sign_bit(n1) | r;
    }
}

// Assembly:
movl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movq %rdx, %r10
andq %rax, %r10
je 0x3cba
movq %rdx, %r9
andq %rdi, %rax
je 0x3ccd
cmpl %eax, %r10d
jbe 0x3cba
andl $0x3fffffff, %esi       # imm = 0x3FFFFFFF
movl $0xffffffe2, %edx       # imm = 0xFFFFFFE2
movq %rsi, %r11
shrq $0x1d, %r11
leaq (%r11,%rax,2), %rax
andl $0x1fffffff, %esi       # imm = 0x1FFFFFFF
xorl %r11d, %r11d
cmpq %rax, %r10
setle %r11b
leaq (%r11,%rsi,2), %rsi
movl $0x0, %r11d
cmovleq %r10, %r11
subq %r11, %rax
incl %edx
jne 0x3c6b
movl %edi, %edx
andl $0x40000000, %edx       # imm = 0x40000000
xorl %edi, %r9d
andl $0x40000000, %r9d       # imm = 0x40000000
orq %r9, %rsi
movq %rsi, (%rcx)
orq %rdx, %rax
movq %rax, (%r8)
retq
movl $0x1, 0xbe7c(%rip)      # 0xfb40
xorl %eax, %eax
movq %rax, (%r8)
movq %rax, (%rcx)
retq
andl $0x3fffffff, %esi       # imm = 0x3FFFFFFF
movl %esi, %eax
xorl %edx, %edx
divl %r10d
movl %edi, %esi
andl $0x40000000, %esi       # imm = 0x40000000
xorl %edi, %r9d
andl $0x40000000, %r9d       # imm = 0x40000000
orl %r9d, %eax
movq %rax, (%rcx)
orq %rsi, %rdx
movq %rdx, (%r8)
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/cell.c
// Function: shift_right
void shift_right(Cell A, Cell X, unsigned long count, Cell *pA, Cell *pX)
{
    *pX = sign_bit(X);
    *pA = sign_bit(A);
    if (count < 5) {
        *pA |= magnitude(A) >> (6 * count);
        *pX |= CELL_MAX & ((magnitude(X) >> (6 * count))
            | (A << (30 - 6 * count)));
    } else if (count < 10)
        *pX |= magnitude(A) >> (6 * count - 30);
    else
        ;
}

// Assembly:
movq %rcx, %rax
movl $0x40000000, %r9d       # imm = 0x40000000
movq %rsi, %rcx
andq %r9, %rcx
movq %rcx, (%r8)
andq %rdi, %r9
movq %r9, (%rax)
cmpq $0x4, %rdx
ja 0x3da7
movl $0x3fffffff, %r10d      # imm = 0x3FFFFFFF
movq %rdi, %r11
andq %r10, %r11
addl %edx, %edx
leal (%rdx,%rdx,2), %ecx
shrq %cl, %r11
andq %r10, %rsi
shrq %cl, %rsi
orq %r9, %r11
movq %r11, (%rax)
movb $0x1e, %al
subb %cl, %al
movl %eax, %ecx
shlq %cl, %rdi
andq %r10, %rdi
orq %rsi, %rdi
jmp 0x3dbe
cmpq $0x9, %rdx
ja 0x3dc4
andl $0x3fffffff, %edi       # imm = 0x3FFFFFFF
addl %edx, %edx
leal (%rdx,%rdx,2), %ecx
addb $-0x1e, %cl
shrq %cl, %rdi
orq (%r8), %rdi
movq %rdi, (%r8)
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/cell.c
// Function: shift_left
void shift_left(Cell A, Cell X, unsigned long count, Cell *pA, Cell *pX)
{
    *pX = sign_bit(X);
    *pA = sign_bit(A);
    if (count < 5) {
        *pX |= CELL_MAX & (X << (6 * count));
        *pA |= CELL_MAX & ((A << (6 * count))
            | (magnitude(X) >> (30 - 6 * count)));
    } else if (count < 10)
        *pA |= CELL_MAX & (X << (6 * count - 30));
    else
        ;
}

// Assembly:
movq %rcx, %rax
movl $0x40000000, %r9d       # imm = 0x40000000
movq %rsi, %rcx
andq %r9, %rcx
movq %rcx, (%r8)
andq %rdi, %r9
movq %r9, (%rax)
cmpq $0x4, %rdx
ja 0x3e14
addl %edx, %edx
leal (%rdx,%rdx,2), %ecx
movq %rsi, %rdx
shlq %cl, %rdx
movl $0x3fffffff, %r9d       # imm = 0x3FFFFFFF
andq %r9, %rdx
orq %rdx, (%r8)
shlq %cl, %rdi
andq %r9, %rsi
movb $0x1e, %dl
subb %cl, %dl
movl %edx, %ecx
shrq %cl, %rsi
andq %r9, %rdi
orq %rsi, %rdi
orq (%rax), %rdi
jmp 0x3e31
cmpq $0x9, %rdx
ja 0x3e34
addl %edx, %edx
leal (%rdx,%rdx,2), %ecx
addb $-0x1e, %cl
shlq %cl, %rsi
andl $0x3fffffff, %esi       # imm = 0x3FFFFFFF
orq %r9, %rsi
movq %rsi, %rdi
movq %rdi, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/cell.c
// Function: shift_right_binary
void shift_right_binary(Cell A, Cell X, unsigned long count, Cell *pA, Cell *pX)
{
    *pX = sign_bit(X);
    *pA = sign_bit(A);
    if (count < 30) {
        *pA |= magnitude(A) >> count;
        *pX |= CELL_MAX & ((magnitude(X) >> count)
            | (A << (30 - count)));
    } else if (count < 60)
        *pX |= magnitude(A) >> (count - 30);
    else
        ;
}

// Assembly:
movq %rcx, %rax
movq %rdx, %rcx
movl $0x40000000, %edx       # imm = 0x40000000
movq %rsi, %r9
andq %rdx, %r9
movq %r9, (%r8)
andq %rdi, %rdx
movq %rdx, (%rax)
cmpq $0x1d, %rcx
ja 0x3e81
movl $0x3fffffff, %r9d       # imm = 0x3FFFFFFF
movq %rdi, %r10
andq %r9, %r10
shrq %cl, %r10
andq %r9, %rsi
shrq %cl, %rsi
orq %rdx, %r10
movq %r10, (%rax)
movb $0x1e, %al
subb %cl, %al
movl %eax, %ecx
shlq %cl, %rdi
andq %r9, %rdi
orq %rsi, %rdi
jmp 0x3e93
cmpq $0x3b, %rcx
ja 0x3e99
andl $0x3fffffff, %edi       # imm = 0x3FFFFFFF
addb $-0x1e, %cl
shrq %cl, %rdi
orq (%r8), %rdi
movq %rdi, (%r8)
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/cell.c
// Function: shift_left_binary
void shift_left_binary(Cell A, Cell X, unsigned long count, Cell *pA, Cell *pX)
{
    *pX = sign_bit(X);
    *pA = sign_bit(A);
    if (count < 30) {
        *pX |= CELL_MAX & (X << count);
        *pA |= CELL_MAX & ((A << count)
            | (magnitude(X) >> (30 - count)));
    } else if (count < 60)
        *pA |= CELL_MAX & (X << (count - 30));
    else
        ;
}

// Assembly:
movq %rcx, %rax
movq %rdx, %rcx
movl $0x40000000, %edx       # imm = 0x40000000
movq %rsi, %r9
andq %rdx, %r9
movq %r9, (%r8)
andq %rdi, %rdx
movq %rdx, (%rax)
cmpq $0x1d, %rcx
ja 0x3ee6
movq %rsi, %rdx
shlq %cl, %rdx
movl $0x3fffffff, %r9d       # imm = 0x3FFFFFFF
andq %r9, %rdx
orq %rdx, (%r8)
shlq %cl, %rdi
andq %r9, %rsi
movb $0x1e, %dl
subb %cl, %dl
movl %edx, %ecx
shrq %cl, %rsi
andq %r9, %rdi
orq %rsi, %rdi
orq (%rax), %rdi
jmp 0x3efe
cmpq $0x3b, %rcx
ja 0x3f01
addb $-0x1e, %cl
shlq %cl, %rsi
andl $0x3fffffff, %esi       # imm = 0x3FFFFFFF
orq %rdx, %rsi
movq %rsi, %rdi
movq %rdi, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/cell.c
// Function: cell_to_address
Address cell_to_address(Cell cell)
{
    if ((sign_bit(cell) != 0 && magnitude(cell) != 0)
       || memory_size <= magnitude(cell))
    {
        char buffer[16];
        unparse_cell(buffer, cell, false);
        error("Value is not an address: %s", buffer);
        return 0;
    }
    return (Address) magnitude(cell);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edi, %eax
shrl $0x1e, %eax
movq %rdi, %rcx
andq $0x3fffffff, %rcx       # imm = 0x3FFFFFFF
setne %dl
testb %dl, %al
jne 0x4067
leaq 0xcd59(%rip), %rax      # 0x10db4
movslq (%rax), %rax
cmpq %rax, %rcx
jge 0x4067
movl %ecx, %ebx
jmp 0x40a4
btl $0x1e, %edi
leaq 0x515a(%rip), %rax      # 0x91cc
leaq 0x52d8(%rip), %rdx      # 0x9351
cmovaeq %rax, %rdx
leaq 0x514a(%rip), %rsi      # 0x91ce
xorl %ebx, %ebx
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x3280
leaq 0x513d(%rip), %rdi      # 0x91d7
movq %r14, %rsi
xorl %eax, %eax
callq 0x5bec
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/charset.c
// Function: mix_to_C_char
char mix_to_C_char(Byte mix_char)
{
    assert((unsigned)mix_char < num_chars);

    if (current_device_type == card_out) {
	/* --- Card punch cannot write characters 20, 21, 48, ... --- */
        if ((mix_char > 48) || (mix_char == 20) || (mix_char == 21))
            return ' ';
    }
    return mix_chars[(unsigned)mix_char];
}

// Assembly:
cmpl $0x40, %edi
jae 0x4169
leaq 0xbb90(%rip), %rax      # 0xfcd0
cmpl $0x4, (%rax)
jne 0x415c
cmpl $0x31, %edi
setae %al
movl %edi, %ecx
andl $0x3e, %ecx
cmpl $0x14, %ecx
sete %cl
orb %al, %cl
movb $0x20, %al
jne 0x4168
movl %edi, %eax
leaq 0x510b(%rip), %rcx      # 0x9270
movb (%rax,%rcx), %al
retq
pushq %rax
leaq 0x5097(%rip), %rdi      # 0x9208
leaq 0x50af(%rip), %rsi      # 0x9227
leaq 0x50b2(%rip), %rcx      # 0x9231
movl $0x12, %edx
callq 0x3130
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/charset.c
// Function: C_char_to_mix
Byte C_char_to_mix(char c)
{
    Byte ret;
    const char *s;

    s = strchr(mix_chars, toupper(c));
    if (!s) return 63;
    ret = (Byte) (s - mix_chars);

    /* --- Card reader cannot read, characters 20, 21, 48, ... --- */
    if (current_device_type == card_in) {
        if ((ret > 48) || (ret == 20) || (ret == 21))
            ret = 0;
    }
    return ret;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x3030
movq (%rax), %rax
movslq %ebx, %rcx
movl (%rax,%rcx,4), %esi
leaq 0x50cf(%rip), %rdi      # 0x9270
movl $0x41, %edx
callq 0x3180
testq %rax, %rax
je 0x41de
leaq 0x50b9(%rip), %rcx      # 0x9270
subl %ecx, %eax
leaq 0xbb10(%rip), %rcx      # 0xfcd0
cmpl $0x3, (%rcx)
jne 0x41e3
movl %eax, %ecx
andl $-0x2, %ecx
xorl %edx, %edx
cmpl $0x14, %ecx
movl %eax, %ecx
cmovel %edx, %ecx
cmpl $0x31, %eax
cmovael %edx, %ecx
movl %ecx, %eax
jmp 0x41e3
movl $0x3f, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/driver.c
// Function: eat_identifier
static void eat_identifier(char *buffer, const_char_ptr *s)
{
    const char *scan = buffer;
    size_t size, truncated_size;

    for (scan = *s; !isspace (*scan) && *scan != '\0'; ++scan)
        ;
    size = scan - *s;

    {				/* ensure it's a legal identifier */
	Flag alpha = false, non_alphanum = false;
	for (scan = *s; scan < *s + size; ++scan) {
	    if (isalpha(*scan))
	        alpha = true;
	    else if (!isalnum (*scan))
	        non_alphanum = true;
	}
	if ((!alpha && size != 0) || non_alphanum) {
	    error ("Ill-formed label or mnemonic: %*.*s", size, size, *s);
	    buffer[0] = '\0';
	    *s += size;
	    return;
	}
    }

    if (max_identifier_length < size) {
        warn ("Truncated long label or mnemonic: %*.*s", size, size, *s);
	    truncated_size = max_identifier_length;
    } else
        truncated_size = size;

    memcpy(buffer, *s, truncated_size);
    buffer[truncated_size] = '\0';
    *s += size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %r12
callq 0x32d0
movq (%rax), %rax
movq $-0x1, %r15
movsbq 0x1(%r12,%r15), %rcx
incq %r15
testq %rcx, %rcx
je 0x4518
movzwl (%rax,%rcx,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
je 0x44fe
leaq (%r12,%r15), %rdx
xorl %ecx, %ecx
cmpq %rdx, %r12
jae 0x4561
movl $0x1, %edx
movq %r15, %rsi
xorl %edi, %edi
movq %r12, %r8
movsbq (%r8), %r9
movzwl (%rax,%r9,2), %r9d
btl $0xa, %r9d
cmovbl %edx, %edi
testl $0x408, %r9d            # imm = 0x408
cmovel %edx, %ecx
incq %r8
decq %rsi
jne 0x4530
testl %edi, %edi
setne %dl
testl %ecx, %ecx
sete %al
movl %edx, %ecx
jmp 0x4563
movb $0x1, %al
testq %r15, %r15
setne %dl
xorb $0x1, %cl
testb %cl, %dl
jne 0x459c
testb %al, %al
je 0x459c
cmpq $0x21, %r15
jb 0x45b5
leaq 0x4d8e(%rip), %rdi      # 0x930f
movq %r15, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x331d
movq (%rbx), %r12
movl $0x20, %r13d
jmp 0x45b8
leaq 0x4d48(%rip), %rdi      # 0x92eb
movq %r15, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x5bec
jmp 0x45c9
movq %r15, %r13
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x31e0
addq %r13, %r14
movb $0x0, (%r14)
addq %r15, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/driver.c
// Function: do_equ
static void do_equ(void)
{
    define_symbol(string_to_symbol(label), parse_W());
    if (VERBOSE) {
        Cell cell = symbol_value(string_to_symbol(label));
        printf("          %s%010lo  %s\n",
               is_negative(cell) ? "-" : "+", magnitude(cell),
               current_line);
    }
}

// Assembly:
pushq %rbx
leaq 0xb69e(%rip), %rdi      # 0xfc80
callq 0x87a4
movq %rax, %rbx
callq 0x65f5
movq %rbx, %rdi
movq %rax, %rsi
callq 0x89bb
leaq 0xc6df(%rip), %rax      # 0x10ce0
cmpl $0x0, (%rax)
je 0x464e
leaq 0xb673(%rip), %rdi      # 0xfc80
callq 0x87a4
movq %rax, %rdi
callq 0x892e
btl $0x1e, %eax
leaq 0x4ba7(%rip), %rcx      # 0x91cc
leaq 0x4d25(%rip), %rsi      # 0x9351
cmovaeq %rcx, %rsi
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
leaq 0x4e27(%rip), %rdi      # 0x9463
leaq 0xb52d(%rip), %rcx      # 0xfb70
movq %rax, %rdx
xorl %eax, %eax
popq %rbx
jmp 0x3120
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/driver.c
// Function: do_end
static void do_end(void)
{
    Address address;

    address = cell_to_address(parse_W());
    set_entry_point(address);
    if (VERBOSE) {
        printf("                %s  %s\n",
                address_to_string(address), current_line);
    }
}

// Assembly:
pushq %rbx
callq 0x65f5
movq %rax, %rdi
callq 0x4037
movl %eax, %ebx
movl %eax, %edi
callq 0x3711
leaq 0xc624(%rip), %rax      # 0x10ce0
cmpl $0x0, (%rax)
je 0x46e1
movl %ebx, %edi
callq 0x3fa3
leaq 0x4d7c(%rip), %rdi      # 0x944b
leaq 0xb49a(%rip), %rdx      # 0xfb70
movq %rax, %rsi
xorl %eax, %eax
popq %rbx
jmp 0x3120
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/driver.c
// Function: do_orig
static void do_orig(void)
{
    here = cell_to_address(parse_W());
    if (VERBOSE) {
        printf("                %s  %s\n",
                address_to_string(here), current_line);
    }
}

// Assembly:
pushq %rax
callq 0x65f5
movq %rax, %rdi
callq 0x4037
leaq 0xb03c(%rip), %rcx      # 0xf734
movl %eax, (%rcx)
leaq 0xc5df(%rip), %rcx      # 0x10ce0
cmpl $0x0, (%rcx)
je 0x4726
movl %eax, %edi
callq 0x3fa3
leaq 0x4d37(%rip), %rdi      # 0x944b
leaq 0xb455(%rip), %rdx      # 0xfb70
movq %rax, %rsi
xorl %eax, %eax
popq %rcx
jmp 0x3120
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: do_scheduled_io
void do_scheduled_io(unsigned clocks)
{
    int i;
    Byte device;

    if (dbg > 3) {
        fflush(stdout);
        fprintf(stderr,"do_scheduled_io(%d)\n", clocks);
    }
    for (i = 0; i < clocks; i++) {
        next_scheduled_io = (unsigned) -1;
        for (device = 0; device < num_devices; device++) {
            if (devices[device].busy) {
                devices[device].busy--;
                if (0 == devices[device].busy)
                    do_io(device);
                else if (devices[device].busy < next_scheduled_io)
                    next_scheduled_io = devices[device].busy;
            }
        }
        if (next_scheduled_io == (unsigned) -1)
            next_scheduled_io = 0;
    }
}

// Assembly:
testl %edi, %edi
je 0x4c74
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edi, %ebx
xorl %r15d, %r15d
leaq 0xa59d(%rip), %r12      # 0xf1a8
movl $0xffffffff, 0xb0a7(%rip) # imm = 0xFFFFFFFF
movq %r12, %r13
xorl %r14d, %r14d
movl (%r13), %eax
testl %eax, %eax
je 0x4c43
decl %eax
movl %eax, (%r13)
je 0x4c3b
cmpl 0xb08b(%rip), %eax      # 0xfcbc
jae 0x4c43
movl %eax, 0xb083(%rip)      # 0xfcbc
jmp 0x4c43
movl %r14d, %edi
callq 0x4c75
incq %r14
addq $0x48, %r13
cmpq $0x14, %r14
jne 0x4c1b
cmpl $-0x1, 0xb065(%rip)     # 0xfcbc
jne 0x4c63
movl $0x0, 0xb059(%rip)      # 0xfcbc
incl %r15d
cmpl %ebx, %r15d
jne 0x4c0b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: do_io
static void do_io(Byte device)
{
    Cell rX, offset;
    Address buffer;
    Operation operation;

    operation = devices[device].operation;
    rX        = devices[device].rX;
    offset    = devices[device].offset;
    buffer    = devices[device].buffer;

    if (dbg > 1) {
        fflush(stdout);
        fprintf(stderr,"do_io(%s, %d, %s, %s%lo, %ld, %d, @%ld)\n",
                address_to_string(devices[device].pc),
                device, operations[operation],
                is_negative(rX) ? "-" : "", magnitude(rX),
                offset, buffer,
                devices[device].position);
    }

    current_device_type = devices[device].type;
    switch (operation) {
    case control:
        attributes(device)->ioc_handler(device, rX, offset); break;
    case input:
        attributes(device)->in_handler(device, rX, buffer); break;
    case output:
        attributes(device)->out_handler(device, rX, buffer);
        if (current_device_type == printer)
            devices[device].position++;
    }
    
    if (operation != control)
        io_mark_incomplete(buffer,
                           attributes(device)->block_size, 
                           operation == input ? -WRITE : -READ);
        
    if (devices[device].int_request == true)
        devices[device].int_pending = true;

    devices[device].busy = 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %eax
leaq (%rax,%rax,8), %rax
leaq 0xa50a(%rip), %rcx      # 0xf190
leaq (%rcx,%rax,8), %r14
movl (%r14), %eax
movl 0x20(%r14), %ebp
movq 0x28(%r14), %rsi
movq 0x30(%r14), %rdx
movl 0x38(%r14), %ebx
movl %eax, 0xb02d(%rip)      # 0xfcd0
testl %ebp, %ebp
je 0x4d0d
cmpl $0x2, %ebp
je 0x4cc4
cmpl $0x1, %ebp
jne 0x4ce2
imulq $0x38, %rax, %rax
leaq 0x9954(%rip), %rcx      # 0xe610
movl %ebx, %edx
callq *0x18(%rax,%rcx)
jmp 0x4ce2
imulq $0x38, %rax, %rax
leaq 0x9941(%rip), %rcx      # 0xe610
movl %ebx, %edx
callq *0x20(%rax,%rcx)
cmpl $0x5, 0xaff4(%rip)      # 0xfcd0
jne 0x4ce2
incq 0x10(%r14)
movl (%r14), %eax
imulq $0x38, %rax, %rax
leaq 0x9920(%rip), %rcx      # 0xe610
movl 0x14(%rax,%rcx), %esi
cmpl $0x1, %ebp
movl $0x15, %eax
movl $0x1, %edx
cmovel %eax, %edx
movl %ebx, %edi
callq 0x510a
jmp 0x4d1c
imulq $0x38, %rax, %rax
leaq 0x98f8(%rip), %rcx      # 0xe610
callq *0x28(%rax,%rcx)
cmpl $0x1, 0x3c(%r14)
jne 0x4d2b
movl $0x1, 0x40(%r14)
movl $0x0, 0x18(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: io_init
void io_init(void)
{
    Byte i;

    incomplete = malloc(sizeof(int) * memory_size);
    if (!incomplete)
        fatal_error("Out of heap space!");

    control_incomplete = malloc(sizeof(int) * memory_size);
    if (!control_incomplete)
        fatal_error("Out of heap space!");

    for (i = 0; i < num_devices; i++) {
        devices[i].busy = 0;
        devices[i].int_request = false;
        devices[i].int_pending = false;
        devices[i].rewound = devices[i].type == tape ? true : false;
    }
    for (i = 0; i < memory_size; i++) {
        incomplete[i] = -WRITE;
        control_incomplete[i] = -WRITE;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xc04c(%rip), %r14      # 0x10db4
movslq (%r14), %rbx
shlq $0x2, %rbx
movq %rbx, %rdi
callq 0x31f0
movq %rax, 0xaf42(%rip)      # 0xfcc0
testq %rax, %rax
jne 0x4d98
leaq 0x471c(%rip), %rdi      # 0x94a6
xorl %eax, %eax
callq 0x5af0
movslq (%r14), %rbx
shlq $0x2, %rbx
movq %rbx, %rdi
callq 0x31f0
movq %rax, 0xaf21(%rip)      # 0xfcc8
testq %rax, %rax
jne 0x4dba
leaq 0x46f3(%rip), %rdi      # 0x94a6
xorl %eax, %eax
callq 0x5af0
movl $0x44, %eax
leaq 0xa3ca(%rip), %rcx      # 0xf190
movl $0x0, -0x2c(%rax,%rcx)
movq $0x0, -0x8(%rax,%rcx)
xorl %edx, %edx
cmpl $0x2, -0x44(%rax,%rcx)
sete %dl
movl %edx, (%rax,%rcx)
addq $0x48, %rax
cmpq $0x5e4, %rax            # imm = 0x5E4
jne 0x4dc6
cmpl $0x0, (%r14)
je 0x4e1c
movq 0xaec3(%rip), %rax      # 0xfcc0
movq 0xaec4(%rip), %rcx      # 0xfcc8
xorl %edx, %edx
movl $0x15, %esi
movl %esi, (%rax,%rdx,4)
movl %esi, (%rcx,%rdx,4)
incq %rdx
movl (%r14), %edi
cmpq %rdi, %rdx
jb 0x4e0b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: io_complete
unsigned io_complete(void)
{
    unsigned clocks = 0;

    while (next_scheduled_io) {
        do_scheduled_io(1);
        clocks++;
        idle_time++;
    }
    return clocks;
}

// Assembly:
pushq %rbx
cmpl $0x0, 0xae90(%rip)      # 0xfcbc
je 0x4e4e
xorl %ebx, %ebx
movl $0x1, %edi
callq 0x4bf2
incq 0xae6f(%rip)            # 0xfcb0
incl %ebx
cmpl $0x0, 0xae72(%rip)      # 0xfcbc
jne 0x4e30
jmp 0x4e50
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: io_shutdown
void io_shutdown(void)
{
    Byte device;

    for (device = 0; device < num_devices; device++) {
        if (devices[device].file) {
            fclose(devices[device].file);
            devices[device].file = NULL;
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x8, %ebx
leaq 0xa32c(%rip), %r14      # 0xf190
movq (%rbx,%r14), %rdi
testq %rdi, %rdi
je 0x4e7a
callq 0x30f0
movq $0x0, (%rbx,%r14)
addq $0x48, %rbx
cmpq $0x5a8, %rbx            # imm = 0x5A8
jne 0x4e64
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: io_incomplete
Flag io_incomplete(Address address, Access access)
{
    Flag ret = false;
    int count;
    
    if (memory_size <= magnitude(address))
        error("Address out of range -- io_incomplete");
        
    count = fetch_incomplete(address);
    if (count == -WRITE)                    /* it is free */
        ret = false;
    else if (access == write_access)        /* either written to, or read from , therefore not writable */
        ret = false;
    else if (access == read_access)         /* if read from, then readable */
        ret = count ? true : false;
    return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
leaq 0xbf17(%rip), %rax      # 0x10db4
movl %edi, %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
cmpl %ecx, (%rax)
jg 0x4eb7
leaq 0x4609(%rip), %rdi      # 0x94b9
xorl %eax, %eax
callq 0x5bec
movl %ebp, %eax
negl %eax
shlq $0x2, %rax
addq 0xae02(%rip), %rax      # 0xfcc8
movl %ebp, %ecx
shlq $0x2, %rcx
addq 0xaded(%rip), %rcx      # 0xfcc0
testl %ebp, %ebp
cmovsq %rax, %rcx
movl (%rcx), %eax
cmpl $0x15, %eax
setne %cl
testl %ebx, %ebx
sete %dl
testl %eax, %eax
setne %al
andb %cl, %al
andb %dl, %al
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: io_pending_interrupt
Flag io_pending_interrupt(Byte *int_device)
{
    Byte device, next_device;
    enum DeviceType next_device_type;

    next_device_type = (enum DeviceType) (LAST_DEVICE_TYPE + 1);
    next_device      = DEV_UNK;
    for (device = 0; device < num_devices; device++) {
        if (devices[device].busy || false == devices[device].int_pending)
            continue;
        /* select device by priority */
        if (devices[device].type < next_device_type) {
            next_device_type = devices[device].type;
            next_device = device;
        }
    }
    if (DEV_UNK != next_device) {
        devices[next_device].int_request = false;
        devices[next_device].int_pending = false;
        *int_device = next_device;
        return true;
    }
    return false;
}

// Assembly:
movl $0xff, %ecx
movl $0x7, %eax
leaq 0xa286(%rip), %rdx      # 0xf190
xorl %esi, %esi
cmpl $0x0, 0x18(%rdx)
jne 0x4f25
cmpl $0x0, 0x40(%rdx)
je 0x4f25
movl (%rdx), %r8d
cmpl %eax, %r8d
cmovbl %esi, %ecx
cmovbl %r8d, %eax
incq %rsi
addq $0x48, %rdx
cmpq $0x14, %rsi
jne 0x4f0c
xorl %eax, %eax
cmpl $0xff, %ecx
je 0x4f59
movl %ecx, %eax
leaq (%rax,%rax,8), %rax
leaq 0xa247(%rip), %rdx      # 0xf190
movq $0x0, 0x3c(%rdx,%rax,8)
movl %ecx, (%rdi)
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: punch_object_deck
void punch_object_deck(const char *title, Address start_address)
{
    FILE *card_punch;
    Address address;
    Cell cell;
    unsigned num_cards;
    int i, num_words;

    card_punch = fopen (methods[card_out].base_filename, methods[card_out].fam);
    if (NULL == card_punch)
        error ("Cannot open card puncher");
    num_cards = 0;
    for (address = 100; address < memory_size; address++) {
        num_words = 0;
        for (i = 0; i < 7; i++) {
            if (memory_size <= address + i)
                break;
            cell = memory_fetch (address);
            if (magnitude (cell))
               num_words = i + 1;
        }
        if (num_words) {
            punch_card (card_punch, title, address, num_words);
            num_cards++;
            address += 6;
        }
    }
    if (num_cards) {
        fprintf (card_punch, "TRANS0%04d\n", abs(start_address));
        fflush (card_punch);
    }
    fclose (card_punch);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %r14d
movq %rdi, 0x20(%rsp)
leaq 0x467f(%rip), %rdi      # 0x95f6
leaq 0x4ec0(%rip), %rsi      # 0x9e3e
callq 0x3250
movq %rax, %rbx
testq %rax, %rax
jne 0x4f99
leaq 0x454d(%rip), %rdi      # 0x94df
xorl %eax, %eax
callq 0x5bec
leaq 0xbe14(%rip), %rbp      # 0x10db4
cmpl $0x65, (%rbp)
jl 0x50f4
movl %r14d, 0xc(%rsp)
movl $0x64, %r15d
leaq 0x47b6(%rip), %r13      # 0x9772
movl $0x0, 0x8(%rsp)
movl $0x1, %r12d
xorl %r14d, %r14d
leal (%r15,%r12), %eax
decl %eax
cmpl %eax, (%rbp)
jle 0x4ff1
movl %r15d, %edi
callq 0x6cad
shlq $0x22, %rax
cmovnel %r12d, %r14d
incl %r12d
cmpl $0x8, %r12d
jne 0x4fcd
testl %r14d, %r14d
je 0x50bc
movq %rbx, %rdi
leaq 0x475b(%rip), %rsi      # 0x975f
movq 0x20(%rsp), %rdx
movl %r14d, %ecx
movl %r15d, %r8d
xorl %eax, %eax
callq 0x31c0
testl %r14d, %r14d
jle 0x5089
xorl %r12d, %r12d
leal (%r15,%r12), %edi
cmpl %edi, (%rbp)
jle 0x507c
callq 0x6cad
movq %rax, %r13
movl %r13d, %edx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
leaq 0x10(%rsp), %rdi
leaq 0x4727(%rip), %rsi      # 0x976b
xorl %eax, %eax
callq 0x3280
btl $0x1e, %r13d
jae 0x5067
movsbq 0x19(%rsp), %rax
leaq 0x46f5(%rip), %rcx      # 0x9754
movb -0x30(%rax,%rcx), %al
movb %al, 0x19(%rsp)
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x3140
incl %r12d
cmpl %r12d, %r14d
jne 0x501e
cmpl $0x6, %r14d
leaq 0x46eb(%rip), %r13      # 0x9772
jg 0x50a7
addl $-0x7, %r14d
movl $0xa, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x32a0
incl %r14d
jne 0x508d
movl $0xa, %edi
movq %rbx, %rsi
callq 0x3170
incl 0x8(%rsp)
addl $0x6, %r15d
incl %r15d
cmpl (%rbp), %r15d
jl 0x4fc4
cmpl $0x0, 0x8(%rsp)
movl 0xc(%rsp), %eax
je 0x50f4
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
leaq 0x4416(%rip), %rsi      # 0x94f8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x31c0
movq %rbx, %rdi
callq 0x3200
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30f0
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: io_mark_incomplete
static void io_mark_incomplete(Address buffer, unsigned block_size, int mark)
{
    int i, current_count;

    if (buffer < 0) {
        if (normal_state == get_internal_state())
            error("Cannot access control store in normal state");
    }

    if (dbg > 2) {
        fflush(stdout);
        fprintf(stderr, "io_mark_incomplete(%d,%d,%d)\n",
                buffer, block_size, mark);
    }
    for (i = 0; i < block_size; i++) {
        if (memory_size <= magnitude(buffer + i))
            error("Address out of range -- io_mark_incomplete");
        current_count = fetch_incomplete(buffer + i);
        if (current_count + mark < 0) {
            if (dbg > 3) {
                fflush(stdout);
                fprintf(stderr, "current: %d, mark: %d\n", current_count, mark);
            }
            error("Overlapping buffers -- io_mark_incomplete");
        }
        store_incomplete(buffer + i, current_count + mark);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movl %edi, %r14d
testl %edi, %edi
jns 0x5137
callq 0x6a18
testl %eax, %eax
jne 0x5137
leaq 0x442c(%rip), %rdi      # 0x955c
xorl %eax, %eax
callq 0x5bec
testl %ebp, %ebp
je 0x51dd
movslq %r14d, %r12
movl %ebp, %r13d
leaq (,%r12,4), %r14
movq %r14, %rbp
negq %rbp
movl %r12d, %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
leaq 0xbc52(%rip), %rcx      # 0x10db4
cmpl %eax, (%rcx)
jg 0x5174
leaq 0x441b(%rip), %rdi      # 0x9588
xorl %eax, %eax
callq 0x5bec
movq 0xab4d(%rip), %rax      # 0xfcc8
leaq (%rax,%rbp), %rdx
movq 0xab3a(%rip), %rcx      # 0xfcc0
leaq (%rcx,%r14), %rsi
testq %r12, %r12
cmovsq %rdx, %rsi
movl (%rsi), %r15d
addl %ebx, %r15d
jns 0x51b5
leaq 0x4413(%rip), %rdi      # 0x95b3
xorl %eax, %eax
callq 0x5bec
movq 0xab12(%rip), %rcx      # 0xfcc0
movq 0xab13(%rip), %rax      # 0xfcc8
movl %r12d, %edx
negl %edx
cmovsl %r12d, %edx
testq %r12, %r12
cmovnsq %rcx, %rax
movl %r15d, (%rax,%rdx,4)
addq $0x4, %r14
addq $-0x4, %rbp
incq %r12
decq %r13
jne 0x5153
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: disk_in
static void disk_in(Byte device, Cell rX, Address buffer)
{
    unsigned block_num;

    block_num = (unsigned) field(make_field_spec(4, 5), rX);
    if (devices[device].type == drum)
        block_num &= 511;

    set_file_position(device, block_num, false);
    read_block(device, buffer);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %ebp
movl $0x4, %edi
movl $0x5, %esi
callq 0x382a
movl %eax, %edi
movq %r14, %rsi
callq 0x37cd
movl %ebp, %ecx
leaq (%rcx,%rcx,8), %rcx
leaq 0x9f73(%rip), %rdx      # 0xf190
movl %eax, %esi
andl $0x1ff, %esi            # imm = 0x1FF
cmpl $0x0, (%rdx,%rcx,8)
cmovnel %eax, %esi
movl %ebp, %edi
callq 0x564b
movl %ebp, %edi
movl %ebx, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x5728
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: disk_ioc
static void disk_ioc(Byte device, Cell rX, Cell offset)
{
    unsigned block_num;

    if (magnitude(offset) != 0)
        error("IOC argument undefined for disk device %02o", device);

    block_num = (unsigned) field(make_field_spec(4, 5), rX);
    if (devices[device].type == drum)
        block_num &= 511;

    set_file_position(device, block_num, false);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
shlq $0x22, %rdx
je 0x52b3
leaq 0x43d3(%rip), %rdi      # 0x967d
movl %ebx, %esi
xorl %eax, %eax
callq 0x5bec
movl $0x4, %edi
movl $0x5, %esi
callq 0x382a
movl %eax, %edi
movq %r14, %rsi
callq 0x37cd
movl %ebx, %ecx
leaq (%rcx,%rcx,8), %rcx
leaq 0x9eb7(%rip), %rdx      # 0xf190
movl %eax, %esi
andl $0x1ff, %esi            # imm = 0x1FF
cmpl $0x0, (%rdx,%rcx,8)
cmovnel %eax, %esi
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x564b
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: tape_ioc
static void tape_ioc(unsigned device, Cell rX, Cell offset)
{
    unsigned block_num, position;
    FILE *fd;
    int c;

    block_num = (unsigned) magnitude(offset);
    if (block_num == 0)
        set_file_position(device, 0, false);
    else if (is_negative(offset)) {
        position = get_file_position(device);
        if (position < block_num)
            block_num = 0;
        else
            block_num = position - block_num;
        set_file_position(device, block_num, false);
    } else {
        fd = assigned_file(device);
        position = get_file_position(device);
        while (block_num--) {
            set_file_position(device, ++position, false);
            c = fgetc(fd);
            if (c == EOF)
                break;
            if (ungetc(c, fd) == EOF)
                error("Device %02o: %s", device, strerror(errno));
        }
    }
    devices[device].position = get_file_position(device);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edx, %r13d
movl %edi, %r12d
andl $0x3fffffff, %r13d      # imm = 0x3FFFFFFF
je 0x5384
btl $0x1e, %edx
jb 0x5388
cmpb $0x1, 0xa94b(%rip)      # 0xfcb8
jne 0x53c8
leaq (%r12,%r12,8), %rax
leaq 0x9e16(%rip), %rcx      # 0xf190
leaq (%rcx,%rax,8), %rax
addq $0x8, %rax
jmp 0x53f5
xorl %esi, %esi
jmp 0x5399
movl %ebx, %edi
callq 0x5979
movl %eax, %esi
xorl %eax, %eax
subl %r13d, %esi
cmovbl %eax, %esi
movl %ebx, %edi
callq 0x564b
movl %ebx, %edi
callq 0x5979
movl %eax, %eax
leaq (%r12,%r12,8), %rcx
leaq 0x9ddc(%rip), %rdx      # 0xf190
movq %rax, 0x10(%rdx,%rcx,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%r12,%r12,8), %rax
leaq 0x9dbd(%rip), %rcx      # 0xf190
movl (%rcx,%rax,8), %edx
addl $-0x3, %edx
cmpl $0x3, %edx
jae 0x53ed
movl %edx, %eax
leaq 0x93b1(%rip), %rcx      # 0xe798
movq (%rcx,%rax,8), %rax
jmp 0x53f5
leaq (%rcx,%rax,8), %rax
addq $0x8, %rax
movq (%rax), %r14
movl %ebx, %edi
callq 0x5979
movl %eax, %ebp
incl %ebp
leaq 0x420c(%rip), %r15      # 0x9616
movl %ebx, %edi
movl %ebp, %esi
callq 0x564b
movq %r14, %rdi
callq 0x3150
cmpl $-0x1, %eax
je 0x53a0
movl %eax, %edi
movq %r14, %rsi
callq 0x3210
cmpl $-0x1, %eax
jne 0x544a
callq 0x3070
movl (%rax), %edi
callq 0x32b0
movq %r15, %rdi
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x5bec
decl %r13d
incl %ebp
testl %r13d, %r13d
jne 0x540a
jmp 0x53a0
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: text_in
static FILE *assigned_file(unsigned device)
{
    if (redirect_devices)
        return devices[device].file;

    /* glibc2.1 fix -ajk */
    switch (devices[device].type) {
    case card_in:
        return stdin; break;
    case card_out: case printer:
        return stdout; break;
    default:
        return devices[device].file;
    }
}

// Assembly:
movl %edi, %eax
cmpb $0x1, 0xa856(%rip)      # 0xfcb8
jne 0x547c
leaq (%rax,%rax,8), %rax
leaq 0x9d21(%rip), %rcx      # 0xf190
leaq (%rcx,%rax,8), %rcx
addq $0x8, %rcx
movl -0x8(%rcx), %eax
jmp 0x54a9
leaq (%rax,%rax,8), %rcx
leaq 0x9d09(%rip), %rsi      # 0xf190
movl (%rsi,%rcx,8), %eax
leal -0x3(%rax), %edi
cmpl $0x3, %edi
jae 0x54a1
movl %edi, %ecx
leaq 0x92fd(%rip), %rsi      # 0xe798
movq (%rsi,%rcx,8), %rcx
jmp 0x54a9
leaq (%rsi,%rcx,8), %rcx
addq $0x8, %rcx
movq (%rcx), %rdi
movl %eax, %eax
imulq $0x38, %rax, %rax
leaq 0x9157(%rip), %rcx      # 0xe610
movl 0x14(%rax,%rcx), %eax
movl %edx, %esi
movl %eax, %edx
jmp 0x59f9
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: set_file_position
static void set_file_position(Byte device, unsigned block, Flag writing)
{
    if (devices[device].position != (long) block) {
        if (attributes(device)->size != 0 && attributes(device)->size <= block)
            error("Device %02o full!");
        else {
            if (fseek(assigned_file(device),
                      (long) block * external_block_size(device),
                  SEEK_SET))
                error("Device %02o: %s", device, strerror(errno));
              devices[device].position = (long) block;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %eax
leaq (%rax,%rax,8), %rax
leaq 0x9b33(%rip), %rcx      # 0xf190
movl %esi, %r14d
cmpq %r14, 0x10(%rcx,%rax,8)
je 0x5722
movl %edi, %ebx
movl (%rcx,%rax,8), %edi
imulq $0x38, %rdi, %rdx
leaq 0x8f95(%rip), %r8       # 0xe610
leaq -0x3(%rdi), %r9
cmpq $0x4, %r9
setb %r9b
cmpl %esi, 0x10(%rdx,%r8)
seta %sil
orb %r9b, %sil
je 0x56a8
cmpb $0x1, 0xa61c(%rip)      # 0xfcb8
jne 0x56bb
leaq (%rcx,%rax,8), %rsi
addq $0x8, %rsi
jmp 0x56da
leaq 0x3f55(%rip), %rdi      # 0x9604
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x5bec
addl $-0x3, %edi
cmpl $0x3, %edi
jae 0x56d2
movl %edi, %esi
leaq 0x90cc(%rip), %rdi      # 0xe798
movq (%rdi,%rsi,8), %rsi
jmp 0x56da
leaq (%rcx,%rax,8), %rsi
addq $0x8, %rsi
leaq (%rcx,%rax,8), %r15
addq $0x10, %r15
movq (%rsi), %rdi
movl 0x14(%rdx,%r8), %eax
addl %eax, %eax
leal (%rax,%rax,2), %esi
incl %esi
imulq %r14, %rsi
xorl %edx, %edx
callq 0x3220
testl %eax, %eax
je 0x571f
callq 0x3070
movl (%rax), %edi
callq 0x32b0
leaq 0x3f03(%rip), %rdi      # 0x9616
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x5bec
movq %r14, (%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: read_block
static void read_block(Byte device, Address buffer)
{
    FILE *file = assigned_file(device);
    unsigned size = block_size(device);
    unsigned i, b;
    int c;

    for (i = 0; i < size; ++i) {
        Cell cell = zero;
        c = fgetc(file);
        if (c == EOF) {
            if (true /*get_halting()*/) {
                fflush(stdout);
                fprintf(stderr, "Unexpected EOF reading from device %02o\n", device);
                return;
            }
            else
                error("Unexpected EOF reading from device %02o", device);
        }
        else if (c == '-')
            cell = negative(cell);
    
        for (b = 1; b <= 5; ++b) {
            c = fgetc(file);
            if (c == EOF) {
                if (true /*get_halting()*/) {
                    fflush(stdout);
                    fprintf(stderr, "Unexpected EOF reading from device %02o\n", device);
                    return;
                }
                else
                    error("Unexpected EOF reading from device %02o", device);
            }
            cell = set_byte(C_int_to_mix(c), b, cell);
        }
        memory_store(buffer + i, cell);
    }
    c = fgetc(file);            /* should be '\n' */
    assert(c == '\n');
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movl %edi, %eax
cmpb $0x1, 0xa579(%rip)      # 0xfcb8
movl %edi, 0x4(%rsp)
jne 0x575d
leaq (%rax,%rax,8), %rax
leaq 0x9a40(%rip), %rcx      # 0xf190
leaq (%rcx,%rax,8), %rcx
addq $0x8, %rcx
movl -0x8(%rcx), %eax
jmp 0x578a
leaq (%rax,%rax,8), %rcx
leaq 0x9a28(%rip), %rdx      # 0xf190
movl (%rdx,%rcx,8), %eax
leal -0x3(%rax), %esi
cmpl $0x3, %esi
jae 0x5782
movl %esi, %ecx
leaq 0x901c(%rip), %rdx      # 0xe798
movq (%rdx,%rcx,8), %rcx
jmp 0x578a
leaq (%rdx,%rcx,8), %rcx
addq $0x8, %rcx
movq (%rcx), %r15
movl %eax, %eax
imulq $0x38, %rax, %rax
leaq 0x8e76(%rip), %rcx      # 0xe610
movl 0x14(%rax,%rcx), %r13d
cmpl $0x1, %r13d
adcl $0x0, %r13d
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x3150
cmpl $0x2d, %eax
je 0x57c0
cmpl $-0x1, %eax
je 0x5834
xorl %r12d, %r12d
jmp 0x57c6
movl $0x40000000, %r12d      # imm = 0x40000000
movl $0x1, %ebp
movq %r15, %rdi
callq 0x3150
cmpl $-0x1, %eax
je 0x5834
movl %eax, %edi
callq 0x41e5
movl %eax, %edi
movl %ebp, %esi
movq %r12, %rdx
callq 0x385b
movq %rax, %r12
incl %ebp
cmpl $0x6, %ebp
jne 0x57cb
leal (%rbx,%r14), %edi
movq %r12, %rsi
callq 0x6d25
incl %ebx
cmpl %r13d, %ebx
jne 0x57a9
movq %r15, %rdi
callq 0x3150
cmpl $0xa, %eax
je 0x583d
leaq 0x3e33(%rip), %rdi      # 0x964f
leaq 0x3e36(%rip), %rsi      # 0x9659
leaq 0x3e34(%rip), %rcx      # 0x965e
movl $0x26f, %edx            # imm = 0x26F
callq 0x3130
movl 0x4(%rsp), %edi
callq 0x32f0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: write_line
static void write_line(FILE *file, Address buffer, unsigned size, Flag text)
{
    unsigned i;
    for (i = 0; i < size; ++i)
        write_cell(memory_fetch(buffer + i), file, text);
    fputc('\n', file);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, 0x4(%rsp)
movq %rdi, %r14
testl %edx, %edx
je 0x595e
movl %edx, %ebp
movl %esi, %r15d
xorl %ebx, %ebx
leal (%rbx,%r15), %edi
callq 0x6cad
movq %rax, %r12
cmpl $0x0, 0x4(%rsp)
je 0x5916
movl $0x1, %r13d
movl %r13d, %edi
movq %r12, %rsi
callq 0x3774
movl %eax, %edi
callq 0x4134
movsbl %al, %edi
movq %r14, %rsi
callq 0x3170
incl %r13d
cmpl $0x6, %r13d
jne 0x58ee
jmp 0x5954
btl $0x1e, %r12d
movl $0x2d, %edi
movl $0x20, %eax
cmovael %eax, %edi
movq %r14, %rsi
callq 0x3170
movl $0x1, %r13d
movl %r13d, %edi
movq %r12, %rsi
callq 0x3774
movl %eax, %edi
movq %r14, %rsi
callq 0x3170
incl %r13d
cmpl $0x6, %r13d
jne 0x5936
incl %ebx
cmpl %ebp, %ebx
jne 0x58d5
movl $0xa, %edi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3170
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/io.c
// Function: read_line
static void read_line(FILE* file, Address buffer, unsigned size)
{
    unsigned i, b;
    Flag past_end = false;

    for (i = 0; i < size; ++i) {
        Cell cell = zero;
        for (b = 1; b <= 5; ++b) {
            Byte mix_char;
            if (past_end)
                mix_char = (Byte) 0;
            else {
                int c = fgetc(file);
                if (c == '\n' || c == EOF) {
                    past_end = true, mix_char = (Byte) 0;
                } else
                    mix_char = C_char_to_mix((char) c);
            }
            cell = set_byte(mix_char, b, cell);
        }
        if (dbg) {
            printf("read_line: %3d = ", buffer + i);
            write_cell (cell, stdout, true);
            printf("\n");
        }
        memory_store(buffer + i, cell);
    }
    if (false == past_end) {
        int c = fgetc(file);
        if (c != '\n' && c != EOF)
            error("Line not terminated (%d)", c);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, %rbx
movl %edx, 0xc(%rsp)
testl %edx, %edx
je 0x5aae
xorl %r13d, %r13d
xorl %r14d, %r14d
movl $0x1, %r12d
xorl %r15d, %r15d
xorl %ebp, %ebp
movl $0x0, %edi
testl %r14d, %r14d
movl $0x1, %r14d
je 0x5a55
movl %r12d, %esi
movq %r15, %rdx
callq 0x385b
movq %rax, %r15
incl %r12d
cmpl $0x6, %r12d
jne 0x5a2a
jmp 0x5a8a
movq %rbx, %rdi
callq 0x3150
xorl %ebp, %ebp
movl $0x1, %r14d
cmpl $-0x1, %eax
je 0x5a86
movl $0x0, %edi
cmpl $0xa, %eax
je 0x5a3c
movsbl %al, %edi
callq 0x4189
movl %eax, %edi
xorl %r14d, %r14d
movb $0x1, %bpl
jmp 0x5a3c
xorl %edi, %edi
jmp 0x5a3c
movq 0x10(%rsp), %rax
leal (%rax,%r13), %edi
movq %r15, %rsi
callq 0x6d25
incl %r13d
cmpl 0xc(%rsp), %r13d
jne 0x5a21
testb %bpl, %bpl
je 0x5ac0
movq %rbx, %rdi
callq 0x3150
cmpl $-0x1, %eax
je 0x5ac0
cmpl $0xa, %eax
jne 0x5acf
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3bd3(%rip), %rdi      # 0x96a9
movl %eax, %esi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5bec
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/main.c
// Function: fatal_error
void fatal_error(const char *message, ...)
{
    va_list args;

    if (current_file)   /*** of course, the error may not have anything to do with the file... */
        fprintf(stderr, "FATAL ERROR (%s, line %u): ", current_file, line_number);
    else
        fprintf(stderr, "FATAL ERROR: ");

    va_start(args, message);
    vfprintf(stderr, message, args);
    va_end(args);
    fprintf(stderr, "\n");

    io_shutdown();
    exit(1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x5b51
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq 0xb190(%rip), %rdx      # 0x10ce8
movq 0x9499(%rip), %r14      # 0xeff8
movq (%r14), %rcx
testq %rdx, %rdx
jne 0x5b7f
leaq 0x3c92(%rip), %rdi      # 0x9800
movl $0xd, %esi
movl $0x1, %edx
callq 0x32a0
jmp 0x5b98
movl 0xb16b(%rip), %eax      # 0x10cf0
leaq 0x3c58(%rip), %rsi      # 0x97e4
movq %rcx, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0x31c0
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3260
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3170
callq 0x4e54
movl $0x1, %edi
callq 0x3290
// File: /workspace/github_c_makefile_star2_O3/pahihu[P]mixal/main.c
// Function: error
void error(const char *message, ...)
{
    va_list args;

    fflush(stdout);

    ++num_errors;
    va_start(args, message);
    if (error_handler)
        error_handler(message, args);
    else
        fatal_error("No error handler installed");
    va_end(args);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x5c4d
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq 0x937c(%rip), %rax      # 0xefd0
movq (%rax), %rdi
callq 0x3200
incl 0xb09e(%rip)            # 0x10d00
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq 0xb06f(%rip), %rax      # 0x10cf8
testq %rax, %rax
je 0x5ca1
movq %rsp, %rsi
movq %rbx, %rdi
callq *%rax
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3b66(%rip), %rdi      # 0x980e
xorl %eax, %eax
callq 0x5af0