LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Ray const&, gaps::R3Triangle const&, gaps::R3Point*, gaps::R3Vector*, double*)
RNClassID R3Intersects(const R3Ray& ray, const R3Triangle& triangle, 
    R3Point *hit_point, R3Vector *hit_normal, RNScalar *hit_t)
{
    // Find intersection of ray and plane
    R3Point p1;
    RNScalar t1;
    switch (R3Intersects(ray, triangle.Plane(), &p1, &t1)) {
    case RN_NULL_CLASS_ID:
	// Ray does not intersect triangle plane
	return RN_NULL_CLASS_ID;
	
    case R3_POINT_CLASS_ID:
	// Ray intersects triangle plane in a single point
	// Check whether triangle contains intersection point
	if (!R3Contains(triangle, p1)) return RN_NULL_CLASS_ID;
	if (hit_point) *hit_point = p1;
	if (hit_normal) *hit_normal = triangle.Normal();
	if (hit_t) *hit_t = t1;
	return R3_POINT_CLASS_ID;

    case R3_RAY_CLASS_ID: 
	// Ray lies in triangle plane 
	// Intersect ray and triangle in 2D
	// RNAbort("Case not implemented");
	// return R3_SPAN_CLASS_ID;
	return RN_NULL_CLASS_ID;

    default:
	RNAbort("Invalid intersection result");
	break;
    }

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, (%rsp)
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbp
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x3c530
leaq 0x20(%r13), %r15
leaq 0x8(%rsp), %rcx
movq %rbp, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x43016
xorl %ebp, %ebp
movl %eax, %eax
leaq 0x65d87(%rip), %rcx     # 0xa8f8c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rbx
movq (%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0x4732f
testl %eax, %eax
je 0x4327d
testq %rbx, %rbx
je 0x43238
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x3c89a
testq %r12, %r12
je 0x43248
movq %r12, %rdi
movq %r15, %rsi
callq 0x3d752
movl $0x1, %ebp
testq %r14, %r14
je 0x4327d
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%r14)
jmp 0x4327d
leaq 0x65d91(%rip), %rdi     # 0xa8ff7
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x718f6
leaq 0x65d6b(%rip), %rdi     # 0xa8fe1
xorl %eax, %eax
callq 0x718f6
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Ray const&, gaps::R3TriangleArray const&, gaps::R3Point*, gaps::R3Vector*, double*)
RNClassID R3Intersects(const R3Ray& ray, const R3TriangleArray& array,
    R3Point *hit_point, R3Vector *hit_normal, RNScalar *hit_t)
{
    // This could be more efficient ???
    // Sort intersections with front-facing planes 
    //   before do any point-in-triangle operations

    // Check bounding volume for intersection 
    if (!R3Intersects(ray, array.Box())) 
	return RN_NULL_CLASS_ID;

    // Check each triangle for intersection
    RNClassID status = RN_NULL_CLASS_ID;
    RNScalar min_t = FLT_MAX;
    for (int i = 0; i < array.NTriangles(); i++) {
        R3Point point;
        R3Vector normal;
	RNScalar t;
        if (R3Intersects(ray, *(array.Triangle(i)), &point, &normal, &t) == R3_POINT_CLASS_ID) {
	    if (t < min_t) {
	        status = R3_POINT_CLASS_ID;
	        if (hit_point) *hit_point = point;
	        if (hit_normal) *hit_normal = normal;
	        min_t = t;
	    }
	}
    }

    // Update hit t
    if (hit_t) *hit_t = min_t;

    // Return whether hit any triangle
    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
addq $0x28, %rsi
xorl %ebp, %ebp
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x433c5
testl %eax, %eax
je 0x433b4
movq %rbx, 0x18(%rsp)
cmpl $0x0, 0x24(%r12)
jle 0x43386
movq %r14, 0x20(%rsp)
xorl %r14d, %r14d
movsd 0x5ed5a(%rip), %xmm0    # 0xa2040
movsd %xmm0, 0x8(%rsp)
leaq 0x40(%rsp), %rbx
leaq 0x28(%rsp), %rbp
movq $0x0, (%rsp)
movq %rbx, %rdi
callq 0x3c530
movq %rbp, %rdi
callq 0x3cfc4
movq 0x18(%r12), %rax
movq (%rax,%r14,8), %rsi
movq %r13, %rdi
movq %rbx, %rdx
movq %rbp, %rcx
leaq 0x10(%rsp), %r8
callq 0x431b8
testl %eax, %eax
je 0x43373
movsd 0x8(%rsp), %xmm0
ucomisd 0x10(%rsp), %xmm0
jbe 0x43373
testq %r15, %r15
je 0x4334c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3c89a
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x4335e
movq %rbp, %rsi
callq 0x3d752
movl $0x1, %eax
movq %rax, (%rsp)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
incq %r14
movslq 0x24(%r12), %rax
cmpq %rax, %r14
jl 0x432fe
jmp 0x4339c
movsd 0x5ecb2(%rip), %xmm0    # 0xa2040
movsd %xmm0, 0x8(%rsp)
movq $0x0, (%rsp)
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x433b0
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq (%rsp), %rbp
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Ray const&, gaps::R3Circle const&, gaps::R3Point*, gaps::R3Vector*, double*)
RNClassID R3Intersects(const R3Ray& ray, const R3Circle& circle, 
    R3Point *hit_point, R3Vector *hit_normal, RNScalar *hit_t)
{
    // Check for empty circle
    if (circle.IsEmpty()) return RN_NULL_CLASS_ID;
    
    // Find intersection of ray and plane
    R3Point p1;
    RNScalar t1;
    switch (R3Intersects(ray, circle.Plane(), &p1, &t1)) {
    case RN_NULL_CLASS_ID:
	// Ray does not intersect circle plane
	return RN_NULL_CLASS_ID;
	
    case R3_POINT_CLASS_ID:
    {
	// Ray intersects circle plane in a single point
	// Check whether circle contains intersection point
	RNScalar radius_squared = circle.Radius() * circle.Radius();
	R3Vector v = circle.Center() - p1;
	RNScalar distance_squared = v.X() * v.X() + v.Y() * v.Y() + v.Z() * v.Z();
	if (RNIsGreater(distance_squared, radius_squared)) return RN_NULL_CLASS_ID;
	if (hit_point) *hit_point = p1;
	if (hit_normal) *hit_normal = circle.Normal();
	if (hit_t) *hit_t = t1;
	return R3_POINT_CLASS_ID;
    }

    case R3_RAY_CLASS_ID: 
	// Ray lies in circle plane 
	// Intersect ray and circle in 2D
        // RNAbort("Case not implemented");
	return R3_SPAN_CLASS_ID;

    default:
	RNAbort("Invalid intersection result");
	break;
    }

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
xorl %ebp, %ebp
xorpd %xmm0, %xmm0
ucomisd 0x20(%rsi), %xmm0
ja 0x43750
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
movq %r8, 0x8(%rsp)
leaq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq 0x3c530
leaq 0x28(%r13), %r12
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x43016
movl %eax, %ebp
movl %eax, %eax
leaq 0x65915(%rip), %rcx     # 0xa8f9c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movsd 0x20(%r13), %xmm0
mulsd %xmm0, %xmm0
movsd %xmm0, (%rsp)
addq $0x8, %r13
leaq 0x30(%rsp), %rbx
leaq 0x18(%rsp), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3c78e
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd 0x10(%rbx), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
subsd (%rsp), %xmm1
leaq 0xa24b2(%rip), %rax     # 0xe5b98
xorl %ebp, %ebp
ucomisd (%rax), %xmm1
ja 0x43750
testq %r15, %r15
je 0x43700
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
callq 0x3c89a
testq %r14, %r14
je 0x43710
movq %r14, %rdi
movq %r12, %rsi
callq 0x3d752
movl $0x1, %ebp
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0x43750
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x43750
leaq 0x658c5(%rip), %rdi     # 0xa8ff7
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x718f6
leaq 0x6589f(%rip), %rdi     # 0xa8fe1
xorl %eax, %eax
callq 0x718f6
jmp 0x43750
movl $0x4, %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_O3/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Ray const&, gaps::R3Ellipse const&, gaps::R3Point*, gaps::R3Vector*, double*)
RNClassID R3Intersects(const R3Ray& ray, const R3Ellipse& ellipse, 
    R3Point *hit_point, R3Vector *hit_normal, RNScalar *hit_t)
{
    // Check for empty ellipse
    if (ellipse.IsEmpty()) return RN_NULL_CLASS_ID;
    
    // Find intersection of ray and plane
    R3Point p1;
    RNScalar t1;
    switch (R3Intersects(ray, ellipse.Plane(), &p1, &t1)) {
    case RN_NULL_CLASS_ID:
	// Ray does not intersect ellipse plane
	return RN_NULL_CLASS_ID;
	
    case R3_POINT_CLASS_ID:
    {
	// Ray intersects ellipse plane in a single point
	// Check whether ellipse contains intersection point
        if (!R3Contains(ellipse, p1)) return RN_NULL_CLASS_ID;
  	if (hit_point) *hit_point = p1;
	if (hit_normal) *hit_normal = ellipse.Normal();
	if (hit_t) *hit_t = t1;
	return R3_POINT_CLASS_ID;
    }

    case R3_RAY_CLASS_ID: 
	// Ray lies in ellipse plane 
	// Intersect ray and ellipse in 2D
        // RNAbort("Case not implemented");
	return R3_SPAN_CLASS_ID;

    default:
	RNAbort("Invalid intersection result");
	break;
    }

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
xorl %ebp, %ebp
xorpd %xmm0, %xmm0
ucomisd 0x68(%rsi), %xmm0
ja 0x43863
movq %rsi, %r13
ucomisd 0x70(%rsi), %xmm0
ja 0x43863
movq %rdx, %r15
movq %rdi, %rbx
movq %rcx, 0x8(%rsp)
movq %r8, 0x10(%rsp)
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
callq 0x3c530
leaq 0x8(%r13), %rsi
leaq 0x50(%r13), %r12
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movq %r12, %rdx
callq 0x3b0b2
leaq 0x18(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x43016
movl %eax, %ebp
movl %eax, %eax
leaq 0x657cb(%rip), %rcx     # 0xa8fac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0x47888
testl %eax, %eax
je 0x43861
testq %r15, %r15
je 0x4380d
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0x3c89a
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x4381f
movq %r12, %rsi
callq 0x3d752
movl $0x1, %ebp
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x43863
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x43863
leaq 0x657b6(%rip), %rdi     # 0xa8ff7
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x718f6
leaq 0x65790(%rip), %rdi     # 0xa8fe1
xorl %eax, %eax
callq 0x718f6
jmp 0x43863
movl $0x4, %ebp
jmp 0x43863
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %rsp
movsd 0x68(%rsi), %xmm0
minsd 0x70(%rsi), %xmm0
xorl %ebp, %ebp
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x43974
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
movq %rcx, 0x8(%rsp)
movq %r8, 0x10(%rsp)
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
callq 0x3c530
leaq 0x8(%r13), %rsi
leaq 0x50(%r13), %r12
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movq %r12, %rdx
callq 0x3b0b2
leaq 0x18(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x43016
movl %eax, %ebp
movl %eax, %eax
leaq 0x656ca(%rip), %rcx     # 0xa8fbc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0x4798c
testl %eax, %eax
je 0x43972
testq %r15, %r15
je 0x4391e
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0x3c89a
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x43930
movq %r12, %rsi
callq 0x3d752
movl $0x1, %ebp
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x43974
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x43974
leaq 0x656a5(%rip), %rdi     # 0xa8ff7
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x718f6
leaq 0x6567f(%rip), %rdi     # 0xa8fe1
xorl %eax, %eax
callq 0x718f6
jmp 0x43974
movl $0x4, %ebp
jmp 0x43974
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rsi, %r13
movsd 0x70(%rsi), %xmm0
movsd 0x78(%rsi), %xmm1
minsd 0x68(%rsi), %xmm0
minsd %xmm0, %xmm1
xorl %ebp, %ebp
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
ja 0x43ad9
movq %r8, %r15
movq %rdx, %r14
movq %rdi, %rsi
movq %rcx, 0x8(%rsp)
leaq 0x48(%rsp), %rbp
movq %rbp, %rdi
callq 0x3c11a
leaq 0x8(%r13), %rsi
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movq %rsi, (%rsp)
callq 0x2a7d6
leaq 0x208(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x29fda
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x3c1f4
movsd 0x68(%r13), %xmm3
movsd 0x70(%r13), %xmm4
movapd 0x5e600(%rip), %xmm2    # 0xa2020
movapd %xmm3, %xmm0
xorpd %xmm2, %xmm0
movapd %xmm4, %xmm1
xorpd %xmm2, %xmm1
movsd 0x78(%r13), %xmm5
xorpd %xmm5, %xmm2
leaq 0x10(%rsp), %rdi
callq 0x27374
movq 0x8(%rsp), %rbx
leaq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r15, %r8
callq 0x433c5
movl %eax, %ebp
testl %eax, %eax
je 0x43ac2
movq %r14, %rax
orq %rbx, %rax
je 0x43ac2
leaq 0x188(%rsp), %rdi
movq (%rsp), %rsi
callq 0x2a74e
leaq 0x78(%rsp), %rdi
leaq 0x188(%rsp), %rsi
xorl %edx, %edx
callq 0x29fda
testq %r14, %r14
je 0x43aa6
leaq 0x78(%rsp), %rsi
movq %r14, %rdi
callq 0x3ce48
testq %rbx, %rbx
je 0x43ab8
leaq 0x78(%rsp), %rsi
movq %rbx, %rdi
callq 0x3db46
leaq 0x78(%rsp), %rdi
callq 0x2a028
leaq 0x10(%rsp), %rdi
callq 0x280f4
leaq 0x208(%rsp), %rdi
callq 0x2a028
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 0x2a028
jmp 0x43b01
jmp 0x43afe
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x280f4
jmp 0x43b12
jmp 0x43b0f
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0x2a028
movq %rbx, %rdi
callq 0xe7e0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x490cc
testl %eax, %eax
je 0x448e0
testq %r15, %r15
je 0x448c0
movq %r15, %rdi
movq %r12, %rsi
callq 0x3c89a
testq %r14, %r14
je 0x448d4
leaq 0x63e14(%rip), %rsi     # 0xa86e0
movq %r14, %rdi
callq 0x3d752
testq %rbx, %rbx
je 0x448e0
movq $0x0, (%rbx)
leaq 0x5da3b(%rip), %rdi     # 0xa2322
xorl %eax, %eax
callq 0x718f6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x42f31
movl %eax, %ebx
testl %eax, %eax
je 0x449df
cmpl $0x1, %ebx
je 0x44981
cmpl $0x4, %ebx
jne 0x449c1
movq %r12, %rdi
movq %r15, %rsi
callq 0x46d6d
movl $0x4, %ebx
testl %eax, %eax
jne 0x449df
addq $0x30, %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x46d6d
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
shll $0x2, %ebx
jmp 0x449df
movsd 0x8(%rsp), %xmm0
leaq 0xa120a(%rip), %rax     # 0xe5b98
movapd %xmm0, %xmm1
subsd 0x48(%r15), %xmm1
xorl %ebx, %ebx
ucomisd (%rax), %xmm1
ja 0x449df
testq %r13, %r13
je 0x449ab
movsd %xmm0, (%r13)
movl $0x1, %ebx
testq %r14, %r14
je 0x449df
movsd (%rsp), %xmm0
movsd %xmm0, (%r14)
jmp 0x449df
leaq 0x64604(%rip), %rdi     # 0xa8fcc
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x718f6
leaq 0x64609(%rip), %rdi     # 0xa8fe1
xorl %eax, %eax
callq 0x718f6
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x43106
movl %eax, %ebx
leal -0x3(%rbx), %eax
cmpl $0x2, %eax
jb 0x44d52
testl %ebx, %ebx
je 0x44d77
cmpl $0x1, %ebx
jne 0x44d59
movsd 0x8(%rsp), %xmm0
leaq 0xa0e69(%rip), %rax     # 0xe5b98
movapd %xmm0, %xmm1
subsd 0x48(%r15), %xmm1
xorl %ebx, %ebx
ucomisd (%rax), %xmm1
ja 0x44d77
movl $0x1, %ebx
testq %r14, %r14
je 0x44d77
movsd %xmm0, (%r14)
jmp 0x44d77
movl $0x4, %ebx
jmp 0x44d77
leaq 0x6426c(%rip), %rdi     # 0xa8fcc
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x718f6
leaq 0x64271(%rip), %rdi     # 0xa8fe1
xorl %eax, %eax
callq 0x718f6
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x68, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, %r12
movq %rdi, %r14
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x3b8f6
addq $0x68, %r12
movb $0x1, %bpl
xorl %eax, %eax
leaq (%rax,%rax,2), %rbx
shlq $0x5, %rbx
addq %r12, %rbx
xorl %r15d, %r15d
leaq (%rbx,%r15), %rsi
movq %r13, %rdi
callq 0x3bef4
testl %eax, %eax
je 0x44e28
addq $0x20, %r15
cmpq $0x60, %r15
jne 0x44dc8
movl $0x1, %eax
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x44dba
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x44e06
leaq 0x18(%rsp), %rsi
callq 0x3c89a
movl $0x4, %ebp
movq 0x10(%rsp), %rbx
testq %rbx, %rbx
je 0x44e2a
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x3bc5c
movsd %xmm0, (%rbx)
jmp 0x44e2a
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x44ea3
testl %ebx, %ebx
je 0x44ec8
cmpl $0x1, %ebx
jne 0x44eaa
movsd 0x8(%rsp), %xmm0
leaq 0xa0d18(%rip), %rax     # 0xe5b98
movapd %xmm0, %xmm1
subsd 0x48(%r15), %xmm1
xorl %ebx, %ebx
ucomisd (%rax), %xmm1
ja 0x44ec8
movl $0x1, %ebx
testq %r14, %r14
je 0x44ec8
movsd %xmm0, (%r14)
jmp 0x44ec8
movl $0x4, %ebx
jmp 0x44ec8
leaq 0x6411b(%rip), %rdi     # 0xa8fcc
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x718f6
leaq 0x64120(%rip), %rdi     # 0xa8fe1
xorl %eax, %eax
callq 0x718f6
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2d1d5
leaq 0xa0add(%rip), %rax     # 0xe5b98
movsd (%rax), %xmm2
movapd 0x5cf59(%rip), %xmm1    # 0xa2020
xorpd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x45105
ucomisd %xmm0, %xmm2
jb 0x45105
movq %r15, %rdi
movq %r12, %rsi
callq 0x470b7
testl %eax, %eax
je 0x450fe
movq %r15, %rdi
movq %r14, %rsi
callq 0x470b7
movl $0x5, %ebp
testl %eax, %eax
jne 0x451e6
xorl %ebp, %ebp
jmp 0x451e6
movl $0x1, %ebp
testq %rbx, %rbx
je 0x451e6
leaq 0x4a1946(%rip), %rsi    # 0x4e6a60
movq %rbx, %rdi
movsd %xmm0, 0x10(%rsp)
callq 0x3c89a
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x3d8fa
movsd 0x18(%r15), %xmm0
xorps 0x5cedb(%rip), %xmm0    # 0xa2020
leaq 0x30(%rsp), %r13
movq %r13, %rdi
leaq 0x18(%rsp), %rsi
callq 0x3d962
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3c914
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3d8fa
movsd 0x18(%r12), %xmm0
xorps 0x5cea0(%rip), %xmm0    # 0xa2020
leaq 0x30(%rsp), %r13
movq %r13, %rdi
leaq 0x18(%rsp), %rsi
callq 0x3d962
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3c914
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3d8fa
movsd 0x18(%r14), %xmm0
xorps 0x5ce63(%rip), %xmm0    # 0xa2020
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x3d962
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3c914
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x3ceea
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_O3/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 0x3d1f0
movl %eax, %ebp
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x27552
movq %rbx, %rdi
movq %r15, %rsi
callq 0x49617
xorl %eax, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x452b1
notl %ebp
andl $0x7, %ebp
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x27552
movq %rbx, %rdi
movq %r15, %rsi
callq 0x49617
xorl %eax, %eax
ucomisd 0x5cf3c(%rip), %xmm0    # 0xa21e8
setbe %al
negl %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
movsd 0x70(%rsi), %xmm0
movsd 0x78(%rsi), %xmm1
minsd 0x68(%rsi), %xmm0
minsd %xmm0, %xmm1
xorl %ebp, %ebp
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
ja 0x4538b
movq %rdi, %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0x3b026
leaq 0x8(%rbx), %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x2a7d6
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x29fda
movq %r14, %rdi
movq %r12, %rsi
callq 0x3b73a
movsd 0x68(%rbx), %xmm3
movsd 0x70(%rbx), %xmm4
movapd 0x5ccde(%rip), %xmm2    # 0xa2020
movapd %xmm3, %xmm0
xorpd %xmm2, %xmm0
movapd %xmm4, %xmm1
xorpd %xmm2, %xmm1
movsd 0x78(%rbx), %xmm5
xorpd %xmm5, %xmm2
leaq 0x20(%rsp), %rdi
callq 0x27374
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x45244
movl %eax, %ebp
leaq 0x20(%rsp), %rdi
callq 0x280f4
leaq 0xa0(%rsp), %rdi
callq 0x2a028
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 0x280f4
jmp 0x453b1
jmp 0x453ae
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x2a028
movq %rbx, %rdi
callq 0xe7e0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x495be
leaq 0xa07bb(%rip), %rax     # 0xe5b98
subsd 0x20(%rbx), %xmm0
movsd (%rax), %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm0
ja 0x4540f
movapd %xmm0, %xmm2
cmpnlepd %xmm1, %xmm2
xorpd 0x5cc21(%rip), %xmm1    # 0xa2020
cmpnlepd %xmm0, %xmm1
orpd %xmm2, %xmm1
movd %xmm1, %eax
orl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %rbx
movb $0x1, %bpl
xorl %ecx, %ecx
leaq (%rcx,%rcx,2), %r15
shlq $0x5, %r15
addq %rbx, %r15
xorl %r12d, %r12d
leaq (%r15,%r12), %rsi
movq %r14, %rdi
callq 0x451f7
testl %eax, %eax
je 0x45460
addq $0x20, %r12
cmpq $0x60, %r12
jne 0x45436
movl $0x1, %ecx
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x45428
xorl %ecx, %ecx
negl %eax
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2a74e
leaq 0xd8(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x29fda
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3b026
leaq 0x8(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x3b7de
leaq 0xa0c34(%rip), %rsi     # 0xe6110
leaq 0x6454d(%rip), %rdx     # 0xa9a30
leaq 0x28(%rsp), %rdi
callq 0x50fa2
leaq 0x5ce2e(%rip), %rdi     # 0xa2322
xorl %eax, %eax
callq 0x718f6
leaq 0x9d81e(%rip), %rax     # 0xe2d20
addq $0x10, %rax
leaq 0xa0(%rsp), %rdi
movq %rax, -0x78(%rdi)
callq 0x280f4
leaq 0x28(%rsp), %rdi
callq 0x5460c
leaq 0xd8(%rsp), %rdi
callq 0x2a028
xorl %eax, %eax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x9d7db(%rip), %rax     # 0xe2d20
addq $0x10, %rax
leaq 0xa0(%rsp), %rdi
movq %rax, -0x78(%rdi)
callq 0x280f4
leaq 0x28(%rsp), %rdi
callq 0x5460c
jmp 0x4556b
jmp 0x45568
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x2a028
movq %rbx, %rdi
callq 0xe7e0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x49617
leaq 0xa0578(%rip), %r13     # 0xe5b98
movsd (%r13), %xmm1
xorpd 0x5c9f2(%rip), %xmm1    # 0xa2020
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
jae 0x456a8
movsd 0x20(%rbx), %xmm2
addsd %xmm0, %xmm2
xorl %eax, %eax
ucomisd %xmm2, %xmm1
ja 0x456a8
movsd %xmm0, (%rsp)
leaq 0x28(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x3d252
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x45683
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3dc00
movq %r14, %rdi
movq %r12, %rsi
callq 0x3d252
mulsd 0x20(%rbx), %xmm0
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd (%r13), %xmm0
xorpd 0x5c981(%rip), %xmm0    # 0xa2020
xorl %eax, %eax
ucomisd %xmm0, %xmm1
adcl $-0x1, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
movsd 0x70(%rsi), %xmm0
movsd 0x78(%rsi), %xmm1
minsd 0x68(%rsi), %xmm0
minsd %xmm0, %xmm1
xorl %ebp, %ebp
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
ja 0x457c8
movq %rdi, %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0x56c7e
leaq 0x8(%rbx), %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x2a7d6
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x29fda
movq %r14, %rdi
movq %r12, %rsi
callq 0x56cba
movsd 0x68(%rbx), %xmm3
movsd 0x70(%rbx), %xmm4
movapd 0x5c8a1(%rip), %xmm2    # 0xa2020
movapd %xmm3, %xmm0
xorpd %xmm2, %xmm0
movapd %xmm4, %xmm1
xorpd %xmm2, %xmm1
movsd 0x78(%rbx), %xmm5
xorpd %xmm5, %xmm2
leaq 0x20(%rsp), %rdi
callq 0x27374
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x456b6
movl %eax, %ebp
leaq 0x20(%rsp), %rdi
callq 0x280f4
leaq 0xa0(%rsp), %rdi
callq 0x2a028
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 0x280f4
jmp 0x457ee
jmp 0x457eb
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x2a028
movq %rbx, %rdi
callq 0xe7e0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x49617
leaq 0xa0381(%rip), %rax     # 0xe5b98
addsd 0x20(%rbx), %xmm0
movsd (%rax), %xmm1
movapd 0x5c7f8(%rip), %xmm2    # 0xa2020
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_O3/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 0x455fd
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x4588c
addq $0x58, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x455fd
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_O3/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
addq $0x38, %rsi
callq 0x47a86
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x458c9
addq $0x58, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x455fd
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_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %rbx
movb $0x1, %bpl
xorl %ecx, %ecx
leaq (%rcx,%rcx,2), %r15
shlq $0x5, %r15
addq %rbx, %r15
xorl %r12d, %r12d
leaq (%r15,%r12), %rdi
movq %r14, %rsi
callq 0x4559d
testl %eax, %eax
je 0x45920
addq $0x20, %r12
cmpq $0x60, %r12
jne 0x458f6
movl $0x1, %ecx
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x458e8
xorl %ecx, %ecx
negl %eax
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %rbx
movb $0x1, %bpl
xorl %ecx, %ecx
leaq (%rcx,%rcx,2), %r15
shlq $0x5, %r15
addq %rbx, %r15
xorl %r12d, %r12d
leaq (%r15,%r12), %rdi
movq %r14, %rsi
callq 0x456b6
testl %eax, %eax
je 0x45f7f
addq $0x20, %r12
cmpq $0x60, %r12
jne 0x45f55
movl $0x1, %ecx
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x45f47
xorl %ecx, %ecx
negl %eax
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %rbx
movb $0x1, %bpl
xorl %ecx, %ecx
leaq (%rcx,%rcx,2), %r15
shlq $0x5, %r15
addq %rbx, %r15
xorl %r12d, %r12d
leaq (%r15,%r12), %rdi
movq %r14, %rsi
callq 0x456f9
testl %eax, %eax
je 0x461f1
addq $0x20, %r12
cmpq $0x60, %r12
jne 0x461c7
movl $0x1, %ecx
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x461b9
xorl %ecx, %ecx
negl %eax
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3c78e
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 0x9f85e(%rip), %rax     # 0xe5b98
movsd (%rax), %xmm1
subsd %xmm2, %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
ja 0x4636b
movapd %xmm0, %xmm2
cmpnlepd %xmm1, %xmm2
xorpd 0x5bcc5(%rip), %xmm1    # 0xa2020
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_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x8(%rdi), %r15
addq $0x68, %rsi
movq %rsi, (%rsp)
movb $0x1, %bpl
xorl %eax, %eax
leaq 0x9f7fd(%rip), %r12     # 0xe5b98
leaq (%rax,%rax,2), %r13
shlq $0x5, %r13
addq (%rsp), %r13
xorl %ebx, %ebx
leaq (%rbx,%r13), %rdi
movq %r15, %rsi
callq 0x49617
addsd 0x20(%r14), %xmm0
movsd (%r12), %xmm1
xorpd 0x5bc57(%rip), %xmm1    # 0xa2020
ucomisd %xmm0, %xmm1
ja 0x463e9
addq $0x20, %rbx
cmpq $0x60, %rbx
jne 0x463a9
movl $0x1, %eax
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x4639b
xorl %eax, %eax
ucomisd %xmm0, %xmm1
setbe %al
negl %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %r14
movb $0x1, %bpl
xorl %ecx, %ecx
leaq (%rcx,%rcx,2), %r15
shlq $0x5, %r15
addq %r14, %r15
xorl %r12d, %r12d
leaq (%r15,%r12), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x1f0(%rax)
testl %eax, %eax
je 0x4646b
addq $0x20, %r12
cmpq $0x60, %r12
jne 0x4643d
movl $0x1, %ecx
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x4642f
xorl %ecx, %ecx
negl %eax
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq