LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Vector.cpp
// Function: gaps::R2Vector::Normalize()
void R2Vector::
Normalize(void)
{
    RNLength length = Length();
    if (length == 0.0) return;
    v[0] /= length;
    v[1] /= length;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movsd (%rdi), %xmm0
movsd 0x8(%rdi), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x6939f
sqrtsd %xmm0, %xmm0
jmp 0x693a8
callq 0xe340
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x693b0
jnp 0x693c0
movupd (%rbx), %xmm1
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
divpd %xmm0, %xmm1
movupd %xmm1, (%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Vector.cpp
// Function: gaps::R2Vector::Rotate(double)
void R2Vector::
Rotate(RNAngle theta)
{
    // Rotate vector counterclockwise 
    RNScalar c = cos(theta);
    RNScalar s = sin(theta);
    RNCoord x = v[0], y = v[1];
    v[0] = c*x - s*y;
    v[1] = s*x + c*y;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
callq 0xe860
movaps %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0xe0f0
movupd (%rbx), %xmm1
movapd 0x38c0f(%rip), %xmm2    # 0xa2020
xorpd %xmm0, %xmm2
movapd %xmm1, %xmm3
unpckhpd %xmm1, %xmm3            # xmm3 = xmm3[1],xmm1[1]
movapd 0x10(%rsp), %xmm4
unpcklpd %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0]
mulpd %xmm3, %xmm2
unpcklpd %xmm0, %xmm4            # xmm4 = xmm4[0],xmm0[0]
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm4, %xmm1
addpd %xmm2, %xmm1
movupd %xmm1, (%rbx)
addq $0x20, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Vector.cpp
// Function: gaps::R2Vector::Project(gaps::R2Vector const&)
void R2Vector::
Project(const R2Vector& vector)
{
    // Project onto another vector    
    RNScalar dot = this->Dot(vector);
    RNLength length = vector.Length();
    if ((RNIsPositive(length)) && (length != 1.0)) 
	dot /= (length * length);
    *this = vector * dot;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movsd (%rsi), %xmm0
movsd 0x8(%rsi), %xmm1
movsd 0x8(%rdi), %xmm2
mulsd %xmm1, %xmm2
movsd (%rdi), %xmm4
mulsd %xmm0, %xmm4
addsd %xmm2, %xmm4
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x6948d
sqrtsd %xmm0, %xmm0
jmp 0x6949c
movapd %xmm4, (%rsp)
callq 0xe340
movapd (%rsp), %xmm4
leaq 0x7c6f5(%rip), %rax     # 0xe5b98
movsd (%rax), %xmm1
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
movapd %xmm4, %xmm3
divsd %xmm2, %xmm3
cmpltsd %xmm0, %xmm1
andpd %xmm1, %xmm3
andnpd %xmm4, %xmm1
cmpneqsd 0x38b6b(%rip), %xmm0    # 0xa2038
orpd %xmm3, %xmm1
andpd %xmm0, %xmm1
andnpd %xmm4, %xmm0
orpd %xmm1, %xmm0
movupd (%r14), %xmm1
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd %xmm1, %xmm0
movupd %xmm0, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Vector.cpp
// Function: gaps::R2Vector::operator*=(gaps::R3Matrix const&)
R2Vector& R2Vector::
operator*=(const R3Matrix& m)
{
    // Multiply vector by matrix 
    RNCoord x = v[0], y = v[1];
    v[0] = x*m[0][0] + y*m[1][0];
    v[1] = x*m[0][1] + y*m[1][1];
    return *this;
}

// Assembly:
movq %rdi, %rax
movsd (%rdi), %xmm0
movsd 0x8(%rdi), %xmm1
movsd 0x18(%rsi), %xmm2
mulsd %xmm1, %xmm2
movsd (%rsi), %xmm3
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, (%rdi)
mulsd 0x20(%rsi), %xmm1
mulsd 0x8(%rsi), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::R2Image(int, int, int)
R2Image::
R2Image(int width, int height, int ncomponents)
  : width(width), 
    height(height),
    ncomponents(ncomponents),
    rowsize(0),
    pixels(NULL)
{
  // Initialize pixels
  rowsize = ncomponents * width;
  if ((rowsize % 4) != 0) rowsize = (rowsize / 4 + 1) * 4;
  int nbytes = rowsize * height;
  if (nbytes > 0) {
    pixels = new unsigned char [nbytes];
    assert(pixels);
    unsigned char *p = pixels;
    while (--nbytes) *(p++) = 0;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
movl %ecx, 0x8(%rdi)
movl $0x0, 0xc(%rdi)
movq $0x0, 0x10(%rdi)
imull %esi, %ecx
testb $0x3, %cl
je 0x69a7e
leal 0x3(%rcx), %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
andl $-0x4, %eax
addl $0x4, %eax
movl %eax, %ecx
movl %ecx, 0xc(%r14)
imull %ecx, %ebx
testl %ebx, %ebx
jle 0x69aab
movl %ebx, %edi
callq 0xe030
movq %rax, 0x10(%r14)
decl %ebx
je 0x69aab
movl %ebx, %edx
movq %rax, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe260
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::R2Image(int, int, int, unsigned char*)
R2Image::
R2Image(int width, int height, int ncomponents, unsigned char *data)
  : width(width), 
    height(height),
    ncomponents(ncomponents),
    rowsize(0),
    pixels(NULL)
{
  // Copy pixels (first pixel is lower-left)
  rowsize = ncomponents * width;
  if ((rowsize % 4) != 0) rowsize = (rowsize / 4 + 1) * 4;
  int nbytes = rowsize * height;
  if (nbytes > 0) {
    pixels = new unsigned char [nbytes];
    assert(pixels);
    unsigned char *p = pixels;
    while (--nbytes) *(p++) = *(data++);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %r8, %rbx
movl %edx, %ebp
movq %rdi, %r14
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
movl %ecx, 0x8(%rdi)
movl $0x0, 0xc(%rdi)
movq $0x0, 0x10(%rdi)
imull %esi, %ecx
testb $0x3, %cl
je 0x69aef
leal 0x3(%rcx), %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
andl $-0x4, %eax
addl $0x4, %eax
movl %eax, %ecx
movl %ecx, 0xc(%r14)
imull %ecx, %ebp
testl %ebp, %ebp
jle 0x69b1a
movl %ebp, %edi
callq 0xe030
movq %rax, 0x10(%r14)
decl %ebp
je 0x69b1a
movl %ebp, %edx
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xe370
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::R2Image(gaps::R2Grid const&, gaps::R2Grid const&, gaps::R2Grid const&)
R2Image::
R2Image(const R2Grid& red, const R2Grid& green, const R2Grid& blue)
  : width(red.XResolution()), 
    height(red.YResolution()),
    ncomponents(3),
    rowsize(0),
    pixels(NULL)
{
  // Just checking
  assert(red.XResolution() == green.XResolution());
  assert(red.YResolution() == green.YResolution());
  assert(red.XResolution() == blue.XResolution());
  assert(red.YResolution() == blue.YResolution());

  // Copy pixels (first pixel is lower-left)
  rowsize = ncomponents * width;
  if ((rowsize % 4) != 0) rowsize = (rowsize / 4 + 1) * 4;
  int nbytes = rowsize * height;
  if (nbytes > 0) {
    pixels = new unsigned char [nbytes];
    assert(pixels);
    for (int i = 0; i < width*height; i++) {
      int r = 255.0 * red.GridValue(i);
      int g = 255.0 * green.GridValue(i);
      int b = 255.0 * blue.GridValue(i);
      r = (r < 0) ? 0 : ((r > 255) ? 255 : r);
      g = (g < 0) ? 0 : ((g > 255) ? 255 : g);
      b = (b < 0) ? 0 : ((b > 255) ? 255 : b);
      pixels[i*3+0] = r;
      pixels[i*3+1] = g;
      pixels[i*3+2] = b;
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl 0xc0(%rsi), %ecx
movl %ecx, (%rdi)
movl 0xc4(%rsi), %eax
movl %eax, 0x4(%rdi)
movq $0x3, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
leal (%rcx,%rcx,2), %ecx
testb $0x3, %cl
je 0x69b6d
leal 0x3(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
andl $-0x4, %edx
addl $0x4, %edx
movl %edx, %ecx
movl %ecx, 0xc(%r12)
imull %ecx, %eax
testl %eax, %eax
jle 0x69c54
movl %eax, %edi
callq 0xe030
movq %rax, 0x10(%r12)
movl 0x4(%r12), %eax
imull (%r12), %eax
testl %eax, %eax
jle 0x69c54
xorl %eax, %eax
movsd 0x38673(%rip), %xmm0    # 0xa2218
xorl %ecx, %ecx
movq 0xb8(%r15), %rdx
movsd (%rdx,%rcx,8), %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movl $0xff, %esi
cmpl %esi, %edx
jl 0x69bc9
movl $0xff, %edx
testl %edx, %edx
jg 0x69bcf
xorl %edx, %edx
movq 0xb8(%r14), %rdi
movsd (%rdi,%rcx,8), %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edi
cmpl %esi, %edi
jl 0x69bec
movl $0xff, %edi
testl %edi, %edi
jg 0x69bf2
xorl %edi, %edi
movq 0xb8(%rbx), %r8
movsd (%r8,%rcx,8), %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %r8d
cmpl %esi, %r8d
jl 0x69c13
movl $0xff, %r8d
testl %r8d, %r8d
jg 0x69c1b
xorl %r8d, %r8d
movq 0x10(%r12), %rsi
movb %dl, (%rsi,%rax)
movq 0x10(%r12), %rdx
movb %dil, 0x1(%rdx,%rax)
movq 0x10(%r12), %rdx
movb %r8b, 0x2(%rdx,%rax)
incq %rcx
movslq (%r12), %rdx
movslq 0x4(%r12), %rsi
imulq %rdx, %rsi
addq $0x3, %rax
cmpq %rsi, %rcx
jl 0x69ba7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::R2Image(gaps::R2Image const&)
R2Image::
R2Image(const R2Image& image)
  : width(image.width), 
    height(image.height),
    ncomponents(image.ncomponents),
    rowsize(image.rowsize),
    pixels(NULL)
{
  // Copy pixels
  int nbytes = rowsize * height;
  if (nbytes > 0) {
    pixels = new unsigned char [nbytes];
    assert(pixels);
    unsigned char *p = pixels;
    unsigned char *data = image.pixels;
    while (--nbytes) *(p++) = *(data++);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0xc(%rsi), %ebp
imull 0x4(%rsi), %ebp
movups (%rsi), %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
testl %ebp, %ebp
jle 0x69ca9
movq %rsi, %rbx
movq %rdi, %r14
movl %ebp, %edi
callq 0xe030
movq %rax, 0x10(%r14)
decl %ebp
je 0x69ca9
movq 0x10(%rbx), %rcx
movl %ebp, %edx
xorl %esi, %esi
movb (%rcx,%rsi), %dil
movb %dil, (%rax,%rsi)
incq %rsi
cmpl %esi, %edx
jne 0x69c9a
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::PixelRGB(int, int) const
const RNRgb R2Image::
PixelRGB(int x, int y) const
{
  // Return pixel RGB at (x,y)
  RNScalar r, g, b;
  const unsigned char *pixel = Pixel(x, y);
  switch (ncomponents) {
  case 1: 
  case 2:
    r = *(pixel++) / 255.0;
    g = b = r;
    break;

  case 3:
  case 4:
    r = *(pixel++) / 255.0;
    g = *(pixel++) / 255.0;
    b = *(pixel++) / 255.0;
    break;

  default:
    r = b = g = 0;
    break;
  }
  return RNRgb(r, g, b);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rsi), %rax
imull 0xc(%rsi), %ecx
movl 0x8(%rsi), %esi
imull %esi, %edx
addl %ecx, %edx
movslq %edx, %rcx
leal -0x3(%rsi), %edx
cmpl $0x2, %edx
jb 0x69cfc
decl %esi
cmpl $0x1, %esi
ja 0x69d2f
movzbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
divsd 0x38526(%rip), %xmm0    # 0xa2218
movapd %xmm0, %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
jmp 0x69d37
movzbl (%rax,%rcx), %edx
cvtsi2sd %edx, %xmm0
divsd 0x3850c(%rip), %xmm0    # 0xa2218
movzwl 0x1(%rax,%rcx), %eax
movd %eax, %xmm1
pxor %xmm2, %xmm2
punpcklbw %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
punpcklwd %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
cvtdq2pd %xmm1, %xmm1
divpd 0x3fdc3(%rip), %xmm1    # 0xa9af0
jmp 0x69d37
xorpd %xmm1, %xmm1
xorpd %xmm0, %xmm0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
movq %rbx, %rdi
callq 0x70460
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::operator=(gaps::R2Image const&)
R2Image& R2Image::
operator=(const R2Image& image)
{
  // Assign values
  this->width = image.width;
  this->height = image.height;
  this->ncomponents = image.ncomponents;
  this->rowsize = image.rowsize;
  
  // Delete previous pixels
  if (this->pixels) delete [] pixels;
  this->pixels = NULL;

  // Copy pixels
  int nbytes = this->rowsize * this->height;
  if (nbytes > 0) {
    this->pixels = new unsigned char [nbytes];
    assert(this->pixels);
    unsigned char *p =this-> pixels;
    unsigned char *data = image.pixels;
    while (--nbytes) *(p++) = *(data++);
  }

  // Return this
  return *this;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movups (%rsi), %xmm0
movups %xmm0, (%rdi)
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x69d6a
callq 0xe5b0
movq $0x0, 0x10(%rbx)
movl 0x4(%rbx), %ebp
imull 0xc(%rbx), %ebp
testl %ebp, %ebp
jle 0x69da3
movl %ebp, %edi
callq 0xe030
movq %rax, 0x10(%rbx)
decl %ebp
je 0x69da3
movq 0x10(%r14), %rcx
movl %ebp, %edx
xorl %esi, %esi
movb (%rcx,%rsi), %dil
movb %dil, (%rax,%rsi)
incq %rsi
cmpl %esi, %edx
jne 0x69d94
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::Add(gaps::R2Image const&)
void R2Image::
Add(const R2Image& image)
{
  int nbytes = rowsize * height;
  unsigned char *p1 = pixels;
  unsigned char *p2 = image.pixels;
  while (--nbytes) {
    int value = *p1;
    value += *(p2++);
    if (value > 255) value = 255;
    *(p1++) = value;
  }
}

// Assembly:
movslq 0xc(%rdi), %rcx
movslq 0x4(%rdi), %rax
imulq %rcx, %rax
cmpl $0x1, %eax
je 0x69fb2
movq 0x10(%rsi), %rcx
movq 0x10(%rdi), %rdx
decq %rax
xorl %esi, %esi
movl $0xff, %edi
movzbl (%rdx,%rsi), %r8d
movzbl (%rcx,%rsi), %r9d
addl %r8d, %r9d
cmpl %edi, %r9d
cmovael %edi, %r9d
movb %r9b, (%rdx,%rsi)
incq %rsi
cmpl %esi, %eax
jne 0x69f93
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::Subtract(gaps::R2Image const&)
void R2Image::
Subtract(const R2Image& image)
{
  int nbytes = rowsize * height;
  unsigned char *p1 = pixels;
  unsigned char *p2 = image.pixels;
  while (--nbytes) {
    int value = *p1 - *p2 + 128;
    if (value < 0) value = 0;
    if (value > 255) value = 255;
    *p1 = value;
    p1++;
    p2++;
  }
}

// Assembly:
movslq 0xc(%rdi), %rcx
movslq 0x4(%rdi), %rax
imulq %rcx, %rax
cmpl $0x1, %eax
je 0x6a009
movq 0x10(%rsi), %rcx
movq 0x10(%rdi), %rdx
decq %rax
xorl %esi, %esi
movl $0xffffff80, %edi       # imm = 0xFFFFFF80
movl $0x7f, %r8d
movzbl (%rdx,%rsi), %r9d
movzbl (%rcx,%rsi), %r10d
subl %r10d, %r9d
cmpl $-0x7f, %r9d
cmovll %edi, %r9d
cmpl $0x7f, %r9d
cmovgel %r8d, %r9d
addb $-0x80, %r9b
movb %r9b, (%rdx,%rsi)
incq %rsi
cmpl %esi, %eax
jne 0x69fdd
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::Capture()
void R2Image::
Capture(void)
{
  // Check image size
  GLint viewport[4];
  glGetIntegerv(GL_VIEWPORT, viewport);
  assert(width >= viewport[2]);
  assert(height >= viewport[3]);
  assert(pixels);

  // Set packing parameters for glReadPixels
  if ((ncomponents != 4) && ((width % 4) != 0)) glPixelStorei(GL_PACK_ALIGNMENT, 1);

  // Read pixels from frame buffer 
  switch (ncomponents) {
  case 1: glReadPixels(0, 0, width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE, pixels); break;
  case 2: glReadPixels(0, 0, width, height, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, pixels); break;
  case 3: glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels); break;
  case 4: glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels); break;
  }

  // Reset packing parameters for glReadPixels
  if ((ncomponents != 4) && ((width % 4) != 0)) glPixelStorei(GL_PACK_ALIGNMENT, 4);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %rsi
movl $0xba2, %edi            # imm = 0xBA2
callq 0xe400
cmpl $0x4, 0x8(%rbx)
je 0x6a501
testb $0x3, (%rbx)
je 0x6a501
movl $0xd05, %edi            # imm = 0xD05
movl $0x1, %esi
callq 0xe230
movl 0x8(%rbx), %eax
decl %eax
cmpl $0x3, %eax
ja 0x6a534
movl %eax, %eax
leaq 0x3f5ec(%rip), %rcx     # 0xa9b00
movl (%rcx,%rax,4), %r8d
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movq 0x10(%rbx), %rax
movq %rax, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
movl $0x1401, %r9d           # imm = 0x1401
callq 0xe200
cmpl $0x4, 0x8(%rbx)
je 0x6a54e
testb $0x3, (%rbx)
je 0x6a54e
movl $0xd05, %edi            # imm = 0xD05
movl $0x4, %esi
callq 0xe230
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::Draw(int, int) const
void R2Image::
Draw(int x, int y) const
{
  // Set projection matrix
  glMatrixMode(GL_PROJECTION);  
  glPushMatrix();
  glLoadIdentity();
  gluOrtho2D(0, width, 0, height);

  // Set model view matrix
  glMatrixMode(GL_MODELVIEW);
  glPushMatrix();
  glLoadIdentity();

  // Set position for image
  glRasterPos2i(x, y);

  // Draw pixels
  switch (ncomponents) {
  case 1: glDrawPixels(width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE, pixels); break;
  case 2: glDrawPixels(width, height, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, pixels); break;
  case 3: glDrawPixels(width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels); break;
  case 4: glDrawPixels(width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels); break;
  default: RNFail("Unrecognized number of components in image: %d\n", ncomponents); break;
  }

  // Reset projection matrix
  glMatrixMode(GL_PROJECTION);
  glPopMatrix();

  // Reset model view matrix
  glMatrixMode(GL_MODELVIEW);
  glPopMatrix();
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movl $0x1701, %edi           # imm = 0x1701
callq 0xe620
callq 0xe740
callq 0xe5c0
cvtsi2sdl (%rbx), %xmm1
cvtsi2sdl 0x4(%rbx), %xmm3
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
callq 0xe2b0
movl $0x1700, %edi           # imm = 0x1700
callq 0xe620
callq 0xe740
callq 0xe5c0
movl %r14d, %edi
movl %ebp, %esi
callq 0xe180
movl 0x8(%rbx), %esi
leal -0x1(%rsi), %eax
cmpl $0x3, %eax
ja 0x6a62b
leaq 0x3f4f4(%rip), %rcx     # 0xa9aac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl (%rbx), %edi
movl 0x4(%rbx), %esi
movq 0x10(%rbx), %r8
movl $0x1909, %edx           # imm = 0x1909
jmp 0x6a5ff
movl (%rbx), %edi
movl 0x4(%rbx), %esi
movq 0x10(%rbx), %r8
movl $0x1907, %edx           # imm = 0x1907
jmp 0x6a5ff
movl (%rbx), %edi
movl 0x4(%rbx), %esi
movq 0x10(%rbx), %r8
movl $0x1908, %edx           # imm = 0x1908
jmp 0x6a5ff
movl (%rbx), %edi
movl 0x4(%rbx), %esi
movq 0x10(%rbx), %r8
movl $0x190a, %edx           # imm = 0x190A
movl $0x1401, %ecx           # imm = 0x1401
callq 0xe350
movl $0x1701, %edi           # imm = 0x1701
callq 0xe620
callq 0xe850
movl $0x1700, %edi           # imm = 0x1700
callq 0xe620
popq %rbx
popq %r14
popq %rbp
jmp 0xe850
leaq 0x3f516(%rip), %rdi     # 0xa9b48
xorl %eax, %eax
callq 0x72a1e
jmp 0x6a609
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::ReadJPEGFile(char const*)
int R2Image::
ReadJPEGFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "rb");
  if (!fp) {
    RNFail("Unable to open JPEG file %s\n", filename);
    return 0;
   }

  // Read file
  if (!ReadJPEGStream(fp)) {
    fclose(fp);
    return 0;
  }

  // Close the file 
  fclose(fp);

  // Return success 
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x37f5e(%rip), %rsi     # 0xa25ae
movq %rbx, %rdi
callq 0xe530
testq %rax, %rax
je 0x6a67a
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x6c2b2
movq %r15, %rdi
callq 0xe430
movl $0x1, %ebp
jmp 0x6a68d
leaq 0x3f70a(%rip), %rdi     # 0xa9d8b
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x72a1e
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::WriteJPEGFile(char const*) const
int R2Image::
WriteJPEGFile(const char *filename) const
{
  // Open the file 
  FILE *fp = fopen(filename, "wb");
  if (fp == NULL) {
    RNFail("Unable to open JPEG file %s\n", filename);
    return 0;
  }
  
  // Write the file
  if (!WriteJPEGStream(fp)) {
    fclose(fp);
    return 0;
  }

  // Close the file 
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x36b7c(%rip), %rsi     # 0xa2a84
movq %rbx, %rdi
callq 0xe530
testq %rax, %rax
je 0x6bf32
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x6c3d0
movq %r15, %rdi
callq 0xe430
movl $0x1, %ebp
jmp 0x6bf45
leaq 0x3de52(%rip), %rdi     # 0xa9d8b
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x72a1e
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::DWordReadLE(_IO_FILE*)
static unsigned int DWordReadLE(FILE *fp)
{
  unsigned int b1 = getc(fp);
  unsigned int b2 = getc(fp);
  unsigned int b3 = getc(fp);
  unsigned int b4 = getc(fp);
  return (b4 << 24) | (b3 << 16) | (b2 << 8) | b1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xe170
movl %eax, %ebp
movq %rbx, %rdi
callq 0xe170
movl %eax, %r14d
movq %rbx, %rdi
callq 0xe170
movl %eax, %r15d
movq %rbx, %rdi
callq 0xe170
shll $0x18, %eax
shll $0x10, %r15d
orl %r15d, %eax
shll $0x8, %r14d
orl %ebp, %r14d
orl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::DWordWriteLE(unsigned int, _IO_FILE*)
static void DWordWriteLE(unsigned int x, FILE *fp)
{
  unsigned char b1 = (x & 0x000000FF); putc(b1, fp);
  unsigned char b2 = ((x >> 8) & 0x000000FF); putc(b2, fp);
  unsigned char b3 = ((x >> 16) & 0x000000FF); putc(b3, fp);
  unsigned char b4 = ((x >> 24) & 0x000000FF); putc(b4, fp);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movl $0xff, %r14d
andl %r14d, %edi
callq 0xe890
movl %ebp, %edi
shrl $0x8, %edi
andl %r14d, %edi
movq %rbx, %rsi
callq 0xe890
movl %ebp, %edi
shrl $0x10, %edi
andl %r14d, %edi
movq %rbx, %rsi
callq 0xe890
shrl $0x18, %ebp
movl %ebp, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xe890
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::LongWriteLE(int, _IO_FILE*)
static void LongWriteLE(int x, FILE *fp)
{
  char b1 = (x & 0x000000FF); putc(b1, fp);
  char b2 = ((x >> 8) & 0x000000FF); putc(b2, fp);
  char b3 = ((x >> 16) & 0x000000FF); putc(b3, fp);
  char b4 = ((x >> 24) & 0x000000FF); putc(b4, fp);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movsbl %bpl, %edi
callq 0xe890
movl %ebp, %eax
shrl $0x8, %eax
movsbl %al, %edi
movq %rbx, %rsi
callq 0xe890
movl %ebp, %eax
shrl $0x10, %eax
movsbl %al, %edi
movq %rbx, %rsi
callq 0xe890
sarl $0x18, %ebp
movl %ebp, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe890
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::ReadJPEGStream(_IO_FILE*)
int R2Image::
ReadJPEGStream(FILE *fp)
{
#ifdef RN_USE_JPEG
  // Initialize decompression info
  struct jpeg_decompress_struct cinfo;
  struct jpeg_error_mgr jerr;
  cinfo.err = jpeg_std_error(&jerr);
  jpeg_create_decompress(&cinfo);
  jpeg_stdio_src(&cinfo, fp);
  jpeg_read_header(&cinfo, TRUE);
  jpeg_start_decompress(&cinfo);

  // Remember image attributes
  width = cinfo.output_width;
  height = cinfo.output_height;
  ncomponents = cinfo.output_components;
  rowsize = ncomponents * width;
  if ((rowsize % 4) != 0) rowsize = (rowsize / 4 + 1) * 4;

  // Allocate image pixels
  int nbytes = rowsize * height;
  this->pixels = new unsigned char [nbytes];
  if (!this->pixels) {
    RNFail("Unable to allocate memory for JPEG file");
    fclose(fp);
    return 0;
  }

  // Read scan lines 
  // First jpeg pixel is top-left, so read pixels in opposite scan-line order
  while (cinfo.output_scanline < cinfo.output_height) {
    int scanline = cinfo.output_height - cinfo.output_scanline - 1;
    unsigned char *row_pointer = &pixels[scanline * rowsize];
    jpeg_read_scanlines(&cinfo, &row_pointer, 1);
  }

  // Free everything
  jpeg_finish_decompress(&cinfo);
  jpeg_destroy_decompress(&cinfo);

  // Return success
  return 1;
#else
  RNFail("JPEG not supported");
  return 0;
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x330, %rsp            # imm = 0x330
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x288(%rsp), %rdi
callq 0x86b2c
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movl $0x278, %edx            # imm = 0x278
movq %r15, %rdi
movl $0x3e, %esi
callq 0x7b66c
movq %r15, %rdi
movq %r14, %rsi
callq 0x7bf2c
movq %r15, %rdi
movl $0x1, %esi
callq 0x7b767
movq %r15, %rdi
callq 0x7bb00
movl 0x88(%r15), %edx
movl %edx, (%rbx)
movl 0x8c(%r15), %eax
movl %eax, 0x4(%rbx)
movl 0x94(%r15), %ecx
movl %ecx, 0x8(%rbx)
imull %edx, %ecx
testb $0x3, %cl
je 0x6c340
leal 0x3(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
andl $-0x4, %edx
addl $0x4, %edx
movl %edx, %ecx
movl %ecx, 0xc(%rbx)
imull %ecx, %eax
movslq %eax, %rdi
callq 0xe030
movq %rax, 0x10(%rbx)
movl 0x9c(%rsp), %eax
movl 0xb8(%rsp), %ecx
cmpl %eax, %ecx
jae 0x6c3a8
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
notl %ecx
addl %eax, %ecx
movslq 0xc(%rbx), %rax
movslq %ecx, %rcx
imulq %rax, %rcx
addq 0x10(%rbx), %rcx
movq %rcx, 0x8(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x7bce8
movl 0x9c(%rsp), %eax
movl 0xb8(%rsp), %ecx
cmpl %eax, %ecx
jb 0x6c36e
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x7ba5e
movq %rbx, %rdi
callq 0x7b75d
movl $0x1, %eax
addq $0x330, %rsp            # imm = 0x330
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::WriteJPEGStream(_IO_FILE*) const
int R2Image::
WriteJPEGStream(FILE *fp) const
{
#ifdef RN_USE_JPEG
  // Initialize compression info
  struct jpeg_compress_struct cinfo;
  struct jpeg_error_mgr jerr;
  cinfo.err = jpeg_std_error(&jerr);
  jpeg_create_compress(&cinfo);
  jpeg_stdio_dest(&cinfo, fp);
  cinfo.image_width = width; 	/* image width and height, in pixels */
  cinfo.image_height = height;
  cinfo.input_components = ncomponents;		/* # of color components per pixel */
  if (ncomponents == 1) cinfo.in_color_space = JCS_GRAYSCALE;
  else if (ncomponents == 3) cinfo.in_color_space = JCS_RGB;
  else if (ncomponents == 4) cinfo.in_color_space = JCS_CMYK;
  else cinfo.in_color_space = JCS_UNKNOWN;
  cinfo.dct_method = JDCT_ISLOW;
  jpeg_set_defaults(&cinfo);
  cinfo.optimize_coding = TRUE;
  jpeg_set_quality(&cinfo, 75, TRUE);
  jpeg_start_compress(&cinfo, TRUE);
	
  // Output scan lines
  // First jpeg pixel is top-left, so write in opposite scan-line order
  while (cinfo.next_scanline < cinfo.image_height) {
    int scanline = cinfo.image_height - cinfo.next_scanline - 1;
    unsigned char *row_pointer = &pixels[scanline * rowsize];
    jpeg_write_scanlines(&cinfo, &row_pointer, 1);
  }

  // Free everything
  jpeg_finish_compress(&cinfo);
  jpeg_destroy_compress(&cinfo);

  // Return number of bytes written
  return 1;
#else
  RNFail("JPEG not supported");
  return 0;
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x2c0, %rsp            # imm = 0x2C0
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x218(%rsp), %rdi
callq 0x86b2c
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movl $0x208, %edx            # imm = 0x208
movq %r15, %rdi
movl $0x3e, %esi
callq 0x72b98
movq %r15, %rdi
movq %r14, %rsi
callq 0x73bb8
movq (%rbx), %rax
movq %rax, 0x30(%r15)
movl 0x8(%rbx), %eax
movl %eax, 0x38(%r15)
decl %eax
xorl %ecx, %ecx
cmpl $0x3, %eax
ja 0x6c437
movl %eax, %eax
leaq 0x3d6dc(%rip), %rcx     # 0xa9b10
movl (%rcx,%rax,4), %ecx
leaq 0x10(%rsp), %r14
movl %ecx, 0x3c(%r14)
movl $0x0, 0x114(%r14)
movq %r14, %rdi
callq 0x732d2
movl $0x1, 0x108(%r14)
movq %r14, %rdi
movl $0x4b, %esi
movl $0x1, %edx
callq 0x73265
movq %r14, %rdi
movl $0x1, %esi
callq 0x72f04
movl 0x34(%r14), %eax
movl 0x130(%r14), %ecx
cmpl %eax, %ecx
jae 0x6c4cd
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
notl %ecx
addl %eax, %ecx
movslq 0xc(%rbx), %rax
movslq %ecx, %rcx
imulq %rax, %rcx
addq 0x10(%rbx), %rcx
movq %rcx, 0x8(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x72f81
movl 0x44(%rsp), %eax
movl 0x140(%rsp), %ecx
cmpl %eax, %ecx
jb 0x6c496
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x72cdd
movq %rbx, %rdi
callq 0x72c85
movl $0x1, %eax
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::ReadJPEGBuffer(char const*, unsigned long)
int R2Image::
ReadJPEGBuffer(const char *buffer, size_t buffer_length)
{
  // Open stream
  FILE *fp = fmemopen((void *) buffer, buffer_length, "r");
  if (!fp) {
    RNFail("Unable to open JPEG stream\n");
    return 0;
   }

  // Read file
  if (!ReadJPEGStream(fp)) {
    fclose(fp);
    return 0;
  }

  // Close the file 
  fclose(fp);

  // Return success 
  return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3f891(%rip), %rax     # 0xabd93
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0xe8a0
testq %rax, %rax
je 0x6c532
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6c2b2
movq %r14, %rdi
callq 0xe430
movl $0x1, %ebx
jmp 0x6c542
leaq 0x3d86f(%rip), %rdi     # 0xa9da8
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x72a1e
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::WriteJPEGBuffer(char**, unsigned long*) const
int R2Image::
WriteJPEGBuffer(char **buffer, size_t *buffer_length) const
{
  // Open the file 
  FILE *fp = open_memstream(buffer, buffer_length);
  if (fp == NULL) {
    RNFail("Unable to open JPEG stream\n");
    return 0;
  }
  
  // Write the file
  if (!WriteJPEGStream(fp)) {
    fclose(fp);
    return 0;
  }

  // Close the file 
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0xe490
testq %rax, %rax
je 0x6c580
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6c3d0
movq %r14, %rdi
callq 0xe430
movl $0x1, %ebx
jmp 0x6c590
leaq 0x3d821(%rip), %rdi     # 0xa9da8
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x72a1e
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Image.cpp
// Function: gaps::R2Image::ReadPNGBuffer(char const*, unsigned long)
int R2Image::
ReadPNGBuffer(const char *buffer, size_t buffer_length)
{
  // Open stream
  FILE *fp = fmemopen((void *) buffer, buffer_length, "r");
  if (!fp) {
    RNFail("Unable to open PNG stream\n");
    return 0;
   }

  // Read file
  if (!ReadPNGStream(fp)) {
    fclose(fp);
    return 0;
  }

  // Close the file 
  fclose(fp);

  // Return success 
  return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3f2b5(%rip), %rax     # 0xabd93
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0xe8a0
testq %rax, %rax
je 0x6cb0d
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6c59a
movl %eax, %ebx
movq %r14, %rdi
callq 0xe430
movl %ebx, %eax
jmp 0x6cb1d
leaq 0x3cc97(%rip), %rdi     # 0xa97ab
xorl %eax, %eax
callq 0x72a1e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Draw.cpp
// Function: gaps::R3Matrix::Load() const
void R3Matrix::
Load(void) const
{
    // Load matrix onto stack replacing top of stack
#if (RN_3D_GRFX == RN_OPENGL) 
    double t[4][4];
    t[0][0] = m[0][0]; t[0][1] = m[1][0]; t[0][2] = 0.0;     t[0][3] = 0.0;
    t[1][0] = m[0][1]; t[1][1] = m[1][1]; t[1][2] = 0.0;     t[1][3] = 0.0;
    t[2][0] = 0.0;     t[2][1] = 0.0;     t[2][2] = 1.0;     t[2][3] = 0.0;
    t[3][0] = m[0][2]; t[3][1] = m[1][2]; t[3][2] = 0.0;     t[3][3] = 1.0;
    glLoadMatrixd((const GLdouble *) t);
#else
    RNAbort("Not Implemented");
#endif
}

// Assembly:
subq $0x88, %rsp
movsd (%rdi), %xmm0
movq %rsp, %rax
movsd %xmm0, (%rax)
movsd 0x18(%rdi), %xmm0
movsd %xmm0, 0x8(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movsd 0x8(%rdi), %xmm1
movsd %xmm1, 0x20(%rax)
movsd 0x20(%rdi), %xmm1
movsd %xmm1, 0x28(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x40(%rax)
movsd 0x3547d(%rip), %xmm1    # 0xa2038
movaps %xmm1, 0x50(%rax)
movsd 0x10(%rdi), %xmm1
movsd %xmm1, 0x60(%rax)
movsd 0x28(%rdi), %xmm1
movsd %xmm1, 0x68(%rax)
movhps 0x3545e(%rip), %xmm0    # xmm0 = xmm0[0,1],mem[0,1]
movaps %xmm0, 0x70(%rax)
movq %rax, %rdi
callq 0xe4f0
addq $0x88, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Draw.cpp
// Function: gaps::R3Matrix::Draw() const
void R3Matrix::
Draw(void) const
{
    // Multiply top of stack by matrix
#if ((RN_3D_GRFX == RN_OPENGL) && (RN_MATH_PRECISION == RN_FLOAT_PRECISION))
    GLdouble t[4][4];
    t[0][0] = m[0][0]; t[0][1] = m[1][0]; t[0][2] = 0.0;     t[0][3] = 0.0;
    t[1][0] = m[0][1]; t[1][1] = m[1][1]; t[1][2] = 0.0;     t[1][3] = 0.0;
    t[2][0] = 0.0;     t[2][1] = 0.0;     t[2][2] = 1.0;     t[2][3] = 0.0;
    t[3][0] = m[0][2]; t[3][1] = m[1][2]; t[3][2] = 0.0;     t[3][3] = 1.0;
    glMultMatrixd((const GLdouble *) t);
#elif ((RN_3D_GRFX == RN_OPENGL) && (RN_MATH_PRECISION == RN_DOUBLE_PRECISION))
    GLdouble t[4][4];
    t[0][0] = m[0][0]; t[0][1] = m[1][0]; t[0][2] = 0.0;     t[0][3] = 0.0;
    t[1][0] = m[0][1]; t[1][1] = m[1][1]; t[1][2] = 0.0;     t[1][3] = 0.0;
    t[2][0] = 0.0;     t[2][1] = 0.0;     t[2][2] = 1.0;     t[2][3] = 0.0;
    t[3][0] = m[0][2]; t[3][1] = m[1][2]; t[3][2] = 0.0;     t[3][3] = 1.0;
    glMultMatrixd((const GLdouble *) t);
#else
    RNAbort("Not Implemented");
#endif
}

// Assembly:
subq $0x88, %rsp
movsd (%rdi), %xmm0
movq %rsp, %rax
movsd %xmm0, (%rax)
movsd 0x18(%rdi), %xmm0
movsd %xmm0, 0x8(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movsd 0x8(%rdi), %xmm1
movsd %xmm1, 0x20(%rax)
movsd 0x20(%rdi), %xmm1
movsd %xmm1, 0x28(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x40(%rax)
movsd 0x35403(%rip), %xmm1    # 0xa2038
movaps %xmm1, 0x50(%rax)
movsd 0x10(%rdi), %xmm1
movsd %xmm1, 0x60(%rax)
movsd 0x28(%rdi), %xmm1
movsd %xmm1, 0x68(%rax)
movhps 0x353e4(%rip), %xmm0    # xmm0 = xmm0[0,1],mem[0,1]
movaps %xmm0, 0x70(%rax)
movq %rax, %rdi
callq 0xe050
addq $0x88, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Draw.cpp
// Function: gaps::R2Affine::Push() const
void R2Affine::
Push(void) const
{
    // Push matrix onto stack
    Matrix().Push();

    // Set mirror flag
    if (IsMirrored()) {}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
callq 0xe740
movq %r14, %rdi
callq 0x6cbee
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x10(%rax)
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Draw.cpp
// Function: gaps::R2Vector::Draw() const
void R2Vector::
Draw(void) const
{
    // Draw vector from (0,0,0)
    R2BeginLine();
    R2LoadPoint(R2zero_point);
    R2LoadPoint((R2zero_point + *this));
    R2EndLine();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x3, %edi
callq 0xe110
leaq 0x47b577(%rip), %r14    # 0x4e8280
movq %r14, %rdi
callq 0xe590
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x69057
movq %r15, %rdi
callq 0xe590
callq 0xe5d0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Draw.cpp
// Function: gaps::R2Line::Draw() const
void R2Line::
Draw(void) const
{
    // Draw line
    R2BeginLine();
    R2LoadPoint(Point());
    R2LoadPoint(Point() + Vector());
    R2EndLine();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl $0x3, %edi
callq 0xe110
leaq 0x10(%rbx), %r14
movsd 0x20(%rbx), %xmm0
xorps 0x35298(%rip), %xmm0    # 0xa2020
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x694f6
leaq 0x47b4e3(%rip), %r12    # 0x4e8280
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x69057
movq %r13, %rdi
callq 0xe590
movsd 0x20(%rbx), %xmm0
xorps 0x3525c(%rip), %xmm0    # 0xa2020
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x694f6
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x69057
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x69057
movq %r15, %rdi
callq 0xe590
callq 0xe5d0
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Draw.cpp
// Function: gaps::R2Ray::Draw() const
void R2Ray::
Draw(void) const
{
    // Draw ray
    R2BeginLine();
    R2LoadPoint(Start());
    R2LoadPoint((Start() + Vector()));
    R2EndLine();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x3, %edi
callq 0xe110
leaq 0x28(%rbx), %r14
movq %r14, %rdi
callq 0xe590
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x69057
movq %r15, %rdi
callq 0xe590
callq 0xe5d0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Draw.cpp
// Function: gaps::R2Span::Draw() const
void R2Span::
Draw(void) const
{
    // Draw span
    R2BeginLine();
    R2LoadPoint(Start());
    R2LoadPoint(End());
    R2EndLine();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x3, %edi
callq 0xe110
leaq 0x28(%rbx), %rdi
callq 0xe590
addq $0x38, %rbx
movq %rbx, %rdi
callq 0xe590
popq %rbx
jmp 0xe5d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Draw.cpp
// Function: gaps::R2Arc::Draw(gaps::RNFlags) const
void R2Arc::
Draw(const R2DrawFlags draw_flags) const
{
    // Draw arc
    if (draw_flags[R2_EDGES_DRAW_FLAG]) {
	R2BeginLine();
	R2LoadPoint(StartPoint());
	int start_index = (int) (1 + R2circle_npoints * StartAngle() / RN_TWO_PI);
	int stop_index = (int) (R2circle_npoints * StopAngle() / RN_TWO_PI);
	for (int i = start_index; i <= stop_index; i++) 
	    R2LoadPoint(Center() + R2circle_points[i % R2circle_npoints] * Radius());
	R2LoadPoint(StopPoint());
	R2EndLine();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, (%rsp)
leaq 0x3d07b(%rip), %rax     # 0xa9f20
testq %rsi, (%rax)
je 0x6cf9d
movl $0x3, %edi
callq 0xe110
movq (%rsp), %rbx
movsd 0x28(%rbx), %xmm0
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6f936
movq %r14, %rdi
callq 0xe590
leaq 0x3d028(%rip), %rax     # 0xa9f08
movl (%rax), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd 0x28(%rbx), %xmm1
mulsd %xmm0, %xmm1
leaq 0x3d0cf(%rip), %rax     # 0xa9fc8
movsd (%rax), %xmm2
divsd %xmm2, %xmm1
addsd 0x3512f(%rip), %xmm1    # 0xa2038
cvttsd2si %xmm1, %ebp
mulsd 0x30(%rbx), %xmm0
divsd %xmm2, %xmm0
cvttsd2si %xmm0, %r13d
cmpl %r13d, %ebp
jg 0x6cf7a
movq (%rsp), %rax
leaq 0x10(%rax), %r14
incl %r13d
leaq 0x18(%rsp), %r15
leaq 0x8(%rsp), %r12
movl %ebp, %eax
cltd
idivl %ecx
movslq %edx, %rsi
shlq $0x4, %rsi
addq 0x78080(%rip), %rsi     # 0xe4fc8
movq (%rsp), %rax
movsd 0x20(%rax), %xmm0
movq %r15, %rdi
movl %ecx, %ebx
callq 0x690d5
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x69043
movq %r12, %rdi
callq 0xe590
movl %ebx, %ecx
incl %ebp
cmpl %ebp, %r13d
jne 0x6cf35
movq (%rsp), %rsi
movsd 0x30(%rsi), %xmm0
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x6f936
movq %r14, %rdi
callq 0xe590
callq 0xe5d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Draw.cpp
// Function: gaps::R2Polyline::Draw(gaps::RNFlags) const
void R2Polyline::
Draw(const R2DrawFlags draw_flags) const
{
    // Draw polyline
    R2BeginLine();
    for (int i = 0; i < npoints; i++) R2LoadPoint(points[i]);
    R2EndLine();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x3, %edi
callq 0xe110
cmpl $0x0, 0x10(%rbx)
jle 0x6cfe6
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
addq %r14, %rdi
callq 0xe590
incq %r15
movslq 0x10(%rbx), %rax
addq $0x10, %r14
cmpq %rax, %r15
jl 0x6cfca
popq %rbx
popq %r14
popq %r15
jmp 0xe5d0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Draw.cpp
// Function: gaps::R2Box::Draw(gaps::RNFlags) const
void R2Box::
Draw(const R2DrawFlags draw_flags) const
{
    // Draw surface
    if (draw_flags[R2_SURFACES_DRAW_FLAG]) {
        R2BeginPolygon();
        R2LoadPoint(Corner(RN_LO, RN_LO));
        R2LoadPoint(Corner(RN_HI, RN_LO));
        R2LoadPoint(Corner(RN_HI, RN_HI));
        R2LoadPoint(Corner(RN_LO, RN_HI));
	R2EndPolygon();
    }

    // Draw edges
    if (draw_flags[R2_EDGES_DRAW_FLAG]) {
	R2BeginLoop();
        R2LoadPoint(Corner(RN_LO, RN_LO));
        R2LoadPoint(Corner(RN_HI, RN_LO));
        R2LoadPoint(Corner(RN_HI, RN_HI));
        R2LoadPoint(Corner(RN_LO, RN_HI));
	R2EndLoop();
    }    
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x3cf22(%rip), %rax     # 0xa9f28
testq %rsi, (%rax)
je 0x6d092
movl $0x9, %edi
callq 0xe110
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x66320
movq %r15, %rdi
callq 0xe590
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x66320
movq %r15, %rdi
callq 0xe590
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x66320
movq %r15, %rdi
callq 0xe590
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x66320
movq %r15, %rdi
callq 0xe590
callq 0xe5d0
leaq 0x3ce87(%rip), %rax     # 0xa9f20
testq %r14, (%rax)
je 0x6d125
movl $0x2, %edi
callq 0xe110
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x66320
movq %r14, %rdi
callq 0xe590
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x66320
movq %r14, %rdi
callq 0xe590
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x66320
movq %r14, %rdi
callq 0xe590
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x66320
movq %r14, %rdi
callq 0xe590
callq 0xe5d0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Draw.cpp
// Function: gaps::R2Circle::Draw(gaps::RNFlags) const
void R2Circle::
Draw(const R2DrawFlags draw_flags) const
{
    // Draw surface
    if (draw_flags[R2_SURFACES_DRAW_FLAG]) {
	R2BeginPolygon();
	for (int i = 0; i < R2circle_npoints; i++) 
	    R2LoadPoint(center + R2circle_points[i] * radius);
	R2EndPolygon();
    }

    // Draw edges
    if (draw_flags[R2_EDGES_DRAW_FLAG]) {
	R2BeginLoop();
	for (int i = 0; i < R2circle_npoints; i++) 
	    R2LoadPoint(center + R2circle_points[i] * radius);
	R2EndLoop();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x3cde0(%rip), %rax     # 0xa9f28
testq %rsi, (%rax)
je 0x6d1b7
movq %rsi, (%rsp)
movl $0x9, %edi
callq 0xe110
leaq 0x3cda6(%rip), %rax     # 0xa9f08
movslq (%rax), %r14
testq %r14, %r14
jle 0x6d1ae
leaq 0x8(%rbx), %r15
leaq 0x47b37b(%rip), %r12    # 0x4e84f0
leaq 0x8(%rsp), %r13
leaq 0x18(%rsp), %rbp
movsd 0x18(%rbx), %xmm0
movq %r13, %rdi
movq %r12, %rsi
callq 0x690d5
movq %rbp, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x69043
movq %rbp, %rdi
callq 0xe590
addq $0x10, %r12
decq %r14
jne 0x6d17f
callq 0xe5d0
movq (%rsp), %rsi
leaq 0x3cd62(%rip), %rax     # 0xa9f20
testq %rsi, (%rax)
je 0x6d225
movl $0x2, %edi
callq 0xe110
leaq 0x3cd34(%rip), %rax     # 0xa9f08
movslq (%rax), %rbp
testq %rbp, %rbp
jle 0x6d220
leaq 0x8(%rbx), %r14
leaq 0x47b309(%rip), %r15    # 0x4e84f0
leaq 0x8(%rsp), %r12
leaq 0x18(%rsp), %r13
movsd 0x18(%rbx), %xmm0
movq %r12, %rdi
movq %r15, %rsi
callq 0x690d5
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x69043
movq %r13, %rdi
callq 0xe590
addq $0x10, %r15
decq %rbp
jne 0x6d1f1
callq 0xe5d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Draw.cpp
// Function: gaps::R2Polygon::Draw(gaps::RNFlags) const
void R2Polygon::
Draw(const R2DrawFlags draw_flags) const
{
    // Draw surface
    if (draw_flags[R2_SURFACES_DRAW_FLAG]) {
	R2BeginPolygon();
	for (int i = 0; i < npoints; i++) R2LoadPoint(points[i]);
	R2EndPolygon();
    }

    // Draw edges
    if (draw_flags[R2_EDGES_DRAW_FLAG]) {
	R2BeginLoop();
	for (int i = 0; i < npoints; i++) R2LoadPoint(points[i]);
	R2EndLoop();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x3ccdf(%rip), %rax     # 0xa9f28
testq %rsi, (%rax)
je 0x6d285
movl $0x9, %edi
callq 0xe110
cmpl $0x0, 0x10(%rbx)
jle 0x6d280
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%rbx), %rdi
addq %r15, %rdi
callq 0xe590
incq %r12
movslq 0x10(%rbx), %rax
addq $0x10, %r15
cmpq %rax, %r12
jl 0x6d264
callq 0xe5d0
leaq 0x3cc94(%rip), %rax     # 0xa9f20
testq %r14, (%rax)
je 0x6d2d3
movl $0x2, %edi
callq 0xe110
cmpl $0x0, 0x10(%rbx)
jle 0x6d2c3
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
addq %r14, %rdi
callq 0xe590
incq %r15
movslq 0x10(%rbx), %rax
addq $0x10, %r14
cmpq %rax, %r15
jl 0x6d2a7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xe5d0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Dist.cpp
// Function: gaps::R2Distance(gaps::R2Point const&, gaps::R2Ray const&)
RNLength R2Distance(const R2Point& point, const R2Ray& ray)
{
    // Check if start point is closest
    R2Vector v = point - ray.Start();
    RNScalar dir = v.Dot(ray.Vector());
    if (RNIsNegative(dir)) return v.Length();

    // Return distance from point to ray line
    return R2Distance(point, ray.Line());
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x28(%rsi), %rdx
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6906b
movq %r15, %rdi
movq %rbx, %rsi
callq 0x692f6
leaq 0x7882d(%rip), %rax     # 0xe5b98
movsd (%rax), %xmm1
xorpd 0x34ca9(%rip), %xmm1    # 0xa2020
ucomisd %xmm0, %xmm1
ja 0x6d3ad
movsd (%r14), %xmm1
movsd 0x8(%r14), %xmm0
mulsd 0x18(%rbx), %xmm0
mulsd 0x10(%rbx), %xmm1
addsd %xmm0, %xmm1
addsd 0x20(%rbx), %xmm1
movapd 0x34c7d(%rip), %xmm0    # 0xa2020
xorpd %xmm1, %xmm0
maxsd %xmm1, %xmm0
jmp 0x6d3b5
movq %rsp, %rdi
callq 0x691fe
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq