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

  // Write file
  if (!WritePlyStream(fp, binary)) return 0;
  
  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movl %edx, 0x1c(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x1002db(%rip), %rsi    # 0x1342f3
callq 0xf5e0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x34047
movq 0x20(%rsp), %rsi
leaq 0xff5a6(%rip), %rdi     # 0x1335dc
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x34(%rsp)
jmp 0x3407f
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl 0x1c(%rsp), %edx
movq (%rdi), %rax
callq *0x218(%rax)
cmpl $0x0, %eax
jne 0x3406d
movl $0x0, 0x34(%rsp)
jmp 0x3407f
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/R3Shapes/R3Mesh.cpp
// Function: gaps::WriteIfsString(_IO_FILE*, char const*)
static int 
WriteIfsString(FILE *fp, const char *buffer)
{
  // Write length
  unsigned int length = strlen(buffer) + 1;
  if (fwrite(&length, sizeof(unsigned int), 1, fp) != 1) {
    RNFail("Unable to write string length");
    return -1;
  }

  // Write characters
  if (fwrite(buffer, sizeof(unsigned char), length, fp) != length) {
    RNFail("Unable to write string characters");
    return -1;
  }

  // Return length of string
  return length;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0xf200
addq $0x1, %rax
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rcx
leaq 0xc(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0xf980
cmpq $0x1, %rax
je 0x35547
leaq 0xfe66b(%rip), %rdi     # 0x133ba1
movb $0x0, %al
callq 0xd4f30
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x3558a
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %eax
movl %eax, %edx
movq 0x18(%rsp), %rcx
movl $0x1, %esi
callq 0xf980
movl 0xc(%rsp), %ecx
cmpq %rcx, %rax
je 0x35582
leaq 0xfe64e(%rip), %rdi     # 0x133bbf
movb $0x0, %al
callq 0xd4f30
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x3558a
movl 0xc(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
addq $0x30, %rdi
leaq 0x543d28(%rip), %rsi    # 0x5795a0
callq 0x70970
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x38(%rsp), %rdi
addq $0x8, %rdi
callq 0x13600
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jge 0x35949
movq 0x38(%rsp), %rdi
addq $0x8, %rdi
movl 0x34(%rsp), %esi
callq 0x372f0
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
cmpq 0x38(%rsp), %rax
jne 0x35905
movq 0x28(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x35903
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0x13840
movq %rax, %rsi
movq 0x38(%rsp), %rdi
addq $0x30, %rdi
callq 0x70be0
jmp 0x35937
movq 0x28(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x35935
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rsi
callq 0x13840
movq %rax, %rsi
movq 0x38(%rsp), %rdi
addq $0x30, %rdi
callq 0x70be0
jmp 0x35937
jmp 0x35939
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x35885
movq 0x38(%rsp), %rdi
addq $0x30, %rdi
callq 0x70410
movq 0x38(%rsp), %rax
addq $0x78, %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x2, %esi
callq 0x13d80
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x37560
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rsi
addq $0x18, %rsi
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rdx
addq $0x18, %rdx
leaq 0x40(%rsp), %rdi
callq 0x6eeb0
movq 0x58(%rsp), %rax
movq 0x18(%rax), %rsi
addq $0x18, %rsi
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rdx
addq $0x18, %rdx
leaq 0x28(%rsp), %rdi
callq 0x6eeb0
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x70af0
leaq 0x10(%rsp), %rdi
callq 0x6fe90
movaps %xmm0, %xmm1
movsd 0xfd591(%rip), %xmm0    # 0x133010
mulsd %xmm1, %xmm0
movq 0x58(%rsp), %rax
movsd %xmm0, 0x90(%rax)
movq 0x58(%rsp), %rax
addq $0xa8, %rax
movq %rax, (%rsp)
leaq 0x8(%rsp), %rdi
movl $0x2, %esi
callq 0x13d80
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x37560
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
addq $0x58, %rdi
leaq 0x142c6a(%rip), %rsi    # 0x1787e8
callq 0x37500
movq 0x18(%rsp), %rdi
addq $0x58, %rdi
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rsi
addq $0x18, %rsi
callq 0x444b0
movq 0x18(%rsp), %rdi
addq $0x58, %rdi
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rsi
addq $0x18, %rsi
callq 0x444b0
movq 0x18(%rsp), %rdi
addq $0x58, %rdi
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rsi
addq $0x18, %rsi
callq 0x444b0
movq 0x18(%rsp), %rax
addq $0xa8, %rax
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movl $0x8, %esi
callq 0x13d80
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x37560
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x13660
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x86c40
movsd %xmm0, 0x8(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x35e8f
movq 0x18(%rsp), %rax
movl $0x1, (%rax)
movq 0x28(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0x18(%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdi
addq $0x20, %rdi
callq 0x6f1e0
movsd 0x8(%rsp), %xmm0
movq 0x18(%rsp), %rax
movsd %xmm0, 0x38(%rax)
movsd 0x8(%rsp), %xmm0
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/./R3Mesh.h
// Function: gaps::R3Mesh::VertexAcrossFace(gaps::R3MeshFace const*, gaps::R3MeshEdge const*) const
inline R3MeshVertex *R3Mesh:: 
VertexAcrossFace(const R3MeshFace *f, const R3MeshEdge *e) const
{
  // Returns the vertex across a triangle from an edge (the edge is the base and the vertex is the apex)
  assert(IsEdgeOnFace(e, f));
  if (!IsVertexOnEdge(f->vertex[0], e)) return f->vertex[0];
  if (!IsVertexOnEdge(f->vertex[1], e)) return f->vertex[1];
  if (!IsVertexOnEdge(f->vertex[2], e)) return f->vertex[2];
  return NULL;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x8(%rsp), %rdx
callq 0x37330
cmpl $0x0, %eax
jne 0x370b4
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x37115
movq (%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x8(%rsp), %rdx
callq 0x37330
cmpl $0x0, %eax
jne 0x370e0
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x37115
movq (%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x8(%rsp), %rdx
callq 0x37330
cmpl $0x0, %eax
jne 0x3710c
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x37115
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/./R3Mesh.h
// Function: gaps::R3Mesh::EdgeOnFace(gaps::R3MeshFace const*, gaps::R3MeshVertex const*, int) const
inline R3MeshEdge *R3Mesh:: 
EdgeOnFace(const R3MeshFace *f, const R3MeshVertex *v, RNDirection dir) const
{
  // Returns edge on face in dir with respect to vertex
  if (f->vertex[0] == v) {
    if (dir == RN_CCW) return f->edge[0];
    else return f->edge[2];
  }
  else if (f->vertex[1] == v) {
    if (dir == RN_CCW) return f->edge[1];
    else return f->edge[0];
  }
  else if (f->vertex[2] == v) {
    if (dir == RN_CCW) return f->edge[2];
    else return f->edge[1];
  }
  else {
    // Vertex not found
    return NULL;
  }
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq %rdx, -0x20(%rsp)
movl %ecx, -0x24(%rsp)
movq -0x18(%rsp), %rax
movq 0x8(%rax), %rax
cmpq -0x20(%rsp), %rax
jne 0x37aad
cmpl $0x0, -0x24(%rsp)
jne 0x37a9d
movq -0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x37b24
movq -0x18(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x37b24
movq -0x18(%rsp), %rax
movq 0x10(%rax), %rax
cmpq -0x20(%rsp), %rax
jne 0x37ae4
cmpl $0x0, -0x24(%rsp)
jne 0x37ad4
movq -0x18(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x37b24
movq -0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x37b24
movq -0x18(%rsp), %rax
movq 0x18(%rax), %rax
cmpq -0x20(%rsp), %rax
jne 0x37b1b
cmpl $0x0, -0x24(%rsp)
jne 0x37b0b
movq -0x18(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x37b24
movq -0x18(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x37b24
movq $0x0, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopw (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x8(%rax)
jne 0x37e87
movq $0x0, 0x20(%rsp)
jmp 0x37f61
movq 0x8(%rsp), %rax
movq (%rax), %rcx
movq (%rcx), %rcx
movq %rcx, 0x10(%rsp)
cmpl $0x0, 0x14(%rax)
jl 0x37eb4
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq (%rax), %rax
movslq 0x14(%rcx), %rcx
movq $0x0, (%rax,%rcx)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x37edc
movq 0x8(%rsp), %rcx
movq 0x20(%rcx), %rax
movq (%rcx), %rdx
movq (%rdx), %rdi
movq 0x28(%rcx), %rsi
callq *%rax
movq $0x0, (%rax)
movq 0x8(%rsp), %rax
movq (%rax), %rcx
movl 0x8(%rax), %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rdx
movq (%rax), %rcx
movq %rdx, (%rcx)
cmpl $0x0, 0x14(%rax)
jl 0x37f13
movq 0x8(%rsp), %rcx
movq (%rcx), %rdx
movq (%rcx), %rax
movq (%rax), %rax
movslq 0x14(%rcx), %rcx
movq %rdx, (%rax,%rcx)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x37f42
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq %rax, (%rsp)
movq 0x20(%rcx), %rax
movq (%rcx), %rdx
movq (%rdx), %rdi
movq 0x28(%rcx), %rsi
callq *%rax
movq (%rsp), %rcx
movq %rcx, (%rax)
movq 0x8(%rsp), %rdi
movl 0x8(%rdi), %eax
addl $-0x1, %eax
movl %eax, 0x8(%rdi)
xorl %esi, %esi
callq 0x3cb10
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x10(%rsp)
cmpl $0x0, 0x14(%rax)
jl 0x381bc
movq (%rsp), %rcx
movq 0x18(%rsp), %rax
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx), %rax
movq %rax, 0x10(%rsp)
movq (%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x381e4
movq (%rsp), %rcx
movq 0x20(%rcx), %rax
movq 0x18(%rsp), %rdi
movq 0x28(%rcx), %rsi
callq *%rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x3823b
movl $0x0, 0xc(%rsp)
movq (%rsp), %rcx
movl 0xc(%rsp), %eax
cmpl 0x8(%rcx), %eax
jge 0x38239
movq (%rsp), %rax
movq (%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpq 0x18(%rsp), %rax
jne 0x3822a
movq (%rsp), %rax
movq (%rax), %rax
movslq 0xc(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
jmp 0x38239
jmp 0x3822c
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x381ec
jmp 0x3823b
cmpq $0x0, 0x10(%rsp)
jne 0x38245
jmp 0x38270
movq (%rsp), %rdi
movq 0x10(%rsp), %rax
movq (%rdi), %rcx
subq %rcx, %rax
sarq $0x3, %rax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %esi
callq 0x3cb10
movq (%rsp), %rdi
movl %eax, %esi
callq 0x3c810
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/./R3Mesh.h
// Function: gaps::R3Mesh::EdgeOnFace(gaps::R3MeshFace const*, gaps::R3MeshEdge const*, int) const
inline R3MeshEdge *R3Mesh:: 
EdgeOnFace(const R3MeshFace *f, const R3MeshEdge *e, RNDirection dir) const
{
  // Return edge on face in dir with respect to edge
  if (f->edge[0] == e) {
    if (dir == RN_CCW) return f->edge[1];
    else return f->edge[2];
  }
  else if (f->edge[1] == e) {
    if (dir == RN_CCW) return f->edge[2];
    else return f->edge[0];
  }
  else if (f->edge[2] == e) {
    if (dir == RN_CCW) return f->edge[0];
    else return f->edge[1];
  }
  else {
    // Edge not found
    return NULL;
  }
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq %rdx, -0x20(%rsp)
movl %ecx, -0x24(%rsp)
movq -0x18(%rsp), %rax
movq 0x20(%rax), %rax
cmpq -0x20(%rsp), %rax
jne 0x386ed
cmpl $0x0, -0x24(%rsp)
jne 0x386dd
movq -0x18(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x38764
movq -0x18(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x38764
movq -0x18(%rsp), %rax
movq 0x28(%rax), %rax
cmpq -0x20(%rsp), %rax
jne 0x38724
cmpl $0x0, -0x24(%rsp)
jne 0x38714
movq -0x18(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x38764
movq -0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x38764
movq -0x18(%rsp), %rax
movq 0x30(%rax), %rax
cmpq -0x20(%rsp), %rax
jne 0x3875b
cmpl $0x0, -0x24(%rsp)
jne 0x3874b
movq -0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x38764
movq -0x18(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x38764
movq $0x0, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/../../pkgs/RNBasics/RNHeap.cpp
// Function: gaps::RNHeap<gaps::R3MeshGeodesicBeam*>::RNHeap(gaps::R3MeshGeodesicBeam*, double*, gaps::R3MeshGeodesicBeam***, int)
RNHeap<PtrType>::
RNHeap(PtrType base, RNScalar *value_ptr, PtrType **entry_ptr, int least_first)
  : entries(NULL),
    nentries(0),
    nallocated(0),
    value_offset(0),
    entry_offset(-1),
    value_callback(NULL),
    entry_callback(NULL),
    callback_data(NULL),
    least_first(least_first)
{
  // Check arguments
  assert(base);
  assert(value_ptr);

  // Compute offsets to data entries in struct referenced by PtrType
  if (value_ptr) value_offset = (unsigned char *) value_ptr - (unsigned char *) base;
  if (entry_ptr) entry_offset = (unsigned char *) entry_ptr - (unsigned char *) base; 

  // Check value offset
  assert(value_offset >= 0);
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq %rcx, -0x20(%rsp)
movl %r8d, -0x24(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x30(%rsp)
movq $0x0, (%rax)
movl $0x0, 0x8(%rax)
movl $0x0, 0xc(%rax)
movl $0x0, 0x10(%rax)
movl $0xffffffff, 0x14(%rax) # imm = 0xFFFFFFFF
movq $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
movq $0x0, 0x28(%rax)
movl -0x24(%rsp), %ecx
movl %ecx, 0x30(%rax)
cmpq $0x0, -0x18(%rsp)
je 0x390f2
movq -0x30(%rsp), %rax
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rdx
subq %rdx, %rcx
movl %ecx, 0x10(%rax)
cmpq $0x0, -0x20(%rsp)
je 0x3910f
movq -0x30(%rsp), %rax
movq -0x20(%rsp), %rcx
movq -0x10(%rsp), %rdx
subq %rdx, %rcx
movl %ecx, 0x14(%rax)
retq
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/./R3Mesh.h
// Function: gaps::R3Mesh::EdgeAcrossFace(gaps::R3MeshFace const*, gaps::R3MeshVertex const*) const
inline R3MeshEdge *R3Mesh:: 
EdgeAcrossFace(const R3MeshFace *f, const R3MeshVertex *v) const
{
  // Returns the edge across a triangle from a vertex (the edge is the base and the vertex is the apex)
  assert(IsVertexOnFace(v, f));
  if (!IsVertexOnEdge(v, f->edge[0]))return f->edge[0];
  if (!IsVertexOnEdge(v, f->edge[1]))return f->edge[1];
  if (!IsVertexOnEdge(v, f->edge[2]))return f->edge[2];
  return NULL;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdx
callq 0x37330
cmpl $0x0, %eax
jne 0x39c84
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x39ce5
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rdx
callq 0x37330
cmpl $0x0, %eax
jne 0x39cb0
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x39ce5
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rdx
callq 0x37330
cmpl $0x0, %eax
jne 0x39cdc
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x39ce5
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nop
// File: 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:
subq $0xa8, %rsp
movq %rdi, 0x30(%rsp)
movq %rdi, %rax
movq %rax, 0x38(%rsp)
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movl %edx, 0x94(%rsp)
movq 0x98(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x3c180
cmpl $0x0, %eax
je 0x39d48
movq 0x30(%rsp), %rdi
leaq 0x53f772(%rip), %rsi    # 0x5794b0
callq 0x6eb90
jmp 0x39f40
movq 0x40(%rsp), %rdi
callq 0x3c1b0
movq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x6eb90
movl 0x94(%rsp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x39da1
movq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x3c1d0
movq 0x40(%rsp), %rdi
movsd %xmm0, 0x28(%rsp)
xorl %esi, %esi
callq 0x3c1f0
movsd 0x28(%rsp), %xmm0
movq %rax, %rsi
leaq 0x78(%rsp), %rdi
callq 0x13800
jmp 0x39de9
movq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x3c1d0
movq 0x40(%rsp), %rdi
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x20(%rsp)
xorl %esi, %esi
callq 0x3c1f0
movsd 0x20(%rsp), %xmm0
movq %rax, %rsi
leaq 0x78(%rsp), %rdi
callq 0x13800
movq 0x30(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x6f290
movl 0x94(%rsp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x39e40
movq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x3c1d0
movq 0x40(%rsp), %rdi
movsd %xmm0, 0x18(%rsp)
movl $0x1, %esi
callq 0x3c1f0
movsd 0x18(%rsp), %xmm0
movq %rax, %rsi
leaq 0x60(%rsp), %rdi
callq 0x13800
jmp 0x39e8e
movq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x3c1d0
movq 0x40(%rsp), %rdi
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x10(%rsp)
movl $0x1, %esi
callq 0x3c1f0
movsd 0x10(%rsp), %xmm0
movq %rax, %rsi
leaq 0x60(%rsp), %rdi
callq 0x13800
movq 0x30(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x6f290
movl 0x94(%rsp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x39ee5
movq 0x40(%rsp), %rdi
movl $0x2, %esi
callq 0x3c1d0
movq 0x40(%rsp), %rdi
movsd %xmm0, 0x8(%rsp)
movl $0x2, %esi
callq 0x3c1f0
movsd 0x8(%rsp), %xmm0
movq %rax, %rsi
leaq 0x48(%rsp), %rdi
callq 0x13800
jmp 0x39f31
movq 0x40(%rsp), %rdi
movl $0x2, %esi
callq 0x3c1d0
movq 0x40(%rsp), %rdi
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, (%rsp)
movl $0x2, %esi
callq 0x3c1f0
movsd (%rsp), %xmm0
movq %rax, %rsi
leaq 0x48(%rsp), %rdi
callq 0x13800
movq 0x30(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x6f290
movq 0x38(%rsp), %rax
addq $0xa8, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/../../pkgs/RNBasics/RNMap.cpp
// Function: gaps::RNMap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>::Find(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int*) const
RNBoolean RNMap<KeyType, ValueType>::
Find(KeyType key, ValueType *value) const
{
    // Return value associated with key, or NULL if not found
    typename std::map<KeyType, ValueType, RNMapComparator<KeyType> >::iterator it = m->find(key);
    if (it == m->end()) return FALSE;
    if (value) *value = it->second;
    return TRUE;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
movq (%rax), %rdi
callq 0x3ff70
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rsp)
movq (%rax), %rdi
callq 0x3ffc0
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3ffa0
testb $0x1, %al
jne 0x3a1f2
jmp 0x3a1fc
movl $0x0, 0x34(%rsp)
jmp 0x3a220
cmpq $0x0, 0x18(%rsp)
je 0x3a218
leaq 0x10(%rsp), %rdi
callq 0x3fff0
movl 0x20(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x48, %rsp
movq %rsi, 0x40(%rsp)
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x30(%rsp), %rdi
movl $0x2, %esi
callq 0x13d80
movq 0x30(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0x3a56a
movq 0x8(%rsp), %rdi
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rsi
movq (%rdi), %rax
callq *0x138(%rax)
jmp 0x3a5cb
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x13d80
movq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0x3a5ac
movq 0x8(%rsp), %rdi
movq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rsi
movq (%rdi), %rax
callq *0x130(%rax)
jmp 0x3a5c9
movq 0x8(%rsp), %rdi
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
callq *0x128(%rax)
jmp 0x3a5cb
addq $0x48, %rsp
retq
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
cmpl $0x0, 0xc(%rsp)
jle 0x3b9dd
movq (%rsp), %rdi
movl 0xc(%rsp), %eax
subl $0x1, %eax
sarl %eax
movl %eax, 0x8(%rsp)
movl 0xc(%rsp), %esi
movl 0x8(%rsp), %edx
callq 0x3b9f0
cmpl $0x0, %eax
jl 0x3b9c2
jmp 0x3b9dd
movq (%rsp), %rdi
movl 0xc(%rsp), %esi
movl 0x8(%rsp), %edx
callq 0x3bac0
movl 0x8(%rsp), %eax
movl %eax, 0xc(%rsp)
jmp 0x3b996
movl 0xc(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movl %edx, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movl 0x24(%rsp), %esi
callq 0x3bbf0
movq 0x8(%rsp), %rdi
movsd %xmm0, 0x18(%rsp)
movl 0x20(%rsp), %esi
callq 0x3bbf0
movq 0x8(%rsp), %rax
movsd %xmm0, 0x10(%rsp)
cmpl $0x0, 0x30(%rax)
je 0x3ba77
movsd 0x18(%rsp), %xmm1
movsd 0x10(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x3ba55
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x3bab3
movsd 0x18(%rsp), %xmm0
ucomisd 0x10(%rsp), %xmm0
jbe 0x3ba6d
movl $0x1, 0x34(%rsp)
jmp 0x3bab3
movl $0x0, 0x34(%rsp)
jmp 0x3bab3
movsd 0x18(%rsp), %xmm0
ucomisd 0x10(%rsp), %xmm0
jbe 0x3ba8f
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x3bab3
movsd 0x18(%rsp), %xmm1
movsd 0x10(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x3baab
movl $0x1, 0x34(%rsp)
jmp 0x3bab3
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movl %edx, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq (%rax), %rcx
movslq 0x2c(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rcx, 0x20(%rsp)
movq (%rax), %rcx
movslq 0x28(%rsp), %rdx
movq (%rcx,%rdx,8), %rsi
movq (%rax), %rcx
movslq 0x2c(%rsp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x20(%rsp), %rsi
movq (%rax), %rcx
movslq 0x28(%rsp), %rdx
movq %rsi, (%rcx,%rdx,8)
cmpl $0x0, 0x14(%rax)
jl 0x3bb66
movq 0x18(%rsp), %rcx
movq (%rcx), %rsi
movslq 0x2c(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq (%rcx), %rax
movslq 0x2c(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movslq 0x14(%rcx), %rdx
movq %rsi, (%rax,%rdx)
movq (%rcx), %rdx
movslq 0x28(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq (%rcx), %rax
movslq 0x28(%rsp), %rsi
movq (%rax,%rsi,8), %rax
movslq 0x14(%rcx), %rcx
movq %rdx, (%rax,%rcx)
movq 0x18(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x3bbe0
movq 0x18(%rsp), %rcx
movq (%rcx), %rax
movslq 0x2c(%rsp), %rdx
shlq $0x3, %rdx
addq %rdx, %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rcx), %rax
movq (%rcx), %rdx
movslq 0x2c(%rsp), %rsi
movq (%rdx,%rsi,8), %rdi
movq 0x28(%rcx), %rsi
callq *%rax
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %rdx, (%rax)
movq (%rcx), %rax
movslq 0x28(%rsp), %rdx
shlq $0x3, %rdx
addq %rdx, %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rcx), %rax
movq (%rcx), %rdx
movslq 0x28(%rsp), %rsi
movq (%rdx,%rsi,8), %rdi
movq 0x28(%rcx), %rsi
callq *%rax
movq 0x10(%rsp), %rcx
movq %rcx, (%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x10(%rax)
jl 0x3bc2f
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movslq 0x14(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movslq 0x10(%rcx), %rcx
movsd (%rax,%rcx), %xmm0
movsd %xmm0, 0x20(%rsp)
jmp 0x3bc75
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x3bc5e
movq 0x8(%rsp), %rcx
movq 0x18(%rcx), %rax
movq (%rcx), %rdx
movslq 0x14(%rsp), %rsi
movq (%rdx,%rsi,8), %rdi
movq 0x28(%rcx), %rsi
callq *%rax
movsd %xmm0, 0x20(%rsp)
jmp 0x3bc75
leaq 0xf7edc(%rip), %rdi     # 0x133b41
movb $0x0, %al
callq 0xd4e20
xorps %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
addq $0x28, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/./R3OrientedBox.h
// Function: gaps::R3OrientedBox::MinRadius() const
inline const RNLength R3OrientedBox::
MinRadius(void) const
{
    // Return smallest radius
    RNLength result = Radius(0);
    if (Radius(1) < result) result = Radius(1);
    if (Radius(2) < result) result = Radius(2);
    return result;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
xorl %esi, %esi
callq 0x3c1d0
movq (%rsp), %rdi
movsd %xmm0, 0x8(%rsp)
movl $0x1, %esi
callq 0x3c1d0
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x3c270
movq (%rsp), %rdi
movl $0x1, %esi
callq 0x3c1d0
movsd %xmm0, 0x8(%rsp)
movq (%rsp), %rdi
movl $0x2, %esi
callq 0x3c1d0
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x3c2a1
movq (%rsp), %rdi
movl $0x2, %esi
callq 0x3c1d0
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/../../pkgs/RNBasics/RNHeap.cpp
// Function: gaps::RNHeap<gaps::DijkstraData*>::Truncate(int, int)
void RNHeap<PtrType>::
Truncate(int n, RNBoolean sort)
{
  // Check nentries
  if (nentries <= n) return;

  // Sort the entries
  if (n > 0) {
    // Sort recursively
    if (sort) Sort(n, 0, nentries - 1);

    // Update entry back pointers 
    if (entry_offset || entry_callback) {
      for (int i = 0; i < n; i++) {
        if (entry_offset >= 0) *((PtrType **) ((unsigned char *) entries[i] + entry_offset)) = &entries[i];
        if (entry_callback) *((PtrType **) (*entry_callback)(entries[i], callback_data)) = &entries[i];
      }
    }
  }

  // Keep only the n best entries
  nentries = n;
}

// 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 0x8(%rax), %eax
cmpl 0x1c(%rsp), %eax
jg 0x3f319
jmp 0x3f408
cmpl $0x0, 0x1c(%rsp)
jle 0x3f3fc
cmpl $0x0, 0x18(%rsp)
je 0x3f341
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x8(%rdi), %ecx
subl $0x1, %ecx
xorl %edx, %edx
callq 0x3f410
movq 0x8(%rsp), %rax
cmpl $0x0, 0x14(%rax)
jne 0x3f35c
movq 0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x3f3fa
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jge 0x3f3f8
movq 0x8(%rsp), %rax
cmpl $0x0, 0x14(%rax)
jl 0x3f3a5
movq 0x8(%rsp), %rcx
movq (%rcx), %rdx
movslq 0x14(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq (%rcx), %rax
movslq 0x14(%rsp), %rsi
movq (%rax,%rsi,8), %rax
movslq 0x14(%rcx), %rcx
movq %rdx, (%rax,%rcx)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x3f3e6
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movslq 0x14(%rsp), %rdx
shlq $0x3, %rdx
addq %rdx, %rax
movq %rax, (%rsp)
movq 0x20(%rcx), %rax
movq (%rcx), %rdx
movslq 0x14(%rsp), %rsi
movq (%rdx,%rsi,8), %rdi
movq 0x28(%rcx), %rsi
callq *%rax
movq (%rsp), %rcx
movq %rcx, (%rax)
jmp 0x3f3e8
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x3f364
jmp 0x3f3fa
jmp 0x3f3fc
movq 0x8(%rsp), %rax
movl 0x1c(%rsp), %ecx
movl %ecx, 0x8(%rax)
addq $0x28, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/../../pkgs/RNBasics/RNHeap.cpp
// Function: gaps::RNHeap<gaps::DijkstraData*>::Sort(int, int, int)
void RNHeap<PtrType>::
Sort(int n, int left, int right)
{
  // Check left and right
  if (left >= right) return;
  if (left >= n) return;

  // Split array based on pivot
  RNScalar pivot_value = Value((left + right) / 2);
  int left_index = left;
  int right_index = right;
  while (left_index < right_index) {
    while ((Value(left_index) <= pivot_value) && (left_index < right_index)) left_index++;
    if (left_index == right_index) break;
    while ((Value(right_index) >= pivot_value) && (left_index < right_index)) right_index--;
    Swap(left_index, right_index);
  }

  // Sort parts recursively
  int pivot_index = left_index;
  Sort(n, left, pivot_index-1);
  Sort(n, pivot_index+1, right);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movl %edx, 0x38(%rsp)
movl %ecx, 0x34(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x38(%rsp), %eax
cmpl 0x34(%rsp), %eax
jl 0x3f43e
jmp 0x3f579
movl 0x38(%rsp), %eax
cmpl 0x3c(%rsp), %eax
jl 0x3f44d
jmp 0x3f579
movq 0x10(%rsp), %rdi
movl 0x38(%rsp), %eax
addl 0x34(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %esi
callq 0x3efd0
movsd %xmm0, 0x28(%rsp)
movl 0x38(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x20(%rsp), %eax
jge 0x3f53f
jmp 0x3f48f
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x3efd0
movaps %xmm0, %xmm1
movsd 0x28(%rsp), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, 0xf(%rsp)
jb 0x3f4c1
movl 0x24(%rsp), %eax
cmpl 0x20(%rsp), %eax
setl %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x3f4cb
jmp 0x3f4d8
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x3f48f
movl 0x24(%rsp), %eax
cmpl 0x20(%rsp), %eax
jne 0x3f4e4
jmp 0x3f53f
jmp 0x3f4e6
movq 0x10(%rsp), %rdi
movl 0x20(%rsp), %esi
callq 0x3efd0
xorl %eax, %eax
ucomisd 0x28(%rsp), %xmm0
movb %al, 0xe(%rsp)
jb 0x3f511
movl 0x24(%rsp), %eax
cmpl 0x20(%rsp), %eax
setl %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0x3f51b
jmp 0x3f528
movl 0x20(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x3f4e6
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %esi
movl 0x20(%rsp), %edx
callq 0x3eea0
jmp 0x3f47f
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x3c(%rsp), %esi
movl 0x38(%rsp), %edx
movl 0x1c(%rsp), %ecx
subl $0x1, %ecx
callq 0x3f410
movq 0x10(%rsp), %rdi
movl 0x3c(%rsp), %esi
movl 0x1c(%rsp), %edx
addl $0x1, %edx
movl 0x34(%rsp), %ecx
callq 0x3f410
addq $0x48, %rsp
retq
nop
// File: 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:
subq $0x98, %rsp
movq %rdi, 0x18(%rsp)
movq %rdi, %rax
movq %rax, 0x20(%rsp)
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x28(%rsp)
xorps %xmm0, %xmm0
ucomisd 0x20(%rax), %xmm0
jb 0x4227b
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq $0x8, %rsi
callq 0x6eb90
jmp 0x4232c
movq 0x28(%rsp), %rdi
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
callq 0x42710
movq 0x10(%rsp), %rsi
movq %rax, %rdx
leaq 0x68(%rsp), %rdi
callq 0x6eeb0
leaq 0x68(%rsp), %rdi
callq 0x6fe90
movq 0x28(%rsp), %rax
movsd %xmm0, 0x60(%rsp)
movsd 0x60(%rsp), %xmm1
movsd 0x20(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x422de
movq 0x18(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x6eb90
jmp 0x4232c
movq 0x28(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x8(%rsp)
movsd 0x20(%rax), %xmm0
leaq 0x30(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x13800
movsd 0x60(%rsp), %xmm0
leaq 0x48(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x711f0
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x6f110
movq 0x20(%rsp), %rax
addq $0x98, %rsp
retq
nopl (%rax)
// File: 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:
subq $0xa8, %rsp
movq %rdi, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x30(%rsp)
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x38(%rsp)
xorps %xmm0, %xmm0
ucomisd 0x20(%rax), %xmm0
jb 0x4239b
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rsi
addq $0x8, %rsi
callq 0x6eb90
jmp 0x4249f
movq 0x38(%rsp), %rdi
movq 0x90(%rsp), %rax
movq %rax, 0x20(%rsp)
callq 0x42710
movq 0x20(%rsp), %rsi
movq %rax, %rdx
leaq 0x78(%rsp), %rdi
callq 0x6eeb0
leaq 0x78(%rsp), %rdi
callq 0x6fe90
movsd %xmm0, 0x70(%rsp)
movsd 0x70(%rsp), %xmm0
leaq 0x1360ff(%rip), %rax    # 0x1784e0
movsd (%rax), %xmm1
callq 0x36b80
cmpl $0x0, %eax
je 0x42451
movq 0x38(%rsp), %rdi
addq $0x8, %rdi
xorl %esi, %esi
callq 0x13af0
movq 0x38(%rsp), %rdi
addsd 0x20(%rdi), %xmm0
movsd %xmm0, 0x18(%rsp)
addq $0x8, %rdi
movl $0x1, %esi
callq 0x13af0
movq 0x38(%rsp), %rdi
movsd %xmm0, 0x10(%rsp)
addq $0x8, %rdi
movl $0x2, %esi
callq 0x13af0
movq 0x28(%rsp), %rdi
movsd 0x10(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x18(%rsp), %xmm0
callq 0x6eb50
jmp 0x4249f
movq 0x38(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x8(%rsp)
movsd 0x20(%rax), %xmm0
leaq 0x40(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x13800
movsd 0x70(%rsp), %xmm0
leaq 0x58(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x711f0
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x6fab0
movq 0x30(%rsp), %rax
addq $0xa8, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Box.cpp
// Function: gaps::R3Box::NDimensions() const
const int R3Box::
NDimensions (void) const
{
    // Return number of non-zero dimensions in box
    int ndimensions = 0;
    if (minpt.X() > maxpt.X()) return -1;
    if (minpt.X() < maxpt.X()) ndimensions++;
    if (minpt.Y() > maxpt.Y()) return -1;
    if (minpt.Y() < maxpt.Y()) ndimensions++;
    if (minpt.Z() > maxpt.Z()) return -1;
    if (minpt.Z() < maxpt.Z()) ndimensions++;
    return ndimensions;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq 0x48(%rsp), %rdi
movq %rdi, 0x30(%rsp)
movl $0x0, 0x44(%rsp)
addq $0x8, %rdi
callq 0x37820
movq 0x30(%rsp), %rdi
movsd %xmm0, 0x38(%rsp)
addq $0x20, %rdi
callq 0x37820
movaps %xmm0, %xmm1
movsd 0x38(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x42bc4
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x42cf0
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
callq 0x37820
movq 0x30(%rsp), %rdi
movsd %xmm0, 0x28(%rsp)
addq $0x20, %rdi
callq 0x37820
movsd 0x28(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x42bfd
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
callq 0x37870
movq 0x30(%rsp), %rdi
movsd %xmm0, 0x20(%rsp)
addq $0x20, %rdi
callq 0x37870
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x42c3b
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x42cf0
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
callq 0x37870
movq 0x30(%rsp), %rdi
movsd %xmm0, 0x18(%rsp)
addq $0x20, %rdi
callq 0x37870
movsd 0x18(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x42c74
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
callq 0x378c0
movq 0x30(%rsp), %rdi
movsd %xmm0, 0x10(%rsp)
addq $0x20, %rdi
callq 0x378c0
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x42caf
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x42cf0
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
callq 0x378c0
movq 0x30(%rsp), %rdi
movsd %xmm0, 0x8(%rsp)
addq $0x20, %rdi
callq 0x378c0
movsd 0x8(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x42ce8
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Box.cpp
// Function: gaps::R3Box::IsFinite() const
const RNBoolean R3Box::
IsFinite (void) const
{
    // Return whether bounding box contains a finite amount of space
    return ((!IsEmpty()) && 
	    (RNIsFinite(minpt.X()) && RNIsFinite(minpt.Y()) && RNIsFinite(minpt.Z())) && 
	    (RNIsFinite(maxpt.X()) && RNIsFinite(maxpt.Y()) && RNIsFinite(maxpt.Z())));
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x44d80
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x1f(%rsp)
jne 0x42e26
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
callq 0x37820
callq 0x44e40
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x1f(%rsp)
je 0x42e26
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
callq 0x37870
callq 0x44e40
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x1f(%rsp)
je 0x42e26
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
callq 0x378c0
callq 0x44e40
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x1f(%rsp)
je 0x42e26
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
callq 0x37820
callq 0x44e40
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xf(%rsp)
je 0x42e1e
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
callq 0x37870
callq 0x44e40
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xf(%rsp)
je 0x42e1e
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
callq 0x378c0
callq 0x44e40
cmpl $0x0, %eax
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x68, %rsp
movq %rdi, (%rsp)
movq %rdi, %rax
movq %rax, 0x8(%rsp)
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movl %edx, 0x54(%rsp)
movl %ecx, 0x50(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x50(%rsp), %esi
leaq 0x135951(%rip), %rdi    # 0x178b08
callq 0x39fb0
movq %rax, %rsi
leaq 0x38(%rsp), %rdi
callq 0x6fcf0
movq 0x10(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x44f00
movq %rax, %rdi
movl 0x50(%rsp), %esi
callq 0x13af0
movsd %xmm0, 0x30(%rsp)
cmpl $0x0, 0x54(%rsp)
jne 0x43215
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x70fa0
movq (%rsp), %rdi
movsd 0x30(%rsp), %xmm0
leaq 0x18(%rsp), %rsi
callq 0x6c220
jmp 0x43240
movq (%rsp), %rdi
movsd 0x30(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
leaq 0x38(%rsp), %rsi
callq 0x6c220
movq 0x8(%rsp), %rax
addq $0x68, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x68, %rsp
movq %rdi, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x20(%rsp)
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movl %edx, 0x54(%rsp)
movl %ecx, 0x50(%rsp)
movq 0x58(%rsp), %rsi
movb $0x0, 0x4f(%rsp)
callq 0x428c0
movq 0x28(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x44f40
movq %rax, 0x30(%rsp)
jmp 0x43297
movq 0x30(%rsp), %rdi
movl 0x50(%rsp), %esi
callq 0x36be0
movq %rax, 0x18(%rsp)
jmp 0x432ac
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movl 0x54(%rsp), %eax
movl $0x1, %esi
subl %eax, %esi
callq 0x44f40
movq %rax, 0x10(%rsp)
jmp 0x432d7
movq 0x10(%rsp), %rdi
movl 0x50(%rsp), %esi
callq 0x36be0
movq %rax, (%rsp)
jmp 0x432eb
movq (%rsp), %rax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movb $0x1, 0x4f(%rsp)
testb $0x1, 0x4f(%rsp)
jne 0x4332b
jmp 0x43321
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
callq 0x36a80
jmp 0x43335
movq 0x28(%rsp), %rdi
callq 0x36a80
movq 0x20(%rsp), %rax
addq $0x68, %rsp
retq
movq 0x40(%rsp), %rdi
callq 0xf890
nop
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movl %edx, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movl $0x0, 0x24(%rsp)
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, 0x20(%rsp)
movl 0x28(%rsp), %eax
addl $0x2, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, 0x1c(%rsp)
addq $0x8, %rdi
movl 0x20(%rsp), %esi
callq 0x13af0
movq 0x8(%rsp), %rdi
movsd %xmm0, 0x10(%rsp)
addq $0x20, %rdi
movl 0x20(%rsp), %esi
callq 0x13af0
movsd 0x10(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x439e5
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
movl 0x1c(%rsp), %esi
callq 0x13af0
movq 0x8(%rsp), %rdi
movsd %xmm0, (%rsp)
addq $0x20, %rdi
movl 0x1c(%rsp), %esi
callq 0x13af0
movsd (%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x43a24
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)