// File: /workspace/github_cpp_makefile_star2_O1/ingowald[P]closestSurfacePointQueries/examples/benchmark.cpp
// Function: main
int main(int ac, char **av)
{
  if (ac != 2)
    throw std::runtime_error("usage: ./distanceTest <directory_with_dumps>");
  const std::string dir = av[1];

  loadTriangles(dir+"/triang_input.txt");
  loadPoints(dir+"/point_input.txt");

  bool couldLoadReference = true;
  try {
//     loadReference(dir+"/dennis.dist.txt");
    loadReference(dir+"/tim.xyzs.txt");
    loadDennis(dir+"/dennis.dist.txt");
  } catch (std::runtime_error e) {
    couldLoadReference = false;
    printf("********************** could NOT load reference results **********************\n");
  }

  
  auto begin = std::chrono::system_clock::now();
  std::cout << "creating embree query object" << std::endl;
  distance_query_scene scene
    = rtdqNewTriangleMeshdi(vertex_x.data(),vertex_y.data(),vertex_z.data(),1,
                            index_x.data(),index_y.data(),index_z.data(),1,
                            index_x.size());
  auto done_build = std::chrono::system_clock::now();

  result_dist.resize(point_x.size());
  result_x.resize(point_x.size());
  result_y.resize(point_x.size());
  result_z.resize(point_x.size());

  std::cout << "calling query (scalar)" << std::endl;
  rtdqComputeClosestPointsdi(scene,
                             // closest point:
                             result_x.data(),
                             result_y.data(),
                             result_z.data(),
                             1,
                             // distance:
                             result_dist.data(),1,
                             // no prim IDs
                             NULL,0,
                             // input: the query points
                             point_x.data(),point_y.data(),point_z.data(),1,
                             // num points:
                             point_x.size());
  auto done_all = std::chrono::system_clock::now();
  
  size_t numPoints = point_x.size();
  size_t numTriangles = index_x.size();

  std::chrono::duration<double> buildTime = done_build - begin;
  std::chrono::duration<double> queryTime = done_all   - done_build;
  std::cout << "time to build tree " << (1000.f*buildTime.count()) << "ms" << std::endl;
  std::cout << "time to query " << numPoints << " points: " << queryTime.count() << "s" << std::endl;
  std::cout << "(this is " << (1000000.f * queryTime.count()/numPoints) << " micro seconds/query)" << std::endl;

  if (couldLoadReference) {
  double most_further_tim_mag = 0.f;
  double most_further_tim_myDist;
  double most_further_tim_hisDist;
  double most_further_tim_input[3];
  double most_further_tim_result[3];

  double most_closer_tim_mag = 0.f;
  double most_closer_tim_myDist;
  double most_closer_tim_hisDist;
  double most_closer_tim_input[3];
  double most_closer_tim_result[3];


  double most_further_dennis_mag = 0.f;
  double most_further_dennis_myDist;
  double most_further_dennis_hisDist;
  double most_further_dennis_input[3];
  double most_further_dennis_result[3];

  double most_closer_dennis_mag = 0.f;
  double most_closer_dennis_myDist;
  double most_closer_dennis_hisDist;
  double most_closer_dennis_input[3];
  double most_closer_dennis_result[3];


  std::cout << "echcking ..." << std::endl;
  for (int i=0;i<point_x.size();i++) {

    printf("results for %8i: mine %18.16f    tim %18.16f    dennis %18.16f\n",i,result_dist[i],reference_dist[i],dennis_dist[i]);
    

    float closer_dennis = dennis_dist[i] - result_dist[i];
    if (closer_dennis > most_closer_dennis_mag) {
      most_closer_dennis_mag = closer_dennis;
      most_closer_dennis_input[0] = point_x[i];
      most_closer_dennis_input[1] = point_y[i];
      most_closer_dennis_input[2] = point_z[i];
      most_closer_dennis_result[0] = result_x[i];
      most_closer_dennis_result[1] = result_y[i];
      most_closer_dennis_result[2] = result_z[i];
      most_closer_dennis_myDist    = result_dist[i];
      most_closer_dennis_hisDist    = dennis_dist[i];
    }

    float further_dennis = result_dist[i] - dennis_dist[i];
    if (further_dennis > most_further_dennis_mag) {
      most_further_dennis_mag = further_dennis;
      most_further_dennis_input[0] = point_x[i];
      most_further_dennis_input[1] = point_y[i];
      most_further_dennis_input[2] = point_z[i];
      most_further_dennis_result[0] = result_x[i];
      most_further_dennis_result[1] = result_y[i];
      most_further_dennis_result[2] = result_z[i];
      most_further_dennis_myDist    = result_dist[i];
      most_further_dennis_hisDist    = dennis_dist[i];
    }

    float closer_tim = reference_dist[i] - result_dist[i];
    if (closer_tim > most_closer_tim_mag) {
      most_closer_tim_mag = closer_tim;
      most_closer_tim_input[0] = point_x[i];
      most_closer_tim_input[1] = point_y[i];
      most_closer_tim_input[2] = point_z[i];
      most_closer_tim_result[0] = result_x[i];
      most_closer_tim_result[1] = result_y[i];
      most_closer_tim_result[2] = result_z[i];
      most_closer_tim_myDist    = result_dist[i];
      most_closer_tim_hisDist    = reference_dist[i];
    }

    float further_tim = result_dist[i] - reference_dist[i];
    if (further_tim > most_further_tim_mag) {
      most_further_tim_mag = further_tim;
      most_further_tim_input[0] = point_x[i];
      most_further_tim_input[1] = point_y[i];
      most_further_tim_input[2] = point_z[i];
      most_further_tim_result[0] = result_x[i];
      most_further_tim_result[1] = result_y[i];
      most_further_tim_result[2] = result_z[i];
      most_further_tim_myDist    = result_dist[i];
      most_further_tim_hisDist    = reference_dist[i];
    }


  }
  printf("biggest dist (to tim) where we're closer: input %g %g %g ours %g %g %g dist %g his-dist %g\n",
         most_closer_tim_input[0],
         most_closer_tim_input[1],
         most_closer_tim_input[2],
         most_closer_tim_result[0],
         most_closer_tim_result[1],
         most_closer_tim_result[2],
         most_closer_tim_myDist,
         most_closer_tim_hisDist);
  printf("biggest dist (to tim) where we're further: input %g %g %g ours %g %g %g dist %g his-dist %g\n",
         most_further_tim_input[0],
         most_further_tim_input[1],
         most_further_tim_input[2],
         most_further_tim_result[0],
         most_further_tim_result[1],
         most_further_tim_result[2],
         most_further_tim_myDist,
         most_further_tim_hisDist);
         
  printf("biggest dist (to dennis) where we're closer: input %g %g %g ours %g %g %g dist %g his-dist %g\n",
         most_closer_dennis_input[0],
         most_closer_dennis_input[1],
         most_closer_dennis_input[2],
         most_closer_dennis_result[0],
         most_closer_dennis_result[1],
         most_closer_dennis_result[2],
         most_closer_dennis_myDist,
         most_closer_dennis_hisDist);
  printf("biggest dist (to dennis) where we're further: input %g %g %g ours %g %g %g dist %g his-dist %g\n",
         most_further_dennis_input[0],
         most_further_dennis_input[1],
         most_further_dennis_input[2],
         most_further_dennis_result[0],
         most_further_dennis_result[1],
         most_further_dennis_result[2],
         most_further_dennis_myDist,
         most_further_dennis_hisDist);
         
  }
  rtdqDestroy(scene);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
cmpl $0x2, %edi
jne 0x41f3
movq 0x8(%rsi), %rsi
leaq 0x70(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x4530
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x460c
leaq 0x6a95(%rip), %rsi      # 0xa23d
leaq 0x48(%rsp), %rdi
callq 0x2330
leaq 0x48(%rsp), %rdi
callq 0x27bc
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x37d3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21e0
leaq 0x48(%rsp), %rdi
movq %r15, (%rdi)
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
addq %rsi, %rdx
callq 0x460c
leaq 0x6a5b(%rip), %rsi      # 0xa24f
leaq 0x48(%rsp), %rdi
callq 0x2330
leaq 0x48(%rsp), %rdi
callq 0x3498
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x381f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21e0
leaq 0x48(%rsp), %rdi
movq %r15, (%rdi)
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
addq %rsi, %rdx
callq 0x460c
leaq 0x6a20(%rip), %rsi      # 0xa260
leaq 0x48(%rsp), %rdi
callq 0x2330
leaq 0x48(%rsp), %rdi
callq 0x2fb5
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x386b
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21e0
leaq 0x48(%rsp), %rdi
movq %r15, (%rdi)
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
addq %rsi, %rdx
callq 0x460c
leaq 0x69e2(%rip), %rsi      # 0xa26e
leaq 0x48(%rsp), %rdi
callq 0x2330
leaq 0x48(%rsp), %rdi
callq 0x3288
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x38b7
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21e0
movb $0x1, %bpl
callq 0x2050
movq %rax, %r15
movq 0x9707(%rip), %rbx      # 0xcfd0
leaq 0x69af(%rip), %rsi      # 0xa27f
movl $0x1c, %edx
movq %rbx, %rdi
callq 0x2200
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq 0x96d5(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x9909(%rip), %rdi      # 0xd218
movq 0x991a(%rip), %rsi      # 0xd230
movq 0x992b(%rip), %rdx      # 0xd248
movq 0x993c(%rip), %r8       # 0xd260
movq 0x994d(%rip), %r9       # 0xd278
movq 0x995e(%rip), %rax      # 0xd290
movq 0x992f(%rip), %rcx      # 0xd268
subq %r8, %rcx
sarq $0x2, %rcx
movq %rcx, 0x10(%rsp)
movq %rax, (%rsp)
movq $0x1, 0x8(%rsp)
movl $0x1, %ecx
callq 0x4b82
movq %rax, %rbx
callq 0x2050
movq %rax, %r14
movq 0x986a(%rip), %rsi      # 0xd1d8
subq 0x985b(%rip), %rsi      # 0xd1d0
sarq $0x3, %rsi
leaq 0x9970(%rip), %rdi      # 0xd2f0
callq 0x456e
movq 0x984c(%rip), %rsi      # 0xd1d8
subq 0x983d(%rip), %rsi      # 0xd1d0
sarq $0x3, %rsi
leaq 0x990a(%rip), %rdi      # 0xd2a8
callq 0x456e
movq 0x982e(%rip), %rsi      # 0xd1d8
subq 0x981f(%rip), %rsi      # 0xd1d0
sarq $0x3, %rsi
leaq 0x9904(%rip), %rdi      # 0xd2c0
callq 0x456e
movq 0x9810(%rip), %rsi      # 0xd1d8
subq 0x9801(%rip), %rsi      # 0xd1d0
sarq $0x3, %rsi
leaq 0x98fe(%rip), %rdi      # 0xd2d8
callq 0x456e
movq 0x95ea(%rip), %r12      # 0xcfd0
leaq 0x68af(%rip), %rsi      # 0xa29c
movl $0x16, %edx
movq %r12, %rdi
callq 0x2200
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq 0x95b7(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x987b(%rip), %rsi      # 0xd2a8
movq 0x988c(%rip), %rdx      # 0xd2c0
movq 0x989d(%rip), %rcx      # 0xd2d8
movq 0x98ae(%rip), %r9       # 0xd2f0
movq 0x9787(%rip), %rax      # 0xd1d0
movq 0x9798(%rip), %rdi      # 0xd1e8
movq 0x97a9(%rip), %r8       # 0xd200
movq 0x977a(%rip), %r10      # 0xd1d8
subq %rax, %r10
sarq $0x3, %r10
movq %r10, 0x38(%rsp)
movl $0x1, %r10d
movq %r10, 0x30(%rsp)
movq %r8, 0x28(%rsp)
movq %rdi, 0x20(%rsp)
movq %rax, 0x18(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rsp)
movq %r10, (%rsp)
movl $0x1, %r8d
movq %rbx, %rdi
callq 0x5254
callq 0x2050
movq %rax, %r13
movq 0x9729(%rip), %r12      # 0xd1d8
subq 0x971a(%rip), %r12      # 0xd1d0
movq 0x9513(%rip), %rdi      # 0xcfd0
leaq 0x67ef(%rip), %rsi      # 0xa2b3
movl $0x13, %edx
callq 0x2200
movq %r14, %rax
subq %r15, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0x6524(%rip), %xmm0     # 0xa008
mulsd 0x6524(%rip), %xmm0     # 0xa010
movq 0x94dd(%rip), %rdi      # 0xcfd0
callq 0x22a0
movq %rax, %r15
leaq 0x67c5(%rip), %rsi      # 0xa2c7
movl $0x2, %edx
movq %rax, %rdi
callq 0x2200
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x9493(%rip), %rdi      # 0xcfd0
leaq 0x6786(%rip), %rsi      # 0xa2ca
movl $0xe, %edx
callq 0x2200
sarq $0x3, %r12
movq 0x9477(%rip), %rdi      # 0xcfd0
movq %r12, %rsi
callq 0x2120
movq %rax, %r15
leaq 0x676e(%rip), %rsi      # 0xa2d9
movl $0x9, %edx
movq %rax, %rdi
callq 0x2200
subq %r14, %r13
xorps %xmm0, %xmm0
cvtsi2sd %r13, %xmm0
divsd 0x647d(%rip), %xmm0     # 0xa008
movq %r15, %rdi
movsd %xmm0, 0x68(%rsp)
callq 0x22a0
movq %rax, %r14
leaq 0x6576(%rip), %rsi      # 0xa119
movl $0x1, %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 0x93f2(%rip), %rdi      # 0xcfd0
leaq 0x66fe(%rip), %rsi      # 0xa2e3
movl $0x9, %edx
callq 0x2200
movsd 0x68(%rsp), %xmm0
mulsd 0x641b(%rip), %xmm0     # 0xa018
movq %r12, %xmm2
punpckldq 0x6416(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x641e(%rip), %xmm2     # 0xa030
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq 0x93a7(%rip), %rdi      # 0xcfd0
callq 0x22a0
movq %rax, %r14
leaq 0x66b5(%rip), %rsi      # 0xa2ed
movl $0x15, %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
testb %bpl, %bpl
je 0x41b6
movq 0x9354(%rip), %r14      # 0xcfd0
leaq 0x6680(%rip), %rsi      # 0xa303
movl $0xc, %edx
movq %r14, %rdi
callq 0x2200
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq 0x9322(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
xorpd %xmm0, %xmm0
movsd %xmm0, 0x68(%rsp)
xorl %r14d, %r14d
leaq 0x6641(%rip), %r15      # 0xa310
xorps %xmm0, %xmm0
movsd %xmm0, 0xa0(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x98(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x90(%rsp)
movq 0x95f6(%rip), %rax      # 0xd2f0
movsd (%rax,%r14,8), %xmm0
movq 0x9601(%rip), %rax      # 0xd308
movsd (%rax,%r14,8), %xmm1
movq 0x9654(%rip), %rax      # 0xd368
movsd (%rax,%r14,8), %xmm2
movq %r15, %rdi
movl %r14d, %esi
movb $0x3, %al
callq 0x2040
movq 0x963a(%rip), %rax      # 0xd368
movsd (%rax,%r14,8), %xmm1
movq 0x95b5(%rip), %rax      # 0xd2f0
movsd (%rax,%r14,8), %xmm0
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
cvtsd2ss %xmm2, %xmm2
cvtss2sd %xmm2, %xmm2
ucomisd 0xa0(%rsp), %xmm2
jbe 0x3dff
movq 0x9469(%rip), %rax      # 0xd1d0
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x170(%rsp)
movq 0x946b(%rip), %rax      # 0xd1e8
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x160(%rsp)
movq 0x946d(%rip), %rax      # 0xd200
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x150(%rsp)
movq 0x94ff(%rip), %rax      # 0xd2a8
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x168(%rsp)
movq 0x9501(%rip), %rax      # 0xd2c0
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x158(%rsp)
movq 0x9503(%rip), %rax      # 0xd2d8
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x148(%rsp)
movsd %xmm2, 0xa0(%rsp)
movsd %xmm0, 0x128(%rsp)
movsd %xmm1, 0x130(%rsp)
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
cvtss2sd %xmm2, %xmm2
ucomisd 0x98(%rsp), %xmm2
jbe 0x3ebd
movq 0x93ab(%rip), %rax      # 0xd1d0
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x1a0(%rsp)
movq 0x93ad(%rip), %rax      # 0xd1e8
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x190(%rsp)
movq 0x93af(%rip), %rax      # 0xd200
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x180(%rsp)
movq 0x9441(%rip), %rax      # 0xd2a8
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x198(%rsp)
movq 0x9443(%rip), %rax      # 0xd2c0
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x188(%rsp)
movq 0x9445(%rip), %rax      # 0xd2d8
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x178(%rsp)
movsd %xmm2, 0x98(%rsp)
movsd %xmm0, 0x138(%rsp)
movsd %xmm1, 0x140(%rsp)
movq 0x9444(%rip), %rax      # 0xd308
movsd (%rax,%r14,8), %xmm1
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
cvtsd2ss %xmm2, %xmm2
cvtss2sd %xmm2, %xmm2
ucomisd 0x90(%rsp), %xmm2
jbe 0x3f88
movq 0x92e0(%rip), %rax      # 0xd1d0
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0xf0(%rsp)
movq 0x92e2(%rip), %rax      # 0xd1e8
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0xe0(%rsp)
movq 0x92e4(%rip), %rax      # 0xd200
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0xc8(%rsp)
movq 0x9376(%rip), %rax      # 0xd2a8
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0xe8(%rsp)
movq 0x9378(%rip), %rax      # 0xd2c0
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0xd8(%rsp)
movq 0x937a(%rip), %rax      # 0xd2d8
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0xc0(%rsp)
movsd %xmm2, 0x90(%rsp)
movsd %xmm0, 0xa8(%rsp)
movsd %xmm1, 0xb0(%rsp)
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
cvtss2sd %xmm2, %xmm2
ucomisd 0x68(%rsp), %xmm2
jbe 0x4040
movq 0x9225(%rip), %rax      # 0xd1d0
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x120(%rsp)
movq 0x9227(%rip), %rax      # 0xd1e8
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x110(%rsp)
movq 0x9229(%rip), %rax      # 0xd200
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x100(%rsp)
movq 0x92bb(%rip), %rax      # 0xd2a8
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x118(%rsp)
movq 0x92bd(%rip), %rax      # 0xd2c0
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0x108(%rsp)
movq 0x92bf(%rip), %rax      # 0xd2d8
movsd (%rax,%r14,8), %xmm3
movsd %xmm3, 0xf8(%rsp)
movsd %xmm0, 0xb8(%rsp)
movsd %xmm1, 0xd0(%rsp)
movsd %xmm2, 0x68(%rsp)
incq %r14
movq 0x918e(%rip), %rax      # 0xd1d8
subq 0x917f(%rip), %rax      # 0xd1d0
sarq $0x3, %rax
cmpq %r14, %rax
ja 0x3cf3
leaq 0x62eb(%rip), %rdi      # 0xa350
movsd 0xf0(%rsp), %xmm0
movsd 0xe0(%rsp), %xmm1
movsd 0xc8(%rsp), %xmm2
movsd 0xe8(%rsp), %xmm3
movsd 0xd8(%rsp), %xmm4
movsd 0xc0(%rsp), %xmm5
movsd 0xa8(%rsp), %xmm6
movsd 0xb0(%rsp), %xmm7
movb $0x8, %al
callq 0x2040
leaq 0x62f1(%rip), %rdi      # 0xa3ac
movsd 0x120(%rsp), %xmm0
movsd 0x110(%rsp), %xmm1
movsd 0x100(%rsp), %xmm2
movsd 0x118(%rsp), %xmm3
movsd 0x108(%rsp), %xmm4
movsd 0xf8(%rsp), %xmm5
movsd 0xb8(%rsp), %xmm6
movsd 0xd0(%rsp), %xmm7
movb $0x8, %al
callq 0x2040
leaq 0x62f8(%rip), %rdi      # 0xa409
movsd 0x170(%rsp), %xmm0
movsd 0x160(%rsp), %xmm1
movsd 0x150(%rsp), %xmm2
movsd 0x168(%rsp), %xmm3
movsd 0x158(%rsp), %xmm4
movsd 0x148(%rsp), %xmm5
movsd 0x128(%rsp), %xmm6
movsd 0x130(%rsp), %xmm7
movb $0x8, %al
callq 0x2040
leaq 0x6301(%rip), %rdi      # 0xa468
movsd 0x1a0(%rsp), %xmm0
movsd 0x190(%rsp), %xmm1
movsd 0x180(%rsp), %xmm2
movsd 0x198(%rsp), %xmm3
movsd 0x188(%rsp), %xmm4
movsd 0x178(%rsp), %xmm5
movsd 0x138(%rsp), %xmm6
movsd 0x140(%rsp), %xmm7
movb $0x8, %al
callq 0x2040
movq %rbx, %rdi
callq 0x53e5
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41df
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x21e0
xorl %eax, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20e0
movq %rax, %r14
leaq 0x6009(%rip), %rsi      # 0xa210
movq %rax, %rdi
callq 0x20a0
movq 0x8dda(%rip), %rsi      # 0xcff0
movq 0x8dab(%rip), %rdx      # 0xcfc8
movq %r14, %rdi
callq 0x22e0
movq %rax, %rbx
movq %r14, %rdi
callq 0x2150
jmp 0x4304
jmp 0x4242
jmp 0x42e0
jmp 0x4242
jmp 0x4261
jmp 0x4242
movq %rdx, %r14
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x4267
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21e0
jmp 0x4267
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x42e3
movq %rbx, %rdi
callq 0x2230
leaq 0x48(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x20c0
movq %rbx, %rdi
callq 0x20b0
leaq 0x6292(%rip), %rdi      # 0xa526
callq 0x2260
movq %r14, %rdi
callq 0x2348
callq 0x22d0
xorl %ebp, %ebp
jmp 0x38ba
jmp 0x42e0
jmp 0x42b7
jmp 0x42b7
jmp 0x42e0
jmp 0x42b7
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x42e3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21e0
jmp 0x42e3
jmp 0x42e0
movq %rax, %rbx
jmp 0x4304
jmp 0x42e0
jmp 0x42e0
jmp 0x42e0
movq %rax, %rbx
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4304
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x22f0