// File: /workspace/github_cpp_makefile_star2_O1/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 0x6b9a(%rip), %rsi      # 0xa050
callq 0x2220
testq %rax, %rax
je 0x36d0
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %rax, %rdx
callq 0x2290
testq %rax, %rax
je 0x3643
leaq 0x18(%rsp), %r13
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r12
leaq 0x9cd8(%rip), %r15      # 0xd1d0
movq %rbx, %rdi
callq 0x2270
testl %eax, %eax
jne 0x3643
leaq 0x20(%rsp), %rdi
leaq 0x6cbf(%rip), %rsi      # 0xa1d3
callq 0x2070
testq %rax, %rax
je 0x3643
movl $0xd, %edx
movq 0x9aa2(%rip), %rdi      # 0xcfd0
leaq 0x6ca3(%rip), %rsi      # 0xa1d8
callq 0x2200
movq %r15, %rbp
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x20d0
movq 0x9a7f(%rip), %rdi      # 0xcfd0
movq %r15, %rsi
movq %rbp, %r15
leaq 0x6c0a(%rip), %rbp      # 0xa168
movq %rax, %rdx
callq 0x2200
jmp 0x3609
movq 0x9c66(%rip), %rsi      # 0xd1d8
cmpq 0x9c67(%rip), %rsi      # 0xd1e0
je 0x3592
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x9c48(%rip)      # 0xd1d8
jmp 0x359d
movq %r15, %rdi
movq %r13, %rdx
callq 0x469c
movq 0x9c4c(%rip), %rsi      # 0xd1f0
cmpq 0x9c4d(%rip), %rsi      # 0xd1f8
je 0x35c4
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x9c2e(%rip)      # 0xd1f0
jmp 0x35d3
leaq 0x9c1d(%rip), %rdi      # 0xd1e8
movq %r14, %rdx
callq 0x469c
movq 0x9c2e(%rip), %rsi      # 0xd208
cmpq 0x9c2f(%rip), %rsi      # 0xd210
je 0x35fa
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x9c10(%rip)      # 0xd208
jmp 0x3609
leaq 0x9bff(%rip), %rdi      # 0xd200
movq %r12, %rdx
callq 0x469c
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r14, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x2320
cmpl $0x3, %eax
je 0x356b
leaq 0x20(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %rbx, %rdx
callq 0x2290
testq %rax, %rax
jne 0x34f8
movq 0x9986(%rip), %r14      # 0xcfd0
leaq 0x6b95(%rip), %rsi      # 0xa1e6
movl $0x10, %edx
movq %r14, %rdi
callq 0x2200
movq 0x9b73(%rip), %rsi      # 0xd1d8
subq 0x9b64(%rip), %rsi      # 0xd1d0
sarq $0x3, %rsi
movq %r14, %rdi
callq 0x2120
movq %rax, %r14
leaq 0x6b75(%rip), %rsi      # 0xa1f7
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 0x696e(%rip), %rsi      # 0xa052
leaq 0x20(%rsp), %rdi
movq %r14, %rdx
callq 0x433c
movb $0x1, %bpl
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x22b0
xorl %ebp, %ebp
movq 0x98e6(%rip), %rsi      # 0xcff0
movq 0x98b7(%rip), %rdx      # 0xcfc8
movq %rbx, %rdi
callq 0x22e0
movq %rax, %r14
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x373f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21e0
jmp 0x373f
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x374c
movq %rbx, %rdi
callq 0x2150
movq %r14, %rdi
callq 0x22f0