// File: /workspace/github_c_makefile_star2_O0/ajpaulson[P]srogue11/state.c
// Function: rs_write_object
int rs_write_object(FILE *savef, struct object *o)
{
    rs_write_int(savef, RSID_OBJECT);
    rs_write_coord(savef, o->o_pos);
    rs_write(savef, o->o_damage, sizeof(o->o_damage));
    rs_write(savef, o->o_hurldmg, sizeof(o->o_hurldmg));

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

    rs_write_int(savef, o->o_type);
    rs_write_int(savef, o->o_count);
    rs_write_int(savef, o->o_which);
    rs_write_int(savef, o->o_hplus);
    rs_write_int(savef, o->o_dplus);
    rs_write_int(savef, o->o_ac);
    rs_write_int(savef, o->o_flags);
    rs_write_int(savef, o->o_group);
    rs_write_int(savef, o->o_weight);
    rs_write_int(savef, o->o_vol);

    rs_write_char(savef, o->o_launch);

    return(WRITESTAT);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0xabcd0003, %esi       # imm = 0xABCD0003
callq 0x1bf60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x1d360
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movl $0x8, %edx
callq 0x1be50
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movl $0x8, %edx
callq 0x1be50
movq -0x10(%rbp), %rax
cmpl $0x5d, 0x20(%rax)
jne 0x1ea87
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x1637d(%rip), %rax     # 0x34dd0
movq 0x40(%rax), %rsi
callq 0x6250
cmpl $0x0, %eax
jne 0x1ea63
jmp 0x1ea82
leaq 0xeb7e(%rip), %rdi      # 0x2d5e8
leaq 0xe8a0(%rip), %rsi      # 0x2d311
movl $0x532, %edx            # imm = 0x532
leaq 0xeb9f(%rip), %rcx      # 0x2d61c
callq 0x61d0
jmp 0x1ecc8
movq -0x10(%rbp), %rax
cmpl $0x3a, 0x20(%rax)
jne 0x1ead4
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x16330(%rip), %rax     # 0x34dd0
movq 0x20(%rax), %rsi
callq 0x6250
cmpl $0x0, %eax
jne 0x1eab0
jmp 0x1eacf
leaq 0xeb92(%rip), %rdi      # 0x2d649
leaq 0xe853(%rip), %rsi      # 0x2d311
movl $0x534, %edx            # imm = 0x534
leaq 0xeb52(%rip), %rcx      # 0x2d61c
callq 0x61d0
jmp 0x1ecc6
movq -0x10(%rbp), %rax
cmpl $0x3d, 0x20(%rax)
jne 0x1eb21
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x162e3(%rip), %rax     # 0x34dd0
movq 0x50(%rax), %rsi
callq 0x6250
cmpl $0x0, %eax
jne 0x1eafd
jmp 0x1eb1c
leaq 0xeb78(%rip), %rdi      # 0x2d67c
leaq 0xe806(%rip), %rsi      # 0x2d311
movl $0x536, %edx            # imm = 0x536
leaq 0xeb05(%rip), %rcx      # 0x2d61c
callq 0x61d0
jmp 0x1ecc4
movq -0x10(%rbp), %rax
cmpl $0x29, 0x20(%rax)
jne 0x1eb6e
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x16296(%rip), %rax     # 0x34dd0
movq 0x30(%rax), %rsi
callq 0x6250
cmpl $0x0, %eax
jne 0x1eb4a
jmp 0x1eb69
leaq 0xeb5e(%rip), %rdi      # 0x2d6af
leaq 0xe7b9(%rip), %rsi      # 0x2d311
movl $0x538, %edx            # imm = 0x538
leaq 0xeab8(%rip), %rcx      # 0x2d61c
callq 0x61d0
jmp 0x1ecc2
movq -0x10(%rbp), %rax
cmpl $0x21, 0x20(%rax)
jne 0x1ebba
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x16249(%rip), %rax     # 0x34dd0
movq (%rax), %rsi
callq 0x6250
cmpl $0x0, %eax
jne 0x1eb96
jmp 0x1ebb5
leaq 0xeb47(%rip), %rdi      # 0x2d6e4
leaq 0xe76d(%rip), %rsi      # 0x2d311
movl $0x53a, %edx            # imm = 0x53A
leaq 0xea6c(%rip), %rcx      # 0x2d61c
callq 0x61d0
jmp 0x1ecc0
movq -0x10(%rbp), %rax
cmpl $0x3f, 0x20(%rax)
jne 0x1ec07
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x161fd(%rip), %rax     # 0x34dd0
movq 0x10(%rax), %rsi
callq 0x6250
cmpl $0x0, %eax
jne 0x1ebe3
jmp 0x1ec02
leaq 0xeb2f(%rip), %rdi      # 0x2d719
leaq 0xe720(%rip), %rsi      # 0x2d311
movl $0x53c, %edx            # imm = 0x53C
leaq 0xea1f(%rip), %rcx      # 0x2d61c
callq 0x61d0
jmp 0x1ecbe
movq -0x10(%rbp), %rax
cmpl $0x2f, 0x20(%rax)
jne 0x1ec51
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x161b0(%rip), %rax     # 0x34dd0
movq 0x60(%rax), %rsi
callq 0x6250
cmpl $0x0, %eax
jne 0x1ec30
jmp 0x1ec4f
leaq 0xeb17(%rip), %rdi      # 0x2d74e
leaq 0xe6d3(%rip), %rsi      # 0x2d311
movl $0x53e, %edx            # imm = 0x53E
leaq 0xe9d2(%rip), %rcx      # 0x2d61c
callq 0x61d0
jmp 0x1ecbc
movq -0x10(%rbp), %rax
cmpl $0x2c, 0x20(%rax)
jne 0x1ec9b
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x16166(%rip), %rax     # 0x34dd0
movq 0x70(%rax), %rsi
callq 0x6250
cmpl $0x0, %eax
jne 0x1ec7a
jmp 0x1ec99
leaq 0xeb01(%rip), %rdi      # 0x2d782
leaq 0xe689(%rip), %rsi      # 0x2d311
movl $0x540, %edx            # imm = 0x540
leaq 0xe988(%rip), %rcx      # 0x2d61c
callq 0x61d0
jmp 0x1ecba
leaq 0xeb15(%rip), %rdi      # 0x2d7b7
leaq 0xe668(%rip), %rsi      # 0x2d311
movl $0x542, %edx            # imm = 0x542
leaq 0xe967(%rip), %rcx      # 0x2d61c
callq 0x61d0
jmp 0x1ecbc
jmp 0x1ecbe
jmp 0x1ecc0
jmp 0x1ecc2
jmp 0x1ecc4
jmp 0x1ecc6
jmp 0x1ecc8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x1bf60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x24(%rax), %esi
callq 0x1bf60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x28(%rax), %esi
callq 0x1bf60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %esi
callq 0x1bf60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x30(%rax), %esi
callq 0x1bf60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x34(%rax), %esi
callq 0x1bf60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x38(%rax), %esi
callq 0x1bf60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %esi
callq 0x1bf60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x40(%rax), %esi
callq 0x1bf60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x44(%rax), %esi
callq 0x1bf60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movsbl 0x48(%rax), %esi
callq 0x1bec0
cmpl $0x0, 0x1db74(%rip)     # 0x3c8f4
sete %al
andb $0x1, %al
movzbl %al, %eax
addq $0x10, %rsp
popq %rbp
retq
nop