// File: /workspace/github_c_makefile_star2_O0/ajpaulson[P]srogue11/state.c
// Function: rs_read_object
int rs_read_object(int inf, struct object *o)
{
    int id;

    if (rs_read_int(inf, &id) != 0)
    {
        if (id != RSID_OBJECT)
        {
            printf("Invalid id. %x != %x(RSID_OBJECT)\n",
                id,RSID_OBJECT);
            printf("Sorry, invalid save game format");
            format_error = TRUE;
        }
        else
        {
            rs_read_coord(inf, &o->o_pos);
            rs_read(inf, &o->o_damage, sizeof(o->o_damage));
            rs_read(inf, &o->o_hurldmg, sizeof(o->o_hurldmg));
            rs_read_int(inf, &o->o_type);

            if (o->o_type == ARMOR)
                o->o_typname = things[TYP_ARMOR].mi_name;
            else if (o->o_type == FOOD)
                o->o_typname = things[TYP_FOOD].mi_name;
            else if (o->o_type == RING)
                o->o_typname = things[TYP_RING].mi_name;
            else if (o->o_type == WEAPON)
                o->o_typname = things[TYP_WEAPON].mi_name;
            else if (o->o_type == POTION)
                o->o_typname = things[TYP_POTION].mi_name;
            else if (o->o_type == SCROLL)
                o->o_typname = things[TYP_SCROLL].mi_name;
            else if (o->o_type == STICK)
                o->o_typname = things[TYP_STICK].mi_name;
            else if (o->o_type == AMULET)
                o->o_typname = things[TYP_AMULET].mi_name;
            else
                assert(0 == 1);

            rs_read_int(inf, &o->o_count);
            rs_read_int(inf, &o->o_which);
            rs_read_int(inf, &o->o_hplus);
            rs_read_int(inf, &o->o_dplus);
            rs_read_int(inf, &o->o_ac);
            rs_read_int(inf, &o->o_flags);
            rs_read_int(inf, &o->o_group);
            rs_read_int(inf, &o->o_weight);
            rs_read_int(inf, &o->o_vol);
            rs_read_char(inf, &o->o_launch);
        }
    }
    
    return(READSTAT);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x4(%rbp), %edi
leaq -0x14(%rbp), %rsi
callq 0x1c810
cmpl $0x0, %eax
je 0x1f00b
cmpl $0xabcd0003, -0x14(%rbp) # imm = 0xABCD0003
je 0x1edf0
movl -0x14(%rbp), %esi
leaq 0xe9f7(%rip), %rdi      # 0x2d7be
movl $0xabcd0003, %edx       # imm = 0xABCD0003
movb $0x0, %al
callq 0x61b0
leaq 0xe69e(%rip), %rdi      # 0x2d478
movb $0x0, %al
callq 0x61b0
movl $0x1, 0x1db0d(%rip)     # 0x3c8f8
jmp 0x1f009
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x1d3a0
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movl $0x8, %edx
callq 0x1c690
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movl $0x8, %edx
callq 0x1c690
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x1c810
movq -0x10(%rbp), %rax
cmpl $0x5d, 0x20(%rax)
jne 0x1ee58
leaq 0x15f89(%rip), %rax     # 0x34dd0
movq 0x40(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x1ef69
movq -0x10(%rbp), %rax
cmpl $0x3a, 0x20(%rax)
jne 0x1ee7a
leaq 0x15f67(%rip), %rax     # 0x34dd0
movq 0x20(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x1ef67
movq -0x10(%rbp), %rax
cmpl $0x3d, 0x20(%rax)
jne 0x1ee9c
leaq 0x15f45(%rip), %rax     # 0x34dd0
movq 0x50(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x1ef65
movq -0x10(%rbp), %rax
cmpl $0x29, 0x20(%rax)
jne 0x1eebe
leaq 0x15f23(%rip), %rax     # 0x34dd0
movq 0x30(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x1ef63
movq -0x10(%rbp), %rax
cmpl $0x21, 0x20(%rax)
jne 0x1eedf
leaq 0x15f01(%rip), %rax     # 0x34dd0
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x1ef61
movq -0x10(%rbp), %rax
cmpl $0x3f, 0x20(%rax)
jne 0x1eefe
leaq 0x15ee0(%rip), %rax     # 0x34dd0
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x1ef5f
movq -0x10(%rbp), %rax
cmpl $0x2f, 0x20(%rax)
jne 0x1ef1d
leaq 0x15ec1(%rip), %rax     # 0x34dd0
movq 0x60(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x1ef5d
movq -0x10(%rbp), %rax
cmpl $0x2c, 0x20(%rax)
jne 0x1ef3c
leaq 0x15ea2(%rip), %rax     # 0x34dd0
movq 0x70(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x1ef5b
leaq 0xe874(%rip), %rdi      # 0x2d7b7
leaq 0xe3c7(%rip), %rsi      # 0x2d311
movl $0x579, %edx            # imm = 0x579
leaq 0xe88b(%rip), %rcx      # 0x2d7e1
callq 0x61d0
jmp 0x1ef5d
jmp 0x1ef5f
jmp 0x1ef61
jmp 0x1ef63
jmp 0x1ef65
jmp 0x1ef67
jmp 0x1ef69
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x24, %rsi
callq 0x1c810
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x1c810
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x2c, %rsi
callq 0x1c810
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x30, %rsi
callq 0x1c810
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x34, %rsi
callq 0x1c810
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x38, %rsi
callq 0x1c810
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x3c, %rsi
callq 0x1c810
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
callq 0x1c810
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x44, %rsi
callq 0x1c810
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
callq 0x1c760
jmp 0x1f00b
xorl %eax, %eax
cmpl $0x0, 0x1d8e4(%rip)     # 0x3c8f8
movb %al, -0x15(%rbp)
jne 0x1f026
cmpl $0x0, 0x1d8d0(%rip)     # 0x3c8f0
sete %al
movb %al, -0x15(%rbp)
movb -0x15(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)