LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::CreateVertex(gaps::R3Point const&, gaps::R3Vector const&, gaps::R3MeshVertex*)
R3MeshVertex *R3Mesh::
CreateVertex(const R3Point& position, const R3Vector& normal, R3MeshVertex *v)
{
  // Invalidate GL buffer objects
  InvalidateGLBufferObjects();

  // Create vertex
  if (!v) {
    v = new R3MeshVertex();
    v->flags.Add(R3_MESH_VERTEX_ALLOCATED);
  }

  // Set position/normal of new vertex
  SetVertexPosition(v, position);
  if (!normal.IsZero()) SetVertexNormal(v, normal);

  // Set ID of new vertex
  v->id = vertices.NEntries();

  // Insert vertex into array
  vertices.Insert(v);

  // Return vertex
  return v;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq (%rdi), %rax
callq *0x290(%rax)
cmpq $0x0, 0x38(%rsp)
jne 0x1a5f6
movl $0x98, %edi
callq 0xf4c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
callq 0x36460
jmp 0x1a59f
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
addq $0x78, %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x13d80
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x37560
jmp 0x1a5f6
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
movl $0x98, %esi
callq 0xf4d0
jmp 0x1a662
movq 0x18(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x18060
movq 0x40(%rsp), %rdi
callq 0x375a0
cmpl $0x0, %eax
jne 0x1a62d
movq 0x18(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x37610
movq 0x18(%rsp), %rdi
addq $0x8, %rdi
callq 0x13600
movq 0x18(%rsp), %rdi
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x70(%rax)
addq $0x8, %rdi
movq 0x38(%rsp), %rsi
callq 0x37410
movq 0x38(%rsp), %rax
addq $0x58, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0xf890
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::CreateVertex(gaps::R3Point const&, gaps::R3Vector const&, gaps::RNRgb const&, gaps::R3MeshVertex*)
R3MeshVertex *R3Mesh::
CreateVertex(const R3Point& position, const R3Vector& normal, const RNRgb& color, R3MeshVertex *v)
{
  // Invalidate GL buffer objects
  InvalidateGLBufferObjects();

  // Create vertex
  if (!v) {
    v = new R3MeshVertex();
    v->flags.Add(R3_MESH_VERTEX_ALLOCATED);
  }

  // Set position/normal of new vertex
  SetVertexPosition(v, position);
  if (!normal.IsZero()) SetVertexNormal(v, normal);
  SetVertexColor(v, color);

  // Set ID of new vertex
  v->id = vertices.NEntries();

  // Insert vertex into array
  vertices.Insert(v);

  // Return vertex
  return v;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movq (%rdi), %rax
callq *0x290(%rax)
cmpq $0x0, 0x30(%rsp)
jne 0x1a71c
movl $0x98, %edi
callq 0xf4c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
callq 0x36460
jmp 0x1a6c4
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x78, %rax
movq %rax, (%rsp)
leaq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x13d80
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x37560
jmp 0x1a71c
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
movl $0x98, %esi
callq 0xf4d0
jmp 0x1a79c
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x18060
movq 0x40(%rsp), %rdi
callq 0x375a0
cmpl $0x0, %eax
jne 0x1a753
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x37610
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x37670
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
callq 0x13600
movq 0x10(%rsp), %rdi
movl %eax, %ecx
movq 0x30(%rsp), %rax
movl %ecx, 0x70(%rax)
addq $0x8, %rdi
movq 0x30(%rsp), %rsi
callq 0x37410
movq 0x30(%rsp), %rax
addq $0x58, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0xf890
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::CreateEdge(gaps::R3MeshVertex*, gaps::R3MeshVertex*, gaps::R3MeshEdge*)
R3MeshEdge *R3Mesh::
CreateEdge(R3MeshVertex *v1, R3MeshVertex *v2, R3MeshEdge *e)
{
  // Invalidate GL buffer objects
  InvalidateGLBufferObjects();

  // Create edge
  if (!e) {
    e = new R3MeshEdge();
    e->flags.Add(R3_MESH_EDGE_ALLOCATED);
  }

  // Update edge-vertex relations
  e->vertex[0] = v1;
  e->vertex[1] = v2;

  // Set ID of new edge
  e->id = edges.NEntries();

  // Insert edge into vertex lists
  v1->edges.Insert(e);
  v2->edges.Insert(e);

  // Insert edge into array
  edges.Insert(e);

  // Return edge
  return e;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq (%rdi), %rax
callq *0x290(%rax)
cmpq $0x0, 0x38(%rsp)
jne 0x1a9b6
movl $0x58, %edi
callq 0xf4c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
callq 0x365c0
jmp 0x1a95f
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
addq $0x38, %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x13d80
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x37560
jmp 0x1a9b6
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
movl $0x58, %esi
callq 0xf4d0
jmp 0x1aa2d
movq 0x18(%rsp), %rdi
movq 0x48(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x40(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x10(%rax)
addq $0x18, %rdi
callq 0x13600
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x30(%rax)
movq 0x48(%rsp), %rdi
addq $0x8, %rdi
movq 0x38(%rsp), %rsi
callq 0x376d0
movq 0x40(%rsp), %rdi
addq $0x8, %rdi
movq 0x38(%rsp), %rsi
callq 0x376d0
movq 0x18(%rsp), %rdi
addq $0x18, %rdi
movq 0x38(%rsp), %rsi
callq 0x376d0
movq 0x38(%rsp), %rax
addq $0x58, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0xf890
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::CreateFace(gaps::R3MeshVertex*, gaps::R3MeshVertex*, gaps::R3MeshVertex*, gaps::R3MeshFace*)
R3MeshFace *R3Mesh::
CreateFace(R3MeshVertex *v1, R3MeshVertex *v2, R3MeshVertex *v3, R3MeshFace *f)
{
  // Get/create edges
  R3MeshEdge *e1 = EdgeBetweenVertices(v1, v2);
  if (!e1) e1 = CreateEdge(v1, v2);
  R3MeshEdge *e2 = EdgeBetweenVertices(v2, v3);
  if (!e2) e2 = CreateEdge(v2, v3);
  R3MeshEdge *e3 = EdgeBetweenVertices(v3, v1);
  if (!e3) e3 = CreateEdge(v3, v1);
  assert(e1 && e2 && e3);

  // Create face
  return CreateFace(v1, v2, v3, e1, e2, e3, f);
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x18280
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x1aa9f
movq 0x10(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq (%rdi), %rax
xorl %ecx, %ecx
callq *0x40(%rax)
movq %rax, 0x28(%rsp)
movq 0x10(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x18280
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x1aadc
movq 0x10(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq (%rdi), %rax
xorl %ecx, %ecx
callq *0x40(%rax)
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x18280
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x1ab19
movq 0x10(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq (%rdi), %rax
xorl %ecx, %ecx
callq *0x40(%rax)
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x20(%rsp), %r9
movq 0x18(%rsp), %r11
movq 0x30(%rsp), %r10
movq (%rdi), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
callq *0x58(%rax)
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::CreateFace(gaps::R3MeshEdge*, gaps::R3MeshEdge*, gaps::R3MeshEdge*, gaps::R3MeshFace*)
R3MeshFace *R3Mesh::
CreateFace(R3MeshEdge *e1, R3MeshEdge *e2, R3MeshEdge *e3, R3MeshFace *f)
{
  // Get vertices
  R3MeshVertex *v1 = VertexBetweenEdges(e3, e1);
  R3MeshVertex *v2 = VertexBetweenEdges(e1, e2);
  R3MeshVertex *v3 = VertexBetweenEdges(e2, e3);
  assert(v1 && v2 && v3);

  // Create face
  return CreateFace(v1, v2, v3, e1, e2, e3, f);
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movq 0x38(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x18570
movq 0x10(%rsp), %rdi
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x18570
movq 0x10(%rsp), %rdi
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x18570
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x48(%rsp), %r8
movq 0x40(%rsp), %r9
movq 0x38(%rsp), %r11
movq 0x30(%rsp), %r10
movq (%rdi), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
callq *0x58(%rax)
addq $0x58, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::DeallocateVertex(gaps::R3MeshVertex*)
void R3Mesh::
DeallocateVertex(R3MeshVertex *v)
{
  // Invalidate GL buffer objects
  InvalidateGLBufferObjects();

  // Remove vertex from mesh array by moving last vertex
  assert(!vertices.IsEmpty());
  R3MeshVertex *tail = vertices.Tail();
  int index = v->id;
  RNArrayEntry *entry = vertices.KthEntry(index);
  assert(vertices.EntryContents(entry) == v);
  vertices.EntryContents(entry) = tail;
  tail->id = index;
  vertices.RemoveTail();

  // Reset ID to ease debugging
  v->id = -1;

  // Deallocate vertex
  if (v->flags[R3_MESH_VERTEX_ALLOCATED]) delete v;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq (%rdi), %rax
callq *0x290(%rax)
movq 0x18(%rsp), %rdi
addq $0x8, %rdi
callq 0x37460
movq 0x18(%rsp), %rdi
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
movl 0x70(%rax), %eax
movl %eax, 0x3c(%rsp)
addq $0x8, %rdi
movl 0x3c(%rsp), %esi
callq 0x37700
movq 0x18(%rsp), %rdi
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x8, %rdi
movq 0x30(%rsp), %rsi
callq 0x37720
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdi
movq %rcx, (%rax)
movl 0x3c(%rsp), %ecx
movq 0x40(%rsp), %rax
movl %ecx, 0x70(%rax)
addq $0x8, %rdi
callq 0x36e60
movq 0x48(%rsp), %rax
movl $0xffffffff, 0x70(%rax) # imm = 0xFFFFFFFF
movq 0x48(%rsp), %rax
addq $0x78, %rax
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0x13d80
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x13d50
cmpl $0x0, %eax
je 0x1af70
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x1af6e
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x1af70
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::DeallocateEdge(gaps::R3MeshEdge*)
void R3Mesh::
DeallocateEdge(R3MeshEdge *e)
{
  // Invalidate GL buffer objects
  InvalidateGLBufferObjects();

  // Remove edge from mesh array by moving last edge
  assert(!edges.IsEmpty());
  R3MeshEdge *tail = edges.Tail();
  int index = e->id;
  RNArrayEntry *entry = edges.KthEntry(index);
  assert(edges.EntryContents(entry) == e);
  edges.EntryContents(entry) = tail;
  tail->id = index;
  edges.RemoveTail();

  // Reset ID to ease debugging
  e->id = -1;

  // Deallocate edge
  if (e->flags[R3_MESH_EDGE_ALLOCATED]) delete e;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq (%rdi), %rax
callq *0x290(%rax)
movq 0x18(%rsp), %rdi
addq $0x18, %rdi
callq 0x37730
movq 0x18(%rsp), %rdi
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
movl 0x30(%rax), %eax
movl %eax, 0x3c(%rsp)
addq $0x18, %rdi
movl 0x3c(%rsp), %esi
callq 0x37700
movq 0x18(%rsp), %rdi
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x18, %rdi
movq 0x30(%rsp), %rsi
callq 0x37740
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdi
movq %rcx, (%rax)
movl 0x3c(%rsp), %ecx
movq 0x40(%rsp), %rax
movl %ecx, 0x30(%rax)
addq $0x18, %rdi
callq 0x36e60
movq 0x48(%rsp), %rax
movl $0xffffffff, 0x30(%rax) # imm = 0xFFFFFFFF
movq 0x48(%rsp), %rax
addq $0x38, %rax
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0x13d80
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x13d50
cmpl $0x0, %eax
je 0x1b070
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x1b06e
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x1b070
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::DeallocateFace(gaps::R3MeshFace*)
void R3Mesh::
DeallocateFace(R3MeshFace *f)
{
  // Invalidate GL buffer objects
  InvalidateGLBufferObjects();

  // Remove face from mesh array by moving last face
  assert(!faces.IsEmpty());
  R3MeshFace *tail = faces.Tail();
  int index = f->id;
  RNArrayEntry *entry = faces.KthEntry(index);
  assert(faces.EntryContents(entry) == f);
  faces.EntryContents(entry) = tail;
  tail->id = index;
  faces.RemoveTail();

  // Reset ID to ease debugging
  f->id = -1;

  // Deallocate face
  if (f->flags[R3_MESH_FACE_ALLOCATED]) delete f;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq (%rdi), %rax
callq *0x290(%rax)
movq 0x18(%rsp), %rdi
addq $0x28, %rdi
callq 0x36e50
movq 0x18(%rsp), %rdi
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
movl 0xa4(%rax), %eax
movl %eax, 0x3c(%rsp)
addq $0x28, %rdi
movl 0x3c(%rsp), %esi
callq 0x37700
movq 0x18(%rsp), %rdi
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x28, %rdi
movq 0x30(%rsp), %rsi
callq 0x37750
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdi
movq %rcx, (%rax)
movl 0x3c(%rsp), %ecx
movq 0x40(%rsp), %rax
movl %ecx, 0xa4(%rax)
addq $0x28, %rdi
callq 0x36e60
movq 0x48(%rsp), %rax
movl $0xffffffff, 0xa4(%rax) # imm = 0xFFFFFFFF
movq 0x48(%rsp), %rax
addq $0xa8, %rax
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0x13d80
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x13d50
cmpl $0x0, %eax
je 0x1b17b
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x1b179
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x1b17b
addq $0x58, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::DeleteVertex(gaps::R3MeshVertex*)
void R3Mesh::
DeleteVertex(R3MeshVertex *v)
{
  // Delete edges attached to vertex
  RNArray<R3MeshEdge *> vertex_edges = v->edges;
  for (int i = 0; i < vertex_edges.NEntries(); i++) 
    DeleteEdge(vertex_edges.Kth(i));

  // Deallocate vertex
  DeallocateVertex(v);
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rsi
addq $0x8, %rsi
leaq 0x38(%rsp), %rdi
callq 0x37760
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0x10(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x13600
movl %eax, 0x14(%rsp)
jmp 0x1b1cb
movl 0x10(%rsp), %eax
movl 0x14(%rsp), %ecx
cmpl %ecx, %eax
jge 0x1b22a
movl 0x34(%rsp), %esi
leaq 0x38(%rsp), %rdi
callq 0x37790
movq %rax, 0x8(%rsp)
jmp 0x1b1ec
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
jmp 0x1b201
jmp 0x1b203
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x1b1b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x36840
jmp 0x1b251
movq 0x18(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq (%rdi), %rax
movq 0x298(%rax), %rax
callq *%rax
jmp 0x1b242
leaq 0x38(%rsp), %rdi
callq 0x36840
addq $0x58, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0xf890
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::DeleteEdge(gaps::R3MeshEdge*)
void R3Mesh::
DeleteEdge(R3MeshEdge *e)
{
  // Delete faces attached to edge
  if (e->face[0]) DeleteFace(e->face[0]);
  if (e->face[1]) DeleteFace(e->face[1]);

  // Remove edge from vertex arrays
  e->vertex[0]->edges.Remove(e);
  e->vertex[1]->edges.Remove(e);

  // Deallocate edge
  DeallocateEdge(e);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x1b296
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rsi
movq (%rdi), %rax
callq *0x70(%rax)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1b2b5
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rsi
movq (%rdi), %rax
callq *0x70(%rax)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
addq $0x8, %rdi
movq 0x8(%rsp), %rsi
callq 0x377b0
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
addq $0x8, %rdi
movq 0x8(%rsp), %rsi
callq 0x377b0
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq (%rdi), %rax
callq *0x2a0(%rax)
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::DeleteFace(gaps::R3MeshFace*)
void R3Mesh::
DeleteFace(R3MeshFace *f)
{
  // Update edge-face relations
  if (f->edge[0]->face[0] == f) f->edge[0]->face[0] = NULL;
  if (f->edge[0]->face[1] == f) f->edge[0]->face[1] = NULL;
  if (f->edge[1]->face[0] == f) f->edge[1]->face[0] = NULL;
  if (f->edge[1]->face[1] == f) f->edge[1]->face[1] = NULL;
  if (f->edge[2]->face[0] == f) f->edge[2]->face[0] = NULL;
  if (f->edge[2]->face[1] == f) f->edge[2]->face[1] = NULL;

  // Deallocate face
  DeallocateFace(f);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
cmpq 0x8(%rsp), %rax
jne 0x1b33c
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movq $0x0, 0x18(%rax)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rax
cmpq 0x8(%rsp), %rax
jne 0x1b361
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movq $0x0, 0x20(%rax)
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rax
cmpq 0x8(%rsp), %rax
jne 0x1b386
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq $0x0, 0x18(%rax)
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x20(%rax), %rax
cmpq 0x8(%rsp), %rax
jne 0x1b3ab
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq $0x0, 0x20(%rax)
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rax
cmpq 0x8(%rsp), %rax
jne 0x1b3d0
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
movq $0x0, 0x18(%rax)
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x20(%rax), %rax
cmpq 0x8(%rsp), %rax
jne 0x1b3f5
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
movq $0x0, 0x20(%rax)
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq (%rdi), %rax
callq *0x2a8(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::DeleteUnusedVertices()
void R3Mesh::
DeleteUnusedVertices(void)
{
  // Find unused vertices
  RNArray<R3MeshVertex *> unused_vertices;
  for (int i = 0; i < NVertices(); i++) {
    R3MeshVertex *vertex = Vertex(i);
    if (VertexValence(vertex) == 0) unused_vertices.Insert(vertex);
  }

  // Delete unused vertices
  for (int i = 0; i < unused_vertices.NEntries(); i++) {
    R3MeshVertex *vertex = unused_vertices.Kth(i);
    DeleteVertex(vertex);
  }
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x36800
movl $0x0, 0x5c(%rsp)
movq 0x28(%rsp), %rdi
movl 0x5c(%rsp), %eax
movl %eax, 0x20(%rsp)
callq 0x135e0
movl %eax, 0x24(%rsp)
jmp 0x1b44d
movl 0x20(%rsp), %eax
movl 0x24(%rsp), %ecx
cmpl %ecx, %eax
jge 0x1b4d8
movq 0x28(%rsp), %rdi
movl 0x5c(%rsp), %esi
callq 0x13630
movq %rax, 0x18(%rsp)
jmp 0x1b46e
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rsi
callq 0x36b50
movl %eax, 0x14(%rsp)
jmp 0x1b48d
movl 0x14(%rsp), %eax
cmpl $0x0, %eax
jne 0x1b4c6
movq 0x40(%rsp), %rsi
leaq 0x60(%rsp), %rdi
callq 0x37410
jmp 0x1b4a7
jmp 0x1b4c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x36850
jmp 0x1b554
jmp 0x1b4c8
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x1b435
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
movl %eax, 0xc(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x13600
movl %eax, 0x10(%rsp)
jmp 0x1b4f8
movl 0xc(%rsp), %eax
movl 0x10(%rsp), %ecx
cmpl %ecx, %eax
jge 0x1b545
movl 0x3c(%rsp), %esi
leaq 0x60(%rsp), %rdi
callq 0x377e0
movq %rax, (%rsp)
jmp 0x1b518
movq 0x28(%rsp), %rdi
movq (%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rsi
movq (%rdi), %rax
movq 0x60(%rax), %rax
callq *%rax
jmp 0x1b536
jmp 0x1b538
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x1b4e0
leaq 0x60(%rsp), %rdi
callq 0x36850
addq $0x78, %rsp
retq
movq 0x50(%rsp), %rdi
callq 0xf890
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::DeleteUnusedEdges()
void R3Mesh::
DeleteUnusedEdges(void)
{
  // Find unused edges
  RNArray<R3MeshEdge *> unused_edges;
  for (int i = 0; i < NEdges(); i++) {
    R3MeshEdge *edge = Edge(i);
    if (!FaceOnEdge(edge, 0) && !FaceOnEdge(edge, 1)) unused_edges.Insert(edge);
  }

  // Delete unused edges
  for (int i = 0; i < unused_edges.NEntries(); i++) {
    R3MeshEdge *edge = unused_edges.Kth(i);
    DeleteEdge(edge);
  }
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x36810
movl $0x0, 0x6c(%rsp)
movq 0x38(%rsp), %rdi
movl 0x6c(%rsp), %eax
movl %eax, 0x30(%rsp)
callq 0x135c0
movl %eax, 0x34(%rsp)
jmp 0x1b5a6
movl 0x30(%rsp), %eax
movl 0x34(%rsp), %ecx
cmpl %ecx, %eax
jge 0x1b660
movq 0x38(%rsp), %rdi
movl 0x6c(%rsp), %esi
callq 0x36930
movq %rax, 0x28(%rsp)
jmp 0x1b5cb
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rsi
xorl %edx, %edx
callq 0x37050
movq %rax, 0x20(%rsp)
jmp 0x1b5ed
movq 0x20(%rsp), %rax
cmpq $0x0, %rax
jne 0x1b64e
movq 0x38(%rsp), %rdi
movq 0x50(%rsp), %rsi
movl $0x1, %edx
callq 0x37050
movq %rax, 0x18(%rsp)
jmp 0x1b613
movq 0x18(%rsp), %rax
cmpq $0x0, %rax
jne 0x1b64e
movq 0x50(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0x376d0
jmp 0x1b62f
jmp 0x1b64e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x36840
jmp 0x1b6e1
jmp 0x1b650
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0x1b58e
movl $0x0, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
movl %eax, 0x10(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x13600
movl %eax, 0x14(%rsp)
jmp 0x1b680
movl 0x10(%rsp), %eax
movl 0x14(%rsp), %ecx
cmpl %ecx, %eax
jge 0x1b6cf
movl 0x4c(%rsp), %esi
leaq 0x70(%rsp), %rdi
callq 0x37790
movq %rax, 0x8(%rsp)
jmp 0x1b6a1
movq 0x38(%rsp), %rdi
movq 0x8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rsi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
jmp 0x1b6c0
jmp 0x1b6c2
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x1b668
leaq 0x70(%rsp), %rdi
callq 0x36840
addq $0x88, %rsp
retq
movq 0x60(%rsp), %rdi
callq 0xf890
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::CollapseFace(gaps::R3MeshFace*, gaps::R3Point const&)
R3MeshVertex *R3Mesh::
CollapseFace(R3MeshFace *f, const R3Point& point)
{
  // Collapse face into single point
  R3MeshVertex *v0 = VertexOnFace(f, 0);
  R3MeshVertex *v1 = VertexOnFace(f, 1);
  R3MeshVertex *v2 = VertexOnFace(f, 2);
  R3MeshEdge *e01 = EdgeBetweenVertices(v0, v1);
  R3MeshVertex *v01 = CollapseEdge(e01, point);
  if (!v01) return NULL;
  R3MeshEdge *e012 = EdgeBetweenVertices(v01, v2);
  assert(e012);
  R3MeshVertex *v012 = CollapseEdge(e012, point);
  return v012;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq 0x58(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movq 0x50(%rsp), %rsi
xorl %edx, %edx
callq 0x13700
movq 0x8(%rsp), %rdi
movq %rax, 0x40(%rsp)
movq 0x50(%rsp), %rsi
movl $0x1, %edx
callq 0x13700
movq 0x8(%rsp), %rdi
movq %rax, 0x38(%rsp)
movq 0x50(%rsp), %rsi
movl $0x2, %edx
callq 0x13700
movq 0x8(%rsp), %rdi
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x18280
movq 0x8(%rsp), %rdi
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq (%rdi), %rax
callq *0x98(%rax)
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x1ccd9
movq $0x0, 0x60(%rsp)
jmp 0x1cd19
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x18280
movq 0x8(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq (%rdi), %rax
callq *0x98(%rax)
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::SplitEdge(gaps::R3MeshEdge*, gaps::R3Plane const&)
R3MeshVertex *R3Mesh::
SplitEdge(R3MeshEdge *e, const R3Plane& plane)
{
  // Compute intersection point with plane
  RNScalar t;
  R3Point point;
  R3Span edge_span = EdgeSpan(e);
  if (!R3Intersects(edge_span, plane, &point, &t)) return NULL;
  if ((RNIsEqual(t, 0.0)) || (RNIsEqual(t, edge_span.Length()))) return NULL;

  // Split edge
  return SplitEdge(e, point);
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
movq %rdx, 0x88(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x6eb40
movq 0x10(%rsp), %rsi
movq 0x90(%rsp), %rdx
leaq 0x18(%rsp), %rdi
callq 0x37a00
movq 0x88(%rsp), %rsi
leaq 0x18(%rsp), %rdi
leaq 0x68(%rsp), %rdx
leaq 0x80(%rsp), %rcx
callq 0x7e560
cmpl $0x0, %eax
jne 0x1d6c2
movq $0x0, 0xa0(%rsp)
jmp 0x1d753
movsd 0x80(%rsp), %xmm0
leaq 0x15ae0e(%rip), %rax    # 0x1784e0
movsd (%rax), %xmm2
xorps %xmm1, %xmm1
callq 0x37170
cmpl $0x0, %eax
jne 0x1d71a
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x37a50
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
leaq 0x15add4(%rip), %rax    # 0x1784e0
movsd (%rax), %xmm2
callq 0x37170
cmpl $0x0, %eax
je 0x1d728
movq $0x0, 0xa0(%rsp)
jmp 0x1d753
movq 0x10(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq (%rdi), %rax
leaq 0x68(%rsp), %rdx
xorl %ecx, %ecx
movl %ecx, %r8d
movq %r8, %rcx
callq *0xb8(%rax)
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::FlipEdge(gaps::R3MeshEdge*)
void R3Mesh::
FlipEdge(R3MeshEdge *e)
{
  // Reverse order of vertices
  R3MeshVertex *v = e->vertex[0];
  e->vertex[0] = e->vertex[1];
  e->vertex[1] = v;

  // Reverse order of faces
  R3MeshFace *f = e->face[0];
  e->face[0] = e->face[1];
  e->face[1] = f;

  // Invalidate GL buffer objects
  InvalidateGLBufferObjects();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x20(%rax)
movq (%rdi), %rax
callq *0x290(%rax)
addq $0x28, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::FlipFace(gaps::R3MeshFace*)
void R3Mesh::
FlipFace(R3MeshFace *f)
{
  // Reverse orientation of plane
  f->plane.Flip();

  // Reverse order of vertices
  R3MeshVertex *vswap = f->vertex[0];
  f->vertex[0] = f->vertex[2];
  f->vertex[2] = vswap;

  // Reverse order of edges
  R3MeshEdge *eswap = f->edge[0];
  f->edge[0] = f->edge[1];
  f->edge[1] = eswap;

  // Invalidate GL buffer objects
  InvalidateGLBufferObjects();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
addq $0x38, %rdi
callq 0x37b30
movq (%rsp), %rdi
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x28(%rax)
movq (%rdi), %rax
callq *0x290(%rax)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::FlipFaces()
void R3Mesh::
FlipFaces(void)
{
  // Reverse orientation of all faces
  for (int i = 0; i < NFaces(); i++) {
    R3MeshFace *f = Face(i);
    FlipFace(f);
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x135a0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x1e6da
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x136d0
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
callq *0xe0(%rax)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x1e68b
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::UnmarkHoleBoundary(gaps::R3Mesh*, gaps::R3MeshBoundaryVertexData*)
static void
UnmarkHoleBoundary(R3Mesh *mesh, R3MeshBoundaryVertexData *head)
{
  // Just checking
  // AssertBoundaryVertexData(mesh, head);

  // Mark all edges
  R3MeshBoundaryVertexData *vdata = head;
  if (vdata) do {
    if (vdata->edge) mesh->SetEdgeMark(vdata->edge, 0);
    vdata = vdata->next;
  } while (vdata != head);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
je 0x20c38
jmp 0x20c00
movq (%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x20c1f
movq 0x10(%rsp), %rdi
movq (%rsp), %rax
movq 0x8(%rax), %rsi
xorl %edx, %edx
callq 0x37c00
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
cmpq 0x8(%rsp), %rax
jne 0x20c00
jmp 0x20c38
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::FillHoles(double, double)
void R3Mesh::
FillHoles(RNLength max_perimeter, RNLength max_planar_deviation)
{
  // Set edge marks
  // Cleared in FillHole
  // Used to avoid trying to fill hole multiple times
  RNMark edge_mark = ++R3mesh_mark;
  for (int i = 0; i < NEdges(); i++) {
    R3MeshEdge *edge = Edge(i);
    SetEdgeMark(edge, edge_mark);
  }
  
  // Iteratively find boundary edge and fill hole
  for (int i = 0; i < NEdges(); i++) {
    R3MeshEdge *edge = Edge(i);
    if (!IsEdgeOnBoundary(edge)) continue;
    if (EdgeMark(edge) != edge_mark) continue;
    FillHole(edge, max_perimeter, max_planar_deviation);
  }
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movsd %xmm0, 0x38(%rsp)
movsd %xmm1, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x14df8b(%rip), %eax    # 0x16f520
addl $0x1, %eax
movl %eax, 0x14df82(%rip)    # 0x16f520
movl %eax, 0x2c(%rsp)
movl $0x0, 0x28(%rsp)
movq 0x8(%rsp), %rdi
movl 0x28(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x135c0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x215f9
movq 0x8(%rsp), %rdi
movl 0x28(%rsp), %esi
callq 0x36930
movq 0x8(%rsp), %rdi
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rsi
movl 0x2c(%rsp), %edx
callq 0x37c00
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x215aa
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, (%rsp)
callq 0x135c0
movl %eax, %ecx
movl (%rsp), %eax
cmpl %ecx, %eax
jge 0x21686
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x36930
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rsi
callq 0x37270
cmpl $0x0, %eax
jne 0x21644
jmp 0x21676
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x37f70
cmpl 0x2c(%rsp), %eax
je 0x2165b
jmp 0x21676
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movsd 0x38(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
callq 0x202e0
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x21601
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::DrawEdgeIDs() const
void R3Mesh::
DrawEdgeIDs(void) const
{
  // Draw all edge IDs
  glDisable(GL_LIGHTING);
  RNGrfxBegin(RN_GRFX_LINES);
  for (int i = 0; i < edges.NEntries(); i++) {
    R3MeshEdge *e = edges.Kth(i);
    unsigned int index = i+1;    
    unsigned char r = (index >> 0) & 0xFF;
    unsigned char g = (index >> 8) & 0xFF;
    unsigned char b = (index >> 16) & 0xFF;
    RNLoadRgb(r, g, b);
    R3LoadPoint(VertexPosition(VertexOnEdge(e, 0)));
    R3LoadPoint(VertexPosition(VertexOnEdge(e, 1)));
  }
  glEnable(GL_LIGHTING);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0xb50, %edi            # imm = 0xB50
callq 0xf150
movl $0x1, %edi
callq 0x38df0
movl $0x0, 0x2c(%rsp)
movq 0x10(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%rsp)
addq $0x18, %rdi
callq 0x13600
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x2421c
movq 0x10(%rsp), %rdi
addq $0x18, %rdi
movl 0x2c(%rsp), %esi
callq 0x37790
movq %rax, 0x20(%rsp)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
shrl $0x0, %eax
andl $0xff, %eax
movb %al, 0x1b(%rsp)
movl 0x1c(%rsp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, 0x1a(%rsp)
movl 0x1c(%rsp), %eax
shrl $0x10, %eax
andl $0xff, %eax
movb %al, 0x19(%rsp)
movb 0x1b(%rsp), %cl
movb 0x1a(%rsp), %al
movzbl %cl, %edi
movzbl %al, %esi
movzbl 0x19(%rsp), %edx
callq 0x38e10
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
xorl %edx, %edx
callq 0x36960
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x13660
movq %rax, %rdi
callq 0x38e40
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x1, %edx
callq 0x36960
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x13660
movq %rax, %rdi
callq 0x38e40
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x2412f
movl $0xb50, %edi            # imm = 0xB50
callq 0xf460
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::DrawEdge(gaps::R3MeshEdge*) const
void R3Mesh::
DrawEdge(R3MeshEdge *e) const
{
  // Draw edge
  R3BeginLine();
  R3LoadPoint(e->vertex[0]->position);
  R3LoadPoint(e->vertex[1]->position);
  R3EndLine();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
callq 0x38e70
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
addq $0x18, %rdi
callq 0x38e40
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
addq $0x18, %rdi
callq 0x38e40
callq 0x38e80
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::DrawFace(gaps::R3MeshFace*) const
void R3Mesh::
DrawFace(R3MeshFace *f) const
{
  // Draw polygon
  R3BeginPolygon();
  R3LoadNormal(FaceNormal(f));
  R3LoadPoint(f->vertex[0]->position);
  R3LoadPoint(f->vertex[1]->position);
  R3LoadPoint(f->vertex[2]->position);
  R3EndPolygon();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
callq 0x38e90
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x13840
movq %rax, %rdi
callq 0x38ea0
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
addq $0x18, %rdi
callq 0x38e40
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
addq $0x18, %rdi
callq 0x38e40
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
addq $0x18, %rdi
callq 0x38e40
callq 0x38ec0
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::Intersection(gaps::R3Ray const&, gaps::R3MeshIntersection*) const
R3MeshType R3Mesh::
Intersection(const R3Ray& ray, R3MeshIntersection *intersection) const
{
  // Initialize intersection variables
  R3MeshType type = R3_MESH_NULL_TYPE;
  if (intersection) {
    intersection->type = R3_MESH_NULL_TYPE;
    intersection->vertex = NULL;
    intersection->edge = NULL;
    intersection->face = NULL;
    intersection->t = RN_INFINITY;
  }

  // Check bounding box for intersection 
  if (R3Intersects(ray, bbox)) {
    // Check each face to find closest intersection
    RNScalar min_t = FLT_MAX;
    for (int i = 0; i < faces.NEntries(); i++) {
      // Get ith face
      R3MeshFace *f = faces[i];

      // Get intersection with face
      R3MeshIntersection face_intersection;
      if (Intersection(ray, f, &face_intersection)) {
        if (face_intersection.t < min_t) {
          if (intersection) *intersection = face_intersection;
          type = face_intersection.type;
          min_t = face_intersection.t;
        }
      }
    }
  }

  // Return intersection type
  return type;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x6c(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0x2446d
movq 0x70(%rsp), %rax
movl $0x0, (%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x70(%rsp), %rax
movq $0x0, 0x18(%rax)
leaq 0x154091(%rip), %rax    # 0x1784f0
movsd (%rax), %xmm0
movq 0x70(%rsp), %rax
movsd %xmm0, 0x38(%rax)
movq 0x8(%rsp), %rsi
movq 0x78(%rsp), %rdi
addq $0xf8, %rsi
xorl %eax, %eax
movl %eax, %r8d
movq %r8, %rdx
movq %r8, %rcx
callq 0x7b430
cmpl $0x0, %eax
je 0x24567
movsd 0x10eb81(%rip), %xmm0   # 0x133020
movsd %xmm0, 0x60(%rsp)
movl $0x0, 0x5c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x5c(%rsp), %eax
movl %eax, 0x4(%rsp)
addq $0x28, %rdi
callq 0x13600
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x24565
movq 0x8(%rsp), %rdi
addq $0x28, %rdi
movl 0x5c(%rsp), %esi
callq 0x13b10
movq %rax, 0x50(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x38ed0
movq 0x8(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq (%rdi), %rax
leaq 0x10(%rsp), %rcx
callq *0x178(%rax)
cmpl $0x0, %eax
je 0x24553
movsd 0x48(%rsp), %xmm1
movsd 0x60(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x24551
cmpq $0x0, 0x70(%rsp)
je 0x2453d
movq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x38ef0
movl 0x10(%rsp), %eax
movl %eax, 0x6c(%rsp)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
jmp 0x24553
jmp 0x24555
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x244ad
jmp 0x24567
movl 0x6c(%rsp), %eax
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::ClosestPoint(gaps::R3Point const&, gaps::R3MeshIntersection*) const
R3Point R3Mesh::
ClosestPoint(const R3Point& point, R3MeshIntersection *closest_point) const
{
  // Check each face to find closest point
  R3Point closest_position = R3zero_point;
  RNScalar closest_distance_squared = FLT_MAX;
  for (int i = 0; i < faces.NEntries(); i++) {
    R3MeshFace *f = faces[i];
    R3MeshIntersection intersection;
    R3Point position = ClosestPointOnFace(f, point, (closest_point) ? &intersection : NULL);
    RNLength distance_squared = R3SquaredDistance(position, point);
    if (distance_squared < closest_distance_squared) {
      if (closest_point) *closest_point = intersection;
      closest_distance_squared = distance_squared;
      closest_position = position;
    }
  }

  // Return closest position on mesh
  return closest_position;
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x30(%rsp)
movq %rdi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
movq %rdx, 0xc0(%rsp)
movq %rcx, 0xb8(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x554238(%rip), %rsi    # 0x5794b0
callq 0x6eb90
movsd 0x10dd9b(%rip), %xmm0   # 0x133020
movsd %xmm0, 0xb0(%rsp)
movl $0x0, 0xac(%rsp)
movq 0x38(%rsp), %rdi
movl 0xac(%rsp), %eax
movl %eax, 0x24(%rsp)
addq $0x28, %rdi
callq 0x13600
movl %eax, %ecx
movl 0x24(%rsp), %eax
cmpl %ecx, %eax
jge 0x253bf
movq 0x38(%rsp), %rdi
addq $0x28, %rdi
movl 0xac(%rsp), %esi
callq 0x13b10
movq %rax, 0xa0(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x38ed0
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0xb8(%rsp)
je 0x25318
leaq 0x60(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x25321
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x25321
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rdx
movq 0x38(%rsp), %rsi
movq 0x8(%rsp), %r8
leaq 0x48(%rsp), %rdi
callq 0x24d10
movq 0xc0(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x86c10
movsd %xmm0, 0x40(%rsp)
movsd 0x40(%rsp), %xmm1
movsd 0xb0(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x253a7
cmpq $0x0, 0xb8(%rsp)
je 0x25389
movq 0xb8(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x38ef0
movq 0x28(%rsp), %rdi
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0xb0(%rsp)
leaq 0x48(%rsp), %rsi
callq 0x6f1e0
jmp 0x253a9
movl 0xac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xac(%rsp)
jmp 0x25299
movq 0x30(%rsp), %rax
addq $0xd8, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::RandomPointOnFace(gaps::R3MeshFace const*) const
R3Point R3Mesh::
RandomPointOnFace(const R3MeshFace *face) const
{
  // Seed random number generator
  static RNBoolean seed = 0;
  if (!seed) { seed = 1; RNSeedRandomScalar(); }

  // Get vertex positions
  R3MeshVertex *v0 = VertexOnFace(face, 0);
  R3MeshVertex *v1 = VertexOnFace(face, 1);
  R3MeshVertex *v2 = VertexOnFace(face, 2);
  const R3Point& p0 = VertexPosition(v0);
  const R3Point& p1 = VertexPosition(v1);
  const R3Point& p2 = VertexPosition(v2);


  // Return random point on face
  RNScalar r1 = sqrt(RNRandomScalar());
  RNScalar r2 = RNRandomScalar();
  R3Point p = p0 * (1.0 - r1) + p1 * r1 * (1.0 - r2) + p2 * r1 * r2;
  return p;
}

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0x8(%rsp)
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq %rdi, 0x100(%rsp)
movq %rsi, 0xf8(%rsp)
movq %rdx, 0xf0(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x153170(%rip)    # 0x178580
jne 0x25424
movl $0x1, 0x153164(%rip)    # 0x178580
xorps %xmm0, %xmm0
callq 0xd46b0
movq 0x18(%rsp), %rdi
movq 0xf0(%rsp), %rsi
xorl %edx, %edx
callq 0x13700
movq 0x18(%rsp), %rdi
movq %rax, 0xe8(%rsp)
movq 0xf0(%rsp), %rsi
movl $0x1, %edx
callq 0x13700
movq 0x18(%rsp), %rdi
movq %rax, 0xe0(%rsp)
movq 0xf0(%rsp), %rsi
movl $0x2, %edx
callq 0x13700
movq 0x18(%rsp), %rdi
movq %rax, 0xd8(%rsp)
movq 0xe8(%rsp), %rsi
callq 0x13660
movq 0x18(%rsp), %rdi
movq %rax, 0xd0(%rsp)
movq 0xe0(%rsp), %rsi
callq 0x13660
movq 0x18(%rsp), %rdi
movq %rax, 0xc8(%rsp)
movq 0xd8(%rsp), %rsi
callq 0x13660
movq %rax, 0xc0(%rsp)
callq 0xd4710
callq 0xf390
movsd %xmm0, 0xb8(%rsp)
callq 0xd4710
movsd %xmm0, 0xb0(%rsp)
movq 0xd0(%rsp), %rsi
movsd 0x10db0b(%rip), %xmm0   # 0x133008
subsd 0xb8(%rsp), %xmm0
leaq 0x80(%rsp), %rdi
callq 0x6fb80
movq 0xc8(%rsp), %rsi
movsd 0xb8(%rsp), %xmm0
leaq 0x50(%rsp), %rdi
callq 0x6fb80
movsd 0x10dad2(%rip), %xmm0   # 0x133008
subsd 0xb0(%rsp), %xmm0
leaq 0x68(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x6fb80
leaq 0x98(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x6fa40
movq 0xc0(%rsp), %rsi
movsd 0xb8(%rsp), %xmm0
leaq 0x20(%rsp), %rdi
callq 0x6fb80
movsd 0xb0(%rsp), %xmm0
leaq 0x38(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x6fb80
movq 0x8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x6fa40
movq 0x10(%rsp), %rax
addq $0x108, %rsp            # imm = 0x108
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3MeshVertexIsSaddleOrBoundary(gaps::R3Mesh const*, gaps::R3MeshVertex const*)
static RNBoolean
R3MeshVertexIsSaddleOrBoundary(const R3Mesh *mesh, const R3MeshVertex *vertex)
{
  // Return whether vertex is a saddle or boundary
  int nconvex = 0;
  int nconcave = 0;
  RNScalar angle_epsilon = 0.1;
  for (int i = 0; i < mesh->VertexValence(vertex); i++) {
    R3MeshEdge *e = mesh->EdgeOnVertex(vertex, i);
    if (!mesh->FaceOnEdge(e, 0)) return TRUE;
    if (!mesh->FaceOnEdge(e, 1)) return TRUE;
    RNAngle angle = mesh->EdgeInteriorAngle(e);
    if (RNIsGreater(angle, RN_PI, angle_epsilon)) nconcave++;
    else if (RNIsLess(angle, RN_PI, angle_epsilon)) nconvex++;
    if (nconvex * nconcave != 0) return TRUE;
  }

  // Not a saddle
  return FALSE;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movl $0x0, 0x28(%rsp)
movsd 0x10baca(%rip), %xmm0   # 0x133230
movsd %xmm0, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x36b50
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x27897
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl 0x1c(%rsp), %edx
callq 0x36ec0
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x37050
cmpq $0x0, %rax
jne 0x277d5
movl $0x1, 0x44(%rsp)
jmp 0x2789f
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x37050
cmpq $0x0, %rax
jne 0x277fc
movl $0x1, 0x44(%rsp)
jmp 0x2789f
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x15630
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
leaq 0x10f0ba(%rip), %rax    # 0x1368d8
movsd (%rax), %xmm1
movsd 0x20(%rsp), %xmm2
callq 0x3c090
cmpl $0x0, %eax
je 0x2783f
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x2786d
movsd 0x8(%rsp), %xmm0
leaq 0x10f08c(%rip), %rax    # 0x1368d8
movsd (%rax), %xmm1
movsd 0x20(%rsp), %xmm2
callq 0x39630
cmpl $0x0, %eax
je 0x2786b
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x2786d
movl 0x2c(%rsp), %eax
imull 0x28(%rsp), %eax
cmpl $0x0, %eax
je 0x27885
movl $0x1, 0x44(%rsp)
jmp 0x2789f
jmp 0x27887
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x27774
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::R3Mesh::ReadPlyFile(char const*)
int R3Mesh::
ReadPlyFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "rb");
  if (!fp) {
    RNFail("Unable to open file: %s", filename);
    return 0;
  }

  // Read file
  if (!ReadPlyStream(fp)) return 0;
  
  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
leaq 0x1049d6(%rip), %rsi    # 0x1335d9
callq 0xf5e0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x2ec32
movq 0x10(%rsp), %rsi
leaq 0x1049bb(%rip), %rdi    # 0x1335dc
movb $0x0, %al
callq 0xd4f30
movl $0x0, 0x24(%rsp)
jmp 0x2ec65
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq (%rdi), %rax
callq *0x210(%rax)
cmpl $0x0, %eax
jne 0x2ec53
movl $0x0, 0x24(%rsp)
jmp 0x2ec65
movq 0x8(%rsp), %rdi
callq 0xf4b0
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Mesh.cpp
// Function: gaps::ReadIfsString(_IO_FILE*, char*, int)
static int 
ReadIfsString(FILE *fp, char *buffer, int maxlength)
{
  // Read length
  unsigned int length;
  if (fread(&length, sizeof(unsigned int), 1, fp) != 1) {
    RNFail("Unable to read string length");
    return -1;
  }

  // Read characters
  if ((int) length > maxlength) length = maxlength;
  if (fread(buffer, sizeof(unsigned char), length, fp) != length) {
    RNFail("Unable to read string characters");
    return -1;
  }

  // Return length of string
  return length;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movq 0x18(%rsp), %rcx
leaq 0x8(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0xf780
cmpq $0x1, %rax
je 0x328c9
leaq 0x1012ab(%rip), %rdi    # 0x133b63
movb $0x0, %al
callq 0xd4f30
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x3291e
movl 0x8(%rsp), %eax
cmpl 0xc(%rsp), %eax
jle 0x328db
movl 0xc(%rsp), %eax
movl %eax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movl 0x8(%rsp), %eax
movl %eax, %edx
movq 0x18(%rsp), %rcx
movl $0x1, %esi
callq 0xf780
movl 0x8(%rsp), %ecx
cmpq %rcx, %rax
je 0x32916
leaq 0x10127b(%rip), %rdi    # 0x133b80
movb $0x0, %al
callq 0xd4f30
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x3291e
movl 0x8(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw (%rax,%rax)