LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4(%rsp), %rsi
callq 0x15bb9
testl %eax, %eax
je 0x16eab
movl 0x4(%rsp), %esi
cmpl $0xabcd0004, %esi       # imm = 0xABCD0004
jne 0x16e80
movq %rsp, %rsi
movl %ebp, %edi
callq 0x15bb9
testl %eax, %eax
je 0x16eab
movl (%rsp), %r15d
cmpl %r14d, %r15d
jle 0x16ec7
leaq 0xc06f(%rip), %rdi      # 0x22ee7
movl %r15d, %esi
movl %r14d, %edx
jmp 0x16e8c
leaq 0xc039(%rip), %rdi      # 0x22ec0
movl $0xabcd0004, %edx       # imm = 0xABCD0004
xorl %eax, %eax
callq 0x61c0
leaq 0xc409(%rip), %rdi      # 0x232a3
xorl %eax, %eax
callq 0x61c0
movl $0x1, 0x1c5dd(%rip)     # 0x33488
movl 0x1c5cf(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1c5cf(%rip), %ecx     # 0x33488
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testl %r15d, %r15d
jle 0x16eab
addq $0x8, %rbx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x15bb9
addq $0x10, %rbx
decq %r15
jne 0x16ed0
jmp 0x16eab
// File: /workspace/github_c_makefile_star2_O3/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 0x156d6
movq %r14, %rdi
movl %r15d, %esi
callq 0x156d6
movq %r14, %rdi
movl %ebx, %esi
callq 0x156d6
movq %r14, %rdi
movl %r12d, %esi
callq 0x156d6
xorl %eax, %eax
cmpl $0x0, 0x1c555(%rip)     # 0x33484
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x15bb9
leaq 0x4(%rbx), %rsi
movl %ebp, %edi
callq 0x15bb9
leaq 0x8(%rbx), %rsi
movl %ebp, %edi
callq 0x15bb9
addq $0xc, %rbx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x15bb9
movl 0x1c50b(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1c50b(%rip), %ecx     # 0x33488
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x156d6
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x16ee5
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
movq %r14, %rdi
callq 0x16ee5
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x158d7
movl 0x28(%rbx), %esi
movq %r14, %rdi
callq 0x156d6
movl 0x2c(%rbx), %esi
movq %r14, %rdi
callq 0x156d6
movl 0x30(%rbx), %esi
movq %r14, %rdi
callq 0x156d6
movl 0x34(%rbx), %esi
movq %r14, %rdi
callq 0x156d6
movl 0x38(%rbx), %esi
movq %r14, %rdi
callq 0x156d6
movl 0x3c(%rbx), %esi
movq %r14, %rdi
callq 0x156d6
addq $0x40, %rbx
movq %r14, %rdi
movq %rbx, %rsi
movl $0x10, %edx
callq 0x15645
xorl %eax, %eax
cmpl $0x0, 0x1c45f(%rip)     # 0x33484
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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
subq $0x18, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x14(%rsp), %rsi
callq 0x15bb9
movl %ebp, %edi
movq %rbx, %rsi
callq 0x16f3e
leaq 0x10(%rbx), %rsi
movl %ebp, %edi
callq 0x16f3e
leaq 0x8(%rsp), %rsi
movl %ebp, %edi
movl $0x4, %edx
callq 0x15ade
cmpl $0x0, 0x1c41e(%rip)     # 0x33490
jne 0x1707b
movq 0x8(%rsp), %rax
jmp 0x1707d
xorl %eax, %eax
movq %rax, 0x20(%rbx)
leaq 0x28(%rbx), %rsi
movl %ebp, %edi
callq 0x15bb9
leaq 0x2c(%rbx), %rsi
movl %ebp, %edi
callq 0x15bb9
leaq 0x30(%rbx), %rsi
movl %ebp, %edi
callq 0x15bb9
leaq 0x34(%rbx), %rsi
movl %ebp, %edi
callq 0x15bb9
leaq 0x38(%rbx), %rsi
movl %ebp, %edi
callq 0x15bb9
leaq 0x3c(%rbx), %rsi
movl %ebp, %edi
callq 0x15bb9
addq $0x40, %rbx
movl %ebp, %edi
movq %rbx, %rsi
movl $0x10, %edx
callq 0x15ade
movl 0x1c3a4(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1c3a4(%rip), %ecx     # 0x33488
sete %al
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x132c3(%rip), %rcx     # 0x2a3c0
xorl %edx, %edx
cmpq %rax, %rcx
cmovel %edx, %esi
incq %rdx
addq $0x70, %rcx
cmpq $0x35, %rdx
jne 0x170ff
pushq %rax
callq 0x156d6
xorl %eax, %eax
cmpl $0x0, 0x1c363(%rip)     # 0x33484
sete %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/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:
testl %edx, %edx
jle 0x171c7
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %r15d
xorl %r12d, %r12d
leaq 0x13233(%rip), %r13     # 0x2a3c0
movq (%rbx,%r12,8), %rax
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r13, %rcx
xorl %edx, %edx
cmpq %rax, %rcx
cmovel %edx, %esi
incq %rdx
addq $0x70, %rcx
cmpq $0x35, %rdx
jne 0x1719b
movq %r14, %rdi
callq 0x156d6
incq %r12
cmpq %r15, %r12
jne 0x1718d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
xorl %eax, %eax
cmpl $0x0, 0x1c2b4(%rip)     # 0x33484
sete %al
retq
// File: /workspace/github_c_makefile_star2_O3/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:
testl %edx, %edx
jle 0x17236
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movl %edx, %r15d
xorl %r12d, %r12d
leaq 0x4(%rsp), %r14
leaq 0x131c6(%rip), %r13     # 0x2a3c0
movl %ebp, %edi
movq %r14, %rsi
callq 0x15bb9
movslq 0x4(%rsp), %rax
imulq $0x70, %rax, %rcx
addq %r13, %rcx
testq %rax, %rax
movl $0x0, %eax
cmovnsq %rcx, %rax
movq %rax, (%rbx,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x171fa
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movl 0x1c244(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1c244(%rip), %ecx     # 0x33488
sete %al
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_read_object_list
int rs_read_object_list(int inf, struct linked_list **list)
{
    int id;
    int i, cnt;
    struct linked_list *l = NULL, *previous = NULL, *head = NULL;

    if (rs_read_int(inf,&id) != 0)
    {
        if (rs_read_int(inf,&cnt) != 0)
        {
            for (i = 0; i < cnt; i++) 
            {
                l = new_item(sizeof(struct object));
                memset(l->l_data,0,sizeof(struct object));
                l->l_prev = previous;
                if (previous != NULL)
                    previous->l_next = l;
                rs_read_object(inf,(struct object *) l->l_data);
                if (previous == NULL)
                    head = l;
                previous = l;
            }
            
            if (l != NULL)
                l->l_next = NULL;
    
            *list = head;
        }
        else
            format_error = TRUE;
    }
    else
        format_error = TRUE;


    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x14(%rsp), %rsi
callq 0x15bb9
testl %eax, %eax
je 0x17804
leaq 0x4(%rsp), %rsi
movl %ebp, %edi
callq 0x15bb9
testl %eax, %eax
je 0x17804
movl 0x4(%rsp), %r15d
testl %r15d, %r15d
jle 0x17812
movq %rbx, 0x8(%rsp)
xorl %r12d, %r12d
xorl %ebx, %ebx
movl $0x50, %edi
callq 0xbdfa
movq %rax, %r14
movq 0x10(%rax), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movq %rbx, 0x8(%r14)
movq %r14, %r13
testq %rbx, %rbx
je 0x177e0
movq %r14, (%rbx)
movq %r12, %r13
movq 0x10(%r14), %rsi
movl %ebp, %edi
callq 0x17594
movq %r13, %r12
movq %r14, %rbx
decl %r15d
jne 0x177a7
movq $0x0, (%r14)
movq 0x8(%rsp), %rbx
jmp 0x17815
movl $0x1, 0x1bc7a(%rip)     # 0x33488
xorl %eax, %eax
jmp 0x17822
xorl %r13d, %r13d
movq %r13, (%rbx)
cmpl $0x0, 0x1bc69(%rip)     # 0x33488
sete %al
cmpl $0x0, 0x1bc57(%rip)     # 0x33480
sete %cl
andb %al, %cl
movzbl %cl, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_write_object_list
int rs_write_object_list(FILE *savef, struct linked_list *l)
{
    rs_write_int(savef, RSID_OBJECTLIST);
    rs_write_int(savef, list_size(l));

    while (l != NULL) 
    {
        rs_write_object(savef, (struct object *) l->l_data);
        l = l->l_next;
    }
    
    return(WRITESTAT);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0xabcd0007, %esi       # imm = 0xABCD0007
callq 0x156d6
testq %r14, %r14
je 0x1788d
xorl %esi, %esi
movq %r14, %rax
cmpq $0x0, 0x10(%rax)
je 0x1786f
incl %esi
movq (%rax), %rax
testq %rax, %rax
jne 0x1785e
movq %rbx, %rdi
callq 0x156d6
testq %r14, %r14
je 0x17897
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x17248
movq (%r14), %r14
jmp 0x17877
movq %rbx, %rdi
xorl %esi, %esi
callq 0x156d6
xorl %eax, %eax
cmpl $0x0, 0x1bbe4(%rip)     # 0x33484
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_write_traps
int rs_write_traps(FILE *savef, struct trap *trap,int count)
{
    int n;

    rs_write_int(savef, RSID_TRAP);
    rs_write_int(savef, count);
    
    for(n=0; n<count; n++)
    {
        rs_write_coord(savef, trap[n].tr_pos);
        rs_write_coord(savef, trap[n].tr_goto);
        rs_write_int(savef, trap[n].tr_flags);
        rs_write_char(savef, trap[n].tr_type);
    }
    return(WRITESTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movl $0xabcd000c, %esi       # imm = 0xABCD000C
callq 0x156d6
movq %r14, %rdi
movl %ebp, %esi
callq 0x156d6
testl %ebp, %ebp
jle 0x17951
movl %ebp, %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %r13
xorl %ebp, %ebp
leaq 0x7(%rsp), %r15
movq (%rbx,%rbp), %rsi
movq %rsi, %r12
shrq $0x20, %r12
movq %r14, %rdi
callq 0x156d6
movq %r14, %rdi
movl %r12d, %esi
callq 0x156d6
movq 0x8(%rbx,%rbp), %rsi
movq %rsi, %r12
shrq $0x20, %r12
movq %r14, %rdi
callq 0x156d6
movq %r14, %rdi
movl %r12d, %esi
callq 0x156d6
movl 0x10(%rbx,%rbp), %esi
movq %r14, %rdi
callq 0x156d6
movb 0x14(%rbx,%rbp), %al
movb %al, 0x7(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x15645
addq $0x18, %rbp
cmpq %rbp, %r13
jne 0x178e7
xorl %eax, %eax
cmpl $0x0, 0x1bb2a(%rip)     # 0x33484
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_read_traps
int rs_read_traps(int inf, struct trap *trap, int count)
{
    int id = 0, value = 0, n = 0;

    if (rs_read_int(inf,&id) != 0)
    {
        if (id != RSID_TRAP)
        {
            printf("Invalid id. %x != %x(RSID_TRAP)\n",
                id,RSID_TRAP);
            printf("Sorry, invalid save game format");
            format_error = TRUE;
        }
        else if (rs_read_int(inf,&value) != 0)
        {
            if (value > count)
            {
                printf("Incorrect number of traps in block. %d > %d.",
                    value,count);
                printf("Sorry, invalid save game format\n");
                format_error = TRUE;
            }
            else
            {
                for(n=0;n<value;n++)
                {   
                    rs_read_coord(inf,&trap[n].tr_pos);
                    rs_read_coord(inf,&trap[n].tr_goto);
                    rs_read_int(inf,&trap[n].tr_flags);
                    rs_read_char(inf,&trap[n].tr_type);
                }
            }
        }
        else
            format_error = TRUE;
    }
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movl %edi, %ebp
xorl %eax, %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movl %eax, (%rsp)
callq 0x15bb9
testl %eax, %eax
je 0x17a00
movl 0x4(%rsp), %esi
cmpl $0xabcd000c, %esi       # imm = 0xABCD000C
jne 0x179d5
movq %rsp, %rsi
movl %ebp, %edi
callq 0x15bb9
testl %eax, %eax
je 0x179f6
movl (%rsp), %r14d
cmpl %r15d, %r14d
jle 0x17a1c
leaq 0xb7a3(%rip), %rdi      # 0x2315d
movl %r14d, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x61c0
leaq 0xb8d5(%rip), %rdi      # 0x232a3
callq 0x60f0
jmp 0x179f6
leaq 0xb760(%rip), %rdi      # 0x2313c
movl $0xabcd000c, %edx       # imm = 0xABCD000C
xorl %eax, %eax
callq 0x61c0
leaq 0xb8b4(%rip), %rdi      # 0x232a3
xorl %eax, %eax
callq 0x61c0
movl $0x1, 0x1ba88(%rip)     # 0x33488
movl 0x1ba7a(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1ba7a(%rip), %ecx     # 0x33488
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testl %r14d, %r14d
jle 0x17a00
movl %ebp, %edi
movq %rbx, %rsi
callq 0x15bb9
leaq 0x4(%rbx), %rsi
movl %ebp, %edi
callq 0x15bb9
leaq 0x8(%rbx), %rsi
movl %ebp, %edi
callq 0x15bb9
leaq 0xc(%rbx), %rsi
movl %ebp, %edi
callq 0x15bb9
leaq 0x10(%rbx), %rsi
movl %ebp, %edi
callq 0x15bb9
leaq 0x14(%rbx), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x15ade
addq $0x18, %rbx
decq %r14
jne 0x17a21
jmp 0x17a00
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_write_monsters
int rs_write_monsters(FILE * savef, struct monster * m, int count)
{
    int n;
    
    rs_write_int(savef, RSID_MONSTERS);
    rs_write_int(savef, count);

    for(n=0;n<count;n++)
    {
        rs_write_monlev(savef, m[n].m_lev);
        rs_write_stats(savef, &m[n].m_stats);
    }
    
    return(WRITESTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movl $0xabcd000b, %esi       # imm = 0xABCD000B
callq 0x156d6
movq %r14, %rdi
movl %ebp, %esi
callq 0x156d6
testl %ebp, %ebp
jle 0x17ac3
movl %ebp, %r15d
addq $0x20, %rbx
movq -0x14(%rbx), %rsi
movl -0xc(%rbx), %edx
movq %r14, %rdi
callq 0x16d2f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x16f87
addq $0x70, %rbx
decq %r15
jne 0x17aa0
xorl %eax, %eax
cmpl $0x0, 0x1b9b8(%rip)     # 0x33484
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_read_monsters
int rs_read_monsters(int inf, struct monster *m, int count)
{
    int id = 0, value = 0, n = 0;
    
    if (rs_read_int(inf, &id) != 0)
    {
        if (id != RSID_MONSTERS)
        {
            printf("Invalid id. %x != %x(RSID_MONSTERS)\n",
                id,RSID_MONSTERS);
            printf("Sorry, invalid save game format");
            format_error = TRUE;
        }
        else if (rs_read_int(inf, &value) != 0)
        {
            for(n=0;n<value;n++)
            {
                rs_read_monlev(inf, &m[n].m_lev);
                rs_read_stats(inf, &m[n].m_stats);
            }
        }
        else
            format_error = TRUE;
    }
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movl %edi, %ebp
xorl %eax, %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movl %eax, 0x8(%rsp)
callq 0x15bb9
testl %eax, %eax
je 0x17b72
movl 0xc(%rsp), %esi
cmpl $0xabcd000b, %esi       # imm = 0xABCD000B
jne 0x17b47
leaq 0x8(%rsp), %rsi
movl %ebp, %edi
callq 0x15bb9
testl %eax, %eax
je 0x17b68
movslq 0x8(%rsp), %r14
testq %r14, %r14
jle 0x17b72
addq $0x20, %rbx
leaq -0x14(%rbx), %rsi
movl %ebp, %edi
callq 0x16d81
movl %ebp, %edi
movq %rbx, %rsi
callq 0x17030
addq $0x70, %rbx
decq %r14
jne 0x17b27
jmp 0x17b72
leaq 0xb63c(%rip), %rdi      # 0x2318a
movl $0xabcd000b, %edx       # imm = 0xABCD000B
xorl %eax, %eax
callq 0x61c0
leaq 0xb742(%rip), %rdi      # 0x232a3
xorl %eax, %eax
callq 0x61c0
movl $0x1, 0x1b916(%rip)     # 0x33488
movl 0x1b908(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1b908(%rip), %ecx     # 0x33488
sete %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: find_thing_coord
int find_thing_coord(struct linked_list *monlist, struct coord *c)
{
    struct linked_list *mitem;
    struct thing *tp;
    int i = 0;

    for(mitem = monlist; mitem != NULL; mitem = mitem->l_next)
    {
        tp = THINGPTR(mitem);
        if (c == &tp->t_pos)
            return(i);
        i++;
    }

    return(-1);
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x17baf
xorl %ecx, %ecx
movq 0x10(%rdi), %rdx
addq $0x50, %rdx
cmpq %rsi, %rdx
je 0x17bb0
incl %ecx
movq (%rdi), %rdi
testq %rdi, %rdi
jne 0x17b98
retq
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_fix_thing
void rs_fix_thing(struct thing *t)
{
    struct linked_list *item;
    struct thing *tp;

    if (t->t_reserved < 0)
        return;

    item = get_list_item(mlist,t->t_reserved);

    if (item != NULL)
    {
        tp = THINGPTR(item);
        t->t_dest = &tp->t_pos;
    }
}

// Assembly:
movsbl 0x90(%rdi), %eax
testl %eax, %eax
js 0x17bfb
leaq 0x15c5b(%rip), %rcx     # 0x2d840
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x17bfb
incl %eax
decl %eax
je 0x17bfc
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x17bef
retq
movq 0x10(%rcx), %rax
testq %rax, %rax
je 0x17bfb
movq 0x10(%rax), %rax
addq $0x50, %rax
movq %rax, 0x60(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_write_monster_list
int rs_write_monster_list(FILE *savef, struct linked_list *l)
{
    int cnt = 0;
    
    rs_write_int(savef, RSID_MONSTERLIST);

    cnt = list_size(l);

    rs_write_int(savef, cnt);

    if (cnt < 1)
        return(WRITESTAT);

    while (l != NULL) {
        rs_write_thing(savef, (struct thing *)l->l_data);
        l = l->l_next;
    }
    
    return(WRITESTAT);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0xabcd0009, %esi       # imm = 0xABCD0009
callq 0x156d6
testq %r14, %r14
je 0x1811d
xorl %ebp, %ebp
movq %r14, %rax
cmpq $0x0, 0x10(%rax)
je 0x18129
movq (%rax), %rax
decl %ebp
testq %rax, %rax
jne 0x180fe
negl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x156d6
jmp 0x18139
movq %rbx, %rdi
xorl %esi, %esi
callq 0x156d6
jmp 0x1814d
movl %ebp, %esi
negl %esi
movq %rbx, %rdi
callq 0x156d6
testl %ebp, %ebp
je 0x1814d
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x17c38
movq (%r14), %r14
testq %r14, %r14
jne 0x18139
xorl %eax, %eax
cmpl $0x0, 0x1b32e(%rip)     # 0x33484
sete %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_read_monster_list
int rs_read_monster_list(int inf, struct linked_list **list)
{
    int id;
    int i, cnt;
    struct linked_list *l = NULL, *previous = NULL, *head = NULL;

    if (rs_read_int(inf,&id) != 0)
    {
        if (id != RSID_MONSTERLIST)
        {
            printf("Invalid id. %x != %x(RSID_MONSTERLIST)\n",
                id,RSID_MONSTERLIST);
            printf("Sorry, invalid save game format");
            format_error = TRUE;
        }
        else if (rs_read_int(inf,&cnt) != 0)
        {
            for (i = 0; i < cnt; i++) 
            {
                l = new_item(sizeof(struct thing));
                l->l_prev = previous;
                if (previous != NULL)
                    previous->l_next = l;
                rs_read_thing(inf,(struct thing *)l->l_data);
                if (previous == NULL)
                    head = l;
                previous = l;
            }
        

            if (l != NULL)
                l->l_next = NULL;

            *list = head;
        }
    }
    else format_error = TRUE;
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movl %edi, %ebp
leaq 0xc(%rsp), %rsi
callq 0x15bb9
testl %eax, %eax
je 0x1821e
movl 0xc(%rsp), %esi
cmpl $0xabcd0009, %esi       # imm = 0xABCD0009
jne 0x181fd
leaq 0x8(%rsp), %rsi
movl %ebp, %edi
callq 0x15bb9
testl %eax, %eax
je 0x1822f
movl 0x8(%rsp), %r15d
testl %r15d, %r15d
jle 0x1822a
movq %r14, 0x10(%rsp)
xorl %r13d, %r13d
xorl %r14d, %r14d
movl $0x98, %edi
callq 0xbdfa
movq %rax, %r12
movq %r14, 0x8(%rax)
movq %rax, %rbx
testq %r14, %r14
je 0x181d7
movq %r12, (%r14)
movq %r13, %rbx
movq 0x10(%r12), %rsi
movl %ebp, %edi
callq 0x17e62
movq %rbx, %r13
movq %r12, %r14
decl %r15d
jne 0x181b8
movq $0x0, (%r12)
movq 0x10(%rsp), %r14
jmp 0x1822c
leaq 0xafcd(%rip), %rdi      # 0x231d1
movl $0xabcd0009, %edx       # imm = 0xABCD0009
xorl %eax, %eax
callq 0x61c0
leaq 0xb08c(%rip), %rdi      # 0x232a3
xorl %eax, %eax
callq 0x61c0
movl $0x1, 0x1b260(%rip)     # 0x33488
jmp 0x1822f
xorl %ebx, %ebx
movq %rbx, (%r14)
movl 0x1b24b(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1b24b(%rip), %ecx     # 0x33488
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_write_object_reference
int rs_write_object_reference(FILE *savef, struct linked_list *list, struct object *item)
{
    int i;
    
    i = find_list_ptr(list, item);
    rs_write_int(savef, i);

    return(WRITESTAT);
}

// Assembly:
pushq %rax
movq %rsi, %rax
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x18273
xorl %ecx, %ecx
cmpq %rdx, 0x10(%rax)
je 0x18271
movq (%rax), %rax
incl %ecx
testq %rax, %rax
jne 0x1825f
jmp 0x18273
movl %ecx, %esi
callq 0x156d6
xorl %eax, %eax
cmpl $0x0, 0x1b203(%rip)     # 0x33484
sete %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_read_object_reference
int rs_read_object_reference(int inf, struct linked_list *list, struct object **item)
{
    int i;
    
    rs_read_int(inf, &i);
    *item = get_list_item(list,i);
            
    return(READSTAT);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x4(%rsp), %rsi
callq 0x15bb9
testq %r14, %r14
je 0x182b5
movl 0x4(%rsp), %ecx
incl %ecx
xorl %eax, %eax
decl %ecx
je 0x182b9
movq (%r14), %r14
testq %r14, %r14
jne 0x182a7
jmp 0x182bd
xorl %eax, %eax
jmp 0x182bd
movq 0x10(%r14), %rax
movq %rax, (%rbx)
movl 0x1b1ba(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1b1ba(%rip), %ecx     # 0x33488
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_read_scrolls
int rs_read_scrolls(int inf)
{
    int i;

    for(i = 0; i < MAXSCROLLS; i++)
    {
        rs_read_new_string(inf,&s_names[i]);
        rs_read_boolean(inf,&s_know[i]);
        rs_read_new_string(inf,&s_guess[i]);
    }

    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x17dd3(%rip), %r14     # 0x300c0
leaq 0x1822c(%rip), %r15     # 0x30520
xorl %r13d, %r13d
leaq 0x180e2(%rip), %rbp     # 0x303e0
leaq 0x7(%rsp), %r12
movl %ebx, %edi
movq %r15, %rsi
callq 0x160d9
movl %ebx, %edi
movq %r12, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, 0x7(%rsp)
setne (%rbp,%r13)
movl %ebx, %edi
movq %r14, %rsi
callq 0x160d9
incq %r13
addq $0x8, %r14
addq $0x8, %r15
cmpq $0x1a, %r13
jne 0x18303
movl 0x1b138(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1b138(%rip), %ecx     # 0x33488
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_write_scrolls
int rs_write_scrolls(FILE *savef)
{
    int i;

    for(i = 0; i < MAXSCROLLS; i++)
    {
        rs_write_string(savef,s_names[i]);
        rs_write_boolean(savef,s_know[i]);
        rs_write_string(savef,s_guess[i]);
    }
    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x181a6(%rip), %r12     # 0x30520
leaq 0x1805f(%rip), %r13     # 0x303e0
leaq 0x7(%rsp), %r14
leaq 0x17d33(%rip), %rbp     # 0x300c0
movq (%r12,%r15,8), %rsi
movq %rbx, %rdi
callq 0x159d7
movb (%r13,%r15), %al
movb %al, 0x7(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15645
movq (%rbp,%r15,8), %rsi
movq %rbx, %rdi
callq 0x159d7
incq %r15
cmpq $0x1a, %r15
jne 0x1838d
movl 0x1b0b2(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1b0b2(%rip), %ecx     # 0x33488
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_read_potions
int rs_read_potions(int inf)
{
    int i;

    for(i = 0; i < MAXPOTIONS; i++)
    {
        rs_read_string_index(inf,rainbow,NCOLORS,&p_colors[i]);
        rs_read_boolean(inf,&p_know[i]);
        rs_read_new_string(inf,&p_guess[i]);
    }

    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x17d94(%rip), %r14     # 0x30190
leaq 0x181ed(%rip), %r15     # 0x305f0
xorl %ebp, %ebp
leaq 0x17ff4(%rip), %r12     # 0x30400
leaq 0x7(%rsp), %r13
movl %ebx, %edi
leaq 0x14706(%rip), %rsi     # 0x2cb20
movl $0x20, %edx
movq %r15, %rcx
callq 0x16154
movl %ebx, %edi
movq %r13, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, 0x7(%rsp)
setne (%r12,%rbp)
movl %ebx, %edi
movq %r14, %rsi
callq 0x160d9
incq %rbp
addq $0x8, %r14
addq $0x8, %r15
cmpq $0x15, %rbp
jne 0x18411
movl 0x1b01f(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1b01f(%rip), %ecx     # 0x33488
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_write_potions
int rs_write_potions(FILE *savef)
{
    int i;

    for(i = 0; i < MAXPOTIONS; i++)
    {
        rs_write_string_index(savef,rainbow,NCOLORS,p_colors[i]);
        rs_write_boolean(savef,p_know[i]);
        rs_write_string(savef,p_guess[i]);
    }

    return(WRITESTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x1468d(%rip), %r13     # 0x2cb20
leaq 0x17f66(%rip), %rbp     # 0x30400
leaq 0x7(%rsp), %r14
leaq 0x17cea(%rip), %r12     # 0x30190
leaq 0x18143(%rip), %rax     # 0x305f0
movq (%rax,%r15,8), %rax
xorl %esi, %esi
cmpq %rax, (%r13,%rsi,8)
je 0x184c8
incq %rsi
cmpq $0x20, %rsi
jne 0x184b3
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x156d6
movb (%rbp,%r15), %al
movb %al, 0x7(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15645
movq (%r12,%r15,8), %rsi
movq %rbx, %rdi
callq 0x159d7
incq %r15
cmpq $0x15, %r15
jne 0x184a6
xorl %eax, %eax
cmpl $0x0, 0x1af7d(%rip)     # 0x33484
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_read_rings
int rs_read_rings(int inf)
{
    int i;

    for(i = 0; i < MAXRINGS; i++)
    {
        rs_read_string_index(inf,stones,NSTONES,&r_stones[i]);
        rs_read_boolean(inf,&r_know[i]);
        rs_read_new_string(inf,&r_guess[i]);
    }

    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x17d13(%rip), %r14     # 0x30240
leaq 0x1816c(%rip), %r15     # 0x306a0
xorl %ebp, %ebp
leaq 0x17ee3(%rip), %r12     # 0x30420
leaq 0x7(%rsp), %r13
movl %ebx, %edi
leaq 0x14bd5(%rip), %rsi     # 0x2d120
movl $0x23, %edx
movq %r15, %rcx
callq 0x16154
movl %ebx, %edi
movq %r13, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, 0x7(%rsp)
setne (%r12,%rbp)
movl %ebx, %edi
movq %r14, %rsi
callq 0x160d9
incq %rbp
addq $0x8, %r14
addq $0x8, %r15
cmpq $0x1a, %rbp
jne 0x18542
movl 0x1aeee(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1aeee(%rip), %ecx     # 0x33488
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_write_rings
int rs_write_rings(FILE *savef)
{
    int i;

    for(i = 0; i < MAXRINGS; i++)
    {
        rs_write_string_index(savef,stones,NSTONES,r_stones[i]);
        rs_write_boolean(savef,r_know[i]);
        rs_write_string(savef,r_guess[i]);
    }

    return(WRITESTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x14b5c(%rip), %r13     # 0x2d120
leaq 0x17e55(%rip), %rbp     # 0x30420
leaq 0x7(%rsp), %r14
leaq 0x17c69(%rip), %r12     # 0x30240
leaq 0x180c2(%rip), %rax     # 0x306a0
movq (%rax,%r15,8), %rax
xorl %esi, %esi
cmpq %rax, (%r13,%rsi,8)
je 0x185f9
incq %rsi
cmpq $0x23, %rsi
jne 0x185e4
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x156d6
movb (%rbp,%r15), %al
movb %al, 0x7(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15645
movq (%r12,%r15,8), %rsi
movq %rbx, %rdi
callq 0x159d7
incq %r15
cmpq $0x1a, %r15
jne 0x185d7
xorl %eax, %eax
cmpl $0x0, 0x1ae4c(%rip)     # 0x33484
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_write_sticks
int rs_write_sticks(FILE *savef)
{
    int i;

    for (i = 0; i < MAXSTICKS; i++)
    {
        if (strcmp(ws_stuff[i].ws_type,"staff") == 0)
        {
            rs_write_int(savef,0);
            rs_write_string_index(savef, wood, NWOOD, ws_stuff[i].ws_made);
        }
        else
        {
            rs_write_int(savef,1);
            rs_write_string_index(savef, metal, NMETAL, ws_stuff[i].ws_made);
        }
        rs_write_int(savef, ws_stuff[i].ws_vol);
        rs_write_int(savef, ws_stuff[i].ws_wght);
        rs_write_boolean(savef, ws_know[i]);
        rs_write_string(savef, ws_guess[i]);
    }

    return(WRITESTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r12d, %r12d
leaq 0x14bde(%rip), %rbp     # 0x2d240
leaq 0x17ca7(%rip), %r14     # 0x30310
leaq 0x14c90(%rip), %r13     # 0x2d300
leaq (%r12,%r12,2), %rax
leaq 0x180f5(%rip), %rcx     # 0x30770
leaq (%rcx,%rax,8), %r15
movq (%r15), %rdi
leaq 0x77b6(%rip), %rsi      # 0x1fe3f
callq 0x6250
movq %rbx, %rdi
testl %eax, %eax
je 0x186b7
movl $0x1, %esi
callq 0x156d6
movq 0x8(%r15), %rax
xorl %esi, %esi
cmpq %rax, (%r13,%rsi,8)
je 0x186d9
incq %rsi
cmpq $0xf, %rsi
jne 0x186a5
jmp 0x186d4
xorl %esi, %esi
callq 0x156d6
movq 0x8(%r15), %rax
xorl %esi, %esi
cmpq %rax, (%rbp,%rsi,8)
je 0x186d9
incq %rsi
cmpq $0x18, %rsi
jne 0x186c4
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x156d6
movl 0x10(%r15), %esi
movq %rbx, %rdi
callq 0x156d6
movl 0x14(%r15), %esi
movq %rbx, %rdi
callq 0x156d6
leaq 0x17d40(%rip), %rax     # 0x30440
movb (%rax,%r12), %al
movb %al, 0x7(%rsp)
movq %rbx, %rdi
leaq 0x7(%rsp), %rsi
movl $0x1, %edx
callq 0x15645
movq (%r14,%r12,8), %rsi
movq %rbx, %rdi
callq 0x159d7
incq %r12
cmpq $0x1a, %r12
jne 0x18670
xorl %eax, %eax
cmpl $0x0, 0x1ad48(%rip)     # 0x33484
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/state.c
// Function: rs_read_sticks
int rs_read_sticks(int inf)
{
    int i = 0, list = 0;

    for(i = 0; i < MAXSTICKS; i++)
    {
        rs_read_int(inf,&list);
        if (list == 0)
        {
            rs_read_string_index(inf,wood,NWOOD,&ws_stuff[i].ws_made);
            ws_stuff[i].ws_type = "staff";
        }
        else
        {
            rs_read_string_index(inf,metal,NMETAL,&ws_stuff[i].ws_made);
            ws_stuff[i].ws_type = "wand";
        }
        rs_read_int(inf, &ws_stuff[i].ws_vol);
        rs_read_int(inf, &ws_stuff[i].ws_wght);

        rs_read_boolean(inf, &ws_know[i]);
        rs_read_new_string(inf, &ws_guess[i]);
    }

    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x4(%rsp), %rax
movl $0x0, (%rax)
leaq 0x17ba3(%rip), %r15     # 0x30310
leaq 0x17ccc(%rip), %r12     # 0x30440
xorl %ebp, %ebp
leaq 0x17ff3(%rip), %r14     # 0x30770
leaq 0x3(%rsp), %r13
movl %ebx, %edi
leaq 0x4(%rsp), %rsi
callq 0x15bb9
cmpl $0x0, 0x4(%rsp)
leaq 0x8(%r14,%rbp), %rcx
movl %ebx, %edi
je 0x187b6
leaq 0x14b5d(%rip), %rsi     # 0x2d300
movl $0xf, %edx
callq 0x16154
leaq 0x7a89(%rip), %rax      # 0x2023d
jmp 0x187ce
leaq 0x14a83(%rip), %rsi     # 0x2d240
movl $0x18, %edx
callq 0x16154
leaq 0x7671(%rip), %rax      # 0x1fe3f
leaq (%r14,%rbp), %rsi
addq $0x10, %rsi
movq %rax, -0x10(%rsi)
movl %ebx, %edi
callq 0x15bb9
leaq (%r14,%rbp), %rsi
addq $0x14, %rsi
movl %ebx, %edi
callq 0x15bb9
movl %ebx, %edi
movq %r13, %rsi
movl $0x1, %edx
callq 0x15ade
cmpb $0x0, 0x3(%rsp)
setne (%r12)
movl %ebx, %edi
movq %r15, %rsi
callq 0x160d9
addq $0x18, %rbp
addq $0x8, %r15
incq %r12
cmpq $0x270, %rbp            # imm = 0x270
jne 0x18782
movl 0x1ac4f(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1ac4f(%rip), %ecx     # 0x33488
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/sticks.c
// Function: fix_stick
void fix_stick(struct object *cur)
{
	struct rod *rd;

	cur->o_type = STICK;
	cur->o_charges = 4 + rnd(5);
	strcpy(cur->o_hurldmg, "1d1");
	rd = &ws_stuff[cur->o_which];
	cur->o_weight = rd->ws_wght;
	cur->o_vol = rd->ws_vol;
	if (strcmp(rd->ws_type, "staff") == 0) {
		strcpy(cur->o_damage, "2d3");
		cur->o_charges += rnd(5) + 3;
	}
	else {
		strcpy(cur->o_damage, "1d1");
	}
	switch (cur->o_which) {
		case WS_HIT:
			if(rnd(100) < 15) {
				cur->o_hplus = 9;
				cur->o_dplus = 9;
				strcpy(cur->o_damage,"3d8");
			}
			else {
				cur->o_hplus = 3;
				cur->o_dplus = 3;
				strcpy(cur->o_damage,"1d8");
			}
		when WS_LIGHT:
			cur->o_charges += 7 + rnd(9);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x2f, 0x20(%rdi)
movl $0x5, %edi
xorl %eax, %eax
callq 0xc674
addl $0x4, %eax
movl %eax, 0x34(%rbx)
movl $0x316431, 0x10(%rbx)   # imm = 0x316431
movslq 0x28(%rbx), %r14
leaq (%r14,%r14,2), %rax
leaq 0x1720a(%rip), %rcx     # 0x30770
movq 0x10(%rcx,%rax,8), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x40(%rbx)
movq (%rcx,%rax,8), %rdi
leaq 0x68be(%rip), %rsi      # 0x1fe3f
callq 0x6250
testl %eax, %eax
je 0x19593
movl $0x316431, 0x8(%rbx)    # imm = 0x316431
jmp 0x195b5
movl $0x336432, 0x8(%rbx)    # imm = 0x336432
movl $0x5, %edi
xorl %eax, %eax
callq 0xc674
movl 0x28(%rbx), %r14d
movl 0x34(%rbx), %ecx
addl %ecx, %eax
addl $0x3, %eax
movl %eax, 0x34(%rbx)
testl %r14d, %r14d
je 0x195e8
cmpl $0x1, %r14d
jne 0x19616
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
cmpl $0xe, %eax
jg 0x19601
movabsq $0x900000009, %rax      # imm = 0x900000009
movq %rax, 0x2c(%rbx)
movl $0x386433, 0x8(%rbx)    # imm = 0x386433
jmp 0x19616
movl $0x9, %edi
xorl %eax, %eax
callq 0xc674
movl 0x34(%rbx), %ecx
addl %ecx, %eax
addl $0x7, %eax
movl %eax, 0x34(%rbx)
jmp 0x19616
movabsq $0x300000003, %rax      # imm = 0x300000003
movq %rax, 0x2c(%rbx)
movl $0x386431, 0x8(%rbx)    # imm = 0x386431
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/sticks.c
// Function: drain
int drain(int ymin,int  ymax,int xmin,int xmax)
{
	int i, j, cnt;
	struct thing *ick;
	struct linked_list *item;

	/*
	 * First count how many things we need to spread the hit points among
	 */
	cnt = 0;
	for (i = ymin; i <= ymax; i++)
		for (j = xmin; j <= xmax; j++)
			if (isalpha(mvwinch(mw, i, j)))
				cnt++;
	if (cnt == 0) {
		msg("You have a tingling feeling.");
		return 0;
	}
	cnt = him->s_hpt / cnt;
	him->s_hpt /= 2;
	/*
	 * Now zot all of the monsters
	 */
	for (i = ymin; i <= ymax; i++) {
		for (j = xmin; j <= xmax; j++) {
			if(isalpha(mvwinch(mw, i, j))) {
				item = find_mons(i, j);
				if (item == NULL)
					continue;
				ick = THINGPTR(item);
				if ((ick->t_stats.s_hpt -= cnt) < 1)
					killed(item,cansee(i,j) && !(ick->t_flags & ISINVIS));
			}
		}
	}
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x10(%rsp)
movl %esi, 0x4(%rsp)
cmpl %esi, %edi
jg 0x1a997
movl %edx, %ebp
movq 0x10(%rsp), %rax
incl %eax
movl %eax, 0xc(%rsp)
xorl %r14d, %r14d
movq %rdi, 0x20(%rsp)
movl %edi, %r12d
movl %edx, 0x8(%rsp)
cmpl 0x10(%rsp), %ebp
jg 0x1a881
callq 0x65b0
leaq 0x161ba(%rip), %rcx     # 0x309f0
movq %rax, %r13
movq (%r13), %r15
movq (%rcx), %rdi
movl %r12d, %esi
movl %ebp, %edx
movq %rcx, %rbx
callq 0x6490
cmpl $-0x1, %eax
je 0x1a85e
movq (%rbx), %rdi
callq 0x6330
cltq
jmp 0x1a865
movq $-0x1, %rax
movzwl (%r15,%rax,2), %eax
btl $0xa, %eax
adcl $0x0, %r14d
incl %ebp
cmpl %ebp, 0xc(%rsp)
leaq 0x16171(%rip), %rcx     # 0x309f0
jne 0x1a839
leal 0x1(%r12), %eax
cmpl 0x4(%rsp), %r12d
movl %eax, %r12d
movl 0x8(%rsp), %ebp
jne 0x1a824
testl %r14d, %r14d
movq 0x20(%rsp), %r15
je 0x1a997
leaq 0x134b7(%rip), %rax     # 0x2dd60
movq (%rax), %rsi
movl 0x30(%rsi), %ecx
movl %ecx, %eax
cltd
idivl %r14d
movl %eax, 0x1c(%rsp)
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
movl %eax, 0x30(%rsi)
cmpl 0x4(%rsp), %r15d
jg 0x1a9a5
cmpl 0x10(%rsp), %ebp
jg 0x1a97f
callq 0x65b0
leaq 0x1610a(%rip), %rcx     # 0x309f0
movq %rax, %r13
movl 0x8(%rsp), %ebp
movq %r15, %r12
movq (%r13), %r14
movq (%rcx), %rdi
movl %r15d, %esi
movl %ebp, %edx
movq %rcx, %rbx
callq 0x6490
cmpl $-0x1, %eax
je 0x1a915
movq (%rbx), %rdi
callq 0x6330
cltq
jmp 0x1a91c
movq $-0x1, %rax
testb $0x4, 0x1(%r14,%rax,2)
je 0x1a969
movl %r12d, %edi
movl %ebp, %esi
callq 0x7502
testq %rax, %rax
je 0x1a969
movq %rax, %r14
movq 0x10(%rax), %r15
movl 0x1c(%rsp), %eax
subl %eax, 0x30(%r15)
jg 0x1a969
movl %r12d, %edi
movl %ebp, %esi
callq 0x6f96
testb %al, %al
je 0x1a95c
testb $0x10, 0x78(%r15)
sete %al
jmp 0x1a95e
xorl %eax, %eax
movzbl %al, %esi
movq %r14, %rdi
callq 0xa04b
incl %ebp
cmpl %ebp, 0xc(%rsp)
movq %r12, %r15
leaq 0x16077(%rip), %rcx     # 0x309f0
jne 0x1a8f0
leal 0x1(%r15), %eax
cmpl 0x4(%rsp), %r15d
movl %eax, %r15d
movl 0x8(%rsp), %ebp
jne 0x1a8d0
jmp 0x1a9a5
leaq 0x8ac8(%rip), %rdi      # 0x23466
xorl %eax, %eax
callq 0xb620
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/sticks.c
// Function: charge_str
char *charge_str(struct object *obj)
{
	static char buf[20];

	buf[0] = '\0';
	if (o_on(obj,ISKNOW) || o_on(obj,ISPOST))
		sprintf(buf, " [%d]", obj->o_charges);
	return buf;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb $0x0, 0x18adf(%rip)     # 0x334a0
movl $0x2, %esi
callq 0x9531
testb %al, %al
jne 0x1a9e0
movl $0x4, %esi
movq %rbx, %rdi
callq 0x9531
testb %al, %al
je 0x1a9f8
movl 0x34(%rbx), %edx
leaq 0x18ab6(%rip), %rdi     # 0x334a0
leaq 0x8a92(%rip), %rsi      # 0x23483
xorl %eax, %eax
callq 0x64f0
leaq 0x18aa1(%rip), %rax     # 0x334a0
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/things.c
// Function: money
void money()
{
	struct room *rp;
	struct linked_list *item;
	struct thing *tp;

	rp = player.t_room;
	if (rp != NULL && ce(hero, rp->r_gold)) {
		msg("%d gold pieces.", rp->r_goldval);
		purse += rp->r_goldval;
		rp->r_goldval = 0;
		cmov(rp->r_gold);
		addch(FLOOR);
		/*
		 * once gold is taken, all monsters will chase him
		 */
		for (item = mlist; item != NULL; item = next(item)) {
			tp = THINGPTR(item);
			if (rnd(100) < 70 && tp->t_room == rp && !iswearing(R_STEALTH)
			  && ((tp->t_flags & (ISMEAN | ISGREED)) || rnd(1000) < 20))
				runto(&tp->t_pos, &hero);
		}
	}
	else
		msg("That gold must have been counterfeit.");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x12a29(%rip), %rbx     # 0x2dc60
movq 0x70(%rbx), %r15
testq %r15, %r15
je 0x1b322
movl 0x50(%rbx), %eax
cmpl 0x10(%r15), %eax
jne 0x1b322
movl 0x54(%rbx), %eax
cmpl 0x14(%r15), %eax
jne 0x1b322
movl 0x58(%r15), %esi
leaq 0x8334(%rip), %rdi      # 0x2359d
xorl %eax, %eax
callq 0xb620
movl 0x58(%r15), %eax
leaq 0x125f1(%rip), %rcx     # 0x2d86c
addl %eax, (%rcx)
movl $0x0, 0x58(%r15)
movq 0xeca4(%rip), %r14      # 0x29f30
movq (%r14), %rdi
movl 0x10(%r15), %edx
movl 0x14(%r15), %esi
callq 0x6490
movq (%r14), %rdi
movl $0x2e, %esi
callq 0x64c0
leaq 0x12590(%rip), %rax     # 0x2d840
movq (%rax), %r12
testq %r12, %r12
je 0x1b316
addq $0x50, %rbx
movq 0x10(%r12), %r14
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
cmpl $0x45, %eax
jg 0x1b30d
cmpq %r15, 0x70(%r14)
jne 0x1b30d
movl $0xc, %edi
callq 0x12c34
testb %al, %al
jne 0x1b30d
testb $0x60, 0x78(%r14)
jne 0x1b2fe
movl $0x3e8, %edi            # imm = 0x3E8
xorl %eax, %eax
callq 0xc674
cmpl $0x13, %eax
jg 0x1b30d
addq $0x50, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x74b9
movq (%r12), %r12
testq %r12, %r12
jne 0x1b2bc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x8284(%rip), %rdi      # 0x235ad
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xb620
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/things.c
// Function: dropcheck
bool dropcheck(struct object *op)
{
	if (op == NULL)
		return TRUE;
	if (levtype == POSTLEV) {
		if (o_on(op,ISCURSED) && o_on(op,ISKNOW)) {
			msg("The trader does not accept shoddy merchandise.");
			return FALSE;
		}
		else {
			cur_null(op);	/* update cur_weapon, etc */
			return TRUE;
		}
	}
	if (op != cur_armor && op != cur_weapon
	  && op != cur_ring[LEFT] && op != cur_ring[RIGHT])
		return TRUE;
	if (o_on(op,ISCURSED)) {
		msg("You can't.  It appears to be cursed.");
		return FALSE;
	}
	if (op == cur_weapon)
		cur_weapon = NULL;
	else if (op == cur_armor) {
		waste_time();
		cur_armor = NULL;
	}
	else if (op == cur_ring[LEFT] || op == cur_ring[RIGHT])
		toss_ring(op);
	return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movb $0x1, %bl
testq %rdi, %rdi
je 0x1b5f1
movq %rdi, %r14
leaq 0x122f9(%rip), %rax     # 0x2d864
cmpl $0x1, (%rax)
jne 0x1b59b
movl $0x1, %esi
movq %r14, %rdi
callq 0x9531
testb %al, %al
je 0x1b5e9
movl $0x2, %esi
movq %r14, %rdi
callq 0x9531
testb %al, %al
je 0x1b5e9
leaq 0x80b8(%rip), %rdi      # 0x23651
jmp 0x1b5de
leaq 0x122b6(%rip), %r15     # 0x2d858
leaq 0x122a7(%rip), %r12     # 0x2d850
cmpq %r14, (%r15)
je 0x1b5c6
cmpq %r14, (%r12)
je 0x1b5c6
leaq 0x12795(%rip), %rax     # 0x2dd50
cmpq %r14, (%rax)
je 0x1b5c6
cmpq %r14, 0x8(%rax)
jne 0x1b5f1
movl $0x1, %esi
movq %r14, %rdi
callq 0x9531
testb %al, %al
je 0x1b5ff
leaq 0x80a2(%rip), %rdi      # 0x23680
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xb620
jmp 0x1b5f1
movq %r14, %rdi
callq 0x10bd9
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
cmpq %r14, (%r12)
je 0x1b626
cmpq %r14, (%r15)
je 0x1b630
leaq 0x1273f(%rip), %rax     # 0x2dd50
cmpq %r14, (%rax)
je 0x1b61c
cmpq %r14, 0x8(%rax)
jne 0x1b5f1
movq %r14, %rdi
callq 0x1273c
jmp 0x1b5f1
movq $0x0, (%r12)
jmp 0x1b5f1
xorl %eax, %eax
callq 0xc9bc
movq $0x0, (%r15)
jmp 0x1b5f1
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/things.c
// Function: pick_one
int pick_one(struct magic_item *mag)
{
	struct magic_item *start;
	int i;

	start = mag;
	for (i = rnd(1000); mag->mi_name != NULL; mag++) {
		if (i < mag->mi_prob)
			break;
		if (mag->mi_name == NULL) {
			if (author() || wizard) {
				for (mag = start; mag->mi_name != NULL; mag++)
					msg("%s: %d%%", mag->mi_name, mag->mi_prob);
			}
			mag = start;
		}
	}
	return mag - start;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x3e8, %edi            # imm = 0x3E8
xorl %eax, %eax
callq 0xc674
cmpq $0x0, (%rbx)
movq %rbx, %rcx
je 0x1b9e1
movq %rbx, %rdx
cmpl 0x8(%rdx), %eax
jl 0x1b9de
leaq 0x10(%rdx), %rcx
cmpq $0x0, 0x10(%rdx)
movq %rcx, %rdx
jne 0x1b9c9
jmp 0x1b9e1
movq %rdx, %rcx
subq %rbx, %rcx
shrq $0x4, %rcx
movl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/trader.c
// Function: price_it
bool price_it()
{
	static char *bargain[] = {
		"great bargain",
		"quality product",
		"exceptional find",
	};
	struct linked_list *item;
	struct object *obj;
	int worth;

	if (!open_market())		/* after buying hours */
		return FALSE;
	if ((item = find_obj(hero.y,hero.x)) == NULL)
		return FALSE;
	obj = OBJPTR(item);
	if (curprice == NOTPRICED) {
		worth = get_worth(obj);
		worth += 50 - rnd(100);
		if (worth < 25)
			worth = 25;
		worth *= 3;							/* slightly expensive */
		curprice = worth;					/* save price */
		strcpy(curpurch, obj->o_typname);	/* save item */
	}
	msg("That %s is a %s for only %d pieces of gold", curpurch,
	  bargain[rnd(3)], curprice);
	return TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
leaq 0x11c97(%rip), %rax     # 0x2d868
cmpl $0x4, (%rax)
jge 0x1bc7e
leaq 0x1207f(%rip), %rax     # 0x2dc60
movl 0x50(%rax), %esi
movl 0x54(%rax), %edi
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xd104
testq %rax, %rax
je 0x1bc8e
leaq 0xe6f4(%rip), %r14      # 0x2a2f4
cmpl $-0x1, (%r14)
jne 0x1bc46
movq 0x10(%rax), %rbx
movq %rbx, %rdi
callq 0x1bc95
movl %eax, %ebp
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
subl %eax, %ebp
addl $0x32, %ebp
cmpl $0x1a, %ebp
movl $0x19, %eax
cmovgel %ebp, %eax
leal (%rax,%rax,2), %eax
movl %eax, (%r14)
movq 0x18(%rbx), %rsi
leaq 0x12235(%rip), %rdi     # 0x2de76
callq 0x60e0
movl $0x3, %edi
xorl %eax, %eax
callq 0xc674
cltq
leaq 0x7c81(%rip), %rcx      # 0x238dc
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
movl (%r14), %ecx
leaq 0x7b43(%rip), %rdi      # 0x237af
leaq 0x12203(%rip), %rsi     # 0x2de76
xorl %eax, %eax
callq 0xb620
movb $0x1, %bl
jmp 0x1bc8e
leaq 0x7c00(%rip), %rdi      # 0x23885
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xb620
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq