// File: ingowald[P]closestSurfacePointQueries/examples/aosExample.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<vec3f> vertex;
    std::vector<vec3i> index;

    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.size();
      vertex.push_back(P);
      vertex.push_back(P+e0);
      vertex.push_back(P+e1);
      index.push_back(vec3i(vIdx+0,vIdx+1,vIdx+2));
    }
    // loadTriangleMesh(vertex,index,av[1]);
    
    // 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[index[triID].x];
      const vec3f B = vertex[index[triID].y];
      const vec3f C = vertex[index[triID].z];
      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[0].x,&vertex[0].y,&vertex[0].z,3,
                              &index[0].x,&index[0].y,&index[0].z,3,
                              index.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 $0x610, %rsp            # imm = 0x610
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 0x3250
leaq -0x60(%rbp), %rdi
callq 0x3270
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x273c
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x30c(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x310(%rbp)
callq 0x2100
movss -0x310(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x30c(%rbp), %xmm0
cvtsd2ss %xmm2, %xmm2
leaq -0x70(%rbp), %rdi
callq 0x3290
jmp 0x2481
movss -0x28(%rbp), %xmm0
movss %xmm0, -0x31c(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x314(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x318(%rbp)
callq 0x2100
movss -0x318(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x314(%rbp), %xmm0
cvtsd2ss %xmm2, %xmm2
leaq -0x94(%rbp), %rdi
callq 0x3290
jmp 0x24da
movss -0x31c(%rbp), %xmm0
leaq -0x94(%rbp), %rdi
callq 0x32d0
movss %xmm1, -0x334(%rbp)
movaps %xmm0, -0x330(%rbp)
jmp 0x24ff
movss -0x334(%rbp), %xmm0
movaps -0x330(%rbp), %xmm1
movlpd %xmm1, -0xa8(%rbp)
movss %xmm0, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, -0x80(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x88(%rbp)
movss -0x28(%rbp), %xmm0
movss %xmm0, -0x340(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x338(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x33c(%rbp)
callq 0x2100
movss -0x33c(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x338(%rbp), %xmm0
cvtsd2ss %xmm2, %xmm2
leaq -0xc4(%rbp), %rdi
callq 0x3290
jmp 0x258e
movss -0x340(%rbp), %xmm0
leaq -0xc4(%rbp), %rdi
callq 0x32d0
movss %xmm1, -0x354(%rbp)
movaps %xmm0, -0x350(%rbp)
jmp 0x25b3
movss -0x354(%rbp), %xmm0
movaps -0x350(%rbp), %xmm1
movlpd %xmm1, -0xd8(%rbp)
movss %xmm0, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
movl %eax, -0xb0(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0x360(%rbp)
callq 0x3340
movq -0x360(%rbp), %rdi
movl %eax, -0xdc(%rbp)
leaq -0x70(%rbp), %rsi
callq 0x3370
jmp 0x2614
leaq -0x70(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3410
movss %xmm1, -0x374(%rbp)
movaps %xmm0, -0x370(%rbp)
jmp 0x2635
movss -0x374(%rbp), %xmm0
movaps -0x370(%rbp), %xmm1
movlpd %xmm1, -0xf8(%rbp)
movss %xmm0, -0xf0(%rbp)
movl -0xf0(%rbp), %eax
movl %eax, -0xe0(%rbp)
movq -0xf8(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x33e0
jmp 0x2680
leaq -0x70(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x3410
movss %xmm1, -0x394(%rbp)
movaps %xmm0, -0x390(%rbp)
jmp 0x26a1
movss -0x394(%rbp), %xmm0
movaps -0x390(%rbp), %xmm1
movlpd %xmm1, -0x118(%rbp)
movss %xmm0, -0x110(%rbp)
movl -0x110(%rbp), %eax
movl %eax, -0x100(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x33e0
jmp 0x26ec
movl -0xdc(%rbp), %esi
movl %esi, %edx
incl %edx
movl %esi, %ecx
addl $0x2, %ecx
leaq -0x124(%rbp), %rdi
callq 0x34b0
jmp 0x2709
leaq -0x60(%rbp), %rdi
leaq -0x124(%rbp), %rsi
callq 0x3480
jmp 0x271b
jmp 0x271d
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x242c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x3229
leaq -0x140(%rbp), %rdi
callq 0x3250
movl $0x0, -0x144(%rbp)
movl -0x144(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x2c34
callq 0x2100
cvtsi2sdl -0x24(%rbp), %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x148(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14c(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x150(%rbp)
movslq -0x148(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x3500
movslq (%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x34e0
movq (%rax), %rcx
movq %rcx, -0x15c(%rbp)
movl 0x8(%rax), %eax
movl %eax, -0x154(%rbp)
movslq -0x148(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x3500
movslq 0x4(%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x34e0
movq (%rax), %rcx
movq %rcx, -0x168(%rbp)
movl 0x8(%rax), %eax
movl %eax, -0x160(%rbp)
movslq -0x148(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x3500
movslq 0x8(%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x34e0
movq (%rax), %rcx
movq %rcx, -0x174(%rbp)
movl 0x8(%rax), %eax
movl %eax, -0x16c(%rbp)
movss -0x14c(%rbp), %xmm0
addss -0x150(%rbp), %xmm0
movss 0xd7c2(%rip), %xmm1     # 0x10004
ucomiss %xmm1, %xmm0
jb 0x2877
movss 0xd7b5(%rip), %xmm0     # 0x10004
subss -0x14c(%rbp), %xmm0
movss %xmm0, -0x14c(%rbp)
movss 0xd79d(%rip), %xmm0     # 0x10004
subss -0x150(%rbp), %xmm0
movss %xmm0, -0x150(%rbp)
movss -0x14c(%rbp), %xmm0
movss %xmm0, -0x3b8(%rbp)
leaq -0x168(%rbp), %rdi
leaq -0x15c(%rbp), %rsi
callq 0x3520
movss %xmm1, -0x3b4(%rbp)
movaps %xmm0, -0x3b0(%rbp)
jmp 0x28ab
movss -0x3b8(%rbp), %xmm0
movss -0x3b4(%rbp), %xmm1
movaps -0x3b0(%rbp), %xmm2
movlpd %xmm2, -0x1c0(%rbp)
movss %xmm1, -0x1b8(%rbp)
movl -0x1b8(%rbp), %eax
movl %eax, -0x1a8(%rbp)
movq -0x1c0(%rbp), %rax
movq %rax, -0x1b0(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x32d0
movss %xmm1, -0x3d4(%rbp)
movaps %xmm0, -0x3d0(%rbp)
jmp 0x2909
movss -0x3d4(%rbp), %xmm0
movaps -0x3d0(%rbp), %xmm1
movlpd %xmm1, -0x1d0(%rbp)
movss %xmm0, -0x1c8(%rbp)
movl -0x1c8(%rbp), %eax
movl %eax, -0x198(%rbp)
movq -0x1d0(%rbp), %rax
movq %rax, -0x1a0(%rbp)
leaq -0x15c(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x3410
movss %xmm1, -0x3f4(%rbp)
movaps %xmm0, -0x3f0(%rbp)
jmp 0x2966
movss -0x3f4(%rbp), %xmm0
movaps -0x3f0(%rbp), %xmm1
movlpd %xmm1, -0x1e0(%rbp)
movss %xmm0, -0x1d8(%rbp)
movl -0x1d8(%rbp), %eax
movl %eax, -0x188(%rbp)
movq -0x1e0(%rbp), %rax
movq %rax, -0x190(%rbp)
movss -0x150(%rbp), %xmm0
movss %xmm0, -0x418(%rbp)
leaq -0x174(%rbp), %rdi
leaq -0x15c(%rbp), %rsi
callq 0x3520
movss %xmm1, -0x414(%rbp)
movaps %xmm0, -0x410(%rbp)
jmp 0x29d3
movss -0x418(%rbp), %xmm0
movss -0x414(%rbp), %xmm1
movaps -0x410(%rbp), %xmm2
movlpd %xmm2, -0x210(%rbp)
movss %xmm1, -0x208(%rbp)
movl -0x208(%rbp), %eax
movl %eax, -0x1f8(%rbp)
movq -0x210(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x32d0
movss %xmm1, -0x434(%rbp)
movaps %xmm0, -0x430(%rbp)
jmp 0x2a31
movss -0x434(%rbp), %xmm0
movaps -0x430(%rbp), %xmm1
movlpd %xmm1, -0x220(%rbp)
movss %xmm0, -0x218(%rbp)
movl -0x218(%rbp), %eax
movl %eax, -0x1e8(%rbp)
movq -0x220(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x190(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x3410
movss %xmm1, -0x454(%rbp)
movaps %xmm0, -0x450(%rbp)
jmp 0x2a8e
movss -0x454(%rbp), %xmm0
movaps -0x450(%rbp), %xmm1
movlpd %xmm1, -0x230(%rbp)
movss %xmm0, -0x228(%rbp)
movl -0x228(%rbp), %eax
movl %eax, -0x178(%rbp)
movq -0x230(%rbp), %rax
movq %rax, -0x180(%rbp)
callq 0x2100
movsd 0xd53c(%rip), %xmm1     # 0x10010
mulsd %xmm1, %xmm0
movss -0x28(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x460(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x458(%rbp)
callq 0x2100
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x45c(%rbp)
callq 0x2100
movss -0x45c(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x458(%rbp), %xmm0
cvtsd2ss %xmm2, %xmm2
leaq -0x25c(%rbp), %rdi
callq 0x3290
jmp 0x2b3d
movss -0x460(%rbp), %xmm0
leaq -0x25c(%rbp), %rdi
callq 0x32d0
movss %xmm1, -0x474(%rbp)
movaps %xmm0, -0x470(%rbp)
jmp 0x2b62
movss -0x474(%rbp), %xmm0
movaps -0x470(%rbp), %xmm1
movlpd %xmm1, -0x270(%rbp)
movss %xmm0, -0x268(%rbp)
movl -0x268(%rbp), %eax
movl %eax, -0x248(%rbp)
movq -0x270(%rbp), %rax
movq %rax, -0x250(%rbp)
leaq -0x180(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x3410
movss %xmm1, -0x494(%rbp)
movaps %xmm0, -0x490(%rbp)
jmp 0x2bbf
movss -0x494(%rbp), %xmm0
movaps -0x490(%rbp), %xmm1
movlpd %xmm1, -0x280(%rbp)
movss %xmm0, -0x278(%rbp)
movl -0x278(%rbp), %eax
movl %eax, -0x238(%rbp)
movq -0x280(%rbp), %rax
movq %rax, -0x240(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x33e0
jmp 0x2c0d
jmp 0x2c0f
movl -0x144(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x144(%rbp)
jmp 0x2752
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x321d
leaq -0x298(%rbp), %rdi
movq %rdi, -0x4a0(%rbp)
callq 0x3250
leaq -0x140(%rbp), %rdi
callq 0x3340
movq -0x4a0(%rbp), %rdi
movq %rax, %rsi
callq 0x3590
jmp 0x2c64
leaq -0x2b0(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x3620
leaq -0x140(%rbp), %rdi
callq 0x3340
movq -0x4a8(%rbp), %rdi
movq %rax, %rsi
callq 0x3640
jmp 0x2c94
leaq -0x2c8(%rbp), %rdi
movq %rdi, -0x4b0(%rbp)
callq 0x36d0
leaq -0x140(%rbp), %rdi
callq 0x3340
movq -0x4b0(%rbp), %rdi
movq %rax, %rsi
callq 0x36f0
jmp 0x2cc4
callq 0x2030
movq %rax, -0x2d0(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x4f8(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0x500(%rbp)
callq 0x34e0
movq -0x500(%rbp), %rdi
movq -0x4f8(%rbp), %rsi
movq %rax, -0x4e0(%rbp)
callq 0x34e0
movq -0x500(%rbp), %rdi
movq -0x4f8(%rbp), %rsi
addq $0x4, %rax
movq %rax, -0x4d8(%rbp)
callq 0x34e0
movq -0x4f8(%rbp), %rsi
addq $0x8, %rax
movq %rax, -0x4d0(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0x4f0(%rbp)
callq 0x3500
movq -0x4f8(%rbp), %rsi
movq -0x4f0(%rbp), %rdi
movq %rax, -0x4c8(%rbp)
callq 0x3500
movq -0x4f8(%rbp), %rsi
movq -0x4f0(%rbp), %rdi
addq $0x4, %rax
movq %rax, -0x4c0(%rbp)
callq 0x3500
movq -0x4f0(%rbp), %rdi
addq $0x8, %rax
movq %rax, -0x4e8(%rbp)
callq 0x3780
movq -0x4e8(%rbp), %rcx
movq -0x4e0(%rbp), %rdi
movq -0x4d8(%rbp), %rsi
movq -0x4d0(%rbp), %rdx
movq -0x4c8(%rbp), %r8
movq -0x4c0(%rbp), %r9
movq %rax, %r10
movq %rsp, %rax
movq %r10, 0x10(%rax)
movq %rcx, (%rax)
movq $0x3, 0x8(%rax)
movl $0x3, %ecx
callq 0x6e10
movq %rax, -0x4b8(%rbp)
jmp 0x2de6
movq -0x4b8(%rbp), %rax
movq %rax, -0x2d8(%rbp)
callq 0x2030
movq %rax, -0x2e0(%rbp)
movq -0x2d8(%rbp), %rax
movq %rax, -0x530(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x550(%rbp)
leaq -0x298(%rbp), %rdi
movq %rdi, -0x560(%rbp)
callq 0x34e0
movq -0x560(%rbp), %rdi
movq -0x550(%rbp), %rsi
movq %rax, -0x528(%rbp)
callq 0x34e0
movq -0x560(%rbp), %rdi
movq -0x550(%rbp), %rsi
addq $0x4, %rax
movq %rax, -0x520(%rbp)
callq 0x34e0
movq -0x550(%rbp), %rsi
addq $0x8, %rax
movq %rax, -0x518(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x37b0
movq -0x550(%rbp), %rsi
movq %rax, -0x510(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x37d0
movq -0x550(%rbp), %rsi
movq %rax, -0x538(%rbp)
leaq -0x140(%rbp), %rdi
movq %rdi, -0x558(%rbp)
callq 0x34e0
movq -0x558(%rbp), %rdi
movq -0x550(%rbp), %rsi
movq %rax, -0x540(%rbp)
callq 0x34e0
movq -0x558(%rbp), %rdi
movq -0x550(%rbp), %rsi
addq $0x4, %rax
movq %rax, -0x548(%rbp)
callq 0x34e0
movq -0x548(%rbp), %r11
movq -0x540(%rbp), %r10
movq -0x538(%rbp), %r8
movq -0x530(%rbp), %rdi
movq -0x528(%rbp), %rsi
movq -0x520(%rbp), %rdx
movq -0x518(%rbp), %rcx
movq -0x510(%rbp), %r9
movq %rax, %rbx
addq $0x8, %rbx
movslq -0x2c(%rbp), %r14
movq %rsp, %rax
movq %rax, -0x508(%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 0x7660
jmp 0x2f7a
callq 0x2030
movq %rax, -0x2e8(%rbp)
leaq -0x2e0(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x37f0
movq %rax, -0x568(%rbp)
jmp 0x2fa2
movq -0x568(%rbp), %rax
movq %rax, -0x2f8(%rbp)
leaq -0x2f0(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x3840
jmp 0x2fc5
leaq -0x2e8(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x37f0
movq %rax, -0x570(%rbp)
jmp 0x2fe1
movq -0x570(%rbp), %rax
movq %rax, -0x308(%rbp)
leaq -0x300(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x3840
jmp 0x3004
movq 0x14fcd(%rip), %rdi     # 0x17fd8
leaq 0xd00e(%rip), %rsi      # 0x10020
callq 0x2110
movq %rax, -0x578(%rbp)
jmp 0x3020
leaq -0x2f0(%rbp), %rdi
callq 0x3880
movsd %xmm0, -0x580(%rbp)
jmp 0x3036
movsd -0x580(%rbp), %xmm0
movq -0x578(%rbp), %rdi
callq 0x21f0
movq %rax, -0x588(%rbp)
jmp 0x3053
movq -0x588(%rbp), %rdi
leaq 0xcfd3(%rip), %rsi      # 0x10034
callq 0x2110
movq %rax, -0x590(%rbp)
jmp 0x306f
movq -0x590(%rbp), %rdi
movq 0x14f4b(%rip), %rsi     # 0x17fc8
callq 0x2140
jmp 0x3084
movq 0x14f4d(%rip), %rdi     # 0x17fd8
leaq 0xcfa4(%rip), %rsi      # 0x10036
callq 0x2110
movq %rax, -0x598(%rbp)
jmp 0x30a0
movq -0x598(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x21c0
movq %rax, -0x5a0(%rbp)
jmp 0x30b8
movq -0x5a0(%rbp), %rdi
leaq 0xcf7f(%rip), %rsi      # 0x10045
callq 0x2110
movq %rax, -0x5a8(%rbp)
jmp 0x30d4
leaq -0x300(%rbp), %rdi
callq 0x3880
movsd %xmm0, -0x5b0(%rbp)
jmp 0x30ea
movsd -0x5b0(%rbp), %xmm0
movq -0x5a8(%rbp), %rdi
callq 0x21f0
movq %rax, -0x5b8(%rbp)
jmp 0x3107
movq -0x5b8(%rbp), %rdi
leaq 0xcf1f(%rip), %rsi      # 0x10034
callq 0x2110
movq %rax, -0x5c0(%rbp)
jmp 0x3123
movq -0x5c0(%rbp), %rdi
movq 0x14e97(%rip), %rsi     # 0x17fc8
callq 0x2140
jmp 0x3138
movq 0x14e99(%rip), %rdi     # 0x17fd8
leaq 0xcf09(%rip), %rsi      # 0x1004f
callq 0x2110
movq %rax, -0x5c8(%rbp)
jmp 0x3154
leaq -0x300(%rbp), %rdi
callq 0x3880
movsd %xmm0, -0x5d0(%rbp)
jmp 0x316a
movq -0x5c8(%rbp), %rdi
movsd -0x5d0(%rbp), %xmm0
cvtsi2sdl -0x2c(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x21f0
movq %rax, -0x5d8(%rbp)
jmp 0x3190
movq -0x5d8(%rbp), %rdi
leaq 0xcebb(%rip), %rsi      # 0x10059
callq 0x2110
movq %rax, -0x5e0(%rbp)
jmp 0x31ac
movq -0x5e0(%rbp), %rdi
movq 0x14e0e(%rip), %rsi     # 0x17fc8
callq 0x2140
jmp 0x31c1
movq -0x2d8(%rbp), %rdi
callq 0x7980
jmp 0x31cf
ud2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x3211
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x3205
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x38a0
leaq -0x2b0(%rbp), %rdi
callq 0x3900
leaq -0x298(%rbp), %rdi
callq 0x3960
leaq -0x140(%rbp), %rdi
callq 0x3960
leaq -0x60(%rbp), %rdi
callq 0x39c0
leaq -0x48(%rbp), %rdi
callq 0x3960
movq -0x78(%rbp), %rdi
callq 0x21d0
nopw %cs:(%rax,%rax)
nop