// File: /workspace/github_cpp_makefile_star2_O1/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 0xad14e
movl $0x0, 0xc(%rsp)
movq %r15, (%rsp)
cmpl $0x0, 0x34(%r15)
sete %bpl
je 0x9d6b0
xorps %xmm0, %xmm0
leaq 0x38(%rsp), %rsi
movups %xmm0, 0x80(%rsi)
movq $0x0, 0x90(%rsi)
movaps 0x40f85(%rip), %xmm0    # 0xde3e0
movups %xmm0, 0x98(%rsi)
xorl %eax, %eax
movb %al, (%rsi)
movb %al, 0x7f(%rsi)
movq %r14, %rdi
movl $0x80, %edx
movl %ebx, %ecx
callq 0xad164
testl %eax, %eax
je 0x9d6b0
movq (%rsp), %rax
addq $0x48, %rax
movq %rax, 0x30(%rsp)
leaq 0xc(%rsp), %r13
xorl %r15d, %r15d
movq %r14, %rdi
leaq 0xb8(%rsp), %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xad365
testl %eax, %eax
je 0x9d6b0
movq %r14, %rdi
leaq 0xbc(%rsp), %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xad365
testl %eax, %eax
je 0x9d6b0
movq %r14, %rdi
leaq 0xc0(%rsp), %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xad54f
testl %eax, %eax
je 0x9d6b0
movq %r14, %rdi
leaq 0xc8(%rsp), %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xad449
testl %eax, %eax
je 0x9d6b0
movq %r14, %rdi
leaq 0xd0(%rsp), %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xad449
testl %eax, %eax
je 0x9d6b0
movq %r14, %rdi
leaq 0xd8(%rsp), %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xad449
testl %eax, %eax
je 0x9d6b0
movl %r15d, 0x8(%rsp)
movl $0xc, %ebp
movq %r14, %rdi
movq %r13, %rsi
movl $0x1, %edx
movl %ebx, %ecx
callq 0xad2da
decl %ebp
jne 0x9d559
leaq 0x20(%rsp), %rbp
movq %rbp, 0x10(%rsp)
leaq 0x38(%rsp), %r15
movq %r15, %rdi
callq 0x13210
leaq (%rsp,%rax), %rdx
addq $0x38, %rdx
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x6a2aa
movl $0xa8, %edx
leaq 0xe0(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x133f0
movq (%rsp), %rax
movq 0x40(%rax), %rdi
movq %rbp, %rsi
callq 0x9dc6a
movl $0xa8, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x133f0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x9d5f2
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x134f0
leaq 0xf0(%rsp), %rbp
movq %rbp, 0xe0(%rsp)
leaq 0x38(%rsp), %r15
movq %r15, %rdi
callq 0x13210
leaq (%rsp,%rax), %rdx
addq $0x38, %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x6a2aa
movq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x9e714
movl 0x8(%rsp), %r15d
movq 0xe0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x9d651
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x134f0
incl %r15d
movq (%rsp), %rax
cmpl 0x34(%rax), %r15d
setae %bpl
jae 0x9d6b0
xorps %xmm0, %xmm0
leaq 0xb8(%rsp), %rax
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movaps 0x40d61(%rip), %xmm0    # 0xde3e0
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 0xad164
testl %eax, %eax
jne 0x9d495
movzbl %bpl, %eax
andl $0x1, %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
cmpq %rbp, %rdi
je 0x9d707
movq 0xf0(%rsp), %rsi
jmp 0x9d6ff
movq %rax, %rbx
jmp 0x9d707
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x9d707
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x134f0
movq %rbx, %rdi
callq 0x138b0
nop