// File: /workspace/github_cpp_makefile_star2_O1/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 0x707f(%rip), %rsi      # 0xa050
callq 0x2220
testq %rax, %rax
je 0x31ff
movq %rax, %rbx
movq 0xa1ef(%rip), %rax      # 0xd1d8
cmpq 0xa1e0(%rip), %rax      # 0xd1d0
je 0x3129
leaq 0x20(%rsp), %r12
leaq 0x18(%rsp), %r13
leaq 0x10(%rsp), %rbp
leaq 0x8(%rsp), %r14
xorl %r15d, %r15d
movq %rbx, %rdi
leaq 0x714d(%rip), %rsi      # 0xa164
movq %r12, %rdx
movq %r13, %rcx
movq %rbp, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x2320
cmpl $0x4, %eax
jne 0x31b3
movq 0xa2ee(%rip), %rsi      # 0xd328
cmpq 0xa2ef(%rip), %rsi      # 0xd330
je 0x305a
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0xa2d0(%rip)      # 0xd328
jmp 0x3069
leaq 0xa2bf(%rip), %rdi      # 0xd320
movq %r12, %rdx
callq 0x469c
movq 0xa2d0(%rip), %rsi      # 0xd340
cmpq 0xa2d1(%rip), %rsi      # 0xd348
je 0x3090
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0xa2b2(%rip)      # 0xd340
jmp 0x309f
leaq 0xa2a1(%rip), %rdi      # 0xd338
movq %r13, %rdx
callq 0x469c
movq 0xa2b2(%rip), %rsi      # 0xd358
cmpq 0xa2b3(%rip), %rsi      # 0xd360
je 0x30c6
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0xa294(%rip)      # 0xd358
jmp 0x30d5
leaq 0xa283(%rip), %rdi      # 0xd350
movq %rbp, %rdx
callq 0x469c
movq 0xa234(%rip), %rsi      # 0xd310
cmpq 0xa235(%rip), %rsi      # 0xd318
je 0x30fc
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0xa216(%rip)      # 0xd310
jmp 0x310b
leaq 0xa205(%rip), %rdi      # 0xd308
movq %r14, %rdx
callq 0x469c
incq %r15
movq 0xa0c3(%rip), %rax      # 0xd1d8
subq 0xa0b4(%rip), %rax      # 0xd1d0
sarq $0x3, %rax
cmpq %r15, %rax
ja 0x300d
movq 0x9ea0(%rip), %r14      # 0xcfd0
leaq 0x6fd2(%rip), %rsi      # 0xa109
movl $0x7, %edx
movq %r14, %rdi
callq 0x2200
movq 0xa1c5(%rip), %rsi      # 0xd310
subq 0xa1b6(%rip), %rsi      # 0xd308
sarq $0x3, %rsi
movq %r14, %rdi
callq 0x2120
movq %rax, %r14
leaq 0x7033(%rip), %rsi      # 0xa19b
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 0x6fae(%rip), %rsi      # 0xa175
leaq 0x28(%rsp), %rdi
movq (%rsp), %rdx
callq 0x433c
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x22b0
xorl %ebp, %ebp
movq 0x9e02(%rip), %rsi      # 0xcff0
movq 0x9dd3(%rip), %rdx      # 0xcfc8
movq %r14, %rdi
callq 0x22e0
jmp 0x3249
movl $0x10, %edi
callq 0x20e0
movq %rax, %r14
leaq 0x6e3f(%rip), %rsi      # 0xa052
leaq 0x28(%rsp), %rdi
movq (%rsp), %rdx
callq 0x433c
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x22b0
xorl %ebp, %ebp
movq 0x9db6(%rip), %rsi      # 0xcff0
movq 0x9d87(%rip), %rdx      # 0xcfc8
movq %r14, %rdi
callq 0x22e0
jmp 0x324d
jmp 0x326d
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3273
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21e0
jmp 0x3273
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x3280
movq %r14, %rdi
callq 0x2150
movq %rbx, %rdi
callq 0x22f0