// File: /workspace/github_c_makefile_star2_O1/ajpaulson[P]srogue11/state.c
// Function: rs_read_rooms
int rs_read_rooms(int inf, struct room *r, int count)
{
    int value = 0, n = 0;

    if (rs_read_int(inf,&value) != 0)
    {
        if (value > count)
        {
            printf("Incorrect number of rooms in block. %d > %d.",
                value,count);
            printf("Sorry, invalid save game format");
            format_error = TRUE;
        }
        else
            for(n = 0; n < value; n++)
            {
                rs_read_coord(inf,&r[n].r_pos);
                rs_read_coord(inf,&r[n].r_max);
                rs_read_coord(inf,&r[n].r_gold);
                rs_read_coord(inf,&r[n].r_exit[0]);
                rs_read_coord(inf,&r[n].r_exit[1]);
                rs_read_coord(inf,&r[n].r_exit[2]);
                rs_read_coord(inf,&r[n].r_exit[3]);
                rs_read_room_reference(inf,&r[n].r_ptr[0]);
                rs_read_room_reference(inf,&r[n].r_ptr[1]);
                rs_read_room_reference(inf,&r[n].r_ptr[2]);
                rs_read_room_reference(inf,&r[n].r_ptr[3]);
                rs_read_int(inf,&r[n].r_goldval);
                rs_read_int(inf,&r[n].r_flags);
                rs_read_int(inf,&r[n].r_nexits);
            }
    }

    return(READSTAT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %ebp
leaq 0xc(%rsp), %rsi
movl $0x0, (%rsi)
callq 0x15d65
testl %eax, %eax
je 0x16edd
movl 0xc(%rsp), %esi
cmpl %r14d, %esi
jle 0x16d48
leaq 0xc0fa(%rip), %rdi      # 0x22e1b
movl %r14d, %edx
xorl %eax, %eax
callq 0x61c0
leaq 0xc4f9(%rip), %rdi      # 0x2322b
xorl %eax, %eax
callq 0x61c0
movl $0x1, 0x1c745(%rip)     # 0x33488
jmp 0x16edd
testl %esi, %esi
jle 0x16edd
imulq $0x68, %rsi, %rax
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
leaq 0x8(%rsp), %r14
leaq 0x16b48(%rip), %r12     # 0x2d8b0
leaq (%rbx,%r13), %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0x4, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0x8, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0xc, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0x10, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0x14, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0x18, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0x1c, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0x20, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0x24, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0x28, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0x2c, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0x30, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %r15
addq $0x34, %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x15d65
movl %ebp, %edi
movq %r14, %rsi
callq 0x15d65
movslq 0x8(%rsp), %rax
imulq $0x68, %rax, %rax
addq %r12, %rax
movq %rax, 0x4(%r15)
movl %ebp, %edi
movq %r14, %rsi
callq 0x15d65
movslq 0x8(%rsp), %rax
imulq $0x68, %rax, %rax
addq %r12, %rax
movq %rax, 0xc(%r15)
movl %ebp, %edi
movq %r14, %rsi
callq 0x15d65
movslq 0x8(%rsp), %rax
imulq $0x68, %rax, %rax
addq %r12, %rax
movq %rax, 0x14(%r15)
movl %ebp, %edi
movq %r14, %rsi
callq 0x15d65
movslq 0x8(%rsp), %rax
imulq $0x68, %rax, %rax
addq %r12, %rax
movq %rax, 0x1c(%r15)
leaq (%rbx,%r13), %rsi
addq $0x58, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0x5c, %rsi
movl %ebp, %edi
callq 0x15d65
leaq (%rbx,%r13), %rsi
addq $0x60, %rsi
movl %ebp, %edi
callq 0x15d65
addq $0x68, %r13
cmpq %r13, 0x10(%rsp)
jne 0x16d68
movl 0x1c59d(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1c59d(%rip), %ecx     # 0x33488
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq