// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshSearchTree.cpp
// Function: gaps::R3MeshSearchTree::FindAll(gaps::R3Point const&, gaps::R3Vector const&, gaps::RNArray<gaps::R3MeshIntersection*>&, double, double, int (*)(gaps::R3Point const&, gaps::R3Vector const&, gaps::R3Mesh*, gaps::R3MeshFace*, void*), void*, gaps::R3MeshFace*) const
void R3MeshSearchTree::
FindAll(const R3Point& query_position, const R3Vector& query_normal, RNArray<R3MeshIntersection *>& hits, 
  RNScalar min_distance_squared, RNScalar max_distance_squared, 
  int (*IsCompatible)(const R3Point&, const R3Vector&, R3Mesh *, R3MeshFace *, void *), void *compatible_data,
  R3MeshFace *face) const
{
  // Initialize hit info
  R3MeshIntersection hit;
  hit.type = R3_MESH_NULL_TYPE;

  // Check face normal
  const R3Vector& face_normal = mesh->FaceNormal(face);
  if (RNIsZero(face_normal.Dot(face_normal))) {
    // Face is degenerate -- assume centroid is closest point on face
    R3Point p = mesh->FaceCentroid(face);
    RNScalar distance_squared = DistanceSquared(query_position, p);
    if ((distance_squared >= min_distance_squared) && (distance_squared < max_distance_squared)) {
      hit.type = R3_MESH_FACE_TYPE;
      hit.face = face;
      hit.point = p;
    }
  }
  else {  
    // Check distance to plane
    const R3Plane& plane = mesh->FacePlane(face);
    RNScalar plane_signed_distance = R3SignedDistance(plane, query_position);
    RNScalar plane_distance_squared = plane_signed_distance * plane_signed_distance;
    if (plane_distance_squared >= max_distance_squared) return;

    // Check distance to bounding box
    RNScalar bbox_distance_squared = DistanceSquared(query_position, mesh->FaceBBox(face), max_distance_squared);
    if (bbox_distance_squared >= max_distance_squared) return;

    // Check compatibility 
    if (IsCompatible) {
      if (!(*IsCompatible)(query_position, query_normal, mesh, face, compatible_data)) return;
    }

    // Get face vertices
    R3MeshVertex *v0 = mesh->VertexOnFace(face, 0);
    R3MeshVertex *v1 = mesh->VertexOnFace(face, 1);
    R3MeshVertex *v2 = mesh->VertexOnFace(face, 2);

    // Get vertex positions
    const R3Point& p0 = mesh->VertexPosition(v0);
    const R3Point& p1 = mesh->VertexPosition(v1);
    const R3Point& p2 = mesh->VertexPosition(v2);

    // Project query point onto face plane
    const R3Vector& face_normal = mesh->FaceNormal(face);
    R3Point plane_point = query_position - plane_signed_distance * face_normal;

    // Check sides of edges
    R3Vector e0 = p1 - p0;
    e0.Normalize();
    R3Vector n0 = mesh->FaceNormal(face) % e0;
    R3Plane s0(p0, n0);
    RNScalar b0 = R3SignedDistance(s0, plane_point);
    R3Vector e1 = p2 - p1;
    e1.Normalize();
    R3Vector n1 = mesh->FaceNormal(face) % e1;
    R3Plane s1(p1, n1);
    RNScalar b1 = R3SignedDistance(s1, plane_point);
    R3Vector e2 = p0 - p2;
    e2.Normalize();
    R3Vector n2 = mesh->FaceNormal(face) % e2;
    R3Plane s2(p2, n2);
    RNScalar b2 = R3SignedDistance(s2, plane_point);

    // Consider plane_point's position in relation to edges of the triangle
    if ((b0 >= 0) && (b1 >= 0) && (b2 >= 0)) {
      // Point is inside face
      if (plane_distance_squared >= min_distance_squared) {
        hit.type = R3_MESH_FACE_TYPE;
        hit.vertex = NULL;
        hit.edge = NULL;
        hit.face = face;
        hit.point = plane_point;
        hit.t = sqrt(plane_distance_squared);
      }
    }
    else {
      // Point is outside face -- check each edge
      if (b0 < 0) {
        // Outside edge0
        R3Vector edge_vector = p1 - p0;
        RNScalar edge_length = edge_vector.Length();
        if (edge_length > 0) {
          edge_vector /= edge_length;
          R3Vector point_vector = plane_point - p0;
          RNScalar t = edge_vector.Dot(point_vector);
          if (t <= 0) {
            RNScalar distance_squared = DistanceSquared(query_position, p0);
            if ((distance_squared >= min_distance_squared) && (distance_squared < max_distance_squared)) {
              hit.type = R3_MESH_VERTEX_TYPE;
              hit.vertex = v0;
              hit.edge = mesh->EdgeOnVertex(hit.vertex, face);
              hit.face = face;
              hit.point = p0;
              hit.t = sqrt(distance_squared);
              max_distance_squared = distance_squared;
            }
          }
          else if (t >= edge_length) {
            RNScalar distance_squared = DistanceSquared(query_position, p1);
            if ((distance_squared >= min_distance_squared) && (distance_squared < max_distance_squared)) {
              hit.type = R3_MESH_VERTEX_TYPE;
              hit.vertex = v1;
              hit.edge = mesh->EdgeOnVertex(hit.vertex, face);
              hit.face = face;
              hit.point = p1;
              hit.t = sqrt(distance_squared);
              max_distance_squared = distance_squared;
            }
          }
          else {
            R3Point point = p0 + t * edge_vector;
            RNScalar distance_squared = DistanceSquared(query_position, point);
            if ((distance_squared >= min_distance_squared) && (distance_squared < max_distance_squared)) {
              hit.type = R3_MESH_EDGE_TYPE;
              hit.vertex = NULL;
              hit.edge = mesh->EdgeOnFace(face, 0);
              hit.face = face;
              hit.point = point;
              hit.t = sqrt(distance_squared);
              max_distance_squared = distance_squared;
            }
          }
        }
      }
      if (b1 < 0) {
        // Outside edge1
        R3Vector edge_vector = p2 - p1;
        RNScalar edge_length = edge_vector.Length();
        if (edge_length > 0) {
          edge_vector /= edge_length;
          R3Vector point_vector = plane_point - p1;
          RNScalar t = edge_vector.Dot(point_vector);
          if (t <= 0) {
            RNScalar distance_squared = DistanceSquared(query_position, p1);
            if ((distance_squared >= min_distance_squared) && (distance_squared < max_distance_squared)) {
              hit.type = R3_MESH_VERTEX_TYPE;
              hit.vertex = v1;
              hit.edge = mesh->EdgeOnVertex(hit.vertex, face);
              hit.face = face;
              hit.point = p1;
              hit.t = sqrt(distance_squared);
              max_distance_squared = distance_squared;
            }
          }
          else if (t >= edge_length) {
            RNScalar distance_squared = DistanceSquared(query_position, p2);
            if ((distance_squared >= min_distance_squared) && (distance_squared < max_distance_squared)) {
              hit.type = R3_MESH_VERTEX_TYPE;
              hit.vertex = v2;
              hit.edge = mesh->EdgeOnVertex(hit.vertex, face);
              hit.face = face;
              hit.point = p2;
              hit.t = sqrt(distance_squared);
              max_distance_squared = distance_squared;
            }
          }
          else {
            R3Point point = p1 + t * edge_vector;
            RNScalar distance_squared = DistanceSquared(query_position, point);
            if ((distance_squared >= min_distance_squared) && (distance_squared < max_distance_squared)) {
              hit.type = R3_MESH_EDGE_TYPE;
              hit.vertex = NULL;
              hit.edge = mesh->EdgeOnFace(face, 1);
              hit.face = face;
              hit.point = point;
              hit.t = sqrt(distance_squared);
              max_distance_squared = distance_squared;
            }
          }
        }
      }
      if (b2 < 0) {
        // Outside edge2
        R3Vector edge_vector = p0 - p2;
        RNScalar edge_length = edge_vector.Length();
        if (edge_length > 0) {
          edge_vector /= edge_length;
          R3Vector point_vector = plane_point - p2;
          RNScalar t = edge_vector.Dot(point_vector);
          if (t <= 0) {
            RNScalar distance_squared = DistanceSquared(query_position, p2);
            if ((distance_squared >= min_distance_squared) && (distance_squared < max_distance_squared)) {
              hit.type = R3_MESH_VERTEX_TYPE;
              hit.vertex = v2;
              hit.edge = mesh->EdgeOnVertex(hit.vertex, face);
              hit.face = face;
              hit.point = p2;
              hit.t = sqrt(distance_squared);
              max_distance_squared = distance_squared;
            }
          }
          else if (t >= edge_length) {
            RNScalar distance_squared = DistanceSquared(query_position, p0);
            if ((distance_squared >= min_distance_squared) && (distance_squared < max_distance_squared)) {
              hit.type = R3_MESH_VERTEX_TYPE;
              hit.vertex = v0;
              hit.edge = mesh->EdgeOnVertex(hit.vertex, face);
              hit.face = face;
              hit.point = p0;
              hit.t = sqrt(distance_squared);
              max_distance_squared = distance_squared;
            }
          }
          else {
            R3Point point = p2 + t * edge_vector;
            RNScalar distance_squared = DistanceSquared(query_position, point);
            if ((distance_squared >= min_distance_squared) && (distance_squared < max_distance_squared)) {
              hit.type = R3_MESH_EDGE_TYPE;
              hit.vertex = NULL;
              hit.edge = mesh->EdgeOnFace(face, 2);
              hit.face = face;
              hit.point = point;
              hit.t = sqrt(distance_squared);
              max_distance_squared = distance_squared;
            }
          }
        }
      }
    }
  }
  
  // Insert hit
  if (hit.type != R3_MESH_NULL_TYPE) {
    hits.Insert(new R3MeshIntersection(hit));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %r9, 0x18(%rsp)
movq %r8, %rbp
movsd %xmm1, (%rsp)
movsd %xmm0, 0x10(%rsp)
movq %rcx, 0xd8(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
movq 0x250(%rsp), %r12
leaq 0x40(%rsp), %r15
movq %r15, %rdi
callq 0x48bde
andl $0x0, -0x20(%r15)
movq (%rbx), %rdi
movq %r12, %rsi
callq 0x1375e
movq %rax, %rdi
movq %rax, %rsi
callq 0x4961a
leaq 0xcda34(%rip), %rax     # 0xe3bc8
movsd (%rax), %xmm1
movapd 0x83ed0(%rip), %xmm2    # 0x9a070
xorpd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jb 0x16279
ucomisd %xmm0, %xmm1
jb 0x16279
movq (%rbx), %rsi
leaq 0x128(%rsp), %rbx
movq %rbx, %rdi
movq 0x250(%rsp), %rdx
callq 0x210ae
movsd (%r13), %xmm1
movsd 0x8(%r13), %xmm2
subsd (%rbx), %xmm1
subsd 0x8(%rbx), %xmm2
movsd 0x10(%r13), %xmm0
subsd 0x10(%rbx), %xmm0
mulsd %xmm2, %xmm2
mulsd %xmm1, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x10(%rsp), %xmm0
jb 0x16241
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x16241
movl $0x3, 0x20(%rsp)
movq 0x250(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x128(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x48eca
cmpl $0x0, 0x20(%rsp)
je 0x16560
pushq $0x40
popq %rdi
callq 0xe450
movq %rax, %rbx
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x17ad8
movq 0xd8(%rsp), %rdi
movq %rbx, %rsi
callq 0x1378a
jmp 0x16560
movq (%rbx), %rdi
movq 0x250(%rsp), %rsi
callq 0x1375e
movq %rax, %rdi
movq %rbx, %r12
movq %r13, %rsi
callq 0x1e3ec
movsd %xmm0, 0x70(%rsp)
mulsd %xmm0, %xmm0
movsd %xmm0, 0xa0(%rsp)
ucomisd (%rsp), %xmm0
jae 0x16560
movq (%r12), %rdi
movq 0x250(%rsp), %rsi
callq 0x2286c
movq %r13, %rsi
movq %rax, %rdx
movsd (%rsp), %xmm0
callq 0x15ae6
ucomisd (%rsp), %xmm0
jae 0x16560
testq %rbp, %rbp
je 0x16307
movq (%r12), %rdx
movq %r13, %rdi
movq %r14, %rsi
movq 0x250(%rsp), %rcx
movq 0x18(%rsp), %r8
callq *%rbp
testl %eax, %eax
je 0x16560
movq 0x250(%rsp), %rsi
movq 0x8(%rsi), %rax
movq 0x10(%rsi), %rdx
movq 0x18(%rsi), %rcx
movq %r13, %r14
movq %rax, 0x88(%rsp)
leaq 0x18(%rax), %r13
movq %rdx, 0x78(%rsp)
leaq 0x18(%rdx), %r15
movq %rcx, 0x80(%rsp)
leaq 0x18(%rcx), %rbp
movq (%r12), %rdi
callq 0x1375e
leaq 0x128(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
movsd 0x70(%rsp), %xmm0
callq 0x49a96
leaq 0xc0(%rsp), %rdi
movq %r14, 0x90(%rsp)
movq %r14, %rsi
movq %rbx, %rdx
callq 0x49331
leaq 0x1c0(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x48dbd
movq %rbx, %rdi
callq 0x496a2
movq (%r12), %rdi
movq 0x250(%rsp), %rsi
callq 0x1375e
leaq 0x1a8(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x49a52
leaq 0x128(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x47840
movq %rbx, %rdi
leaq 0xc0(%rsp), %rsi
callq 0x1e3ec
movsd %xmm0, 0x70(%rsp)
leaq 0x190(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x48dbd
movq %rbx, %rdi
callq 0x496a2
movq (%r12), %rdi
movq 0x250(%rsp), %rsi
callq 0x1375e
leaq 0x178(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x49a52
leaq 0x1f8(%rsp), %rbx
movq %rbx, %rdi
movq %r15, 0x60(%rsp)
movq %r15, %rsi
movq %r14, %rdx
callq 0x47840
movq %rbx, %rdi
leaq 0xc0(%rsp), %r15
movq %r15, %rsi
callq 0x1e3ec
movsd %xmm0, 0x18(%rsp)
leaq 0x160(%rsp), %rbx
movq %rbx, %rdi
movq %r13, 0x98(%rsp)
movq %r13, %rsi
movq %rbp, %rdx
callq 0x48dbd
movq %rbx, %rdi
callq 0x496a2
movq %r12, 0x68(%rsp)
movq (%r12), %rdi
movq %rbp, %r12
movq 0x250(%rsp), %rsi
callq 0x1375e
leaq 0x148(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x49a52
leaq 0x1d8(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x47840
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1e3ec
movsd 0x70(%rsp), %xmm3
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm3
jb 0x16572
movsd 0x18(%rsp), %xmm1
ucomisd %xmm2, %xmm1
jb 0x16572
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x16572
movsd 0xa0(%rsp), %xmm0
ucomisd 0x10(%rsp), %xmm0
jb 0x16241
movl $0x3, 0x20(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x28(%rsp)
movq 0x250(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0xc0(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x48eca
sqrtsd 0xa0(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
jmp 0x16241
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
ucomisd %xmm3, %xmm2
movsd %xmm0, 0x8(%rsp)
jbe 0x166ed
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movq 0x60(%rsp), %r15
movq %r15, %rsi
movq 0x98(%rsp), %rbp
movq %rbp, %rdx
callq 0x48dbd
movq %rbx, %rdi
callq 0x494a6
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movq 0x90(%rsp), %r13
jbe 0x16832
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movsd %xmm0, 0x70(%rsp)
callq 0x49c9e
leaq 0x110(%rsp), %r14
leaq 0xc0(%rsp), %rsi
movq %r14, %rdi
movq %rbp, %rdx
callq 0x48dbd
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4961a
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x16707
ucomisd 0x70(%rsp), %xmm0
jae 0x1678b
leaq 0xf8(%rsp), %rbx
leaq 0xa8(%rsp), %rsi
movq %rbx, %rdi
callq 0x49a96
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x48ea7
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
subsd (%r14), %xmm0
subsd 0x8(%r14), %xmm1
movsd 0x10(%r13), %xmm2
subsd 0x10(%r14), %xmm2
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
ucomisd 0x10(%rsp), %xmm2
jb 0x16780
movsd (%rsp), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x16780
movl $0x2, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
movq 0x250(%rsp), %rcx
movq 0x20(%rcx), %rax
movq %rax, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
leaq 0xe0(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movsd %xmm2, (%rsp)
callq 0x48eca
movsd (%rsp), %xmm1
sqrtsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movsd %xmm1, (%rsp)
jmp 0x16780
movq 0x98(%rsp), %rbp
movq 0x90(%rsp), %r13
movq 0x60(%rsp), %r15
jmp 0x16838
movq %r13, %rsi
movq %rbp, %rdx
callq 0x15ab4
ucomisd 0x10(%rsp), %xmm0
jb 0x16780
movapd %xmm0, %xmm1
movsd (%rsp), %xmm0
ucomisd %xmm1, %xmm0
movsd 0x8(%rsp), %xmm0
movq 0x60(%rsp), %r15
jbe 0x16838
movl $0x1, 0x20(%rsp)
movq 0x88(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
movq 0x250(%rsp), %rbx
movq %rbx, %rdx
xorl %ecx, %ecx
movsd %xmm1, (%rsp)
callq 0x229c8
movq %rax, 0x30(%rsp)
movq %rbx, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
movq %rbp, %rsi
jmp 0x167ff
movsd 0x8(%rsp), %xmm0
jmp 0x166fd
movq %r13, %rsi
movq 0x60(%rsp), %r15
movq %r15, %rdx
callq 0x15ab4
ucomisd 0x10(%rsp), %xmm0
jb 0x16832
movapd %xmm0, %xmm1
movsd (%rsp), %xmm0
ucomisd %xmm1, %xmm0
movsd 0x8(%rsp), %xmm0
jbe 0x16838
movl $0x1, 0x20(%rsp)
movq 0x78(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
movq 0x250(%rsp), %rbx
movq %rbx, %rdx
xorl %ecx, %ecx
movsd %xmm1, (%rsp)
callq 0x229c8
movq %rax, 0x30(%rsp)
movq %rbx, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x48eca
movsd (%rsp), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0x16819
sqrtsd %xmm1, %xmm0
jmp 0x16827
movapd %xmm1, %xmm0
callq 0xe350
movsd (%rsp), %xmm1
movsd %xmm0, 0x58(%rsp)
movsd %xmm1, (%rsp)
movsd 0x8(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd 0x18(%rsp), %xmm1
jbe 0x16acc
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x48dbd
movq %rbx, %rdi
callq 0x494a6
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x16991
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movsd %xmm0, 0x18(%rsp)
callq 0x49c9e
leaq 0x110(%rsp), %r14
leaq 0xc0(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x48dbd
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4961a
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x1699c
ucomisd 0x18(%rsp), %xmm0
jae 0x16a15
leaq 0xf8(%rsp), %rbx
leaq 0xa8(%rsp), %rsi
movq %rbx, %rdi
callq 0x49a96
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
movq 0x60(%rsp), %rsi
movq %rbx, %rdx
callq 0x48ea7
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
subsd (%r14), %xmm0
subsd 0x8(%r14), %xmm1
movsd 0x10(%r13), %xmm2
subsd 0x10(%r14), %xmm2
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
ucomisd 0x10(%rsp), %xmm2
jb 0x16ac2
movsd (%rsp), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x16ac2
movl $0x2, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
movq 0x250(%rsp), %rcx
movq 0x28(%rcx), %rax
movq %rax, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
leaq 0xe0(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movsd %xmm2, (%rsp)
callq 0x48eca
movsd (%rsp), %xmm1
jmp 0x16aa3
movsd 0x8(%rsp), %xmm0
jmp 0x16acc
movq %r13, %rsi
movq %r15, %rdx
callq 0x15ab4
ucomisd 0x10(%rsp), %xmm0
jb 0x16ac2
movapd %xmm0, %xmm2
movsd (%rsp), %xmm0
ucomisd %xmm2, %xmm0
movsd 0x8(%rsp), %xmm0
xorpd %xmm1, %xmm1
jbe 0x16acc
movl $0x1, 0x20(%rsp)
movq 0x78(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
movq 0x250(%rsp), %rbx
movq %rbx, %rdx
xorl %ecx, %ecx
movsd %xmm2, (%rsp)
callq 0x229c8
movq %rax, 0x30(%rsp)
movq %rbx, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
jmp 0x16a8f
movq %r13, %rsi
movq %r12, %rdx
callq 0x15ab4
ucomisd 0x10(%rsp), %xmm0
jb 0x16ac2
movapd %xmm0, %xmm2
movsd (%rsp), %xmm0
ucomisd %xmm2, %xmm0
movsd 0x8(%rsp), %xmm0
xorpd %xmm1, %xmm1
jbe 0x16acc
movl $0x1, 0x20(%rsp)
movq 0x80(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
movq 0x250(%rsp), %rbx
movq %rbx, %rdx
xorl %ecx, %ecx
movsd %xmm2, (%rsp)
callq 0x229c8
movq %rax, 0x30(%rsp)
movq %rbx, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
callq 0x48eca
movsd (%rsp), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0x16aa9
sqrtsd %xmm1, %xmm0
jmp 0x16ab7
movapd %xmm1, %xmm0
callq 0xe350
movsd (%rsp), %xmm1
movsd %xmm0, 0x58(%rsp)
movsd %xmm1, (%rsp)
movsd 0x8(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x16241
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x48dbd
movq %rbx, %rdi
callq 0x494a6
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x16241
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movsd %xmm0, 0x18(%rsp)
callq 0x49c9e
leaq 0x110(%rsp), %r14
leaq 0xc0(%rsp), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x48dbd
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4961a
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x16c1d
ucomisd 0x18(%rsp), %xmm0
jae 0x16c8f
leaq 0xf8(%rsp), %rbx
leaq 0xa8(%rsp), %rsi
movq %rbx, %rdi
callq 0x49a96
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x48ea7
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
subsd (%r14), %xmm0
subsd 0x8(%r14), %xmm1
movsd 0x10(%r13), %xmm2
subsd 0x10(%r14), %xmm2
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
ucomisd 0x10(%rsp), %xmm2
jb 0x16241
movsd (%rsp), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x16241
movl $0x2, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
movq 0x250(%rsp), %rcx
movq 0x30(%rcx), %rax
movq %rax, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
leaq 0xe0(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movsd %xmm2, (%rsp)
callq 0x48eca
sqrtsd (%rsp), %xmm0
jmp 0x16555
movq %r13, %rsi
movq %r12, %rdx
callq 0x15ab4
ucomisd 0x10(%rsp), %xmm0
jb 0x16241
movapd %xmm0, %xmm1
movsd (%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x16241
movl $0x1, 0x20(%rsp)
movq 0x80(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
movq 0x250(%rsp), %rbx
movq %rbx, %rdx
xorl %ecx, %ecx
movsd %xmm1, (%rsp)
callq 0x229c8
movq %rax, 0x30(%rsp)
movq %rbx, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
jmp 0x16cff
movq %r13, %rsi
movq %rbp, %rdx
callq 0x15ab4
ucomisd 0x10(%rsp), %xmm0
jb 0x16241
movapd %xmm0, %xmm1
movsd (%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x16241
movl $0x1, 0x20(%rsp)
movq 0x88(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
movq 0x250(%rsp), %rbx
movq %rbx, %rdx
xorl %ecx, %ecx
movsd %xmm1, (%rsp)
callq 0x229c8
movq %rax, 0x30(%rsp)
movq %rbx, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x48eca
movsd (%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x16d1c
sqrtsd %xmm0, %xmm0
jmp 0x16555
callq 0xe350
jmp 0x16555
movq %rax, %r14
pushq $0x40
popq %rsi
movq %rbx, %rdi
callq 0xe460
movq %r14, %rdi
callq 0xe820