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

  char line[1000];

  while (fgets(line,1000,file) && !feof(file) && strstr(line,"Zone")) {
    std::cout << "loading zone " << line;
    double x,y,z;
    
    while (fscanf(file,"%lf %lf %lf\n",&x,&y,&z)==3) {
      point_x.push_back(x);
      point_y.push_back(y);
      point_z.push_back(z);
    }
  }
  std::cout << "loaded total of " << point_x.size() << " points across all zones" << std::endl;
  fclose(file);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %r14
movq (%rdi), %rdi
leaq 0x5b85(%rip), %rsi      # 0x9050
callq 0x2220
testq %rax, %rax
je 0x36e5
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %rax, %rdx
callq 0x2290
testq %rax, %rax
je 0x3658
leaq 0x18(%rsp), %r13
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r12
leaq 0x8cbb(%rip), %r15      # 0xc1c8
movq %rbx, %rdi
callq 0x2270
testl %eax, %eax
jne 0x3658
leaq 0x20(%rsp), %rdi
leaq 0x5caa(%rip), %rsi      # 0x91d3
callq 0x2070
testq %rax, %rax
je 0x3658
movl $0xd, %edx
movq 0x8a8d(%rip), %rdi      # 0xbfd0
leaq 0x5c8e(%rip), %rsi      # 0x91d8
callq 0x2200
movq %r15, %rbp
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x20d0
movq 0x8a6a(%rip), %rdi      # 0xbfd0
movq %r15, %rsi
movq %rbp, %r15
leaq 0x5bf5(%rip), %rbp      # 0x9168
movq %rax, %rdx
callq 0x2200
jmp 0x361e
movq 0x8c49(%rip), %rsi      # 0xc1d0
cmpq 0x8c4a(%rip), %rsi      # 0xc1d8
je 0x35a7
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8c2b(%rip)      # 0xc1d0
jmp 0x35b2
movq %r15, %rdi
movq %r13, %rdx
callq 0x469c
movq 0x8c2f(%rip), %rsi      # 0xc1e8
cmpq 0x8c30(%rip), %rsi      # 0xc1f0
je 0x35d9
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8c11(%rip)      # 0xc1e8
jmp 0x35e8
leaq 0x8c00(%rip), %rdi      # 0xc1e0
movq %r14, %rdx
callq 0x469c
movq 0x8c11(%rip), %rsi      # 0xc200
cmpq 0x8c12(%rip), %rsi      # 0xc208
je 0x360f
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8bf3(%rip)      # 0xc200
jmp 0x361e
leaq 0x8be2(%rip), %rdi      # 0xc1f8
movq %r12, %rdx
callq 0x469c
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r14, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x2310
cmpl $0x3, %eax
je 0x3580
leaq 0x20(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %rbx, %rdx
callq 0x2290
testq %rax, %rax
jne 0x350d
movq 0x8971(%rip), %r14      # 0xbfd0
leaq 0x5b80(%rip), %rsi      # 0x91e6
movl $0x10, %edx
movq %r14, %rdi
callq 0x2200
movq 0x8b56(%rip), %rsi      # 0xc1d0
subq 0x8b47(%rip), %rsi      # 0xc1c8
sarq $0x3, %rsi
movq %r14, %rdi
callq 0x2120
movq %rax, %r14
leaq 0x5b60(%rip), %rsi      # 0x91f7
movl $0x18, %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 $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20e0
movq %rax, %rbx
leaq 0x5959(%rip), %rsi      # 0x9052
leaq 0x20(%rsp), %rdi
movq %r14, %rdx
callq 0x4336
movb $0x1, %bpl
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x22b0
xorl %ebp, %ebp
movq 0x88d1(%rip), %rsi      # 0xbff0
movq 0x88a2(%rip), %rdx      # 0xbfc8
movq %rbx, %rdi
callq 0x22e0
movq %rax, %r14
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x374c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21e0
testb %bpl, %bpl
jne 0x3756
jmp 0x375e
movq %rax, %r14
movq %rbx, %rdi
callq 0x2150
movq %r14, %rdi
callq 0x22f0