// File: ingowald[P]closestSurfacePointQueries/examples/soaExample.cpp
// Function: main
int main(int ac, char **av)
  {
    srand48(290374);

    int numTriangles = 1000000;
    float maxEdgeLen = 1.f/(powf(numTriangles,1.f/3.f));
    int numPoints    = 1000000;
    
    // the triangles we're querying to
    std::vector<float>   vertex_x;
    std::vector<float>   vertex_y;
    std::vector<float>   vertex_z;
    std::vector<int32_t> index_x;
    std::vector<int32_t> index_y;
    std::vector<int32_t> index_z;
    
    for (int i=0;i<numTriangles;i++) {
      const vec3f P(drand48(),drand48(),drand48());
      const vec3f e0 = maxEdgeLen * vec3f(drand48(),drand48(),drand48());
      const vec3f e1 = maxEdgeLen * vec3f(drand48(),drand48(),drand48());
      const int vIdx = vertex_x.size();
      vertex_x.push_back(P.x);
      vertex_x.push_back(P.x+e0.x);
      vertex_x.push_back(P.x+e1.x);

      vertex_y.push_back(P.y);
      vertex_y.push_back(P.y+e0.y);
      vertex_y.push_back(P.y+e1.y);

      vertex_z.push_back(P.z);
      vertex_z.push_back(P.z+e0.z);
      vertex_z.push_back(P.z+e1.z);

      index_x.push_back(vIdx+0);
      index_y.push_back(vIdx+1);
      index_z.push_back(vIdx+2);
    }
    
    // the points we're query'ing
    std::vector<vec3f> queryPoint;
    for (int i=0;i<numPoints;i++) {
      int triID = int(drand48()*numTriangles);
      float u = drand48();
      float v = drand48();
      const vec3f A(vertex_x[index_x[triID]],
                    vertex_y[index_x[triID]],
                    vertex_z[index_x[triID]]);
      const vec3f B(vertex_x[index_y[triID]],
                    vertex_y[index_y[triID]],
                    vertex_z[index_y[triID]]);
      const vec3f C(vertex_x[index_z[triID]],
                    vertex_y[index_z[triID]],
                    vertex_z[index_z[triID]]);
      if (u+v >= 1.f) { u = 1-u; v = 1-v; }
      const vec3f pointOnTri = A+u*(B-A)+v*(C-A);
      queryPoint.push_back(pointOnTri + float(0.1f*drand48()*maxEdgeLen)*vec3f(drand48(),drand48(),drand48()));
    }

    // the result of our queries
    std::vector<vec3f>   result_pos;    result_pos.resize(queryPoint.size());
    std::vector<int32_t> result_primID; result_primID.resize(queryPoint.size());
    std::vector<float>   result_dist;   result_dist.resize(queryPoint.size());

    auto begin = std::chrono::system_clock::now();
    // create the actual scene:
    distance_query_scene scene
      = rtdqNewTriangleMeshfi(&vertex_x[0],&vertex_y[0],&vertex_z[0],1,
                              &index_x[0],&index_y[0],&index_z[0],1,
                              index_x.size());
    auto done_build = std::chrono::system_clock::now();

    // perform the queries - all together, in a single thread
    rtdqComputeClosestPointsfi(scene,
                             &result_pos[0].x,&result_pos[0].y,&result_pos[0].z,3,
                             &result_dist[0],1,
                             &result_primID[0],1,
                             &queryPoint[0].x,&queryPoint[0].y,&queryPoint[0].z,3,
                             numPoints);
    auto done_all = std::chrono::system_clock::now();

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

    rtdqDestroy(scene);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x640, %rsp            # imm = 0x640
movl %edi, -0x14(%rbp)
movq %rsi, -0x20(%rbp)
movl $0x46e46, %edi          # imm = 0x46E46
callq 0x21b0
movl $0xf4240, -0x24(%rbp)   # imm = 0xF4240
cvtsi2ssl -0x24(%rbp), %xmm0
movss 0xdc15(%rip), %xmm1     # 0x10008
callq 0x2180
movaps %xmm0, %xmm1
movss 0xdc01(%rip), %xmm0     # 0x10004
divss %xmm1, %xmm0
movss %xmm0, -0x28(%rbp)
movl $0xf4240, -0x2c(%rbp)   # imm = 0xF4240
leaq -0x48(%rbp), %rdi
callq 0x34a0
leaq -0x60(%rbp), %rdi
callq 0x34a0
leaq -0x78(%rbp), %rdi
callq 0x34a0
leaq -0x90(%rbp), %rdi
callq 0x34c0
leaq -0xa8(%rbp), %rdi
callq 0x34c0
leaq -0xc0(%rbp), %rdi
callq 0x34c0
movl $0x0, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x281d
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x344(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x348(%rbp)
callq 0x2100
movss -0x348(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x344(%rbp), %xmm0
cvtsd2ss %xmm2, %xmm2
leaq -0xd0(%rbp), %rdi
callq 0x34e0
jmp 0x24b7
movss -0x28(%rbp), %xmm0
movss %xmm0, -0x354(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x34c(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x350(%rbp)
callq 0x2100
movss -0x350(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x34c(%rbp), %xmm0
cvtsd2ss %xmm2, %xmm2
leaq -0xf4(%rbp), %rdi
callq 0x34e0
jmp 0x2510
movss -0x354(%rbp), %xmm0
leaq -0xf4(%rbp), %rdi
callq 0x3520
movss %xmm1, -0x374(%rbp)
movaps %xmm0, -0x370(%rbp)
jmp 0x2535
movss -0x374(%rbp), %xmm0
movaps -0x370(%rbp), %xmm1
movlpd %xmm1, -0x108(%rbp)
movss %xmm0, -0x100(%rbp)
movl -0x100(%rbp), %eax
movl %eax, -0xe0(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0xe8(%rbp)
movss -0x28(%rbp), %xmm0
movss %xmm0, -0x380(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x378(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x37c(%rbp)
callq 0x2100
movss -0x37c(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x378(%rbp), %xmm0
cvtsd2ss %xmm2, %xmm2
leaq -0x124(%rbp), %rdi
callq 0x34e0
jmp 0x25c7
movss -0x380(%rbp), %xmm0
leaq -0x124(%rbp), %rdi
callq 0x3520
movss %xmm1, -0x394(%rbp)
movaps %xmm0, -0x390(%rbp)
jmp 0x25ec
movss -0x394(%rbp), %xmm0
movaps -0x390(%rbp), %xmm1
movlpd %xmm1, -0x138(%rbp)
movss %xmm0, -0x130(%rbp)
movl -0x130(%rbp), %eax
movl %eax, -0x110(%rbp)
movq -0x138(%rbp), %rax
movq %rax, -0x118(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x3590
movq -0x3a0(%rbp), %rdi
movl %eax, -0x13c(%rbp)
leaq -0xd0(%rbp), %rsi
callq 0x35b0
jmp 0x2650
movss -0xd0(%rbp), %xmm0
movss -0xe8(%rbp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x140(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x3620
jmp 0x267e
movss -0xd0(%rbp), %xmm0
movss -0x118(%rbp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x144(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x144(%rbp), %rsi
callq 0x3620
jmp 0x26ac
leaq -0xcc(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x35b0
jmp 0x26be
movss -0xcc(%rbp), %xmm0
movss -0xe4(%rbp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x148(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x3620
jmp 0x26ec
movss -0xcc(%rbp), %xmm0
movss -0x114(%rbp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x14c(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x14c(%rbp), %rsi
callq 0x3620
jmp 0x271a
leaq -0xc8(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x35b0
jmp 0x272c
movss -0xc8(%rbp), %xmm0
movss -0xe0(%rbp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x150(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x3620
jmp 0x275a
movss -0xc8(%rbp), %xmm0
movss -0x110(%rbp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x154(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x154(%rbp), %rsi
callq 0x3620
jmp 0x2788
movl -0x13c(%rbp), %eax
movl %eax, -0x158(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x3650
jmp 0x27a9
movl -0x13c(%rbp), %eax
incl %eax
movl %eax, -0x15c(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0x15c(%rbp), %rsi
callq 0x3650
jmp 0x27cc
movl -0x13c(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x160(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x3650
jmp 0x27f0
jmp 0x27f2
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x245c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x3455
leaq -0x178(%rbp), %rdi
callq 0x3680
movl $0x0, -0x17c(%rbp)
movl -0x17c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x2e68
callq 0x2100
cvtsi2sdl -0x24(%rbp), %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x180(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x184(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x188(%rbp)
movslq -0x180(%rbp), %rsi
leaq -0x90(%rbp), %rdi
movq %rdi, -0x3b0(%rbp)
callq 0x36c0
movslq (%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x36a0
movq -0x3b0(%rbp), %rdi
movss (%rax), %xmm0
movss %xmm0, -0x3a8(%rbp)
movslq -0x180(%rbp), %rsi
callq 0x36c0
movslq (%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x36a0
movq -0x3b0(%rbp), %rdi
movss (%rax), %xmm0
movss %xmm0, -0x3a4(%rbp)
movslq -0x180(%rbp), %rsi
callq 0x36c0
movslq (%rax), %rsi
leaq -0x78(%rbp), %rdi
callq 0x36a0
movss -0x3a8(%rbp), %xmm0
movss -0x3a4(%rbp), %xmm1
movss (%rax), %xmm2
leaq -0x194(%rbp), %rdi
callq 0x34e0
jmp 0x291a
movslq -0x180(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x3c0(%rbp)
callq 0x36c0
movslq (%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x36a0
movq -0x3c0(%rbp), %rdi
movss (%rax), %xmm0
movss %xmm0, -0x3b8(%rbp)
movslq -0x180(%rbp), %rsi
callq 0x36c0
movslq (%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x36a0
movq -0x3c0(%rbp), %rdi
movss (%rax), %xmm0
movss %xmm0, -0x3b4(%rbp)
movslq -0x180(%rbp), %rsi
callq 0x36c0
movslq (%rax), %rsi
leaq -0x78(%rbp), %rdi
callq 0x36a0
movss -0x3b8(%rbp), %xmm0
movss -0x3b4(%rbp), %xmm1
movss (%rax), %xmm2
leaq -0x1a0(%rbp), %rdi
callq 0x34e0
jmp 0x29b8
movslq -0x180(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x3d0(%rbp)
callq 0x36c0
movslq (%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x36a0
movq -0x3d0(%rbp), %rdi
movss (%rax), %xmm0
movss %xmm0, -0x3c8(%rbp)
movslq -0x180(%rbp), %rsi
callq 0x36c0
movslq (%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x36a0
movq -0x3d0(%rbp), %rdi
movss (%rax), %xmm0
movss %xmm0, -0x3c4(%rbp)
movslq -0x180(%rbp), %rsi
callq 0x36c0
movslq (%rax), %rsi
leaq -0x78(%rbp), %rdi
callq 0x36a0
movss -0x3c8(%rbp), %xmm0
movss -0x3c4(%rbp), %xmm1
movss (%rax), %xmm2
leaq -0x1ac(%rbp), %rdi
callq 0x34e0
jmp 0x2a56
movss -0x184(%rbp), %xmm0
addss -0x188(%rbp), %xmm0
movss 0xd596(%rip), %xmm1     # 0x10004
ucomiss %xmm1, %xmm0
jb 0x2abc
movss 0xd589(%rip), %xmm0     # 0x10004
subss -0x184(%rbp), %xmm0
movss %xmm0, -0x184(%rbp)
movss 0xd571(%rip), %xmm0     # 0x10004
subss -0x188(%rbp), %xmm0
movss %xmm0, -0x188(%rbp)
jmp 0x2abc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x3449
movss -0x184(%rbp), %xmm0
movss %xmm0, -0x3e8(%rbp)
leaq -0x1a0(%rbp), %rdi
leaq -0x194(%rbp), %rsi
callq 0x3750
movss %xmm1, -0x3e4(%rbp)
movaps %xmm0, -0x3e0(%rbp)
jmp 0x2af0
movss -0x3e8(%rbp), %xmm0
movss -0x3e4(%rbp), %xmm1
movaps -0x3e0(%rbp), %xmm2
movlpd %xmm2, -0x1f8(%rbp)
movss %xmm1, -0x1f0(%rbp)
movl -0x1f0(%rbp), %eax
movl %eax, -0x1e0(%rbp)
movq -0x1f8(%rbp), %rax
movq %rax, -0x1e8(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x3520
movss %xmm1, -0x404(%rbp)
movaps %xmm0, -0x400(%rbp)
jmp 0x2b4e
movss -0x404(%rbp), %xmm0
movaps -0x400(%rbp), %xmm1
movlpd %xmm1, -0x208(%rbp)
movss %xmm0, -0x200(%rbp)
movl -0x200(%rbp), %eax
movl %eax, -0x1d0(%rbp)
movq -0x208(%rbp), %rax
movq %rax, -0x1d8(%rbp)
leaq -0x194(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x36e0
movss %xmm1, -0x424(%rbp)
movaps %xmm0, -0x420(%rbp)
jmp 0x2bab
movss -0x424(%rbp), %xmm0
movaps -0x420(%rbp), %xmm1
movlpd %xmm1, -0x218(%rbp)
movss %xmm0, -0x210(%rbp)
movl -0x210(%rbp), %eax
movl %eax, -0x1c0(%rbp)
movq -0x218(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movss -0x188(%rbp), %xmm0
movss %xmm0, -0x448(%rbp)
leaq -0x1ac(%rbp), %rdi
leaq -0x194(%rbp), %rsi
callq 0x3750
movss %xmm1, -0x444(%rbp)
movaps %xmm0, -0x440(%rbp)
jmp 0x2c18
movss -0x448(%rbp), %xmm0
movss -0x444(%rbp), %xmm1
movaps -0x440(%rbp), %xmm2
movlpd %xmm2, -0x248(%rbp)
movss %xmm1, -0x240(%rbp)
movl -0x240(%rbp), %eax
movl %eax, -0x230(%rbp)
movq -0x248(%rbp), %rax
movq %rax, -0x238(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x3520
movss %xmm1, -0x464(%rbp)
movaps %xmm0, -0x460(%rbp)
jmp 0x2c76
movss -0x464(%rbp), %xmm0
movaps -0x460(%rbp), %xmm1
movlpd %xmm1, -0x258(%rbp)
movss %xmm0, -0x250(%rbp)
movl -0x250(%rbp), %eax
movl %eax, -0x220(%rbp)
movq -0x258(%rbp), %rax
movq %rax, -0x228(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x36e0
movss %xmm1, -0x484(%rbp)
movaps %xmm0, -0x480(%rbp)
jmp 0x2cd3
movss -0x484(%rbp), %xmm0
movaps -0x480(%rbp), %xmm1
movlpd %xmm1, -0x268(%rbp)
movss %xmm0, -0x260(%rbp)
movl -0x260(%rbp), %eax
movl %eax, -0x1b0(%rbp)
movq -0x268(%rbp), %rax
movq %rax, -0x1b8(%rbp)
callq 0x2100
movsd 0xd2f7(%rip), %xmm1     # 0x10010
mulsd %xmm1, %xmm0
movss -0x28(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x490(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x488(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x48c(%rbp)
callq 0x2100
movss -0x48c(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x488(%rbp), %xmm0
cvtsd2ss %xmm2, %xmm2
leaq -0x294(%rbp), %rdi
callq 0x34e0
jmp 0x2d82
movss -0x490(%rbp), %xmm0
leaq -0x294(%rbp), %rdi
callq 0x3520
movss %xmm1, -0x4a4(%rbp)
movaps %xmm0, -0x4a0(%rbp)
jmp 0x2da7
movss -0x4a4(%rbp), %xmm0
movaps -0x4a0(%rbp), %xmm1
movlpd %xmm1, -0x2a8(%rbp)
movss %xmm0, -0x2a0(%rbp)
movl -0x2a0(%rbp), %eax
movl %eax, -0x280(%rbp)
movq -0x2a8(%rbp), %rax
movq %rax, -0x288(%rbp)
leaq -0x1b8(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x36e0
movss %xmm1, -0x4c4(%rbp)
movaps %xmm0, -0x4c0(%rbp)
jmp 0x2e04
movss -0x4c4(%rbp), %xmm0
movaps -0x4c0(%rbp), %xmm1
movlpd %xmm1, -0x2b8(%rbp)
movss %xmm0, -0x2b0(%rbp)
movl -0x2b0(%rbp), %eax
movl %eax, -0x270(%rbp)
movq -0x2b8(%rbp), %rax
movq %rax, -0x278(%rbp)
leaq -0x178(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x37c0
jmp 0x2e52
jmp 0x2e54
movl -0x17c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x17c(%rbp)
jmp 0x2833
leaq -0x2d0(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
callq 0x3680
leaq -0x178(%rbp), %rdi
callq 0x3880
movq -0x4d0(%rbp), %rdi
movq %rax, %rsi
callq 0x37f0
jmp 0x2e98
leaq -0x2e8(%rbp), %rdi
movq %rdi, -0x4d8(%rbp)
callq 0x34c0
leaq -0x178(%rbp), %rdi
callq 0x3880
movq -0x4d8(%rbp), %rdi
movq %rax, %rsi
callq 0x38b0
jmp 0x2ec8
leaq -0x300(%rbp), %rdi
movq %rdi, -0x4e0(%rbp)
callq 0x34a0
leaq -0x178(%rbp), %rdi
callq 0x3880
movq -0x4e0(%rbp), %rdi
movq %rax, %rsi
callq 0x3940
jmp 0x2ef8
callq 0x2030
movq %rax, -0x308(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x528(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x36a0
movq -0x528(%rbp), %rsi
movq %rax, -0x510(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x36a0
movq -0x528(%rbp), %rsi
movq %rax, -0x508(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x36a0
movq -0x528(%rbp), %rsi
movq %rax, -0x500(%rbp)
leaq -0x90(%rbp), %rdi
movq %rdi, -0x520(%rbp)
callq 0x36c0
movq -0x528(%rbp), %rsi
movq %rax, -0x4f8(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x36c0
movq -0x528(%rbp), %rsi
movq %rax, -0x4f0(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x36c0
movq -0x520(%rbp), %rdi
movq %rax, -0x518(%rbp)
callq 0x39d0
movq -0x518(%rbp), %rcx
movq -0x510(%rbp), %rdi
movq -0x508(%rbp), %rsi
movq -0x500(%rbp), %rdx
movq -0x4f8(%rbp), %r8
movq -0x4f0(%rbp), %r9
movq %rax, %r10
movq %rsp, %rax
movq %r10, 0x10(%rax)
movq %rcx, (%rax)
movq $0x1, 0x8(%rax)
movl $0x1, %ecx
callq 0x6ce0
movq %rax, -0x4e8(%rbp)
jmp 0x3000
movq -0x4e8(%rbp), %rax
movq %rax, -0x310(%rbp)
callq 0x2030
movq %rax, -0x318(%rbp)
movq -0x310(%rbp), %rax
movq %rax, -0x558(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x578(%rbp)
leaq -0x2d0(%rbp), %rdi
movq %rdi, -0x588(%rbp)
callq 0x39f0
movq -0x588(%rbp), %rdi
movq -0x578(%rbp), %rsi
movq %rax, -0x550(%rbp)
callq 0x39f0
movq -0x588(%rbp), %rdi
movq -0x578(%rbp), %rsi
addq $0x4, %rax
movq %rax, -0x548(%rbp)
callq 0x39f0
movq -0x578(%rbp), %rsi
addq $0x8, %rax
movq %rax, -0x540(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x36a0
movq -0x578(%rbp), %rsi
movq %rax, -0x538(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x36c0
movq -0x578(%rbp), %rsi
movq %rax, -0x560(%rbp)
leaq -0x178(%rbp), %rdi
movq %rdi, -0x580(%rbp)
callq 0x39f0
movq -0x580(%rbp), %rdi
movq -0x578(%rbp), %rsi
movq %rax, -0x568(%rbp)
callq 0x39f0
movq -0x580(%rbp), %rdi
movq -0x578(%rbp), %rsi
addq $0x4, %rax
movq %rax, -0x570(%rbp)
callq 0x39f0
movq -0x570(%rbp), %r11
movq -0x568(%rbp), %r10
movq -0x560(%rbp), %r8
movq -0x558(%rbp), %rdi
movq -0x550(%rbp), %rsi
movq -0x548(%rbp), %rdx
movq -0x540(%rbp), %rcx
movq -0x538(%rbp), %r9
movq %rax, %rbx
addq $0x8, %rbx
movslq -0x2c(%rbp), %r14
movq %rsp, %rax
movq %rax, -0x530(%rbp)
movq %r14, 0x38(%rax)
movq %rbx, 0x28(%rax)
movq %r11, 0x20(%rax)
movq %r10, 0x18(%rax)
movq %r8, 0x8(%rax)
movq $0x3, 0x30(%rax)
movq $0x1, 0x10(%rax)
movq $0x1, (%rax)
movl $0x3, %r8d
callq 0x7530
jmp 0x3194
callq 0x2030
movq %rax, -0x320(%rbp)
leaq -0x318(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x3a10
movq %rax, -0x590(%rbp)
jmp 0x31bc
movq -0x590(%rbp), %rax
movq %rax, -0x330(%rbp)
leaq -0x328(%rbp), %rdi
leaq -0x330(%rbp), %rsi
callq 0x3a60
jmp 0x31df
leaq -0x320(%rbp), %rdi
leaq -0x318(%rbp), %rsi
callq 0x3a10
movq %rax, -0x598(%rbp)
jmp 0x31fb
movq -0x598(%rbp), %rax
movq %rax, -0x340(%rbp)
leaq -0x338(%rbp), %rdi
leaq -0x340(%rbp), %rsi
callq 0x3a60
jmp 0x321e
movq 0x13db3(%rip), %rdi     # 0x16fd8
leaq 0xcdf4(%rip), %rsi      # 0x10020
callq 0x2110
movq %rax, -0x5a0(%rbp)
jmp 0x323a
leaq -0x328(%rbp), %rdi
callq 0x3aa0
movsd %xmm0, -0x5a8(%rbp)
jmp 0x3250
movsd -0x5a8(%rbp), %xmm0
movq -0x5a0(%rbp), %rdi
callq 0x21f0
movq %rax, -0x5b0(%rbp)
jmp 0x326d
movq -0x5b0(%rbp), %rdi
leaq 0xcdb9(%rip), %rsi      # 0x10034
callq 0x2110
movq %rax, -0x5b8(%rbp)
jmp 0x3289
movq -0x5b8(%rbp), %rdi
movq 0x13d31(%rip), %rsi     # 0x16fc8
callq 0x2140
jmp 0x329e
movq 0x13d33(%rip), %rdi     # 0x16fd8
leaq 0xcd8a(%rip), %rsi      # 0x10036
callq 0x2110
movq %rax, -0x5c0(%rbp)
jmp 0x32ba
movq -0x5c0(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x21c0
movq %rax, -0x5c8(%rbp)
jmp 0x32d2
movq -0x5c8(%rbp), %rdi
leaq 0xcd65(%rip), %rsi      # 0x10045
callq 0x2110
movq %rax, -0x5d0(%rbp)
jmp 0x32ee
leaq -0x338(%rbp), %rdi
callq 0x3aa0
movsd %xmm0, -0x5d8(%rbp)
jmp 0x3304
movsd -0x5d8(%rbp), %xmm0
movq -0x5d0(%rbp), %rdi
callq 0x21f0
movq %rax, -0x5e0(%rbp)
jmp 0x3321
movq -0x5e0(%rbp), %rdi
leaq 0xcd05(%rip), %rsi      # 0x10034
callq 0x2110
movq %rax, -0x5e8(%rbp)
jmp 0x333d
movq -0x5e8(%rbp), %rdi
movq 0x13c7d(%rip), %rsi     # 0x16fc8
callq 0x2140
jmp 0x3352
movq 0x13c7f(%rip), %rdi     # 0x16fd8
leaq 0xccef(%rip), %rsi      # 0x1004f
callq 0x2110
movq %rax, -0x5f0(%rbp)
jmp 0x336e
leaq -0x338(%rbp), %rdi
callq 0x3aa0
movsd %xmm0, -0x5f8(%rbp)
jmp 0x3384
movq -0x5f0(%rbp), %rdi
movsd -0x5f8(%rbp), %xmm0
cvtsi2sdl -0x2c(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x21f0
movq %rax, -0x600(%rbp)
jmp 0x33aa
movq -0x600(%rbp), %rdi
leaq 0xcca1(%rip), %rsi      # 0x10059
callq 0x2110
movq %rax, -0x608(%rbp)
jmp 0x33c6
movq -0x608(%rbp), %rdi
movq 0x13bf4(%rip), %rsi     # 0x16fc8
callq 0x2140
jmp 0x33db
movq -0x310(%rbp), %rdi
callq 0x7850
jmp 0x33e9
ud2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x343d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x3431
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x3ac0
leaq -0x2e8(%rbp), %rdi
callq 0x3b20
leaq -0x2d0(%rbp), %rdi
callq 0x3b80
leaq -0x178(%rbp), %rdi
callq 0x3b80
leaq -0xc0(%rbp), %rdi
callq 0x3b20
leaq -0xa8(%rbp), %rdi
callq 0x3b20
leaq -0x90(%rbp), %rdi
callq 0x3b20
leaq -0x78(%rbp), %rdi
callq 0x3ac0
leaq -0x60(%rbp), %rdi
callq 0x3ac0
leaq -0x48(%rbp), %rdi
callq 0x3ac0
movq -0xd8(%rbp), %rdi
callq 0x21d0