// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2PixelDatabase.cpp
// Function: gaps::R2PixelDatabase::ReadEntries(_IO_FILE*, int)
int R2PixelDatabase::
ReadEntries(FILE *fp, int swap_endian)
{
  // Seek to entries seek
  RNFileSeek(fp, entries_seek, RN_FILE_SEEK_SET);

  // Read entries
  int dummy = 0;
  for (unsigned int i = 0; i < entries_count; i++) {
    R2PixelDatabaseEntry entry;
    if (!RNReadChar(fp, entry.key, 128, swap_endian)) return 0;
    if (!RNReadUnsignedInt(fp, &entry.format, 1, swap_endian)) return 0;
    if (!RNReadUnsignedInt(fp, &entry.size, 1, swap_endian)) return 0;
    if (!RNReadUnsignedLongLong(fp, &entry.seek, 1, swap_endian)) return 0;
    if (!RNReadDouble(fp, &entry.offset, 1, swap_endian)) return 0;
    if (!RNReadDouble(fp, &entry.scale, 1, swap_endian)) return 0;
    if (!RNReadDouble(fp, &entry.exponent, 1, swap_endian)) return 0;
    for (int j = 0; j < 12; j++) RNReadInt(fp, &dummy, 1, swap_endian);
    map.Insert(entry.key, entry);
    keys.push_back(entry.key);
  }

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq 0x38(%rdi), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0xabc5a
movl $0x0, 0x4(%rsp)
cmpl $0x0, 0x34(%r15)
je 0x9c3ee
leaq 0xb8(%rsp), %r13
leaq 0x48(%r15), %rax
movq %rax, 0x30(%rsp)
leaq 0x4(%rsp), %rbp
xorl %r12d, %r12d
movq %r15, 0x8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
movq $0x0, 0x10(%r13)
movaps 0x41205(%rip), %xmm0    # 0xdd3e0
movups %xmm0, 0xd0(%rsp)
xorl %eax, %eax
movb %al, 0x38(%rsp)
movb %al, 0xb7(%rsp)
movq %r14, %rdi
leaq 0x38(%rsp), %rsi
movl $0x80, %edx
movl %ebx, %ecx
callq 0xabc70
testl %eax, %eax
je 0x9c3f5
movq %r14, %rdi
movq %r13, %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xabe71
testl %eax, %eax
je 0x9c3f5
movq %r14, %rdi
leaq 0xbc(%rsp), %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xabe71
testl %eax, %eax
je 0x9c3f5
movq %r14, %rdi
leaq 0xc0(%rsp), %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xac05b
testl %eax, %eax
je 0x9c3f5
movq %r14, %rdi
leaq 0xc8(%rsp), %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xabf55
testl %eax, %eax
je 0x9c3f5
movq %r14, %rdi
leaq 0xd0(%rsp), %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xabf55
testl %eax, %eax
je 0x9c3f5
movq %r14, %rdi
leaq 0xd8(%rsp), %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xabf55
testl %eax, %eax
je 0x9c3f5
movl %r12d, (%rsp)
movl $0xc, %r13d
movq %r14, %rdi
movq %rbp, %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xabde6
decl %r13d
jne 0x9c2cb
leaq 0x20(%rsp), %r13
movq %r13, 0x10(%rsp)
leaq 0x38(%rsp), %r12
movq %r12, %rdi
callq 0x13210
leaq (%rsp,%rax), %rdx
addq $0x38, %rdx
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x696b2
movl $0xa8, %edx
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x133f0
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rdi
movq %r13, %rsi
callq 0x9c9a2
movl $0xa8, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x133f0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x9c366
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x134f0
leaq 0xf0(%rsp), %rax
movq %rax, 0xe0(%rsp)
leaq 0x38(%rsp), %r12
movq %r12, %rdi
callq 0x13210
leaq (%rsp,%rax), %rdx
addq $0x38, %rdx
leaq 0xe0(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x696b2
movq 0x8(%rsp), %r15
movq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x9d416
movl (%rsp), %r12d
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x9c3d9
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x134f0
incl %r12d
cmpl 0x34(%r15), %r12d
leaq 0xb8(%rsp), %r13
jb 0x9c1c4
movl $0x1, %eax
jmp 0x9c3f7
xorl %eax, %eax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x9c44f
movq 0xf0(%rsp), %rsi
jmp 0x9c447
movq %rax, %rbx
jmp 0x9c44f
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x9c44f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x134f0
movq %rbx, %rdi
callq 0x138b0
nop