// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0xabcd0003, %esi       # imm = 0xABCD0003
callq 0x15842
movq (%r14), %rsi
movq %rsi, %r15
shrq $0x20, %r15
movq %rbx, %rdi
callq 0x15842
movq %rbx, %rdi
movl %r15d, %esi
callq 0x15842
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x157b1
leaq 0x10(%r14), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x157b1
movl 0x20(%r14), %ebp
cmpl $0x39, %ebp
jg 0x174ac
cmpl $0x2b, %ebp
jg 0x17502
cmpl $0x21, %ebp
je 0x1759c
cmpl $0x29, %ebp
jne 0x17705
movq 0x18(%r14), %rdi
leaq 0x14954(%rip), %rax     # 0x2bdd0
movq 0x30(%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x17660
leaq 0xbad5(%rip), %rdi      # 0x22f69
leaq 0xb7ee(%rip), %rsi      # 0x22c89
leaq 0xba34(%rip), %rcx      # 0x22ed6
movl $0x538, %edx            # imm = 0x538
callq 0x61e0
cmpl $0x3e, %ebp
jg 0x1754f
cmpl $0x3a, %ebp
je 0x175d6
cmpl $0x3d, %ebp
jne 0x17705
movq 0x18(%r14), %rdi
leaq 0x148fe(%rip), %rax     # 0x2bdd0
movq 0x50(%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x17660
leaq 0xba4c(%rip), %rdi      # 0x22f36
leaq 0xb798(%rip), %rsi      # 0x22c89
leaq 0xb9de(%rip), %rcx      # 0x22ed6
movl $0x536, %edx            # imm = 0x536
callq 0x61e0
cmpl $0x2c, %ebp
je 0x1760d
cmpl $0x2f, %ebp
jne 0x17705
movq 0x18(%r14), %rdi
leaq 0x148b1(%rip), %rax     # 0x2bdd0
movq 0x60(%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x17660
leaq 0xbad1(%rip), %rdi      # 0x23008
leaq 0xb74b(%rip), %rsi      # 0x22c89
leaq 0xb991(%rip), %rcx      # 0x22ed6
movl $0x53e, %edx            # imm = 0x53E
callq 0x61e0
cmpl $0x3f, %ebp
je 0x17644
cmpl $0x5d, %ebp
jne 0x17705
movq 0x18(%r14), %rdi
leaq 0x14864(%rip), %rax     # 0x2bdd0
movq 0x40(%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x17660
leaq 0xb91e(%rip), %rdi      # 0x22ea2
leaq 0xb6fe(%rip), %rsi      # 0x22c89
leaq 0xb944(%rip), %rcx      # 0x22ed6
movl $0x532, %edx            # imm = 0x532
callq 0x61e0
movq 0x18(%r14), %rdi
leaq 0x14829(%rip), %rax     # 0x2bdd0
movq (%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x17660
leaq 0xb9e0(%rip), %rdi      # 0x22f9e
leaq 0xb6c4(%rip), %rsi      # 0x22c89
leaq 0xb90a(%rip), %rcx      # 0x22ed6
movl $0x53a, %edx            # imm = 0x53A
callq 0x61e0
movq 0x18(%r14), %rdi
leaq 0x147ef(%rip), %rax     # 0x2bdd0
movq 0x20(%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x17660
leaq 0xb90e(%rip), %rdi      # 0x22f03
leaq 0xb68d(%rip), %rsi      # 0x22c89
leaq 0xb8d3(%rip), %rcx      # 0x22ed6
movl $0x534, %edx            # imm = 0x534
callq 0x61e0
movq 0x18(%r14), %rdi
leaq 0x147b8(%rip), %rax     # 0x2bdd0
movq 0x70(%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x17660
leaq 0xba10(%rip), %rdi      # 0x2303c
leaq 0xb656(%rip), %rsi      # 0x22c89
leaq 0xb89c(%rip), %rcx      # 0x22ed6
movl $0x540, %edx            # imm = 0x540
callq 0x61e0
movq 0x18(%r14), %rdi
leaq 0x14781(%rip), %rax     # 0x2bdd0
movq 0x10(%rax), %rsi
callq 0x6250
testl %eax, %eax
jne 0x17724
movq %rbx, %rdi
movl %ebp, %esi
callq 0x15842
movl 0x24(%r14), %esi
movq %rbx, %rdi
callq 0x15842
movl 0x28(%r14), %esi
movq %rbx, %rdi
callq 0x15842
movl 0x2c(%r14), %esi
movq %rbx, %rdi
callq 0x15842
movl 0x30(%r14), %esi
movq %rbx, %rdi
callq 0x15842
movl 0x34(%r14), %esi
movq %rbx, %rdi
callq 0x15842
movl 0x38(%r14), %esi
movq %rbx, %rdi
callq 0x15842
movl 0x3c(%r14), %esi
movq %rbx, %rdi
callq 0x15842
movl 0x40(%r14), %esi
movq %rbx, %rdi
callq 0x15842
movl 0x44(%r14), %esi
movq %rbx, %rdi
callq 0x15842
movb 0x48(%r14), %al
leaq 0x7(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
movl $0x1, %edx
callq 0x157b1
xorl %eax, %eax
cmpl $0x0, 0x1bd8d(%rip)     # 0x33484
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb965(%rip), %rdi      # 0x23071
leaq 0xb576(%rip), %rsi      # 0x22c89
leaq 0xb7bc(%rip), %rcx      # 0x22ed6
movl $0x542, %edx            # imm = 0x542
callq 0x61e0
leaq 0xb8a8(%rip), %rdi      # 0x22fd3
leaq 0xb557(%rip), %rsi      # 0x22c89
leaq 0xb79d(%rip), %rcx      # 0x22ed6
movl $0x53c, %edx            # imm = 0x53C
callq 0x61e0