// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshSearchTree.cpp
// Function: gaps::R3MeshSearchTree::FindClosest(gaps::R3Point const&, gaps::R3Vector const&, gaps::R3MeshIntersection&, double, double&, int (*)(gaps::R3Point const&, gaps::R3Vector const&, gaps::R3Mesh*, gaps::R3MeshFace*, void*), void*, gaps::R3MeshFace*) const
void R3MeshSearchTree::
FindClosest(const R3Point& query_position, const R3Vector& query_normal, R3MeshIntersection& closest, 
  RNScalar min_distance_squared, RNScalar& max_distance_squared, 
  int (*IsCompatible)(const R3Point&, const R3Vector&, R3Mesh *, R3MeshFace *, void *), void *compatible_data,
  R3MeshFace *face) const
{
  // 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)) {
      closest.type = R3_MESH_FACE_TYPE;
      closest.face = face;
      closest.point = p;
      max_distance_squared = distance_squared;
    }
  }
  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
    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) {
        closest.type = R3_MESH_FACE_TYPE;
        closest.face = face;
        closest.point = plane_point;
        max_distance_squared = plane_distance_squared;
        if (b0 < b1) closest.edge = (b0 < b2) ? mesh->EdgeOnFace(face, 0) : mesh->EdgeOnFace(face, 2);
        else closest.edge = (b1 < b2) ? mesh->EdgeOnFace(face, 1) : mesh->EdgeOnFace(face, 2);
      }
    }
    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)) {
              closest.type = R3_MESH_VERTEX_TYPE;
              closest.vertex = v0;
              closest.point = p0;
              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)) {
              closest.type = R3_MESH_VERTEX_TYPE;
              closest.vertex = v1;
              closest.point = p1;
              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)) {
              closest.type = R3_MESH_EDGE_TYPE;
              closest.edge = mesh->EdgeOnFace(face, 0);
              closest.point = point;
              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)) {
              closest.type = R3_MESH_VERTEX_TYPE;
              closest.vertex = v1;
              closest.point = p1;
              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)) {
              closest.type = R3_MESH_VERTEX_TYPE;
              closest.vertex = v2;
              closest.point = p2;
              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)) {
              closest.type = R3_MESH_EDGE_TYPE;
              closest.edge = mesh->EdgeOnFace(face, 1);
              closest.point = point;
              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)) {
              closest.type = R3_MESH_VERTEX_TYPE;
              closest.vertex = v2;
              closest.point = p2;
              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)) {
              closest.type = R3_MESH_VERTEX_TYPE;
              closest.vertex = v0;
              closest.point = p0;
              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)) {
              closest.type = R3_MESH_EDGE_TYPE;
              closest.edge = mesh->EdgeOnFace(face, 2);
              closest.point = point;
              max_distance_squared = distance_squared;
            }
          }
        }
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %r9, %r15
movq %r8, 0x8(%rsp)
movsd %xmm0, 0x10(%rsp)
movq %rcx, 0x20(%rsp)
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %rbp
movq 0x218(%rsp), %rsi
movq (%rdi), %rdi
movq %rsi, %r14
callq 0x1375e
movq %rax, %r13
movq %rax, %rdi
movq %rax, %rsi
callq 0x4961a
leaq 0xceaa5(%rip), %rax     # 0xe3bc8
movsd (%rax), %xmm1
movapd 0x84f41(%rip), %xmm2    # 0x9a070
xorpd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jb 0x151ed
ucomisd %xmm0, %xmm1
jb 0x151ed
movq (%rbp), %rsi
leaq 0xe8(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x210ae
movsd (%r12), %xmm0
movsd 0x8(%r12), %xmm1
subsd (%rbx), %xmm0
subsd 0x8(%rbx), %xmm1
movsd 0x10(%r12), %xmm2
subsd 0x10(%rbx), %xmm2
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
ucomisd 0x10(%rsp), %xmm2
jb 0x15aa2
movq 0x8(%rsp), %rax
movsd (%rax), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x15aa2
movq 0x20(%rsp), %rdi
movl $0x3, (%rdi)
movq %r14, 0x18(%rdi)
addq $0x20, %rdi
leaq 0xe8(%rsp), %rsi
movsd %xmm2, 0x10(%rsp)
callq 0x48eca
movq 0x8(%rsp), %rax
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x15aa2
movq (%rbp), %rdi
movq %r14, %rsi
callq 0x1375e
movq %rax, %rdi
movq %r12, %rsi
callq 0x1e3ec
movsd %xmm0, 0x18(%rsp)
mulsd %xmm0, %xmm0
movq 0x8(%rsp), %rax
movsd %xmm0, 0x28(%rsp)
ucomisd (%rax), %xmm0
jae 0x15aa2
movq (%rbp), %rdi
movq %r14, %rsi
callq 0x2286c
movq 0x8(%rsp), %rcx
movsd (%rcx), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %r12, %rsi
movq %rax, %rdx
callq 0x15ae6
ucomisd 0x40(%rsp), %xmm0
jae 0x15aa2
testq %r15, %r15
je 0x1527a
movq 0x210(%rsp), %r8
movq (%rbp), %rdx
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq *%r15
testl %eax, %eax
je 0x15aa2
movq 0x8(%r14), %rax
movq 0x10(%r14), %rdx
movq 0x18(%r14), %rcx
movq %rax, 0x58(%rsp)
addq $0x18, %rax
movq %rax, 0x40(%rsp)
movq %rdx, 0x48(%rsp)
leaq 0x18(%rdx), %r15
movq %rcx, 0x50(%rsp)
leaq 0x18(%rcx), %rax
movq %rax, 0x98(%rsp)
leaq 0xe8(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
movsd 0x18(%rsp), %xmm0
callq 0x49a96
leaq 0x80(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x49331
leaq 0x180(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq 0x40(%rsp), %r13
movq %r13, %rdx
callq 0x48dbd
movq %rbx, %rdi
callq 0x496a2
movq (%rbp), %rdi
movq %r14, %rsi
callq 0x1375e
leaq 0x120(%rsp), %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x49a52
leaq 0xe8(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x120(%rsp), %rdx
callq 0x47840
movq %rbx, %rdi
leaq 0x80(%rsp), %rsi
callq 0x1e3ec
movsd %xmm0, 0x60(%rsp)
leaq 0x168(%rsp), %rbx
movq %rbx, %rdi
movq 0x98(%rsp), %r13
movq %r13, %rsi
movq %r15, %rdx
callq 0x48dbd
movq %rbx, %rdi
callq 0x496a2
movq (%rbp), %rdi
movq %r14, %rsi
callq 0x1375e
leaq 0x108(%rsp), %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x49a52
leaq 0x1b8(%rsp), %rbx
movq %rbx, %rdi
movq %r15, 0x38(%rsp)
movq %r15, %rsi
leaq 0x108(%rsp), %rdx
callq 0x47840
movq %rbx, %rdi
leaq 0x80(%rsp), %rsi
callq 0x1e3ec
movsd %xmm0, 0x18(%rsp)
leaq 0x150(%rsp), %rbx
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
movq %r13, %rdx
callq 0x48dbd
movq %rbx, %rdi
callq 0x496a2
movq (%rbp), %rdi
movq %r13, %rbp
movq %r14, %rsi
callq 0x1375e
leaq 0x138(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x49a52
leaq 0x198(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x47840
movq %rbx, %rdi
leaq 0x80(%rsp), %rsi
callq 0x1e3ec
movsd 0x60(%rsp), %xmm4
movsd 0x18(%rsp), %xmm3
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm4
jb 0x154da
ucomisd %xmm2, %xmm3
jb 0x154da
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x154da
movsd 0x28(%rsp), %xmm1
ucomisd 0x10(%rsp), %xmm1
jb 0x15aa2
movsd %xmm0, 0x30(%rsp)
movq 0x20(%rsp), %rbx
movl $0x3, (%rbx)
movq %r14, 0x18(%rbx)
leaq 0x20(%rbx), %rdi
leaq 0x80(%rsp), %rsi
callq 0x48eca
movsd 0x60(%rsp), %xmm2
movsd 0x18(%rsp), %xmm1
movq 0x8(%rsp), %rax
movsd 0x28(%rsp), %xmm0
movsd %xmm0, (%rax)
xorl %eax, %eax
ucomisd %xmm2, %xmm1
jbe 0x15636
movsd 0x30(%rsp), %xmm0
ucomisd %xmm2, %xmm0
setbe %al
shll $0x4, %eax
movq 0x20(%r14,%rax), %rax
jmp 0x15648
ucomisd %xmm4, %xmm2
movq 0x40(%rsp), %r14
movq 0x38(%rsp), %r15
movsd %xmm0, 0x30(%rsp)
jbe 0x15701
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x48dbd
movq %rbx, %rdi
callq 0x494a6
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x156f5
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
movsd %xmm0, 0x28(%rsp)
callq 0x49c9e
leaq 0xd0(%rsp), %r15
leaq 0x80(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x48dbd
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4961a
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x15651
ucomisd 0x28(%rsp), %xmm0
jae 0x15699
leaq 0xb8(%rsp), %rbx
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x49a96
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x48ea7
movsd (%r12), %xmm0
movsd 0x8(%r12), %xmm1
subsd (%r15), %xmm0
subsd 0x8(%r15), %xmm1
movsd 0x10(%r12), %xmm2
subsd 0x10(%r15), %xmm2
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
ucomisd 0x10(%rsp), %xmm2
jb 0x1562c
movq 0x8(%rsp), %rax
movsd (%rax), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x1562c
movq 0x20(%rsp), %rcx
movl $0x2, (%rcx)
movq 0x218(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x10(%rcx)
leaq 0x20(%rcx), %rdi
leaq 0xa0(%rsp), %rsi
movsd %xmm2, 0x28(%rsp)
callq 0x48eca
movq 0x8(%rsp), %rax
movsd 0x28(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x38(%rsp), %r15
jmp 0x156f5
movsd 0x30(%rsp), %xmm0
ucomisd %xmm1, %xmm0
setbe %al
movq 0x28(%r14,%rax,8), %rax
movq %rax, 0x10(%rbx)
jmp 0x15aa2
movq %r12, %rsi
movq %r14, %rdx
callq 0x15ab4
ucomisd 0x10(%rsp), %xmm0
movq 0x38(%rsp), %r15
jb 0x156f5
movq 0x8(%rsp), %rax
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x156f5
movq 0x20(%rsp), %rax
movl $0x1, (%rax)
movq 0x58(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x20(%rax), %rdi
movq %r14, %rsi
jmp 0x156db
movq %r12, %rsi
movq 0x38(%rsp), %r15
movq %r15, %rdx
callq 0x15ab4
ucomisd 0x10(%rsp), %xmm0
jb 0x156f5
movq 0x8(%rsp), %rax
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x156f5
movq 0x20(%rsp), %rax
movl $0x1, (%rax)
movq 0x48(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x20(%rax), %rdi
movq %r15, %rsi
movsd %xmm0, 0x28(%rsp)
callq 0x48eca
movq 0x8(%rsp), %rax
movsd 0x28(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x30(%rsp), %xmm0
movsd 0x18(%rsp), %xmm3
xorpd %xmm1, %xmm1
ucomisd %xmm3, %xmm1
jbe 0x158e6
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x48dbd
movq %rbx, %rdi
callq 0x494a6
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x158e0
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
movsd %xmm0, 0x18(%rsp)
callq 0x49c9e
leaq 0xd0(%rsp), %r13
leaq 0x80(%rsp), %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0x48dbd
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4961a
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x15842
ucomisd 0x18(%rsp), %xmm0
jae 0x15885
leaq 0xb8(%rsp), %rbx
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x49a96
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
movq 0x38(%rsp), %rsi
movq %rbx, %rdx
callq 0x48ea7
movsd (%r12), %xmm0
movsd 0x8(%r12), %xmm1
subsd (%r15), %xmm0
subsd 0x8(%r15), %xmm1
movsd 0x10(%r12), %xmm2
subsd 0x10(%r15), %xmm2
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
ucomisd 0x10(%rsp), %xmm2
jb 0x158dc
movq 0x8(%rsp), %rax
movsd (%rax), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x158dc
movq 0x20(%rsp), %rcx
movl $0x2, (%rcx)
movq 0x218(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x10(%rcx)
leaq 0x20(%rcx), %rdi
leaq 0xa0(%rsp), %rsi
movsd %xmm2, 0x18(%rsp)
jmp 0x158c8
movq %r12, %rsi
movq %r15, %rdx
callq 0x15ab4
ucomisd 0x10(%rsp), %xmm0
jb 0x158dc
movq 0x8(%rsp), %rax
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x158dc
movq 0x20(%rsp), %rax
movl $0x1, (%rax)
movq 0x48(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x20(%rax), %rdi
movq %r15, %rsi
jmp 0x158c2
movq %r12, %rsi
movq %rbp, %rdx
callq 0x15ab4
ucomisd 0x10(%rsp), %xmm0
jb 0x158dc
movq 0x8(%rsp), %rax
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x158dc
movq 0x20(%rsp), %rax
movl $0x1, (%rax)
movq 0x50(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x20(%rax), %rdi
movq %rbp, %rsi
movsd %xmm0, 0x18(%rsp)
callq 0x48eca
movq 0x8(%rsp), %rax
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rax)
xorpd %xmm1, %xmm1
movsd 0x30(%rsp), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x15aa2
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x48dbd
movq %rbx, %rdi
callq 0x494a6
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x15aa2
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
movsd %xmm0, 0x18(%rsp)
callq 0x49c9e
leaq 0xd0(%rsp), %r15
leaq 0x80(%rsp), %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x48dbd
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4961a
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x15a1b
ucomisd 0x18(%rsp), %xmm0
jae 0x15a5a
leaq 0xb8(%rsp), %rbx
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x49a96
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x48ea7
movsd (%r12), %xmm0
movsd 0x8(%r12), %xmm1
subsd (%r15), %xmm0
subsd 0x8(%r15), %xmm1
movsd 0x10(%r12), %xmm2
subsd 0x10(%r15), %xmm2
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
ucomisd 0x10(%rsp), %xmm2
jb 0x15aa2
movq 0x8(%rsp), %rax
movsd (%rax), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x15aa2
movq 0x20(%rsp), %rdi
movl $0x2, (%rdi)
movq 0x218(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x10(%rdi)
addq $0x20, %rdi
leaq 0xa0(%rsp), %rsi
jmp 0x151ce
movq %r12, %rsi
movq %rbp, %rdx
callq 0x15ab4
ucomisd 0x10(%rsp), %xmm0
jb 0x15aa2
movq 0x8(%rsp), %rax
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x15aa2
movq 0x20(%rsp), %rdi
movl $0x1, (%rdi)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rdi)
addq $0x20, %rdi
movq %rbp, %rsi
jmp 0x15a97
movq %r12, %rsi
movq %r14, %rdx
callq 0x15ab4
ucomisd 0x10(%rsp), %xmm0
jb 0x15aa2
movq 0x8(%rsp), %rax
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x15aa2
movq 0x20(%rsp), %rdi
movl $0x1, (%rdi)
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rdi)
addq $0x20, %rdi
movq %r14, %rsi
movsd %xmm0, 0x10(%rsp)
jmp 0x151d4
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq