LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::WriteSTLFile(char const*) const
int R3Mesh::
WriteSTLFile(const char *filename) const
{
  // Open file
  FILE *fp;
  if (!(fp = fopen(filename, "w"))) {
    RNFail("Unable to open file %s", filename);
    return 0;
  }

  // Write header
  fprintf(fp, "solid %s\n", filename);

  // Write Faces
  for (int i = 0; i < NFaces(); i++) {
    R3MeshFace *face = Face(i);
    const R3Vector& n = FaceNormal(face);
    fprintf(fp, "facet normal %g %g %g\n", n[0], n[1], n[2]);
    fprintf(fp, "  outer loop\n");
    for (int j = 0; j < 3; j++) {
      R3MeshVertex *vertex = VertexOnFace(face, j);
      const R3Point& p = VertexPosition(vertex);
      fprintf(fp, "   vertex %g %g %g\n", p[0], p[1], p[2]);
    }
    fprintf(fp, "  endloop\n");
    fprintf(fp, "endfacet\n");
  }

  // Write trailer
  fprintf(fp, "endsolid\n");

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
leaq 0x84319(%rip), %rsi     # 0xa77bd
movq %r15, %rdi
callq 0xe530
testq %rax, %rax
je 0x235da
movq %rax, %rbx
leaq 0x7f5d0(%rip), %rsi     # 0xa2a8f
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe670
cmpl $0x0, 0x34(%r14)
jle 0x235b2
xorl %ebp, %ebp
leaq 0x7f5de(%rip), %r13     # 0xa2abe
movq 0x28(%r14), %rax
movq (%rax,%rbp,8), %r12
testb $0x4, 0xa8(%r12)
jne 0x23502
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %rsi
callq *0x2c8(%rax)
movsd 0x38(%r12), %xmm0
movsd 0x40(%r12), %xmm1
movsd 0x48(%r12), %xmm2
movq %rbx, %rdi
leaq 0x7f578(%rip), %rsi     # 0xa2a99
movb $0x3, %al
callq 0xe670
movl $0x1, %r15d
movl $0xd, %esi
movl $0x1, %edx
leaq 0x7f571(%rip), %rdi     # 0xa2ab0
movq %rbx, %rcx
callq 0xe8b0
movq (%r12,%r15,8), %rax
movsd 0x18(%rax), %xmm0
movsd 0x20(%rax), %xmm1
movsd 0x28(%rax), %xmm2
movq %rbx, %rdi
movq %r13, %rsi
movb $0x3, %al
callq 0xe670
incq %r15
cmpq $0x4, %r15
jne 0x23547
movl $0xa, %esi
movl $0x1, %edx
leaq 0x7f551(%rip), %rdi     # 0xa2ad2
movq %rbx, %rcx
callq 0xe8b0
movl $0x9, %esi
movl $0x1, %edx
leaq 0x7f543(%rip), %rdi     # 0xa2add
movq %rbx, %rcx
callq 0xe8b0
incq %rbp
movslq 0x34(%r14), %rax
cmpq %rax, %rbp
jl 0x234e0
leaq 0x7f52e(%rip), %rdi     # 0xa2ae7
movl $0x9, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0xe8b0
movq %rbx, %rdi
callq 0xe430
movl $0x1, %ebx
jmp 0x235ed
leaq 0x7eddc(%rip), %rdi     # 0xa23bd
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0x72a1e
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::UpdateVertexNormal(gaps::R3MeshVertex*) const
void R3Mesh::
UpdateVertexNormal(R3MeshVertex *v) const
{
  // Average face normals
  v->normal = R3zero_vector;
  for (int i = 0; i < v->edges.NEntries(); i++) {
    R3MeshEdge *e = v->edges[i];
    if (e->vertex[0] == v) {
      if (e->face[0]) 
        v->normal += FaceNormal(e->face[0]);
    }
    else {
      if (e->face[1]) 
        v->normal += FaceNormal(e->face[1]);
    }
  }
  v->normal.Normalize();

  // Update flags
  v->flags.Add(R3_MESH_VERTEX_NORMAL_UPTODATE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x30(%rsi), %r14
leaq 0x850b0(%rip), %rsi     # 0xa86e0
movq %r14, %rdi
callq 0x3dc6a
cmpl $0x0, 0x14(%rbx)
jle 0x23693
xorl %r13d, %r13d
movq 0x8(%rbx), %rax
movq (%rax,%r13,8), %rax
cmpq %rbx, 0x8(%rax)
je 0x23655
movq 0x20(%rax), %r12
jmp 0x23659
movq 0x18(%rax), %r12
testq %r12, %r12
je 0x23687
testb $0x4, 0xa8(%r12)
jne 0x23678
movq (%r15), %rax
movq %r15, %rdi
movq %r12, %rsi
callq *0x2c8(%rax)
addq $0x38, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x3deb0
incq %r13
movslq 0x14(%rbx), %rax
cmpq %rax, %r13
jl 0x23641
movq %r14, %rdi
callq 0x3d7e0
orb $0x2, 0x78(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::UpdateFaceArea(gaps::R3MeshFace*) const
void R3Mesh::
UpdateFaceArea(R3MeshFace *f) const
{
  // Compute area of face
  R3Vector v1 = f->vertex[1]->position - f->vertex[0]->position;
  R3Vector v2 = f->vertex[2]->position - f->vertex[0]->position;
  R3Vector v3 = v1 % v2;
  f->area = 0.5 * v3.Length();

  // Update flags
  f->flags.Add(R3_MESH_FACE_AREA_UPTODATE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq 0x8(%rsi), %rdx
movq 0x10(%rsi), %rsi
addq $0x18, %rsi
addq $0x18, %rdx
leaq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x3cc88
movq 0x8(%rbx), %rdx
movq 0x18(%rbx), %rsi
addq $0x18, %rsi
addq $0x18, %rdx
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x3cc88
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3de12
movq %r12, %rdi
callq 0x3d5c4
mulsd 0x7e8f9(%rip), %xmm0    # 0xa2030
movsd %xmm0, 0x90(%rbx)
orb $0x2, 0xa8(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::UpdateFaceBBox(gaps::R3MeshFace*) const
void R3Mesh::
UpdateFaceBBox(R3MeshFace *f) const
{
  // Update face bbox
  f->bbox = R3null_box;
  f->bbox.Union(f->vertex[0]->position);
  f->bbox.Union(f->vertex[1]->position);
  f->bbox.Union(f->vertex[2]->position);

  // Update flags
  f->flags.Add(R3_MESH_FACE_BBOX_UPTODATE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
leaq 0x58(%rsi), %r14
leaq 0x60(%rsi), %rdi
leaq 0xc26d9(%rip), %r15     # 0xe5e98
leaq 0x8(%r15), %rsi
callq 0x3cd94
leaq 0x78(%rbx), %rdi
addq $0x20, %r15
movq %r15, %rsi
callq 0x3cd94
movq 0x8(%rbx), %rsi
addq $0x18, %rsi
movq %r14, %rdi
callq 0x27f0e
movq 0x10(%rbx), %rsi
addq $0x18, %rsi
movq %r14, %rdi
callq 0x27f0e
movq 0x18(%rbx), %rsi
addq $0x18, %rsi
movq %r14, %rdi
callq 0x27f0e
orb $0x8, 0xa8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Distance(gaps::R3Mesh*, gaps::R3MeshVertex*, gaps::R3Point const&, gaps::R3MeshIntersection*)
RNLength
R3Distance(R3Mesh *mesh, R3MeshVertex *vertex, const R3Point& point, R3MeshIntersection* closest_point)
{
  // Compute squared distance from vertex to point
  const R3Point& vertex_position = mesh->VertexPosition(vertex);
  RNLength distance = R3Distance(point, vertex_position);

  // Fill in closest_point info
  if (closest_point) {
    closest_point->type = R3_MESH_VERTEX_TYPE;
    closest_point->vertex = vertex;
    closest_point->edge = NULL;
    closest_point->face = NULL;
    closest_point->point = vertex_position;
    closest_point->t = distance; 
  }

  // Return distance
  return distance;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %rdi
movq %rsi, %r15
leaq 0x18(%rsi), %r14
movq %r14, %rsi
callq 0x49efc
testq %rbx, %rbx
je 0x238cd
movl $0x1, (%rbx)
movq %r15, 0x8(%rbx)
leaq 0x20(%rbx), %rdi
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq %r14, %rsi
callq 0x3cd94
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x38(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Distance(gaps::R3Mesh*, gaps::R3MeshEdge*, gaps::R3Point const&, gaps::R3MeshIntersection*)
RNLength 
R3Distance(R3Mesh *mesh, R3MeshEdge *edge, const R3Point& point, R3MeshIntersection* closest_point)
{
  // Compute distance from edge to point
  R3Span edge_span = mesh->EdgeSpan(edge);
  RNScalar distance = R3Distance(point, edge_span);

  // Fill in closest point info
  if (closest_point) {
    closest_point->edge = edge;
    closest_point->face = NULL;
    closest_point->t = distance; 
    RNScalar edge_t = edge_span.T(point);
    if (RNIsEqual(edge_t, 0)) {
      R3MeshVertex *vertex = mesh->VertexOnEdge(edge, 0);
      closest_point->type = R3_MESH_VERTEX_TYPE;
      closest_point->vertex = vertex;
      closest_point->point = mesh->VertexPosition(vertex);
    }
    else if (RNIsEqual(edge_t, edge_span.Length())) {
      R3MeshVertex *vertex = mesh->VertexOnEdge(edge, 1);
      closest_point->type = R3_MESH_VERTEX_TYPE;
      closest_point->vertex = vertex;
      closest_point->point = mesh->VertexPosition(vertex);
    }
    else {
      closest_point->type = R3_MESH_EDGE_TYPE;
      closest_point->vertex = NULL;
      closest_point->point = edge_span.Point(edge_t);
    }
  }

  // Return squared distance
  return distance;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movq 0x8(%rsi), %rsi
movq 0x10(%r14), %rdx
addq $0x18, %rsi
addq $0x18, %rdx
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x3beaa
movq %r15, %rdi
movq %r12, %rsi
callq 0x49fde
testq %rbx, %rbx
je 0x239cf
movq %r14, 0x10(%rbx)
movq $0x0, 0x18(%rbx)
movsd %xmm0, 0x8(%rsp)
movsd %xmm0, 0x38(%rbx)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x3c150
leaq 0xc2251(%rip), %rax     # 0xe5b98
movsd (%rax), %xmm1
movapd 0x7e6cd(%rip), %xmm2    # 0xa2020
xorpd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jb 0x23969
ucomisd %xmm0, %xmm1
jb 0x23969
movq 0x8(%r14), %rsi
jmp 0x23983
movapd %xmm0, %xmm3
subsd 0x58(%rsp), %xmm3
ucomisd %xmm2, %xmm3
jb 0x2399a
ucomisd %xmm3, %xmm1
jb 0x2399a
movq 0x10(%r14), %rsi
movl $0x1, (%rbx)
movq %rsi, 0x8(%rbx)
addq $0x18, %rsi
addq $0x20, %rbx
movq %rbx, %rdi
jmp 0x239c4
movl $0x2, (%rbx)
movq $0x0, 0x8(%rbx)
leaq 0x60(%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3c03a
addq $0x20, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3cd94
movsd 0x8(%rsp), %xmm0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/../../pkgs/RNBasics/RNHeap.cpp
// Function: gaps::RNHeap<gaps::R3MeshEdge*>::Push(gaps::R3MeshEdge*)
void RNHeap<PtrType>::
Push(PtrType entry)
{
  // Allocate space for entry
  if (nentries == nallocated) {
    nallocated = (nallocated == 0) ? 1 : 2 * nallocated;
    PtrType *newentries = new PtrType [nallocated];
    for (int i = 0; i < nentries; i++) {
      newentries[i] = entries[i];
      if (entry_offset >= 0) *((PtrType **) ((unsigned char *) newentries[i] + entry_offset)) = &newentries[i];
      if (entry_callback) *((PtrType **) (*entry_callback)(newentries[i], callback_data)) = &newentries[i];
    }
    if (entries) delete [] entries;
    entries = newentries;
  }

  // Put entry into tail
  entries[nentries] = entry;

  // Update entry backpointer
  if (entry_offset >= 0) *((PtrType **) ((unsigned char *) entries[nentries] + entry_offset)) = &entries[nentries];
  if (entry_callback) *((PtrType **) (*entry_callback)(entries[nentries], callback_data)) = &entries[nentries];

  // Increment number of entries
  nentries++;

  // Bubble tail entry up to its rightful spot
  BubbleUp(nentries-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc(%rdi), %eax
cmpl %eax, 0x8(%rdi)
jne 0x23ec0
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x1, %eax
cmovnel %ecx, %eax
movl %eax, 0xc(%rbx)
cltq
leaq (,%rax,8), %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0xe030
movq %rax, %r15
cmpl $0x0, 0x8(%rbx)
jle 0x23eb0
xorl %r12d, %r12d
movq %r15, %r13
movq (%rbx), %rax
movq (%rax,%r12,8), %rax
movq %rax, (%r13)
movslq 0x14(%rbx), %rcx
testq %rcx, %rcx
js 0x23e8a
movq %r13, (%rax,%rcx)
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x23ea0
movq (%r13), %rdi
movq 0x28(%rbx), %rsi
callq *%rax
movq %r13, (%rax)
incq %r12
movslq 0x8(%rbx), %rax
addq $0x8, %r13
cmpq %rax, %r12
jl 0x23e72
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x23ebd
callq 0xe5b0
movq %r15, (%rbx)
movq (%rbx), %rcx
movslq 0x8(%rbx), %rax
movq %r14, (%rcx,%rax,8)
movslq 0x14(%rbx), %rcx
testq %rcx, %rcx
js 0x23ee2
movq (%rbx), %rdx
leaq (%rdx,%rax,8), %rdx
movq (%rdx), %rsi
movq %rdx, (%rsi,%rcx)
movq 0x20(%rbx), %rcx
testq %rcx, %rcx
je 0x23efe
movq (%rbx), %rdx
movq 0x28(%rbx), %rsi
leaq (%rdx,%rax,8), %r14
movq (%r14), %rdi
callq *%rcx
movq %r14, (%rax)
movl 0x8(%rbx), %esi
leal 0x1(%rsi), %eax
movl %eax, 0x8(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x250b8
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/../../pkgs/RNBasics/RNHeap.cpp
// Function: gaps::RNHeap<gaps::R3MeshEdge*>::Pop()
PtrType RNHeap<PtrType>::
Pop(void)
{
  // Check number of entries	
  if (nentries == 0) return NULL;

  // Get head entry
  PtrType result = entries[0];

  // Update deleted entry backpointer
  if (entry_offset >= 0) *((PtrType **) ((unsigned char *) entries[0] + entry_offset)) = NULL;
  if (entry_callback) *((PtrType **) (*entry_callback)(entries[0], callback_data)) = NULL;

  // Remove head entry, by copying tail over it
  entries[0] = entries[nentries-1];

  // Update new entry[0] backpointer
  if (entry_offset >= 0) *((PtrType **) ((unsigned char *) entries[0] + entry_offset)) = &entries[0];
  if (entry_callback) *((PtrType **) (*entry_callback)(entries[0], callback_data)) = &entries[0];

  // Decrement number of entries
  nentries--;

  // Bubble the head entry down to its rightful spot
  BubbleDown(0);

  // Return original head entry
  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x0, 0x8(%rdi)
je 0x23fa7
movq %rdi, %r14
movq (%rdi), %rax
movq (%rax), %rbx
movslq 0x14(%rdi), %rax
testq %rax, %rax
js 0x23f41
movq $0x0, (%rbx,%rax)
movq 0x20(%r14), %rax
testq %rax, %rax
je 0x23f5d
movq (%r14), %rcx
movq 0x28(%r14), %rsi
movq (%rcx), %rdi
callq *%rax
movq $0x0, (%rax)
movq (%r14), %rax
movslq 0x8(%r14), %rcx
movq -0x8(%rax,%rcx,8), %rcx
movq %rcx, (%rax)
movslq 0x14(%r14), %rax
testq %rax, %rax
js 0x23f7f
movq (%r14), %rcx
movq (%rcx), %rdx
movq %rcx, (%rdx,%rax)
movq 0x20(%r14), %rax
testq %rax, %rax
je 0x23f97
movq (%r14), %r15
movq 0x28(%r14), %rsi
movq (%r15), %rdi
callq *%rax
movq %r15, (%rax)
decl 0x8(%r14)
movq %r14, %rdi
xorl %esi, %esi
callq 0x25238
jmp 0x23fa9
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/../../pkgs/RNBasics/RNHeap.cpp
// Function: gaps::RNHeap<gaps::R3MeshEdge*>::Remove(gaps::R3MeshEdge*)
void RNHeap<PtrType>::
Remove(PtrType entry)
{
  // Search for entry
  PtrType *entryp = NULL;
  if (entry_offset >= 0) entryp = *((PtrType **) ((unsigned char *) entry + entry_offset));
  if (entry_callback) entryp = *((PtrType **) (*entry_callback)(entry, callback_data));
  else {
    // Find entry in heap
    for (int i = 0; i < nentries; i++) {
      if (entries[i] == entry) {
        entryp = &entries[i];
        break;
      }
    }
  }

  // Move data into place
  if (!entryp) return;
  int index = entryp - entries;
  assert((0 <= index) && (index < nentries));

  // Update deleted entry backpointer
  if (entry_offset >= 0) *((PtrType **) ((unsigned char *) entries[index] + entry_offset)) = NULL;
  if (entry_callback) *((PtrType **) (*entry_callback)(entries[index], callback_data)) = NULL;

  // Remove entry, by copying tail over it
  entries[index] = entries[nentries-1];

  // Update new entry[0] backpointer
  if (entry_offset >= 0) *((PtrType **) ((unsigned char *) entries[index] + entry_offset)) = &entries[index];
  if (entry_callback) *((PtrType **) (*entry_callback)(entries[index], callback_data)) = &entries[index];

  // Decrement number of entries
  nentries--;

  // Bubble the entry down to its rightful spot
  BubbleDown(index);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movslq 0x14(%rdi), %rax
testq %rax, %rax
js 0x23fc9
movq (%rsi,%rax), %r14
jmp 0x23fcc
xorl %r14d, %r14d
movq 0x20(%rbx), %rcx
testq %rcx, %rcx
je 0x2408c
movq 0x28(%rbx), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq *%rcx
movq (%rax), %r14
testq %r14, %r14
je 0x240af
movq (%rbx), %rax
subq %rax, %r14
shrq $0x3, %r14
movslq 0x14(%rbx), %rcx
testq %rcx, %rcx
js 0x24013
movslq %r14d, %rdx
movq (%rax,%rdx,8), %rax
movq $0x0, (%rax,%rcx)
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x24033
movslq %r14d, %rcx
movq (%rbx), %rdx
movq 0x28(%rbx), %rsi
movq (%rdx,%rcx,8), %rdi
callq *%rax
movq $0x0, (%rax)
movq (%rbx), %rcx
movslq 0x8(%rbx), %rax
movq -0x8(%rcx,%rax,8), %rdx
movslq %r14d, %rax
movq %rdx, (%rcx,%rax,8)
movslq 0x14(%rbx), %rcx
testq %rcx, %rcx
js 0x2405d
movq (%rbx), %rdx
leaq (%rdx,%rax,8), %rdx
movq (%rdx), %rsi
movq %rdx, (%rsi,%rcx)
movq 0x20(%rbx), %rcx
testq %rcx, %rcx
je 0x24079
movq (%rbx), %rdx
movq 0x28(%rbx), %rsi
leaq (%rdx,%rax,8), %r15
movq (%r15), %rdi
callq *%rcx
movq %r15, (%rax)
decl 0x8(%rbx)
movq %rbx, %rdi
movl %r14d, %esi
popq %rbx
popq %r14
popq %r15
jmp 0x25238
movslq 0x8(%rbx), %rax
testq %rax, %rax
jle 0x23fe8
movq (%rbx), %rcx
cmpq %rsi, (%rcx)
je 0x240b5
addq $0x8, %rcx
decq %rax
jne 0x2409c
jmp 0x23fe8
popq %rbx
popq %r14
popq %r15
retq
movq %rcx, %r14
jmp 0x23fe8
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/../../pkgs/RNBasics/RNHeap.cpp
// Function: gaps::RNHeap<gaps::R3MeshEdge*>::Update(gaps::R3MeshEdge*)
void RNHeap<PtrType>::
Update(PtrType entry)
{
  // Search for entry
  PtrType *entryp = NULL;
  if (entry_offset >= 0) entryp = *((PtrType **) ((unsigned char *) entry + entry_offset));
  if (entry_callback) entryp = *((PtrType **) (*entry_callback)(entry, callback_data));
  else {
    // Find entry in heap
    for (int i = 0; i < nentries; i++) {
      if (entries[i] == entry) {
        entryp = &entries[i];
        break;
      }
    }
  }

  // Move data into place
  if (!entryp) return;
  int index = entryp - entries;
  assert((0 <= index) && (index < nentries));
  BubbleUp(BubbleDown(index));
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
movslq 0x14(%rdi), %rcx
testq %rcx, %rcx
js 0x240d4
movq (%rax,%rcx), %rsi
jmp 0x240d6
xorl %esi, %esi
movq 0x20(%rbx), %rcx
testq %rcx, %rcx
je 0x2410a
movq 0x28(%rbx), %rsi
movq %rax, %rdi
callq *%rcx
movq (%rax), %rsi
testq %rsi, %rsi
je 0x24126
subq (%rbx), %rsi
shrq $0x3, %rsi
movq %rbx, %rdi
callq 0x25238
movq %rbx, %rdi
movl %eax, %esi
popq %rbx
jmp 0x250b8
movslq 0x8(%rbx), %rcx
testq %rcx, %rcx
jle 0x240eb
movq (%rbx), %rdx
cmpq %rax, (%rdx)
je 0x24128
addq $0x8, %rdx
decq %rcx
jne 0x24116
jmp 0x240eb
popq %rbx
retq
movq %rdx, %rsi
jmp 0x240eb
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/./R3OrientedBox.h
// Function: gaps::R3OrientedBox::Corner(int) const
inline const R3Point R3OrientedBox::
Corner(RNOctant octant) const
{
    // Check if box is empty
    if (IsEmpty()) return R3zero_point;

    // Return corner position
    R3Point corner = Center();
    corner += (octant & RN_PNN_OCTANT) ? Radius(0)*Axis(0) : -Radius(0)*Axis(0);
    corner += (octant & RN_NPN_OCTANT) ? Radius(1)*Axis(1) : -Radius(1)*Axis(1);
    corner += (octant & RN_NNP_OCTANT) ? Radius(2)*Axis(2) : -Radius(2)*Axis(2);
    return corner;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movsd 0x70(%rsi), %xmm0
movsd 0x78(%rsi), %xmm1
minsd 0x68(%rsi), %xmm0
minsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
ja 0x248b6
movl %edx, %ebp
movq %rsi, %r14
addq $0x8, %rsi
movq %rbx, %rdi
callq 0x3ca36
movsd 0x68(%r14), %xmm0
testb $0x4, %bpl
jne 0x2483c
xorps 0x7d7e4(%rip), %xmm0    # 0xa2020
leaq 0x20(%r14), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x3de8e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3ce0e
movsd 0x70(%r14), %xmm0
testb $0x2, %bpl
jne 0x24869
xorps 0x7d7b7(%rip), %xmm0    # 0xa2020
leaq 0x38(%r14), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x3de8e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3ce0e
movsd 0x78(%r14), %xmm0
testb $0x1, %bpl
jne 0x24897
xorpd 0x7d789(%rip), %xmm0    # 0xa2020
addq $0x50, %r14
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3de8e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3ce0e
jmp 0x248c5
leaq 0x4c21a3(%rip), %rsi    # 0x4e6a60
movq %rbx, %rdi
callq 0x3ca36
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/./R3Mesh.h
// Function: gaps::R3Mesh::Draw(gaps::RNFlags) const
inline void R3Mesh:: 
Draw(const R3DrawFlags draw_flags) const
{
  // Draw the mesh
  if (draw_flags[R3_SURFACES_DRAW_FLAG]) DrawFaces(draw_flags);
  else if (draw_flags[R3_EDGES_DRAW_FLAG]) DrawEdges(draw_flags);
  else DrawVertices(draw_flags);
}

// Assembly:
testb $0x2, %sil
jne 0x2490d
movq (%rdi), %rax
testb $0x1, %sil
jne 0x24917
addq $0x128, %rax            # imm = 0x128
jmp 0x2491d
movl $0x138, %eax            # imm = 0x138
addq (%rdi), %rax
jmp 0x2491d
addq $0x130, %rax            # imm = 0x130
movq (%rax), %rax
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/../../pkgs/RNBasics/RNHeap.cpp
// Function: gaps::RNHeap<gaps::R3MeshBoundaryVertexData*>::BubbleUp(int)
int RNHeap<PtrType>::
BubbleUp(int index)
{
  // Move data up tree to rightful place
  while (index > 0) {
    int parent_index = ((index - 1) >> 1);

    // Compare values
    if (Compare(index, parent_index) >= 0) break;

    // Swap values
    Swap(index, parent_index);

    // Move up tree
    index = parent_index;
  }

  // Return new index
  return index;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
testl %r14d, %r14d
jle 0x24d88
leal -0x1(%r14), %ebp
shrl %ebp
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x24d98
movl %eax, %r15d
testl %eax, %eax
js 0x24d71
movl %r14d, %ebp
jmp 0x24d81
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x24df6
movl %ebp, %r14d
testl %r15d, %r15d
js 0x24d4d
jmp 0x24d8b
movl %r14d, %ebp
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/R3Shapes/../../pkgs/RNBasics/RNHeap.cpp
// Function: gaps::RNHeap<gaps::R3MeshBoundaryVertexData*>::Compare(int, int) const
int RNHeap<PtrType>::
Compare(int i, int j) const
{
  // Get values
  RNScalar value1 = Value(i);
  RNScalar value2 = Value(j);

  // Compare values
  if (least_first) { 
    if (value1 < value2) return -1;
    else if (value1 > value2) return 1;
    else return 0;
  }
  else {
    if (value1 > value2) return -1;
    else if (value1 < value2) return 1;
    else return 0;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
callq 0x24e76
movsd %xmm0, (%rsp)
movq %r14, %rdi
movl %ebx, %esi
callq 0x24e76
cmpl $0x0, 0x30(%r14)
je 0x24dd4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movsd (%rsp), %xmm1
ucomisd %xmm1, %xmm0
ja 0x24ded
xorl %eax, %eax
ucomisd %xmm0, %xmm1
jmp 0x24dea
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x24ded
xorl %eax, %eax
ucomisd %xmm1, %xmm0
seta %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/../../pkgs/RNBasics/RNHeap.cpp
// Function: gaps::RNHeap<gaps::R3MeshBoundaryVertexData*>::Swap(int, int)
void RNHeap<PtrType>::
Swap(int i, int j)
{
  // Swap entries
  PtrType swap = entries[i];
  entries[i] = entries[j];
  entries[j] = swap;
  
  // Update entry backpointers
  if (entry_offset >= 0) {
    *((PtrType **) ((unsigned char *) entries[i] + entry_offset)) = &entries[i];
    *((PtrType **) ((unsigned char *) entries[j] + entry_offset)) = &entries[j];
  }
  if (entry_callback) {
    *((PtrType **) (*entry_callback)(entries[i], callback_data)) = &entries[i];
    *((PtrType **) (*entry_callback)(entries[j], callback_data)) = &entries[j];
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rcx
movslq %esi, %rax
movq (%rcx,%rax,8), %rsi
movslq %edx, %r14
movq (%rcx,%r14,8), %rdx
movq %rdx, (%rcx,%rax,8)
movq (%rdi), %rcx
movq %rsi, (%rcx,%r14,8)
movslq 0x14(%rdi), %rcx
testq %rcx, %rcx
js 0x24e3f
movq (%rbx), %rdx
leaq (%rdx,%rax,8), %rdx
movq (%rdx), %rsi
movq %rdx, (%rsi,%rcx)
movq (%rbx), %rdx
leaq (%rdx,%r14,8), %rdx
movq (%rdx), %rsi
movq %rdx, (%rsi,%rcx)
movq 0x20(%rbx), %rcx
testq %rcx, %rcx
je 0x24e6f
movq (%rbx), %rdx
movq 0x28(%rbx), %rsi
leaq (%rdx,%rax,8), %r15
movq (%r15), %rdi
callq *%rcx
movq %r15, (%rax)
movq (%rbx), %rax
movq 0x28(%rbx), %rsi
leaq (%rax,%r14,8), %r14
movq (%r14), %rdi
callq *0x20(%rbx)
movq %r14, (%rax)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/../../pkgs/RNBasics/RNHeap.cpp
// Function: gaps::RNHeap<gaps::R3MeshBoundaryVertexData*>::Value(int) const
RNScalar RNHeap<PtrType>::
Value(int i) const
{
  // Return value}
  if (value_offset >= 0) {
    return *((RNScalar *) ((unsigned char *) entries[i] + value_offset));
  }
  else if (value_callback) {
    return (*value_callback)(entries[i], callback_data);
  }
  else {
    RNAbort("No heap value callback or offset\n");
    return 0;
  }
}

// Assembly:
movslq 0x10(%rdi), %rax
testq %rax, %rax
js 0x24e8f
movq (%rdi), %rcx
movslq %esi, %rdx
movq (%rcx,%rdx,8), %rcx
movsd (%rcx,%rax), %xmm0
retq
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x24ea8
movslq %esi, %rcx
movq (%rdi), %rdx
movq 0x28(%rdi), %rsi
movq (%rdx,%rcx,8), %rdi
jmpq *%rax
pushq %rax
leaq 0x7dc5b(%rip), %rdi     # 0xa2b0b
xorl %eax, %eax
callq 0x72942
xorps %xmm0, %xmm0
addq $0x8, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Sphere.cpp
// Function: gaps::R3Sphere::ClosestPoint(gaps::R3Point const&) const
const R3Point R3Sphere::
ClosestPoint(const R3Point& point) const
{
    // Return closest point in sphere
    if (radius <= 0) return center;
    R3Vector v = point - Center();
    RNLength d = v.Length();
    if (d < radius) return point;
    else return center + radius * v / d;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r12
movq %rdi, %rbx
xorpd %xmm0, %xmm0
ucomisd 0x20(%rsi), %xmm0
jae 0x27238
movq %rdx, %r15
leaq 0x8(%r12), %r14
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rdx, %rsi
movq %r14, %rdx
callq 0x3cc88
movq %r13, %rdi
callq 0x3d5c4
movapd %xmm0, %xmm1
movsd 0x20(%r12), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x27249
movq %rbx, %rdi
movq %r15, %rsi
jmp 0x27242
addq $0x8, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3ca36
jmp 0x27283
leaq 0x20(%rsp), %r15
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
movsd %xmm1, (%rsp)
callq 0x3de8e
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
callq 0x3e200
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3cd71
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Sphere.cpp
// Function: gaps::R3Sphere::FurthestPoint(gaps::R3Point const&) const
const R3Point R3Sphere::
FurthestPoint(const R3Point& point) const
{
    // Return furthest point in sphere
    if (radius <= 0) return center;
    R3Vector v = point - Center();
    RNLength d = v.Length();
    if (RNIsZero(d)) return R3Point(center[0] + radius, center[1], center[2]);
    else return center - radius * v / d;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorpd %xmm0, %xmm0
ucomisd 0x20(%rsi), %xmm0
jae 0x27318
leaq 0x8(%r14), %r15
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %rdx, %rsi
movq %r15, %rdx
callq 0x3cc88
movq %r12, %rdi
callq 0x3d5c4
movapd %xmm0, %xmm2
leaq 0xbe8be(%rip), %rax     # 0xe5b98
movsd (%rax), %xmm0
movapd 0x7ad3a(%rip), %xmm1    # 0xa2020
xorpd %xmm0, %xmm1
ucomisd %xmm1, %xmm2
jb 0x27329
ucomisd %xmm2, %xmm0
jb 0x27329
movsd 0x8(%r14), %xmm0
movsd 0x10(%r14), %xmm1
addsd 0x20(%r14), %xmm0
movsd 0x18(%r14), %xmm2
movq %rbx, %rdi
callq 0x3ca26
jmp 0x2736b
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3ca36
jmp 0x2736b
movsd 0x20(%r14), %xmm0
leaq 0x28(%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
movsd %xmm2, 0x8(%rsp)
callq 0x3de8e
leaq 0x40(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x3e200
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3d44d
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Box.cpp
// Function: gaps::R3Box::Corner(int) const
const R3Point R3Box::
Corner (RNOctant octant) const
{
    // Return corner point 
    switch (octant) {
    case RN_NNN_OCTANT: return minpt;
    case RN_NNP_OCTANT: return R3Point(minpt.X(), minpt.Y(), maxpt.Z());
    case RN_NPN_OCTANT: return R3Point(minpt.X(), maxpt.Y(), minpt.Z());
    case RN_NPP_OCTANT: return R3Point(minpt.X(), maxpt.Y(), maxpt.Z());
    case RN_PNN_OCTANT: return R3Point(maxpt.X(), minpt.Y(), minpt.Z());
    case RN_PNP_OCTANT: return R3Point(maxpt.X(), minpt.Y(), maxpt.Z());
    case RN_PPN_OCTANT: return R3Point(maxpt.X(), maxpt.Y(), minpt.Z());
    case RN_PPP_OCTANT: return maxpt;
    default: RNAbort("Invalid octant for box corner"); return R3null_point;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x7, %edx
ja 0x27804
movl %edx, %eax
leaq 0x7b4f4(%rip), %rcx     # 0xa2c84
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x8, %rsi
jmp 0x27819
movsd 0x20(%rsi), %xmm0
movsd 0x10(%rsi), %xmm1
jmp 0x277b5
movsd 0x28(%rsi), %xmm1
movsd 0x8(%rsi), %xmm0
movsd 0x18(%rsi), %xmm2
jmp 0x277fa
movsd 0x8(%rsi), %xmm0
movsd 0x28(%rsi), %xmm1
jmp 0x277e4
addq $0x20, %rsi
jmp 0x27819
movsd 0x8(%rsi), %xmm0
movsd 0x10(%rsi), %xmm1
jmp 0x277e4
movsd 0x10(%rsi), %xmm1
movsd 0x20(%rsi), %xmm0
movsd 0x30(%rsi), %xmm2
jmp 0x277fa
movsd 0x18(%rsi), %xmm2
movsd 0x20(%rsi), %xmm0
movsd 0x28(%rsi), %xmm1
movq %rbx, %rdi
callq 0x3ca26
jmp 0x27821
leaq 0x7b4c3(%rip), %rdi     # 0xa2cce
xorl %eax, %eax
callq 0x72942
leaq 0x4bf247(%rip), %rsi    # 0x4e6a60
movq %rbx, %rdi
callq 0x3ca36
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Box.cpp
// Function: gaps::R3Box::Plane(int, int) const
const R3Plane R3Box::
Plane (RNDirection dir, RNDimension dim) const
{
    // Return plane along side
    R3Vector v = R3xyz_triad[dim]; 
    RNCoord d = (*this)[dir][dim];
    if (dir == RN_LO) return R3Plane(-v, d);
    else return R3Plane(v, -d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movslq %ecx, %r15
leaq (%r15,%r15,2), %rsi
shlq $0x3, %rsi
addq 0xbd71e(%rip), %rsi     # 0xe4fb0
leaq 0x18(%rsp), %rdi
callq 0x3d4ce
leaq 0x20(%r14), %rax
addq $0x8, %r14
testl %ebp, %ebp
cmovneq %rax, %r14
movsd (%r14,%r15,8), %xmm0
je 0x278c3
xorps 0x7a767(%rip), %xmm0    # 0xa2020
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
jmp 0x278e3
leaq 0x30(%rsp), %r14
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
movaps %xmm0, (%rsp)
callq 0x3e154
movq %rbx, %rdi
movq %r14, %rsi
movaps (%rsp), %xmm0
callq 0x3b582
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Box.cpp
// Function: gaps::R3Box::Side(int, int) const
const R3Box R3Box::
Side (RNDirection dir, RNDimension dim) const
{
    // Return box along side
    R3Box result = *this;
    result[1-dir][dim] = result[dir][dim];
    return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebx
movl %edx, %ebp
movq %rdi, %r14
callq 0x274f0
leaq 0x20(%r14), %rax
movq %r14, %rcx
addq $0x8, %rcx
testl %ebp, %ebp
movq %rax, %rdx
cmoveq %rcx, %rdx
movslq %ebx, %rsi
movsd (%rdx,%rsi,8), %xmm0
cmpl $0x1, %ebp
cmovneq %rax, %rcx
movsd %xmm0, (%rcx,%rsi,8)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Box.cpp
// Function: gaps::R3Box::Octant(int, int, int) const
const R3Box R3Box::
Octant (RNDirection xdir, RNDirection ydir, RNDirection zdir) const
{
    // Return box in octant (xdir, ydir, zdir)
    R3Box result;
    R3Point centroid = Centroid();
    if (xdir == RN_HI) { result[RN_LO][RN_X] = centroid[RN_X]; result[RN_HI][RN_X] = maxpt[RN_X]; }
    else { result[RN_LO][RN_X] = minpt[RN_X]; result[RN_HI][RN_X] = centroid[RN_X]; }
    if (ydir == RN_HI) { result[RN_LO][RN_Y] = centroid[RN_Y]; result[RN_HI][RN_Y] = maxpt[RN_Y]; }
    else { result[RN_LO][RN_Y] = minpt[RN_Y]; result[RN_HI][RN_Y] = centroid[RN_Y]; }
    if (zdir == RN_HI) { result[RN_LO][RN_Z] = centroid[RN_Z]; result[RN_HI][RN_Z] = maxpt[RN_Z]; }
    else { result[RN_LO][RN_Z] = minpt[RN_Z]; result[RN_HI][RN_Z] = centroid[RN_Z]; }
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %ebp
movl %ecx, %r15d
movl %edx, %r13d
movq %rsi, %r14
movq %rdi, %rbx
callq 0x274ac
movq (%r14), %rax
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq *0x68(%rax)
cmpl $0x1, %r13d
jne 0x2797d
movsd (%rsp), %xmm0
movsd %xmm0, 0x8(%rbx)
leaq 0x20(%r14), %r12
jmp 0x27988
movsd 0x8(%r14), %xmm0
movsd %xmm0, 0x8(%rbx)
movsd (%r12), %xmm0
movsd %xmm0, 0x20(%rbx)
cmpl $0x1, %r15d
jne 0x279aa
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rbx)
leaq 0x28(%r14), %rax
jmp 0x279ba
movsd 0x10(%r14), %xmm0
movsd %xmm0, 0x10(%rbx)
leaq 0x8(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rbx)
cmpl $0x1, %ebp
jne 0x279d9
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x18(%rbx)
addq $0x30, %r14
jmp 0x279e9
movsd 0x18(%r14), %xmm0
movsd %xmm0, 0x18(%rbx)
leaq 0x10(%rsp), %r14
movsd (%r14), %xmm0
movsd %xmm0, 0x30(%rbx)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x28348
movq %r14, %rdi
callq 0xe7e0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Box.cpp
// Function: gaps::R3Box::NDimensionsAlongSide(int, int) const
const int R3Box::
NDimensionsAlongSide (RNDirection, RNDimension dim) const
{
    // Return number of non-zero dimensions along side
    int ndimensions = 0;
    int dim1 = (dim+1) % 3;
    int dim2 = (dim+2) % 3;
    if (minpt[dim1] < maxpt[dim1]) ndimensions++;
    if (minpt[dim2] < maxpt[dim2]) ndimensions++;
    return ndimensions;
}

// Assembly:
leal 0x1(%rdx), %eax
cltq
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
leal (%rax,%rax,2), %eax
negl %eax
addl %edx, %eax
incl %eax
movl %edx, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
imulq $0x55555556, %rcx, %rcx # imm = 0x55555556
movq %rcx, %rsi
shrq $0x3f, %rsi
shrq $0x20, %rcx
addl %esi, %ecx
leal (%rcx,%rcx,2), %ecx
negl %ecx
addl %edx, %ecx
addl $0x2, %ecx
cltq
movsd 0x20(%rdi,%rax,8), %xmm0
xorl %edx, %edx
ucomisd 0x8(%rdi,%rax,8), %xmm0
seta %dl
movslq %ecx, %rcx
movsd 0x20(%rdi,%rcx,8), %xmm0
leal 0x1(%rdx), %eax
ucomisd 0x8(%rdi,%rcx,8), %xmm0
cmovbel %edx, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Box.cpp
// Function: gaps::R3Box::ClosestPoint(gaps::R3Point const&) const
const R3Point R3Box::
ClosestPoint(const R3Point& point) const
{
    // Return closest point in box
    R3Point closest(point);
    if (closest.X() < XMin()) closest[RN_X] = XMin();
    else if (closest.X() > XMax()) closest[RN_X] = XMax();
    if (closest.Y() < YMin()) closest[RN_Y] = YMin();
    else if (closest.Y() > YMax()) closest[RN_Y] = YMax();
    if (closest.Z() < ZMin()) closest[RN_Z] = ZMin();
    else if (closest.Z() > ZMax()) closest[RN_Z] = ZMax();
    return closest;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x3ca36
movsd (%rbx), %xmm1
movsd 0x8(%r14), %xmm0
ucomisd %xmm1, %xmm0
ja 0x27bae
movsd 0x20(%r14), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x27bb2
movsd %xmm0, (%rbx)
movsd 0x8(%rbx), %xmm1
movsd 0x10(%r14), %xmm0
ucomisd %xmm1, %xmm0
ja 0x27bcf
movsd 0x28(%r14), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x27bd4
movsd %xmm0, 0x8(%rbx)
movsd 0x10(%rbx), %xmm1
movsd 0x18(%r14), %xmm0
ucomisd %xmm1, %xmm0
ja 0x27bf1
movsd 0x30(%r14), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x27bf6
movsd %xmm0, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Box.cpp
// Function: gaps::R3Box::FurthestPoint(gaps::R3Point const&) const
const R3Point R3Box::
FurthestPoint(const R3Point& point) const
{
    // Return furthest point in box
    R3Point furthest(point);
    RNScalar x = (point.X() < XCenter()) ? XMax() : XMin();
    RNScalar y = (point.Y() < YCenter()) ? YMax() : YMin();
    RNScalar z = (point.Z() < ZCenter()) ? ZMax() : ZMin();
    return R3Point(x, y, z);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x3ca36
movsd 0x20(%r15), %xmm1
movsd 0x8(%r15), %xmm2
movapd %xmm1, %xmm3
addsd %xmm2, %xmm3
mulsd 0x7a3f3(%rip), %xmm3    # 0xa2030
movsd (%r14), %xmm0
cmpltsd %xmm3, %xmm0
andpd %xmm0, %xmm1
andnpd %xmm2, %xmm0
orpd %xmm1, %xmm0
movupd 0x8(%r14), %xmm1
movupd 0x28(%r15), %xmm2
movupd 0x10(%r15), %xmm3
movapd %xmm2, %xmm4
addpd %xmm3, %xmm4
mulpd 0x7a39b(%rip), %xmm4    # 0xa2010
cmpltpd %xmm4, %xmm1
movmskpd %xmm1, %eax
movapd %xmm2, %xmm1
testb $0x1, %al
jne 0x27c8a
movapd %xmm3, %xmm1
testb $0x2, %al
jne 0x27c98
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
movapd %xmm3, %xmm2
jmp 0x27c9c
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
movq %rbx, %rdi
callq 0x3ca26
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Box.cpp
// Function: gaps::R3Box::Union(gaps::R3Point const&)
void R3Box::
Union (const R3Point& point) 
{
    // Expand this to include point
    if (IsEmpty()) {
        minpt = point;
        maxpt = point;
    }
    else {
        if (minpt.X() > point.X()) minpt[0] = point.X();
        if (minpt.Y() > point.Y()) minpt[1] = point.Y();
        if (minpt.Z() > point.Z()) minpt[2] = point.Z();
        if (maxpt.X() < point.X()) maxpt[0] = point.X();
        if (maxpt.Y() < point.Y()) maxpt[1] = point.Y();
        if (maxpt.Z() < point.Z()) maxpt[2] = point.Z();
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x8(%rdi), %rax
movsd 0x8(%rdi), %xmm1
movsd 0x20(%rdi), %xmm0
leaq 0x20(%rdi), %r14
ucomisd %xmm0, %xmm1
ja 0x27fba
movsd 0x10(%rdi), %xmm2
ucomisd 0x28(%rdi), %xmm2
ja 0x27fba
movsd 0x18(%rdi), %xmm2
ucomisd 0x30(%rdi), %xmm2
ja 0x27fba
movsd (%rbx), %xmm2
ucomisd %xmm2, %xmm1
jbe 0x27f57
movsd %xmm2, (%rax)
movsd 0x10(%rdi), %xmm2
movsd 0x8(%rbx), %xmm1
ucomisd %xmm1, %xmm2
jbe 0x27f6c
movsd %xmm1, 0x10(%rdi)
movsd 0x18(%rdi), %xmm2
movsd 0x10(%rbx), %xmm1
ucomisd %xmm1, %xmm2
jbe 0x27f81
movsd %xmm1, 0x18(%rdi)
movsd (%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x27f90
movsd %xmm1, (%r14)
movsd 0x8(%rbx), %xmm0
ucomisd 0x28(%rdi), %xmm0
jbe 0x27fa1
movsd %xmm0, 0x28(%rdi)
movsd 0x10(%rbx), %xmm0
ucomisd 0x30(%rdi), %xmm0
jbe 0x27fb2
movsd %xmm0, 0x30(%rdi)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3cd94
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3cd94
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Box.cpp
// Function: gaps::R3Box::Union(gaps::R3Box const&)
void R3Box::
Union (const R3Box& box) 
{
    // Expand this to include box
    if (IsEmpty()) {
        *this = box;
    }
    else if (!box.IsEmpty()) {
        if (minpt.X() > box.XMin()) minpt[0] = box.XMin();
        if (minpt.Y() > box.YMin()) minpt[1] = box.YMin();
        if (minpt.Z() > box.ZMin()) minpt[2] = box.ZMin();
        if (maxpt.X() < box.XMax()) maxpt[0] = box.XMax();
        if (maxpt.Y() < box.YMax()) maxpt[1] = box.YMax();
        if (maxpt.Z() < box.ZMax()) maxpt[2] = box.ZMax();
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x8(%rdi), %rax
movsd 0x8(%rdi), %xmm1
movsd 0x20(%rdi), %xmm0
leaq 0x20(%rdi), %r14
ucomisd %xmm0, %xmm1
ja 0x280ad
movsd 0x10(%rdi), %xmm2
ucomisd 0x28(%rdi), %xmm2
ja 0x280ad
movsd 0x18(%rdi), %xmm2
ucomisd 0x30(%rdi), %xmm2
ja 0x280ad
movsd 0x8(%rbx), %xmm2
ucomisd 0x20(%rbx), %xmm2
ja 0x280a5
movsd 0x10(%rbx), %xmm3
ucomisd 0x28(%rbx), %xmm3
ja 0x280a5
movsd 0x18(%rbx), %xmm3
ucomisd 0x30(%rbx), %xmm3
ja 0x280a5
ucomisd %xmm2, %xmm1
jbe 0x28049
movsd %xmm2, (%rax)
movsd 0x10(%rdi), %xmm2
movsd 0x10(%rbx), %xmm1
ucomisd %xmm1, %xmm2
jbe 0x2805e
movsd %xmm1, 0x10(%rdi)
movsd 0x18(%rdi), %xmm2
movsd 0x18(%rbx), %xmm1
ucomisd %xmm1, %xmm2
jbe 0x28073
movsd %xmm1, 0x18(%rdi)
movsd 0x20(%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x28083
movsd %xmm1, (%r14)
movsd 0x28(%rbx), %xmm0
ucomisd 0x28(%rdi), %xmm0
jbe 0x28094
movsd %xmm0, 0x28(%rdi)
movsd 0x30(%rbx), %xmm0
ucomisd 0x30(%rdi), %xmm0
jbe 0x280a5
movsd %xmm0, 0x30(%rdi)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x3cd94
addq $0x20, %rbx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3cd94
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Affine.cpp
// Function: gaps::R3Affine::InverseMatrix() const
const R4Matrix& R3Affine::
InverseMatrix(void) const
{
    // Update inverse matrix 
    if (!flags[R3_AFFINE_INVERSE_UPTODATE_FLAG]) {
        // Update inverse matrix
        R3Affine *affine = (R3Affine *) this;
	affine->inverse = matrix.Inverse();
	affine->flags.Add(R3_AFFINE_INVERSE_UPTODATE_FLAG);
    }

    // Return inverse matrix
    return inverse;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
testb $0x2, 0x108(%rdi)
jne 0x2a2d7
leaq 0x8(%rbx), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x2cde6
leaq 0x88(%rbx), %rdi
movq %r14, %rsi
callq 0x2e19e
orb $0x2, 0x108(%rbx)
addq $0x88, %rbx
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Affine.cpp
// Function: gaps::R3Affine::InverseTransform(gaps::R3Affine const&)
void R3Affine::
InverseTransform(const R3Affine& affine) 
{
    // Transform affine transformation
    matrix = matrix * affine.InverseMatrix();
    if (affine.HasMirror()) Mirror();
    InvalidateInverse();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
movq %rsi, %rdi
callq 0x2a29a
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2e5ab
movq %r15, %rdi
movq %r12, %rsi
callq 0x2e19e
testb $0x1, 0x108(%r14)
je 0x2a523
xorb $0x1, 0x108(%rbx)
andb $-0x3, 0x108(%rbx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Affine.cpp
// Function: gaps::R3Affine::ApplyInverseTranspose(gaps::R3Vector&) const
void R3Affine::
ApplyInverseTranspose (R3Vector& vector) const
{
    // Transform (normal) vector by inverse transpose
    const R4Matrix& m = InverseMatrix();
    RNCoord x = m[0][0] * vector.X() + m[1][0] * vector.Y() + m[2][0] * vector.Z();
    RNCoord y = m[0][1] * vector.X() + m[1][1] * vector.Y() + m[2][1] * vector.Z();
    RNCoord z = m[0][2] * vector.X() + m[1][2] * vector.Y() + m[2][2] * vector.Z();
    vector = R3Vector(x, y, z);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
callq 0x2a29a
movsd (%rbx), %xmm3
movsd 0x8(%rbx), %xmm4
movsd 0x20(%rax), %xmm0
mulsd %xmm4, %xmm0
movsd (%rax), %xmm1
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rbx), %xmm2
movsd 0x40(%rax), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x28(%rax), %xmm1
mulsd %xmm4, %xmm1
movsd 0x8(%rax), %xmm5
mulsd %xmm3, %xmm5
addsd %xmm1, %xmm5
movsd 0x48(%rax), %xmm1
mulsd %xmm2, %xmm1
addsd %xmm5, %xmm1
mulsd 0x30(%rax), %xmm4
mulsd 0x10(%rax), %xmm3
addsd %xmm4, %xmm3
mulsd 0x50(%rax), %xmm2
addsd %xmm3, %xmm2
movq %rsp, %r14
movq %r14, %rdi
callq 0x3d4be
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3dc6a
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Affine.cpp
// Function: gaps::R3Affine::ApplyTranspose(gaps::R3Vector&) const
void R3Affine::
ApplyTranspose (R3Vector& vector) const
{
    // Transform (normal) vector by inverse transpose
    const R4Matrix& m = Matrix();
    RNCoord x = m[0][0] * vector.X() + m[1][0] * vector.Y() + m[2][0] * vector.Z();
    RNCoord y = m[0][1] * vector.X() + m[1][1] * vector.Y() + m[2][1] * vector.Z();
    RNCoord z = m[0][2] * vector.X() + m[1][2] * vector.Y() + m[2][2] * vector.Z();
    vector = R3Vector(x, y, z);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movsd (%rsi), %xmm3
movsd 0x8(%rsi), %xmm4
movsd 0x28(%rdi), %xmm0
mulsd %xmm4, %xmm0
movsd 0x8(%rdi), %xmm1
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rsi), %xmm2
movsd 0x48(%rdi), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x30(%rdi), %xmm1
mulsd %xmm4, %xmm1
movsd 0x10(%rdi), %xmm5
mulsd %xmm3, %xmm5
addsd %xmm1, %xmm5
movsd 0x50(%rdi), %xmm1
mulsd %xmm2, %xmm1
addsd %xmm5, %xmm1
mulsd 0x38(%rdi), %xmm4
mulsd 0x18(%rdi), %xmm3
addsd %xmm4, %xmm3
mulsd 0x58(%rdi), %xmm2
addsd %xmm3, %xmm2
movq %rsp, %r14
movq %r14, %rdi
callq 0x3d4be
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3dc6a
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Affine.cpp
// Function: gaps::R3Affine::Mirror(gaps::R3Plane const&)
void R3Affine::
Mirror(const R3Plane& plane)
{
  // Compute translation
  R3Vector translation = plane.D() * plane.Normal();

  // Compute dimension to rotate to and reflect across
  RNDimension dim = plane.Normal().MinDimension();
  R3Vector target_vector = R3xyz_triad[dim];

  // Compute rotation axis
  R3Vector rotation_axis = plane.Normal() % target_vector;
  RNLength rotation_axis_length = rotation_axis.Length();
  if (RNIsZero(rotation_axis_length)) return;
  rotation_axis /= rotation_axis_length;

  // Compute rotation angle
  RNAngle rotation_angle = R3InteriorAngle(plane.Normal(), target_vector);
  
  // Transform
  Translate(-translation);
  Rotate(rotation_axis, -rotation_angle);
  Mirror(dim);
  Rotate(rotation_axis, rotation_angle);
  Translate(translation);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movsd 0x18(%rsi), %xmm0
leaq 0x48(%rsp), %rdi
callq 0x3de8e
movq %r14, %rdi
callq 0x3d616
movl %eax, %ebp
cltq
leaq (%rax,%rax,2), %rsi
shlq $0x3, %rsi
addq 0xba864(%rip), %rsi     # 0xe4fb0
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x3d4ce
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3de12
movq %r12, %rdi
callq 0x3d5c4
leaq 0xbb41d(%rip), %rax     # 0xe5b98
movsd (%rax), %xmm1
movapd 0x77899(%rip), %xmm2    # 0xa2020
xorpd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jb 0x2a79b
ucomisd %xmm0, %xmm1
jae 0x2a844
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x3e0ec
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x4c77b
movapd %xmm0, (%rsp)
leaq 0x60(%rsp), %r13
leaq 0x48(%rsp), %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x3e154
leaq 0x8(%rbx), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x2d6f4
andb $-0x3, 0x108(%rbx)
movaps 0x77834(%rip), %xmm0    # 0xa2020
xorps (%rsp), %xmm0
movq %r12, %rdi
movq %r15, %rsi
callq 0x2dd1e
andb $-0x3, 0x108(%rbx)
movsd 0x7783e(%rip), %xmm0    # 0xa2048
movq %r12, %rdi
movl %ebp, %esi
callq 0x2d812
xorb $0x1, 0x108(%rbx)
movq %r12, %rdi
movq %r15, %rsi
movapd (%rsp), %xmm0
callq 0x2dd1e
andb $-0x3, 0x108(%rbx)
movq %r12, %rdi
movq %r14, %rsi
callq 0x2d6f4
andb $-0x3, 0x108(%rbx)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop