// File: /workspace/github_c_makefile_star2_O1/ajpaulson[P]srogue11/state.c
// Function: rs_write_daemons
int rs_write_daemons(FILE *savef, struct delayed_action *d_list, int count)
{
    int i = 0;
    int func = 0;
        
    rs_write_int(savef, RSID_DAEMONS);
    rs_write_int(savef, count);
        
    for(i = 0; i < count; i++)
    {
        if (d_list[i].d_func == rollwand)
            func = 1;
        else if (d_list[i].d_func == doctor)
            func = 2;
        else if (d_list[i].d_func == stomach)
            func = 3;
        else if (d_list[i].d_func == runners)
            func = 4;
        else if (d_list[i].d_func == swander)
            func = 5;
        else if (d_list[i].d_func == nohaste)
            func = 6;
        else if (d_list[i].d_func == unconfuse)
            func = 7;
        else if (d_list[i].d_func == unsee)
            func = 8;
        else if (d_list[i].d_func == sight)
            func = 9;
        else if (d_list[i].d_func == noteth)
            func = 10;
        else if (d_list[i].d_func == sapem)
            func = 11;
        else if (d_list[i].d_func == notslow)
            func = 12;
        else if (d_list[i].d_func == notregen)
            func = 13;
        else if (d_list[i].d_func == notinvinc)
            func = 14;
        else if (d_list[i].d_func == rchg_str)
            func = 15;
        else if (d_list[i].d_func == wghtchk)
            func = 16;
        else if (d_list[i].d_func == status)
            func = 17;
        else
            func = 0;

        rs_write_int(savef, d_list[i].d_type);
        rs_write_int(savef, func);
        rs_write_int(savef, d_list[i].d_arg);
        rs_write_int(savef, d_list[i].d_time);
    }
    
    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 $0xabcd000e, %esi       # imm = 0xABCD000E
callq 0x15842
movq %r14, %rdi
movl %ebp, %esi
callq 0x15842
testl %ebp, %ebp
jle 0x1690c
movl %ebp, %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %r15
xorl %r12d, %r12d
leaq -0xd8c5(%rip), %r13     # 0x8eb9
movq 0x8(%rbx,%r12), %rax
cmpq %r13, %rax
je 0x16861
cmpq 0x1380d(%rip), %rax     # 0x29fa0
je 0x16868
cmpq 0x13778(%rip), %rax     # 0x29f18
je 0x1686f
cmpq 0x137bb(%rip), %rax     # 0x29f68
je 0x16876
cmpq 0x13836(%rip), %rax     # 0x29ff0
je 0x1687d
cmpq 0x13771(%rip), %rax     # 0x29f38
je 0x16884
cmpq 0x13754(%rip), %rax     # 0x29f28
je 0x1688b
cmpq 0x137ef(%rip), %rax     # 0x29fd0
je 0x16892
cmpq 0x137ba(%rip), %rax     # 0x29fa8
je 0x16899
cmpq 0x13745(%rip), %rax     # 0x29f40
je 0x168a0
cmpq 0x13748(%rip), %rax     # 0x29f50
je 0x168a7
cmpq 0x13733(%rip), %rax     # 0x29f48
je 0x168ae
cmpq 0x1373e(%rip), %rax     # 0x29f60
je 0x168b5
cmpq 0x136d9(%rip), %rax     # 0x29f08
je 0x168bc
cmpq 0x1374c(%rip), %rax     # 0x29f88
je 0x168c3
cmpq 0x1368f(%rip), %rax     # 0x29ed8
je 0x168ca
cmpq 0x1372e(%rip), %rax     # 0x29f80
movl $0x0, %ebp
movl $0x11, %eax
cmovel %eax, %ebp
jmp 0x168cf
movl $0x1, %ebp
jmp 0x168cf
movl $0x2, %ebp
jmp 0x168cf
movl $0x3, %ebp
jmp 0x168cf
movl $0x4, %ebp
jmp 0x168cf
movl $0x5, %ebp
jmp 0x168cf
movl $0x6, %ebp
jmp 0x168cf
movl $0x7, %ebp
jmp 0x168cf
movl $0x8, %ebp
jmp 0x168cf
movl $0x9, %ebp
jmp 0x168cf
movl $0xa, %ebp
jmp 0x168cf
movl $0xb, %ebp
jmp 0x168cf
movl $0xc, %ebp
jmp 0x168cf
movl $0xd, %ebp
jmp 0x168cf
movl $0xe, %ebp
jmp 0x168cf
movl $0xf, %ebp
jmp 0x168cf
movl $0x10, %ebp
movl (%rbx,%r12), %esi
movq %r14, %rdi
callq 0x15842
movq %r14, %rdi
movl %ebp, %esi
callq 0x15842
movl 0x10(%rbx,%r12), %esi
movq %r14, %rdi
callq 0x15842
movl 0x14(%rbx,%r12), %esi
movq %r14, %rdi
callq 0x15842
addq $0x18, %r12
cmpq %r12, %r15
jne 0x1677e
xorl %eax, %eax
cmpl $0x0, 0x1cb6f(%rip)     # 0x33484
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq