LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::~R3SceneNode()
R3SceneNode::
~R3SceneNode(void)
{
  // Remove elements
  for (int i = 0; i < elements.NEntries(); i++) {
    R3SceneElement *element = elements.Kth(i);
    RemoveElement(element);
  }

  // Remove references
  for (int i = 0; i < references.NEntries(); i++) {
    R3SceneReference *reference = references.Kth(i);
    RemoveReference(reference);
  }

  // Remove children
  for (int i = 0; i < children.NEntries(); i++) {
    R3SceneNode *child = children.Kth(i);
    RemoveChild(child);
  }

  // Remove node from parent
  if (parent) {
    parent->RemoveChild(this);
  }

  // Remove node from scene
  if (scene) {
    scene->RemoveNode(this);
  }

  // Delete name
  if (name) free(name);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x3c(%rdi)
jle 0x3b892
xorl %r14d, %r14d
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x3b96c
incq %r14
movslq 0x3c(%rbx), %rax
cmpq %rax, %r14
jl 0x3b876
cmpl $0x0, 0x4c(%rbx)
jle 0x3b8b7
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x3b9ba
incq %r14
movslq 0x4c(%rbx), %rax
cmpq %rax, %r14
jl 0x3b89b
cmpl $0x0, 0x2c(%rbx)
jle 0x3b8dc
xorl %r14d, %r14d
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x3ba02
incq %r14
movslq 0x2c(%rbx), %rax
cmpq %rax, %r14
jl 0x3b8c0
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x3b8ed
movq %rbx, %rsi
callq 0x3ba02
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3b8fd
movq %rbx, %rsi
callq 0x2869a
leaq 0x30(%rbx), %r15
leaq 0x40(%rbx), %r12
leaq 0x20(%rbx), %r14
movq 0x1a0(%rbx), %rdi
testq %rdi, %rdi
je 0x3b91a
callq 0x21ad0
leaq 0x168(%rbx), %rdi
callq 0x6dafc
leaq 0x58(%rbx), %rdi
callq 0x6fa30
addq $0x50, %rbx
movq %rbx, %rdi
callq 0x36e90
movq %r12, %rdi
callq 0x875f6
movq %r15, %rdi
callq 0x875f6
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x875f6
jmp 0x3b964
jmp 0x3b964
jmp 0x3b964
movq %rax, %rdi
callq 0x3704d
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::RemoveElement(gaps::R3SceneElement*)
void R3SceneNode::
RemoveElement(R3SceneElement *element) 
{
  // Update goemetry
  assert(element->node == this);
  element->node = NULL;

  // Remove element
  elements.Remove(element);

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x0, (%rsi)
leaq 0x30(%rdi), %r14
movq %r14, %rdi
callq 0x87604
subq 0x30(%rbx), %rax
shrq $0x3, %rax
movq %r14, %rdi
movl %eax, %esi
callq 0x877ac
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x170(%rbx)
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
jne 0x3b9a2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::RemoveReference(gaps::R3SceneReference*)
void R3SceneNode::
RemoveReference(R3SceneReference *reference) 
{
  // Remove reference
  references.Remove(reference);

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x40(%rdi), %r14
movq %r14, %rdi
callq 0x87604
subq 0x40(%rbx), %rax
shrq $0x3, %rax
movq %r14, %rdi
movl %eax, %esi
callq 0x877ac
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x170(%rbx)
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
jne 0x3b9e9
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::RemoveChild(gaps::R3SceneNode*)
void R3SceneNode::
RemoveChild(R3SceneNode *node) 
{
  // Remove node from children
  assert(node->parent == this);
  RNArrayEntry *entry = children.KthEntry(node->parent_index);
  assert(children.EntryContents(entry) == node);
  R3SceneNode *tail = children.Tail();
  children.EntryContents(entry) = tail;
  tail->parent_index = node->parent_index;
  children.RemoveTail();
  node->parent = NULL;
  node->parent_index = -1;

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
addq $0x20, %rdi
movslq 0x18(%rsi), %rax
movq 0x20(%rbx), %rcx
movslq 0x2c(%rbx), %rdx
movq -0x8(%rcx,%rdx,8), %rsi
movq %rsi, (%rcx,%rax,8)
movl %eax, 0x18(%rsi)
leal -0x1(%rdx), %esi
callq 0x877ac
movq $0x0, 0x10(%r14)
movl $0xffffffff, 0x18(%r14) # imm = 0xFFFFFFFF
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x170(%rbx)
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
jne 0x3ba4a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::NFacets() const
const RNInterval R3SceneNode::
NFacets(void) const
{
  // Initialize nfacets
  RNInterval nfacets(0,0);
  
  // Add facets from elements
  for (int i = 0; i < NElements(); i++) {
    R3SceneElement *element = Element(i);
    nfacets += element->NFacets();
  }
  
  // Add facets from references
  for (int i = 0; i < NReferences(); i++) {
    R3SceneReference *reference = Reference(i);
    R3Scene *referenced_scene = reference->ReferencedScene();
    if (referenced_scene) nfacets += referenced_scene->NFacets();
  }
  
  // Add facets from children
  for (int i = 0; i < NChildren(); i++) {
    R3SceneNode *child = Child(i);
    nfacets += child->NFacets();
  }

  // Return nfacets
  return nfacets;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorpd %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x8928e
cmpl $0x0, 0x3c(%r14)
jle 0x3bab5
xorl %r12d, %r12d
movq %rsp, %r15
movq 0x30(%r14), %rax
movq (%rax,%r12,8), %rsi
movq %r15, %rdi
callq 0x3d65c
movupd (%rbx), %xmm0
addpd (%rsp), %xmm0
movupd %xmm0, (%rbx)
incq %r12
movslq 0x3c(%r14), %rax
cmpq %rax, %r12
jl 0x3ba8c
movl 0x4c(%r14), %eax
testl %eax, %eax
jle 0x3bafa
xorl %r12d, %r12d
movq %rsp, %r15
movq 0x40(%r14), %rcx
movq (%rcx,%r12,8), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x3baef
movq (%rcx), %rsi
movq %r15, %rdi
callq 0x3ba62
movupd (%rbx), %xmm0
addpd (%rsp), %xmm0
movupd %xmm0, (%rbx)
movl 0x4c(%r14), %eax
incq %r12
movslq %eax, %rcx
cmpq %rcx, %r12
jl 0x3bac3
cmpl $0x0, 0x2c(%r14)
jle 0x3bb30
xorl %r12d, %r12d
movq %rsp, %r15
movq 0x20(%r14), %rax
movq (%rax,%r12,8), %rsi
movq %r15, %rdi
callq 0x3ba62
movupd (%rbx), %xmm0
addpd (%rsp), %xmm0
movupd %xmm0, (%rbx)
incq %r12
movslq 0x2c(%r14), %rax
cmpq %rax, %r12
jl 0x3bb07
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::Length() const
const RNLength R3SceneNode::
Length(void) const
{
  // Initialize length
  RNLength length = 0;
  
  // Add length from elements
  for (int i = 0; i < NElements(); i++) {
    R3SceneElement *element = Element(i);
    length += element->Length();
  }
  
  // Add length from references
  for (int i = 0; i < NReferences(); i++) {
    R3SceneReference *reference = Reference(i);
    R3Scene *referenced_scene = reference->ReferencedScene();
    if (referenced_scene) length += referenced_scene->Length();
  }
  
  // Add length from children
  for (int i = 0; i < NChildren(); i++) {
    R3SceneNode *child = Child(i);
    length += child->Length();
  }

  // Return length
  return length;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x3c(%rdi)
jle 0x3bb87
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3d6c0
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x3c(%rbx), %rax
cmpq %rax, %r14
jl 0x3bb54
jmp 0x3bb8b
xorpd %xmm0, %xmm0
movl 0x4c(%rbx), %eax
testl %eax, %eax
jle 0x3bbd3
xorl %r14d, %r14d
movq 0x40(%rbx), %rcx
movq (%rcx,%r14,8), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x3bbc8
movq (%rcx), %rdi
movsd %xmm0, (%rsp)
callq 0x3bb40
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
movl 0x4c(%rbx), %eax
incq %r14
movslq %eax, %rcx
cmpq %rcx, %r14
jl 0x3bb95
cmpl $0x0, 0x2c(%rbx)
jle 0x3bc0d
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3bb40
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x2c(%rbx), %rax
cmpq %rax, %r14
jl 0x3bbdc
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::Area() const
const RNArea R3SceneNode::
Area(void) const
{
  // Initialize area
  RNArea area = 0;
  
  // Add area from elements
  for (int i = 0; i < NElements(); i++) {
    R3SceneElement *element = Element(i);
    area += element->Area();
  }
  
  // Add area from references
  for (int i = 0; i < NReferences(); i++) {
    R3SceneReference *reference = Reference(i);
    R3Scene *referenced_scene = reference->ReferencedScene();
    if (referenced_scene) area += referenced_scene->Area();
  }
  
  // Add area from children
  for (int i = 0; i < NChildren(); i++) {
    R3SceneNode *child = Child(i);
    area += child->Area();
  }

  // Return area
  return area;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x3c(%rdi)
jle 0x3bc5d
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3d712
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x3c(%rbx), %rax
cmpq %rax, %r14
jl 0x3bc2a
jmp 0x3bc61
xorpd %xmm0, %xmm0
movl 0x4c(%rbx), %eax
testl %eax, %eax
jle 0x3bca9
xorl %r14d, %r14d
movq 0x40(%rbx), %rcx
movq (%rcx,%r14,8), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x3bc9e
movq (%rcx), %rdi
movsd %xmm0, (%rsp)
callq 0x3bc16
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
movl 0x4c(%rbx), %eax
incq %r14
movslq %eax, %rcx
cmpq %rcx, %r14
jl 0x3bc6b
cmpl $0x0, 0x2c(%rbx)
jle 0x3bce3
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3bc16
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x2c(%rbx), %rax
cmpq %rax, %r14
jl 0x3bcb2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::Volume() const
const RNVolume R3SceneNode::
Volume(void) const
{
  // Initialize volume
  RNVolume volume = 0;
  
  // Add volume from elements
  for (int i = 0; i < NElements(); i++) {
    R3SceneElement *element = Element(i);
    volume += element->Volume();
  }
  
  // Add volume from references
  for (int i = 0; i < NReferences(); i++) {
    R3SceneReference *reference = Reference(i);
    R3Scene *referenced_scene = reference->ReferencedScene();
    if (referenced_scene) volume += referenced_scene->Volume();
  }
  
  // Add volume from children
  for (int i = 0; i < NChildren(); i++) {
    R3SceneNode *child = Child(i);
    volume += child->Volume();
  }

  // Return volume
  return volume;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x3c(%rdi)
jle 0x3bd33
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3d764
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x3c(%rbx), %rax
cmpq %rax, %r14
jl 0x3bd00
jmp 0x3bd37
xorpd %xmm0, %xmm0
movl 0x4c(%rbx), %eax
testl %eax, %eax
jle 0x3bd7f
xorl %r14d, %r14d
movq 0x40(%rbx), %rcx
movq (%rcx,%r14,8), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x3bd74
movq (%rcx), %rdi
movsd %xmm0, (%rsp)
callq 0x3bcec
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
movl 0x4c(%rbx), %eax
incq %r14
movslq %eax, %rcx
cmpq %rcx, %r14
jl 0x3bd41
cmpl $0x0, 0x2c(%rbx)
jle 0x3bdb9
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3bcec
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x2c(%rbx), %rax
cmpq %rax, %r14
jl 0x3bd88
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::BShape() const
const R3Shape& R3SceneNode::
BShape(void) const
{
  // Return bounding box
  if (bbox[0][0] == FLT_MAX) 
    ((R3SceneNode *) this)->UpdateBBox();
  return bbox;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movsd 0x170(%rdi), %xmm0
ucomisd 0x9f910(%rip), %xmm0    # 0xdbbb0
jne 0x3c2ac
jp 0x3c2ac
movq %rbx, %rdi
callq 0x3c2b8
addq $0x168, %rbx            # imm = 0x168
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::BBox() const
const R3Box& R3SceneNode::
BBox(void) const
{
  // Return bounding box
  if (bbox[0][0] == FLT_MAX) 
    ((R3SceneNode *) this)->UpdateBBox();
  return bbox;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movsd 0x170(%rdi), %xmm0
ucomisd 0x9f724(%rip), %xmm0    # 0xdbbb0
jne 0x3c498
jp 0x3c498
movq %rbx, %rdi
callq 0x3c2b8
addq $0x168, %rbx            # imm = 0x168
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::WorldBBox() const
R3Box R3SceneNode::
WorldBBox(void) const
{
  // This returns bounding box in world coordinate frame
  // Note that BBox() returns bounding box after xform (in parent's coordinate frame)
  // Note that this bbox will be over-estimating, since it is a transformed AABB

  // Start for bbox in parent's coordinate frame
  R3Box box = BBox();

  // Transform box
  R3SceneNode *ancestor = Parent();
  while (ancestor) {
    box.Transform(ancestor->Transformation());
    ancestor = ancestor->Parent();
  }

  // Return box;
  return bbox;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movsd 0x170(%rsi), %xmm0
ucomisd 0x9f6eb(%rip), %xmm0    # 0xdbbb0
jne 0x3c4d1
jp 0x3c4d1
movq %r14, %rdi
callq 0x3c2b8
leaq 0x168(%r14), %r15
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x6ccdc
movq 0x10(%r14), %r14
testq %r14, %r14
je 0x3c4fd
leaq 0x58(%r14), %rsi
movq %r12, %rdi
callq 0x6d9c8
jmp 0x3c4e6
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6ccdc
movq %rsp, %rdi
callq 0x6dafc
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x3c521
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6dafc
movq %rbx, %rdi
callq 0x220c0
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::LocalBBox() const
R3Box R3SceneNode::
LocalBBox(void) const
{
  // This returns bounding box in this node's coordinate frame (before transformation)
  // Note that BBox() returns bounding box after xform (in parent's coordinate frame)
  
  // Compute bounding box in local coordinates
  R3Box bbox = R3null_box;

  // Include elements
  for (int i = 0; i < NElements(); i++) {
    R3SceneElement *element = Element(i);
    bbox.Union(element->BBox());
  }

  // Include references
  for (int i = 0; i < NReferences(); i++) {
    R3SceneReference *reference = Reference(i);
    bbox.Union(reference->BBox());
  }

  // Include children
  for (int i = 0; i < NChildren(); i++) {
    R3SceneNode *child = Child(i);
    bbox.Union(child->BBox());
  }

  // Return box
  return bbox;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x108fcf(%rip), %rsi    # 0x145518
callq 0x6ccdc
cmpl $0x0, 0x3c(%r14)
jle 0x3c595
xorl %r12d, %r12d
movq 0x30(%r14), %rax
movq (%rax,%r12,8), %r15
movsd 0x30(%r15), %xmm0
ucomisd 0x9f642(%rip), %xmm0    # 0xdbbb0
jne 0x3c57a
jp 0x3c57a
movq %r15, %rdi
callq 0x3dc5e
addq $0x28, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6d794
incq %r12
movslq 0x3c(%r14), %rax
cmpq %rax, %r12
jl 0x3c558
cmpl $0x0, 0x4c(%r14)
jle 0x3c5c3
xorl %r15d, %r15d
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x3de08
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6d794
incq %r15
movslq 0x4c(%r14), %rax
cmpq %rax, %r15
jl 0x3c59f
cmpl $0x0, 0x2c(%r14)
jle 0x3c610
xorl %r12d, %r12d
movq 0x20(%r14), %rax
movq (%rax,%r12,8), %r15
movsd 0x170(%r15), %xmm0
ucomisd 0x9f5ca(%rip), %xmm0    # 0xdbbb0
jne 0x3c5f2
jp 0x3c5f2
movq %r15, %rdi
callq 0x3c2b8
addq $0x168, %r15            # imm = 0x168
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6d794
incq %r12
movslq 0x2c(%r14), %rax
cmpq %rax, %r12
jl 0x3c5cd
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x3c623
jmp 0x3c623
movq %rax, %r14
movq %rbx, %rdi
callq 0x6dafc
movq %r14, %rdi
callq 0x220c0
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::CumulativeTransformation() const
R3Affine R3SceneNode::
CumulativeTransformation(void) const
{
  // Initialize cumulative transformation
  R3Affine cumulative_transformation(R3identity_affine);

  // Concatenate transformations back to the root
  const R3SceneNode *ancestor = this;
  while (ancestor) {
    R3Affine t(R3identity_affine);
    t.Transform(ancestor->Transformation());
    t.Transform(cumulative_transformation);
    cumulative_transformation = t;
    ancestor = ancestor->Parent();
  }

  // Return cumulative transformation from root to node (including node's transformation)
  return cumulative_transformation;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xfca94(%rip), %rax     # 0x139148
addq $0x10, %rax
movq %rax, 0x20(%rsp)
movq %rax, (%rdi)
addq $0x8, %rdi
leaq 0x108fb5(%rip), %rax    # 0x145680
leaq 0x8(%rax), %rsi
movq %rdi, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
callq 0x71cc6
movl $0x88, %r13d
leaq (%rbx,%r13), %rdi
addq 0x1008e9(%rip), %r13    # 0x13cfd8
movq %rdi, 0x8(%rsp)
movq %r13, %rsi
callq 0x71cc6
leaq 0x108f7d(%rip), %rax    # 0x145680
movq 0x108(%rax), %rax
movq %rax, 0x108(%rbx)
leaq 0x30(%rsp), %r15
leaq 0xb0(%rsp), %r12
leaq 0x28(%rsp), %rbp
movq 0x20(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %r15, %rdi
movq 0x18(%rsp), %rsi
callq 0x71cc6
movq %r12, %rdi
movq %r13, %rsi
callq 0x71cc6
leaq 0x108f34(%rip), %rax    # 0x145680
movq 0x108(%rax), %rax
movq %rax, 0x130(%rsp)
leaq 0x58(%r14), %rsi
movq %rbp, %rdi
callq 0x6fb9e
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x6fb9e
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x738aa
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x738aa
movq 0x130(%rsp), %rax
movq %rax, 0x108(%rbx)
movq 0x10(%r14), %r14
movq %rbp, %rdi
callq 0x6fa30
testq %r14, %r14
jne 0x3c723
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x700c4
jmp 0x3c7f6
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x700c4
jmp 0x3c7ee
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x6fa30
movq %rbx, %rdi
callq 0x6fa30
movq %r14, %rdi
callq 0x220c0
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::CumulativeParentTransformation() const
R3Affine R3SceneNode::
CumulativeParentTransformation(void) const
{
  // Initialize cumulative transformation
  R3Affine cumulative_transformation(R3identity_affine);

  // Concatenate transformations back to the root
  const R3SceneNode *ancestor = Parent();
  while (ancestor) {
    R3Affine t(R3identity_affine);
    t.Transform(ancestor->Transformation());
    t.Transform(cumulative_transformation);
    cumulative_transformation = t;
    ancestor = ancestor->Parent();
  }

  // Return cumulative transformation from root to parent (not including node's transformation)
  return cumulative_transformation;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xfc92c(%rip), %rax     # 0x139148
addq $0x10, %rax
movq %rax, 0x20(%rsp)
movq %rax, (%rdi)
addq $0x8, %rdi
leaq 0x108e4d(%rip), %rax    # 0x145680
leaq 0x8(%rax), %rsi
movq %rdi, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
callq 0x71cc6
movl $0x88, %esi
leaq (%rbx,%rsi), %rdi
addq 0x100782(%rip), %rsi    # 0x13cfd8
movq %rdi, 0x8(%rsp)
callq 0x71cc6
leaq 0x108e19(%rip), %rax    # 0x145680
movq 0x108(%rax), %rax
movq %rax, 0x108(%rbx)
movq 0x10(%r14), %r12
testq %r12, %r12
je 0x3c930
leaq 0x30(%rsp), %r13
leaq 0xb0(%rsp), %rbp
movl $0x88, %r14d
addq 0x10073c(%rip), %r14    # 0x13cfd8
leaq 0x28(%rsp), %r15
movq 0x20(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %r13, %rdi
movq 0x18(%rsp), %rsi
callq 0x71cc6
movq %rbp, %rdi
movq %r14, %rsi
callq 0x71cc6
leaq 0x108db6(%rip), %rax    # 0x145680
movq 0x108(%rax), %rax
movq %rax, 0x130(%rsp)
leaq 0x58(%r12), %rsi
movq %r15, %rdi
callq 0x6fb9e
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6fb9e
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x738aa
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x738aa
movq 0x130(%rsp), %rax
movq %rax, 0x108(%rbx)
movq 0x10(%r12), %r12
movq %r15, %rdi
callq 0x6fa30
testq %r12, %r12
jne 0x3c8a1
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x700c4
jmp 0x3c976
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x700c4
jmp 0x3c96e
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x6fa30
movq %rbx, %rdi
callq 0x6fa30
movq %r14, %rdi
callq 0x220c0
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::InsertElement(gaps::R3SceneElement*)
void R3SceneNode::
InsertElement(R3SceneElement *element) 
{
  // Update goemetry
  assert(!element->node);
  element->node = this;

  // Insert element
  elements.Insert(element);

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rdi, (%rsi)
addq $0x30, %rdi
movl 0x3c(%rbx), %edx
callq 0x87622
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x170(%rbx)
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
jne 0x3c9eb
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::InsertReference(gaps::R3SceneReference*)
void R3SceneNode::
InsertReference(R3SceneReference *reference) 
{
  // Insert reference
  references.Insert(reference);

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x40, %rdi
movl 0x4c(%rbx), %edx
callq 0x87622
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x170(%rbx)
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
jne 0x3ca18
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneNode.cpp
// Function: gaps::R3SceneNode::Draw(gaps::RNFlags, gaps::RNArray<gaps::R3Material*> const*) const
void R3SceneNode::
Draw(const R3DrawFlags draw_flags, const RNArray<R3Material *> *materials) const
{
  // Push transformation
  transformation.Push();

  // Draw elements
  for (int i = 0; i < elements.NEntries(); i++) {
    R3SceneElement *element = elements.Kth(i);
    element->Draw(draw_flags, materials);
  }

  // Draw references
  for (int i = 0; i < references.NEntries(); i++) {
    R3SceneReference *reference = references.Kth(i);
    reference->Draw(draw_flags, materials);
  }

  // Draw children
  for (int i = 0; i < children.NEntries(); i++) {
    R3SceneNode *child = children.Kth(i);
    child->Draw(draw_flags, materials);
  }

  // Pop transformation
  transformation.Pop();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
leaq 0x58(%rdi), %r15
movq %r15, %rdi
callq 0x4521a
cmpl $0x0, 0x3c(%r12)
jle 0x3d236
xorl %r13d, %r13d
movq 0x30(%r12), %rax
movq (%rax,%r13,8), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3dbd0
incq %r13
movslq 0x3c(%r12), %rax
cmpq %rax, %r13
jl 0x3d215
cmpl $0x0, 0x4c(%r12)
jle 0x3d262
xorl %r13d, %r13d
movq 0x40(%r12), %rax
movq (%rax,%r13,8), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3e052
incq %r13
movslq 0x4c(%r12), %rax
cmpq %rax, %r13
jl 0x3d241
cmpl $0x0, 0x2c(%r12)
jle 0x3d28e
xorl %r13d, %r13d
movq 0x20(%r12), %rax
movq (%rax,%r13,8), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3d1ec
incq %r13
movslq 0x2c(%r12), %rax
cmpq %rax, %r13
jl 0x3d26d
movq %r15, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x45256
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::NFacets() const
const RNInterval R3SceneElement::
NFacets(void) const
{
  // Initialize nfacets
  RNInterval nfacets(0,0);
  
  // Add facets from shapes
  for (int i = 0; i < NShapes(); i++) {
    R3Shape *shape = Shape(i);
    nfacets += shape->NFacets();
  }
  
  // Return nfacets
  return nfacets;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorpd %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x8928e
cmpl $0x0, 0x1c(%r14)
jle 0x3d6b0
xorl %r12d, %r12d
movq %rsp, %r15
movq 0x10(%r14), %rax
movq (%rax,%r12,8), %rsi
movq (%rsi), %rax
movq %r15, %rdi
callq *0x48(%rax)
movupd (%rbx), %xmm0
addpd (%rsp), %xmm0
movupd %xmm0, (%rbx)
incq %r12
movslq 0x1c(%r14), %rax
cmpq %rax, %r12
jl 0x3d686
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::Length() const
const RNLength R3SceneElement::
Length(void) const
{
  // Initialize length
  RNLength length = 0;
  
  // Add length from shapes
  for (int i = 0; i < NShapes(); i++) {
    R3Shape *shape = Shape(i);
    length += shape->Length();
  }
  
  // Return length
  return length;
}

// Assembly:
cmpl $0x0, 0x1c(%rdi)
jle 0x3d70e
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x10(%rbx), %rax
movq (%rax,%r14,8), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x1c(%rbx), %rax
cmpq %rax, %r14
jl 0x3d6d4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::Area() const
const RNArea R3SceneElement::
Area(void) const
{
  // Initialize area
  RNArea area = 0;
  
  // Add area from shapes
  for (int i = 0; i < NShapes(); i++) {
    R3Shape *shape = Shape(i);
    area += shape->Area();
  }
  
  // Return area
  return area;
}

// Assembly:
cmpl $0x0, 0x1c(%rdi)
jle 0x3d760
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x10(%rbx), %rax
movq (%rax,%r14,8), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x1c(%rbx), %rax
cmpq %rax, %r14
jl 0x3d726
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::Volume() const
const RNVolume R3SceneElement::
Volume(void) const
{
  // Initialize volume
  RNVolume volume = 0;
  
  // Add volume from shapes
  for (int i = 0; i < NShapes(); i++) {
    R3Shape *shape = Shape(i);
    volume += shape->Volume();
  }

  // Return volume
  return volume;
}

// Assembly:
cmpl $0x0, 0x1c(%rdi)
jle 0x3d7b2
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x10(%rbx), %rax
movq (%rax,%r14,8), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x1c(%rbx), %rax
cmpq %rax, %r14
jl 0x3d778
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::InsertShape(gaps::R3Shape*)
void R3SceneElement::
InsertShape(R3Shape *shape) 
{
  // Insert shape
  shapes.Insert(shape);

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x10, %rdi
movl 0x1c(%rbx), %edx
callq 0x87622
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x30(%rbx)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3d7e8
popq %rbx
jmp 0x3c9b2
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::RemoveShape(gaps::R3Shape*)
void R3SceneElement::
RemoveShape(R3Shape *shape) 
{
  // Remove shape
  shapes.Remove(shape);

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
movq %r14, %rdi
callq 0x87604
subq 0x10(%rbx), %rax
shrq $0x3, %rax
movq %r14, %rdi
movl %eax, %esi
callq 0x877ac
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x30(%rbx)
movq (%rbx), %rdi
addq $0x8, %rsp
testq %rdi, %rdi
je 0x3d84d
popq %rbx
popq %r14
jmp 0x3c9b2
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::Transform(gaps::R3Transformation const&)
void R3SceneElement::
Transform(const R3Transformation& transformation)
{
  // Transform all shapes
  for (int i = 0; i < NShapes(); i++) {
    R3Shape *shape = Shape(i);
    shape->Transform(transformation);
  }


  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x1c(%rdi)
jle 0x3d886
movq %rsi, %r14
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0xa0(%rax)
incq %r15
movslq 0x1c(%rbx), %rax
cmpq %rax, %r15
jl 0x3d866
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x30(%rbx)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3d8a6
popq %rbx
popq %r14
popq %r15
jmp 0x3c9b2
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::FindClosest(gaps::R3Point const&, gaps::R3Shape**, gaps::R3Point*, gaps::R3Vector*, double*, double, double) const
RNBoolean R3SceneElement::
FindClosest(const R3Point& point, R3Shape **hit_shape,
  R3Point *hit_point, R3Vector *hit_normal, RNLength *hit_d,
  RNLength min_d, RNLength max_d) const
{
  // Check if bounding box is within max_d
  RNScalar bbox_d = R3Distance(point, BBox());
  if (bbox_d > max_d) return FALSE;

  // Find distance to closest shape
  RNBoolean found = FALSE;
  for (int i = 0; i < NShapes(); i++) {
    R3Shape *shape = Shape(i);
    R3Point closest = shape->ClosestPoint(point);
    RNLength d = R3Distance(closest, point);
    if ((d >= min_d) && (d <= max_d)) {
      if (hit_shape) *hit_shape = shape;
      if (hit_point) *hit_point = closest;
      if (hit_normal) *hit_normal = R3zero_vector; // ???
      if (hit_d) *hit_d = d;
      found = TRUE;
      max_d = d;
    }
  }

  // Return whether hit any shape
  return found;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x38(%rsp)
movq %r9, %rbx
movq %r8, 0x30(%rsp)
movq %rcx, %r15
movq %rdx, 0x28(%rsp)
movq %rsi, %r13
movq %rdi, %rbp
movsd 0x30(%rdi), %xmm0
ucomisd 0x9e28b(%rip), %xmm0    # 0xdbbb0
jne 0x3d931
jp 0x3d931
movq %rbp, %rdi
callq 0x3dc5e
leaq 0x28(%rbp), %rsi
movq %r13, %rdi
callq 0x4e35f
xorl %r14d, %r14d
ucomisd 0x8(%rsp), %xmm0
ja 0x3da1a
movq %r15, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
cmpl $0x0, 0x1c(%rbp)
jle 0x3da1a
xorl %r12d, %r12d
leaq 0x40(%rsp), %rbx
xorl %r14d, %r14d
movq 0x10(%rbp), %rax
movq (%rax,%r12,8), %r15
movq (%r15), %rax
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *0x70(%rax)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4e0d4
ucomisd 0x38(%rsp), %xmm0
jb 0x3da0a
movapd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x3da0a
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x3d9b2
movq %r15, (%rax)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
movq 0x30(%rsp), %r14
movsd %xmm1, 0x10(%rsp)
je 0x3d9d5
movq %rbx, %rsi
callq 0x75732
movsd 0x10(%rsp), %xmm1
testq %r14, %r14
movq 0x20(%rsp), %r15
je 0x3d9f4
movq %r14, %rdi
leaq 0x9f387(%rip), %rsi     # 0xdcd70
callq 0x765ea
movsd 0x10(%rsp), %xmm1
movl $0x1, %r14d
testq %r15, %r15
je 0x3da04
movsd %xmm1, (%r15)
movsd %xmm1, 0x8(%rsp)
incq %r12
movslq 0x1c(%rbp), %rax
cmpq %rax, %r12
jl 0x3d96b
movl %r14d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::Intersects(gaps::R3Ray const&, gaps::R3Shape**, gaps::R3Point*, gaps::R3Vector*, double*, double, double) const
RNBoolean R3SceneElement::
Intersects(const R3Ray& ray, R3Shape **hit_shape,
  R3Point *hit_point, R3Vector *hit_normal, RNScalar *hit_t,
  RNScalar min_t, RNScalar max_t) const
{
  // Variables
  RNScalar bbox_t;
  RNScalar closest_t = max_t;
  R3Point point;
  R3Vector normal;
  RNScalar t;

  // Check if ray intersects bounding box
  if (!R3Intersects(ray, BBox(), NULL, NULL, &bbox_t)) return FALSE;
  if (RNIsGreater(bbox_t, max_t)) return FALSE;

  // Intersect with shapes
  for (int i = 0; i < NShapes(); i++) {
    R3Shape *shape = Shape(i);
    if (shape->Intersects(ray, &point, &normal, &t)) {
      if ((t >= min_t) && (t <= closest_t)) {
        if (hit_shape) *hit_shape = shape;
        if (hit_point) *hit_point = point;
        if (hit_normal) *hit_normal = normal;
        if (hit_t) *hit_t = t;
        closest_t = t;
      }
    }
  }

  // Return whether hit any shape
  return (closest_t == max_t) ? FALSE : TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movsd %xmm1, (%rsp)
movsd %xmm0, 0x38(%rsp)
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r12
movq %rdx, 0x30(%rsp)
movq %rsi, %r13
movq %rdi, %rbp
leaq 0x60(%rsp), %rdi
callq 0x753c8
leaq 0x48(%rsp), %rdi
callq 0x75e5c
movsd 0x30(%rbp), %xmm0
ucomisd 0x9e136(%rip), %xmm0    # 0xdbbb0
jne 0x3da86
jp 0x3da86
movq %rbp, %rdi
callq 0x3dc5e
leaq 0x28(%rbp), %rsi
xorl %ebx, %ebx
leaq 0x40(%rsp), %r8
movq %r13, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x48095
testl %eax, %eax
je 0x3dbbe
movsd 0x40(%rsp), %xmm0
leaq 0x100626(%rip), %rax    # 0x13e0d8
movsd (%rsp), %xmm1
subsd %xmm1, %xmm0
ucomisd (%rax), %xmm0
ja 0x3dbbe
movq %r12, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq %r14, 0x28(%rsp)
cmpl $0x0, 0x1c(%rbp)
movapd %xmm1, %xmm0
jle 0x3dbb1
xorl %r15d, %r15d
leaq 0x60(%rsp), %rbx
leaq 0x48(%rsp), %r14
movapd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x10(%rbp), %rax
movq (%rax,%r15,8), %r12
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r14, %rcx
leaq 0x10(%rsp), %r8
callq *0x1d8(%rax)
testl %eax, %eax
je 0x3db96
movsd 0x10(%rsp), %xmm0
ucomisd 0x38(%rsp), %xmm0
jb 0x3db96
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movapd %xmm1, %xmm0
movsd (%rsp), %xmm1
jb 0x3dba1
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x3db50
movq %r12, (%rax)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x3db67
movq %rbx, %rsi
callq 0x75732
movsd (%rsp), %xmm1
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
movq 0x28(%rsp), %r12
je 0x3db83
movq %r14, %rsi
callq 0x765ea
movsd (%rsp), %xmm1
movsd 0x10(%rsp), %xmm0
testq %r12, %r12
je 0x3dba1
movsd %xmm0, (%r12)
jmp 0x3dba1
movsd (%rsp), %xmm1
movsd 0x8(%rsp), %xmm0
incq %r15
movslq 0x1c(%rbp), %rax
cmpq %rax, %r15
jl 0x3daf3
cmpneqsd %xmm1, %xmm0
movq %xmm0, %rbx
andl $0x1, %ebx
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::Draw(gaps::RNFlags, gaps::RNArray<gaps::R3Material*> const*) const
void R3SceneElement::
Draw(const R3DrawFlags draw_flags, const RNArray<R3Material *> *materials) const
{
  // Check shapes
  if (NShapes() == 0) return;

  // Draw material
  if (material && draw_flags[R3_SURFACE_MATERIAL_DRAW_FLAG]) {
    int material_index = material->SceneIndex();
    if (materials && (material_index >= 0) && (material_index < materials->NEntries()) && materials->Kth(material_index)) materials->Kth(material_index)->Draw();
    else material->Draw();
  }

  // Draw shapes
  if (0 && (draw_flags == R3_DEFAULT_DRAW_FLAGS)) {
    // Create display list
    if (opengl_id == 0) {
      // Begin display list
      R3SceneElement *element = (R3SceneElement *) this;
      element->opengl_id = glGenLists(1);
      glNewList(opengl_id, GL_COMPILE);
      
      // Draw shapes
      for (int i = 0; i < NShapes(); i++) {
        R3Shape *shape = Shape(i);
        shape->Draw(draw_flags);
      }

      // End display list
      glEndList();
    }

    // Call display list
    glCallList(opengl_id);
  }
  else {
    // Draw shapes with non-default draw flags
    for (int i = 0; i < NShapes(); i++) {
      R3Shape *shape = Shape(i);
      shape->Draw(draw_flags);
    }
  }
}

// Assembly:
cmpl $0x0, 0x1c(%rdi)
je 0x3dc5c
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rax
testq %rax, %rax
sete %cl
testb $0x40, %bl
sete %sil
orb %cl, %sil
jne 0x3dc2d
movslq 0x8(%rax), %rcx
testq %rcx, %rcx
sets %sil
testq %rdx, %rdx
sete %dil
orb %sil, %dil
jne 0x3dc23
cmpl 0xc(%rdx), %ecx
jge 0x3dc23
movq (%rdx), %rdx
movq (%rdx,%rcx,8), %rdi
testq %rdi, %rdi
jne 0x3dc26
movq %rax, %rdi
xorl %esi, %esi
callq 0x43cee
cmpl $0x0, 0x1c(%r14)
jle 0x3dc57
xorl %r15d, %r15d
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0xa8(%rax)
incq %r15
movslq 0x1c(%r14), %rax
cmpq %rax, %r15
jl 0x3dc37
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3SceneElement.cpp
// Function: gaps::R3SceneElement::UpdateBBox()
void R3SceneElement::
UpdateBBox(void)
{
  // Update bounding box
  bbox = R3null_box;
  for (int i = 0; i < NShapes(); i++) {
    R3Shape *shape = Shape(i);
    bbox.Union(shape->BBox());
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
addq $0x30, %rdi
leaq 0x1078a1(%rip), %r14    # 0x145518
leaq 0x8(%r14), %rsi
callq 0x75732
leaq 0x48(%rbx), %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0x75732
cmpl $0x0, 0x1c(%rbx)
jle 0x3dcd3
leaq 0x28(%rbx), %r14
xorl %r12d, %r12d
movq %rsp, %r15
movq 0x10(%rbx), %rax
movq (%rax,%r12,8), %rsi
movq (%rsi), %rax
movq %r15, %rdi
callq *0x88(%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6d794
movq %r15, %rdi
callq 0x6dafc
incq %r12
movslq 0x1c(%rbx), %rax
cmpq %rax, %r12
jl 0x3dca0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6dafc
movq %rbx, %rdi
callq 0x220c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::SetCamera(gaps::R3Camera const&)
void R3Viewer::
SetCamera(const R3Camera& camera)
{
    // Set viewer's camera
    this->camera = camera;
    RNScalar aspect = ((RNScalar) viewport.Height()) / ((RNScalar) viewport.Width());
    this->camera.SetYFOV(atan(aspect * tan(camera.XFOV())));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rdi), %r15
movq %r15, %rdi
callq 0x4048c
cvtdq2pd 0xa0(%r14), %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
divsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
movsd 0x60(%rbx), %xmm0
callq 0x214c0
mulsd (%rsp), %xmm0
callq 0x21730
movq %r15, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x40412
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::ResizeViewport(int, int, int, int)
void R3Viewer::
ResizeViewport (int xmin, int ymin, int width, int height) 
{
    // Resize viewport
    viewport.Resize(xmin, ymin, width, height);

    // Adjust camera field of view to match viewport aspect ratio
    RNScalar aspect = (RNScalar) height / (RNScalar) width;
    camera.SetYFOV(atan(aspect * tan(camera.XFOV())));
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %r8d, %ebx
movl %ecx, %ebp
movq %rdi, %r14
addq $0x98, %rdi
callq 0x407b6
cvtsi2sd %ebx, %xmm1
cvtsi2sd %ebp, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x68(%r14), %xmm0
addq $0x8, %r14
callq 0x214c0
mulsd 0x8(%rsp), %xmm0
callq 0x21730
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x40412
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::ScaleWorld(gaps::R3Point const&, double)
void R3Viewer::
ScaleWorld (const R3Point& origin, RNScalar factor)
{
    // Scale world by factor - translate camera
    assert(factor > 0.0);
    factor = (factor - 1.0) / factor;
    camera.Translate((origin - camera.Origin()) * factor);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movsd 0x9c1e4(%rip), %xmm1    # 0xda4d0
addsd %xmm0, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
addq $0x8, %rbx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x75626
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x767fa
movq %rbx, %rdi
movq %r15, %rsi
callq 0x40424
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::RotateWorld(gaps::R3Point const&, gaps::R3Vector const&, double)
void R3Viewer::
RotateWorld (const R3Point& origin, const R3Vector& axis, RNAngle dtheta)
{
    // Rotate camera around line (origin, axis)
    R3Line axis_line = R3Line(origin, axis);
    R3Point apex = camera.Origin();
    apex.Rotate(axis_line, dtheta);
    R3Vector towards = camera.Towards();
    towards.Rotate(axis, dtheta);
    R3Vector up = camera.Up();
    up.Rotate(axis, dtheta);
    camera.Reset(apex, towards, up);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdx, %rbx
movq %rdi, %r12
leaq 0x58(%rsp), %r13
movq %r13, %rdi
xorl %ecx, %ecx
callq 0x750e0
leaq 0x8(%r12), %r14
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x753da
movq %r15, %rdi
movq %r13, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x75c62
leaq 0x50(%r12), %rsi
leaq 0x28(%rsp), %r13
movq %r13, %rdi
callq 0x76a98
movq %r13, %rdi
movq %rbx, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x7660a
addq $0x38, %r12
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0x75e6e
movq %rbp, %rdi
movq %rbx, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x7660a
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x4012a
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::TranslateWorld(double, gaps::R3Point const&, int, int, int, int)
void R3Viewer::
TranslateWorld(RNScalar factor, const R3Point& origin, int, int, int dx, int dy)
{
    // Translate world based on mouse (dx,dy)
    if ((dx == 0) && (dy == 0)) return;
    RNLength length = factor * R3Distance(origin, camera.Origin()) * tan(camera.XFOV());
    RNLength vx = length * (RNLength) dx / (RNLength) viewport.Width();
    RNLength vy = length * (RNLength) dy / (RNLength) viewport.Height();
    R3Vector vector = (camera.Right() * vx) + (camera.Up() * vy);
    TranslateWorld(vector);
}

// Assembly:
movl %r9d, %eax
orl %r8d, %eax
je 0x3e4e8
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movl %r9d, %ebp
movl %r8d, %r15d
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
movq %rsi, %rdi
movq %rbx, %rsi
movsd %xmm0, (%rsp)
callq 0x4e0d4
mulsd (%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x68(%r14), %xmm0
callq 0x214c0
movapd %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
mulsd (%rsp), %xmm2
mulsd %xmm2, %xmm0
cvtsi2sdl 0xa0(%r14), %xmm1
divsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %ebp, %xmm1
mulsd %xmm1, %xmm2
xorps %xmm1, %xmm1
cvtsi2sdl 0xa4(%r14), %xmm1
divsd %xmm1, %xmm2
movsd %xmm2, (%rsp)
leaq 0x20(%r14), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x767fa
addq $0x38, %r14
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movsd (%rsp), %xmm0
callq 0x767fa
leaq 0x38(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x76ab8
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x76a98
movq %rbx, %rdi
movq %r15, %rsi
callq 0x40424
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::ScaleWorld(double, gaps::R3Point const&, int, int, int, int)
void R3Viewer::
ScaleWorld(RNScalar factor, const R3Point& origin, int, int, int dx, int dy)
{
    // Scale world based on mouse dx
    if ((dx == 0) && (dy == 0)) return;
    RNScalar motion = (RNScalar) dx / (RNScalar) viewport.Width() + (RNScalar) dy / (RNScalar) viewport.Height();
    RNScalar scale = exp(2.0 * factor * motion);
    ScaleWorld(origin, scale);
}

// Assembly:
movl %r9d, %eax
orl %r8d, %eax
je 0x3e545
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movd %r9d, %xmm1
movd %r8d, %xmm2
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
cvtdq2pd 0xa0(%rdi), %xmm1
cvtdq2pd %xmm2, %xmm2
divpd %xmm1, %xmm2
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
addsd %xmm0, %xmm0
mulsd %xmm1, %xmm0
callq 0x22110
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3e2d8
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Viewer.cpp
// Function: gaps::R3Viewer::RotateWorld(double, gaps::R3Point const&, int, int, int, int)
void R3Viewer::
RotateWorld(RNScalar factor, const R3Point& origin, int, int, int dx, int dy)
{
    // Rotate world based on mouse (dx)
    if ((dx == 0) && (dy == 0)) return;
    RNLength vx = (RNLength) dx / (RNLength) viewport.Width();
    RNLength vy = (RNLength) dy / (RNLength) viewport.Height();
    RNAngle theta = factor * 4.0 * (fabs(vx) + fabs(vy));
    R3Vector vector = (camera.Right() * vx) + (camera.Up() * vy);
    R3Vector axis = camera.Towards() % vector;
    axis.Normalize();
    RotateWorld(origin, axis, theta);
}

// Assembly:
movl %r9d, %eax
orl %r8d, %eax
je 0x3e63b
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movd %r9d, %xmm1
movd %r8d, %xmm2
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
cvtdq2pd %xmm2, %xmm3
mulsd 0x9d641(%rip), %xmm0    # 0xdbbc0
cvtdq2pd 0xa0(%rdi), %xmm1
divpd %xmm1, %xmm3
movapd 0x9d65d(%rip), %xmm1    # 0xdbbf0
andpd %xmm3, %xmm1
movapd %xmm3, (%rsp)
pshufd $0xee, %xmm1, %xmm2     # xmm2 = xmm1[2,3,2,3]
addsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
movapd %xmm2, 0x10(%rsp)
leaq 0x20(%rdi), %rsi
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movapd %xmm3, %xmm0
callq 0x767fa
leaq 0x38(%r14), %rsi
movaps (%rsp), %xmm0
movhlps %xmm0, %xmm0            # xmm0 = xmm0[1,1]
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x767fa
leaq 0x58(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x76ab8
leaq 0x50(%r14), %rsi
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x76a98
leaq 0x40(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x76792
movq %r12, %rdi
callq 0x76174
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movaps 0x10(%rsp), %xmm0
callq 0x3e33a
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq