// File: /workspace/github_cpp_makefile_star2_O3/ingowald[P]closestSurfacePointQueries/examples/benchmark.cpp
// Function: loadReference(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void loadReference(const std::string &fileName)
{
  FILE *file = fopen(fileName.c_str(),"r");
  if (!file) throw std::runtime_error("could not open "+fileName);

  for (int i=0;i<point_x.size();i++) {
    double x,y,z,s;
    if (fscanf(file,"%lf %lf %lf %lf\n",&x,&y,&z,&s) != 4)
      throw std::runtime_error("could not read reference result from "+fileName);
    reference_x.push_back(x);
    reference_y.push_back(y);
    reference_z.push_back(z);
    reference_dist.push_back(s);
  }
  std::cout << "loaded " << reference_dist.size() << " reference distances" << std::endl;
  fclose(file);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, (%rsp)
movq (%rdi), %rdi
leaq 0x6064(%rip), %rsi      # 0x9050
callq 0x2220
testq %rax, %rax
je 0x321a
movq %rax, %rbx
movq 0x91cc(%rip), %rax      # 0xc1d0
cmpq 0x91bd(%rip), %rax      # 0xc1c8
je 0x3144
leaq 0x20(%rsp), %r12
leaq 0x18(%rsp), %r13
leaq 0x10(%rsp), %rbp
leaq 0x8(%rsp), %r14
xorl %r15d, %r15d
movq %rbx, %rdi
leaq 0x6132(%rip), %rsi      # 0x9164
movq %r12, %rdx
movq %r13, %rcx
movq %rbp, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x2310
cmpl $0x4, %eax
jne 0x31ce
movq 0x92cb(%rip), %rsi      # 0xc320
cmpq 0x92cc(%rip), %rsi      # 0xc328
je 0x3075
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x92ad(%rip)      # 0xc320
jmp 0x3084
leaq 0x929c(%rip), %rdi      # 0xc318
movq %r12, %rdx
callq 0x469c
movq 0x92ad(%rip), %rsi      # 0xc338
cmpq 0x92ae(%rip), %rsi      # 0xc340
je 0x30ab
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x928f(%rip)      # 0xc338
jmp 0x30ba
leaq 0x927e(%rip), %rdi      # 0xc330
movq %r13, %rdx
callq 0x469c
movq 0x928f(%rip), %rsi      # 0xc350
cmpq 0x9290(%rip), %rsi      # 0xc358
je 0x30e1
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x9271(%rip)      # 0xc350
jmp 0x30f0
leaq 0x9260(%rip), %rdi      # 0xc348
movq %rbp, %rdx
callq 0x469c
movq 0x9211(%rip), %rsi      # 0xc308
cmpq 0x9212(%rip), %rsi      # 0xc310
je 0x3117
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x91f3(%rip)      # 0xc308
jmp 0x3126
leaq 0x91e2(%rip), %rdi      # 0xc300
movq %r14, %rdx
callq 0x469c
incq %r15
movq 0x90a0(%rip), %rax      # 0xc1d0
subq 0x9091(%rip), %rax      # 0xc1c8
sarq $0x3, %rax
cmpq %r15, %rax
ja 0x3028
movq 0x8e85(%rip), %r14      # 0xbfd0
leaq 0x5fb7(%rip), %rsi      # 0x9109
movl $0x7, %edx
movq %r14, %rdi
callq 0x2200
movq 0x91a2(%rip), %rsi      # 0xc308
subq 0x9193(%rip), %rsi      # 0xc300
sarq $0x3, %rsi
movq %r14, %rdi
callq 0x2120
movq %rax, %r14
leaq 0x6018(%rip), %rsi      # 0x919b
movl $0x14, %edx
movq %rax, %rdi
callq 0x2200
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x21c0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20e0
movq %rax, %r14
leaq 0x5f93(%rip), %rsi      # 0x9175
leaq 0x28(%rsp), %rdi
movq (%rsp), %rdx
callq 0x4336
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x22b0
xorl %ebp, %ebp
movq 0x8de7(%rip), %rsi      # 0xbff0
movq 0x8db8(%rip), %rdx      # 0xbfc8
movq %r14, %rdi
callq 0x22e0
jmp 0x3264
movl $0x10, %edi
callq 0x20e0
movq %rax, %r14
leaq 0x5e24(%rip), %rsi      # 0x9052
leaq 0x28(%rsp), %rdi
movq (%rsp), %rdx
callq 0x4336
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x22b0
xorl %ebp, %ebp
movq 0x8d9b(%rip), %rsi      # 0xbff0
movq 0x8d6c(%rip), %rdx      # 0xbfc8
movq %r14, %rdi
callq 0x22e0
jmp 0x3268
jmp 0x328d
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3286
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21e0
testb %bpl, %bpl
jne 0x3290
jmp 0x3298
movq %rax, %rbx
movq %r14, %rdi
callq 0x2150
movq %rbx, %rdi
callq 0x22f0