// File: /workspace/github_cpp_makefile_star2_O2/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 $0x198, %rsp            # imm = 0x198
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq 0x38(%rdi), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x9c462
leaq 0x14(%rsp), %rax
andl $0x0, (%rax)
leaq 0x48(%r15), %rax
movq %rax, 0x18(%rsp)
pushq $0x1
popq %r13
leaq 0xd0(%rsp), %r12
xorl %ecx, %ecx
movq %r15, 0x20(%rsp)
movl 0x34(%r15), %r15d
cmpl %r15d, %ecx
jae 0x8e23d
movl %ecx, 0x10(%rsp)
leaq 0xa8(%rsp), %rax
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movaps 0x3a33c(%rip), %xmm0    # 0xc83e0
movups %xmm0, 0xc0(%rsp)
xorl %eax, %eax
movb %al, 0x28(%rsp)
movb %al, 0xa7(%rsp)
movq %r14, %rdi
leaq 0x28(%rsp), %rsi
movl $0x80, %edx
movl %ebx, %ecx
callq 0x9c478
testl %eax, %eax
je 0x8e239
movq %r14, %rdi
leaq 0xa8(%rsp), %rsi
movl %r13d, %edx
movl %ebx, %ecx
callq 0x9c61d
testl %eax, %eax
je 0x8e239
movq %r14, %rdi
leaq 0xac(%rsp), %rsi
movl %r13d, %edx
movl %ebx, %ecx
callq 0x9c61d
testl %eax, %eax
je 0x8e239
movq %r14, %rdi
leaq 0xb0(%rsp), %rsi
movl %r13d, %edx
movl %ebx, %ecx
callq 0x9c79a
testl %eax, %eax
je 0x8e239
movq %r14, %rdi
leaq 0xb8(%rsp), %rsi
movl %r13d, %edx
movl %ebx, %ecx
callq 0x9c6cd
testl %eax, %eax
je 0x8e239
movq %r14, %rdi
leaq 0xc0(%rsp), %rsi
movl %r13d, %edx
movl %ebx, %ecx
callq 0x9c6cd
testl %eax, %eax
je 0x8e239
movq %r14, %rdi
leaq 0xc8(%rsp), %rsi
movl %r13d, %edx
movl %ebx, %ecx
callq 0x9c6cd
testl %eax, %eax
je 0x8e239
pushq $0xc
popq %r15
subl $0x1, %r15d
jb 0x8e1a1
movq %r14, %rdi
leaq 0x14(%rsp), %rsi
movl %r13d, %edx
movl %ebx, %ecx
callq 0x9c5ab
jmp 0x8e187
movq %r12, %rdi
leaq 0x28(%rsp), %r15
movq %r15, %rsi
leaq 0xf(%rsp), %rdx
callq 0x5edd2
movl $0xa8, %edx
leaq 0xf0(%rsp), %rdi
movq %r15, %rsi
callq 0x13400
movq 0x20(%rsp), %r15
movq 0x40(%r15), %rdi
movq %r12, %rsi
callq 0x8e764
movl $0xa8, %edx
movq %rax, %rdi
leaq 0xf0(%rsp), %rsi
callq 0x13400
movq %r12, %rbp
movq %r12, %rdi
leaq 0xf0(%rsp), %r12
callq 0x13230
movq %r12, %rdi
leaq 0x28(%rsp), %rsi
leaq 0xf(%rsp), %rdx
callq 0x5edd2
movq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x8eece
movq %r12, %rdi
callq 0x13230
movl 0x10(%rsp), %ecx
incl %ecx
movq %rbp, %r12
jmp 0x8e079
movl 0x10(%rsp), %ecx
xorl %eax, %eax
cmpl %r15d, %ecx
setae %al
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
jmp 0x8e271
jmp 0x8e278
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x13230
jmp 0x8e27b
movq %rax, %rbx
movq %rbx, %rdi
callq 0x138f0
nop