// File: /workspace/github_c_makefile_star2_O3/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 0x15bb9
testl %eax, %eax
je 0x16d0f
movl 0xc(%rsp), %esi
cmpl %r14d, %esi
jle 0x16b7a
leaq 0xc340(%rip), %rdi      # 0x22e93
movl %r14d, %edx
xorl %eax, %eax
callq 0x61c0
leaq 0xc73f(%rip), %rdi      # 0x232a3
xorl %eax, %eax
callq 0x61c0
movl $0x1, 0x1c913(%rip)     # 0x33488
jmp 0x16d0f
testl %esi, %esi
jle 0x16d0f
imulq $0x68, %rsi, %rax
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
leaq 0x8(%rsp), %r14
leaq 0x16d16(%rip), %r12     # 0x2d8b0
leaq (%rbx,%r13), %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0x4, %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0x8, %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0xc, %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0x10, %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0x14, %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0x18, %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0x1c, %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0x20, %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0x24, %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0x28, %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0x2c, %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0x30, %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %r15
addq $0x34, %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x15bb9
movl %ebp, %edi
movq %r14, %rsi
callq 0x15bb9
movslq 0x8(%rsp), %rax
imulq $0x68, %rax, %rax
addq %r12, %rax
movq %rax, 0x4(%r15)
movl %ebp, %edi
movq %r14, %rsi
callq 0x15bb9
movslq 0x8(%rsp), %rax
imulq $0x68, %rax, %rax
addq %r12, %rax
movq %rax, 0xc(%r15)
movl %ebp, %edi
movq %r14, %rsi
callq 0x15bb9
movslq 0x8(%rsp), %rax
imulq $0x68, %rax, %rax
addq %r12, %rax
movq %rax, 0x14(%r15)
movl %ebp, %edi
movq %r14, %rsi
callq 0x15bb9
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 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0x5c, %rsi
movl %ebp, %edi
callq 0x15bb9
leaq (%rbx,%r13), %rsi
addq $0x60, %rsi
movl %ebp, %edi
callq 0x15bb9
addq $0x68, %r13
cmpq %r13, 0x10(%rsp)
jne 0x16b9a
movl 0x1c76b(%rip), %ecx     # 0x33480
xorl %eax, %eax
orl 0x1c76b(%rip), %ecx     # 0x33488
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq