// File: 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
movq %rsp, %rbp
subq $0x460, %rsp            # imm = 0x460
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x30f0
movq %rax, %rdi
leaq 0xc8ce(%rip), %rsi      # 0x11040
callq 0x3300
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x4822
movb $0x1, -0x3d(%rbp)
movl $0x10, %edi
callq 0x3130
movq %rax, -0x450(%rbp)
movq -0x8(%rbp), %rdx
leaq 0xc89c(%rip), %rsi      # 0x11042
leaq -0x30(%rbp), %rdi
callq 0x5b70
jmp 0x47b1
movq -0x450(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3390
jmp 0x47c3
movq -0x450(%rbp), %rdi
movb $0x0, -0x3d(%rbp)
movq 0x1381b(%rip), %rsi     # 0x17ff0
movq 0x137ec(%rip), %rdx     # 0x17fc8
callq 0x33c0
jmp 0x498d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4809
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3180
testb $0x1, -0x3d(%rbp)
jne 0x4811
jmp 0x481d
movq -0x450(%rbp), %rdi
callq 0x31d0
jmp 0x4984
jmp 0x4824
leaq -0x430(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x3380
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x451(%rbp)
je 0x4882
movq -0x10(%rbp), %rdi
callq 0x3360
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x451(%rbp)
jne 0x4882
leaq -0x430(%rbp), %rdi
leaq 0xc953(%rip), %rsi      # 0x111c3
callq 0x3070
cmpq $0x0, %rax
setne %al
movb %al, -0x451(%rbp)
movb -0x451(%rbp), %al
testb $0x1, %al
jne 0x4891
jmp 0x491f
movq 0x13738(%rip), %rdi     # 0x17fd0
leaq 0xc929(%rip), %rsi      # 0x111c8
callq 0x3260
movq %rax, %rdi
leaq -0x430(%rbp), %rsi
callq 0x3260
movq -0x10(%rbp), %rdi
leaq 0xc89a(%rip), %rsi      # 0x11158
leaq -0x438(%rbp), %rdx
leaq -0x440(%rbp), %rcx
leaq -0x448(%rbp), %r8
movb $0x0, %al
callq 0x3420
cmpl $0x3, %eax
jne 0x491a
leaq 0x1398a(%rip), %rdi     # 0x18270
leaq -0x438(%rbp), %rsi
callq 0x5df0
leaq 0x1398f(%rip), %rdi     # 0x18288
leaq -0x440(%rbp), %rsi
callq 0x5df0
leaq 0x13994(%rip), %rdi     # 0x182a0
leaq -0x448(%rbp), %rsi
callq 0x5df0
jmp 0x48b3
jmp 0x4824
movq 0x136aa(%rip), %rdi     # 0x17fd0
leaq 0xc8a9(%rip), %rsi      # 0x111d6
callq 0x3260
movq %rax, -0x460(%rbp)
leaq 0x13930(%rip), %rdi     # 0x18270
callq 0x5e60
movq -0x460(%rbp), %rdi
movq %rax, %rsi
callq 0x3080
movq %rax, %rdi
leaq 0xc889(%rip), %rsi      # 0x111e7
callq 0x3260
movq %rax, %rdi
movq 0x1364b(%rip), %rsi     # 0x17fb8
callq 0x32a0
movq -0x10(%rbp), %rdi
callq 0x3270
addq $0x460, %rsp            # imm = 0x460
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x33e0
nopl (%rax)