LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Vector::Draw() const
void R3Vector::
Draw(void) const
{
    // Draw vector from (0,0,0)
    R3BeginLine();
    R3LoadPoint(R3zero_point);
    R3LoadPoint((R3zero_point + *this));
    R3EndLine();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl $0x3, %edi
callq 0xe110
leaq 0x4a5e55(%rip), %r14    # 0x4e6a60
movq %r14, %rdi
callq 0xe130
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3cd71
movq %r15, %rdi
callq 0xe130
callq 0xe5d0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Line::Draw() const
void R3Line::
Draw(void) const
{
    // Draw line
    R3BeginLine();
    R3LoadPoint(Point());
    R3LoadPoint(Point() + Vector());
    R3EndLine();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl $0x3, %edi
callq 0xe110
movq %rbx, %rdi
callq 0xe130
leaq 0x18(%rbx), %rdx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3cd71
movq %r14, %rdi
callq 0xe130
callq 0xe5d0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Span::Draw() const
void R3Span::
Draw(void) const
{
    // Draw span
    R3BeginLine();
    R3LoadPoint(Start());
    R3LoadPoint(End());
    R3EndLine();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x3, %edi
callq 0xe110
movq %rbx, %rdi
callq 0xe130
addq $0x30, %rbx
movq %rbx, %rdi
callq 0xe130
popq %rbx
jmp 0xe5d0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Circle::Draw(gaps::RNFlags) const
void R3Circle::
Draw(const R3DrawFlags draw_flags) const
{
    // Push matrix (Zaxis -> ScaledNormal + OffsetToCenter)
    R4Matrix matrix = R4identity_matrix;
    matrix.Translate(center.Vector());
    matrix.Rotate(R3posz_vector, Normal());
    matrix.Push();

    // Draw surface
    if (draw_flags[R3_SURFACES_DRAW_FLAG]) {
	// Load normal
	if (draw_flags[R3_SURFACE_NORMALS_DRAW_FLAG]) 
	    R3LoadNormal(R3posz_vector);

	// Draw circle in XY plane
	R3BeginPolygon();
	for (int i = 0; i < R3circle_npoints; i++) {
	    if (draw_flags[R3_VERTEX_TEXTURE_COORDS_DRAW_FLAG]) 
		R3LoadTextureCoords(R3circle_texcoords[i]);
	    R3LoadPoint(R3circle_points[i] * radius);
	}
	R3EndPolygon();
    }

    // Draw edges
    if (draw_flags[R3_EDGES_DRAW_FLAG]) {
	R3BeginLoop();
	for (int i = 0; i < R3circle_npoints; i++) 
	    R3LoadPoint(R3circle_points[i] * radius);
	R3EndLoop();
    }

    // Pop matrix
    matrix.Pop();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x61b1a(%rip), %rsi     # 0xa2e40
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x2c5ba
movsd 0x8(%rbx), %xmm0
movsd 0x10(%rbx), %xmm1
movsd 0x18(%rbx), %xmm2
movq %rsp, %r12
movq %r12, %rdi
callq 0x3d4be
movq %r15, %rdi
movq %r12, %rsi
callq 0x2d6f4
leaq 0x28(%rbx), %rdx
leaq 0x673dd(%rip), %rsi     # 0xa8740
movq %r15, %rdi
callq 0x2dee0
movq %r15, %rdi
callq 0x40928
testb $0x2, %r14b
je 0x413ee
testb $0x20, %r14b
je 0x4138b
leaq 0x673ba(%rip), %rdi     # 0xa8740
callq 0xe6b0
movl $0x9, %edi
callq 0xe110
leaq 0x67d74(%rip), %rax     # 0xa9110
movslq (%rax), %rbp
testq %rbp, %rbp
jle 0x413e9
leaq 0x4a5fc5(%rip), %r15    # 0x4e7370
leaq 0x4a5cbe(%rip), %r12    # 0x4e7070
movq %rsp, %r13
btl $0x9, %r14d
jae 0x413c4
movq %r15, %rdi
callq 0xe120
movsd 0x20(%rbx), %xmm0
movq %r13, %rdi
movq %r12, %rsi
callq 0x3d470
movq %r13, %rdi
callq 0xe130
addq $0x10, %r15
addq $0x18, %r12
decq %rbp
jne 0x413b5
callq 0xe5d0
testb $0x1, %r14b
je 0x4143d
movl $0x2, %edi
callq 0xe110
leaq 0x67d0b(%rip), %rax     # 0xa9110
movslq (%rax), %r12
testq %r12, %r12
jle 0x41438
leaq 0x4a5c5c(%rip), %r14    # 0x4e7070
movq %rsp, %r15
movsd 0x20(%rbx), %xmm0
movq %r15, %rdi
movq %r14, %rsi
callq 0x3d470
movq %r15, %rdi
callq 0xe130
addq $0x18, %r14
decq %r12
jne 0x41417
callq 0xe5d0
callq 0xe850
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Ellipse::Draw(gaps::RNFlags) const
void R3Ellipse::
Draw(const R3DrawFlags draw_flags) const
{
    // Push matrix
    R4Matrix matrix = R4identity_matrix;
    matrix.Transform(cs.Matrix());
    matrix.Scale(R3Vector(radii.X(), radii.Y(), 1.0));
    matrix.Push();

    // Draw unit sphere
    R3unit_circle.Draw(draw_flags);

    // Pop matrix
    matrix.Pop();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x180, %rsp            # imm = 0x180
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x619cf(%rip), %rsi     # 0xa2e40
leaq 0x100(%rsp), %r14
movq %r14, %rdi
callq 0x2c5ba
leaq 0x8(%r15), %rsi
leaq 0x80(%rsp), %r12
movq %r12, %rdi
callq 0x2a996
movq %rsp, %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2e5ab
movq %r14, %rdi
movq %r13, %rsi
callq 0x2e19e
movsd 0x68(%r15), %xmm0
movsd 0x70(%r15), %xmm1
movq %rsp, %r15
movsd 0x60b70(%rip), %xmm2    # 0xa2038
movq %r15, %rdi
callq 0x3d4be
movq %r14, %rdi
movq %r15, %rsi
callq 0x2d8fa
movq %r14, %rdi
callq 0x40928
leaq 0x4a59f6(%rip), %rdi    # 0x4e6ee0
movq %rbx, %rsi
callq 0x41308
callq 0xe850
addq $0x180, %rsp            # imm = 0x180
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Polygon::Draw(gaps::RNFlags) const
void R3Polygon::
Draw(const R3DrawFlags draw_flags) const
{
    // Draw polygon
    if (draw_flags[R3_SURFACES_DRAW_FLAG]) {
        R3BeginPolygon();
        if (draw_flags[R3_SURFACE_NORMALS_DRAW_FLAG] ||
            draw_flags[R3_VERTEX_NORMALS_DRAW_FLAG])
            R3LoadNormal(plane.Normal());
        for (int i = 0; i < npoints; i++) {
            R3LoadPoint(points[i]);
        }
        R3EndPolygon();
    }
    if (draw_flags[R3_EDGES_DRAW_FLAG]) {
        R3BeginLoop();
        for (int i = 0; i < npoints; i++) {
            R3LoadPoint(points[i]);
        }
        R3EndLoop();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
testb $0x2, %r14b
je 0x41923
movl $0x9, %edi
callq 0xe110
testl $0x120, %r14d           # imm = 0x120
je 0x418f6
leaq 0x18(%rbx), %rdi
callq 0xe6b0
cmpl $0x0, 0x10(%rbx)
jle 0x4191e
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%rbx), %rdi
addq %r15, %rdi
callq 0xe130
incq %r12
movslq 0x10(%rbx), %rax
addq $0x18, %r15
cmpq %rax, %r12
jl 0x41902
callq 0xe5d0
testb $0x1, %r14b
jne 0x41935
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x2, %edi
callq 0xe110
cmpl $0x0, 0x10(%rbx)
jle 0x41967
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
addq %r14, %rdi
callq 0xe130
incq %r15
movslq 0x10(%rbx), %rax
addq $0x18, %r14
cmpq %rax, %r15
jl 0x4194b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xe5d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Sphere::Draw(gaps::RNFlags) const
void R3Sphere::
Draw(const R3DrawFlags draw_flags) const
{
    // Draw sphere - sphdraw uses n3f only ???
#if (RN_3D_GRFX == RN_OPENGL)
    // Create GLU quadric
    static GLUquadricObj *sphere = gluNewQuadric(); // ???

    // Push matrix 
    R4Matrix matrix = R4identity_matrix;
    matrix.Translate(center.Vector());
    matrix.Push();

    // Draw surface
    if (draw_flags[R3_SURFACES_DRAW_FLAG]) {
	if (draw_flags[R3_VERTEX_NORMALS_DRAW_FLAG]) gluQuadricNormals(sphere, (GLenum) GLU_SMOOTH);
	else if (draw_flags[R3_SURFACE_NORMALS_DRAW_FLAG]) gluQuadricNormals(sphere, (GLenum) GLU_FLAT);
	if (draw_flags[R3_VERTEX_TEXTURE_COORDS_DRAW_FLAG]) gluQuadricTexture(sphere, GL_TRUE);
	else gluQuadricTexture(sphere, GL_FALSE);
	gluQuadricDrawStyle(sphere, (GLenum) GLU_FILL);
	gluSphere(sphere, radius, 16, 8);
    }

    // Draw edges
    if (draw_flags[R3_EDGES_DRAW_FLAG]) {
	gluQuadricNormals(sphere, (GLenum) GLU_NONE);
	gluQuadricTexture(sphere, GL_FALSE);
	gluQuadricDrawStyle(sphere, (GLenum) GLU_SILHOUETTE);
	gluSphere(sphere, radius, 16, 8);
    }

    // Pop matrix
    matrix.Pop();
#else
    RNAbort("Not Implemented");
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movb 0x4a48f2(%rip), %al     # 0x4e6d30
testb %al, %al
je 0x42556
leaq 0x609f3(%rip), %rsi     # 0xa2e40
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x2c5ba
movsd 0x8(%rbx), %xmm0
movsd 0x10(%rbx), %xmm1
movsd 0x18(%rbx), %xmm2
movq %rsp, %r12
movq %r12, %rdi
callq 0x3d4be
movq %r15, %rdi
movq %r12, %rsi
callq 0x2d6f4
movq %r15, %rdi
callq 0x40928
testb $0x2, %r14b
je 0x424f1
movl $0x186a0, %esi          # imm = 0x186A0
btl $0x8, %r14d
jb 0x424a4
movl $0x186a1, %esi          # imm = 0x186A1
testb $0x20, %r14b
je 0x424b0
movq 0x4a487d(%rip), %rdi    # 0x4e6d28
callq 0xe1d0
movl %r14d, %esi
shrl $0x9, %esi
movq 0x4a486b(%rip), %rdi    # 0x4e6d28
andl $0x1, %esi
callq 0xe830
movq 0x4a485c(%rip), %rdi    # 0x4e6d28
movl $0x186ac, %esi          # imm = 0x186AC
callq 0xe770
movq 0x4a484b(%rip), %rdi    # 0x4e6d28
movsd 0x20(%rbx), %xmm0
movl $0x10, %esi
movl $0x8, %edx
callq 0xe220
testb $0x1, %r14b
je 0x42542
movq 0x4a482a(%rip), %rdi    # 0x4e6d28
movl $0x186a2, %esi          # imm = 0x186A2
callq 0xe1d0
movq 0x4a4819(%rip), %rdi    # 0x4e6d28
xorl %esi, %esi
callq 0xe830
movq 0x4a480b(%rip), %rdi    # 0x4e6d28
movl $0x186ad, %esi          # imm = 0x186AD
callq 0xe770
movq 0x4a47fa(%rip), %rdi    # 0x4e6d28
movsd 0x20(%rbx), %xmm0
movl $0x10, %esi
movl $0x8, %edx
callq 0xe220
callq 0xe850
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x4a47d3(%rip), %rdi    # 0x4e6d30
callq 0xe810
testl %eax, %eax
je 0x42446
callq 0xe500
movq %rax, 0x4a47b2(%rip)    # 0x4e6d28
leaq 0x4a47b3(%rip), %rdi    # 0x4e6d30
callq 0xe2e0
jmp 0x42446
movq %rax, %rbx
leaq 0x4a479f(%rip), %rdi    # 0x4e6d30
callq 0xe2d0
movq %rbx, %rdi
callq 0xe7e0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Ellipsoid::Draw(gaps::RNFlags) const
void R3Ellipsoid::
Draw(const R3DrawFlags draw_flags) const
{
    // Push matrix
    R4Matrix matrix = R4identity_matrix;
    matrix.Transform(cs.Matrix());
    matrix.Scale(radii);
    matrix.Push();

    // Draw unit sphere
    R3unit_sphere.Draw(draw_flags);

    // Pop matrix
    matrix.Pop();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x180, %rsp            # imm = 0x180
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x60885(%rip), %rsi     # 0xa2e40
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0x2c5ba
leaq 0x8(%r15), %rsi
movq %rsp, %r12
movq %r12, %rdi
callq 0x2a996
leaq 0x100(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2e5ab
movq %r14, %rdi
movq %r13, %rsi
callq 0x2e19e
addq $0x68, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2d8fa
movq %r14, %rdi
callq 0x40928
leaq 0xa3777(%rip), %rdi     # 0xe5d90
movq %rbx, %rsi
callq 0x42424
callq 0xe850
addq $0x180, %rsp            # imm = 0x180
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Line const&, gaps::R3Span const&, gaps::R3Point*, double*)
RNClassID R3Intersects(const R3Line& line, const R3Span& span, 
    R3Point *hit_point, RNScalar *hit_t)
{
    // Intersect line with span's ray
    RNScalar s;
    switch (R3Intersects(line, span.Ray(), hit_point, &s)) {
    case RN_NULL_CLASS_ID:
	// Span and line do not intersect
	return RN_NULL_CLASS_ID;

    case R3_RAY_CLASS_ID:
	// Line 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 line beyond span endpoint
	    return RN_NULL_CLASS_ID;
	}
	else {
	    // Span and line 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 %rsi, %r15
leaq 0x8(%rsp), %rcx
callq 0x42a0f
movl %eax, %ebx
movl %eax, %eax
leaq 0x66365(%rip), %rcx     # 0xa8f58
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movsd 0x8(%rsp), %xmm0
leaq 0xa2f8f(%rip), %rax     # 0xe5b98
movapd %xmm0, %xmm1
subsd 0x48(%r15), %xmm1
xorl %ebx, %ebx
ucomisd (%rax), %xmm1
ja 0x42c51
movl $0x1, %ebx
testq %r14, %r14
je 0x42c51
movsd %xmm0, (%r14)
jmp 0x42c51
leaq 0x66399(%rip), %rdi     # 0xa8fcc
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x72942
leaq 0x6639e(%rip), %rdi     # 0xa8fe1
xorl %eax, %eax
callq 0x72942
jmp 0x42c51
movl $0x4, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Line const&, gaps::R3Plane const&, gaps::R3Point*)
RNClassID R3Intersects(const R3Line& line, const R3Plane& plane, 
    R3Point *hit_point)
{
    // Compute dot product of line vector and plane normal
    RNScalar denom = plane.Normal().Dot(line.Vector());

    // Check if line and plane are parallel
    if (RNIsZero(denom)) {
	// Check if line lies in plane	
	if (R3Contains(plane, line.Point())) {
	    // Line lies in plane
	    return R3_LINE_CLASS_ID;
	}
	else {
	    // Line is parallel to plane, but not in it
	    return RN_NULL_CLASS_ID;
	}
    }
    else {
	// Line and plane are not parallel - they must intersect at a point
	if (hit_point) {
	    RNScalar t = -(R3SignedDistance(plane, line.Point())) / denom;
	    *hit_point = line.Point() + line.Vector() * t;
	}
	return R3_POINT_CLASS_ID;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
leaq 0x18(%rdi), %r15
movq %rsi, %rdi
movq %r15, %rsi
callq 0x3d756
leaq 0xa2f10(%rip), %rax     # 0xe5b98
movsd (%rax), %xmm2
movapd 0x5f38c(%rip), %xmm1    # 0xa2020
xorpd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x42cbb
ucomisd %xmm0, %xmm2
jb 0x42cbb
movq %r12, %rdi
movq %r14, %rsi
callq 0x47841
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
addl %ebp, %ebp
jmp 0x42d12
movl $0x1, %ebp
testq %rbx, %rbx
je 0x42d12
movq %r12, %rdi
movq %r14, %rsi
movsd %xmm0, 0x8(%rsp)
callq 0x4a10f
xorpd 0x5f342(%rip), %xmm0    # 0xa2020
divsd 0x8(%rsp), %xmm0
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3de8e
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3cd71
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3cd94
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Line const&, gaps::R3Triangle const&, gaps::R3Point*)
RNClassID R3Intersects(const R3Line& line, const R3Triangle& triangle, 
    R3Point *hit_point)
{
    // Find intersection of line and plane
    R3Point p;
    switch (R3Intersects(line, triangle.Plane(), &p)) {
    case RN_NULL_CLASS_ID:
	// Line does not intersect triangle plane
	return RN_NULL_CLASS_ID;
	
    case R3_POINT_CLASS_ID:
	// Line intersects triangle plane in a single point
	// Check whether triangle contains intersection point
	if (!R3Contains(triangle, p)) return RN_NULL_CLASS_ID;
	if (hit_point) *hit_point = p;
	return R3_POINT_CLASS_ID;

    case R3_LINE_CLASS_ID: 
	// Line lies in triangle plane 
	// Intersect line and triangle 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 %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x3ca24
leaq 0x20(%r14), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x42c5d
movl %eax, %ebp
testl %eax, %eax
je 0x42d90
cmpl $0x2, %ebp
jne 0x42d64
movl $0x4, %ebp
jmp 0x42d90
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x47c1f
testl %eax, %eax
je 0x42d8e
movl $0x1, %ebp
testq %rbx, %rbx
je 0x42d90
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x3cd94
jmp 0x42d90
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Line const&, gaps::R3Halfspace const&, gaps::R3Ray*)
RNClassID R3Intersects(const R3Line& line, const R3Halfspace& halfspace, 
    R3Ray *result)
{
    // Compute dot product of line vector and halfspace plane normal
    RNScalar denom = halfspace.Plane().Normal().Dot(line.Vector());

    // Check if line and halfspace plane are parallel
    if (RNIsZero(denom)) {
	// Check if line lies in halfspace
	if (R3Contains(halfspace, line.Point())) {
	    // Line lies in halfspace
	    return R3_LINE_CLASS_ID;
	}
	else {
	    // Line is parallel to halfspace plane, but not in halfspace
	    return RN_NULL_CLASS_ID;
	}
    }
    else {
	// Line and halfspace plane are not parallel - intersection must be a ray
	if (result) {
	    RNScalar t = -(R3SignedDistance(halfspace.Plane(), line.Point())) / denom;
	    R3Point point = line.Point() + line.Vector() * t;
	    R3Vector vector = (RNIsPositive(denom)) ? line.Vector() : -(line.Vector());
	    *result = R3Ray(point, vector);
	}
	return R3_RAY_CLASS_ID;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
leaq 0x18(%rdi), %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x3d756
leaq 0xa2dcc(%rip), %r13     # 0xe5b98
movsd (%r13), %xmm2
movapd 0x5f246(%rip), %xmm1    # 0xa2020
xorpd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x42e04
ucomisd %xmm0, %xmm2
jb 0x42e04
movq %r12, %rdi
movq %r15, %rsi
callq 0x48368
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
addl %ebp, %ebp
jmp 0x42ead
movl $0x3, %ebp
testq %rbx, %rbx
je 0x42ead
movq %r12, %rdi
movq %r15, %rsi
movsd %xmm0, (%rsp)
callq 0x4a10f
xorpd 0x5f1f6(%rip), %xmm0    # 0xa2020
divsd (%rsp), %xmm0
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x3de8e
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3cd71
movsd (%rsp), %xmm0
ucomisd (%r13), %xmm0
ja 0x42e6b
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x3e154
jmp 0x42e78
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x3d4ce
leaq 0x38(%rsp), %r14
leaq 0x20(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x3c614
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3cd94
addq $0x18, %rbx
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0x3dc6a
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_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Line const&, gaps::R3OrientedBox const&, gaps::R3Point*)
RNClassID R3Intersects(const R3Line& line, const R3OrientedBox& box, 
    R3Point *hit_point)
{
    // Check if box is empty
    if (box.IsEmpty()) return RN_NULL_CLASS_ID;

    // Transform line into std coordinate system
    R3Line transformed_line = line;
    R3Affine cs_to_std_xform(box.CoordSystem().InverseMatrix());
    transformed_line.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_line, axis_aligned_box, hit_point);
    if (status == RN_NULL_CLASS_ID) return RN_NULL_CLASS_ID;

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

    // Return whether hit
    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq %rsi, %r15
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 0x431d3
movq %rdx, %rbx
movq %rdi, %rsi
leaq 0x38(%rsp), %r12
movq %r12, %rdi
callq 0x3c712
leaq 0x8(%r15), %r14
leaq 0x68(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x2aa1e
leaq 0x1f8(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2a22e
movq %r12, %rdi
movq %rbp, %rsi
callq 0x3c920
movsd 0x68(%r15), %xmm3
movsd 0x70(%r15), %xmm4
movapd 0x5eede(%rip), %xmm2    # 0xa2020
movapd %xmm3, %xmm0
xorpd %xmm2, %xmm0
movapd %xmm4, %xmm1
xorpd %xmm2, %xmm1
movsd 0x78(%r15), %xmm5
xorpd %xmm5, %xmm2
movq %rsp, %rdi
callq 0x27590
leaq 0x38(%rsp), %rdi
movq %rsp, %rsi
movq %rbx, %rdx
callq 0x42ebe
movl %eax, %ebp
testl %eax, %eax
je 0x431bc
testq %rbx, %rbx
je 0x431be
leaq 0x178(%rsp), %rdi
movq %r14, %rsi
callq 0x2a996
leaq 0x68(%rsp), %rdi
leaq 0x178(%rsp), %rsi
xorl %edx, %edx
callq 0x2a22e
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x3d342
leaq 0x68(%rsp), %rdi
callq 0x2a27c
jmp 0x431be
xorl %ebp, %ebp
movq %rsp, %rdi
callq 0x28348
leaq 0x1f8(%rsp), %rdi
callq 0x2a27c
movl %ebp, %eax
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x2a27c
jmp 0x431fb
jmp 0x431f8
movq %rax, %rbx
movq %rsp, %rdi
callq 0x28348
jmp 0x4320a
jmp 0x43207
movq %rax, %rbx
leaq 0x1f8(%rsp), %rdi
callq 0x2a27c
movq %rbx, %rdi
callq 0xe7e0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Line const&, gaps::R3Sphere const&, gaps::R3Point*)
RNClassID R3Intersects(const R3Line& line, const R3Sphere& sphere, 
    R3Point *hit_point)
{
    // Check if sphere contains line point
    if (R3Contains(sphere, line.Point())) {
	if (hit_point) *hit_point = line.Point();
	return R3_SPAN_CLASS_ID;
    }
    else {
	// Check if line points towards sphere
	R3Vector EO = sphere.Center() - line.Point();
	RNScalar v = EO.Dot(line.Vector());

	// Compute possible intersection -- Graphics Gems I, p. 388    
	RNScalar disc = sphere.Radius() * sphere.Radius() - (EO.Dot(EO) - v*v);
	if (RNIsNegative(disc)) {
	    // No intersection
	    return RN_NULL_CLASS_ID;
	}
	else {
	    // Line intersects sphere (it grazes if disc is zero)
	    if (hit_point) {
		RNScalar d = sqrt(disc);
		RNScalar t = v - d;
		*hit_point = line.Point() + t * line.Vector();
	    }
	    
	    // Return result
	    if (RNIsZero(disc)) return R3_POINT_CLASS_ID;
	    else return R3_SPAN_CLASS_ID;
	}
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x4949b
testl %eax, %eax
je 0x43263
movl $0x4, %ebp
testq %rbx, %rbx
je 0x43372
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3cd94
jmp 0x43372
leaq 0x8(%r12), %rsi
leaq 0x40(%rsp), %r13
movq %r13, %rdi
movq %r14, %rdx
callq 0x3cc88
leaq 0x18(%r14), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x3d756
movsd %xmm0, 0x8(%rsp)
movsd 0x20(%r12), %xmm0
movsd %xmm0, (%rsp)
movq %r13, %rdi
movq %r13, %rsi
callq 0x3d756
movsd (%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm1
subsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
leaq 0xa28d6(%rip), %r13     # 0xe5b98
movsd (%r13), %xmm1
xorpd 0x5ed50(%rip), %xmm1    # 0xa2020
subsd %xmm0, %xmm2
xorl %ebp, %ebp
ucomisd %xmm2, %xmm1
ja 0x43372
testq %rbx, %rbx
je 0x43347
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
movsd %xmm2, (%rsp)
jb 0x432fd
xorps %xmm0, %xmm0
sqrtsd %xmm2, %xmm0
jmp 0x43306
movapd %xmm2, %xmm0
callq 0xe340
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movapd %xmm1, %xmm0
callq 0x3de8e
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3cd71
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3cd94
movsd (%rsp), %xmm2
movsd (%r13), %xmm0
movapd 0x5eccb(%rip), %xmm1    # 0xa2020
xorl %eax, %eax
ucomisd %xmm2, %xmm0
xorpd %xmm0, %xmm1
setb %al
ucomisd %xmm1, %xmm2
leal 0x1(%rax,%rax,2), %eax
movl $0x4, %ebp
cmovael %eax, %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_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Ray const&, gaps::R3Span const&, gaps::R3Point*, double*, double*)
RNClassID R3Intersects(const R3Ray& ray, const R3Span& span, 
    R3Point *hit_point, RNScalar *hit_tray, RNScalar *hit_tspan)
{
    // Intersect ray with span's ray
    RNScalar s1 = 0, s2 = 0;
    switch (R3Intersects(ray, span.Ray(), hit_point, &s1, &s2)) {
    case RN_NULL_CLASS_ID:
	// Span and ray do not intersect
	return RN_NULL_CLASS_ID;

    case R3_SPAN_CLASS_ID:
	// Ray and span point at each other on same line
	return R3_SPAN_CLASS_ID;

    case R3_RAY_CLASS_ID:
	// Ray and span point in same direction on same line
	if (RNIsGreater(s2, span.Length())) {
	    // Intersection is beyond span endpoint 
	    return RN_NULL_CLASS_ID;
	}
	else if (RNIsEqual(s2, span.Length())) {
	    // Span endpoint is ray start point
	    if (hit_tray) *hit_tray = s1;
	    if (hit_tspan) *hit_tspan = s2;
	    return R3_POINT_CLASS_ID;
	}
	else {
	    // Span and ray have non-null intersection in same line
	    return R3_SPAN_CLASS_ID;
	}
	break;

    case R3_POINT_CLASS_ID: 
	// Check if intersection point is on span
	if (RNIsGreater(s2, span.Length())) {
	    // Intersection is beyond span endpoint 
	    return RN_NULL_CLASS_ID;
	}
	else {
	    // Span and ray intersect at point
	    if (hit_tray) *hit_tray = s1;
	    if (hit_tspan) *hit_tspan = 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 %rbx
subq $0x10, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, %r15
xorl %eax, %eax
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq %rsp, %r8
movq %rax, (%r8)
callq 0x433ab
cmpl $0x4, %eax
ja 0x435bb
movl %eax, %ecx
leaq 0x65a41(%rip), %rdx     # 0xa8f78
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movsd (%rsp), %xmm0
movapd %xmm0, %xmm1
subsd 0x48(%r15), %xmm1
leaq 0xa2642(%rip), %rax     # 0xe5b98
ucomisd (%rax), %xmm1
jbe 0x4359b
jmp 0x435d7
movsd (%rsp), %xmm0
leaq 0xa262e(%rip), %rax     # 0xe5b98
movsd (%rax), %xmm1
movapd %xmm0, %xmm2
subsd 0x48(%r15), %xmm2
ucomisd %xmm1, %xmm2
ja 0x435d7
movapd 0x5ea9a(%rip), %xmm3    # 0xa2020
xorpd %xmm1, %xmm3
ucomisd %xmm3, %xmm2
movl $0x4, %eax
jb 0x435d9
ucomisd %xmm2, %xmm1
jb 0x435d9
testq %r14, %r14
je 0x435ab
movsd 0x8(%rsp), %xmm1
movsd %xmm1, (%r14)
movl $0x1, %eax
testq %rbx, %rbx
je 0x435d9
movsd %xmm0, (%rbx)
jmp 0x435d9
leaq 0x65a0a(%rip), %rdi     # 0xa8fcc
xorl %eax, %eax
callq 0x72942
leaq 0x65a11(%rip), %rdi     # 0xa8fe1
xorl %eax, %eax
callq 0x72942
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Ray const&, gaps::R3Plane const&, gaps::R3Point*, double*)
RNClassID R3Intersects(const R3Ray& ray, const R3Plane& plane, 
    R3Point *hit_point, RNScalar *hit_t)
{
    // Compute dot product of ray vector and plane normal
    RNScalar denom = plane.Normal().Dot(ray.Vector());

    // Check if ray and plane are parallel
    if (RNIsZero(denom)) {
	// Check if ray lies in plane	
	if (R3Contains(plane, ray.Start())) {
	    // Ray lies in plane
	    return R3_RAY_CLASS_ID;
	}
	else {
	    // Ray is parallel to plane, but not in it
	    return RN_NULL_CLASS_ID;
	}
    }
    else {
	// Ray and plane are not parallel - compute parametric value on ray
	RNScalar s = -(R3SignedDistance(plane, ray.Start())) / denom;
	if (RNIsNegative(s)) {
	    // Ray is directed away from plane
	    return RN_NULL_CLASS_ID;
	}
	else {
	    // Ray is not parallel to plane and is pointing at plane - it must intersect
	    if (hit_point) *hit_point = ray.Start() + ray.Vector() * s;
	    if (hit_t) *hit_t = s;
	    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, %r13
movq %rdi, %r15
leaq 0x18(%rdi), %r12
movq %rsi, %rdi
movq %r12, %rsi
callq 0x3d756
leaq 0xa2585(%rip), %rbp     # 0xe5b98
movsd (%rbp), %xmm2
movapd 0x5ea00(%rip), %xmm1    # 0xa2020
xorpd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x43647
ucomisd %xmm0, %xmm2
jb 0x43647
movq %r13, %rdi
movq %r15, %rsi
callq 0x47841
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leal (%rcx,%rcx,2), %eax
jmp 0x436c4
movq %r13, %rdi
movq %r15, %rsi
movsd %xmm0, (%rsp)
callq 0x4a10f
movapd 0x5e9c1(%rip), %xmm2    # 0xa2020
xorpd %xmm2, %xmm0
divsd (%rsp), %xmm0
movsd (%rbp), %xmm1
xorpd %xmm2, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
ja 0x436c4
testq %r14, %r14
je 0x436b6
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movapd %xmm0, (%rsp)
callq 0x3de8e
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x3cd71
movq %r14, %rdi
movq %r12, %rsi
callq 0x3cd94
movapd (%rsp), %xmm0
movl $0x1, %eax
testq %rbx, %rbx
je 0x436c4
movsd %xmm0, (%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Isect.cpp
// Function: gaps::R3Intersects(gaps::R3Ray const&, gaps::R3Halfspace const&, gaps::R3Point*, double*)
RNClassID R3Intersects(const R3Ray& ray, const R3Halfspace& halfspace, 
    R3Point *hit_point, RNScalar *hit_t)
{
    // Check if halfspace contains point
    RNBoolean pinside = R3Contains(halfspace, ray.Start());

    // Check whether vectors point in same direction
    RNBoolean vinside = RNIsPositive(halfspace.Normal().Dot(ray.Vector()));

    // Classify ray with respect to halfspace
    if (pinside) {
	// Start point of ray is inside halfspace
	if (hit_point) *hit_point = ray.Start();
	if (hit_t) *hit_t = 0.0;
	if (vinside) return R3_RAY_CLASS_ID;
	else return R3_SPAN_CLASS_ID;
    }
    else {
	if (vinside) return R3Intersects(ray, halfspace.Plane(), hit_point, hit_t);
	else return RN_NULL_CLASS_ID;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, %rdi
movq %r15, %rsi
callq 0x48368
movl %eax, %ebp
leaq 0x18(%r15), %rsi
movq %r12, %rdi
callq 0x3d756
leaq 0xa248d(%rip), %rax     # 0xe5b98
movsd (%rax), %xmm1
testl %ebp, %ebp
je 0x43753
testq %r14, %r14
je 0x43739
movq %r14, %rdi
movq %r15, %rsi
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, (%rsp)
callq 0x3cd94
movsd (%rsp), %xmm1
movsd 0x8(%rsp), %xmm0
testq %rbx, %rbx
je 0x43745
movq $0x0, (%rbx)
xorl %eax, %eax
ucomisd %xmm1, %xmm0
setbe %al
addl $0x3, %eax
jmp 0x4375b
xorl %eax, %eax
ucomisd %xmm1, %xmm0
ja 0x43768
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x435e3
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3ca24
leaq 0x20(%r13), %r15
leaq 0x8(%rsp), %rcx
movq %rbp, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x435e3
xorl %ebp, %ebp
movl %eax, %eax
leaq 0x657ba(%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 0x47c1f
testl %eax, %eax
je 0x4384a
testq %rbx, %rbx
je 0x43805
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x3cd94
testq %r12, %r12
je 0x43815
movq %r12, %rdi
movq %r15, %rsi
callq 0x3dc6a
movl $0x1, %ebp
testq %r14, %r14
je 0x4384a
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%r14)
jmp 0x4384a
leaq 0x657c4(%rip), %rdi     # 0xa8ff7
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x72942
leaq 0x6579e(%rip), %rdi     # 0xa8fe1
xorl %eax, %eax
callq 0x72942
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_O1/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 0x43992
testl %eax, %eax
je 0x43981
movq %rbx, 0x18(%rsp)
cmpl $0x0, 0x24(%r12)
jle 0x43953
movq %r14, 0x20(%rsp)
xorl %r14d, %r14d
movsd 0x5e78d(%rip), %xmm0    # 0xa2040
movsd %xmm0, 0x8(%rsp)
leaq 0x40(%rsp), %rbx
leaq 0x28(%rsp), %rbp
movq $0x0, (%rsp)
movq %rbx, %rdi
callq 0x3ca24
movq %rbp, %rdi
callq 0x3d4bc
movq 0x18(%r12), %rax
movq (%rax,%r14,8), %rsi
movq %r13, %rdi
movq %rbx, %rdx
movq %rbp, %rcx
leaq 0x10(%rsp), %r8
callq 0x43785
testl %eax, %eax
je 0x43940
movsd 0x8(%rsp), %xmm0
ucomisd 0x10(%rsp), %xmm0
jbe 0x43940
testq %r15, %r15
je 0x43919
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3cd94
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x4392b
movq %rbp, %rsi
callq 0x3dc6a
movl $0x1, %eax
movq %rax, (%rsp)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
incq %r14
movslq 0x24(%r12), %rax
cmpq %rax, %r14
jl 0x438cb
jmp 0x43969
movsd 0x5e6e5(%rip), %xmm0    # 0xa2040
movsd %xmm0, 0x8(%rsp)
movq $0x0, (%rsp)
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x4397d
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_O1/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 0x43d95
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
movq %r8, 0x8(%rsp)
leaq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq 0x3ca24
leaq 0x28(%r13), %r12
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x435e3
movl %eax, %ebp
movl %eax, %eax
leaq 0x652d0(%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 0x3cc88
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 0xa1e6d(%rip), %rax     # 0xe5b98
xorl %ebp, %ebp
ucomisd (%rax), %xmm1
ja 0x43d95
testq %r15, %r15
je 0x43d45
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
callq 0x3cd94
testq %r14, %r14
je 0x43d55
movq %r14, %rdi
movq %r12, %rsi
callq 0x3dc6a
movl $0x1, %ebp
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0x43d95
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x43d95
leaq 0x65280(%rip), %rdi     # 0xa8ff7
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x72942
leaq 0x6525a(%rip), %rdi     # 0xa8fe1
xorl %eax, %eax
callq 0x72942
jmp 0x43d95
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_O1/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 0x43ea8
movq %rsi, %r13
ucomisd 0x70(%rsi), %xmm0
ja 0x43ea8
movq %rdx, %r15
movq %rdi, %rbx
movq %rcx, 0x8(%rsp)
movq %r8, 0x10(%rsp)
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
callq 0x3ca24
leaq 0x8(%r13), %rsi
leaq 0x50(%r13), %r12
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movq %r12, %rdx
callq 0x3b5a6
leaq 0x18(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x435e3
movl %eax, %ebp
movl %eax, %eax
leaq 0x65186(%rip), %rcx     # 0xa8fac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0x4816b
testl %eax, %eax
je 0x43ea6
testq %r15, %r15
je 0x43e52
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0x3cd94
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x43e64
movq %r12, %rsi
callq 0x3dc6a
movl $0x1, %ebp
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x43ea8
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x43ea8
leaq 0x65171(%rip), %rdi     # 0xa8ff7
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x72942
leaq 0x6514b(%rip), %rdi     # 0xa8fe1
xorl %eax, %eax
callq 0x72942
jmp 0x43ea8
movl $0x4, %ebp
jmp 0x43ea8
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_O1/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 0x43fb9
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 0x3ca24
leaq 0x8(%r13), %rsi
leaq 0x50(%r13), %r12
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movq %r12, %rdx
callq 0x3b5a6
leaq 0x18(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x435e3
movl %eax, %ebp
movl %eax, %eax
leaq 0x65085(%rip), %rcx     # 0xa8fbc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0x48270
testl %eax, %eax
je 0x43fb7
testq %r15, %r15
je 0x43f63
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0x3cd94
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x43f75
movq %r12, %rsi
callq 0x3dc6a
movl $0x1, %ebp
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x43fb9
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x43fb9
leaq 0x65060(%rip), %rdi     # 0xa8ff7
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x72942
leaq 0x6503a(%rip), %rdi     # 0xa8fe1
xorl %eax, %eax
callq 0x72942
jmp 0x43fb9
movl $0x4, %ebp
jmp 0x43fb9
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_O1/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 0x44122
movq %r8, %r15
movq %rdx, %r14
movq %rdi, %rsi
movq %rcx, 0x8(%rsp)
leaq 0x48(%rsp), %rbp
movq %rbp, %rdi
callq 0x3c60e
leaq 0x8(%r13), %rsi
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movq %rsi, (%rsp)
callq 0x2aa1e
leaq 0x208(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x2a22e
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x3c6e8
movsd 0x68(%r13), %xmm3
movsd 0x70(%r13), %xmm4
movapd 0x5dfbb(%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 0x27590
movq 0x8(%rsp), %rbx
leaq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r15, %r8
callq 0x43992
movl %eax, %ebp
testl %eax, %eax
je 0x44109
movq %r14, %rax
orq %rbx, %rax
je 0x4410b
leaq 0x188(%rsp), %rdi
movq (%rsp), %rsi
callq 0x2a996
leaq 0x78(%rsp), %rdi
leaq 0x188(%rsp), %rsi
xorl %edx, %edx
callq 0x2a22e
testq %r14, %r14
je 0x440eb
leaq 0x78(%rsp), %rsi
movq %r14, %rdi
callq 0x3d342
testq %rbx, %rbx
je 0x440fd
leaq 0x78(%rsp), %rsi
movq %rbx, %rdi
callq 0x3e09a
leaq 0x78(%rsp), %rdi
callq 0x2a27c
jmp 0x4410b
xorl %ebp, %ebp
leaq 0x10(%rsp), %rdi
callq 0x28348
leaq 0x208(%rsp), %rdi
callq 0x2a27c
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 0x2a27c
jmp 0x4414a
jmp 0x44147
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x28348
jmp 0x4415b
jmp 0x44158
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0x2a27c
movq %rbx, %rdi
callq 0xe7e0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x49a1a
testl %eax, %eax
je 0x44f53
testq %r15, %r15
je 0x44f33
movq %r15, %rdi
movq %r12, %rsi
callq 0x3cd94
testq %r14, %r14
je 0x44f47
leaq 0x637a1(%rip), %rsi     # 0xa86e0
movq %r14, %rdi
callq 0x3dc6a
testq %rbx, %rbx
je 0x44f53
movq $0x0, (%rbx)
leaq 0x5d3c8(%rip), %rdi     # 0xa2322
xorl %eax, %eax
callq 0x72942
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq