// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movq %r8, %rbx
movsd %xmm1, (%rsp)
movsd %xmm0, 0x20(%rsp)
movq %rcx, 0xd8(%rsp)
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, 0x8(%rsp)
movq 0x250(%rsp), %r12
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
callq 0x4fd3c
movl $0x0, -0x20(%rbp)
movq %r12, %rbp
testb $0x4, 0xa8(%r12)
jne 0x17831
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %rbp, %rsi
callq *0x2c8(%rax)
movq %rbp, %r12
addq $0x38, %rbp
movq %rbp, %rdi
movq %rbp, %rsi
callq 0x50a5e
leaq 0xd835e(%rip), %rax     # 0xefba8
movsd (%rax), %xmm1
movapd 0x927da(%rip), %xmm2    # 0xaa030
xorpd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jb 0x1794b
ucomisd %xmm0, %xmm1
jb 0x1794b
movq 0x8(%rsp), %rax
movq (%rax), %rsi
leaq 0x128(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rdx
callq 0x23bb2
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 0x20(%rsp), %xmm0
jb 0x178ef
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x178ef
movl $0x3, 0x30(%rsp)
movq %r12, 0x48(%rsp)
leaq 0x128(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x500a6
cmpl $0x0, 0x30(%rsp)
je 0x17c97
movl $0x40, %edi
callq 0xe440
movq %rax, %rbx
movups 0x30(%rsp), %xmm0
movupd 0x40(%rsp), %xmm1
movups %xmm0, (%rax)
movupd %xmm1, 0x10(%rax)
leaq 0x20(%rax), %rdi
leaq 0x50(%rsp), %rsi
callq 0x4fd4e
movsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x38(%rbx)
movq 0xd8(%rsp), %rdi
movl 0xc(%rdi), %edx
movq %rbx, %rsi
callq 0x7769e
jmp 0x17c97
testb $0x4, 0xa8(%r12)
jne 0x1796a
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x2c8(%rax)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2094b
movsd %xmm0, 0x10(%rsp)
mulsd %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
ucomisd (%rsp), %xmm0
jae 0x17c97
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq %r12, %rsi
callq 0x2574a
movq %r13, %rsi
movq %rax, %rdx
movsd (%rsp), %xmm0
callq 0x17134
ucomisd (%rsp), %xmm0
jae 0x17c97
testq %rbx, %rbx
je 0x179de
movq 0x8(%rsp), %rax
movq (%rax), %rdx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rcx
movq %r14, %r8
callq *%rbx
testl %eax, %eax
je 0x17c97
movq %r12, %r15
movq 0x8(%r12), %rax
movq 0x10(%r12), %rdx
movq 0x18(%r12), %rcx
movq %rcx, 0x70(%rsp)
movq %rax, 0x88(%rsp)
leaq 0x18(%rax), %r14
movq %rdx, 0x80(%rsp)
leaq 0x18(%rdx), %rax
movq %rax, 0x78(%rsp)
testb $0x4, 0xa8(%r12)
jne 0x17a31
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x2c8(%rax)
movq 0x70(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x90(%rsp)
leaq 0x128(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movsd 0x10(%rsp), %xmm0
callq 0x5116e
leaq 0xb8(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x5075f
leaq 0x178(%rsp), %rbx
movq %rbx, %rdi
movq 0x78(%rsp), %rsi
movq %r14, 0x10(%rsp)
movq %r14, %rdx
callq 0x4ff9a
movq %rbx, %rdi
callq 0x50ae8
testb $0x4, 0xa8(%r15)
jne 0x17ab1
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x2c8(%rax)
leaq 0x1c0(%rsp), %rbx
leaq 0x178(%rsp), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x51106
leaq 0x128(%rsp), %r14
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x4e8be
leaq 0xb8(%rsp), %rsi
movq %r14, %rdi
callq 0x2094b
movsd %xmm0, 0xd0(%rsp)
leaq 0x160(%rsp), %rbx
movq %rbx, %rdi
movq 0x90(%rsp), %rsi
movq 0x78(%rsp), %rdx
callq 0x4ff9a
movq %rbx, %rdi
callq 0x50ae8
testb $0x4, 0xa8(%r15)
jne 0x17b40
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x2c8(%rax)
leaq 0x1a8(%rsp), %rbx
leaq 0x160(%rsp), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x51106
leaq 0x1f8(%rsp), %r14
movq %r14, %rdi
movq 0x78(%rsp), %rsi
movq %rbx, %rdx
callq 0x4e8be
leaq 0xb8(%rsp), %rsi
movq %r14, %rdi
callq 0x2094b
movsd %xmm0, 0x98(%rsp)
leaq 0x148(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq 0x90(%rsp), %rdx
callq 0x4ff9a
movq %rbx, %rdi
callq 0x50ae8
testb $0x4, 0xa8(%r15)
jne 0x17bcf
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x2c8(%rax)
leaq 0x190(%rsp), %rbx
leaq 0x148(%rsp), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x51106
leaq 0x1d8(%rsp), %r14
movq %r14, %rdi
movq 0x90(%rsp), %rbp
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x4e8be
leaq 0xb8(%rsp), %rsi
movq %r14, %rdi
callq 0x2094b
movapd %xmm0, %xmm2
xorpd %xmm0, %xmm0
movsd 0xd0(%rsp), %xmm3
ucomisd %xmm0, %xmm3
jb 0x17ca9
movsd 0x98(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x17ca9
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm2
jb 0x17ca9
movsd 0x28(%rsp), %xmm0
ucomisd 0x20(%rsp), %xmm0
jb 0x178ef
movl $0x3, 0x30(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x38(%rsp)
movq %r12, 0x48(%rsp)
leaq 0xb8(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x500a6
xorps %xmm0, %xmm0
sqrtsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x68(%rsp)
jmp 0x178ef
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
ucomisd %xmm3, %xmm0
movq %r12, %r15
movsd %xmm2, 0x18(%rsp)
jbe 0x17e1c
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
movq 0x78(%rsp), %r12
movq %r12, %rsi
movq 0x10(%rsp), %r14
movq %r14, %rdx
callq 0x4ff9a
movq %rbx, %rdi
callq 0x508d8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x17e14
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
movsd %xmm0, 0x28(%rsp)
callq 0x513a4
movq %r14, %rdx
leaq 0x110(%rsp), %r14
leaq 0xb8(%rsp), %rsi
movq %r14, %rdi
callq 0x4ff9a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x50a5e
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x17f9d
ucomisd 0x28(%rsp), %xmm0
jae 0x180e9
leaq 0xf8(%rsp), %rbx
leaq 0xa0(%rsp), %rsi
movq %rbx, %rdi
callq 0x5116e
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x50083
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 0x20(%rsp), %xmm2
jb 0x17e0f
movsd (%rsp), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x17e0f
movl $0x2, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x20(%r15), %rax
movq %rax, 0x40(%rsp)
movq %r15, 0x48(%rsp)
leaq 0xe0(%rsp), %rsi
leaq 0x50(%rsp), %rdi
movsd %xmm2, (%rsp)
callq 0x500a6
movsd (%rsp), %xmm1
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movsd %xmm1, (%rsp)
movq 0x10(%rsp), %r14
movsd 0x18(%rsp), %xmm2
jmp 0x17e26
movq 0x10(%rsp), %r14
movq 0x78(%rsp), %r12
xorpd %xmm1, %xmm1
ucomisd 0x98(%rsp), %xmm1
jbe 0x18288
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x4ff9a
movq %rbx, %rdi
callq 0x508d8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x17f92
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
movsd %xmm0, 0x28(%rsp)
callq 0x513a4
leaq 0x110(%rsp), %r14
leaq 0xb8(%rsp), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x4ff9a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x50a5e
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x18043
ucomisd 0x28(%rsp), %xmm0
jae 0x181b1
leaq 0xf8(%rsp), %rbx
leaq 0xa0(%rsp), %rsi
movq %rbx, %rdi
callq 0x5116e
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x50083
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 0x20(%rsp), %xmm2
jb 0x18279
movsd (%rsp), %xmm0
ucomisd %xmm2, %xmm0
movq 0x10(%rsp), %r14
jbe 0x1827e
movl $0x2, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x28(%r15), %rax
movq %rax, 0x40(%rsp)
movq %r15, 0x48(%rsp)
leaq 0xe0(%rsp), %rsi
leaq 0x50(%rsp), %rdi
movsd %xmm2, (%rsp)
callq 0x500a6
movsd (%rsp), %xmm1
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movsd %xmm1, (%rsp)
jmp 0x1827e
movsd 0x18(%rsp), %xmm2
jmp 0x18288
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
movq 0x88(%rsp), %rax
subsd 0x18(%rax), %xmm0
subsd 0x20(%rax), %xmm1
movsd 0x10(%r13), %xmm3
subsd 0x28(%rax), %xmm3
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm3, %xmm3
addsd %xmm0, %xmm3
ucomisd 0x20(%rsp), %xmm3
movsd 0x18(%rsp), %xmm2
jb 0x18268
movsd (%rsp), %xmm0
ucomisd %xmm3, %xmm0
movq 0x10(%rsp), %r14
jbe 0x17e26
movl $0x1, 0x30(%rsp)
movq 0x88(%rsp), %rsi
movq %rsi, 0x38(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq %r15, %rdx
xorl %ecx, %ecx
movsd %xmm3, (%rsp)
callq 0x258b8
movq %rax, 0x40(%rsp)
movq %r15, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
jmp 0x1818a
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
movq 0x80(%rsp), %rax
subsd 0x18(%rax), %xmm0
subsd 0x20(%rax), %xmm1
movsd 0x10(%r13), %xmm3
subsd 0x28(%rax), %xmm3
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm3, %xmm3
addsd %xmm0, %xmm3
ucomisd 0x20(%rsp), %xmm3
movsd 0x18(%rsp), %xmm2
jb 0x18272
movsd (%rsp), %xmm0
ucomisd %xmm3, %xmm0
movq 0x10(%rsp), %r14
jbe 0x18284
movl $0x1, 0x30(%rsp)
movq 0x80(%rsp), %rsi
movq %rsi, 0x38(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq %r15, %rdx
xorl %ecx, %ecx
movsd %xmm3, (%rsp)
callq 0x258b8
movq %rax, 0x40(%rsp)
movq %r15, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
jmp 0x18244
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
movq 0x80(%rsp), %rax
subsd 0x18(%rax), %xmm0
subsd 0x20(%rax), %xmm1
movsd 0x10(%r13), %xmm3
subsd 0x28(%rax), %xmm3
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm3, %xmm3
addsd %xmm0, %xmm3
ucomisd 0x20(%rsp), %xmm3
movsd 0x18(%rsp), %xmm2
jb 0x18268
movsd (%rsp), %xmm0
ucomisd %xmm3, %xmm0
movq 0x10(%rsp), %r14
jbe 0x17e26
movl $0x1, 0x30(%rsp)
movq 0x80(%rsp), %rsi
movq %rsi, 0x38(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq %r15, %rdx
xorl %ecx, %ecx
movsd %xmm3, (%rsp)
callq 0x258b8
movq %rax, 0x40(%rsp)
movq %r15, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x500a6
movsd 0x18(%rsp), %xmm2
movsd (%rsp), %xmm1
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movsd %xmm1, (%rsp)
jmp 0x17e26
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
movq 0x70(%rsp), %rax
subsd 0x18(%rax), %xmm0
subsd 0x20(%rax), %xmm1
movsd 0x10(%r13), %xmm3
subsd 0x28(%rax), %xmm3
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm3, %xmm3
addsd %xmm0, %xmm3
ucomisd 0x20(%rsp), %xmm3
movsd 0x18(%rsp), %xmm2
jb 0x18272
movsd (%rsp), %xmm0
ucomisd %xmm3, %xmm0
movq 0x10(%rsp), %r14
jbe 0x18284
movl $0x1, 0x30(%rsp)
movq 0x70(%rsp), %rsi
movq %rsi, 0x38(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq %r15, %rdx
xorl %ecx, %ecx
movsd %xmm3, (%rsp)
callq 0x258b8
movq %rax, 0x40(%rsp)
movq %r15, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
movq %rbp, %rsi
callq 0x500a6
movsd 0x18(%rsp), %xmm2
movsd (%rsp), %xmm1
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movsd %xmm1, (%rsp)
jmp 0x18284
movq 0x10(%rsp), %r14
jmp 0x17e26
movq 0x10(%rsp), %r14
jmp 0x18284
movq 0x10(%rsp), %r14
movsd 0x18(%rsp), %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm1
jbe 0x178ef
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x4ff9a
movq %rbx, %rdi
callq 0x508d8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x178ef
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
movsd %xmm0, 0x28(%rsp)
callq 0x513a4
leaq 0x110(%rsp), %r14
leaq 0xb8(%rsp), %rsi
movq %r14, %rdi
movq %rbp, %rdx
callq 0x4ff9a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x50a5e
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x183cb
ucomisd 0x28(%rsp), %xmm0
jae 0x18461
leaq 0xf8(%rsp), %rbx
leaq 0xa0(%rsp), %rsi
movq %rbx, %rdi
callq 0x5116e
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x50083
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 0x20(%rsp), %xmm2
jb 0x178ef
movsd (%rsp), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x178ef
movl $0x2, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x30(%r15), %rax
movq %rax, 0x40(%rsp)
movq %r15, 0x48(%rsp)
leaq 0xe0(%rsp), %rsi
leaq 0x50(%rsp), %rdi
movsd %xmm2, 0x8(%rsp)
jmp 0x184fa
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
movq 0x70(%rsp), %rax
subsd 0x18(%rax), %xmm0
subsd 0x20(%rax), %xmm1
movsd 0x10(%r13), %xmm2
subsd 0x28(%rax), %xmm2
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
ucomisd 0x20(%rsp), %xmm2
jb 0x178ef
movsd (%rsp), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x178ef
movl $0x1, 0x30(%rsp)
movq 0x70(%rsp), %rsi
movq %rsi, 0x38(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq %r15, %rdx
xorl %ecx, %ecx
movsd %xmm2, 0x8(%rsp)
callq 0x258b8
movq %rax, 0x40(%rsp)
movq %r15, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
movq %rbp, %rsi
jmp 0x184fa
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
movq 0x88(%rsp), %rax
subsd 0x18(%rax), %xmm0
subsd 0x20(%rax), %xmm1
movsd 0x10(%r13), %xmm2
subsd 0x28(%rax), %xmm2
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
ucomisd 0x20(%rsp), %xmm2
jb 0x178ef
movsd (%rsp), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x178ef
movl $0x1, 0x30(%rsp)
movq 0x88(%rsp), %rsi
movq %rsi, 0x38(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq %r15, %rdx
xorl %ecx, %ecx
movsd %xmm2, 0x8(%rsp)
callq 0x258b8
movq %rax, 0x40(%rsp)
movq %r15, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x500a6
xorps %xmm0, %xmm0
sqrtsd 0x8(%rsp), %xmm0
jmp 0x17c8c
movq %rax, %r14
movl $0x40, %esi
movq %rbx, %rdi
callq 0xe450
movq %r14, %rdi
callq 0xe7f0
nop