LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %rsi
movl $0xba2, %edi            # imm = 0xBA2
callq 0xf480
movq 0x18(%rsp), %rax
cmpl $0x4, 0x8(%rax)
je 0xc6470
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0xc6470
movl $0xd05, %edi            # imm = 0xD05
movl $0x1, %esi
callq 0xf250
movq 0x18(%rsp), %rax
movl 0x8(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, 0x10(%rsp)
subl $0x3, %eax
ja 0xc6541
movq 0x10(%rsp), %rax
leaq 0x6fee2(%rip), %rcx     # 0x136378
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rsp), %rax
movl (%rax), %edx
movl 0x4(%rax), %ecx
movq 0x10(%rax), %rax
xorl %esi, %esi
movl $0x1909, %r8d           # imm = 0x1909
movl $0x1401, %r9d           # imm = 0x1401
movl %esi, %edi
movq %rax, (%rsp)
callq 0xf220
jmp 0xc6541
movq 0x18(%rsp), %rax
movl (%rax), %edx
movl 0x4(%rax), %ecx
movq 0x10(%rax), %rax
xorl %esi, %esi
movl $0x190a, %r8d           # imm = 0x190A
movl $0x1401, %r9d           # imm = 0x1401
movl %esi, %edi
movq %rax, (%rsp)
callq 0xf220
jmp 0xc6541
movq 0x18(%rsp), %rax
movl (%rax), %edx
movl 0x4(%rax), %ecx
movq 0x10(%rax), %rax
xorl %esi, %esi
movl $0x1907, %r8d           # imm = 0x1907
movl $0x1401, %r9d           # imm = 0x1401
movl %esi, %edi
movq %rax, (%rsp)
callq 0xf220
jmp 0xc6541
movq 0x18(%rsp), %rax
movl (%rax), %edx
movl 0x4(%rax), %ecx
movq 0x10(%rax), %rax
xorl %esi, %esi
movl $0x1908, %r8d           # imm = 0x1908
movl $0x1401, %r9d           # imm = 0x1401
movl %esi, %edi
movq %rax, (%rsp)
callq 0xf220
movq 0x18(%rsp), %rax
cmpl $0x4, 0x8(%rax)
je 0xc656f
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0xc656f
movl $0xd05, %edi            # imm = 0xD05
movl $0x4, %esi
callq 0xf250
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x1701, %edi           # imm = 0x1701
callq 0xf6e0
callq 0xf7f0
callq 0xf680
movq 0x8(%rsp), %rax
cvtsi2sdl (%rax), %xmm1
cvtsi2sdl 0x4(%rax), %xmm3
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
callq 0xf2e0
movl $0x1700, %edi           # imm = 0x1700
callq 0xf6e0
callq 0xf7f0
callq 0xf680
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %esi
callq 0xf190
movq 0x8(%rsp), %rax
movl 0x8(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, 0x10(%rsp)
subl $0x3, %eax
ja 0xc6694
movq 0x10(%rsp), %rax
leaq 0x6fd79(%rip), %rcx     # 0x136388
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rsp), %rax
movl (%rax), %edi
movl 0x4(%rax), %esi
movq 0x10(%rax), %r8
movl $0x1909, %edx           # imm = 0x1909
movl $0x1401, %ecx           # imm = 0x1401
callq 0xf3b0
jmp 0xc66aa
movq 0x8(%rsp), %rax
movl (%rax), %edi
movl 0x4(%rax), %esi
movq 0x10(%rax), %r8
movl $0x190a, %edx           # imm = 0x190A
movl $0x1401, %ecx           # imm = 0x1401
callq 0xf3b0
jmp 0xc66aa
movq 0x8(%rsp), %rax
movl (%rax), %edi
movl 0x4(%rax), %esi
movq 0x10(%rax), %r8
movl $0x1907, %edx           # imm = 0x1907
movl $0x1401, %ecx           # imm = 0x1401
callq 0xf3b0
jmp 0xc66aa
movq 0x8(%rsp), %rax
movl (%rax), %edi
movl 0x4(%rax), %esi
movq 0x10(%rax), %r8
movl $0x1908, %edx           # imm = 0x1908
movl $0x1401, %ecx           # imm = 0x1401
callq 0xf3b0
jmp 0xc66aa
movq 0x8(%rsp), %rax
movl 0x8(%rax), %esi
leaq 0x6fd19(%rip), %rdi     # 0x1363bc
movb $0x0, %al
callq 0xd4f30
movl $0x1701, %edi           # imm = 0x1701
callq 0xf6e0
callq 0xf920
movl $0x1700, %edi           # imm = 0x1700
callq 0xf6e0
callq 0xf920
addq $0x28, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
leaq 0x6cd26(%rip), %rsi     # 0x1335d9
callq 0xf5e0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0xc68e2
movq 0x10(%rsp), %rsi
leaq 0x6fdda(%rip), %rdi     # 0x1366ab
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x24(%rsp)
jmp 0xc691b
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0xc9d90
cmpl $0x0, %eax
jne 0xc6909
movq 0x8(%rsp), %rdi
callq 0xf4b0
movl $0x0, 0x24(%rsp)
jmp 0xc691b
movq 0x8(%rsp), %rdi
callq 0xf4b0
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
leaq 0x6a3c7(%rip), %rsi     # 0x133aba
callq 0xf5e0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0xc9722
movq 0x10(%rsp), %rsi
leaq 0x6cf9a(%rip), %rdi     # 0x1366ab
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x24(%rsp)
jmp 0xc975b
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0xc9f60
cmpl $0x0, %eax
jne 0xc9749
movq 0x8(%rsp), %rdi
callq 0xf4b0
movl $0x0, 0x24(%rsp)
jmp 0xc975b
movq 0x8(%rsp), %rdi
callq 0xf4b0
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0xf180
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rdi
callq 0xf180
movl %eax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0xf180
movl %eax, 0x4(%rsp)
movq 0x10(%rsp), %rdi
callq 0xf180
movl %eax, (%rsp)
movl (%rsp), %eax
shll $0x18, %eax
movl 0x4(%rsp), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movl 0x8(%rsp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
orl 0xc(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movq %rsi, 0x8(%rsp)
movl 0x14(%rsp), %eax
andl $0xff, %eax
movb %al, 0x7(%rsp)
movzbl 0x7(%rsp), %edi
movq 0x8(%rsp), %rsi
callq 0xf960
movl 0x14(%rsp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, 0x6(%rsp)
movzbl 0x6(%rsp), %edi
movq 0x8(%rsp), %rsi
callq 0xf960
movl 0x14(%rsp), %eax
shrl $0x10, %eax
andl $0xff, %eax
movb %al, 0x5(%rsp)
movzbl 0x5(%rsp), %edi
movq 0x8(%rsp), %rsi
callq 0xf960
movl 0x14(%rsp), %eax
shrl $0x18, %eax
andl $0xff, %eax
movb %al, 0x4(%rsp)
movzbl 0x4(%rsp), %edi
movq 0x8(%rsp), %rsi
callq 0xf960
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movq %rsi, 0x8(%rsp)
movl 0x14(%rsp), %eax
andl $0xff, %eax
movb %al, 0x7(%rsp)
movsbl 0x7(%rsp), %edi
movq 0x8(%rsp), %rsi
callq 0xf960
movl 0x14(%rsp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, 0x6(%rsp)
movsbl 0x6(%rsp), %edi
movq 0x8(%rsp), %rsi
callq 0xf960
movl 0x14(%rsp), %eax
sarl $0x10, %eax
andl $0xff, %eax
movb %al, 0x5(%rsp)
movsbl 0x5(%rsp), %edi
movq 0x8(%rsp), %rsi
callq 0xf960
movl 0x14(%rsp), %eax
sarl $0x18, %eax
andl $0xff, %eax
movb %al, 0x4(%rsp)
movsbl 0x4(%rsp), %edi
movq 0x8(%rsp), %rsi
callq 0xf960
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x2d8, %rsp            # imm = 0x2D8
movq %rdi, 0x2d0(%rsp)
movq %rsi, 0x2c8(%rsp)
movq 0x2d0(%rsp), %rax
movq %rax, (%rsp)
leaq 0x18(%rsp), %rdi
callq 0xf94a0
movq %rax, 0xc0(%rsp)
leaq 0xc0(%rsp), %rdi
movl $0x3e, %esi
movl $0x208, %edx            # imm = 0x208
callq 0xd5100
movq 0x2c8(%rsp), %rsi
leaq 0xc0(%rsp), %rdi
callq 0xd7010
movq (%rsp), %rax
movl (%rax), %ecx
movl %ecx, 0xf0(%rsp)
movl 0x4(%rax), %ecx
movl %ecx, 0xf4(%rsp)
movl 0x8(%rax), %ecx
movl %ecx, 0xf8(%rsp)
cmpl $0x1, 0x8(%rax)
jne 0xc9ff5
movl $0x1, 0xfc(%rsp)
jmp 0xca032
movq (%rsp), %rax
cmpl $0x3, 0x8(%rax)
jne 0xca00c
movl $0x2, 0xfc(%rsp)
jmp 0xca030
movq (%rsp), %rax
cmpl $0x4, 0x8(%rax)
jne 0xca023
movl $0x4, 0xfc(%rsp)
jmp 0xca02e
movl $0x0, 0xfc(%rsp)
jmp 0xca030
jmp 0xca032
movl $0x0, 0x1d4(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xd5ec0
movl $0x1, 0x1c8(%rsp)
leaq 0xc0(%rsp), %rdi
movl $0x4b, %esi
movl $0x1, %edx
callq 0xd5e80
leaq 0xc0(%rsp), %rdi
movl $0x1, %esi
callq 0xd5830
movl 0x1f0(%rsp), %eax
cmpl 0xf4(%rsp), %eax
jae 0xca0d7
movq (%rsp), %rdx
movl 0xf4(%rsp), %eax
subl 0x1f0(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x14(%rsp)
movq 0x10(%rdx), %rax
movl 0x14(%rsp), %ecx
imull 0xc(%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x1, %edx
callq 0xd5910
jmp 0xca07e
leaq 0xc0(%rsp), %rdi
callq 0xd53d0
leaq 0xc0(%rsp), %rdi
callq 0xd52e0
movl $0x1, %eax
addq $0x2d8, %rsp            # imm = 0x2D8
retq
nop
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0x6e545(%rip), %rdx     # 0x138673
callq 0xf970
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0xca158
leaq 0x6c581(%rip), %rdi     # 0x1366c8
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x34(%rsp)
jmp 0xca192
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xc9d90
cmpl $0x0, %eax
jne 0xca180
movq 0x10(%rsp), %rdi
callq 0xf4b0
movl $0x0, 0x34(%rsp)
jmp 0xca192
movq 0x10(%rsp), %rdi
callq 0xf4b0
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xf520
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0xca1f1
leaq 0x6c4e8(%rip), %rdi     # 0x1366c8
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x34(%rsp)
jmp 0xca22b
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xc9f60
cmpl $0x0, %eax
jne 0xca219
movq 0x10(%rsp), %rdi
callq 0xf4b0
movl $0x0, 0x34(%rsp)
jmp 0xca22b
movq 0x10(%rsp), %rdi
callq 0xf4b0
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0x6df15(%rip), %rdx     # 0x138673
callq 0xf970
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0xca788
leaq 0x6b9ab(%rip), %rdi     # 0x136122
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x34(%rsp)
jmp 0xca7c2
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xca240
cmpl $0x0, %eax
jne 0xca7b0
movq 0x10(%rsp), %rdi
callq 0xf4b0
movl $0x0, 0x34(%rsp)
jmp 0xca7c2
movq 0x10(%rsp), %rdi
callq 0xf4b0
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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
movq %rdi, 0x80(%rsp)
movq 0x80(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x38(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x40(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x68699(%rip), %xmm0    # 0x133008
movsd %xmm0, 0x50(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x28(%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x70(%rsp)
movsd 0x68663(%rip), %xmm0    # 0x133008
movsd %xmm0, 0x78(%rsp)
movq %rsp, %rdi
callq 0xf5b0
addq $0x88, %rsp
retq
nopl (%rax,%rax)
// File: 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
movq %rdi, 0x80(%rsp)
movq 0x80(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x38(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x40(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x685c9(%rip), %xmm0    # 0x133008
movsd %xmm0, 0x50(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x28(%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x70(%rsp)
movsd 0x68593(%rip), %xmm0    # 0x133008
movsd %xmm0, 0x78(%rsp)
movq %rsp, %rdi
callq 0xf050
addq $0x88, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
callq 0xcb3d0
leaq 0x4b0229(%rip), %rdi    # 0x57ae18
callq 0xcb3e0
movq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %rdi
leaq 0x4b0213(%rip), %rsi    # 0x57ae18
callq 0xc37a0
leaq 0x10(%rsp), %rdi
callq 0xcb3e0
callq 0xcb400
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Draw.cpp
// Function: gaps::R2Point::Draw() const
void R2Point::
Draw(void) const
{
    // Draw point
    R2BeginLine();
    R2LoadPoint(v);
    R2LoadPoint(v);
    R2EndLine();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
callq 0xcb3d0
movq 0x8(%rsp), %rdi
callq 0xcb410
movq 0x8(%rsp), %rdi
callq 0xcb410
callq 0xcb400
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
callq 0xcb3d0
movq 0x8(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0xa3630
leaq 0x30(%rsp), %rdi
callq 0xcb3e0
movq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0xa3630
movq 0x8(%rsp), %rdi
callq 0xa3540
movq %rax, %rdx
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xc37a0
leaq 0x20(%rsp), %rdi
callq 0xcb3e0
callq 0xcb400
addq $0x48, %rsp
retq
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
callq 0xcb3d0
movq (%rsp), %rdi
callq 0xa3560
movq %rax, %rdi
callq 0xcb3e0
movq (%rsp), %rdi
callq 0xa3560
movq (%rsp), %rdi
movq %rax, 0x8(%rsp)
callq 0xa35c0
movq 0x8(%rsp), %rsi
movq %rax, %rdx
leaq 0x10(%rsp), %rdi
callq 0xc37a0
leaq 0x10(%rsp), %rdi
callq 0xcb3e0
callq 0xcb400
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
callq 0xcb3d0
movq 0x8(%rsp), %rdi
callq 0xa3500
movq %rax, %rdi
callq 0xcb3e0
movq 0x8(%rsp), %rdi
callq 0xa3510
movq %rax, %rdi
callq 0xcb3e0
callq 0xcb400
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x98, %rsp
movq %rsi, 0x90(%rsp)
movq %rdi, 0x88(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x4b0525(%rip), %rax    # 0x57b300
movq (%rax), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rsi
leaq 0x90(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0xcaf4b
callq 0xcb3d0
movq 0x28(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0xcb420
leaq 0x70(%rsp), %rdi
callq 0xcb3e0
movq 0x28(%rsp), %rdi
leaq 0x6ba4a(%rip), %rax     # 0x136878
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
callq 0xcb450
movsd 0x18(%rsp), %xmm1
movq 0x28(%rsp), %rdi
mulsd %xmm0, %xmm1
leaq 0x6baa5(%rip), %rax     # 0x1368f8
divsd (%rax), %xmm1
movsd 0x681a9(%rip), %xmm0    # 0x133008
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x6c(%rsp)
leaq 0x6ba06(%rip), %rax     # 0x136878
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
callq 0xcb460
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
mulsd %xmm1, %xmm0
leaq 0x6ba63(%rip), %rax     # 0x1368f8
divsd (%rax), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x68(%rsp)
movl 0x6c(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
cmpl 0x68(%rsp), %eax
jg 0xcaf2d
movq 0x28(%rsp), %rdi
callq 0xcb470
movq 0x28(%rsp), %rdi
movq %rax, 0x10(%rsp)
movl 0x64(%rsp), %eax
leaq 0x6b9a6(%rip), %rcx     # 0x136878
cltd
idivl (%rcx)
movslq %edx, %rcx
leaq 0x4b0221(%rip), %rax    # 0x57b100
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
callq 0xcb490
movq 0x8(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0xc3a60
movq 0x10(%rsp), %rsi
leaq 0x50(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0xc3750
leaq 0x50(%rsp), %rdi
callq 0xcb3e0
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0xcaea9
movq 0x28(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0xcb4b0
leaq 0x30(%rsp), %rdi
callq 0xcb3e0
callq 0xcb400
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rsi, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
callq 0xcb3d0
movl $0x0, 0x14(%rsp)
movq 0x8(%rsp), %rcx
movl 0x14(%rsp), %eax
cmpl 0x10(%rcx), %eax
jge 0xcafba
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movslq 0x14(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0xcb3e0
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0xcaf85
callq 0xcb400
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0xa8, %rsp
movq %rsi, 0xa0(%rsp)
movq %rdi, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq %rax, (%rsp)
leaq 0x4b030e(%rip), %rax    # 0x57b308
movq (%rax), %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0xcb0ac
callq 0xcb4e0
movq (%rsp), %rsi
leaq 0x80(%rsp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xbda70
leaq 0x80(%rsp), %rdi
callq 0xcb3e0
movq (%rsp), %rsi
leaq 0x70(%rsp), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xbda70
leaq 0x70(%rsp), %rdi
callq 0xcb3e0
movq (%rsp), %rsi
leaq 0x60(%rsp), %rdi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xbda70
leaq 0x60(%rsp), %rdi
callq 0xcb3e0
movq (%rsp), %rsi
leaq 0x50(%rsp), %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0xbda70
leaq 0x50(%rsp), %rdi
callq 0xcb3e0
callq 0xcb4f0
leaq 0x4b024d(%rip), %rax    # 0x57b300
movq (%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0xcb159
callq 0xcb500
movq (%rsp), %rsi
leaq 0x38(%rsp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xbda70
leaq 0x38(%rsp), %rdi
callq 0xcb3e0
movq (%rsp), %rsi
leaq 0x28(%rsp), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xbda70
leaq 0x28(%rsp), %rdi
callq 0xcb3e0
movq (%rsp), %rsi
leaq 0x18(%rsp), %rdi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xbda70
leaq 0x18(%rsp), %rdi
callq 0xcb3e0
movq (%rsp), %rsi
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0xbda70
leaq 0x8(%rsp), %rdi
callq 0xcb3e0
callq 0xcb510
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x88, %rsp
movq %rsi, 0x80(%rsp)
movq %rdi, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x4b0173(%rip), %rax    # 0x57b308
movq (%rax), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rsi
leaq 0x80(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0xcb233
callq 0xcb4e0
movl $0x0, 0x6c(%rsp)
movl 0x6c(%rsp), %eax
leaq 0x6b6ac(%rip), %rcx     # 0x136878
cmpl (%rcx), %eax
jge 0xcb22e
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x8(%rsp)
movslq 0x6c(%rsp), %rcx
leaq 0x4aff13(%rip), %rsi    # 0x57b100
shlq $0x4, %rcx
addq %rcx, %rsi
movsd 0x18(%rax), %xmm0
leaq 0x48(%rsp), %rdi
callq 0xc3a60
movq 0x8(%rsp), %rsi
leaq 0x58(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xc3750
leaq 0x58(%rsp), %rdi
callq 0xcb3e0
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0xcb1c1
callq 0xcb4f0
leaq 0x4b00c6(%rip), %rax    # 0x57b300
movq (%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rsi
leaq 0x80(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0xcb2d6
callq 0xcb500
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
leaq 0x6b607(%rip), %rcx     # 0x136878
cmpl (%rcx), %eax
jge 0xcb2d1
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, (%rsp)
movslq 0x3c(%rsp), %rcx
leaq 0x4afe6f(%rip), %rsi    # 0x57b100
shlq $0x4, %rcx
addq %rcx, %rsi
movsd 0x18(%rax), %xmm0
leaq 0x18(%rsp), %rdi
callq 0xc3a60
movq (%rsp), %rsi
leaq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xc3750
leaq 0x28(%rsp), %rdi
callq 0xcb3e0
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0xcb266
callq 0xcb510
addq $0x88, %rsp
retq
nop
// File: 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:
subq $0x38, %rsp
movq %rsi, 0x30(%rsp)
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
leaq 0x4b000a(%rip), %rax    # 0x57b308
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0xcb35f
callq 0xcb4e0
movl $0x0, 0x1c(%rsp)
movq (%rsp), %rcx
movl 0x1c(%rsp), %eax
cmpl 0x10(%rcx), %eax
jge 0xcb35a
movq (%rsp), %rax
movq 0x8(%rax), %rdi
movslq 0x1c(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0xcb3e0
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xcb327
callq 0xcb4f0
leaq 0x4aff9a(%rip), %rax    # 0x57b300
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0xcb3c7
callq 0xcb500
movl $0x0, 0xc(%rsp)
movq (%rsp), %rcx
movl 0xc(%rsp), %eax
cmpl 0x10(%rcx), %eax
jge 0xcb3c2
movq (%rsp), %rax
movq 0x8(%rax), %rdi
movslq 0xc(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0xcb3e0
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xcb38f
callq 0xcb510
addq $0x38, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rdi
callq 0xa3560
movq 0x10(%rsp), %rsi
movq %rax, %rdx
leaq 0x20(%rsp), %rdi
callq 0xc3830
movq 0x30(%rsp), %rdi
callq 0xa35c0
movq %rax, %rsi
leaq 0x20(%rsp), %rdi
callq 0xc3f40
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
leaq 0xace22(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm1
callq 0x38fd0
cmpl $0x0, %eax
je 0xcb6de
leaq 0x20(%rsp), %rdi
callq 0xc3d60
movsd %xmm0, 0x40(%rsp)
jmp 0xcb705
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
callq 0xa35d0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xcb580
movsd %xmm0, 0x40(%rsp)
movsd 0x40(%rsp), %xmm0
addq $0x48, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Dist.cpp
// Function: gaps::R2Distance(gaps::R2Point const&, gaps::R2Span const&)
RNLength R2Distance(const R2Point& point, const R2Span& span)
{
    // Check span
    if (RNIsZero(span.Length())) return R2Distance(point, span.Start());

    // Check if start point is closest
    R2Vector v1 = point - span.Start();
    RNScalar dir1 = v1.Dot(span.Vector());
    if (RNIsNegative(dir1)) return v1.Length();

    // Check if end point is closest
    R2Vector v2 = point - span.End();
    RNScalar dir2 = v2.Dot(span.Vector());
    if (RNIsPositive(dir2)) return v2.Length();

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

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq 0x50(%rsp), %rdi
callq 0xa5bd0
leaq 0xacdb1(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm1
callq 0x36b80
cmpl $0x0, %eax
je 0xcb769
movq 0x58(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rdi
callq 0xa3500
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0xcb540
movsd %xmm0, 0x60(%rsp)
jmp 0xcb871
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rdi
callq 0xa3500
movq 0x10(%rsp), %rsi
movq %rax, %rdx
leaq 0x40(%rsp), %rdi
callq 0xc3830
movq 0x50(%rsp), %rdi
callq 0xa61d0
movq %rax, %rsi
leaq 0x40(%rsp), %rdi
callq 0xc3f40
movsd %xmm0, 0x38(%rsp)
movsd 0x38(%rsp), %xmm0
leaq 0xacd27(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm1
callq 0x38fd0
cmpl $0x0, %eax
je 0xcb7dc
leaq 0x40(%rsp), %rdi
callq 0xc3d60
movsd %xmm0, 0x60(%rsp)
jmp 0xcb871
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rdi
callq 0xa3510
movq 0x8(%rsp), %rsi
movq %rax, %rdx
leaq 0x28(%rsp), %rdi
callq 0xc3830
movq 0x50(%rsp), %rdi
callq 0xa61d0
movq %rax, %rsi
leaq 0x28(%rsp), %rdi
callq 0xc3f40
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
leaq 0xaccb4(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm1
callq 0x36d50
cmpl $0x0, %eax
je 0xcb84c
leaq 0x28(%rsp), %rdi
callq 0xc3d60
movsd %xmm0, 0x60(%rsp)
jmp 0xcb871
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
movq 0x50(%rsp), %rdi
callq 0xa3610
movq (%rsp), %rdi
movq %rax, %rsi
callq 0xcb580
movsd %xmm0, 0x60(%rsp)
movsd 0x60(%rsp), %xmm0
addq $0x68, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Dist.cpp
// Function: gaps::R2Distance(gaps::R2Point const&, gaps::R2Polyline const&)
RNLength R2Distance(const R2Point& point, const R2Polyline& polyline)
{
    // Compute distance to each segment
    // This could be a lot faster
    RNLength closest_distance = FLT_MAX;
    for (int i = 1; i < polyline.NPoints(); i++) {
        const R2Point& p0 = polyline.Point(i-1);
        const R2Point& p1 = polyline.Point(i);
        R2Span span(p0, p1);
        RNLength d = R2Distance(span, point);
        if (d < closest_distance) closest_distance = d;
    }

    // Return distance
    return closest_distance;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movsd 0x67431(%rip), %xmm0    # 0x133020
movsd %xmm0, 0x80(%rsp)
movl $0x1, 0x7c(%rsp)
movl 0x7c(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x88(%rsp), %rdi
callq 0xcd130
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0xcbcb4
movq 0x88(%rsp), %rdi
movl 0x7c(%rsp), %esi
subl $0x1, %esi
callq 0xcd140
movq %rax, 0x70(%rsp)
movq 0x88(%rsp), %rdi
movl 0x7c(%rsp), %esi
callq 0xcd140
movq %rax, 0x68(%rsp)
movq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rdx
leaq 0x18(%rsp), %rdi
callq 0xc1470
movq 0x90(%rsp), %rsi
leaq 0x18(%rsp), %rdi
callq 0xa35e0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm1
movsd 0x80(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xcbca2
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
jmp 0xcbca4
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rsp)
jmp 0xcbc00
movsd 0x80(%rsp), %xmm0
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Dist.cpp
// Function: gaps::R2Distance(gaps::R2Point const&, gaps::R2Polygon const&)
RNLength R2Distance(const R2Point& point, const R2Polygon& polygon)
{
    // Check if polygon contains point
    if (R2Contains(polygon, point)) return 0;
  
    // Compute distance to each segment
    // This could be a lot faster
    RNLength closest_distance = FLT_MAX;
    for (int i = 0; i < polygon.NPoints(); i++) {
        const R2Point& p0 = polygon.Point(i);
        const R2Point& p1 = polygon.Point((i+1)%polygon.NPoints());
        R2Span span(p0, p1);
        RNLength d = R2Distance(span, point);
        if (d < closest_distance) closest_distance = d;
    }

    // Return distance
    return closest_distance;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
movq 0x90(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0xa3000
cmpl $0x0, %eax
je 0xcbd12
xorps %xmm0, %xmm0
movsd %xmm0, 0xa0(%rsp)
jmp 0xcbe29
movsd 0x67306(%rip), %xmm0    # 0x133020
movsd %xmm0, 0x88(%rsp)
movl $0x0, 0x84(%rsp)
movl 0x84(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x90(%rsp), %rdi
callq 0xa3810
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jge 0xcbe17
movq 0x90(%rsp), %rdi
movl 0x84(%rsp), %esi
callq 0xa3820
movq %rax, 0x78(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x84(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
movq 0x90(%rsp), %rdi
callq 0xa3810
movq 0x8(%rsp), %rdi
movl %eax, %ecx
movl 0x10(%rsp), %eax
cltd
idivl %ecx
movl %edx, %esi
callq 0xa3820
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rsi
movq 0x70(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0xc1470
movq 0x98(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0xa35e0
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm1
movsd 0x88(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xcbdff
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
jmp 0xcbe01
movl 0x84(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x84(%rsp)
jmp 0xcbd2e
movsd 0x88(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movsd 0xa0(%rsp), %xmm0
addq $0xa8, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Dist.cpp
// Function: gaps::R2Distance(gaps::R2Line const&, gaps::R2Span const&)
RNLength R2Distance(const R2Line& line, const R2Span& span)
{
    // Return distance from span to line
    RNScalar d = R2SignedDistance(line, span);
    if (RNIsPositive(d)) return d;
    else if (RNIsNegative(d)) return -d;
    else return 0.0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xcc430
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
leaq 0xac120(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm1
callq 0x36d50
cmpl $0x0, %eax
je 0xcc3dc
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
jmp 0xcc425
movsd 0x8(%rsp), %xmm0
leaq 0xac0f7(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm1
callq 0x38fd0
cmpl $0x0, %eax
je 0xcc41c
movsd 0x8(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x20(%rsp)
jmp 0xcc425
xorps %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
addq $0x28, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Dist.cpp
// Function: gaps::R2SignedDistance(gaps::R2Line const&, gaps::R2Span const&)
RNLength R2SignedDistance(const R2Line& line, const R2Span& span)
{
    // Return signed distance from line to span
    RNLength d1 = R2SignedDistance(line, span.Start());
    if (RNIsPositive(d1)) {
	// Start point is above line
	RNLength d2 = R2SignedDistance(line, span.End());
	if (RNIsPositive(d2)) return ((d1 > d2) ? d2 : d1);
	else return 0.0;
    }
    else if (RNIsNegative(d1)) {
	// Start point is below line
	RNLength d2 = R2SignedDistance(line, span.End());
	if (RNIsNegative(d2)) return ((d1 > d2) ? d1 : d2);
	else return 0.0;
    }
    else {
	// Start point is on line
	return 0.0;
    }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rdi
callq 0xa3500
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xcb900
movsd %xmm0, 0x38(%rsp)
movsd 0x38(%rsp), %xmm0
leaq 0xac06e(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm1
callq 0x36d50
cmpl $0x0, %eax
je 0xcc50d
movq 0x48(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rdi
callq 0xa3510
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0xcb900
movsd %xmm0, 0x30(%rsp)
movsd 0x30(%rsp), %xmm0
leaq 0xac028(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm1
callq 0x36d50
cmpl $0x0, %eax
je 0xcc4ff
movsd 0x38(%rsp), %xmm0
ucomisd 0x30(%rsp), %xmm0
jbe 0xcc4e2
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
jmp 0xcc4ee
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
jmp 0xcc5b5
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
jmp 0xcc5b5
movsd 0x38(%rsp), %xmm0
leaq 0xabfc6(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm1
callq 0x38fd0
cmpl $0x0, %eax
je 0xcc5ac
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
callq 0xa3510
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xcb900
movsd %xmm0, 0x28(%rsp)
movsd 0x28(%rsp), %xmm0
leaq 0xabf80(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm1
callq 0x38fd0
cmpl $0x0, %eax
je 0xcc5a1
movsd 0x38(%rsp), %xmm0
ucomisd 0x28(%rsp), %xmm0
jbe 0xcc589
movsd 0x38(%rsp), %xmm0
movsd %xmm0, (%rsp)
jmp 0xcc594
movsd 0x28(%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd (%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
jmp 0xcc5b5
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
jmp 0xcc5b5
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x50(%rsp), %xmm0
addq $0x58, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Dist.cpp
// Function: gaps::R2SignedDistance(gaps::R2Line const&, gaps::R2Line const&)
RNLength R2SignedDistance(const R2Line& line1, const R2Line& line2)
{
    // Return signed distance from line to line
    RNScalar dot = line1.Vector().Dot(line2.Vector());
    if (RNIsEqual(dot, 1.0)) return (line1.C() - line2.C());
    else if (RNIsEqual(dot, -1.0)) return (line1.C() + line2.C());
    else return 0.0;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rdi
callq 0xa3540
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
callq 0xa3540
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0xc3f40
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
leaq 0xabde9(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm2
movsd 0x66905(%rip), %xmm1    # 0x133008
callq 0x37170
cmpl $0x0, %eax
je 0xcc73c
movq 0x28(%rsp), %rdi
callq 0xa3550
movsd %xmm0, 0x8(%rsp)
movq 0x20(%rsp), %rdi
callq 0xa3550
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
jmp 0xcc795
movsd 0x18(%rsp), %xmm0
leaq 0xabd97(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm2
movsd 0x668c3(%rip), %xmm1    # 0x133018
callq 0x37170
cmpl $0x0, %eax
je 0xcc78c
movq 0x28(%rsp), %rdi
callq 0xa3550
movsd %xmm0, (%rsp)
movq 0x20(%rsp), %rdi
callq 0xa3550
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
jmp 0xcc795
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x30(%rsp), %xmm0
addq $0x38, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Dist.cpp
// Function: gaps::R2SignedDistance(gaps::R2Line const&, gaps::R2Box const&)
RNLength R2SignedDistance(const R2Line& line, const R2Box& box)
{
    // Return signed distance from line to box
    RNQuadrant quadrant = line.Normal().Quadrant();
    RNScalar d1 = R2SignedDistance(line, box.Corner(~quadrant & 0x3));
    if (RNIsPositiveOrZero(d1)) return d1;
    RNScalar d2 = R2SignedDistance(line, box.Corner(quadrant));
    if (RNIsNegative(d2)) return d2;
    else return 0.0;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq 0x58(%rsp), %rdi
callq 0xa38c0
movq %rax, %rdi
callq 0xc3ed0
movl %eax, 0x4c(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rsi
movl 0x4c(%rsp), %edx
xorl $-0x1, %edx
andl $0x3, %edx
leaq 0x30(%rsp), %rdi
callq 0xbd950
movq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xcb900
movsd %xmm0, 0x40(%rsp)
movsd 0x40(%rsp), %xmm0
leaq 0xabc77(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm1
callq 0x3a5d0
cmpl $0x0, %eax
je 0xcc885
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
jmp 0xcc8e9
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rsi
movl 0x4c(%rsp), %edx
leaq 0x18(%rsp), %rdi
callq 0xbd950
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xcb900
movsd %xmm0, 0x28(%rsp)
movsd 0x28(%rsp), %xmm0
leaq 0xabc1c(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm1
callq 0x38fd0
cmpl $0x0, %eax
je 0xcc8e0
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
jmp 0xcc8e9
xorps %xmm0, %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x60(%rsp), %xmm0
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Dist.cpp
// Function: gaps::R2SignedDistance(gaps::R2Line const&, gaps::R2Circle const&)
RNLength R2SignedDistance(const R2Line& line, const R2Circle& circle)
{
    RNLength d = R2SignedDistance(line, circle.Center());
    if (d < 0.0) {
	d += circle.Radius();
	if (d > 0.0) return 0.0;
    }
    else if (d > 0.0) {
	d -= circle.Radius();
	if (d < 0.0) return 0.0;
    }
    return d;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
callq 0xa3530
movq (%rsp), %rdi
movq %rax, %rsi
callq 0xcb900
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0xcc970
movq 0x10(%rsp), %rdi
callq 0xa36b0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xcc96e
xorps %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
jmp 0xcc9c2
jmp 0xcc9b6
movsd 0x8(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xcc9b4
movq 0x10(%rsp), %rdi
callq 0xa36b0
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0xcc9b2
xorps %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
jmp 0xcc9c2
jmp 0xcc9b4
jmp 0xcc9b6
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
addq $0x28, %rsp
retq
nopl (%rax)