// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadBinaryFile(char const*)
int R3PointSet::
ReadBinaryFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "rb");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Read points
  float buf[16];
  while (fread(buf, sizeof(float), 16, fp) == (unsigned int) 16) {
    R3Point position(buf[0], buf[1], buf[2]);
    R3Vector normal(buf[3], buf[4], buf[5]);
    RNRgb color(buf[6], buf[7], buf[8]);
    double timestamp = buf[9];
    int category_identifier = buf[10] + 0.5;
    int instance_identifier = buf[11] + 0.5;
    double value = buf[12];
    normal.Normalize();
    int index = InsertPoint(position);
    SetPointNormal(index, normal);
    SetPointColor(index, color);
    SetPointTimestamp(index, timestamp);
    SetPointCategoryIdentifier(index, category_identifier);
    SetPointInstanceIdentifier(index, instance_identifier);
    SetPointValue(index, value);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x73556(%rip), %rsi     # 0xf365a
movq %r15, %rdi
callq 0x22a70
testq %rax, %rax
je 0x802b7
movq %rax, %r14
leaq 0x20(%rsp), %rdi
movl $0x4, %esi
movl $0x10, %edx
movq %rax, %rcx
callq 0x22e10
cmpq $0x10, %rax
jne 0x802a8
movq %r14, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd 0x20(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x24(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x28(%rsp), %xmm2
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0x7cff6
xorps %xmm0, %xmm0
cvtss2sd 0x2c(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x30(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x34(%rsp), %xmm2
leaq 0x78(%rsp), %r12
movq %r12, %rdi
callq 0x7da8a
xorps %xmm0, %xmm0
cvtss2sd 0x38(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x3c(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x40(%rsp), %xmm2
leaq 0x60(%rsp), %rdi
callq 0x9ea2c
xorps %xmm0, %xmm0
cvtss2sd 0x44(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
cvtss2sd 0x48(%rsp), %xmm0
movsd 0x71e32(%rip), %xmm1    # 0xf2008
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %r15d
xorps %xmm0, %xmm0
cvtss2sd 0x4c(%rsp), %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ebp
xorps %xmm0, %xmm0
cvtss2sd 0x50(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq %r12, %rdi
callq 0x7dda0
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %r13d # imm = 0xAAAAAAAB
movq %rbx, %rdi
movl %r13d, %esi
movq %r14, %rdx
movq 0x8(%rsp), %r14
callq 0x7ee86
movq %rbx, %rdi
movl %r13d, %esi
movq %r12, %rdx
callq 0x7ef06
movq %rbx, %rdi
movl %r13d, %esi
leaq 0x60(%rsp), %rdx
callq 0x7f082
movq %rbx, %rdi
movl %r13d, %esi
movsd 0x10(%rsp), %xmm0
callq 0x7f0fc
movq %rbx, %rdi
movl %r13d, %esi
movl %r15d, %edx
callq 0x7f1a6
movq %rbx, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0x7f240
movq %rbx, %rdi
movl %r13d, %esi
movsd 0x18(%rsp), %xmm0
callq 0x7f380
movl $0x4, %esi
movl $0x10, %edx
leaq 0x20(%rsp), %rdi
movq %r14, %rcx
callq 0x22e10
cmpq $0x10, %rax
je 0x8013e
movq %r14, %rdi
callq 0x22880
movl $0x1, %ebx
jmp 0x802ca
leaq 0x75114(%rip), %rdi     # 0xf53d2
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0xa172a
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq