LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Cont.cpp
// Function: gaps::R2Contains(gaps::R2Box const&, gaps::R2Circle const&)
RNBoolean R2Contains(const R2Box& box, const R2Circle& circle)
{
    // Return whether box contains circle 
    if (box.IsEmpty()) return FALSE;
    if (circle.IsEmpty()) return TRUE;
    if (RNIsLess(circle.Center().X() - circle.Radius(), box.XMin())) return FALSE;
    if (RNIsLess(circle.Center().Y() - circle.Radius(), box.YMin())) return FALSE;
    if (RNIsGreater(circle.Center().X() + circle.Radius(), box.XMax())) return FALSE;
    if (RNIsGreater(circle.Center().Y() + circle.Radius(), box.YMax())) return FALSE;
    return TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x50606
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x501b5
movsd 0x18(%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x501b2
movsd 0x8(%r14), %xmm2
movapd %xmm2, %xmm3
subsd %xmm0, %xmm3
leaq 0x8aa4d(%rip), %rcx     # 0xdaba8
movsd (%rcx), %xmm1
subsd 0x8(%rbx), %xmm3
movapd 0x42ec4(%rip), %xmm4    # 0x93030
xorpd %xmm1, %xmm4
ucomisd %xmm3, %xmm4
ja 0x501b5
movsd 0x10(%r14), %xmm3
movapd %xmm3, %xmm5
subsd %xmm0, %xmm5
subsd 0x10(%rbx), %xmm5
ucomisd %xmm5, %xmm4
ja 0x501b5
addsd %xmm0, %xmm2
subsd 0x18(%rbx), %xmm2
ucomisd %xmm1, %xmm2
ja 0x501b5
addsd %xmm3, %xmm0
subsd 0x20(%rbx), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
setbe %al
jmp 0x501b5
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Cont.cpp
// Function: gaps::R2Contains(gaps::R2Circle const&, gaps::R2Point const&)
RNBoolean R2Contains(const R2Circle& circle, const R2Point& point)
{
    // Return whether circle contains point
    RNScalar radius_squared = circle.Radius() * circle.Radius();
    R2Vector v = circle.Center() - point;
    RNScalar distance_squared = v.X() * v.X() + v.Y() * v.Y();
    return RNIsLessOrEqual(distance_squared, radius_squared);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rdx
movsd 0x18(%rdi), %xmm0
mulsd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x8(%rdi), %rsi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x5f7c9
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
subsd 0x8(%rsp), %xmm0
leaq 0x8a98e(%rip), %rax     # 0xdaba8
movsd (%rax), %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
setae %al
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Cont.cpp
// Function: gaps::R2Contains(gaps::R2Circle const&, gaps::R2Span const&)
RNBoolean R2Contains(const R2Circle& circle, const R2Span& span)
{
    // Return whether circle contains span
    if (!R2Contains(circle, span.Start())) return FALSE;
    if (!R2Contains(circle, span.End())) return FALSE;
    return TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x28, %rsi
callq 0x501d0
testl %eax, %eax
je 0x502c2
addq $0x38, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x501d0
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
jmp 0x502c4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Cont.cpp
// Function: gaps::R2Contains(gaps::R2Circle const&, gaps::R2Box const&)
RNBoolean R2Contains(const R2Circle& circle, const R2Box& box)
{
    // Return whether circle contains box 
    R2Vector v = box.Centroid() - circle.Center();
    R2Point corner = box.Corner(v.Quadrant());
    return R2Contains(circle, corner);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x5ce16
leaq 0x8(%r14), %rdx
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x5f7c9
movq %r12, %rdi
callq 0x5f9f8
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x5cce2
movq %r14, %rdi
movq %r15, %rsi
callq 0x501d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Cont.cpp
// Function: gaps::R2Contains(gaps::R2Polygon const&, gaps::R2Point const&)
RNBoolean R2Contains(const R2Polygon& polygon, const R2Point& point)
{
    // Return whether polygon contains point
    int ncrossings = 0;
    R2Ray ray(point, R2Vector(0.12345, 0.9923508));
    for (int i = 0; i < polygon.NPoints(); i++) {
        const R2Point& p0 = polygon.Point(i);
        const R2Point& p1 = polygon.Point((i+1)%polygon.NPoints());
        if (R2Intersects(ray, R2Span(p0, p1))) ncrossings++;
    }

    // Check odd-crossing rule
    return (ncrossings % 2) ? TRUE : FALSE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x38(%rsp), %r14
movsd 0x49ea2(%rip), %xmm0    # 0x9a280
movsd 0x49ea2(%rip), %xmm1    # 0x9a288
movq %r14, %rdi
callq 0x5f8b4
movq %rsp, %r15
xorl %r13d, %r13d
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x5ee6e
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq 0x10(%rbx), %rcx
cmpq %rcx, %r12
jge 0x50450
movq 0x8(%rbx), %rdi
leaq (%rdi,%r13), %rsi
incq %r12
movl %r12d, %eax
cltd
idivl %ecx
shlq $0x4, %rdx
addq %rdi, %rdx
movq %r14, %rdi
callq 0x5e5de
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x50b6a
cmpl $0x1, %eax
sbbl $-0x1, %ebp
addq $0x10, %r13
jmp 0x50409
andl $0x1, %ebp
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Cont.cpp
// Function: gaps::R2Contains(gaps::R2Polygon const&, gaps::R2Span const&)
RNBoolean R2Contains(const R2Polygon& polygon, const R2Span& span)
{
    // Return whether polygon contains span (this is not right, because polygon can be concave)
    if (!R2Contains(polygon, span.Start())) return FALSE;
    if (!R2Contains(polygon, span.End())) return FALSE;
    return TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x28, %rsi
callq 0x503ba
testl %eax, %eax
je 0x504be
addq $0x38, %rbx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x503ba
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Isect.cpp
// Function: gaps::R2Intersects(gaps::R2Point const&, gaps::R2Span const&, double*)
RNClassID R2Intersects(const R2Point& point, const R2Span& span, RNScalar *hit_t)
{
    // Check if span contains point
    if (R2Contains(span, point)) {
	// Point lies on span
	if (hit_t) *hit_t = span.T(point);
	return R2_POINT_CLASS_ID;
    }
    else {
	// Point is not on span
	return RN_NULL_CLASS_ID;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x4fc28
testl %eax, %eax
je 0x506da
pushq $0x1
popq %rbp
testq %rbx, %rbx
je 0x506dc
movq %r15, %rdi
movq %r14, %rsi
callq 0x5ef24
movsd %xmm0, (%rbx)
jmp 0x506dc
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Isect.cpp
// Function: gaps::R2Intersects(gaps::R2Line const&, gaps::R2Ray const&, gaps::R2Point*, double*)
RNClassID R2Intersects(const R2Line& line, const R2Ray& ray, 
    R2Point *hit_point, RNScalar *hit_t)
{
    // Get variables in more convenient form
    const R2Vector& n1 = line.Normal();
    const RNScalar c1 = line.C();
    const R2Vector p2 = ray.Start().Vector();
    const R2Vector& v2 = ray.Vector();

    // Check if line and ray are parallel
    RNScalar denom = n1.Dot(v2);
    if (RNIsZero(denom)) {
	// Check if line and ray are coincident
	if (R2Contains(line, ray.Start())) {
	    // Line and ray are coincident
	    return R2_RAY_CLASS_ID;
	}
	else {
	    // Lines are parallel and do not intersect
	    return RN_NULL_CLASS_ID;
	}
    }
    else {
	// Find parametric value on ray of intersection point between lines
        RNScalar t = (c1 + n1.Dot(p2)) / -denom;

	// Check if intersection point is on ray
	if (RNIsPositiveOrZero(t)) {
	    if (hit_point) *hit_point = ray.Point(t);
	    if (hit_t) *hit_t = t;
	    return R2_POINT_CLASS_ID;
	}
	else {
	    // Line and ray do not intersect
	    return RN_NULL_CLASS_ID;
	}
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
leaq 0x10(%rdi), %r12
movsd 0x20(%rdi), %xmm0
movsd %xmm0, (%rsp)
leaq 0x28(%rsi), %rbp
leaq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x51538
movq %r12, %rdi
movq %r15, %rsi
callq 0x5fa20
leaq 0x8a36d(%rip), %rbx     # 0xdaba8
movsd (%rbx), %xmm2
movapd 0x427e9(%rip), %xmm1    # 0x93030
xorpd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x50871
ucomisd %xmm0, %xmm2
jb 0x50871
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4f917
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leal (%rcx,%rcx,2), %eax
jmp 0x508f2
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
movapd %xmm0, 0x10(%rsp)
callq 0x5fa20
movsd (%rsp), %xmm2
addsd %xmm0, %xmm2
movapd 0x4279b(%rip), %xmm0    # 0x93030
movapd 0x10(%rsp), %xmm1
xorpd %xmm0, %xmm1
divsd %xmm1, %xmm2
movsd (%rbx), %xmm1
xorpd %xmm0, %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm2
jb 0x508f2
testq %r14, %r14
je 0x508e1
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movapd %xmm2, %xmm0
movsd %xmm2, (%rsp)
callq 0x5eeee
movq %r14, %rdi
movq %r12, %rsi
callq 0x5f6c4
movsd (%rsp), %xmm2
pushq $0x1
popq %rax
movq 0x8(%rsp), %rcx
testq %rcx, %rcx
je 0x508f2
movsd %xmm2, (%rcx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Isect.cpp
// Function: gaps::R2Intersects(gaps::R2Line const&, gaps::R2Span const&, gaps::R2Point*, double*)
RNClassID R2Intersects(const R2Line& line, const R2Span& span, 
    R2Point *hit_point, RNScalar *hit_t)
{
    // Intersect line with span's ray
    RNScalar s;
    switch (R2Intersects(line, span.Ray(), hit_point, &s)) {
    case RN_NULL_CLASS_ID:
	// Span and line do not intersect
	return RN_NULL_CLASS_ID;

    case R2_RAY_CLASS_ID:
	// Line contains span
	return R2_SPAN_CLASS_ID;

    case R2_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 R2_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 0x507ee
movl %eax, %ebx
movl %eax, %eax
leaq 0x4996b(%rip), %rcx     # 0x9a290
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movsd 0x8(%rsp), %xmm0
leaq 0x8a26d(%rip), %rax     # 0xdaba8
movapd %xmm0, %xmm1
subsd 0x48(%r15), %xmm1
xorl %ebx, %ebx
ucomisd (%rax), %xmm1
ja 0x5097f
pushq $0x1
popq %rbx
testq %r14, %r14
je 0x5097f
movsd %xmm0, (%r14)
jmp 0x5097f
leaq 0x49619(%rip), %rdi     # 0x99f7c
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x680f0
leaq 0x4961e(%rip), %rdi     # 0x99f91
xorl %eax, %eax
callq 0x680f0
jmp 0x5097f
pushq $0x4
popq %rbx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Isect.cpp
// Function: gaps::R2Intersects(gaps::R2Ray const&, gaps::R2Span const&, gaps::R2Point*, double*, double*)
RNClassID R2Intersects(const R2Ray& ray, const R2Span& span, 
    R2Point *hit_point, RNScalar *hit_tray, RNScalar *hit_tspan)
{
    // Intersect ray with span's ray
    RNScalar s;
    switch (R2Intersects(ray, span.Ray(), hit_point, hit_tray, &s)) {
    case RN_NULL_CLASS_ID:
	// Span and ray do not intersect
	return RN_NULL_CLASS_ID;

    case R2_RAY_CLASS_ID:
	// Ray contains span
	return R2_SPAN_CLASS_ID;

    case R2_POINT_CLASS_ID: 
	// Check if intersection point is on span
	if (RNIsGreater(s, span.Length())) {
	    // Span's ray intersects ray beyond span endpoint
	    return RN_NULL_CLASS_ID;
	}
	else {
	    // Span and ray intersect at point
	    if (hit_tspan) *hit_tspan = s;
	    return R2_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, %r14
movq %rsi, %r15
leaq 0x8(%rsp), %r8
callq 0x509c4
movl %eax, %ebx
testl %eax, %eax
je 0x50be4
cmpl $0x1, %ebx
je 0x50b98
cmpl $0x3, %ebx
jne 0x50bc6
pushq $0x4
popq %rbx
jmp 0x50be4
movsd 0x8(%rsp), %xmm0
leaq 0x8a003(%rip), %rax     # 0xdaba8
movapd %xmm0, %xmm1
subsd 0x48(%r15), %xmm1
xorl %ebx, %ebx
ucomisd (%rax), %xmm1
ja 0x50be4
pushq $0x1
popq %rbx
testq %r14, %r14
je 0x50be4
movsd %xmm0, (%r14)
jmp 0x50be4
leaq 0x493af(%rip), %rdi     # 0x99f7c
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x680f0
leaq 0x493b4(%rip), %rdi     # 0x99f91
xorl %eax, %eax
callq 0x680f0
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Isect.cpp
// Function: gaps::R2Intersects(gaps::R2Span const&, gaps::R2Span const&, gaps::R2Point*, double*, double*)
RNClassID R2Intersects(const R2Span& span1, const R2Span& span2, 
    R2Point *hit_point, RNScalar *hit_t1, RNScalar *hit_t2)
{
    // Intersect span1 with span2's ray
    RNScalar s1, s2;
    switch (R2Intersects(span1, span2.Ray(), hit_point, &s1, &s2)) {
    case RN_NULL_CLASS_ID:
	// Spans do not intersect
	return RN_NULL_CLASS_ID;

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

    case R2_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 {
	    // Spans intersect at point
	    if (hit_t1) *hit_t1 = s1;
	    if (hit_t2) *hit_t2 = s2;
	    return R2_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 0x50b6a
movl %eax, %ebx
testl %eax, %eax
je 0x5115f
cmpl $0x1, %ebx
je 0x510e8
cmpl $0x4, %ebx
jne 0x51126
leaq 0x28(%r15), %rsi
movq %r12, %rdi
callq 0x4fc28
testl %eax, %eax
je 0x51146
pushq $0x4
popq %rbx
jmp 0x5115f
movsd 0x8(%rsp), %xmm0
leaq 0x89ab3(%rip), %rax     # 0xdaba8
movapd %xmm0, %xmm1
subsd 0x48(%r15), %xmm1
xorl %ebx, %ebx
ucomisd (%rax), %xmm1
ja 0x5115f
testq %r13, %r13
je 0x51112
movsd %xmm0, (%r13)
pushq $0x1
popq %rbx
testq %r14, %r14
je 0x5115f
movsd (%rsp), %xmm0
movsd %xmm0, (%r14)
jmp 0x5115f
leaq 0x48e4f(%rip), %rdi     # 0x99f7c
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x680f0
leaq 0x48e54(%rip), %rdi     # 0x99f91
xorl %eax, %eax
callq 0x680f0
jmp 0x5115f
addq $0x38, %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x4fc28
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
shll $0x2, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Isect.cpp
// Function: gaps::R2Intersects(gaps::R2Span const&, gaps::R2Box const&, gaps::R2Point*, double*)
RNClassID R2Intersects(const R2Span& span, const R2Box& box, 
    R2Point *hit_point, RNScalar *hit_t)
{
    // Intersect box with span's ray
    RNScalar s;
    switch (R2Intersects(box, span.Ray(), hit_point, NULL, &s)) {
    case RN_NULL_CLASS_ID:
	// Span and box do not intersect
	return RN_NULL_CLASS_ID;

    case R2_SPAN_CLASS_ID:
	// Box contains span
        if (RNIsGreater(s, span.Length()))
            return RN_NULL_CLASS_ID;
        else
            return R2_SPAN_CLASS_ID;

    case R2_POINT_CLASS_ID: 
	// Check if intersection point is on span
	if (RNIsGreater(s, span.Length())) {
	    // Span's ray intersects box beyond span endpoint
	    return RN_NULL_CLASS_ID;
	}
	else {
	    // Span and box intersect at point
	    if (hit_t) *hit_t = s;
	    return R2_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), %r8
xorl %ecx, %ecx
callq 0x50c03
movl %eax, %ebx
testl %eax, %eax
je 0x5121a
cmpl $0x1, %ebx
je 0x511ce
cmpl $0x4, %ebx
jne 0x511fc
movsd 0x8(%rsp), %xmm0
leaq 0x899ee(%rip), %rax     # 0xdaba8
subsd 0x48(%r15), %xmm0
xorl %ebx, %ebx
ucomisd (%rax), %xmm0
setbe %bl
shll $0x2, %ebx
jmp 0x5121a
movsd 0x8(%rsp), %xmm0
leaq 0x899cd(%rip), %rax     # 0xdaba8
movapd %xmm0, %xmm1
subsd 0x48(%r15), %xmm1
xorl %ebx, %ebx
ucomisd (%rax), %xmm1
ja 0x5121a
pushq $0x1
popq %rbx
testq %r14, %r14
je 0x5121a
movsd %xmm0, (%r14)
jmp 0x5121a
leaq 0x48d79(%rip), %rdi     # 0x99f7c
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x680f0
leaq 0x48d7e(%rip), %rdi     # 0x99f91
xorl %eax, %eax
callq 0x680f0
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Isect.cpp
// Function: gaps::R2Intersects(gaps::R2Span const&, gaps::R2Circle const&, gaps::R2Point*, double*)
RNClassID R2Intersects(const R2Span& span, const R2Circle& circle, 
    R2Point *hit_point, RNScalar *hit_t)
{
    // Intersect circle with span's ray
    RNScalar s;
    switch (R2Intersects(circle, span.Ray(), hit_point, NULL, &s)) {
    case RN_NULL_CLASS_ID:
	// Span and circle do not intersect
	return RN_NULL_CLASS_ID;

    case R2_SPAN_CLASS_ID:
	// Circle contains span
	return R2_SPAN_CLASS_ID;

    case R2_POINT_CLASS_ID: 
	// Check if intersection point is on span
	if (RNIsGreater(s, span.Length())) {
	    // Span's ray intersects circle beyond span endpoint
	    return RN_NULL_CLASS_ID;
	}
	else {
	    // Span and circle intersect at point
	    if (hit_t) *hit_t = s;
	    return R2_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 %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %r8
xorl %ecx, %ecx
callq 0x50e17
movl %eax, %ebp
testl %eax, %eax
je 0x5129b
cmpl $0x4, %ebp
je 0x5129b
cmpl $0x1, %ebp
jne 0x5127d
movsd 0x8(%rsp), %xmm0
leaq 0x8994b(%rip), %rax     # 0xdaba8
movapd %xmm0, %xmm1
subsd 0x48(%r14), %xmm1
xorl %ebp, %ebp
ucomisd (%rax), %xmm1
ja 0x5129b
pushq $0x1
popq %rbp
testq %rbx, %rbx
je 0x5129b
movsd %xmm0, (%rbx)
jmp 0x5129b
leaq 0x48cf8(%rip), %rdi     # 0x99f7c
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x680f0
leaq 0x48cfd(%rip), %rdi     # 0x99f91
xorl %eax, %eax
callq 0x680f0
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Isect.cpp
// Function: gaps::R2Intersects(gaps::R2Halfspace const&, gaps::R2Halfspace const&)
RNClassID R2Intersects(const R2Halfspace& halfspace1, const R2Halfspace& halfspace2)
{
    // Check halfspace directions
    if (R2Contains(halfspace1.Normal(), -(halfspace2.Normal()))) {
	// Halfspace normals point in opposite directions
	return R2Intersects(halfspace1, halfspace2.Line().Point());
    }
    else { 
	// Halfspaces are not anti-parallel -- they must intersect
	return RN_UNKNOWN_CLASS_ID;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
addq $0x10, %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x5fd59
movq %r15, %rdi
movq %r12, %rsi
callq 0x4f7bc
testl %eax, %eax
je 0x512f8
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x505c2
movq %r15, %rdi
movq %rbx, %rsi
callq 0x506e9
jmp 0x512fb
pushq $-0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Isect.cpp
// Function: gaps::R2Intersects(gaps::R2Halfspace const&, gaps::R2Circle const&)
RNClassID R2Intersects(const R2Halfspace& halfspace, const R2Circle& circle)
{
    // Return whether circle intersects halfspace
    RNScalar d = R2SignedDistance(halfspace.Line(), circle.Center());
    if (RNIsLess(d, -(circle.Radius()))) return RN_NULL_CLASS_ID;
    else if (RNIsEqual(d, -(circle.Radius()))) return R2_POINT_CLASS_ID;
    else return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
addq $0x8, %rsi
callq 0x63638
leaq 0x89848(%rip), %rax     # 0xdaba8
addsd 0x18(%rbx), %xmm0
movsd (%rax), %xmm1
movapd 0x41cbf(%rip), %xmm2    # 0x93030
xorpd %xmm1, %xmm2
movapd %xmm0, %xmm3
cmpnlepd %xmm1, %xmm3
movapd %xmm2, %xmm1
cmpnlepd %xmm0, %xmm1
orpd %xmm3, %xmm1
movd %xmm1, %ecx
orl $0x1, %ecx
xorl %eax, %eax
ucomisd %xmm0, %xmm2
cmovbel %ecx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Isect.cpp
// Function: gaps::R2Intersects(gaps::R2Box const&, gaps::R2Box const&, gaps::R2Box*)
RNClassID R2Intersects(const R2Point& point, const R2Circle& circle)
{
    // Check whether circle contains point
    if (R2Contains(circle, point)) {
	// Point lies in circle
	return R2_POINT_CLASS_ID;
    }
    else {
	// Point does not lie in circle
	return RN_NULL_CLASS_ID;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movsd 0x8(%rdi), %xmm4
movsd 0x18(%rsi), %xmm2
leaq 0x897f1(%rip), %rax     # 0xdaba8
movsd (%rax), %xmm6
movapd %xmm4, %xmm0
subsd %xmm2, %xmm0
xorl %ebx, %ebx
ucomisd %xmm6, %xmm0
ja 0x51459
movsd 0x10(%rdi), %xmm5
movsd 0x20(%rsi), %xmm3
movapd %xmm5, %xmm0
subsd %xmm3, %xmm0
ucomisd %xmm6, %xmm0
ja 0x51459
movsd 0x8(%rsi), %xmm0
movsd 0x18(%rdi), %xmm7
movapd %xmm0, %xmm1
subsd %xmm7, %xmm1
ucomisd %xmm6, %xmm1
ja 0x51459
movsd 0x10(%rsi), %xmm1
movsd 0x20(%rdi), %xmm8
movapd %xmm1, %xmm9
subsd %xmm8, %xmm9
ucomisd %xmm6, %xmm9
ja 0x51459
movq %rdx, %r14
pushq $-0x1
popq %rbx
testq %rdx, %rdx
je 0x51459
maxsd %xmm4, %xmm0
maxsd %xmm5, %xmm1
minsd %xmm7, %xmm2
minsd %xmm8, %xmm3
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x5cb7a
movq %r14, %rdi
movq %r15, %rsi
callq 0x51550
leaq 0x8(%rsp), %rdi
callq 0x5d2ee
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5d2ee
movq %rbx, %rdi
callq 0xe810
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Isect.cpp
// Function: gaps::R2Intersects(gaps::R2Circle const&, gaps::R2Circle const&)
RNClassID R2Intersects(const R2Circle& circle1, const R2Circle& circle2)
{
    // Return whether circle intersects circle
    R2Vector v = circle1.Center() - circle2.Center();
    RNScalar distance_squared = v.X() * v.X() + v.Y() * v.Y();
    RNScalar radius_sum = circle1.Radius() + circle2.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 R2_POINT_CLASS_ID;
    else return RN_UNKNOWN_CLASS_ID;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %rsi
leaq 0x8(%rbx), %rdx
movq %rsp, %r15
movq %r15, %rdi
callq 0x5f7c9
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
movsd 0x18(%r14), %xmm2
addsd 0x18(%rbx), %xmm2
addsd %xmm1, %xmm0
mulsd %xmm2, %xmm2
leaq 0x896ab(%rip), %rax     # 0xdaba8
movsd (%rax), %xmm1
subsd %xmm2, %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
ja 0x5152e
movapd %xmm0, %xmm2
cmpnlepd %xmm1, %xmm2
xorpd 0x41b12(%rip), %xmm1    # 0x93030
cmpnlepd %xmm0, %xmm1
orpd %xmm2, %xmm1
movd %xmm1, %eax
orl $0x1, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::R2Grid(int, int)
R2Grid::
R2Grid(int xresolution, int yresolution)
{
  // Set grid resolution
  grid_resolution[0] = xresolution;
  grid_resolution[1] = yresolution;
  grid_row_size = xresolution;
  grid_size = grid_row_size * yresolution;

  // Allocate grid values
  if (grid_size == 0) grid_values = NULL;
  else grid_values = new RNScalar [ grid_size ];
  assert(!grid_size || grid_values);

  // Set all values to zero
  for (int i = 0; i < grid_size; i++) grid_values[i] = 0;

  // Set transformations
  grid_to_world_transform = R2identity_affine;
  world_to_grid_transform = R2identity_affine;
  world_to_grid_scale_factor = 1.0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %rbx
callq 0x5d2fe
leaq 0x58(%rbx), %r14
movq %r14, %rdi
callq 0x5d2fe
movl %ebp, 0xc0(%rbx)
movl %r15d, 0xc4(%rbx)
movl %ebp, 0xc8(%rbx)
imull %ebp, %r15d
movl %r15d, 0xcc(%rbx)
xorl %r12d, %r12d
testl %r15d, %r15d
je 0x51687
movl %r15d, %eax
shlq $0x3, %rax
testl %r15d, %r15d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0xe030
jmp 0x51689
xorl %eax, %eax
movq %rax, 0xb8(%rbx)
testl %r15d, %r15d
cmovlel %r12d, %r15d
cmpq %r12, %r15
je 0x516a6
andq $0x0, (%rax,%r12,8)
incq %r12
jmp 0x51697
leaq 0x48b8bb(%rip), %rsi    # 0x4dcf68
movq %rbx, %rdi
callq 0x5ac32
leaq 0x48b8ac(%rip), %rsi    # 0x4dcf68
movq %r14, %rdi
callq 0x5ac32
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0xb0(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x516ee
movq %rax, %r15
movq %r14, %rdi
callq 0x5d61e
movq %rbx, %rdi
callq 0x5d61e
movq %r15, %rdi
callq 0xe810
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::R2Grid(int, int, gaps::R2Box const&)
R2Grid::
R2Grid(int xresolution, int yresolution, const R2Box& bbox)
{
  // Set grid resolution
  grid_resolution[0] = xresolution;
  grid_resolution[1] = yresolution;
  grid_row_size = xresolution;
  grid_size = grid_row_size * yresolution;

  // Allocate grid values
  if (grid_size == 0) grid_values = NULL;
  else grid_values = new RNScalar [ grid_size ];
  assert(!grid_size || grid_values);

  // Set all values to zero
  for (int i = 0; i < grid_size; i++) grid_values[i] = 0;

  // Set transformation
  SetWorldToGridTransformation(bbox);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movl %edx, %r12d
movl %esi, %ebp
movq %rdi, %rbx
callq 0x5d2fe
leaq 0x58(%rbx), %r14
movq %r14, %rdi
callq 0x5d2fe
movl %ebp, 0xc0(%rbx)
movl %r12d, 0xc4(%rbx)
movl %ebp, 0xc8(%rbx)
imull %ebp, %r12d
movl %r12d, 0xcc(%rbx)
xorl %r13d, %r13d
testl %r12d, %r12d
je 0x51763
movl %r12d, %eax
shlq $0x3, %rax
testl %r12d, %r12d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0xe030
jmp 0x51765
xorl %eax, %eax
movq %rax, 0xb8(%rbx)
testl %r12d, %r12d
cmovlel %r13d, %r12d
cmpq %r13, %r12
je 0x51782
andq $0x0, (%rax,%r13,8)
incq %r13
jmp 0x51773
movq %rbx, %rdi
movq %r15, %rsi
callq 0x517bc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x517ac
movq %rax, %r15
movq %r14, %rdi
callq 0x5d61e
movq %rbx, %rdi
callq 0x5d61e
movq %r15, %rdi
callq 0xe810
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::R2Grid(int, int, gaps::R2Affine const&)
R2Grid::
R2Grid(int xresolution, int yresolution, const R2Affine& world_to_grid)
{
  // Set grid resolution
  grid_resolution[0] = xresolution;
  grid_resolution[1] = yresolution;
  grid_row_size = xresolution;
  grid_size = grid_row_size * yresolution;

  // Allocate grid values
  if (grid_size == 0) grid_values = NULL;
  else grid_values = new RNScalar [ grid_size ];
  assert(!grid_size || grid_values);

  // Set all values to zero
  for (int i = 0; i < grid_size; i++) grid_values[i] = 0;

  // Set transformation
  SetWorldToGridTransformation(world_to_grid);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movl %edx, %r12d
movl %esi, %ebp
movq %rdi, %rbx
callq 0x5d2fe
leaq 0x58(%rbx), %r14
movq %r14, %rdi
callq 0x5d2fe
movl %ebp, 0xc0(%rbx)
movl %r12d, 0xc4(%rbx)
movl %ebp, 0xc8(%rbx)
imull %ebp, %r12d
movl %r12d, 0xcc(%rbx)
xorl %r13d, %r13d
testl %r12d, %r12d
je 0x51a11
movl %r12d, %eax
shlq $0x3, %rax
testl %r12d, %r12d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0xe030
jmp 0x51a13
xorl %eax, %eax
movq %rax, 0xb8(%rbx)
testl %r12d, %r12d
cmovlel %r13d, %r12d
cmpq %r13, %r12
je 0x51a30
andq $0x0, (%rax,%r13,8)
incq %r13
jmp 0x51a21
movq %rbx, %rdi
movq %r15, %rsi
callq 0x51a6a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x51a5a
movq %rax, %r15
movq %r14, %rdi
callq 0x5d61e
movq %rbx, %rdi
callq 0x5d61e
movq %r15, %rdi
callq 0xe810
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::SetWorldToGridTransformation(gaps::R2Affine const&)
void R2Grid::
SetWorldToGridTransformation(const R2Affine& affine)
{
  // Set transformations
  world_to_grid_transform = affine;
  grid_to_world_transform = affine.Inverse();
  world_to_grid_scale_factor = affine.ScaleFactor();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x58, %rdi
callq 0x5ac32
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x5ac5c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5ac32
leaq 0x8(%rsp), %rdi
callq 0x5d61e
movq %r14, %rdi
callq 0x5d378
movsd %xmm0, 0xb0(%rbx)
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5d61e
movq %rbx, %rdi
callq 0xe810
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::operator=(gaps::R2Grid const&)
R2Grid& R2Grid::
operator=(const R2Grid& grid) 
{
  // Copy grid resolution
  grid_resolution[0] = grid.grid_resolution[0];
  grid_resolution[1] = grid.grid_resolution[1];
  grid_row_size = grid.grid_row_size;
  grid_size = grid.grid_size;

  // Copy grid values
  if (grid_values) delete [] grid_values;
  if (grid_size == 0) grid_values = NULL;
  else grid_values = new RNScalar [ grid_size ];
  assert(!grid_size || grid_values);
  for (int i = 0; i < grid_size; i++) {
    grid_values[i] = grid.grid_values[i];
  }

  // Copy transforms
  grid_to_world_transform = grid.grid_to_world_transform;
  world_to_grid_transform = grid.world_to_grid_transform;
  world_to_grid_scale_factor = grid.world_to_grid_scale_factor;

  // Return this
  return *this;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc0(%rsi), %eax
movl %eax, 0xc0(%rdi)
movl 0xc4(%rsi), %eax
movl %eax, 0xc4(%rdi)
movl 0xc8(%rsi), %eax
movl %eax, 0xc8(%rdi)
movl 0xcc(%rsi), %r15d
movl %r15d, 0xcc(%rdi)
movq 0xb8(%rdi), %rdi
testq %rdi, %rdi
je 0x51f2e
callq 0xe5d0
movl 0xcc(%rbx), %r15d
xorl %r12d, %r12d
testl %r15d, %r15d
je 0x51f4e
movslq %r15d, %rax
shlq $0x3, %rax
testl %r15d, %r15d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0xe030
jmp 0x51f50
xorl %eax, %eax
movq %rax, 0xb8(%rbx)
movq 0xb8(%r14), %rcx
testl %r15d, %r15d
cmovlel %r12d, %r15d
cmpq %r12, %r15
je 0x51f7b
movsd (%rcx,%r12,8), %xmm0
movsd %xmm0, (%rax,%r12,8)
incq %r12
jmp 0x51f65
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5ac32
leaq 0x58(%r14), %rsi
leaq 0x58(%rbx), %rdi
callq 0x5ac32
movsd 0xb0(%r14), %xmm0
movsd %xmm0, 0xb0(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::R2Grid(gaps::R2Image const&, int)
R2Grid::
R2Grid(const R2Image& image, int dummy)
  : grid_values(NULL)
{
  // Determine grid resolution
  grid_resolution[0] = image.Width();
  grid_resolution[1] = image.Height();
  grid_row_size = grid_resolution[0];
  grid_size = grid_row_size * grid_resolution[1];

  // Allocate grid values
  if (grid_size <= 0) grid_values = NULL;
  else grid_values = new RNScalar [ grid_size ];
  assert(!grid_size || grid_values);

  // Copy grid values
  for (int j = 0; j < grid_resolution[1]; j++) {
    for (int i = 0; i < grid_resolution[0]; i++) {
      RNRgb rgb = image.PixelRGB(i, j);
      SetGridValue(i, j, rgb.Luminance());
    }
  }

  // Set transformations
  grid_to_world_transform = R2identity_affine;
  world_to_grid_transform = R2identity_affine;
  world_to_grid_scale_factor = 1.0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %rbx
callq 0x5d2fe
leaq 0x58(%rbx), %rdi
movq %rdi, 0x8(%rsp)
callq 0x5d2fe
andq $0x0, 0xb8(%rbx)
movl (%r15), %r14d
movl %r14d, 0xc0(%rbx)
movl 0x4(%r15), %ebp
movl %ebp, 0xc4(%rbx)
movl %r14d, 0xc8(%rbx)
movl %ebp, %eax
imull %r14d, %eax
movl %eax, 0xcc(%rbx)
xorl %r12d, %r12d
testl %eax, %eax
jle 0x52074
movl %eax, %edi
shlq $0x3, %rdi
callq 0xe030
jmp 0x52076
xorl %eax, %eax
movq %rax, 0xb8(%rbx)
cmpl %ebp, %r12d
jge 0x52108
movslq %r12d, %r13
xorl %ebp, %ebp
cmpl %r14d, %ebp
jge 0x520fa
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %r12d, %ecx
callq 0x6036e
movsd 0x18(%rsp), %xmm0
mulsd 0x481f0(%rip), %xmm0    # 0x9a2a0
movsd 0x10(%rsp), %xmm1
mulsd 0x481ea(%rip), %xmm1    # 0x9a2a8
addsd %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
mulsd 0x481e0(%rip), %xmm0    # 0x9a2b0
addsd %xmm1, %xmm0
movq 0xb8(%rbx), %rax
movslq 0xc8(%rbx), %rcx
imulq %r13, %rcx
addq %rbp, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0xc0(%rbx), %r14d
incq %rbp
jmp 0x5208b
incl %r12d
movl 0xc4(%rbx), %ebp
jmp 0x5207d
leaq 0x48ae59(%rip), %rsi    # 0x4dcf68
movq %rbx, %rdi
callq 0x5ac32
leaq 0x48ae4a(%rip), %rsi    # 0x4dcf68
movq 0x8(%rsp), %rdi
callq 0x5ac32
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0xb0(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x5215c
jmp 0x5214f
movq %rax, %r15
movq 0x8(%rsp), %rdi
callq 0x5d61e
movq %rbx, %rdi
callq 0x5d61e
movq %r15, %rdi
callq 0xe810
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Percentile(double) const
RNScalar R2Grid::
Percentile(RNScalar percentile) const
{
  // Return value at given percentile
  if (grid_size == 0) return 0.0;
  int tmp_count = 0;
  RNScalar *tmp_values = new RNScalar [ grid_size ];
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] != R2_GRID_UNKNOWN_VALUE) {
      tmp_values[tmp_count++] = grid_values[i];
    }
  }
  if (tmp_count == 0) return R2_GRID_UNKNOWN_VALUE;
  qsort(tmp_values, tmp_count, sizeof(RNScalar), RNCompareScalars);
  int percentile_index = percentile * tmp_count;
  RNScalar value = tmp_values[percentile_index];
  delete [] tmp_values;
  return value;
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
je 0x522d2
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movsd %xmm0, 0x8(%rsp)
movq %rax, %rcx
shlq $0x3, %rcx
xorl %r15d, %r15d
testl %eax, %eax
pushq $-0x1
popq %rdi
cmovnsq %rcx, %rdi
movl $0x0, %r12d
cmovgl %eax, %r12d
callq 0xe030
movq %rax, %rbx
movq 0xb8(%r14), %rax
movsd 0x41d07(%rip), %xmm0    # 0x93f68
xorl %ebp, %ebp
movslq %ebp, %rsi
cmpq %r15, %r12
je 0x52286
movsd (%rax,%r15,8), %xmm1
ucomisd %xmm0, %xmm1
jne 0x52279
jnp 0x52281
leal 0x1(%rsi), %ebp
movsd %xmm1, (%rbx,%rsi,8)
incq %r15
jmp 0x52263
testl %ebp, %ebp
je 0x522c5
leaq 0x15ba4(%rip), %rcx     # 0x67e35
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0xe8b0
cvtsi2sd %ebp, %xmm0
mulsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %eax
cltq
movsd (%rbx,%rax,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0xe5d0
movsd 0x8(%rsp), %xmm0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::L1Norm() const
RNScalar R2Grid::
L1Norm(void) const
{
  // Return L1 norm of grid
  RNScalar sum = 0.0;
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] != R2_GRID_UNKNOWN_VALUE) {
      sum += grid_values[i];
    }
  }
  return sum;
}

// Assembly:
movl 0xcc(%rdi), %eax
movq 0xb8(%rdi), %rcx
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
xorpd %xmm0, %xmm0
movsd 0x41c72(%rip), %xmm1    # 0x93f68
cmpq %rdx, %rax
je 0x52322
movsd (%rcx,%rdx,8), %xmm2
movapd %xmm0, %xmm3
addsd %xmm2, %xmm3
cmpneqsd %xmm1, %xmm2
andpd %xmm2, %xmm3
andnpd %xmm0, %xmm2
orpd %xmm3, %xmm2
incq %rdx
movapd %xmm2, %xmm0
jmp 0x522f6
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::L2Norm() const
RNScalar R2Grid::
L2Norm(void) const
{
  // Return L2 norm of grid
  RNScalar sum = 0.0;
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] != R2_GRID_UNKNOWN_VALUE) {
      RNScalar value = grid_values[i];
      sum += value * value;
    }
  }
  return sqrt(sum);
}

// Assembly:
movl 0xcc(%rdi), %eax
movq 0xb8(%rdi), %rcx
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
xorpd %xmm0, %xmm0
movsd 0x41c24(%rip), %xmm1    # 0x93f68
cmpq %rdx, %rax
je 0x52374
movsd (%rcx,%rdx,8), %xmm2
movapd %xmm2, %xmm3
mulsd %xmm2, %xmm3
addsd %xmm0, %xmm3
cmpneqsd %xmm1, %xmm2
andpd %xmm2, %xmm3
andnpd %xmm0, %xmm2
orpd %xmm3, %xmm2
incq %rdx
movapd %xmm2, %xmm0
jmp 0x52344
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xe350
sqrtsd %xmm0, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Cardinality() const
int R2Grid::
Cardinality(void) const
{
  // Return number of non-zero grid values
  int count = 0;
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] != R2_GRID_UNKNOWN_VALUE) {
      if (grid_values[i] != 0) count++;
    }
  }
  return count;
}

// Assembly:
movl 0xcc(%rdi), %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
movq 0xb8(%rdi), %rsi
xorpd %xmm0, %xmm0
movsd 0x41bc0(%rip), %xmm1    # 0x93f68
xorl %eax, %eax
cmpq %rdx, %rcx
je 0x523d1
movsd (%rsi,%rdx,8), %xmm2
movapd %xmm2, %xmm3
cmpneqpd %xmm0, %xmm3
cmpneqpd %xmm1, %xmm2
andpd %xmm3, %xmm2
movd %xmm2, %edi
subl %edi, %eax
incq %rdx
jmp 0x523aa
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Mean() const
RNScalar R2Grid::
Mean(void) const
{
  // Sum values
  int count = 0;
  RNScalar sum = 0;
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] != R2_GRID_UNKNOWN_VALUE) {
      sum += grid_values[i];
      count++;
    }
  }

  // Return mean
  if (count == 0) return 0.0;
  else return sum / count;
}

// Assembly:
movl 0xcc(%rdi), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movq 0xb8(%rdi), %rsi
xorpd %xmm1, %xmm1
movsd 0x41b76(%rip), %xmm0    # 0x93f68
xorl %edx, %edx
cmpq %rcx, %rax
je 0x52427
movsd (%rsi,%rcx,8), %xmm3
ucomisd %xmm0, %xmm3
movapd %xmm1, %xmm2
addsd %xmm3, %xmm2
jne 0x52412
jp 0x52412
movapd %xmm1, %xmm2
cmpneqsd %xmm0, %xmm3
movq %xmm3, %rdi
subl %edi, %edx
incq %rcx
movapd %xmm2, %xmm1
jmp 0x523f4
xorpd %xmm0, %xmm0
testl %edx, %edx
je 0x5243b
cvtsi2sd %edx, %xmm0
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::GridCentroid() const
R2Point R2Grid::
GridCentroid(void) const
{
  // Compute weighted sum
  RNScalar total_value = 0;
  R2Point centroid(0,0);
  RNScalar *grid_valuesp = grid_values;
  for (int j = 0; j < grid_resolution[1]; j++) {
    for (int i = 0; i < grid_resolution[0]; i++) {
      R2Vector position(i, j);
      RNScalar value = *(grid_valuesp++);
      centroid += value * position;
      total_value += value;
    }
  }

  // Divide by total value
  if (total_value > 0) centroid /= total_value;

  // Return centroid
  return centroid;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm1, %xmm1
callq 0x5f58c
movq 0xb8(%r14), %r13
xorl %eax, %eax
leaq 0x38(%rsp), %r15
leaq 0x28(%rsp), %r12
cmpl 0xc4(%r14), %eax
jge 0x524ed
movl %eax, 0x14(%rsp)
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x18(%rsp)
xorl %ebp, %ebp
cmpl 0xc0(%r14), %ebp
jge 0x524e5
cvtsi2sd %ebp, %xmm0
movq %r15, %rdi
movsd 0x18(%rsp), %xmm1
callq 0x5f8b4
movsd (%r13), %xmm0
movsd %xmm0, 0x20(%rsp)
addq $0x8, %r13
movq %r12, %rdi
movq %r15, %rsi
callq 0x5fbe5
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5f672
movsd 0x8(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
incl %ebp
jmp 0x5248e
movl 0x14(%rsp), %eax
incl %eax
jmp 0x52475
xorpd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x52509
movapd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x5f772
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Abs()
void R2Grid::
Abs(void) 
{
  // Take absolute value of every grid value
  for (int i = 0; i < grid_size; i++) {
    RNScalar value = grid_values[i];
    if (value != R2_GRID_UNKNOWN_VALUE) grid_values[i] = fabs(value);
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
movq 0xb8(%rdi), %rcx
xorl %edx, %edx
movsd 0x41532(%rip), %xmm0    # 0x93f68
movapd 0x40832(%rip), %xmm1    # 0x93270
cmpq %rax, %rdx
jge 0x52a5e
movsd (%rcx,%rdx,8), %xmm2
ucomisd %xmm0, %xmm2
jne 0x52a50
jnp 0x52a59
andpd %xmm1, %xmm2
movlpd %xmm2, (%rcx,%rdx,8)
incq %rdx
jmp 0x52a3e
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Sqrt()
void R2Grid::
Sqrt(void) 
{
  // Take sqrt of every grid value
  for (int i = 0; i < grid_size; i++) {
    RNScalar value = grid_values[i];
    if (value != R2_GRID_UNKNOWN_VALUE) grid_values[i] = sqrt(value);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movsd 0x414f6(%rip), %xmm1    # 0x93f68
xorpd %xmm2, %xmm2
movslq 0xcc(%rbx), %rax
cmpq %rax, %r14
jge 0x52ac6
movq 0xb8(%rbx), %rax
movsd (%rax,%r14,8), %xmm0
ucomisd %xmm1, %xmm0
jne 0x52a97
jnp 0x52ac1
ucomisd %xmm2, %xmm0
jb 0x52aa3
sqrtsd %xmm0, %xmm0
jmp 0x52ab4
callq 0xe350
xorpd %xmm2, %xmm2
movsd 0x414b4(%rip), %xmm1    # 0x93f68
movq 0xb8(%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
jmp 0x52a76
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::IsLocalExtremum(gaps::R2Grid const&, int, int, int)
void R2Grid::
Square(void) 
{
  // Square every grid value
  for (int i = 0; i < grid_size; i++) {
    RNScalar value = grid_values[i];
    if (value != R2_GRID_UNKNOWN_VALUE) grid_values[i] *= value;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0xb8(%rdi), %rax
movslq 0xc8(%rdi), %r8
movl %r8d, %r9d
imull %edx, %r9d
addl %esi, %r9d
movslq %r9d, %r9
movsd (%rax,%r9,8), %xmm0
movslq 0xc0(%rdi), %r9
movslq 0xc4(%rdi), %rdi
movslq %edx, %rdx
movslq %esi, %rsi
leaq -0x1(%rdx), %r10
imulq %r8, %r10
leaq (,%rsi,8), %r11
leaq (%r11,%r10,8), %r10
addq %rax, %r10
addq $-0x8, %r10
shlq $0x3, %r8
movabsq $-0x1, %rbx
movq %rbx, %r14
cmpq $0x2, %r14
je 0x54c21
movq %r14, %rax
addq %rsi, %rax
js 0x54c18
cmpq %r9, %rax
jge 0x54c18
movq %r10, %r15
movq %rbx, %r12
cmpq $0x2, %r12
je 0x54c18
movl %r12d, %eax
orl %r14d, %eax
je 0x54c10
movq %rdx, %rax
addq %r12, %rax
js 0x54c10
cmpq %rdi, %rax
jge 0x54c10
testl %ecx, %ecx
sete %bpl
movsd (%r15), %xmm1
ucomisd %xmm1, %xmm0
seta %r11b
ucomisd %xmm0, %xmm1
setbe %r13b
xorl %eax, %eax
testb %r11b, %bpl
jne 0x54c26
orb %r13b, %bpl
je 0x54c26
incq %r12
addq %r8, %r15
jmp 0x54bce
incq %r14
addq $0x8, %r10
jmp 0x54bb5
movl $0x1, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Negate()
void R2Grid::
Negate(void) 
{
  // Square every grid value
  for (int i = 0; i < grid_size; i++) {
    RNScalar value = grid_values[i];
    if (value != R2_GRID_UNKNOWN_VALUE) grid_values[i] = -value;
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
movq 0xb8(%rdi), %rcx
xorl %edx, %edx
movsd 0x41448(%rip), %xmm0    # 0x93f68
movapd 0x40508(%rip), %xmm1    # 0x93030
cmpq %rax, %rdx
jge 0x52b48
movsd (%rcx,%rdx,8), %xmm2
ucomisd %xmm0, %xmm2
jne 0x52b3a
jnp 0x52b43
xorpd %xmm1, %xmm2
movlpd %xmm2, (%rcx,%rdx,8)
incq %rdx
jmp 0x52b28
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Invert()
void R2Grid::
Invert(void) 
{
  // Invert every grid value
  for (int i = 0; i < grid_size; i++) {
    RNScalar value = grid_values[i];
    if ((value != R2_GRID_UNKNOWN_VALUE) && (value != 0)) {
      grid_values[i] = 1.0 / value;
    }
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
movq 0xb8(%rdi), %rcx
xorl %edx, %edx
movsd 0x41406(%rip), %xmm0    # 0x93f68
xorpd %xmm1, %xmm1
movsd 0x4049a(%rip), %xmm2    # 0x93008
cmpq %rax, %rdx
jge 0x52b9a
movsd (%rcx,%rdx,8), %xmm3
ucomisd %xmm0, %xmm3
jne 0x52b80
jnp 0x52b95
ucomisd %xmm1, %xmm3
jne 0x52b88
jnp 0x52b95
movapd %xmm2, %xmm4
divsd %xmm3, %xmm4
movsd %xmm4, (%rcx,%rdx,8)
incq %rdx
jmp 0x52b6e
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Transpose()
void R2Grid::
Transpose(void)
{
  // Transpose values
  R2Grid copy(*this);
  int xres = XResolution();
  int yres = YResolution();
  for (int iy = 0; iy < yres; iy++) {
    for (int ix = 0; ix < xres; ix++) {
      RNScalar value = copy.GridValue(xres-1 - ix, yres-1 - iy);
      SetGridValue(ix, iy, value);
    }
  }
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x51fb4
movl 0xc0(%rbx), %eax
movl 0xc4(%rbx), %ecx
xorl %edx, %edx
testl %eax, %eax
movl $0x0, %esi
cmovgl %eax, %esi
testl %ecx, %ecx
movl $0x0, %edi
cmovgl %ecx, %edi
decl %eax
decl %ecx
cmpl %edi, %edx
je 0x52c2f
movq 0xb8(%rsp), %r8
movl 0xc8(%rbx), %r9d
imull %edx, %r9d
movslq %r9d, %r9
shlq $0x3, %r9
addq 0xb8(%rbx), %r9
movl 0xc8(%rsp), %r10d
imull %ecx, %r10d
addl %eax, %r10d
xorl %r11d, %r11d
cmpq %r11, %rsi
je 0x52c2b
movslq %r10d, %r10
movsd (%r8,%r10,8), %xmm0
movsd %xmm0, (%r9,%r11,8)
incq %r11
decl %r10d
jmp 0x52c0f
incl %edx
jmp 0x52bd6
movq %rsp, %rdi
callq 0x5216c
addq $0xd0, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Divide(double)
void R2Grid::
Divide(RNScalar value) 
{
  // Just checking
  if (RNIsZero(value)) return;

  // Multiply by recipricol
  Multiply(1.0 / value);
}

// Assembly:
leaq 0x87f4f(%rip), %rax     # 0xdaba8
movsd (%rax), %xmm1
movapd 0x403cb(%rip), %xmm2    # 0x93030
xorpd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jb 0x52c76
ucomisd %xmm0, %xmm1
jb 0x52c76
retq
movsd 0x4038a(%rip), %xmm1    # 0x93008
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x55a92
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Clear(double)
void R2Grid::
Clear(RNScalar value) 
{
  // Set all grid values to value
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] == R2_GRID_UNKNOWN_VALUE) continue;
    grid_values[i] = value;
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
movq 0xb8(%rdi), %rcx
xorl %edx, %edx
movsd 0x409d8(%rip), %xmm1    # 0x93f68
cmpq %rax, %rdx
jge 0x535ac
movsd (%rcx,%rdx,8), %xmm2
ucomisd %xmm1, %xmm2
jne 0x535a2
jnp 0x535a7
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
jmp 0x53590
retq
nop