LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_booleans
int rs_write_booleans(FILE *savef, bool *c, int count)
{
    int n = 0;

    rs_write_int(savef,count);
    
    for(n = 0; n < count; n++)
        rs_write_boolean(savef,c[n]);

    return(WRITESTAT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %esi
callq 0x14801
xorl %r12d, %r12d
testl %ebx, %ebx
cmovlel %r12d, %ebx
cmpq %r12, %rbx
je 0x1486b
movzbl (%r14,%r12), %esi
movq %r15, %rdi
callq 0x147df
incq %r12
jmp 0x14854
xorl %eax, %eax
cmpl $0x0, 0x1ec00(%rip)     # 0x33474
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_short
int rs_write_short(FILE *savef, short c)
{
    unsigned char bytes[2];
    unsigned char *buf = (unsigned char *) &c;

    if (big_endian)
    {
        bytes[1] = buf[0];
        bytes[0] = buf[1];
        buf = bytes;
    }

    rs_write(savef, buf, 2);

    return(WRITESTAT);
}

// Assembly:
pushq %rax
movl %esi, %eax
movw %ax, 0x4(%rsp)
cmpl $0x0, 0x1ebcc(%rip)     # 0x33480
je 0x148c4
rolw $0x8, %ax
leaq 0x6(%rsp), %rsi
movw %ax, (%rsi)
jmp 0x148c9
leaq 0x4(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x14776
xorl %eax, %eax
cmpl $0x0, 0x1eb9a(%rip)     # 0x33474
sete %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_shorts
int rs_write_shorts(FILE *savef, short *c, int count)
{
    int n = 0;

    rs_write_int(savef,count);
    
    for(n = 0; n < count; n++)
        rs_write_short(savef,c[n]);

    return(WRITESTAT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %esi
callq 0x14801
xorl %r12d, %r12d
testl %ebx, %ebx
cmovlel %r12d, %ebx
cmpq %r12, %rbx
je 0x14916
movswl (%r14,%r12,2), %esi
movq %r15, %rdi
callq 0x148a5
incq %r12
jmp 0x148ff
xorl %eax, %eax
cmpl $0x0, 0x1eb55(%rip)     # 0x33474
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_ushort
int rs_write_ushort(FILE *savef, unsigned short c)
{
    unsigned char bytes[2];
    unsigned char *buf = (unsigned char *) &c;

    if (big_endian)
    {
        bytes[1] = buf[0];
        bytes[0] = buf[1];
        buf = bytes;
    }

    rs_write(savef, buf, 2);

    return(WRITESTAT);
}

// Assembly:
pushq %rax
movl %esi, %eax
movw %ax, 0x4(%rsp)
cmpl $0x0, 0x1eb43(%rip)     # 0x33480
je 0x1494d
rolw $0x8, %ax
leaq 0x6(%rsp), %rsi
movw %ax, (%rsi)
jmp 0x14952
leaq 0x4(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x14776
xorl %eax, %eax
cmpl $0x0, 0x1eb11(%rip)     # 0x33474
sete %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_ints
int rs_write_ints(FILE *savef, int *c, int count)
{
    int n = 0;

    rs_write_int(savef,count);
    
    for(n = 0; n < count; n++)
        rs_write_int(savef,c[n]);

    return(WRITESTAT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %esi
callq 0x14801
xorl %r12d, %r12d
testl %ebx, %ebx
cmovlel %r12d, %ebx
cmpq %r12, %rbx
je 0x1499e
movl (%r14,%r12,4), %esi
movq %r15, %rdi
callq 0x14801
incq %r12
jmp 0x14988
xorl %eax, %eax
cmpl $0x0, 0x1eacd(%rip)     # 0x33474
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_uint
int rs_write_uint(FILE *savef, unsigned int c)
{
    unsigned char bytes[4];
    unsigned char *buf = (unsigned char *) &c;

    if (big_endian)
    {
        bytes[3] = buf[0];
        bytes[2] = buf[1];
        bytes[1] = buf[2];
        bytes[0] = buf[3];
        buf = bytes;
    }
    
    rs_write(savef, buf, 4);

    return(WRITESTAT);
}

// Assembly:
pushq %rax
movl %esi, (%rsp)
cmpl $0x0, 0x1eabf(%rip)     # 0x33480
je 0x149d0
movl %esi, %eax
bswapl %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
jmp 0x149d3
movq %rsp, %rsi
pushq $0x4
popq %rdx
callq 0x14776
xorl %eax, %eax
cmpl $0x0, 0x1ea90(%rip)     # 0x33474
sete %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_longs
int rs_write_longs(FILE *savef, long *c, int count)
{
    int n = 0;

    rs_write_int(savef,count);
    
    for(n = 0; n < count; n++)
        rs_write_long(savef,c[n]);

    return(WRITESTAT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %esi
callq 0x14801
xorl %r12d, %r12d
testl %ebx, %ebx
cmovlel %r12d, %ebx
cmpq %r12, %rbx
je 0x14a53
movq (%r14,%r12,8), %rsi
movq %r15, %rdi
callq 0x149e9
incq %r12
jmp 0x14a3d
xorl %eax, %eax
cmpl $0x0, 0x1ea18(%rip)     # 0x33474
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_ulongs
int rs_write_ulongs(FILE *savef, unsigned long *c, int count)
{
    int n = 0;

    rs_write_int(savef,count);
    
    for(n = 0; n < count; n++)
        rs_write_ulong(savef,c[n]);

    return(WRITESTAT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %esi
callq 0x14801
xorl %r12d, %r12d
testl %ebx, %ebx
cmovlel %r12d, %ebx
cmpq %r12, %rbx
je 0x14ad5
movq (%r14,%r12,8), %rsi
movq %r15, %rdi
callq 0x14a6b
incq %r12
jmp 0x14abf
xorl %eax, %eax
cmpl $0x0, 0x1e996(%rip)     # 0x33474
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_string
int rs_write_string(FILE *savef, char *s)
{
    int len = 0;

    len = (s == NULL) ? 0 : strlen(s) + 1;

    rs_write_int(savef, len);
    rs_write(savef, s, len);
            
    return(WRITESTAT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x14b0d
movq %rbx, %rdi
callq 0x6170
movq %rax, %r15
incl %r15d
jmp 0x14b10
xorl %r15d, %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x14801
movq %r14, %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x14776
xorl %eax, %eax
cmpl $0x0, 0x1e942(%rip)     # 0x33474
sete %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_string_index
int rs_write_string_index(FILE *savef, char *master[], int max, char *str)
{
    int i;

    for(i = 0; i < max; i++)
    {
        if (str == master[i])
        {
            rs_write_int(savef,i);
            return(WRITESTAT);
        }
    }

    rs_write_int(savef,-1);

    return(WRITESTAT);
}

// Assembly:
movq %rsi, %rax
xorl %r8d, %r8d
testl %edx, %edx
cmovlel %r8d, %edx
pushq $-0x1
popq %rsi
cmpq %r8, %rdx
je 0x14b5d
cmpq %rcx, (%rax,%r8,8)
je 0x14b5a
incq %r8
jmp 0x14b4a
movl %r8d, %esi
pushq %rax
callq 0x14801
xorl %eax, %eax
cmpl $0x0, 0x1e908(%rip)     # 0x33474
sete %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_strings
int rs_write_strings(FILE *savef, char *s[], int count)
{
    int len = 0;
    int n = 0;

    rs_write_int(savef,count);

    for(n = 0; n < count; n++)
    {
        len = (s[n] == NULL) ? 0L : strlen(s[n]) + 1;
        rs_write_int(savef, len);
        rs_write(savef, s[n], len);
    }
    
    return(WRITESTAT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %esi
callq 0x14801
xorl %r13d, %r13d
testl %ebx, %ebx
cmovlel %r13d, %ebx
cmpq %r13, %rbx
je 0x14bcf
movq (%r14,%r13,8), %rdi
testq %rdi, %rdi
je 0x14bad
callq 0x6170
movq %rax, %r12
incl %r12d
jmp 0x14bb0
xorl %r12d, %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x14801
movq (%r14,%r13,8), %rsi
movq %r15, %rdi
movl %r12d, %edx
callq 0x14776
incq %r13
jmp 0x14b92
xorl %eax, %eax
cmpl $0x0, 0x1e89c(%rip)     # 0x33474
sete %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read
int rs_read(int inf, void *ptr, int size)
{
    int actual;

    end_of_file = FALSE;

    if (!read_error && !format_error)
    {
        actual = encread(ptr, size, inf);

        if ((actual == 0) && (size != 0))
           end_of_file = TRUE;
    }
       
    if (read_error)
    {
        printf("read error has occurred. restore short-circuited.\n");
        abort();
    }

    if (format_error)
    {
        printf("format error: %s\r\n", fmterr);
        printf("game format invalid. restore short-circuited.\n");
        abort();
    }

    return(READSTAT);
}

// Assembly:
pushq %rbx
andl $0x0, 0x1e88f(%rip)     # 0x3347c
movl 0x1e87d(%rip), %eax     # 0x33470
movl 0x1e87f(%rip), %ecx     # 0x33478
orl %eax, %ecx
jne 0x14c23
movl %edx, %ebx
movl %edi, %edx
movq %rsi, %rdi
movl %ebx, %esi
callq 0x146da
testl %ebx, %ebx
je 0x14c1d
testl %eax, %eax
jne 0x14c1d
movl $0x1, 0x1e85f(%rip)     # 0x3347c
movl 0x1e84d(%rip), %eax     # 0x33470
testl %eax, %eax
jne 0x14c35
cmpl $0x0, 0x1e84a(%rip)     # 0x33478
jne 0x14c3e
pushq $0x1
popq %rax
popq %rbx
retq
leaq 0xc61b(%rip), %rdi      # 0x21257
jmp 0x14c5a
movq 0x1887b(%rip), %rsi     # 0x2d4c0
leaq 0xc0df(%rip), %rdi      # 0x20d2b
xorl %eax, %eax
callq 0x61c0
leaq 0xc5cf(%rip), %rdi      # 0x21229
callq 0x60f0
callq 0x6090
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_int
int rs_read_int(int inf, int *i)
{
    unsigned char bytes[4];
    int  input;
    unsigned char *buf = (unsigned char *)&input;
    
    rs_read(inf, &input, 4);

    if (big_endian)
    {
        bytes[3] = buf[0];
        bytes[2] = buf[1];
        bytes[1] = buf[2];
        bytes[0] = buf[3];
        buf = bytes;
    }
    
    *i = *((int *) buf);

    return(READSTAT);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x4(%rsp), %r14
pushq $0x4
popq %rdx
movq %r14, %rsi
callq 0x14be5
cmpl $0x0, 0x1e7ab(%rip)     # 0x33480
movl (%r14), %eax
movl %eax, %ecx
bswapl %ecx
cmovel %eax, %ecx
movl %ecx, (%rbx)
movl 0x1e789(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e789(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_booleans
int rs_read_booleans(int inf, bool *i, int count)
{
    int n = 0, value = 0;
    
    if (rs_read_int(inf,&value) != 0)
    {
        if (value != count)
        {
            printf("Invalid booleans block. %d != requested %d\n",value,count); 
            format_error = TRUE;
        }
        else
        {
            for(n = 0; n < value; n++)
                rs_read_boolean(inf, &i[n]);
        }
    }
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
callq 0x14cb7
testl %eax, %eax
je 0x14d5d
movl 0x4(%rsp), %esi
cmpl %r14d, %esi
jne 0x14d42
xorl %r15d, %r15d
testl %r14d, %r14d
cmovgl %r14d, %r15d
subq $0x1, %r15
jb 0x14d5d
movl %ebp, %edi
movq %rbx, %rsi
callq 0x14c80
incq %rbx
jmp 0x14d2d
leaq 0xbff5(%rip), %rdi      # 0x20d3e
movl %r14d, %edx
xorl %eax, %eax
callq 0x61c0
movl $0x1, 0x1e71b(%rip)     # 0x33478
movl 0x1e70d(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e70d(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_short
int rs_read_short(int inf, short *i)
{
    unsigned char bytes[2];
    short  input;
    unsigned char *buf = (unsigned char *)&input;
    
    rs_read(inf, &input, 2);

    if (big_endian)
    {
        bytes[1] = buf[0];
        bytes[0] = buf[1];
        buf = bytes;
    }
    
    *i = *((short *) buf);

    return(READSTAT);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x4(%rsp), %r14
pushq $0x2
popq %rdx
movq %r14, %rsi
callq 0x14be5
cmpl $0x0, 0x1e6b4(%rip)     # 0x33480
je 0x14de0
movzwl 0x4(%rsp), %eax
rolw $0x8, %ax
leaq 0x6(%rsp), %r14
movw %ax, (%r14)
movzwl (%r14), %eax
movw %ax, (%rbx)
movl 0x1e683(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e683(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_shorts
int rs_read_shorts(int inf, short *i, int count)
{
    int n = 0, value = 0;

    if (rs_read_int(inf,&value) != 0)
    {
        if (value != count)
            format_error = TRUE;
        else
        {
            for(n = 0; n < value; n++)
                rs_read_short(inf, &i[n]);
        }
    }
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
callq 0x14cb7
testl %eax, %eax
je 0x14e51
cmpl %r14d, 0x4(%rsp)
jne 0x14e47
xorl %r15d, %r15d
testl %r14d, %r14d
cmovgl %r14d, %r15d
subq $0x1, %r15
jb 0x14e51
movl %ebp, %edi
movq %rbx, %rsi
callq 0x14dae
addq $0x2, %rbx
jmp 0x14e31
movl $0x1, 0x1e627(%rip)     # 0x33478
movl 0x1e619(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e619(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_ushort
int rs_read_ushort(int inf, unsigned short *i)
{
    unsigned char bytes[2];
    unsigned short  input;
    unsigned char *buf = (unsigned char *)&input;
    
    rs_read(inf, &input, 2);

    if (big_endian)
    {
        bytes[1] = buf[0];
        bytes[0] = buf[1];
        buf = bytes;
    }
    
    *i = *((unsigned short *) buf);

    return(READSTAT);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x4(%rsp), %r14
pushq $0x2
popq %rdx
movq %r14, %rsi
callq 0x14be5
cmpl $0x0, 0x1e5f5(%rip)     # 0x33480
je 0x14e9f
movzwl 0x4(%rsp), %eax
rolw $0x8, %ax
leaq 0x6(%rsp), %r14
movw %ax, (%r14)
movzwl (%r14), %eax
movw %ax, (%rbx)
movl 0x1e5c4(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e5c4(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_ints
int rs_read_ints(int inf, int *i, int count)
{
    int n = 0, value = 0;
    
    if (rs_read_int(inf,&value) != 0)
    {
        if (value != count)
            format_error = TRUE;
        else
        {
            for(n = 0; n < value; n++)
                rs_read_int(inf, &i[n]);
        }
    }
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
callq 0x14cb7
testl %eax, %eax
je 0x14f10
cmpl %r14d, 0x4(%rsp)
jne 0x14f06
xorl %r15d, %r15d
testl %r14d, %r14d
cmovgl %r14d, %r15d
subq $0x1, %r15
jb 0x14f10
movl %ebp, %edi
movq %rbx, %rsi
callq 0x14cb7
addq $0x4, %rbx
jmp 0x14ef0
movl $0x1, 0x1e568(%rip)     # 0x33478
movl 0x1e55a(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e55a(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_uint
int rs_read_uint(int inf, unsigned int *i)
{
    unsigned char bytes[4];
    int  input;
    unsigned char *buf = (unsigned char *)&input;
    
    rs_read(inf, &input, 4);

    if (big_endian)
    {
        bytes[3] = buf[0];
        bytes[2] = buf[1];
        bytes[1] = buf[2];
        bytes[0] = buf[3];
        buf = bytes;
    }
    
    *i = *((unsigned int *) buf);

    return(READSTAT);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x4(%rsp), %r14
pushq $0x4
popq %rdx
movq %r14, %rsi
callq 0x14be5
cmpl $0x0, 0x1e536(%rip)     # 0x33480
movl (%r14), %eax
movl %eax, %ecx
bswapl %ecx
cmovel %eax, %ecx
movl %ecx, (%rbx)
movl 0x1e514(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e514(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_long
int rs_read_long(int inf, long *i)
{
    unsigned char bytes[4];
    long input;
    unsigned char *buf = (unsigned char *) &input;
    
    rs_read(inf, &input, 4);

    if (big_endian)
    {
        bytes[3] = buf[0];
        bytes[2] = buf[1];
        bytes[1] = buf[2];
        bytes[0] = buf[3];
        buf = bytes;
    }
    
    *i = *((long *) buf);

    return(READSTAT);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
leaq 0x10(%rsp), %r14
pushq $0x4
popq %rdx
movq %r14, %rsi
callq 0x14be5
cmpl $0x0, 0x1e4f0(%rip)     # 0x33480
leaq 0xc(%rsp), %rax
cmoveq %r14, %rax
movq (%rax), %rax
movq %rax, (%rbx)
movl 0x1e4cb(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e4cb(%rip), %ecx     # 0x33478
sete %al
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_longs
int rs_read_longs(int inf, long *i, int count)
{
    int n = 0, value = 0;
    
    if (rs_read_int(inf,&value) != 0)
    {
        if (value != count)
            format_error = TRUE;
        else
        {
            for(n = 0; n < value; n++)
                rs_read_long(inf, &i[n]);
        }
    }
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
callq 0x14cb7
testl %eax, %eax
je 0x15009
cmpl %r14d, 0x4(%rsp)
jne 0x14fff
xorl %r15d, %r15d
testl %r14d, %r14d
cmovgl %r14d, %r15d
subq $0x1, %r15
jb 0x15009
movl %ebp, %edi
movq %rbx, %rsi
callq 0x14f6f
addq $0x8, %rbx
jmp 0x14fe9
movl $0x1, 0x1e46f(%rip)     # 0x33478
movl 0x1e461(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e461(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_ulong
int rs_read_ulong(int inf, unsigned long *i)
{
    unsigned char bytes[4];
    unsigned long input;
    unsigned char *buf = (unsigned char *) &input;
    
    rs_read(inf, &input, 4);

    if (big_endian)
    {
        bytes[3] = buf[0];
        bytes[2] = buf[1];
        bytes[1] = buf[2];
        bytes[0] = buf[3];
        buf = bytes;
    }
    
    *i = *((unsigned long *) buf);

    return(READSTAT);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
leaq 0x10(%rsp), %r14
pushq $0x4
popq %rdx
movq %r14, %rsi
callq 0x14be5
cmpl $0x0, 0x1e43a(%rip)     # 0x33480
leaq 0xc(%rsp), %rax
cmoveq %r14, %rax
movq (%rax), %rax
movq %rax, (%rbx)
movl 0x1e415(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e415(%rip), %ecx     # 0x33478
sete %al
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_ulongs
int rs_read_ulongs(int inf, unsigned long *i, int count)
{
    int n = 0, value = 0;
    
    if (rs_read_int(inf,&value) != 0)
    {
        if (value != count)
            format_error = TRUE;
        else
        {
            for(n = 0; n < value; n++)
                rs_read_ulong(inf, &i[n]);
        }
    }
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
callq 0x14cb7
testl %eax, %eax
je 0x150bf
cmpl %r14d, 0x4(%rsp)
jne 0x150b5
xorl %r15d, %r15d
testl %r14d, %r14d
cmovgl %r14d, %r15d
subq $0x1, %r15
jb 0x150bf
movl %ebp, %edi
movq %rbx, %rsi
callq 0x15025
addq $0x8, %rbx
jmp 0x1509f
movl $0x1, 0x1e3b9(%rip)     # 0x33478
movl 0x1e3ab(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e3ab(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_string
int rs_read_string(int inf, char *s, int max)
{
    int len = 0;

    if (rs_read_int(inf, &len) != FALSE)
    {
        if (len > max)
        {
            printf("String too long to restore. %d > %d\n",len,max);
            printf("Sorry, invalid save game format\n");
            format_error = TRUE;
        }
    
        rs_read(inf, s, len);
    }
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
callq 0x14cb7
testl %eax, %eax
je 0x1513c
movl 0x4(%rsp), %r15d
cmpl %r14d, %r15d
jle 0x1512f
leaq 0xbc5e(%rip), %rdi      # 0x20d6a
movl %r15d, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x61c0
leaq 0xc183(%rip), %rdi      # 0x212a3
callq 0x60f0
movl $0x1, 0x1e349(%rip)     # 0x33478
movl %ebp, %edi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x14be5
movl 0x1e32e(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e32e(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_new_string
int rs_read_new_string(int inf, char **s)
{
    int len=0;
    char *buf=0;

    if (rs_read_int(inf, &len) != 0)
    {
        if (len == 0)
            *s = NULL;
        else
        { 
            buf = malloc(len);

            if (buf == NULL)            
                read_error = TRUE;
            else
            {
                rs_read(inf, buf, len);
                *s = buf;
            }
        }
    }

    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
callq 0x14cb7
testl %eax, %eax
je 0x151b1
movslq 0x4(%rsp), %r14
testq %r14, %r14
je 0x151a1
movq %r14, %rdi
callq 0x6330
testq %rax, %rax
je 0x151a7
movq %rax, %r15
movl %ebp, %edi
movq %rax, %rsi
movl %r14d, %edx
callq 0x14be5
movq %r15, (%rbx)
jmp 0x151b1
andq $0x0, (%rbx)
jmp 0x151b1
movl $0x1, 0x1e2bf(%rip)     # 0x33470
movl 0x1e2b9(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e2b9(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_string_index
int rs_read_string_index(int inf, char *master[], int maxindex, char **str)
{
    int i;

    if (rs_read_int(inf,&i) != 0)
    {
        if (i > maxindex)
        {
            printf("String index is out of range. %d > %d\n", i, maxindex);
            printf("Sorry, invalid save game format\n");
            format_error = TRUE;
        }
        else if (i >= 0)
            *str = master[i];
        else
            *str = NULL;
    }

    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
leaq 0xc(%rsp), %rsi
callq 0x14cb7
testl %eax, %eax
je 0x1522c
movl 0xc(%rsp), %esi
cmpl %ebp, %esi
jle 0x1521b
leaq 0xbb95(%rip), %rdi      # 0x20d8f
movl %ebp, %edx
xorl %eax, %eax
callq 0x61c0
leaq 0xc099(%rip), %rdi      # 0x212a3
callq 0x60f0
movl $0x1, 0x1e25f(%rip)     # 0x33478
jmp 0x1522c
testl %esi, %esi
js 0x15228
movq (%r14,%rsi,8), %rax
movq %rax, (%rbx)
jmp 0x1522c
andq $0x0, (%rbx)
movl 0x1e23e(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e23e(%rip), %ecx     # 0x33478
sete %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_strings
int rs_read_strings(int inf, char **s, int count, int max)
{
    int len   = 0;
    int n     = 0;
    int value = 0;
    
    if (rs_read_int(inf,&value) != 0)
    {
        if (value != count)
        {
            printf("Incorrect number of strings in block. %d > %d.", 
                value, count);
            printf("Sorry, invalid save game format");
            format_error = TRUE;
        }
        else
        {
            for(n = 0; n < value; n++)
            {
                rs_read_string(inf, s[n], max);
            }
        }
    }
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %r15d
leaq 0xc(%rsp), %rsi
andl $0x0, (%rsi)
callq 0x14cb7
testl %eax, %eax
je 0x152be
movl 0xc(%rsp), %esi
cmpl %ebx, %esi
jne 0x15296
xorl %r12d, %r12d
testl %ebx, %ebx
cmovlel %r12d, %ebx
cmpq %r12, %rbx
je 0x152be
movq (%r14,%r12,8), %rsi
movl %r15d, %edi
movl %ebp, %edx
callq 0x150db
incq %r12
jmp 0x1527e
leaq 0xbb19(%rip), %rdi      # 0x20db6
movl %ebx, %edx
xorl %eax, %eax
callq 0x61c0
leaq 0xbff6(%rip), %rdi      # 0x212a3
xorl %eax, %eax
callq 0x61c0
movl $0x1, 0x1e1ba(%rip)     # 0x33478
movl 0x1e1ac(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e1ac(%rip), %ecx     # 0x33478
sete %al
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_new_strings
int rs_read_new_strings(int inf, char **s, int count)
{
    int len   = 0;
    int n     = 0;
    int value = 0;
    
    if (rs_read_int(inf,&value) != 0)
    {
        if (value != count)
        {
            printf("Incorrect number of new strings in block. %d > %d.",
                value,count);abort();
            printf("Sorry, invalid save game format");
            format_error = TRUE;
        }
        else
            for(n=0; n<value; n++)
            {
                rs_read_int(inf, &len);
            
                if (len == 0)
                    s[n]=0;
                else 
                {
                    s[n] = malloc(len);
                    rs_read(inf,s[n],len);
                }
            }
    }
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %ebp
andl $0x0, (%rsp)
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
callq 0x14cb7
testl %eax, %eax
je 0x15354
movl 0x4(%rsp), %esi
cmpl %ebx, %esi
jne 0x15374
xorl %r13d, %r13d
testl %ebx, %ebx
cmovlel %r13d, %ebx
movq %rsp, %r15
cmpq %r13, %rbx
je 0x15354
movl %ebp, %edi
movq %r15, %rsi
callq 0x14cb7
movslq (%rsp), %r12
testq %r12, %r12
je 0x1534a
movq %r12, %rdi
callq 0x6330
movq %rax, (%r14,%r13,8)
movl %ebp, %edi
movq %rax, %rsi
movl %r12d, %edx
callq 0x14be5
jmp 0x1534f
andq $0x0, (%r14,%r13,8)
incq %r13
jmp 0x15317
movl 0x1e116(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1e116(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xba6a(%rip), %rdi      # 0x20de5
movl %ebx, %edx
xorl %eax, %eax
callq 0x61c0
callq 0x6090
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_window
int rs_write_window(FILE *savef, WINDOW *win)
{
    int row,col,height,width;
    width = getmaxx(win);
    height = getmaxy(win);

    rs_write_int(savef,RSID_WINDOW);
    rs_write_int(savef,height);
    rs_write_int(savef,width);
    
    for(row=0;row<height;row++)
        for(col=0;col<width;col++)
            rs_write_int(savef, mvwinch(win,row,col));
    return(WRITESTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $-0x1
popq %r15
movl %r15d, %ebp
movl %r15d, %r13d
testq %rsi, %rsi
je 0x1541c
movswl 0x6(%rbx), %ebp
incl %ebp
movswl 0x4(%rbx), %r13d
incl %r13d
movq %r14, %rdi
movl $0xabcd000d, %esi       # imm = 0xABCD000D
callq 0x14801
movq %r14, %rdi
movl %r13d, %esi
callq 0x14801
movq %r14, %rdi
movl %ebp, %esi
callq 0x14801
xorl %r12d, %r12d
testl %ebp, %ebp
cmovlel %r12d, %ebp
testl %r13d, %r13d
cmovlel %r12d, %r13d
movl %r13d, 0x4(%rsp)
cmpl %r13d, %r12d
je 0x15497
xorl %r13d, %r13d
cmpl %r13d, %ebp
je 0x1548d
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x6470
movl %r15d, %esi
cmpl $-0x1, %eax
je 0x15480
movq %rbx, %rdi
callq 0x6320
movl %eax, %esi
movq %r14, %rdi
callq 0x14801
incl %r13d
jmp 0x1545b
incl %r12d
movl 0x4(%rsp), %r13d
jmp 0x15453
xorl %eax, %eax
cmpl $0x0, 0x1dfd4(%rip)     # 0x33474
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_window
int rs_read_window(int inf, WINDOW *win)
{
    int id,row,col,maxlines,maxcols,value,width,height;
    
    width = getmaxx(win);
    height = getmaxy(win);

    if (rs_read_int(inf, &id) != 0)
    {
        if (id != RSID_WINDOW)
        {
            printf("Invalid head id. %x != %x(RSID_WINDOW)\n", id, RSID_WINDOW);
            printf("Sorry, invalid save game format");
            format_error = TRUE;
        }   
        else
        {
            rs_read_int(inf,&maxlines);
            rs_read_int(inf,&maxcols);
            if (maxlines > height)
               abort();
            if (maxcols > width)
               abort();
               
            for(row=0;row<maxlines;row++)
                for(col=0;col<maxcols;col++)
                {
                    rs_read_int(inf, &value);
                    mvwaddch(win,row,col,value);
                }
        }
    }
        
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movl %edi, %ebp
testq %rsi, %rsi
je 0x154dc
movswl 0x6(%rbx), %r15d
incl %r15d
movswl 0x4(%rbx), %r12d
incl %r12d
jmp 0x154e3
pushq $-0x1
popq %r15
movl %r15d, %r12d
leaq 0x10(%rsp), %rsi
movl %ebp, %edi
callq 0x14cb7
testl %eax, %eax
je 0x155c4
movl 0x10(%rsp), %esi
cmpl $0xabcd000d, %esi       # imm = 0xABCD000D
jne 0x15599
leaq 0x14(%rsp), %r14
movl %ebp, %edi
movq %r14, %rsi
callq 0x14cb7
leaq 0xc(%rsp), %rsi
movl %ebp, %edi
callq 0x14cb7
movl (%r14), %ecx
cmpl %r12d, %ecx
jg 0x155e4
movl 0xc(%rsp), %r13d
cmpl %r15d, %r13d
jg 0x155e4
movl %ecx, %eax
xorl %r14d, %r14d
testl %r13d, %r13d
cmovlel %r14d, %r13d
testl %ecx, %ecx
cmovlel %r14d, %eax
movl %eax, 0x4(%rsp)
leaq 0x8(%rsp), %r15
cmpl 0x4(%rsp), %r14d
je 0x155c4
xorl %r12d, %r12d
cmpl %r12d, %r13d
je 0x15594
movl %ebp, %edi
movq %r15, %rsi
callq 0x14cb7
movq %rbx, %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0x6470
cmpl $-0x1, %eax
je 0x1558f
movl 0x8(%rsp), %esi
movq %rbx, %rdi
callq 0x64a0
incl %r12d
jmp 0x15561
incl %r14d
jmp 0x15557
leaq 0xb878(%rip), %rdi      # 0x20e18
movl $0xabcd000d, %edx       # imm = 0xABCD000D
xorl %eax, %eax
callq 0x61c0
leaq 0xbcf0(%rip), %rdi      # 0x212a3
xorl %eax, %eax
callq 0x61c0
movl $0x1, 0x1deb4(%rip)     # 0x33478
movl 0x1dea6(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1dea6(%rip), %ecx     # 0x33478
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6090
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_room_reference
int rs_write_room_reference(FILE *savef, struct room *rp)
{
    int i, room = -1;
    
    for (i = 0; i < MAXROOMS; i++)
        if (&rooms[i] == rp)
            room = i;

    rs_write_int(savef, room);

    return(WRITESTAT);
}

// Assembly:
movq %rsi, %rax
pushq $-0x1
popq %rsi
leaq 0x17ff8(%rip), %rcx     # 0x2d8a0
xorl %edx, %edx
cmpq $0x9, %rdx
je 0x158bf
cmpq %rax, %rcx
cmovel %edx, %esi
incq %rdx
addq $0x68, %rcx
jmp 0x158aa
pushq %rax
callq 0x14801
xorl %eax, %eax
cmpl $0x0, 0x1dba6(%rip)     # 0x33474
sete %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_rooms
int rs_write_rooms(FILE *savef, struct room r[], int count)
{
    int n = 0;

    rs_write_int(savef, count);
    
    for(n=0; n<count; n++)
    {
        rs_write_coord(savef, r[n].r_pos);
        rs_write_coord(savef, r[n].r_max);
        rs_write_coord(savef, r[n].r_gold);
        rs_write_coord(savef, r[n].r_exit[0]);
        rs_write_coord(savef, r[n].r_exit[1]);
        rs_write_coord(savef, r[n].r_exit[2]);
        rs_write_coord(savef, r[n].r_exit[3]);
        rs_write_room_reference(savef,r[n].r_ptr[0]);
        rs_write_room_reference(savef,r[n].r_ptr[1]);
        rs_write_room_reference(savef,r[n].r_ptr[2]);
        rs_write_room_reference(savef,r[n].r_ptr[3]);
        rs_write_int(savef, r[n].r_goldval);
        rs_write_int(savef, r[n].r_flags);
        rs_write_int(savef, r[n].r_nexits);
    }
    
    return(WRITESTAT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %esi
callq 0x14801
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
imulq $0x68, %r15, %r15
cmpq %r12, %r15
je 0x159fe
movq (%rbx,%r12), %rsi
movq %r14, %rdi
callq 0x15389
movq 0x8(%rbx,%r12), %rsi
movq %r14, %rdi
callq 0x15389
movq 0x10(%rbx,%r12), %rsi
movq %r14, %rdi
callq 0x15389
movq 0x18(%rbx,%r12), %rsi
movq %r14, %rdi
callq 0x15389
movq 0x20(%rbx,%r12), %rsi
movq %r14, %rdi
callq 0x15389
movq 0x28(%rbx,%r12), %rsi
movq %r14, %rdi
callq 0x15389
movq 0x30(%rbx,%r12), %rsi
movq %r14, %rdi
callq 0x15389
movq 0x38(%rbx,%r12), %rsi
movq %r14, %rdi
callq 0x1589b
movq 0x40(%rbx,%r12), %rsi
movq %r14, %rdi
callq 0x1589b
movq 0x48(%rbx,%r12), %rsi
movq %r14, %rdi
callq 0x1589b
movq 0x50(%rbx,%r12), %rsi
movq %r14, %rdi
callq 0x1589b
movl 0x58(%rbx,%r12), %esi
movq %r14, %rdi
callq 0x14801
movl 0x5c(%rbx,%r12), %esi
movq %r14, %rdi
callq 0x14801
movl 0x60(%rbx,%r12), %esi
movq %r14, %rdi
callq 0x14801
addq $0x68, %r12
jmp 0x15937
xorl %eax, %eax
cmpl $0x0, 0x1da6d(%rip)     # 0x33474
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_rooms
int rs_read_rooms(int inf, struct room *r, int count)
{
    int value = 0, n = 0;

    if (rs_read_int(inf,&value) != 0)
    {
        if (value > count)
        {
            printf("Incorrect number of rooms in block. %d > %d.",
                value,count);
            printf("Sorry, invalid save game format");
            format_error = TRUE;
        }
        else
            for(n = 0; n < value; n++)
            {
                rs_read_coord(inf,&r[n].r_pos);
                rs_read_coord(inf,&r[n].r_max);
                rs_read_coord(inf,&r[n].r_gold);
                rs_read_coord(inf,&r[n].r_exit[0]);
                rs_read_coord(inf,&r[n].r_exit[1]);
                rs_read_coord(inf,&r[n].r_exit[2]);
                rs_read_coord(inf,&r[n].r_exit[3]);
                rs_read_room_reference(inf,&r[n].r_ptr[0]);
                rs_read_room_reference(inf,&r[n].r_ptr[1]);
                rs_read_room_reference(inf,&r[n].r_ptr[2]);
                rs_read_room_reference(inf,&r[n].r_ptr[3]);
                rs_read_int(inf,&r[n].r_goldval);
                rs_read_int(inf,&r[n].r_flags);
                rs_read_int(inf,&r[n].r_nexits);
            }
    }

    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
callq 0x14cb7
testl %eax, %eax
je 0x15a68
movl 0x4(%rsp), %esi
cmpl %r14d, %esi
jle 0x15a84
leaq 0xb44d(%rip), %rdi      # 0x20e93
movl %r14d, %edx
xorl %eax, %eax
callq 0x61c0
leaq 0xb84c(%rip), %rdi      # 0x212a3
xorl %eax, %eax
callq 0x61c0
movl $0x1, 0x1da10(%rip)     # 0x33478
movl 0x1da02(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1da02(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
testl %esi, %esi
cmovlel %r14d, %esi
imulq $0x68, %rsi, %r15
cmpq %r14, %r15
je 0x15a68
leaq (%rbx,%r14), %rsi
movl %ebp, %edi
callq 0x153bb
leaq (%rbx,%r14), %rsi
addq $0x8, %rsi
movl %ebp, %edi
callq 0x153bb
leaq (%rbx,%r14), %rsi
addq $0x10, %rsi
movl %ebp, %edi
callq 0x153bb
leaq (%rbx,%r14), %rsi
addq $0x18, %rsi
movl %ebp, %edi
callq 0x153bb
leaq (%rbx,%r14), %rsi
addq $0x20, %rsi
movl %ebp, %edi
callq 0x153bb
leaq (%rbx,%r14), %rsi
addq $0x28, %rsi
movl %ebp, %edi
callq 0x153bb
leaq (%rbx,%r14), %rsi
addq $0x30, %rsi
movl %ebp, %edi
callq 0x153bb
leaq (%rbx,%r14), %rsi
addq $0x38, %rsi
movl %ebp, %edi
callq 0x158d3
leaq (%rbx,%r14), %rsi
addq $0x40, %rsi
movl %ebp, %edi
callq 0x158d3
leaq (%rbx,%r14), %rsi
addq $0x48, %rsi
movl %ebp, %edi
callq 0x158d3
leaq (%rbx,%r14), %rsi
addq $0x50, %rsi
movl %ebp, %edi
callq 0x158d3
leaq (%rbx,%r14), %rsi
addq $0x58, %rsi
movl %ebp, %edi
callq 0x14cb7
leaq (%rbx,%r14), %rsi
addq $0x5c, %rsi
movl %ebp, %edi
callq 0x14cb7
leaq (%rbx,%r14), %rsi
addq $0x60, %rsi
movl %ebp, %edi
callq 0x14cb7
addq $0x68, %r14
jmp 0x15a91
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_monlev
int rs_write_monlev(FILE *savef, struct monlev m)
{
    rs_write_int(savef, m.l_lev);
    rs_write_int(savef, m.h_lev);
    rs_write_boolean(savef, m.d_wand);

    return(WRITESTAT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
movq %rsi, %r15
shrq $0x20, %r15
callq 0x14801
movq %r14, %rdi
movl %r15d, %esi
callq 0x14801
andl $0x1, %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x147df
xorl %eax, %eax
cmpl $0x0, 0x1d8d0(%rip)     # 0x33474
sete %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_monlev
int rs_read_monlev(int inf, struct monlev *m)
{
    rs_read_int(inf, &m->l_lev);
    rs_read_int(inf, &m->h_lev);
    rs_read_boolean(inf, &m->d_wand);

    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
callq 0x14cb7
leaq 0x4(%rbx), %rsi
movl %ebp, %edi
callq 0x14cb7
addq $0x8, %rbx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x14c80
movl 0x1d897(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1d897(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_magic_items
int rs_write_magic_items(FILE *savef, struct magic_item *i, int count)
{
    int n;
    
    rs_write_int(savef, RSID_MAGICITEMS);
    rs_write_int(savef, count);

    for(n = 0; n < count; n++)
    {
        /* mi_name is constant, defined at compile time in all cases */
        rs_write_int(savef,i[n].mi_prob);
    }
    
    return(WRITESTAT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl $0xabcd0004, %esi       # imm = 0xABCD0004
callq 0x14801
movq %r15, %rdi
movl %ebx, %esi
callq 0x14801
xorl %r12d, %r12d
testl %ebx, %ebx
cmovlel %r12d, %ebx
shlq $0x4, %rbx
cmpq %r12, %rbx
je 0x15c34
movl 0x8(%r14,%r12), %esi
movq %r15, %rdi
callq 0x14801
addq $0x10, %r12
jmp 0x15c1c
xorl %eax, %eax
cmpl $0x0, 0x1d837(%rip)     # 0x33474
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_magic_items
int rs_read_magic_items(int inf, struct magic_item *mi, int count)
{
    int id;
    int n;
    int value;

    if (rs_read_int(inf, &id) != 0)
    {
        if (id != RSID_MAGICITEMS)
        {
            printf("Invalid id. %x != %x(RSID_MAGICITEMS)\n",
                id, RSID_MAGICITEMS);
            printf("Sorry, invalid save game format");
            format_error = TRUE;
        }   
        else if (rs_read_int(inf, &value) != 0)
        {
            if (value > count)
            {
                printf("Incorrect number of magic items in block. %d > %d.",
                    value, count);
                printf("Sorry, invalid save game format");
                format_error = TRUE;
            }
            else
            {
                for(n = 0; n < value; n++)
                {
                    rs_read_int(inf,&mi[n].mi_prob);
                }
            }
        }
    }
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %ebp
leaq 0xc(%rsp), %rsi
callq 0x14cb7
testl %eax, %eax
je 0x15cc6
movl 0xc(%rsp), %esi
cmpl $0xabcd0004, %esi       # imm = 0xABCD0004
jne 0x15c9b
leaq 0x8(%rsp), %rsi
movl %ebp, %edi
callq 0x14cb7
testl %eax, %eax
je 0x15cc6
movl 0x8(%rsp), %esi
cmpl %r14d, %esi
jle 0x15ce0
leaq 0xb251(%rip), %rdi      # 0x20ee7
movl %r14d, %edx
jmp 0x15ca7
leaq 0xb21e(%rip), %rdi      # 0x20ec0
movl $0xabcd0004, %edx       # imm = 0xABCD0004
xorl %eax, %eax
callq 0x61c0
leaq 0xb5ee(%rip), %rdi      # 0x212a3
xorl %eax, %eax
callq 0x61c0
movl $0x1, 0x1d7b2(%rip)     # 0x33478
movl 0x1d7a4(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1d7a4(%rip), %ecx     # 0x33478
sete %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
xorl %r14d, %r14d
testl %esi, %esi
cmovgl %esi, %r14d
addq $0x8, %rbx
subq $0x1, %r14
jb 0x15cc6
movl %ebp, %edi
movq %rbx, %rsi
callq 0x14cb7
addq $0x10, %rbx
jmp 0x15ced
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_real
int rs_write_real(FILE *savef, struct real r)
{
    rs_write_int(savef, r.a_str);
    rs_write_int(savef, r.a_dex);
    rs_write_int(savef, r.a_wis);
    rs_write_int(savef, r.a_con);

    return(WRITESTAT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq %rsi, %r15
shrq $0x20, %r15
movq %rdx, %r12
shrq $0x20, %r12
callq 0x14801
movq %r14, %rdi
movl %r15d, %esi
callq 0x14801
movq %r14, %rdi
movl %ebx, %esi
callq 0x14801
movq %r14, %rdi
movl %r12d, %esi
callq 0x14801
xorl %eax, %eax
cmpl $0x0, 0x1d727(%rip)     # 0x33474
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_real
int rs_read_real(int inf, struct real *r)
{
    rs_read_int(inf,&r->a_str);
    rs_read_int(inf,&r->a_dex);
    rs_read_int(inf,&r->a_wis);
    rs_read_int(inf,&r->a_con);

    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
callq 0x14cb7
leaq 0x4(%rbx), %rsi
movl %ebp, %edi
callq 0x14cb7
leaq 0x8(%rbx), %rsi
movl %ebp, %edi
callq 0x14cb7
addq $0xc, %rbx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x14cb7
movl 0x1d6dd(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1d6dd(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_stats
int rs_write_stats(FILE *savef, struct stats *s)
{
    rs_write_int(savef, RSID_STATS);
    rs_write_real(savef, s->s_re);
    rs_write_real(savef, s->s_ef);
    rs_write_long(savef, s->s_exp);
    rs_write_int(savef, s->s_lvl);
    rs_write_int(savef, s->s_arm);
    rs_write_int(savef, s->s_hpt);
    rs_write_int(savef, s->s_maxhp);
    rs_write_int(savef, s->s_pack);
    rs_write_int(savef, s->s_carry);
    rs_write(savef, s->s_dmg, sizeof(s->s_dmg));

    return(WRITESTAT);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0xabcd0001, %esi       # imm = 0xABCD0001
callq 0x14801
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x15d03
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
movq %r14, %rdi
callq 0x15d03
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x149e9
movl 0x28(%rbx), %esi
movq %r14, %rdi
callq 0x14801
movl 0x2c(%rbx), %esi
movq %r14, %rdi
callq 0x14801
movl 0x30(%rbx), %esi
movq %r14, %rdi
callq 0x14801
movl 0x34(%rbx), %esi
movq %r14, %rdi
callq 0x14801
movl 0x38(%rbx), %esi
movq %r14, %rdi
callq 0x14801
movl 0x3c(%rbx), %esi
movq %r14, %rdi
callq 0x14801
addq $0x40, %rbx
pushq $0x10
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x14776
xorl %eax, %eax
cmpl $0x0, 0x1d633(%rip)     # 0x33474
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_stats
int rs_read_stats(int inf, struct stats *s)
{
    int id;

    rs_read_int(inf, &id);
    rs_read_real(inf, &s->s_re);
    rs_read_real(inf, &s->s_ef);

    rs_read_long(inf,&s->s_exp);
    rs_read_int(inf,&s->s_lvl);
    rs_read_int(inf,&s->s_arm);
    rs_read_int(inf,&s->s_hpt);
    rs_read_int(inf,&s->s_maxhp);
    rs_read_int(inf,&s->s_pack);
    rs_read_int(inf,&s->s_carry);

    rs_read(inf,s->s_dmg,sizeof(s->s_dmg));
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4(%rsp), %rsi
callq 0x14cb7
movl %ebp, %edi
movq %rbx, %rsi
callq 0x15d5c
leaq 0x10(%rbx), %rsi
movl %ebp, %edi
callq 0x15d5c
leaq 0x20(%rbx), %rsi
movl %ebp, %edi
callq 0x14f6f
leaq 0x28(%rbx), %rsi
movl %ebp, %edi
callq 0x14cb7
leaq 0x2c(%rbx), %rsi
movl %ebp, %edi
callq 0x14cb7
leaq 0x30(%rbx), %rsi
movl %ebp, %edi
callq 0x14cb7
leaq 0x34(%rbx), %rsi
movl %ebp, %edi
callq 0x14cb7
leaq 0x38(%rbx), %rsi
movl %ebp, %edi
callq 0x14cb7
leaq 0x3c(%rbx), %rsi
movl %ebp, %edi
callq 0x14cb7
addq $0x40, %rbx
pushq $0x10
popq %rdx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x14be5
movl 0x1d599(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1d599(%rip), %ecx     # 0x33478
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_monster_reference
int rs_write_monster_reference(FILE *savef, struct monster *m)
{
    int i, mon = -1;
    
    for (i = 0; i < (MAXMONS+1); i++)
        if (&monsters[i] == m)
            mon = i;

    rs_write_int(savef, mon);

    return(WRITESTAT);
}

// Assembly:
movq %rsi, %rax
pushq $-0x1
popq %rsi
leaq 0x144ba(%rip), %rcx     # 0x2a3b0
xorl %edx, %edx
cmpq $0x35, %rdx
je 0x15f0d
cmpq %rax, %rcx
cmovel %edx, %esi
incq %rdx
addq $0x70, %rcx
jmp 0x15ef8
pushq %rax
callq 0x14801
xorl %eax, %eax
cmpl $0x0, 0x1d558(%rip)     # 0x33474
sete %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_monster_references
int rs_write_monster_references(FILE *savef, struct monster *marray[], int count)
{
    int i;

    for(i = 0; i < count; i++)
        rs_write_monster_reference(savef, marray[i]);
    return(WRITESTAT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
testl %edx, %edx
cmovlel %r12d, %ebx
cmpq %r12, %rbx
je 0x15f97
movq (%r14,%r12,8), %rsi
movq %r15, %rdi
callq 0x15ee9
incq %r12
jmp 0x15f81
xorl %eax, %eax
cmpl $0x0, 0x1d4d4(%rip)     # 0x33474
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_read_monster_references
int rs_read_monster_references(int inf, struct monster *marray[], int count)
{
    int i;

    for(i = 0; i < count; i++)
        rs_read_monster_reference(inf, &marray[i]);
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
xorl %r14d, %r14d
testl %edx, %edx
cmovgl %edx, %r14d
subq $0x1, %r14
jb 0x15fd7
movl %ebp, %edi
movq %rbx, %rsi
callq 0x15f21
addq $0x8, %rbx
jmp 0x15fc1
movl 0x1d493(%rip), %ecx     # 0x33470
xorl %eax, %eax
orl 0x1d493(%rip), %ecx     # 0x33478
sete %al
popq %rbx
popq %r14
popq %rbp
retq