LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Ray const&, gaps::R3Rectangle const&, gaps::R3Point*, gaps::R3Vector*, double*)
RNClassID R3Intersects(const R3Point& point, const R3Halfspace& halfspace)
{
    // Check whether halfspace contains point
    if (R3Contains(halfspace, point)) {
	// Point lies in halfspace
	return R3_POINT_CLASS_ID;
    }
    else {
	// Point does not lie in halfspace
	return RN_NULL_CLASS_ID;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movsd 0x68(%rsi), %xmm0
minsd 0x70(%rsi), %xmm0
xorl %ebp, %ebp
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x3e519
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r13
movq %r8, (%rsp)
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
callq 0x37b4a
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x40d34
leaq 0x8(%rsp), %rcx
movq %r13, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x3dc32
movl %eax, %ebp
movl %eax, %eax
leaq 0x5bad2(%rip), %rcx     # 0x99f6c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x41d9f
testl %eax, %eax
je 0x3e517
testq %r12, %r12
je 0x3e4c6
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x37e36
testq %r14, %r14
je 0x3e4da
addq $0x50, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x3887c
pushq $0x1
popq %rbp
movq (%rsp), %rax
testq %rax, %rax
je 0x3e519
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x3e519
leaq 0x5baae(%rip), %rdi     # 0x99fa7
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x680f0
leaq 0x5ba88(%rip), %rdi     # 0x99f91
xorl %eax, %eax
callq 0x680f0
jmp 0x3e519
pushq $0x4
popq %rbp
jmp 0x3e519
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Ray const&, gaps::R3OrientedBox const&, gaps::R3Point*, gaps::R3Vector*, double*)
RNClassID R3Intersects(const R3Ray& ray, const R3OrientedBox& box, 
    R3Point *hit_point1, R3Vector *hit_normal1, RNScalar *hit_t1)
{
    // Check if box is empty
    if (box.IsEmpty()) return RN_NULL_CLASS_ID;

    // Transform ray into std coordinate system
    R3Ray transformed_ray = ray;
    R3Affine cs_to_std_xform(box.CoordSystem().InverseMatrix());
    transformed_ray.Transform(cs_to_std_xform);

    // Intersect in std coordinate system
    R3Box axis_aligned_box(-box.Radius(0), -box.Radius(1), -box.Radius(2), box.Radius(0), box.Radius(1), box.Radius(2));
    int status = R3Intersects(transformed_ray, axis_aligned_box, hit_point1, hit_normal1, hit_t1);
    if (status == RN_NULL_CLASS_ID) return RN_NULL_CLASS_ID;

    // Compute hit point
    if (hit_point1 || hit_normal1) {
      R3Affine std_to_cs_xform(box.CoordSystem().Matrix());
      if (hit_point1) hit_point1->Transform(std_to_cs_xform);
      if (hit_normal1) hit_normal1->Transform(std_to_cs_xform);
    }

    // Return whether hit
    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
movq %r8, %r15
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
movq %rsi, %rdi
callq 0x22b76
xorl %ebp, %ebp
testl %eax, %eax
jne 0x3e66d
movq %rbx, 0x8(%rsp)
leaq 0x48(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0x37758
leaq 0x8(%r13), %rsi
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movq %rsi, (%rsp)
callq 0x27e20
leaq 0x208(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x276a0
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x37812
movsd 0x68(%r13), %xmm3
movsd 0x70(%r13), %xmm4
movaps 0x54a77(%rip), %xmm2    # 0x93030
movaps %xmm3, %xmm0
xorps %xmm2, %xmm0
movaps %xmm4, %xmm1
xorps %xmm2, %xmm1
movsd 0x78(%r13), %xmm5
xorps %xmm5, %xmm2
leaq 0x10(%rsp), %rdi
callq 0x24bde
movq 0x8(%rsp), %rbx
leaq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r15, %r8
callq 0x3dfb5
movl %eax, %ebp
testl %eax, %eax
je 0x3e656
movq %r14, %rax
orq %rbx, %rax
je 0x3e656
leaq 0x188(%rsp), %rdi
movq (%rsp), %rsi
callq 0x27dbc
leaq 0x78(%rsp), %rdi
leaq 0x188(%rsp), %rsi
xorl %edx, %edx
callq 0x276a0
testq %r14, %r14
je 0x3e63a
leaq 0x78(%rsp), %rsi
movq %r14, %rdi
callq 0x38192
testq %rbx, %rbx
je 0x3e64c
leaq 0x78(%rsp), %rsi
movq %rbx, %rdi
callq 0x38bb8
leaq 0x78(%rsp), %rdi
callq 0x276ee
leaq 0x10(%rsp), %rdi
callq 0x25832
leaq 0x208(%rsp), %rdi
callq 0x276ee
movl %ebp, %eax
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x276ee
jmp 0x3e695
jmp 0x3e692
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x25832
jmp 0x3e6a6
jmp 0x3e6a3
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0x276ee
movq %rbx, %rdi
callq 0xe810
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Ray const&, gaps::R3Frustum const&, gaps::R3Point*, gaps::R3Vector*, double*)
RNClassID R3Intersects(const R3Ray& ray, const R3Frustum& frustum,
    R3Point *hit_point, R3Vector *hit_normal, RNScalar *hit_t)
{
    // Check if frustum contains ray start
    if (R3Contains(frustum, ray.Start())) {
       if (hit_point) *hit_point = ray.Start();
       if (hit_normal) *hit_normal = R3zero_vector;
       if (hit_t) *hit_t = 0;
    }
  
    // Not implemented
    RNAbort("Not implemented");
    return RN_NULL_CLASS_ID;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r12
movq %rsi, %rdi
movq %r12, %rsi
callq 0x42f3c
testl %eax, %eax
je 0x3f3f9
testq %r15, %r15
je 0x3f3dc
movq %r15, %rdi
movq %r12, %rsi
callq 0x37e36
testq %r14, %r14
je 0x3f3f0
leaq 0x5a2a8(%rip), %rsi     # 0x99690
movq %r14, %rdi
callq 0x3887c
testq %rbx, %rbx
je 0x3f3f9
andq $0x0, (%rbx)
leaq 0x53ed2(%rip), %rdi     # 0x932d2
xorl %eax, %eax
callq 0x680f0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Span const&, gaps::R3Span const&, gaps::R3Point*, double*, double*)
RNClassID R3Intersects(const R3Span& span1, const R3Span& span2, 
    R3Point *hit_point, RNScalar *hit_t1, RNScalar *hit_t2)
{
    // Intersect span1 with span2's ray
    RNScalar s1, s2;
    switch (R3Intersects(span1, span2.Ray(), hit_point, &s1, &s2)) {
    case RN_NULL_CLASS_ID:
	// Spans do not intersect
	return RN_NULL_CLASS_ID;

    case R3_SPAN_CLASS_ID:
	// Span1 lies on span2's ray -- check if they overlap ???
	if ((R3Contains(span2, span1.Start())) || (R3Contains(span2, span1.End()))) {
	    // Spans are on same line, and overlap
	    return R3_SPAN_CLASS_ID;
	}
	else {
	    // Spans are on same line, but do not overlap
	    return RN_NULL_CLASS_ID;
	}
	break;

    case R3_POINT_CLASS_ID: 
	// Check if intersection point is on span
	if (RNIsGreater(s1, span1.Length())) {
	    // Span's ray intersects plane beyond span endpoint
	    return RN_NULL_CLASS_ID;
	}
	else {
	    // Span and plane intersect at point
	    if (hit_t1) *hit_t1 = s1;
	    if (hit_t2) *hit_t2 = s2;
	    return R3_POINT_CLASS_ID;
	}
	break;

    default:
	RNAbort("Illegal intersection");
	break;
    }

    // Should never get here
    RNAbort("Should never get here");
    return RN_NULL_CLASS_ID;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %r14
movq %rcx, %r13
movq %rsi, %r12
movq %rdi, %r15
movq %rsp, %rcx
leaq 0x8(%rsp), %r8
movq %rsi, %rdi
movq %r15, %rsi
callq 0x3db43
movl %eax, %ebx
testl %eax, %eax
je 0x3f4f6
cmpl $0x1, %ebx
je 0x3f47f
cmpl $0x4, %ebx
jne 0x3f4bd
movq %r12, %rdi
movq %r15, %rsi
callq 0x4141d
testl %eax, %eax
je 0x3f4dd
pushq $0x4
popq %rbx
jmp 0x3f4f6
movsd 0x8(%rsp), %xmm0
leaq 0x9b71c(%rip), %rax     # 0xdaba8
movapd %xmm0, %xmm1
subsd 0x48(%r15), %xmm1
xorl %ebx, %ebx
ucomisd (%rax), %xmm1
ja 0x3f4f6
testq %r13, %r13
je 0x3f4a9
movsd %xmm0, (%r13)
pushq $0x1
popq %rbx
testq %r14, %r14
je 0x3f4f6
movsd (%rsp), %xmm0
movsd %xmm0, (%r14)
jmp 0x3f4f6
leaq 0x5aab8(%rip), %rdi     # 0x99f7c
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x680f0
leaq 0x5aabd(%rip), %rdi     # 0x99f91
xorl %eax, %eax
callq 0x680f0
jmp 0x3f4f6
addq $0x30, %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x4141d
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
shll $0x2, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Span const&, gaps::R3Halfspace const&, gaps::R3Point*, double*)
RNClassID R3Intersects(const R3Span& span, const R3Halfspace& halfspace, 
    R3Point *hit_point, RNScalar *hit_t)
{
    // Intersect halfspace with span's ray
    RNScalar s;
    switch (R3Intersects(halfspace, span.Ray(), hit_point, &s)) {
    case RN_NULL_CLASS_ID:
	// Span and halfspace do not intersect
	return RN_NULL_CLASS_ID;

    case R3_RAY_CLASS_ID:
    case R3_SPAN_CLASS_ID:
	// Halfspace contains span
	return R3_SPAN_CLASS_ID;

    case R3_POINT_CLASS_ID: 
	// Check if intersection point is on span
	if (RNIsGreater(s, span.Length())) {
	    // Span's ray intersects halfspace beyond span endpoint
	    return RN_NULL_CLASS_ID;
	}
	else {
	    // Span and halfspace intersect at point
	    if (hit_t) *hit_t = s;
	    return R3_POINT_CLASS_ID;
	}
	break;

    default:
	RNAbort("Illegal intersection");
	break;
    }

    // Should never get here
    RNAbort("Should never get here");
    return RN_NULL_CLASS_ID;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %rcx
callq 0x3dd20
movl %eax, %ebx
leal -0x3(%rbx), %eax
cmpl $0x2, %eax
jb 0x3f869
testl %ebx, %ebx
je 0x3f88c
cmpl $0x1, %ebx
jne 0x3f86e
movsd 0x8(%rsp), %xmm0
leaq 0x9b360(%rip), %rax     # 0xdaba8
movapd %xmm0, %xmm1
subsd 0x48(%r15), %xmm1
xorl %ebx, %ebx
ucomisd (%rax), %xmm1
ja 0x3f88c
pushq $0x1
popq %rbx
testq %r14, %r14
je 0x3f88c
movsd %xmm0, (%r14)
jmp 0x3f88c
pushq $0x4
popq %rbx
jmp 0x3f88c
leaq 0x5a707(%rip), %rdi     # 0x99f7c
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x680f0
leaq 0x5a70c(%rip), %rdi     # 0x99f91
xorl %eax, %eax
callq 0x680f0
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Span const&, gaps::R3Frustum const&, gaps::R3Point*, double*)
RNClassID R3Intersects(const R3Span& span, const R3Frustum& frustum, 
    R3Point *hit_point, RNScalar *hit_t)
{
  // Clip by each halfspace
  R3Span result = span;
  for (int dir = 0; dir < 2; dir++) {
    for (int dim = 0; dim < 3; dim++) {
      if (!result.Clip(frustum.Halfspace(dir, dim).Plane())) {
        return RN_NULL_CLASS_ID;
      }
    }
  }

  // Passed all tests
  if (hit_point) *hit_point = result.Start();
  if (hit_t) *hit_t = span.T(result.Start());
  return R3_SPAN_CLASS_ID;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, (%rsp)
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x36f48
addq $0x68, %r12
xorl %ebp, %ebp
cmpq $0x2, %rbp
je 0x3f90e
xorl %esi, %esi
leaq 0x20(%rsi), %rbx
cmpq $0x80, %rbx
je 0x3f8f2
addq %r12, %rsi
movq %r13, %rdi
callq 0x374d6
movq %rbx, %rsi
testl %eax, %eax
jne 0x3f8d1
jmp 0x3f8fb
incq %rbp
addq $0x60, %r12
jmp 0x3f8c9
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r15, %r15
je 0x3f920
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x37e36
pushq $0x4
popq %rbp
movq (%rsp), %rbx
testq %rbx, %rbx
je 0x3f8fd
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x37276
movsd %xmm0, (%rbx)
jmp 0x3f8fd
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Span const&, gaps::R3Shape const&, gaps::R3Point*, double*)
RNClassID R3Intersects(const R3Span& span, const R3Shape& shape, 
    R3Point *hit_point, RNScalar *hit_t)
{
    // Intersect shape with span's ray
    RNScalar s;
    switch (R3Intersects(shape, span.Ray(), hit_point, NULL, &s)) {
    case RN_NULL_CLASS_ID:
	// Span and shape do not intersect
	return RN_NULL_CLASS_ID;

    case R3_RAY_CLASS_ID:
    case R3_SPAN_CLASS_ID:
	// Shape contains span
	return R3_SPAN_CLASS_ID;

    case R3_POINT_CLASS_ID: 
	// Check if intersection point is on span
	if (RNIsGreater(s, span.Length())) {
	    // Span's ray intersects shape beyond span endpoint
	    return RN_NULL_CLASS_ID;
	}
	else {
	    // Span and shape intersect at point
	    if (hit_t) *hit_t = s;
	    return R3_POINT_CLASS_ID;
	}
	break;

    default:
	RNAbort("Illegal intersection");
	break;
    }

    // Should never get here
    RNAbort("Should never get here");
    return RN_NULL_CLASS_ID;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdi, %r15
movq (%rsi), %rax
leaq 0x8(%rsp), %r8
movq %rsi, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq *0x1d8(%rax)
movl %eax, %ebx
leal -0x3(%rbx), %eax
cmpl $0x2, %eax
jb 0x3f9a5
testl %ebx, %ebx
je 0x3f9c8
cmpl $0x1, %ebx
jne 0x3f9aa
movsd 0x8(%rsp), %xmm0
leaq 0x9b224(%rip), %rax     # 0xdaba8
movapd %xmm0, %xmm1
subsd 0x48(%r15), %xmm1
xorl %ebx, %ebx
ucomisd (%rax), %xmm1
ja 0x3f9c8
pushq $0x1
popq %rbx
testq %r14, %r14
je 0x3f9c8
movsd %xmm0, (%r14)
jmp 0x3f9c8
pushq $0x4
popq %rbx
jmp 0x3f9c8
leaq 0x5a5cb(%rip), %rdi     # 0x99f7c
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x680f0
leaq 0x5a5d0(%rip), %rdi     # 0x99f91
xorl %eax, %eax
callq 0x680f0
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Plane const&, gaps::R3Plane const&, gaps::R3Line*)
RNClassID R3Intersects(const R3Plane& plane1, const R3Plane& plane2, 
    R3Line *result)
{
    // Check if planes are parallel
    if (R3Parallel(plane1, plane2)) {
	// Planes are parallel - check if planes are equal
	if (RNIsEqual(plane1.D(), plane2.D())) {
	    // Planes are coincident
	    return R3_PLANE_CLASS_ID;
	}
	else {
	    // Planes are parallel, but not coincident
	    return RN_NULL_CLASS_ID;
	}
    }
    else {
	// Planes are not parallel -- they must intersect
	if (result) {
	    // Compute direction vector of intersection line
	    R3Vector v = plane1.Normal();
	    v.Cross(plane2.Normal());

	    // Find v's largest dimension
	    RNDimension dim = v.MaxDimension();
	    RNDimension dim1 = (dim+1) % 3;
	    RNDimension dim2 = (dim+2) % 3;
	    assert(RNIsNotZero(v[dim]));

	    // Solve for point on zero plane of v's largest dimension
	    R3Point p;
	    p[dim] = 0.0;
	    p[dim1] = (plane1[dim2] * plane2.D() - plane2[dim2] * plane1.D()) / v[dim];
	    p[dim2] = (plane2[dim1] * plane1.D() - plane1[dim1] * plane2.D()) / v[dim];
	    *result = R3Line(p, v);
	}

	// Planes intersect in a line
	return R3_LINE_CLASS_ID;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0x453cf
testl %eax, %eax
je 0x3fa32
movsd 0x18(%r12), %xmm0
leaq 0x9b1a6(%rip), %rax     # 0xdaba8
movsd (%rax), %xmm1
subsd 0x18(%r15), %xmm0
movapd 0x5361c(%rip), %xmm2    # 0x93030
xorpd %xmm1, %xmm2
xorl %eax, %eax
ucomisd %xmm0, %xmm1
setae %al
xorl %ecx, %ecx
ucomisd %xmm2, %xmm0
leal (%rax,%rax,4), %ebx
cmovbl %ecx, %ebx
jmp 0x3fb09
pushq $0x2
popq %rbx
testq %r14, %r14
je 0x3fb09
leaq 0x20(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x3831c
movq %r13, %rdi
movq %r15, %rsi
callq 0x38680
movq %r13, %rdi
callq 0x38490
movl %eax, %r13d
leal 0x1(%r13), %eax
pushq $0x3
popq %rcx
cltd
idivl %ecx
movl %edx, 0x4(%rsp)
leal 0x2(%r13), %eax
cltd
idivl %ecx
movl %edx, %ebp
leaq 0x8(%rsp), %rdi
callq 0x37b4a
movslq %r13d, %rax
andq $0x0, 0x8(%rsp,%rax,8)
movslq %ebp, %rcx
movsd 0x18(%r15), %xmm0
movsd 0x18(%r12), %xmm1
movsd (%r15,%rcx,8), %xmm2
mulsd %xmm1, %xmm2
movsd (%r12,%rcx,8), %xmm3
mulsd %xmm0, %xmm3
subsd %xmm2, %xmm3
movsd 0x20(%rsp,%rax,8), %xmm2
divsd %xmm2, %xmm3
movslq 0x4(%rsp), %rax
movsd %xmm3, 0x8(%rsp,%rax,8)
mulsd (%r12,%rax,8), %xmm0
mulsd (%r15,%rax,8), %xmm1
subsd %xmm0, %xmm1
divsd %xmm2, %xmm1
movsd %xmm1, 0x8(%rsp,%rcx,8)
leaq 0x38(%rsp), %r15
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
leaq 0x20(%rsp), %rdx
xorl %ecx, %ecx
callq 0x37866
movq %r14, %rdi
movq %r15, %rsi
callq 0x22b4c
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Plane const&, gaps::R3Plane const&, gaps::R3Plane const&, gaps::R3Point*)
RNClassID R3Intersects(const R3Plane& plane1, const R3Plane& plane2, const R3Plane& plane3, 
    R3Point *hit_point)
{
    // From Graphics Gems I, page 305
    RNScalar denom = R4MatrixDet3(plane1.Normal().X(), plane2.Normal().X(), plane3.Normal().X(), 
				  plane1.Normal().Y(), plane2.Normal().Y(), plane3.Normal().Y(), 
				  plane1.Normal().Z(), plane2.Normal().Z(), plane3.Normal().Z());

    // Check for any two parallel planes 
    if (RNIsZero(denom)) {
	// Check for case of all planes coincident
	if (R3Contains(plane1, plane2) && R3Contains(plane1, plane3)) return R3_PLANE_CLASS_ID;
	else return RN_NULL_CLASS_ID;
    }

    // Compute unique intersection point
    if (hit_point) {
	*hit_point = R3zero_point;
	*hit_point += (plane2.Normal() % plane3.Normal()) * -(plane1.D());
	*hit_point += (plane3.Normal() % plane1.Normal()) * -(plane2.D());
	*hit_point += (plane1.Normal() % plane2.Normal()) * -(plane3.D());
	*hit_point /= denom;
    }

    // Return intersection type
    return R3_POINT_CLASS_ID;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movsd (%rdi), %xmm0
movsd 0x8(%rdi), %xmm3
movsd (%rsi), %xmm1
movsd 0x8(%rsi), %xmm4
movsd (%rdx), %xmm2
movsd 0x8(%rdx), %xmm5
movsd 0x10(%rdi), %xmm6
movsd 0x10(%rsi), %xmm7
movsd 0x10(%rdx), %xmm8
movsd %xmm8, (%rsp)
callq 0x2a47f
leaq 0x9b037(%rip), %rax     # 0xdaba8
movsd (%rax), %xmm2
movapd 0x534b3(%rip), %xmm1    # 0x93030
xorpd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x3fbbb
ucomisd %xmm0, %xmm2
jb 0x3fbbb
movq %r15, %rdi
movq %r12, %rsi
callq 0x416b4
testl %eax, %eax
je 0x3fc9c
movq %r15, %rdi
movq %r14, %rsi
callq 0x416b4
testl %eax, %eax
je 0x3fc9c
pushq $0x5
popq %rbp
jmp 0x3fc9e
pushq $0x1
popq %rbp
testq %rbx, %rbx
je 0x3fc9e
leaq 0x49bea2(%rip), %rsi    # 0x4dba70
movq %rbx, %rdi
movsd %xmm0, 0x10(%rsp)
callq 0x37e36
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x389be
movsd 0x18(%r15), %xmm0
xorps 0x53437(%rip), %xmm0    # 0x93030
leaq 0x30(%rsp), %r13
movq %r13, %rdi
leaq 0x18(%rsp), %rsi
callq 0x38a02
movq %rbx, %rdi
movq %r13, %rsi
callq 0x37e9c
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x389be
movsd 0x18(%r12), %xmm0
xorps 0x533fc(%rip), %xmm0    # 0x93030
leaq 0x30(%rsp), %r13
movq %r13, %rdi
leaq 0x18(%rsp), %rsi
callq 0x38a02
movq %rbx, %rdi
movq %r13, %rsi
callq 0x37e9c
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x389be
movsd 0x18(%r14), %xmm0
xorps 0x533bf(%rip), %xmm0    # 0x93030
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x38a02
movq %rbx, %rdi
movq %r14, %rsi
callq 0x37e9c
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x38234
jmp 0x3fc9e
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Plane const&, gaps::R3Box const&)
RNClassID R3Intersects(const R3Plane& plane, const R3Box& box)
{
    // Return whether sphere intersects plane
    RNOctant octant = plane.Normal().Octant();
    if (R3SignedDistance(plane, box.Corner(octant)) < 0) return RN_NULL_CLASS_ID;
    if (R3SignedDistance(plane, box.Corner(~octant & 0x7)) > 0) return RN_NULL_CLASS_ID;
    return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3852c
movl %eax, %ebp
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x24db6
movq %rbx, %rdi
movq %r15, %rsi
callq 0x43420
xorl %eax, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x3fd5e
notl %ebp
andl $0x7, %ebp
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x24db6
movq %rbx, %rdi
movq %r15, %rsi
callq 0x43420
xorl %eax, %eax
ucomisd 0x5348f(%rip), %xmm0    # 0x931e8
setbe %al
negl %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Plane const&, gaps::R3OrientedBox const&)
RNClassID R3Intersects(const R3Plane& plane, const R3OrientedBox& box)
{
    // Check if box is empty
    if (box.IsEmpty()) return RN_NULL_CLASS_ID;

    // Transform plane into std coordinate system and intersect there
    R3Plane transformed_plane = plane;
    R3Affine cs_to_std_xform(box.CoordSystem().InverseMatrix());
    transformed_plane.Transform(cs_to_std_xform);
    R3Box axis_aligned_box(-box.Radius(0), -box.Radius(1), -box.Radius(2), box.Radius(0), box.Radius(1), box.Radius(2));
    return R3Intersects(transformed_plane, axis_aligned_box);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x22b76
xorl %ebp, %ebp
testl %eax, %eax
jne 0x3fe24
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x36720
leaq 0x8(%rbx), %rsi
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x27e20
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x276a0
movq %r15, %rdi
movq %r12, %rsi
callq 0x36dde
movsd 0x68(%rbx), %xmm3
movsd 0x70(%rbx), %xmm4
movaps 0x53250(%rip), %xmm2    # 0x93030
movaps %xmm3, %xmm0
xorps %xmm2, %xmm0
movaps %xmm4, %xmm1
xorps %xmm2, %xmm1
movsd 0x78(%rbx), %xmm5
xorps %xmm5, %xmm2
leaq 0x20(%rsp), %rdi
callq 0x24bde
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x3fcf1
movl %eax, %ebp
leaq 0x20(%rsp), %rdi
callq 0x25832
leaq 0xa0(%rsp), %rdi
callq 0x276ee
movl %ebp, %eax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x25832
jmp 0x3fe4a
jmp 0x3fe47
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x276ee
movq %rbx, %rdi
callq 0xe810
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Plane const&, gaps::R3Sphere const&)
RNClassID R3Intersects(const R3Plane& plane, const R3Sphere& sphere)
{
    // Return whether sphere intersects plane
    RNScalar d = R3Distance(plane, sphere.Center());
    if (RNIsGreater(d, sphere.Radius())) return RN_NULL_CLASS_ID;
    else if (RNIsEqual(d, sphere.Radius())) return R3_POINT_CLASS_ID;
    else return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x8(%rbx), %rdi
callq 0x433d6
leaq 0x9ad32(%rip), %rax     # 0xdaba8
subsd 0x20(%rbx), %xmm0
movsd (%rax), %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm0
ja 0x3fea8
movapd %xmm0, %xmm2
cmpnlepd %xmm1, %xmm2
xorpd 0x53198(%rip), %xmm1    # 0x93030
cmpnlepd %xmm0, %xmm1
orpd %xmm2, %xmm1
movd %xmm1, %eax
orl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Plane const&, gaps::R3Frustum const&)
RNClassID R3Intersects(const R3Plane& plane, const R3Frustum& frustum)
{
  // Check each halfspace
  for (int dir = 0; dir < 2; dir++) {
    for (int dim = 0; dim < 3; dim++) {
      if (!R3Intersects(frustum.Halfspace(dir, dim), plane)) {
        return RN_NULL_CLASS_ID;
      }
    }
  }

  // Passed all tests
  return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %rbx
xorl %r15d, %r15d
cmpq $0x2, %r15
je 0x3fef1
xorl %esi, %esi
leaq 0x20(%rsi), %r12
cmpq $0x80, %r12
je 0x3fee8
addq %rbx, %rsi
movq %r14, %rdi
callq 0x3fcaf
movq %r12, %rsi
testl %eax, %eax
jne 0x3fec7
jmp 0x3fef1
incq %r15
addq $0x60, %rbx
jmp 0x3febf
xorl %eax, %eax
cmpq $0x2, %r15
adcl $-0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Plane const&, gaps::R3Ellipsoid const&, gaps::R3Ellipse*)
RNClassID R3Intersects(const R3Plane& plane, const R3Ellipsoid& ellipsoid,
                       R3Ellipse *result)
{
  // Compute transformation from ellipse to canonical coordinate systems
  R3Affine xform(ellipsoid.CoordSystem().Matrix());

  // Transform plane to canonical coordinate system
  R3Plane transformed_plane(plane);
  transformed_plane.InverseTransform(xform);

  // Compute intersection
  R3Ellipse ellipse(R3xyz_coordinate_system, R2null_vector); 

  // If no intersection
  RNAbort("Not implemented");
  return RN_NULL_CLASS_ID;

  // Transform intersection back to original coordinate system
  if (result) {
    *result = ellipse;
    result->Transform(xform);
  }

  // Return success
  return R3_ELLIPSE_CLASS_ID;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rdi, %rbx
addq $0x8, %rsi
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x27dbc
leaq 0xd8(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x276a0
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x36720
leaq 0x8(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x36e5a
leaq 0x9b1af(%rip), %rsi     # 0xdb120
leaq 0x5aa40(%rip), %rdx     # 0x9a9b8
leaq 0x28(%rsp), %rdi
callq 0x4a340
leaq 0x53349(%rip), %rdi     # 0x932d2
xorl %eax, %eax
callq 0x680f0
leaq 0x28(%rsp), %rdi
callq 0x40d4e
leaq 0xd8(%rsp), %rdi
callq 0x276ee
xorl %eax, %eax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x40d4e
jmp 0x3ffc8
jmp 0x3ffc5
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x276ee
movq %rbx, %rdi
callq 0xe810
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Halfspace const&, gaps::R3Circle const&)
RNClassID R3Intersects(const R3Halfspace& halfspace, const R3Circle& circle)
{
    // Return whether halfspace intersects circle
    RNScalar d = R3SignedDistance(halfspace.Plane(), circle.Center());
    if (RNIsPositiveOrZero(d)) return RN_UNKNOWN_CLASS_ID;
    else if (RNIsLess(d, -(circle.Radius()))) return RN_NULL_CLASS_ID;
    else {
        RNScalar cos_theta = halfspace.Plane().Normal().Dot(circle.Normal());
	if (cos_theta < 0.0) cos_theta = halfspace.Plane().Normal().Dot(-circle.Normal());
	if (RNIsGreaterOrEqual(d, -(cos_theta * circle.Radius()))) return RN_UNKNOWN_CLASS_ID;
	else return RN_NULL_CLASS_ID;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
addq $0x8, %rsi
callq 0x43420
leaq 0x9ab36(%rip), %r13     # 0xdaba8
movsd (%r13), %xmm2
xorpd 0x52fb0(%rip), %xmm2    # 0x93030
ucomisd %xmm2, %xmm0
jae 0x400f7
movsd 0x20(%rbx), %xmm1
addsd %xmm0, %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm2
ja 0x400fa
movsd %xmm0, (%rsp)
leaq 0x28(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x38586
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x400d0
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x38c72
movq %r14, %rdi
movq %r12, %rsi
callq 0x38586
mulsd 0x20(%rbx), %xmm0
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd (%r13), %xmm0
xorpd 0x52f44(%rip), %xmm0    # 0x93030
xorl %eax, %eax
ucomisd %xmm0, %xmm1
adcl $-0x1, %eax
jmp 0x400fa
pushq $-0x1
popq %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Halfspace const&, gaps::R3OrientedBox const&)
RNClassID R3Intersects(const R3Halfspace& halfspace, const R3OrientedBox& box)
{
    // Check if box is empty
    if (box.IsEmpty()) return RN_NULL_CLASS_ID;

    // Transform halfspace into std coordinate system and intersect there
    R3Halfspace transformed_halfspace = halfspace;
    R3Affine cs_to_std_xform(box.CoordSystem().InverseMatrix());
    transformed_halfspace.Transform(cs_to_std_xform);
    R3Box axis_aligned_box(-box.Radius(0), -box.Radius(1), -box.Radius(2), box.Radius(0), box.Radius(1), box.Radius(2));
    return R3Intersects(transformed_halfspace, axis_aligned_box);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x22b76
xorl %ebp, %ebp
testl %eax, %eax
jne 0x40206
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x4f774
leaq 0x8(%rbx), %rsi
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x27e20
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x276a0
movq %r15, %rdi
movq %r12, %rsi
callq 0x4f7b0
movsd 0x68(%rbx), %xmm3
movsd 0x70(%rbx), %xmm4
movaps 0x52e6e(%rip), %xmm2    # 0x93030
movaps %xmm3, %xmm0
xorps %xmm2, %xmm0
movaps %xmm4, %xmm1
xorps %xmm2, %xmm1
movsd 0x78(%rbx), %xmm5
xorps %xmm5, %xmm2
leaq 0x20(%rsp), %rdi
callq 0x24bde
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x40108
movl %eax, %ebp
leaq 0x20(%rsp), %rdi
callq 0x25832
leaq 0xa0(%rsp), %rdi
callq 0x276ee
movl %ebp, %eax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x25832
jmp 0x4022c
jmp 0x40229
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x276ee
movq %rbx, %rdi
callq 0xe810
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Halfspace const&, gaps::R3Sphere const&)
RNClassID R3Intersects(const R3Halfspace& halfspace, const R3Sphere& sphere)
{
    // Return whether sphere intersects halfspace
    RNScalar d = R3SignedDistance(halfspace.Plane(), sphere.Center());
    if (RNIsLess(d, -(sphere.Radius()))) return RN_NULL_CLASS_ID;
    else if (RNIsEqual(d, -(sphere.Radius()))) return R3_POINT_CLASS_ID;
    else return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
addq $0x8, %rsi
callq 0x43420
leaq 0x9a953(%rip), %rax     # 0xdaba8
addsd 0x20(%rbx), %xmm0
movsd (%rax), %xmm1
movapd 0x52dca(%rip), %xmm2    # 0x93030
xorpd %xmm1, %xmm2
movapd %xmm0, %xmm3
cmpnlepd %xmm1, %xmm3
movapd %xmm2, %xmm1
cmpnlepd %xmm0, %xmm1
orpd %xmm3, %xmm1
movd %xmm1, %ecx
orl $0x1, %ecx
xorl %eax, %eax
ucomisd %xmm0, %xmm2
cmovbel %ecx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Halfspace const&, gaps::R3Cylinder const&)
RNClassID R3Intersects(const R3Halfspace& halfspace, const R3Cylinder& cylinder)
{
    // Return whether halfspace intersects cylinder
    if (R3Intersects(halfspace, cylinder.Top())) return RN_UNKNOWN_CLASS_ID;
    if (R3Intersects(halfspace, cylinder.Base())) return RN_UNKNOWN_CLASS_ID;
    return RN_NULL_CLASS_ID;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0xa0, %rsi
callq 0x4004f
testl %eax, %eax
je 0x402b1
pushq $-0x1
popq %rax
jmp 0x402c8
addq $0x58, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4004f
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Halfspace const&, gaps::R3Cone const&)
RNClassID R3Intersects(const R3Halfspace& halfspace, const R3Cone& cone)
{
    // Return whether halfspace intersects cone
    if (R3Intersects(halfspace, cone.Apex())) return RN_UNKNOWN_CLASS_ID;
    if (R3Intersects(halfspace, cone.Base())) return RN_UNKNOWN_CLASS_ID;
    return RN_NULL_CLASS_ID;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x38(%rsi), %rdi
movq %r14, %rsi
callq 0x3ce83
testl %eax, %eax
je 0x402ef
pushq $-0x1
popq %rax
jmp 0x40306
addq $0x58, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4004f
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Halfspace const&, gaps::R3Frustum const&)
RNClassID R3Intersects(const R3Halfspace& halfspace, const R3Frustum& frustum)
{
  // Check each halfspace
  for (int dir = 0; dir < 2; dir++) {
    for (int dim = 0; dim < 3; dim++) {
      if (!R3Intersects(frustum.Halfspace(dir, dim), halfspace)) {
        return RN_NULL_CLASS_ID;
      }
    }
  }

  // Passed all tests
  return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %rbx
xorl %r15d, %r15d
cmpq $0x2, %r15
je 0x40355
xorl %edi, %edi
leaq 0x20(%rdi), %r12
cmpq $0x80, %r12
je 0x4034c
addq %rbx, %rdi
movq %r14, %rsi
callq 0x3fffa
movq %r12, %rdi
testl %eax, %eax
jne 0x4032b
jmp 0x40355
incq %r15
addq $0x60, %rbx
jmp 0x40323
xorl %eax, %eax
cmpq $0x2, %r15
adcl $-0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Box const&, gaps::R3OrientedBox const&)
RNClassID R3Intersects(const R3Box& box1, const R3OrientedBox& box2)
{
    // Check if box is empty
    if (box1.IsEmpty()) return RN_NULL_CLASS_ID;
    if (box2.IsEmpty()) return RN_NULL_CLASS_ID;

    // Check for intersection with all halfspaces
    for (int dir = 0; dir < 2; dir++) {
      for (int dim = 0; dim < 3; dim++) {
        R3Halfspace halfspace(-box2.Plane(dir, dim), 0);
        if (!R3Intersects(halfspace, box1)) {
          return RN_NULL_CLASS_ID;
        }
      }
    }

    // Passed all tests
    return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r13
movq %rdi, %r14
callq 0x257ce
xorl %r15d, %r15d
testl %eax, %eax
jne 0x408b1
movq %r13, %rdi
callq 0x22b76
testl %eax, %eax
jne 0x408b1
xorl %ebp, %ebp
cmpl $0x2, %ebp
je 0x408a7
xorl %r15d, %r15d
cmpl $0x3, %r15d
je 0x408a3
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x4ea8a
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x21c84
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4f7a4
movq %r12, %rdi
movq %r14, %rsi
callq 0x40108
incl %r15d
testl %eax, %eax
jne 0x40852
jmp 0x408a7
incl %ebp
jmp 0x4084a
xorl %r15d, %r15d
cmpl $0x2, %ebp
adcl $-0x1, %r15d
movl %r15d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Box const&, gaps::R3Frustum const&)
RNClassID R3Intersects(const R3Box& box, const R3Frustum& frustum)
{
  // Check each halfspace
  for (int dir = 0; dir < 2; dir++) {
    for (int dim = 0; dim < 3; dim++) {
      if (!R3Intersects(frustum.Halfspace(dir, dim), box)) {
        return RN_NULL_CLASS_ID;
      }
    }
  }

  // Passed all tests
  return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %rbx
xorl %r15d, %r15d
cmpq $0x2, %r15
je 0x4093e
xorl %edi, %edi
leaq 0x20(%rdi), %r12
cmpq $0x80, %r12
je 0x40935
addq %rbx, %rdi
movq %r14, %rsi
callq 0x40108
movq %r12, %rdi
testl %eax, %eax
jne 0x40914
jmp 0x4093e
incq %r15
addq $0x60, %rbx
jmp 0x4090c
xorl %eax, %eax
cmpq $0x2, %r15
adcl $-0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3OrientedBox const&, gaps::R3OrientedBox const&)
RNClassID R3Intersects(const R3OrientedBox& box1, const R3OrientedBox& box2)
{
    // Check if box is empty
    if (box1.IsEmpty()) return RN_NULL_CLASS_ID;
    if (box2.IsEmpty()) return RN_NULL_CLASS_ID;

    // Check for intersection with all halfspaces
    for (int dir = 0; dir < 2; dir++) {
      for (int dim = 0; dim < 3; dim++) {
        R3Halfspace halfspace(-box2.Plane(dir, dim), 0);
        if (!R3Intersects(halfspace, box1)) {
          return RN_NULL_CLASS_ID;
        }
      }
    }

    // Passed all tests
    return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r13
movq %rdi, %r14
callq 0x22b76
xorl %r15d, %r15d
testl %eax, %eax
jne 0x409fd
movq %r13, %rdi
callq 0x22b76
testl %eax, %eax
jne 0x409fd
xorl %ebp, %ebp
cmpl $0x2, %ebp
je 0x409f3
xorl %r15d, %r15d
cmpl $0x3, %r15d
je 0x409ef
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x4ea8a
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x21c84
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4f7a4
movq %r12, %rdi
movq %r14, %rsi
callq 0x4014b
incl %r15d
testl %eax, %eax
jne 0x4099e
jmp 0x409f3
incl %ebp
jmp 0x40996
xorl %r15d, %r15d
cmpl $0x2, %ebp
adcl $-0x1, %r15d
movl %r15d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3OrientedBox const&, gaps::R3Sphere const&)
RNClassID R3Intersects(const R3OrientedBox& box, const R3Sphere& sphere)
{
    // Check if box is empty
    if (box.IsEmpty()) return RN_NULL_CLASS_ID;

    // Check for intersection with all halfspaces
    for (int dir = 0; dir < 2; dir++) {
      for (int dim = 0; dim < 3; dim++) {
        R3Halfspace halfspace(-box.Plane(dir, dim), 0);
        if (!R3Intersects(halfspace, sphere)) {
          return RN_NULL_CLASS_ID;
        }
      }
    }

    // Passed all tests
    return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x22b76
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x40a98
movq %rbx, (%rsp)
xorl %ebp, %ebp
leaq 0x8(%rsp), %r15
leaq 0x28(%rsp), %r12
leaq 0x48(%rsp), %r13
cmpl $0x2, %ebp
je 0x40a90
xorl %ebx, %ebx
cmpl $0x3, %ebx
je 0x40a8c
movq %r15, %rdi
movq (%rsp), %rsi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x4ea8a
movq %r12, %rdi
movq %r15, %rsi
callq 0x21c84
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x4f7a4
movq %r13, %rdi
movq %r14, %rsi
callq 0x40241
incl %ebx
testl %eax, %eax
jne 0x40a4c
jmp 0x40a90
incl %ebp
jmp 0x40a45
xorl %eax, %eax
cmpl $0x2, %ebp
adcl $-0x1, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3OrientedBox const&, gaps::R3Frustum const&)
RNClassID R3Intersects(const R3OrientedBox& box, const R3Frustum& frustum)
{
  // Check each halfspace
  for (int dir = 0; dir < 2; dir++) {
    for (int dim = 0; dim < 3; dim++) {
      if (!R3Intersects(frustum.Halfspace(dir, dim), box)) {
        return RN_NULL_CLASS_ID;
      }
    }
  }

  // Passed all tests
  return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %rbx
xorl %r15d, %r15d
cmpq $0x2, %r15
je 0x40aee
xorl %edi, %edi
leaq 0x20(%rdi), %r12
cmpq $0x80, %r12
je 0x40ae5
addq %rbx, %rdi
movq %r14, %rsi
callq 0x4014b
movq %r12, %rdi
testl %eax, %eax
jne 0x40ac4
jmp 0x40aee
incq %r15
addq $0x60, %rbx
jmp 0x40abc
xorl %eax, %eax
cmpq $0x2, %r15
adcl $-0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3OrientedBox const&, gaps::R3Shape const&)
RNClassID R3Intersects(const R3OrientedBox& box, const R3Shape& shape)
{
    // Check if box is empty
    if (box.IsEmpty()) return RN_NULL_CLASS_ID;

    // Check for intersection with all halfspaces
    for (int dir = 0; dir < 2; dir++) {
      for (int dim = 0; dim < 3; dim++) {
        R3Halfspace halfspace(-box.Plane(dir, dim), 0);
        if (!R3Intersects(halfspace, shape)) {
          return RN_NULL_CLASS_ID;
        }
      }
    }

    // Passed all tests
    return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x22b76
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x40b94
movq %r14, (%rsp)
xorl %ebp, %ebp
leaq 0x8(%rsp), %r15
leaq 0x28(%rsp), %r12
leaq 0x48(%rsp), %r13
cmpl $0x2, %ebp
je 0x40b8c
xorl %r14d, %r14d
cmpl $0x3, %r14d
je 0x40b88
movq %r15, %rdi
movq (%rsp), %rsi
movl %ebp, %edx
movl %r14d, %ecx
callq 0x4ea8a
movq %r12, %rdi
movq %r15, %rsi
callq 0x21c84
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x4f7a4
movq (%rbx), %rax
movq %rbx, %rdi
movq %r13, %rsi
callq *0x1f0(%rax)
incl %r14d
testl %eax, %eax
jne 0x40b41
jmp 0x40b8c
incl %ebp
jmp 0x40b39
xorl %eax, %eax
cmpl $0x2, %ebp
adcl $-0x1, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Sphere const&, gaps::R3Sphere const&)
RNClassID R3Intersects(const R3Sphere& sphere1, const R3Sphere& sphere2)
{
    // Return whether sphere intersects sphere
    R3Vector v = sphere1.Center() - sphere2.Center();
    RNScalar distance_squared = v.X() * v.X() + v.Y() * v.Y() + v.Z() * v.Z();
    RNScalar radius_sum = sphere1.Radius() + sphere2.Radius();
    RNScalar radius_sum_squared = radius_sum * radius_sum;
    if (RNIsGreater(distance_squared, radius_sum_squared)) return RN_NULL_CLASS_ID;
    else if (RNIsEqual(distance_squared, radius_sum_squared)) return R3_POINT_CLASS_ID;
    else return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %rsi
leaq 0x8(%rbx), %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x37d29
movsd (%r15), %xmm1
movsd 0x8(%r15), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%r15), %xmm0
mulsd %xmm0, %xmm0
movsd 0x20(%r14), %xmm2
addsd 0x20(%rbx), %xmm2
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
leaq 0x99fa6(%rip), %rax     # 0xdaba8
movsd (%rax), %xmm1
subsd %xmm2, %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
ja 0x40c33
movapd %xmm0, %xmm2
cmpnlepd %xmm1, %xmm2
xorpd 0x5240d(%rip), %xmm1    # 0x93030
cmpnlepd %xmm0, %xmm1
orpd %xmm2, %xmm1
movd %xmm1, %eax
orl $0x1, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Sphere const&, gaps::R3Frustum const&)
RNClassID R3Intersects(const R3Sphere& sphere, const R3Frustum& frustum)
{
  // Check each halfspace
  for (int dir = 0; dir < 2; dir++) {
    for (int dim = 0; dim < 3; dim++) {
      if (!R3Intersects(frustum.Halfspace(dir, dim), sphere)) {
        return RN_NULL_CLASS_ID;
      }
    }
  }

  // Passed all tests
  return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %rbx
xorl %r15d, %r15d
cmpq $0x2, %r15
je 0x40c84
xorl %edi, %edi
leaq 0x20(%rdi), %r12
cmpq $0x80, %r12
je 0x40c7b
addq %rbx, %rdi
movq %r14, %rsi
callq 0x40241
movq %r12, %rdi
testl %eax, %eax
jne 0x40c5a
jmp 0x40c84
incq %r15
addq $0x60, %rbx
jmp 0x40c52
xorl %eax, %eax
cmpq $0x2, %r15
adcl $-0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Frustum const&, gaps::R3Shape const&)
RNClassID R3Intersects(const R3Frustum& frustum, const R3Shape& shape)
{
  // Check each halfspace
  for (int dir = 0; dir < 2; dir++) {
    for (int dim = 0; dim < 3; dim++) {
      if (!R3Intersects(frustum.Halfspace(dir, dim), shape)) {
        return RN_NULL_CLASS_ID;
      }
    }
  }

  // Passed all tests
  return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %r14
xorl %r15d, %r15d
cmpq $0x2, %r15
je 0x40cf9
xorl %esi, %esi
leaq 0x20(%rsi), %r12
cmpq $0x80, %r12
je 0x40cf0
addq %r14, %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x1f0(%rax)
movq %r12, %rsi
testl %eax, %eax
jne 0x40ccb
jmp 0x40cf9
incq %r15
addq $0x60, %r14
jmp 0x40cc3
xorl %eax, %eax
cmpq $0x2, %r15
adcl $-0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Cont.cpp
// Function: gaps::R3Contains(gaps::R3Point const&, gaps::R3Triangle const&)
RNBoolean R3Contains(const R3Point& point, const R3Triangle& triangle)
{
    // Get triangle vertices
    R3TriangleVertex *v0 = triangle.V0();
    R3TriangleVertex *v1 = triangle.V1();
    R3TriangleVertex *v2 = triangle.V2();
    if (!v0 || !v1 || !v2) return FALSE;

    // Return whether point contains triangle's vertices
    return (R3Contains(point, v0->Position()) &&
            R3Contains(point, v1->Position()) &&
            R3Contains(point, v2->Position())); 
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rax
movq 0x8(%rsi), %rsi
movq 0x10(%rax), %r15
movq 0x18(%rax), %r14
testq %rsi, %rsi
sete %al
testq %r15, %r15
sete %cl
orb %al, %cl
testq %r14, %r14
sete %al
orb %cl, %al
jne 0x40eca
movq %rdi, %rbx
callq 0x40dd7
testl %eax, %eax
je 0x40eca
movq %rbx, %rdi
movq %r15, %rsi
callq 0x40dd7
testl %eax, %eax
je 0x40eca
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x40dd7
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Cont.cpp
// Function: gaps::R3Contains(gaps::R3Ellipse const&, gaps::R3Point const&)
RNBoolean R3Contains(const R3Point& point, const R3Box& box)
{
    // Return whether point contains box
    if (box.IsEmpty()) return FALSE;
    if (!box.IsPoint()) return FALSE;
    if (!R3Contains(point, box.Min())) return FALSE;
    return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movsd 0x68(%rdi), %xmm0
xorl %ebp, %ebp
xorpd %xmm2, %xmm2
ucomisd %xmm0, %xmm2
ja 0x41d92
movq %rdi, %rbx
movsd 0x70(%rdi), %xmm1
ucomisd %xmm1, %xmm2
ja 0x41d92
leaq 0x98ea6(%rip), %rax     # 0xdaba8
movsd (%rax), %xmm2
ucomisd %xmm2, %xmm0
jbe 0x41d92
ucomisd %xmm2, %xmm1
jbe 0x41d92
movq %rsi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x40d1a
movq %r15, %rdi
movq %r14, %rsi
callq 0x415ce
testl %eax, %eax
je 0x41d92
leaq 0x8(%rbx), %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x37d29
leaq 0x20(%rbx), %rsi
movq %r15, %rdi
callq 0x38586
divsd 0x68(%rbx), %xmm0
movsd %xmm0, (%rsp)
leaq 0x38(%rbx), %rsi
movq %r15, %rdi
callq 0x38586
divsd 0x70(%rbx), %xmm0
mulsd %xmm0, %xmm0
movsd (%rsp), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
xorl %ebp, %ebp
ucomisd 0x5127a(%rip), %xmm1    # 0x93008
setbe %bpl
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq