// File: /workspace/github_c_makefile_star2_O3/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 0x156d6
movq (%r14), %rsi
movq %rsi, %r15
shrq $0x20, %r15
movq %rbx, %rdi
callq 0x156d6
movq %rbx, %rdi
movl %r15d, %esi
callq 0x156d6
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x15645
leaq 0x10(%r14), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x15645
movl 0x20(%r14), %ebp
cmpl $0x39, %ebp
jg 0x172fd
cmpl $0x2b, %ebp
jg 0x17353
cmpl $0x21, %ebp
je 0x173ed
cmpl $0x29, %ebp
jne 0x17556
movq 0x18(%r14), %rdi
leaq 0x14b03(%rip), %rax     # 0x2bdd0
movq 0x30(%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x174b1
leaq 0xbcfc(%rip), %rdi      # 0x22fe1
leaq 0xba15(%rip), %rsi      # 0x22d01
leaq 0xbc5b(%rip), %rcx      # 0x22f4e
movl $0x538, %edx            # imm = 0x538
callq 0x61e0
cmpl $0x3e, %ebp
jg 0x173a0
cmpl $0x3a, %ebp
je 0x17427
cmpl $0x3d, %ebp
jne 0x17556
movq 0x18(%r14), %rdi
leaq 0x14aad(%rip), %rax     # 0x2bdd0
movq 0x50(%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x174b1
leaq 0xbc73(%rip), %rdi      # 0x22fae
leaq 0xb9bf(%rip), %rsi      # 0x22d01
leaq 0xbc05(%rip), %rcx      # 0x22f4e
movl $0x536, %edx            # imm = 0x536
callq 0x61e0
cmpl $0x2c, %ebp
je 0x1745e
cmpl $0x2f, %ebp
jne 0x17556
movq 0x18(%r14), %rdi
leaq 0x14a60(%rip), %rax     # 0x2bdd0
movq 0x60(%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x174b1
leaq 0xbcf8(%rip), %rdi      # 0x23080
leaq 0xb972(%rip), %rsi      # 0x22d01
leaq 0xbbb8(%rip), %rcx      # 0x22f4e
movl $0x53e, %edx            # imm = 0x53E
callq 0x61e0
cmpl $0x3f, %ebp
je 0x17495
cmpl $0x5d, %ebp
jne 0x17556
movq 0x18(%r14), %rdi
leaq 0x14a13(%rip), %rax     # 0x2bdd0
movq 0x40(%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x174b1
leaq 0xbb45(%rip), %rdi      # 0x22f1a
leaq 0xb925(%rip), %rsi      # 0x22d01
leaq 0xbb6b(%rip), %rcx      # 0x22f4e
movl $0x532, %edx            # imm = 0x532
callq 0x61e0
movq 0x18(%r14), %rdi
leaq 0x149d8(%rip), %rax     # 0x2bdd0
movq (%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x174b1
leaq 0xbc07(%rip), %rdi      # 0x23016
leaq 0xb8eb(%rip), %rsi      # 0x22d01
leaq 0xbb31(%rip), %rcx      # 0x22f4e
movl $0x53a, %edx            # imm = 0x53A
callq 0x61e0
movq 0x18(%r14), %rdi
leaq 0x1499e(%rip), %rax     # 0x2bdd0
movq 0x20(%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x174b1
leaq 0xbb35(%rip), %rdi      # 0x22f7b
leaq 0xb8b4(%rip), %rsi      # 0x22d01
leaq 0xbafa(%rip), %rcx      # 0x22f4e
movl $0x534, %edx            # imm = 0x534
callq 0x61e0
movq 0x18(%r14), %rdi
leaq 0x14967(%rip), %rax     # 0x2bdd0
movq 0x70(%rax), %rsi
callq 0x6250
testl %eax, %eax
je 0x174b1
leaq 0xbc37(%rip), %rdi      # 0x230b4
leaq 0xb87d(%rip), %rsi      # 0x22d01
leaq 0xbac3(%rip), %rcx      # 0x22f4e
movl $0x540, %edx            # imm = 0x540
callq 0x61e0
movq 0x18(%r14), %rdi
leaq 0x14930(%rip), %rax     # 0x2bdd0
movq 0x10(%rax), %rsi
callq 0x6250
testl %eax, %eax
jne 0x17575
movq %rbx, %rdi
movl %ebp, %esi
callq 0x156d6
movl 0x24(%r14), %esi
movq %rbx, %rdi
callq 0x156d6
movl 0x28(%r14), %esi
movq %rbx, %rdi
callq 0x156d6
movl 0x2c(%r14), %esi
movq %rbx, %rdi
callq 0x156d6
movl 0x30(%r14), %esi
movq %rbx, %rdi
callq 0x156d6
movl 0x34(%r14), %esi
movq %rbx, %rdi
callq 0x156d6
movl 0x38(%r14), %esi
movq %rbx, %rdi
callq 0x156d6
movl 0x3c(%r14), %esi
movq %rbx, %rdi
callq 0x156d6
movl 0x40(%r14), %esi
movq %rbx, %rdi
callq 0x156d6
movl 0x44(%r14), %esi
movq %rbx, %rdi
callq 0x156d6
movb 0x48(%r14), %al
leaq 0x7(%rsp), %rsi
movb %al, (%rsi)
movq %rbx, %rdi
movl $0x1, %edx
callq 0x15645
xorl %eax, %eax
cmpl $0x0, 0x1bf3c(%rip)     # 0x33484
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbb8c(%rip), %rdi      # 0x230e9
leaq 0xb79d(%rip), %rsi      # 0x22d01
leaq 0xb9e3(%rip), %rcx      # 0x22f4e
movl $0x542, %edx            # imm = 0x542
callq 0x61e0
leaq 0xbacf(%rip), %rdi      # 0x2304b
leaq 0xb77e(%rip), %rsi      # 0x22d01
leaq 0xb9c4(%rip), %rcx      # 0x22f4e
movl $0x53c, %edx            # imm = 0x53C
callq 0x61e0