LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Relate.cpp
// Function: gaps::R2Splits(gaps::R2Line const&, gaps::R2Span const&)
int 
R2Splits(const R2Line& line, const R2Span& span)
{
    // This is just a simple version 

    // Classify span
    // Result values: 0 = on, 1 = below, 2 = above, 3 = crossing
    RNScalar d1 = R2SignedDistance(line, span.Start());
    RNScalar d2 = R2SignedDistance(line, span.End());
    if (RNIsNegative(d1)) {
        if (RNIsPositive(d2)) return 3;
	else return 1;
    }
    else if (RNIsPositive(d1)) {
        if (RNIsNegative(d2)) return 3;
	else return 2;
    }
    else {
        if (RNIsNegative(d2)) return 1;
        else if (RNIsPositive(d2)) return 2;
	else return 0;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x28, %rsi
callq 0x63638
movsd %xmm0, (%rsp)
addq $0x38, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x63638
movsd (%rsp), %xmm3
leaq 0x768a1(%rip), %rax     # 0xdaba8
movsd (%rax), %xmm1
movapd 0x2ed1d(%rip), %xmm2    # 0x93030
xorpd %xmm1, %xmm2
ucomisd %xmm3, %xmm2
ja 0x64336
ucomisd %xmm1, %xmm3
ja 0x64348
ucomisd %xmm0, %xmm2
ja 0x64356
xorl %eax, %eax
ucomisd %xmm1, %xmm0
seta %al
addl %eax, %eax
jmp 0x64359
xorl %eax, %eax
ucomisd %xmm1, %xmm0
seta %al
leal 0x1(,%rax,2), %eax
jmp 0x64359
xorl %eax, %eax
ucomisd %xmm0, %xmm2
setbe %al
xorl $0x3, %eax
jmp 0x64359
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Align.cpp
// Function: gaps::R2Centroid(gaps::RNArray<gaps::R2Point*> const&, double const*)
R2Point 
R2Centroid(const RNArray<R2Point *>& points, const RNScalar *weights)
{
  // Compute center of mass
  R2Point centroid(0.0, 0.0);
  RNScalar total_weight = 0;
  for (int i = 0; i < points.NEntries(); i++) {
    RNScalar weight = (weights) ? weights[i] : 1;
    R2Point *point = points[i];
    centroid += *point * weight;
    total_weight += weight;
  }

  // Compute average
  if (total_weight > 0) centroid /= total_weight;

  // Return center of mass
  return centroid;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
callq 0x5f58c
xorpd %xmm0, %xmm0
xorl %r13d, %r13d
leaq 0x10(%rsp), %r12
movslq 0xc(%r15), %rax
cmpq %rax, %r13
jge 0x6459c
movsd %xmm0, 0x8(%rsp)
movsd 0x2eaa6(%rip), %xmm0    # 0x93008
testq %r14, %r14
je 0x6456d
movsd (%r14,%r13,8), %xmm0
movq (%r15), %rax
movq (%rax,%r13,8), %rsi
movq %r12, %rdi
movsd %xmm0, (%rsp)
callq 0x5f833
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5f6da
movsd 0x8(%rsp), %xmm0
addsd (%rsp), %xmm0
incq %r13
jmp 0x6454b
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x645ae
movq %rbx, %rdi
callq 0x5f772
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Align.cpp
// Function: gaps::R2AverageDistance(gaps::R2Point const&, gaps::RNArray<gaps::R2Point*> const&, double const*)
RNLength
R2AverageDistance(const R2Point& center, const RNArray<R2Point *>& points, const RNScalar *weights)
{
  // Compute sum of distances between a position on the surface and a center point
  RNScalar distance = 0.0;
  RNScalar total_weight = 0;
  for (int i = 0; i < points.NEntries(); i++) {
    RNScalar weight = (weights) ? weights[i] : 1;
    R2Point *point = points[i];
    distance += weight * R2Distance(*point, center);
    total_weight += weight;
  }

  // Compute average distance
  if (total_weight > 0) distance /= total_weight;

  // Return average distance
  return distance;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorpd %xmm2, %xmm2
xorl %r12d, %r12d
xorpd %xmm3, %xmm3
movslq 0xc(%r14), %rax
cmpq %rax, %r12
jge 0x648ff
movapd %xmm3, 0x10(%rsp)
movsd %xmm2, 0x8(%rsp)
movsd 0x2e74a(%rip), %xmm0    # 0x93008
testq %rbx, %rbx
je 0x648c9
movsd (%rbx,%r12,8), %xmm0
movsd %xmm0, (%rsp)
movq (%r14), %rax
movq (%rax,%r12,8), %rdi
movq %r15, %rsi
callq 0x63469
movsd (%rsp), %xmm1
mulsd %xmm1, %xmm0
movapd 0x10(%rsp), %xmm3
addsd %xmm0, %xmm3
movsd 0x8(%rsp), %xmm2
addsd %xmm1, %xmm2
incq %r12
jmp 0x648a1
movapd %xmm3, %xmm1
divsd %xmm2, %xmm1
xorpd %xmm0, %xmm0
cmpltsd %xmm2, %xmm0
andpd %xmm0, %xmm1
andnpd %xmm3, %xmm0
orpd %xmm1, %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Align.cpp
// Function: gaps::R2AlignError(gaps::RNArray<gaps::R2Point*> const&, gaps::RNArray<gaps::R2Point*> const&, gaps::R3Matrix const&, double const*)
RNScalar 
R2AlignError(const RNArray<R2Point *>& points1, const RNArray<R2Point *>& points2, 
  const R3Matrix& matrix, const RNScalar* weights)
{
  // Get number of points
  int count = points1.NEntries();
  if (points2.NEntries() < count) count = points2.NEntries();
  if (count == 0) return -1;

  // Compute sum of squared distances
  RNScalar ssd = 0;
  RNScalar total_weight = 0;
  for (int i = 0; i < count; i++) {
    RNScalar weight = (weights) ? weights[i] : 1;
    R2Point *point1 = points1[i];
    R2Point point2 = *(points2[i]);
    point2 = matrix * point2;
    R2Vector v = *point1 - point2;
    ssd += weight * v.Dot(v);
    total_weight += weight;
  }

  // Return RMSD
  if (total_weight == 0) return -1;
  else return sqrt(ssd / total_weight);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, 0x18(%rsp)
movq %rdi, 0x8(%rsp)
movl 0xc(%rdi), %r15d
movq %rsi, 0x10(%rsp)
movl 0xc(%rsi), %eax
cmpl %r15d, %eax
cmovll %eax, %r15d
movsd 0x2e4a6(%rip), %xmm0    # 0x93020
movsd %xmm0, (%rsp)
testl %r15d, %r15d
je 0x64c79
movq %rcx, %rbx
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
xorpd %xmm1, %xmm1
leaq 0x48(%rsp), %r13
leaq 0x38(%rsp), %rbp
xorpd %xmm2, %xmm2
cmpq %r12, %r15
je 0x64c4f
movsd %xmm2, 0x28(%rsp)
movsd %xmm1, 0x30(%rsp)
movsd 0x2e444(%rip), %xmm0    # 0x93008
testq %rbx, %rbx
je 0x64bcf
movsd (%rbx,%r12,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rax,%r12,8), %r14
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax,%r12,8), %rsi
movq %r13, %rdi
callq 0x5f596
movq %rbp, %rdi
movq 0x18(%rsp), %rsi
movq %r13, %rdx
callq 0x5e3fc
movq %r13, %rdi
movq %rbp, %rsi
callq 0x5f6c4
movq %rbp, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x5f7c9
movq %rbp, %rdi
movq %rbp, %rsi
callq 0x5fa20
movsd 0x20(%rsp), %xmm3
mulsd %xmm3, %xmm0
movsd 0x30(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd 0x28(%rsp), %xmm2
addsd %xmm3, %xmm2
incq %r12
jmp 0x64ba7
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jne 0x64c5b
jnp 0x64c79
divsd %xmm2, %xmm1
ucomisd %xmm0, %xmm1
jb 0x64c6b
sqrtsd %xmm1, %xmm0
jmp 0x64c74
movapd %xmm1, %xmm0
callq 0xe350
movsd %xmm0, (%rsp)
movsd (%rsp), %xmm0
addq $0x58, %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/R2Arc.cpp
// Function: gaps::R2Arc::R2Arc(gaps::R2Point const&, double, double, double)
R2Arc::
R2Arc(const R2Point& center, RNLength radius, RNAngle theta1, RNAngle theta2)
    : circle(center, radius),
      start(theta1),
      stop(theta2)
{
    // Needed because don't know if RN_TWO_PI is initialized
    RNScalar TWO_PI = 2.0 * 3.14159265358979323846;
    while (start >= TWO_PI) start -= TWO_PI;
    while (start < 0.0) start += TWO_PI;
    while (stop >= (start + TWO_PI)) stop -= TWO_PI;
    while (stop < start) stop += TWO_PI;
    assert((0.0 <= start) && (start <= TWO_PI));
    assert((start <= stop) && (stop <= (start + TWO_PI)));
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movsd %xmm2, 0x8(%rsp)
movsd %xmm1, (%rsp)
movsd %xmm0, 0x10(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
callq 0x65ac6
leaq 0x740b4(%rip), %rax     # 0xd96a8
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
movq %r14, %rsi
movsd 0x10(%rsp), %xmm0
callq 0x65c00
movsd (%rsp), %xmm5
movsd %xmm5, 0x28(%rbx)
movsd 0x8(%rsp), %xmm4
movsd %xmm4, 0x30(%rbx)
movsd 0x3585a(%rip), %xmm0    # 0x9ae80
movsd 0x3585a(%rip), %xmm1    # 0x9ae88
ucomisd %xmm0, %xmm5
jb 0x6563f
addsd %xmm1, %xmm5
movsd %xmm5, 0x28(%rbx)
jmp 0x6562e
xorpd %xmm3, %xmm3
movapd %xmm5, %xmm2
ucomisd %xmm5, %xmm3
addsd %xmm0, %xmm2
jbe 0x65665
movsd %xmm2, 0x28(%rbx)
movapd %xmm2, %xmm5
jmp 0x65647
addsd %xmm1, %xmm4
movsd %xmm4, 0x30(%rbx)
ucomisd %xmm2, %xmm4
jae 0x6565c
jmp 0x65676
addsd %xmm0, %xmm4
movsd %xmm4, 0x30(%rbx)
ucomisd %xmm4, %xmm5
ja 0x6566d
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x65ad2
movq %r14, %rdi
callq 0xe810
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Arc.cpp
// Function: gaps::R2Arc::BBox() const
const R2Box R2Arc::
BBox(void) const
{
    // Return bounding box of arc ???
    R2Box bbox(R2null_box);
    bbox.Union(StartPoint());
    bbox.Union(StopPoint());
    if ((start < 0.0) && (stop > 0.0)) bbox.Union(Center() + R2posx_point * Radius());
    if ((start < RN_PI_OVER_TWO) && (stop > RN_PI_OVER_TWO)) bbox.Union(Center() + R2posy_point * Radius());
    if ((start < RN_PI) && (stop > RN_PI)) bbox.Union(Center() + R2negx_point * Radius());
    if ((start < RN_THREE_PI_OVER_TWO) && (stop > RN_THREE_PI_OVER_TWO)) bbox.Union(Center() + R2negy_point * Radius());
    return bbox;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x477762(%rip), %rsi    # 0x4dcee8
callq 0x5ca56
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x6342a
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5d088
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x6343e
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5d088
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm1, %xmm2
jbe 0x6581e
ucomisd %xmm2, %xmm0
jbe 0x6581e
movsd 0x20(%r14), %xmm0
leaq 0x477ac8(%rip), %rsi    # 0x4dd2b0
leaq 0x18(%rsp), %rdi
callq 0x5f833
leaq 0x10(%r14), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x5f7a1
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5d088
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm0
leaq 0x35733(%rip), %rax     # 0x9af58
movsd (%rax), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x65878
ucomisd %xmm2, %xmm0
jbe 0x65878
movsd 0x20(%r14), %xmm0
leaq 0x477a7e(%rip), %rsi    # 0x4dd2c0
leaq 0x18(%rsp), %rdi
callq 0x5f833
leaq 0x10(%r14), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x5f7a1
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5d088
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm0
leaq 0x356c9(%rip), %rax     # 0x9af48
movsd (%rax), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x658d2
ucomisd %xmm2, %xmm0
jbe 0x658d2
movsd 0x20(%r14), %xmm0
leaq 0x477a34(%rip), %rsi    # 0x4dd2d0
leaq 0x18(%rsp), %rdi
callq 0x5f833
leaq 0x10(%r14), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x5f7a1
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5d088
movsd 0x28(%r14), %xmm1
movsd 0x30(%r14), %xmm0
leaq 0x35687(%rip), %rax     # 0x9af60
movsd (%rax), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x65923
ucomisd %xmm2, %xmm0
jbe 0x65923
movsd 0x20(%r14), %xmm0
leaq 0x4779ea(%rip), %rsi    # 0x4dd2e0
leaq 0x18(%rsp), %rdi
callq 0x5f833
addq $0x10, %r14
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
movq %r14, %rsi
callq 0x5f7a1
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5d088
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
jmp 0x65938
jmp 0x65938
jmp 0x65938
jmp 0x65938
jmp 0x65938
movq %rax, %r14
movq %rbx, %rdi
callq 0x5d2ee
movq %r14, %rdi
callq 0xe810
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Arc.cpp
// Function: gaps::R2Arc::SetStartAngle(double)
void R2Arc::
SetStartAngle(RNAngle theta)
{
    // Set arc start angle
    start = theta;
    while (start >= RN_TWO_PI) start -= RN_TWO_PI;
    while (start < 0.0) start += RN_TWO_PI;
    while (stop >= (start + RN_TWO_PI)) { stop -= RN_TWO_PI; }
    while (stop < start) { stop += RN_TWO_PI; }
    assert((0.0 <= start) && (start <= RN_TWO_PI));
    assert((start <= stop) && (stop <= (start + RN_TWO_PI)));
}

// Assembly:
leaq 0x355d9(%rip), %rax     # 0x9af68
movsd (%rax), %xmm1
ucomisd %xmm1, %xmm0
jb 0x6599f
subsd %xmm1, %xmm0
jmp 0x65993
xorpd %xmm2, %xmm2
ucomisd %xmm0, %xmm2
movapd %xmm1, %xmm3
addsd %xmm0, %xmm3
jbe 0x659b7
movapd %xmm3, %xmm0
jmp 0x659a3
movsd %xmm0, 0x28(%rdi)
movsd 0x30(%rdi), %xmm2
ucomisd %xmm3, %xmm2
jb 0x659db
subsd %xmm1, %xmm2
movsd %xmm2, 0x30(%rdi)
jmp 0x659c1
addsd %xmm1, %xmm2
movsd %xmm2, 0x30(%rdi)
ucomisd %xmm2, %xmm0
ja 0x659d2
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Circle.cpp
// Function: gaps::R2InitCircle()
int 
R2InitCircle()
{
    // Initialize circle angles and points 
    for (int i = 0; i < R2circle_npoints; i++) {
        R2circle_angles[i] = ((RNScalar) i * RN_TWO_PI) / (RNScalar) R2circle_npoints;
        R2circle_points[i] = R2Point(cos(R2circle_angles[i]), sin(R2circle_angles[i]));
    }

    /* Return success */
    return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x3547a(%rip), %rax     # 0x9af68
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x477a01(%rip), %rbx    # 0x4dd500
leaq 0x4778fa(%rip), %r15    # 0x4dd400
xorl %r12d, %r12d
leaq 0x18(%rsp), %r14
cmpq $0x20, %r12
je 0x65b6a
cvtsi2sd %r12d, %xmm0
mulsd 0x8(%rsp), %xmm0
mulsd 0x34591(%rip), %xmm0    # 0x9a0b8
movsd %xmm0, (%r15)
callq 0xe890
movsd %xmm0, 0x10(%rsp)
movsd (%r15), %xmm0
callq 0xe0f0
movaps %xmm0, %xmm1
movq %r14, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x5f58c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5f6c4
incq %r12
addq $0x10, %rbx
addq $0x8, %r15
jmp 0x65b0e
pushq $0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Circle.cpp
// Function: gaps::R2Circle::Transform(gaps::R2Transformation const&)
void R2Circle::
Transform (const R2Transformation& transformation)
{
    // Transform center 
    center.Transform(transformation);

    // Scale radius 
    if (!transformation.IsIsotropic()) RNWarning("Circle transformed by anisotropic transformation");
    R2Vector v(R2ones_vector);
    v.Transform(transformation);
    radius *= v.Length() / RN_SQRT_TWO;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x8, %rdi
callq 0x5f6a0
movq (%r14), %rax
movq %r14, %rdi
callq *0x28(%rax)
testl %eax, %eax
jne 0x65d59
leaq 0x3438c(%rip), %rdi     # 0x9a0de
xorl %eax, %eax
callq 0x68283
leaq 0x34c68(%rip), %rsi     # 0x9a9c8
movq %rsp, %r15
movq %r15, %rdi
callq 0x5f8be
movq %r15, %rdi
movq %r14, %rsi
callq 0x5fc6a
movq %r15, %rdi
callq 0x5f958
leaq 0x351f3(%rip), %rax     # 0x9af78
divsd (%rax), %xmm0
mulsd 0x18(%rbx), %xmm0
movsd %xmm0, 0x18(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNGrfx.cpp
// Function: gaps::DecodePickColor(unsigned char*, unsigned int*, unsigned char*)
void
DecodePickColor(unsigned char color[4], unsigned int *index, unsigned char *alpha)
{
  // Unpack index (and then subtract one)
  unsigned int k = 0;
  k |= color[0] << 0;
  k |= color[1] << 8;
  k |= color[2] << 16;
  if (alpha) *alpha = color[4];
  if (index) *index = k - 1;
}

// Assembly:
movzwl (%rdi), %ecx
movzbl 0x2(%rdi), %eax
testq %rdx, %rdx
je 0x65edd
movb 0x4(%rdi), %dil
movb %dil, (%rdx)
testq %rsi, %rsi
je 0x65eeb
shll $0x10, %eax
orl %ecx, %eax
decl %eax
movl %eax, (%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNGrfx.cpp
// Function: gaps::R2SetViewport(int, int, int, int)
void 
R2SetViewport(int xmin, int ymin, int xmax, int ymax)
{
    /* Update viewport */
    RNgrfx_viewport_xmin = xmin;
    RNgrfx_viewport_ymin = ymin;
    RNgrfx_viewport_xmax = xmax;
    RNgrfx_viewport_ymax = ymax;
    RNgrfx_viewport_xcenter = (RNgrfx_viewport_xmax + RNgrfx_viewport_xmin) / 2;
    RNgrfx_viewport_ycenter = (RNgrfx_viewport_ymax + RNgrfx_viewport_ymin) / 2;
    RNgrfx_viewport_width = RNgrfx_viewport_xmax - RNgrfx_viewport_xmin;
    RNgrfx_viewport_height = RNgrfx_viewport_ymax - RNgrfx_viewport_ymin;

    /* Update scale */
    RNgrfx_window_xscale = RNgrfx_viewport_width / RNgrfx_window_width;
    RNgrfx_window_yscale = RNgrfx_viewport_height / RNgrfx_window_height;
}

// Assembly:
movl %edx, %r8d
movl %edi, 0x477813(%rip)    # 0x4dd708
movl %esi, 0x477811(%rip)    # 0x4dd70c
movl %edx, 0x74bd3(%rip)     # 0xdaad4
movl %ecx, 0x74bd1(%rip)     # 0xdaad8
leal (%r8,%rdi), %eax
pushq $0x2
popq %r9
cltd
idivl %r9d
movl %eax, 0x74bb3(%rip)     # 0xdaacc
leal (%rcx,%rsi), %eax
cltd
idivl %r9d
movl %eax, 0x74baa(%rip)     # 0xdaad0
subl %edi, %r8d
cvtsi2ss %r8d, %xmm0
movl %r8d, 0x74b8f(%rip)     # 0xdaac4
subl %esi, %ecx
divss 0x74b6d(%rip), %xmm0    # 0xdaaac
movss %xmm0, 0x74b5d(%rip)    # 0xdaaa4
cvtsi2ss %ecx, %xmm0
movl %ecx, 0x74b77(%rip)     # 0xdaac8
divss 0x74b57(%rip), %xmm0    # 0xdaab0
movss %xmm0, 0x74b47(%rip)    # 0xdaaa8
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNGrfx.cpp
// Function: gaps::R2SetWindow(float, float, float, float)
void 
R2SetWindow(float xmin, float ymin, float xmax, float ymax)
{
    /* Update window */
    RNgrfx_window_xmin = xmin;
    RNgrfx_window_ymin = ymin;
    RNgrfx_window_xmax = xmax;
    RNgrfx_window_ymax = ymax;
    RNgrfx_window_xcenter = (RNgrfx_window_xmax + RNgrfx_window_xmin) / 2.0;
    RNgrfx_window_ycenter = (RNgrfx_window_ymax + RNgrfx_window_ymin) / 2.0;
    RNgrfx_window_width = RNgrfx_window_xmax - RNgrfx_window_xmin;
    RNgrfx_window_height = RNgrfx_window_ymax - RNgrfx_window_ymin;

    /* Update scale */
    RNgrfx_window_xscale = RNgrfx_viewport_width / RNgrfx_window_width;
    RNgrfx_window_yscale = RNgrfx_viewport_height / RNgrfx_window_height;
}

// Assembly:
movss %xmm0, 0x477796(%rip)   # 0x4dd700
movss %xmm1, 0x477792(%rip)   # 0x4dd704
movss %xmm2, 0x74b42(%rip)    # 0xdaabc
movss %xmm3, 0x74b3e(%rip)    # 0xdaac0
movaps %xmm0, %xmm4
addss %xmm2, %xmm4
movss 0x34f6f(%rip), %xmm5    # 0x9af00
mulss %xmm5, %xmm4
movss %xmm4, 0x74b17(%rip)    # 0xdaab4
movaps %xmm1, %xmm4
addss %xmm3, %xmm4
mulss %xmm5, %xmm4
movss %xmm4, 0x74b08(%rip)    # 0xdaab8
subss %xmm0, %xmm2
movss %xmm2, 0x74af0(%rip)    # 0xdaaac
subss %xmm1, %xmm3
cvtsi2ssl 0x74afc(%rip), %xmm0 # 0xdaac4
movss %xmm3, 0x74ae0(%rip)    # 0xdaab0
cvtsi2ssl 0x74af0(%rip), %xmm1 # 0xdaac8
divss %xmm2, %xmm0
movss %xmm0, 0x74ac0(%rip)    # 0xdaaa4
divss %xmm3, %xmm1
movss %xmm1, 0x74ab8(%rip)    # 0xdaaa8
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNGrfx.cpp
// Function: gaps::R2ScaleWindow(float, float)
void 
R2ScaleWindow(float xscale, float yscale)
{
    /* Update window */
    RNgrfx_window_xmin = RNgrfx_window_xcenter - 0.5 * xscale * RNgrfx_window_width;
    RNgrfx_window_ymin = RNgrfx_window_ycenter - 0.5 * yscale * RNgrfx_window_height;
    RNgrfx_window_xmax = RNgrfx_window_xcenter + 0.5 * xscale * RNgrfx_window_width;
    RNgrfx_window_ymax = RNgrfx_window_ycenter + 0.5 * yscale * RNgrfx_window_height;
    RNgrfx_window_width = RNgrfx_window_xmax - RNgrfx_window_xmin;
    RNgrfx_window_height = RNgrfx_window_ymax - RNgrfx_window_ymin;

    /* Update scale */
    RNgrfx_window_xscale = RNgrfx_viewport_width / RNgrfx_window_width;
    RNgrfx_window_yscale = RNgrfx_viewport_height / RNgrfx_window_height;
}

// Assembly:
cvtss2sd 0x74abb(%rip), %xmm3    # 0xdaab4
cvtss2sd %xmm0, %xmm0
movsd 0x2d00b(%rip), %xmm4    # 0x93010
mulsd %xmm4, %xmm0
cvtss2sd 0x74a9b(%rip), %xmm5    # 0xdaaac
movapd 0x2d017(%rip), %xmm6    # 0x93030
movapd %xmm0, %xmm7
xorpd %xmm6, %xmm7
cvtss2sd 0x74a8f(%rip), %xmm2    # 0xdaab8
cvtss2sd %xmm1, %xmm1
mulsd %xmm4, %xmm1
cvtss2sd 0x74a77(%rip), %xmm4    # 0xdaab0
xorpd %xmm1, %xmm6
unpcklpd %xmm7, %xmm0            # xmm0 = xmm0[0],xmm7[0]
movlhps %xmm5, %xmm5            # xmm5 = xmm5[0,0]
mulpd %xmm0, %xmm5
movlhps %xmm3, %xmm3            # xmm3 = xmm3[0,0]
addpd %xmm5, %xmm3
cvtpd2ps %xmm3, %xmm0
movapd %xmm0, %xmm3
shufps $0x55, %xmm0, %xmm3     # xmm3 = xmm3[1,1],xmm0[1,1]
movss %xmm3, 0x47769d(%rip)   # 0x4dd700
movss %xmm0, 0x74a51(%rip)    # 0xdaabc
unpcklpd %xmm6, %xmm1            # xmm1 = xmm1[0],xmm6[0]
movlhps %xmm4, %xmm4            # xmm4 = xmm4[0,0]
mulpd %xmm1, %xmm4
movlhps %xmm2, %xmm2            # xmm2 = xmm2[0,0]
addpd %xmm4, %xmm2
cvtpd2ps %xmm2, %xmm1
movapd %xmm1, %xmm2
shufps $0x55, %xmm1, %xmm2     # xmm2 = xmm2[1,1],xmm1[1,1]
movss %xmm2, 0x477673(%rip)   # 0x4dd704
movss %xmm1, 0x74a27(%rip)    # 0xdaac0
subss %xmm3, %xmm0
movss %xmm0, 0x74a07(%rip)    # 0xdaaac
subss %xmm2, %xmm1
cvtsi2ssl 0x74a13(%rip), %xmm2 # 0xdaac4
movss %xmm1, 0x749f7(%rip)    # 0xdaab0
cvtsi2ssl 0x74a07(%rip), %xmm3 # 0xdaac8
divss %xmm0, %xmm2
movss %xmm2, 0x749d7(%rip)    # 0xdaaa4
divss %xmm1, %xmm3
movss %xmm3, 0x749cf(%rip)    # 0xdaaa8
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNGrfx.cpp
// Function: gaps::R2TranslateWindow(float, float)
void 
R2TranslateWindow(float xtranslate, float ytranslate)
{
    /* Update window */
    RNgrfx_window_xmin += xtranslate;
    RNgrfx_window_ymin += ytranslate;
    RNgrfx_window_xmax += xtranslate;
    RNgrfx_window_ymax += ytranslate;
    RNgrfx_window_xcenter = (RNgrfx_window_xmax + RNgrfx_window_xmin) / 2.0;
    RNgrfx_window_ycenter = (RNgrfx_window_ymax + RNgrfx_window_ymin) / 2.0;
}

// Assembly:
movss 0x47761e(%rip), %xmm2   # 0x4dd700
addss %xmm0, %xmm2
movss %xmm2, 0x477612(%rip)   # 0x4dd700
movss 0x47760e(%rip), %xmm3   # 0x4dd704
addss %xmm1, %xmm3
addss 0x749ba(%rip), %xmm0    # 0xdaabc
movss %xmm3, 0x4775fa(%rip)   # 0x4dd704
movss %xmm0, 0x749aa(%rip)    # 0xdaabc
addss 0x749a6(%rip), %xmm1    # 0xdaac0
movss %xmm1, 0x7499e(%rip)    # 0xdaac0
addss %xmm2, %xmm0
movss 0x34dd2(%rip), %xmm2    # 0x9af00
mulss %xmm2, %xmm0
movss %xmm0, 0x7497a(%rip)    # 0xdaab4
addss %xmm3, %xmm1
mulss %xmm2, %xmm1
movss %xmm1, 0x7496e(%rip)    # 0xdaab8
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNArray.cpp
// Function: gaps::RNVArray::operator=(gaps::RNVArray const&)
RNVArray& RNVArray::
operator=(const RNVArray& array)
{
    // Empty array
    Empty();

    // Copy array of entries
    if (array.nentries > 0) {
	// Allocate memory for entries
	Resize(array.nentries);
	
	// Copy entries from array
	for (int i = 0; i < array.nentries; i++) 
            entries[i] = array.entries[i];

	// Update number of entries
	nentries = array.nentries;
    }

    // Return array
    return *this;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x0, 0xc(%rdi)
jle 0x66332
andl $0x0, 0xc(%rbx)
movl 0xc(%r14), %esi
testl %esi, %esi
jle 0x6636d
movq %rbx, %rdi
callq 0x663f0
movl 0xc(%r14), %eax
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
cmpq %rcx, %rdx
je 0x6636a
movq (%r14), %rsi
movq (%rsi,%rcx,8), %rsi
movq (%rbx), %rdi
movq %rsi, (%rdi,%rcx,8)
incq %rcx
jmp 0x66352
movl %eax, 0xc(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNArray.cpp
// Function: gaps::RNVArray::InternalInsert(void*, int)
RNArrayEntry *RNVArray::
InternalInsert(void *data, int k)
{
    // Make sure there is enough storage for new entry
    Resize(nentries+1);

    // Increment number of entries
    nentries++;

    // Shift entries up one notch 
    if (k < (nentries-1)) Shift(k, 0, 1);

    // Copy data into kth entry
    entries[k] = data;

    // Return entry
    return &entries[k];
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc(%rdi), %esi
incl %esi
callq 0x663f0
movl 0xc(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xc(%rbx)
cmpl %ebp, %eax
jle 0x663da
pushq $0x1
popq %rcx
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x66468
movq (%rbx), %rcx
movslq %ebp, %rax
movq %r14, (%rcx,%rax,8)
shlq $0x3, %rax
addq (%rbx), %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNArray.cpp
// Function: gaps::RNVArray::Resize(int)
void RNVArray::
Resize(int length)
{
    // Check if length is valid
    assert(length >= nentries);
    assert(nentries <= nallocated);

    // Check if are growing array
    if (length > nallocated) {
	// Adjust length to be next greater power of 2
	int tmplength = RN_ARRAY_MIN_ALLOCATED;
	while (tmplength < length) tmplength *= 2;
	length = tmplength;

	// Allocate new entries
	RNArrayEntry *newentries = NULL;
	if (length > 0) {
	    newentries = (RNArrayEntry *) malloc(length * sizeof(RNArrayEntry));
	    assert(newentries);
	}

	// Copy old entries into new entries
	if (nentries > 0) {
	    assert(entries);
	    assert(newentries);
	    for (int i = 0; i < nentries; i++)
                newentries[i] = entries[i];
	}
 
	// Zero remaining new entries
	if (nentries < length) {
	    assert(newentries);
	    for (int i = nentries; i < length; i++)
                newentries[i] = NULL;
	}

	// Replace entries
	if (entries) free(entries);
	entries = newentries;

	// Update nallocated
	nallocated = length;
    }
}

// Assembly:
cmpl %esi, 0x8(%rdi)
jge 0x66466
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rax
movl %eax, %r15d
leal (%r15,%r15), %eax
cmpl %esi, %r15d
jl 0x66400
movl %r15d, %edi
shlq $0x3, %rdi
callq 0xe600
movq %rax, %r14
movslq 0xc(%rbx), %rax
testq %rax, %rax
jle 0x6643b
movq (%rbx), %rcx
xorl %edx, %edx
cmpq %rdx, %rax
je 0x6643b
movq (%rcx,%rdx,8), %rsi
movq %rsi, (%r14,%rdx,8)
incq %rdx
jmp 0x66429
cmpl %r15d, %eax
jge 0x66452
movslq %r15d, %rcx
cmpq %rax, %rcx
je 0x66452
andq $0x0, (%r14,%rax,8)
incq %rax
jmp 0x66443
movq (%rbx), %rdi
callq 0xe560
movq %r14, (%rbx)
movl %r15d, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNArray.cpp
// Function: gaps::RNVArray::Shift(int, int, int)
void RNVArray::
Shift(int start, int length, int delta)
{
    /* Compute number of entries to shift */
    if ((delta < 0) && (start < -delta)) start = -delta;
    int nshift = nentries - start;
    if (delta > 0) nshift -= delta;
    if (nshift <= 0) return;
    if ((length > 0) && (length < nshift)) nshift = length;

    /* Shift array entries */
    if (delta < 0) {
        for (int i = start; i < (start + nshift); i++) {
	    entries[i+delta]=entries[i];
	}
    }
    else if (delta > 0) {
        for (int i = (start + nshift - 1); i >= start; i--) {
	    entries[i+delta]=entries[i];
	}
    }
}

// Assembly:
movl %ecx, %eax
negl %eax
cmpl %esi, %eax
movl %esi, %r8d
cmovgl %eax, %r8d
xorl %r9d, %r9d
testl %ecx, %ecx
movl %esi, %r11d
cmovsl %r8d, %r11d
cmovgl %ecx, %r9d
movl 0xc(%rdi), %r10d
addl %r11d, %r9d
subl %r9d, %r10d
testl %r10d, %r10d
jle 0x66501
cmpl %edx, %r10d
movl %edx, %r9d
cmovbl %r10d, %r9d
testl %edx, %edx
cmovlel %r10d, %r9d
testl %ecx, %ecx
js 0x664d4
jle 0x66501
addl %esi, %r9d
movslq %r9d, %rdx
movl %ecx, %eax
movslq %esi, %rcx
shlq $0x3, %rax
cmpq %rcx, %rdx
jle 0x66501
movq (%rdi), %rsi
leaq (%rsi,%rdx,8), %r8
movq -0x8(%rsi,%rdx,8), %rsi
decq %rdx
movq %rsi, -0x8(%rax,%r8)
jmp 0x664b9
addl %r8d, %r9d
cmpl %eax, %esi
cmovgl %esi, %eax
cltq
movslq %r9d, %rdx
movslq %ecx, %rcx
shlq $0x3, %rcx
cmpq %rdx, %rax
jge 0x66501
movq (%rdi), %rsi
leaq (%rsi,%rax,8), %r8
movq (%rsi,%rax,8), %rsi
movq %rsi, (%rcx,%r8)
incq %rax
jmp 0x664e8
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNArray.cpp
// Function: gaps::RNVArray::Empty(int)
void RNVArray::
Empty(RNBoolean deallocate)
{
    // Remove all entries from array
    Truncate(0);

    // Deallocate memory
    if (deallocate) {
        if (entries) delete entries;
        entries = NULL;
        nallocated = 0;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0xc(%rdi)
jle 0x66536
andl $0x0, 0xc(%rbx)
testl %esi, %esi
je 0x66552
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x6654a
pushq $0x8
popq %rsi
callq 0xe460
andq $0x0, (%rbx)
andl $0x0, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNArray.cpp
// Function: gaps::RNVArray::Reverse(int, int)
void RNVArray::
Reverse(int start, int length)
{
    /* Compute number of entries to reverse */
    int nreverse = nentries - start;
    if (nreverse <= 0) return;
    if ((length > 0) && (length < nreverse)) nreverse = length;
    if (nreverse <= 0) return;

    // Reverse length at start
    int i, j;
    for (i = start, j = start + nreverse - 1; i < j; i++, j--) {
        Swap(i, j);
    }
}

// Assembly:
movl 0xc(%rdi), %eax
subl %esi, %eax
jle 0x665b2
cmpl %edx, %eax
movl %edx, %ecx
cmovbl %eax, %ecx
testl %edx, %edx
cmovlel %eax, %ecx
addl %esi, %ecx
movslq %esi, %rax
movslq %ecx, %rcx
decq %rcx
cmpq %rcx, %rax
jge 0x665b2
movq (%rdi), %rdx
movq (%rdx,%rax,8), %rsi
movq (%rdx,%rcx,8), %r8
movq %r8, (%rdx,%rax,8)
movq (%rdi), %rdx
movq %rsi, (%rdx,%rcx,8)
incq %rax
jmp 0x6658f
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNArray.cpp
// Function: gaps::RNVArray::Append(gaps::RNVArray const&)
void RNVArray::
Append(const RNVArray& array)
{
    // Resize first
    Resize(NEntries() + array.NEntries());

    // Insert entries of array
    for (int i = 0; i < array.NEntries(); i++)
	Insert(array.Kth(i));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0xc(%rsi), %esi
addl 0xc(%rdi), %esi
callq 0x663f0
xorl %r15d, %r15d
movslq 0xc(%rbx), %rax
cmpq %rax, %r15
jge 0x66608
movq (%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x22bfc
incq %r15
jmp 0x665eb
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNArray.cpp
// Function: gaps::RNVArray::BubbleSort(int (*)(void*, void*, void*), void*)
void RNVArray::
BubbleSort(int (*compare)(void *data1, void *data2, void *appl), void *appl)
{
    // Sort vector entries
    for (int i = 0; i < NEntries(); i++) {
	for (int j = i+1; j < NEntries(); j++) {
	    if ((*compare)(entries[j], entries[i], appl) < 0) {
	        Swap(i, j);
	    }
	}
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0xc(%rdi), %eax
pushq $0x1
popq %r12
xorl %r13d, %r13d
movslq %eax, %rcx
movq %r12, %rbp
cmpq %rcx, %r13
jl 0x66681
jmp 0x6668d
movq (%r15), %rax
movq (%rax,%rbp,8), %rdi
movq (%rax,%r13,8), %rsi
movq %rbx, %rdx
callq *%r14
testl %eax, %eax
jns 0x6667a
movq (%r15), %rax
movq (%rax,%r13,8), %rcx
movq (%rax,%rbp,8), %rdx
movq %rdx, (%rax,%r13,8)
movq (%r15), %rax
movq %rcx, (%rax,%rbp,8)
incq %rbp
movl 0xc(%r15), %eax
cmpl %ebp, %eax
jg 0x6664f
incq %r13
incq %r12
jmp 0x66642
addq $0x8, %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/RNBasics/RNSvd.cpp
// Function: gaps::rotate_cols(int, int, double, double, double*, int, int, int, int)
void rotate_cols(int i,int j,RNScalar cos,RNScalar sin,RNScalar* a,int start,int n,int mm,int nn)
{
    int end = start+n, k;
    RNScalar x,y;
    for (k=start; k<end; k++) {
	x = REF2D(a,mm,nn,k,i);
	y = REF2D(a,mm,nn,k,j);
	REF2D(a,mm,nn,k,i) =  cos*x + sin*y;
	REF2D(a,mm,nn,k,j) = -sin*x + cos*y;
    }
}

// Assembly:
movslq 0x8(%rsp), %rax
addl %ecx, %r8d
movapd 0x2c482(%rip), %xmm2    # 0x93030
xorpd %xmm1, %xmm2
movslq %ecx, %rcx
movslq %r8d, %r8
movslq %edi, %rdi
movslq %esi, %rsi
movq %rax, %r9
imulq %rcx, %r9
leaq (%rdx,%r9,8), %rdx
shlq $0x3, %rax
cmpq %r8, %rcx
jge 0x66c0e
movsd (%rdx,%rdi,8), %xmm3
movsd (%rdx,%rsi,8), %xmm4
movapd %xmm4, %xmm5
mulsd %xmm1, %xmm5
movapd %xmm0, %xmm6
mulsd %xmm3, %xmm6
addsd %xmm5, %xmm6
movsd %xmm6, (%rdx,%rdi,8)
mulsd %xmm0, %xmm4
mulsd %xmm2, %xmm3
addsd %xmm4, %xmm3
movsd %xmm3, (%rdx,%rsi,8)
incq %rcx
addq %rax, %rdx
jmp 0x66bcd
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNSvd.cpp
// Function: gaps::rotate_rows(int, int, double, double, double*, int, int, int, int)
void rotate_rows(int i,int j, RNScalar cos,RNScalar sin,RNScalar* a,int start,int n,int mm,int nn)
{
    int end = start+n, k;
    RNScalar x,y;
    for (k=start; k<end; k++) {
	x = REF2D(a,mm,nn,i,k);
	y = REF2D(a,mm,nn,j,k);
	REF2D(a,mm,nn,i,k) =  cos*x + sin*y;
	REF2D(a,mm,nn,j,k) = -sin*x + cos*y;
    }
}

// Assembly:
movl 0x8(%rsp), %eax
addl %ecx, %r8d
imull %eax, %edi
imull %eax, %esi
movapd 0x2c40c(%rip), %xmm2    # 0x93030
xorpd %xmm1, %xmm2
movslq %ecx, %rax
movslq %r8d, %rcx
movslq %esi, %r8
movslq %edi, %rsi
leaq (%rdx,%rsi,8), %rsi
leaq (%rdx,%r8,8), %rdx
cmpq %rcx, %rax
jge 0x66c7a
movsd (%rsi,%rax,8), %xmm3
movsd (%rdx,%rax,8), %xmm4
movapd %xmm4, %xmm5
mulsd %xmm1, %xmm5
movapd %xmm0, %xmm6
mulsd %xmm3, %xmm6
addsd %xmm5, %xmm6
movsd %xmm6, (%rsi,%rax,8)
mulsd %xmm0, %xmm4
mulsd %xmm2, %xmm3
addsd %xmm4, %xmm3
movsd %xmm3, (%rdx,%rax,8)
incq %rax
jmp 0x66c3c
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNSvd.cpp
// Function: gaps::clr_top_supdiag_elt(double*, int, int, double*, int, int, int)
void clr_top_supdiag_elt(RNScalar * b,int p,int z,RNScalar * u,int m,int n,int min)
{
    int i;
    RNScalar r, x, hypot, cos, sin;

    for (i=p+1; i<=z; i++) {
	r = REF2D(b,m,n,p,i);
	x = REF2D(b,m,n,i,i);
	if (r==0) break;
	hypot = ((RNScalar) sqrt (r*r + x*x)); //hypot = pythag(r,x);
	cos = x/hypot;
	sin = r/hypot;
	/* update the diagonal and superdiagonal elements */
	REF2D(b,m,n,p,i) = 0;
	REF2D(b,m,n,i,i) = hypot;
	/* Rotate the remainder of rows p and i (only need to
	** rotate one more element, since the rest are zero) */
	if (i != z) rotate_rows(p,i,cos,sin,b,i+1,1,m,n);
	/* accumulate the rotation into u */
	rotate_cols(i,p,cos,sin,u,0,m,m,min);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %r8d, 0x1c(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdi, %r12
movl %r9d, %eax
imull %esi, %eax
movq %r9, 0x20(%rsp)
leal 0x1(%r9), %ecx
movl %esi, 0x18(%rsp)
movslq %esi, %rsi
cltq
movslq %edx, %rdx
movl %esi, %r13d
shlq $0x3, %rax
leaq (%rax,%rsi,8), %rax
leaq (%rdi,%rax), %r15
addq $0x8, %r15
pushq $0x1
popq %rax
movq %rdx, 0x38(%rsp)
subl %edx, %eax
addq %r13, %rax
movq %rax, 0x28(%rsp)
movq %rsi, 0x40(%rsp)
leal 0x1(%rsi), %r14d
movl %ecx, 0x14(%rsp)
imull %ecx, %r14d
xorl %ebp, %ebp
movq 0x40(%rsp), %rax
addq %rbp, %rax
cmpq 0x38(%rsp), %rax
jge 0x66dbe
movsd (%r15,%rbp,8), %xmm1
ucomisd 0x2c4de(%rip), %xmm1    # 0x931e8
jne 0x66d12
jnp 0x66dbe
leaq 0x1(,%rbp), %rbx
addq %r13, %rbx
movslq %r14d, %rax
movsd (%r12,%rax,8), %xmm0
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm3, %xmm2
sqrtsd %xmm2, %xmm2
divsd %xmm2, %xmm0
andq $0x0, (%r15,%rbp,8)
divsd %xmm2, %xmm1
movsd %xmm2, (%r12,%rax,8)
movq 0x28(%rsp), %rax
addl %ebp, %eax
je 0x66d90
leal 0x2(%r13,%rbp), %ecx
movq 0x20(%rsp), %rax
movl %eax, (%rsp)
movl %r13d, %edi
movl %ebx, %esi
movq %r12, %rdx
pushq $0x1
popq %r8
movsd %xmm1, 0x50(%rsp)
movsd %xmm0, 0x48(%rsp)
callq 0x66c0f
movsd 0x48(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
movl 0x90(%rsp), %eax
movl %eax, (%rsp)
movl %ebx, %edi
movl 0x18(%rsp), %esi
movq 0x30(%rsp), %rdx
xorl %ecx, %ecx
movl 0x1c(%rsp), %r8d
callq 0x66b9e
incq %rbp
addl 0x14(%rsp), %r14d
jmp 0x66ce9
addq $0x58, %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/RNBasics/RNSvd.cpp
// Function: gaps::clr_bot_supdiag_elt(double*, int, int, double*, int, int, int)
void clr_bot_supdiag_elt(RNScalar * b,int p,int z,RNScalar * v,int m,int n,int min)
{
    int i;
    RNScalar r, x, hypot, cos, sin;

    for (i=z-1; i>=p; i--) {
	r = REF2D(b,m,n,i,z);
	x = REF2D(b,m,n,i,i);
	if (r==0) break;
	hypot = ((RNScalar) sqrt (r*r + x*x)); //hypot = pythag(r,x);
	cos = x/hypot;
	sin = r/hypot;
	/* update the diagonal and superdiagonal elements */
	REF2D(b,m,n,i,z) = 0;
	REF2D(b,m,n,i,i) = hypot;
	/* Rotate the remainder of cols z and i (only need to
	** rotate one more element, since the rest are zero) */
	if (i != p) rotate_cols(i,z,cos,sin,b,i-1,1,m,n);
	/* accumulate the rotation into v */
	rotate_rows(i,z,cos,sin,v,0,n,min,n);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r9d, %ebx
movq %rcx, 0x50(%rsp)
movl %edx, %ebp
movslq %edx, %rax
movslq %r9d, %rcx
movslq %esi, %rdx
leal -0x2(%rax), %esi
movq %rsi, 0x10(%rsp)
movq %rdi, 0x18(%rsp)
leaq (%rdi,%rax,8), %rsi
leal -0x1(%rax), %edi
movl %r9d, %r14d
movq %rdi, 0x38(%rsp)
imull %edi, %r14d
movq %rdx, 0x58(%rsp)
subl %eax, %edx
incl %edx
movq %rdx, 0x30(%rsp)
movq %rax, 0x60(%rsp)
decq %rax
imulq %rcx, %rax
movq %rsi, 0x40(%rsp)
leaq (%rsi,%rax,8), %r12
shlq $0x3, %rcx
negq %rcx
movq %rcx, 0x48(%rsp)
xorl %r15d, %r15d
movq 0x60(%rsp), %rax
addq %r15, %rax
cmpq 0x58(%rsp), %rax
jle 0x66f18
movsd (%r12), %xmm1
ucomisd 0x2c387(%rip), %xmm1    # 0x931e8
jne 0x66e69
jnp 0x66f18
movslq %r14d, %rax
movq 0x40(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
addq $-0x8, %rax
movq 0x38(%rsp), %rcx
leaq (%rcx,%r15), %r13
movsd (%rax,%r15,8), %xmm0
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm3, %xmm2
sqrtsd %xmm2, %xmm2
andq $0x0, (%r12)
divsd %xmm2, %xmm0
divsd %xmm2, %xmm1
movsd %xmm2, (%rax,%r15,8)
cmpl %r15d, 0x30(%rsp)
je 0x66ef1
movq 0x10(%rsp), %rax
leal (%rax,%r15), %ecx
movl %ebx, (%rsp)
movl %r13d, %edi
movl %ebp, %esi
movq 0x18(%rsp), %rdx
pushq $0x1
popq %r8
movsd %xmm1, 0x28(%rsp)
movsd %xmm0, 0x20(%rsp)
callq 0x66b9e
movsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
movl %ebx, (%rsp)
movl %r13d, %edi
movl %ebp, %esi
movq 0x50(%rsp), %rdx
xorl %ecx, %ecx
movl %ebx, %r8d
callq 0x66c0f
decq %r15
subl %ebx, %r14d
addq 0x48(%rsp), %r12
jmp 0x66e40
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNSvd.cpp
// Function: gaps::RNSvdBacksubstitute(int, int, double const*, double const*, double const*, double const*, double*, double)
void RNSvdBacksubstitute(int m, int n, 
    const RNScalar *u, const RNScalar *w, const RNScalar *vt, const RNScalar *b, 
    RNScalar *x, RNScalar eps)
{
    const int min = MIN(m,n);
    const RNScalar thresh = eps * w[0];	/* singular vals are sorted, w[0] is max */
    RNScalar *tmp = ALLOC1D(min);
    int i,j,k;

    for (j=0; j<min; j++) {
	RNScalar s = 0;
	if (w[j] >= thresh) {
	    for (i=0; i<m; i++) s += REF2D(u,m,min,i,j) * b[i];
	    s /= w[j];
	}
	tmp[j] = s;
    }
    for (k=0; k<n; k++) {
	RNScalar s=0;
	for (j=0; j<min; j++) s += REF2D(vt,min,n,j,k) * tmp[j];
	x[k] = s;
    }
    FREE(tmp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movq %r8, %rbx
movq %rcx, %r12
movq %rdx, %r13
movl %esi, %r14d
movl %edi, %ebp
cmpl %esi, %edi
movl %esi, %ecx
cmovll %edi, %ecx
movq %rcx, (%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
mulsd (%r12), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq (,%rcx,8), %rdi
callq 0xe600
movslq (%rsp), %rdx
xorl %esi, %esi
testl %ebp, %ebp
cmovlel %esi, %ebp
testl %edx, %edx
movl $0x0, %ecx
cmovgl %edx, %ecx
shlq $0x3, %rdx
cmpq %rcx, %rsi
je 0x67be8
movsd (%r12,%rsi,8), %xmm1
xorpd %xmm0, %xmm0
ucomisd 0x10(%rsp), %xmm1
jb 0x67bda
movq %r13, %rdi
xorl %r8d, %r8d
cmpq %r8, %rbp
je 0x67bd6
movsd (%rdi), %xmm2
mulsd (%r15,%r8,8), %xmm2
addsd %xmm2, %xmm0
incq %r8
addq %rdx, %rdi
jmp 0x67bbb
divsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rsi,8)
incq %rsi
addq $0x8, %r13
jmp 0x67b9e
movslq %r14d, %rdx
xorl %esi, %esi
testl %r14d, %r14d
cmovlel %esi, %r14d
shlq $0x3, %rdx
movq 0x8(%rsp), %r9
cmpq %r14, %rsi
je 0x67c36
xorpd %xmm0, %xmm0
movq %rbx, %rdi
xorl %r8d, %r8d
cmpq %r8, %rcx
je 0x67c27
movsd (%rdi), %xmm1
mulsd (%rax,%r8,8), %xmm1
addsd %xmm1, %xmm0
incq %r8
addq %rdx, %rdi
jmp 0x67c0c
movsd %xmm0, (%r9,%rsi,8)
incq %rsi
addq $0x8, %rbx
jmp 0x67bfd
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe560
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNSvd.cpp
// Function: gaps::RNSvdSolve(int, int, double const*, double const*, double*, double)
void RNSvdSolve(int m, int n, 
    const RNScalar *a, const RNScalar *b,
    RNScalar *x, RNScalar eps)
{
  // Allocate memory
  int min = (m < n) ? m : n;
  RNScalar *u = new RNScalar [ m * min ];
  RNScalar *w = new RNScalar [ min ];
  RNScalar *vt = new RNScalar [ min * n ];
  assert(u && w && vt);

  // Decompose matrix
  RNSvdDecompose(m, n, a, u, w, vt);

  // Backsubstitute
  RNSvdBacksubstitute(m, n, u, w, vt, b, x, eps);

  // Delete memory
  delete [] u;
  delete [] w;
  delete [] vt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movsd %xmm0, 0x20(%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
movl %esi, %ebp
movl %edi, %r15d
cmpl %esi, %edi
movl %esi, %r14d
cmovll %edi, %r14d
movq %rdx, 0x8(%rsp)
movl %r14d, %eax
imull %edi, %eax
leaq (,%rax,8), %rdi
testl %eax, %eax
pushq $-0x1
popq %r13
cmovsq %r13, %rdi
callq 0xe030
movq %rax, %r12
leaq (,%r14,8), %rdi
testl %r14d, %r14d
cmovsq %r13, %rdi
callq 0xe030
movq %rax, %rbx
imull %ebp, %r14d
leaq (,%r14,8), %rdi
testl %r14d, %r14d
cmovsq %r13, %rdi
callq 0xe030
movq %rax, %r14
movl %r15d, %edi
movl %ebp, %esi
movq 0x8(%rsp), %rdx
movq %r12, %rcx
movq %rbx, %r8
movq %rax, %r9
callq 0x678f6
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movl %r15d, %edi
movl %ebp, %esi
movq %r12, %rdx
movq %rbx, %rcx
movq %r14, %r8
movq 0x18(%rsp), %r9
movsd 0x20(%rsp), %xmm0
callq 0x67b38
movq %r12, %rdi
callq 0xe5d0
movq %rbx, %rdi
callq 0xe5d0
movq %r14, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe5d0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNScalar.cpp
// Function: gaps::RNSeedRandomScalar(double)
void 
RNSeedRandomScalar(RNScalar seed)
{
#if (RN_OS == RN_WINDOWS)
  if (seed == 0.0) srand(GetTickCount());
  else srand((int) (1.0E6 * seed));
#elif (RN_CC_VER == RN_C11)
#else
  if (seed == 0.0) { 
    struct timeval timevalue;
    gettimeofday(&timevalue, NULL);
    srand48(timevalue.tv_usec);
  }
  else {
    srand48((long) (1.0E6 * seed));
  }
#endif
  random_seeded = TRUE;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x67df7
jp 0x67df7
movq %rsp, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe790
movq 0x8(%rbx), %rdi
jmp 0x67e04
mulsd 0x330f9(%rip), %xmm0    # 0x9aef8
cvttsd2si %xmm0, %rdi
callq 0xe7e0
movb $0x1, 0x4759c0(%rip)    # 0x4dd7d0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNType.cpp
// Function: gaps::RNClassType::RNClassType(int, char const*)
RNClassType::
RNClassType(RNClassID id, const char *name)
{
    // Initialize class type
    this->id = id;
    if (!name) this->name = NULL;
    else {
	this->name = new char[strlen(name) + 1];
	assert(this->name);
	strcpy(this->name, name);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl %esi, (%rdi)
testq %rdx, %rdx
je 0x67ed6
movq %rdx, %rbx
movq %rdx, %rdi
callq 0xe1e0
leaq 0x1(%rax), %rdi
callq 0xe030
movq %rax, 0x8(%r14)
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe3e0
andq $0x0, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNType.cpp
// Function: gaps::RNClassType::RNClassType(char const*)
RNClassType::
RNClassType(const char *name)
{
    // Initialize class type
    id = ++RNnclass_ids;
    if (!name) this->name = NULL;
    else {
	this->name = new char[strlen(name) + 1];
	assert(this->name);
	strcpy(this->name, name);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl 0x4758f7(%rip), %eax    # 0x4dd7e8
incl %eax
movl %eax, 0x4758ef(%rip)    # 0x4dd7e8
movl %eax, (%rdi)
testq %rsi, %rsi
je 0x67f2a
movq %rsi, %rbx
movq %rsi, %rdi
callq 0xe1e0
leaq 0x1(%rax), %rdi
callq 0xe030
movq %rax, 0x8(%r14)
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe3e0
andq $0x0, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNMem.cpp
// Function: gaps::RNSwap(void*, void*, void*, int)
void RNSwap(void *node1, void *node2, void *buffer, int size)
{
    // Check arguments
    assert(node1);
    assert(node2);
    assert(size > 0);

    // Find suitable swap buffer 
    void *swap = buffer;
    char swap_buffer[RN_SWAP_BUFFER_SIZE];
    if (buffer == NULL) {
	swap = (void *) swap_buffer;
	if (size > RN_SWAP_BUFFER_SIZE) {
	    swap = (void *) malloc(size);
            if (!swap) {
		RNFail("Unable to allocate swap buffer");
                return;
	    }
	}
    }

    // Swap two buffers 
    RNCopy(node1, swap, size);
    RNCopy(node2, node1, size);
    RNCopy(swap, node2, size);

    // Free swap buffer 
    if (buffer == NULL) {
	if (size > RN_SWAP_BUFFER_SIZE) {
	    free(swap);
	}
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movl %ecx, %ebx
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r12
movq %rdx, %r15
testq %rdx, %rdx
jne 0x67fb6
cmpl $0x401, %ebx            # imm = 0x401
jl 0x67fb3
movl %ebx, %edi
callq 0xe600
movq %rax, %r15
testq %rax, %rax
jne 0x67fb6
leaq 0x32fed(%rip), %rdi     # 0x9af88
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x681ca
movq %rsp, %r15
testq %r13, %r13
setne %bpl
movslq %ebx, %r13
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xe380
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0xe380
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0xe380
cmpl $0x401, %ebx            # imm = 0x401
setl %al
orb %bpl, %al
jne 0x68000
movq %r15, %rdi
callq 0xe560
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNMem.cpp
// Function: gaps::RNStrdup(char const*)
char *RNStrdup(const char *str)
{
  // Copy a string (RNStrdup is not part of standard)
  size_t len = strlen(str) + 1;
  void *output = malloc(len);
  if (output == NULL) return NULL;
  return (char *) memcpy (output, str, len);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xe1e0
movq %rax, %r14
incq %r14
movq %r14, %rdi
callq 0xe600
testq %rax, %rax
je 0x68069
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe380
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNMem.cpp
// Function: gaps::RNStrncpy(char*, char const*, int)
char *RNStrncpy(char *dst, const char *src, int max_length)
{
  // Check arguments
  if (!dst) return NULL;
  if (!src) return NULL;
  if (max_length < 0) return NULL;

  // Copy characters
  int count = 0;
  char *dstp = dst;
  const char *srcp = src;
  while (count < max_length) {
    if (count++ >= max_length) break;
    if (!*srcp) { *dstp = '\0'; break; }
    *dstp++ = *srcp++;
  }

  // Return destination address
  return dst;
}

// Assembly:
movq %rdi, %rax
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dil
orb %cl, %dil
testl %edx, %edx
sets %cl
orb %dil, %cl
je 0x68091
xorl %eax, %eax
retq
movl %edx, %ecx
xorl %edx, %edx
cmpl %edx, %ecx
je 0x680af
movb (%rsi,%rdx), %dil
testb %dil, %dil
je 0x680ab
movb %dil, (%rax,%rdx)
incq %rdx
jmp 0x68095
movb $0x0, (%rax,%rdx)
retq