LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::CreateDirectionalLights()
void R3Scene::
CreateDirectionalLights(void)
{
  // Create directional light pointing diagonally down
  RNRgb color1(1,1,1);
  R3Vector direction1(-3,-4,-5);
  direction1.Normalize();
  R3DirectionalLight *light1 = new R3DirectionalLight(direction1, color1);
  InsertLight(light1);

  // Create second (weaker) directional light pointing diagonally up
  RNRgb color2(0.5, 0.5, 0.5);
  R3Vector direction2(3,2,3);
  direction2.Normalize();
  R3DirectionalLight *light2 = new R3DirectionalLight(direction2, color2);
  InsertLight(light2);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
leaq 0x48(%rsp), %r14
movsd 0xb3017(%rip), %xmm0    # 0xdc018
movq %r14, %rdi
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x88530
leaq 0x30(%rsp), %r12
movsd 0xb348c(%rip), %xmm0    # 0xdc4a8
movsd 0xb348c(%rip), %xmm1    # 0xdc4b0
movsd 0xb348c(%rip), %xmm2    # 0xdc4b8
movq %r12, %rdi
callq 0x76d52
movq %r12, %rdi
callq 0x77074
movl $0x68, %edi
callq 0x218c0
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
movsd 0xb2fbe(%rip), %xmm0    # 0xdc018
movl $0x1, %ecx
callq 0x429d2
movq %rbx, 0x8(%r15)
leaq 0x18(%rbx), %r14
movl 0x24(%rbx), %edx
movl %edx, 0x10(%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x88752
leaq 0x18(%rsp), %r15
movsd 0xb2f95(%rip), %xmm0    # 0xdc020
movq %r15, %rdi
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x88530
movq %rsp, %r13
movsd 0xb341c(%rip), %xmm1    # 0xdc4c0
movsd 0xb341c(%rip), %xmm0    # 0xdc4c8
movq %r13, %rdi
movaps %xmm0, %xmm2
callq 0x76d52
movq %r13, %rdi
callq 0x77074
movl $0x68, %edi
callq 0x218c0
movq %rax, %r12
movsd 0xb2f44(%rip), %xmm0    # 0xdc018
movq %rax, %rdi
movq %r13, %rsi
movq %r15, %rdx
movl $0x1, %ecx
callq 0x429d2
movq %rbx, 0x8(%r12)
movl 0x24(%rbx), %edx
movl %edx, 0x10(%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x88752
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x68, %esi
movq %r12, %rdi
jmp 0x29125
movq %rax, %rbx
movl $0x68, %esi
movq %r15, %rdi
callq 0x218e0
movq %rbx, %rdi
callq 0x220d0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::LoadLights(int, int) const
int R3Scene::
LoadLights(int min_index, int max_index) const
{
  // Set ambient light
  static GLfloat ambient[4];
  ambient[0] = Ambient().R();
  ambient[1] = Ambient().G();
  ambient[2] = Ambient().B();
  ambient[3] = 1;
  glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient);

  // Draw lights 
  int count = 0;
  for (int i = 0; i < NLights(); i++) {
    R3Light *light = Light(i);
    if (min_index + count > max_index) break;
    light->Draw(min_index + count);
    count++;
  }

  // Return number of lights loaded
  return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
movupd 0x118(%rdi), %xmm0
cvtpd2ps %xmm0, %xmm0
movlpd %xmm0, 0x11b8a2(%rip)   # 0x144a10
xorps %xmm0, %xmm0
cvtsd2ss 0x128(%rdi), %xmm0
movl %esi, %r15d
leaq 0x11b88d(%rip), %rsi    # 0x144a10
movss %xmm0, 0x11b88d(%rip)   # 0x144a18
movl $0x3f800000, 0x11b887(%rip) # imm = 0x3F800000
movl $0xb53, %edi            # imm = 0xB53
callq 0x22210
cmpl $0x0, 0x24(%r14)
jle 0x291d9
xorl %r13d, %r13d
xorl %r12d, %r12d
leal (%r12,%r15), %ebp
cmpl %ebx, %ebp
jg 0x291c7
movq 0x18(%r14), %rax
movq (%rax,%r13,8), %rdi
movq (%rdi), %rax
movl %ebp, %esi
callq *0x70(%rax)
incl %r12d
cmpl %ebx, %ebp
jg 0x291dc
incq %r13
movslq 0x24(%r14), %rax
cmpq %rax, %r13
jl 0x291ac
jmp 0x291dc
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::Draw(gaps::RNFlags) const
void R3Scene::
Draw(const R3DrawFlags draw_flags) const
{
  // Draw null material
  R3null_material.Draw();

  // Draw nodes recursively
  if (NLights() > 7) DrawNodeWithLights(this, root, R3identity_affine, draw_flags, 1, 7);
  else root->Draw(draw_flags);

  // Draw null material
  R3null_material.Draw();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x11b9c7(%rip), %rdi    # 0x144e20
xorl %esi, %esi
callq 0x442d0
cmpl $0x8, 0x24(%r14)
movq (%r14), %rsi
jl 0x2947e
leaq 0x11e20f(%rip), %rdx    # 0x147680
movq %r14, %rdi
movq %rbx, %rcx
callq 0x294a0
jmp 0x2948b
movq %rsi, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3d69c
leaq 0x11b98e(%rip), %rdi    # 0x144e20
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x442d0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::ReadMeshFile(char const*, gaps::R3SceneNode*)
int R3Scene::
ReadMeshFile(const char *filename, R3SceneNode *parent_node)
{
  // Check/set parent node
  if (!parent_node) parent_node = root;

  // Load triangles into scene
  R3TriangleArray *shape = ReadMesh(filename);
  if (!shape) return 0;
  R3SceneElement *element = new R3SceneElement();
  element->InsertShape(shape);
  R3SceneNode *node = new R3SceneNode(this);
  node->InsertElement(element);
  parent_node->InsertChild(node);

  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
testq %rdx, %rdx
jne 0x2d1cc
movq (%r14), %rbx
movq %rsi, %rdi
callq 0x33d50
testq %rax, %rax
je 0x2d233
movq %rax, %r12
movl $0x60, %edi
callq 0x218c0
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
callq 0x3d9c4
movq %r15, %rdi
movq %r12, %rsi
callq 0x3dc6c
movl $0x1b0, %edi            # imm = 0x1B0
callq 0x218c0
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x3bab8
movq %r12, %rdi
movq %r15, %rsi
callq 0x3ceca
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3ce8e
movl $0x1, %eax
jmp 0x2d235
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x1b0, %esi            # imm = 0x1B0
movq %r12, %rdi
jmp 0x2d259
movq %rax, %rbx
movl $0x60, %esi
movq %r15, %rdi
callq 0x218e0
movq %rbx, %rdi
callq 0x220d0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::WriteFile(char const*) const
int R3Scene::
WriteFile(const char *filename) const
{
  // Parse input filename extension
  const char *extension;
  if (!(extension = strrchr(filename, '.'))) {
    RNFail("Filename %s has no extension (e.g., .txt)\n", filename);
    return 0;
  }

  // Write file of appropriate type
  if (!strncmp(extension, ".scn", 4)) {
    if (!WritePrincetonFile(filename)) return 0;
  }
  else if (!strncmp(extension, ".obj", 4)) {
    if (!WriteObjFile(filename)) return 0;
  }
  else if (!strncmp(extension, ".json", 4)) {
    if (!WriteSUNCGFile(filename)) return 0;
  }
  else {
    RNFail("Unable to write file %s (unrecognized extension: %s)\n", filename, extension);
    return 0;
  }

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movl $0x2e, %esi
callq 0x219b0
testq %rax, %rax
je 0x3071a
movq %rax, %r15
leaq 0xabeea(%rip), %rsi     # 0xdc5ab
movl $0x4, %edx
movq %rax, %rdi
callq 0x213d0
testl %eax, %eax
je 0x3072f
leaq 0xacbb7(%rip), %rsi     # 0xdd290
movl $0x4, %edx
movq %r15, %rdi
callq 0x213d0
testl %eax, %eax
je 0x3073c
leaq 0xabede(%rip), %rsi     # 0xdc5cf
movl $0x4, %edx
movq %r15, %rdi
callq 0x213d0
testl %eax, %eax
je 0x30754
leaq 0xabf01(%rip), %rdi     # 0xdc60a
xorl %ebp, %ebp
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x8b53a
jmp 0x3076c
leaq 0xabe5f(%rip), %rdi     # 0xdc580
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x8b53a
jmp 0x3076c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3077a
jmp 0x3075f
movq %r14, %rdi
callq 0x28b08
movq (%r14), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x3389e
jmp 0x3075f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x30dc0
testl %eax, %eax
je 0x3076a
movl $0x1, %ebp
jmp 0x3076c
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::WriteSUNCGFile(char const*) const
int R3Scene::
WriteSUNCGFile(const char *filename) const
{
  // Open file
  FILE *fp;
  if (!(fp = fopen(filename, "w"))) {
    RNFail("Unable to open file %s", filename);
    return 0;
  }

  // Write header
  fprintf(fp, "{\n");
  fprintf(fp, "  \"version\":\"suncg@1.0.0\",\n");
  if (root->Name()) fprintf(fp, "  \"id\":\"%s\",\n", root->Name());
  fprintf(fp, "  \"up\":[0,1,0],\n");
  fprintf(fp, "  \"front\":[0,0,1],\n");
  fprintf(fp, "  \"scaleToMeters\":1,\n");  
  fprintf(fp, "  \"levels\":[\n");  

  // Write nodes recursively
  for (int i = 0; i < root->NChildren(); i++) {
    R3SceneNode *child = root->Child(i);
    if (!WriteSUNCGNode(this, child, fp)) {
      fclose(fp);
      return 0;
    }
  }

  // Write trailer
  fprintf(fp, "\n  ]\n");
  fprintf(fp, "}\n");
  
  // Close file
  fclose(fp);
  
  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0xaf04a(%rip), %rsi     # 0xdfe1c
movq %r15, %rdi
callq 0x21ac0
testq %rax, %rax
je 0x30f0c
movq %rax, %rbx
leaq 0xacba4(%rip), %rdi     # 0xdd991
movl $0x2, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x222a0
leaq 0xac4d4(%rip), %rdi     # 0xdd2da
movl $0x1b, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x222a0
movq (%r14), %rax
movq 0x1a0(%rax), %rdx
testq %rdx, %rdx
je 0x30e38
leaq 0xacb6c(%rip), %rsi     # 0xdd99a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21d90
leaq 0xac4b7(%rip), %rdi     # 0xdd2f6
movl $0x10, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x222a0
leaq 0xac4af(%rip), %rdi     # 0xdd307
movl $0x13, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x222a0
leaq 0xac4aa(%rip), %rdi     # 0xdd31b
movl $0x15, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x222a0
leaq 0xac4a7(%rip), %rdi     # 0xdd331
movl $0xd, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x222a0
movq (%r14), %rax
cmpl $0x0, 0x2c(%rax)
jle 0x30ecb
xorl %r15d, %r15d
movq 0x20(%rax), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
callq 0x354d4
testl %eax, %eax
je 0x30f21
incq %r15
movq (%r14), %rax
movslq 0x2c(%rax), %rcx
cmpq %rcx, %r15
jl 0x30ea8
leaq 0xac46d(%rip), %rdi     # 0xdd33f
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x222a0
leaq 0xacb31(%rip), %rdi     # 0xdda1c
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x222a0
movq %rbx, %rdi
callq 0x218b0
movl $0x1, %ebx
jmp 0x30f2b
leaq 0xab733(%rip), %rdi     # 0xdc646
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0x8b53a
jmp 0x30f2b
movq %rbx, %rdi
callq 0x218b0
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::ReadMesh(char const*)
static R3TriangleArray *
ReadMesh(const char *filename)
{
  // Read mesh file
  R3Mesh mesh;
  if (!mesh.ReadFile(filename)) {
    RNFail("Unable to read mesh %s\n", filename);
    return NULL;
  }

  // Allocate triangle array
  R3TriangleArray *array = new R3TriangleArray();
  if (!array) {
    RNFail("Unable to allocate triangle array");
    return NULL;
  }

  // Load mesh into triangle array
  array->LoadMesh(mesh);

  // Return triangle array
  return array;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %r14
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x51a10
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5ea2e
testl %eax, %eax
je 0x33d9d
movl $0x70, %edi
callq 0x218c0
movq %rax, %rbx
movq %rax, %rdi
callq 0x686ac
movq (%rbx), %rax
movq %rsp, %rsi
movq %rbx, %rdi
callq *0x240(%rax)
jmp 0x33db0
xorl %ebx, %ebx
leaq 0xa8a4c(%rip), %rdi     # 0xdc7f2
movq %r14, %rsi
xorl %eax, %eax
callq 0x8b53a
movq %rsp, %rdi
callq 0x51f3e
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r14
retq
movq %rax, %r14
movl $0x70, %esi
movq %rbx, %rdi
callq 0x218e0
jmp 0x33ddd
jmp 0x33dda
movq %rax, %r14
movq %rsp, %rdi
callq 0x51f3e
movq %r14, %rdi
callq 0x220d0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::FindPrincetonMaterialAndElement(gaps::R3Scene*, gaps::R3SceneNode*, gaps::RNArray<gaps::R3Material*> const&, int, gaps::R3Material*&, gaps::R3Material*&, gaps::R3SceneElement*&)
static int
FindPrincetonMaterialAndElement(R3Scene *scene, R3SceneNode *node,
  const RNArray<R3Material *>& materials, int m, R3Material *&default_material,
  R3Material *& material, R3SceneElement *& element)
{
  // Find material from m
  material = NULL;
  if (m >= 0) {
    if (m < materials.NEntries()) material = materials[m];
    else return 0;
  }
  else {
    // Get material from 
    material = default_material;
    if (!material) {
      R3Brdf *brdf = new R3Brdf(R3default_brdf);
      scene->InsertBrdf(brdf);
      material = new R3Material(brdf);
      scene->InsertMaterial(material);
      default_material = material;
    }
  }

  // Find element with that material
  element = NULL;
  for (int i = 0; i < node->NElements(); i++) {
    R3SceneElement *e = node->Element(i);
    if (e->Material() == material) { element = e; break; }
  }

  // Create element if none found
  if (!element) {
    element = new R3SceneElement(material);
    node->InsertElement(element);
  }

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movq %rsi, %rbx
movq $0x0, (%r9)
testl %ecx, %ecx
js 0x33e25
xorl %ebp, %ebp
cmpl %ecx, 0xc(%rdx)
jle 0x33f19
movl %ecx, %eax
shlq $0x3, %rax
addq (%rdx), %rax
movq %r14, %r15
jmp 0x33ea9
movq %r8, %r15
movq (%r8), %rax
movq %rax, (%r14)
testq %rax, %rax
jne 0x33eaf
movq %rdi, %r12
movl $0xb8, %edi
callq 0x218c0
movq %rax, %r13
leaq 0x111456(%rip), %rsi    # 0x1452a0
movq %rax, %rdi
xorl %edx, %edx
callq 0x443d8
movq %r12, 0x8(%r13)
leaq 0x38(%r12), %rdi
movl 0x44(%r12), %edx
movl %edx, 0x10(%r13)
movq %r13, %rsi
callq 0x88752
movl $0x30, %edi
callq 0x218c0
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x440f8
movq %rbp, (%r14)
movq %r12, (%rbp)
movl 0x34(%r12), %edx
addq $0x28, %r12
movl %edx, 0x8(%rbp)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x88752
movq %r14, %rax
movq (%rax), %rax
movq %rax, (%r15)
movq 0x40(%rsp), %r12
movq $0x0, (%r12)
movslq 0x3c(%rbx), %rax
testq %rax, %rax
jle 0x33ee6
movq 0x30(%rbx), %rcx
movq (%r14), %rdx
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
cmpq %rdx, 0x8(%rdi)
je 0x33ee2
incq %rsi
cmpq %rsi, %rax
jne 0x33ece
jmp 0x33ee6
movq %rdi, (%r12)
movl $0x1, %ebp
cmpq $0x0, (%r12)
jne 0x33f19
movl $0x60, %edi
callq 0x218c0
movq %rax, %r15
movq (%r14), %rsi
movq %rax, %rdi
callq 0x3d9c4
movq %r15, (%r12)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3ceca
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x30, %esi
movq %rbp, %rdi
jmp 0x33f4f
movq %rax, %rbx
movl $0xb8, %esi
movq %r13, %rdi
jmp 0x33f4f
movq %rax, %rbx
movl $0x60, %esi
movq %r15, %rdi
callq 0x218e0
movq %rbx, %rdi
callq 0x220d0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3bdf0
xorl %r14d, %r14d
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x3beca
incq %r14
movslq 0x3c(%rbx), %rax
cmpq %rax, %r14
jl 0x3bdd4
cmpl $0x0, 0x4c(%rbx)
jle 0x3be15
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x3bf06
incq %r14
movslq 0x4c(%rbx), %rax
cmpq %rax, %r14
jl 0x3bdf9
cmpl $0x0, 0x2c(%rbx)
jle 0x3be3a
xorl %r14d, %r14d
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x3bf3a
incq %r14
movslq 0x2c(%rbx), %rax
cmpq %rax, %r14
jl 0x3be1e
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x3be4b
movq %rbx, %rsi
callq 0x3bf3a
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3be5b
movq %rbx, %rsi
callq 0x2876c
leaq 0x30(%rbx), %r15
leaq 0x40(%rbx), %r12
leaq 0x20(%rbx), %r14
movq 0x1a0(%rbx), %rdi
testq %rdi, %rdi
je 0x3be78
callq 0x21ae0
leaq 0x168(%rbx), %rdi
callq 0x6e944
leaq 0x58(%rbx), %rdi
callq 0x70878
addq $0x50, %rbx
movq %rbx, %rdi
callq 0x372a2
movq %r12, %rdi
callq 0x88726
movq %r15, %rdi
callq 0x88726
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x88726
jmp 0x3bec2
jmp 0x3bec2
jmp 0x3bec2
movq %rax, %rdi
callq 0x37467
// File: /workspace/github_cpp_makefile_star2_O1/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 0x88734
subq 0x30(%rbx), %rax
shrq $0x3, %rax
movq %r14, %rdi
movl %eax, %esi
callq 0x888c6
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3ceae
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x88734
subq 0x40(%rbx), %rax
shrq $0x3, %rax
movq %r14, %rdi
movl %eax, %esi
callq 0x888c6
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3ceae
// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movq %rdi, %r14
addq $0x20, %rdi
movslq 0x18(%rsi), %rax
movq 0x20(%r14), %rcx
movslq 0x2c(%r14), %rdx
movq -0x8(%rcx,%rdx,8), %rsi
movq %rsi, (%rcx,%rax,8)
movl %eax, 0x18(%rsi)
leal -0x1(%rdx), %esi
callq 0x888c6
movq $0x0, 0x10(%rbx)
movl $0xffffffff, 0x18(%rbx) # imm = 0xFFFFFFFF
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3ceae
// File: /workspace/github_cpp_makefile_star2_O1/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 0x8a626
cmpl $0x0, 0x3c(%r14)
jle 0x3bfd9
xorl %r12d, %r12d
movq %rsp, %r15
movq 0x30(%r14), %rax
movq (%rax,%r12,8), %rsi
movq %r15, %rdi
callq 0x3db0c
movupd (%rbx), %xmm0
addpd (%rsp), %xmm0
movupd %xmm0, (%rbx)
incq %r12
movslq 0x3c(%r14), %rax
cmpq %rax, %r12
jl 0x3bfb0
cmpl $0x0, 0x4c(%r14)
jle 0x3c01a
xorl %r12d, %r12d
movq %rsp, %r15
movq 0x40(%r14), %rax
movq (%rax,%r12,8), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x3c00e
movq (%rax), %rsi
movq %r15, %rdi
callq 0x3bf86
movupd (%rbx), %xmm0
addpd (%rsp), %xmm0
movupd %xmm0, (%rbx)
incq %r12
movslq 0x4c(%r14), %rax
cmpq %rax, %r12
jl 0x3bfe6
cmpl $0x0, 0x2c(%r14)
jle 0x3c050
xorl %r12d, %r12d
movq %rsp, %r15
movq 0x20(%r14), %rax
movq (%rax,%r12,8), %rsi
movq %r15, %rdi
callq 0x3bf86
movupd (%rbx), %xmm0
addpd (%rsp), %xmm0
movupd %xmm0, (%rbx)
incq %r12
movslq 0x2c(%r14), %rax
cmpq %rax, %r12
jl 0x3c027
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3c0a7
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3db70
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x3c(%rbx), %rax
cmpq %rax, %r14
jl 0x3c074
jmp 0x3c0ab
xorpd %xmm0, %xmm0
cmpl $0x0, 0x4c(%rbx)
jle 0x3c0f0
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x3c0e4
movq (%rax), %rdi
movsd %xmm0, (%rsp)
callq 0x3c060
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x4c(%rbx), %rax
cmpq %rax, %r14
jl 0x3c0b4
cmpl $0x0, 0x2c(%rbx)
jle 0x3c12a
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3c060
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x2c(%rbx), %rax
cmpq %rax, %r14
jl 0x3c0f9
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3c179
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3dbc2
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x3c(%rbx), %rax
cmpq %rax, %r14
jl 0x3c146
jmp 0x3c17d
xorpd %xmm0, %xmm0
cmpl $0x0, 0x4c(%rbx)
jle 0x3c1c2
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x3c1b6
movq (%rax), %rdi
movsd %xmm0, (%rsp)
callq 0x3c132
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x4c(%rbx), %rax
cmpq %rax, %r14
jl 0x3c186
cmpl $0x0, 0x2c(%rbx)
jle 0x3c1fc
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3c132
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x2c(%rbx), %rax
cmpq %rax, %r14
jl 0x3c1cb
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3c24b
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3dc14
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x3c(%rbx), %rax
cmpq %rax, %r14
jl 0x3c218
jmp 0x3c24f
xorpd %xmm0, %xmm0
cmpl $0x0, 0x4c(%rbx)
jle 0x3c294
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x3c288
movq (%rax), %rdi
movsd %xmm0, (%rsp)
callq 0x3c204
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x4c(%rbx), %rax
cmpq %rax, %r14
jl 0x3c258
cmpl $0x0, 0x2c(%rbx)
jle 0x3c2ce
xorl %r14d, %r14d
movsd %xmm0, (%rsp)
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3c204
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
movslq 0x2c(%rbx), %rax
cmpq %rax, %r14
jl 0x3c29d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa13ee(%rip), %xmm0    # 0xddba0
jne 0x3c7be
jp 0x3c7be
movq %rbx, %rdi
callq 0x3c7ca
addq $0x168, %rbx            # imm = 0x168
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa1204(%rip), %xmm0    # 0xddba0
jne 0x3c9a8
jp 0x3c9a8
movq %rbx, %rdi
callq 0x3c7ca
addq $0x168, %rbx            # imm = 0x168
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa11cb(%rip), %xmm0    # 0xddba0
jne 0x3c9e1
jp 0x3c9e1
movq %r14, %rdi
callq 0x3c7ca
leaq 0x168(%r14), %r15
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x6daec
movq 0x10(%r14), %r14
testq %r14, %r14
je 0x3ca0d
leaq 0x58(%r14), %rsi
movq %r12, %rdi
callq 0x6e810
jmp 0x3c9f6
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6daec
movq %rsp, %rdi
callq 0x6e944
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x3ca31
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6e944
movq %rbx, %rdi
callq 0x220d0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x10aabf(%rip), %rsi    # 0x147518
callq 0x6daec
cmpl $0x0, 0x3c(%r14)
jle 0x3caa5
xorl %r12d, %r12d
movq 0x30(%r14), %rax
movq (%rax,%r12,8), %r15
movsd 0x30(%r15), %xmm0
ucomisd 0xa1122(%rip), %xmm0    # 0xddba0
jne 0x3ca8a
jp 0x3ca8a
movq %r15, %rdi
callq 0x3e114
addq $0x28, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6e5d4
incq %r12
movslq 0x3c(%r14), %rax
cmpq %rax, %r12
jl 0x3ca68
cmpl $0x0, 0x4c(%r14)
jle 0x3cad3
xorl %r15d, %r15d
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x3e2c8
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6e5d4
incq %r15
movslq 0x4c(%r14), %rax
cmpq %rax, %r15
jl 0x3caaf
cmpl $0x0, 0x2c(%r14)
jle 0x3cb20
xorl %r12d, %r12d
movq 0x20(%r14), %rax
movq (%rax,%r12,8), %r15
movsd 0x170(%r15), %xmm0
ucomisd 0xa10aa(%rip), %xmm0    # 0xddba0
jne 0x3cb02
jp 0x3cb02
movq %r15, %rdi
callq 0x3c7ca
addq $0x168, %r15            # imm = 0x168
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6e5d4
incq %r12
movslq 0x2c(%r14), %rax
cmpq %rax, %r12
jl 0x3cadd
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x3cb33
jmp 0x3cb33
movq %rax, %r14
movq %rbx, %rdi
callq 0x6e944
movq %r14, %rdi
callq 0x220d0
// File: /workspace/github_cpp_makefile_star2_O1/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 0xfe584(%rip), %rax     # 0x13b148
addq $0x10, %rax
movq %rax, 0x20(%rsp)
movq %rax, (%rdi)
addq $0x8, %rdi
leaq 0x10aaa5(%rip), %rax    # 0x147680
leaq 0x8(%rax), %rsi
movq %rdi, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
callq 0x72bb6
movl $0x88, %r13d
leaq (%rbx,%r13), %rdi
addq 0x1023d9(%rip), %r13    # 0x13efd8
movq %rdi, 0x8(%rsp)
movq %r13, %rsi
callq 0x72bb6
leaq 0x10aa6d(%rip), %rax    # 0x147680
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 0x72bb6
movq %r12, %rdi
movq %r13, %rsi
callq 0x72bb6
leaq 0x10aa24(%rip), %rax    # 0x147680
movq 0x108(%rax), %rax
movq %rax, 0x130(%rsp)
leaq 0x58(%r14), %rsi
movq %rbp, %rdi
callq 0x709e6
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x709e6
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x7479a
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x7479a
movq 0x130(%rsp), %rax
movq %rax, 0x108(%rbx)
movq 0x10(%r14), %r14
movq %rbp, %rdi
callq 0x70878
testq %r14, %r14
jne 0x3cc33
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 0x70f00
jmp 0x3cd06
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x70f00
jmp 0x3ccfe
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x70878
movq %rbx, %rdi
callq 0x70878
movq %r14, %rdi
callq 0x220d0
// File: /workspace/github_cpp_makefile_star2_O1/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 0xfe41c(%rip), %rax     # 0x13b148
addq $0x10, %rax
movq %rax, 0x20(%rsp)
movq %rax, (%rdi)
addq $0x8, %rdi
leaq 0x10a93d(%rip), %rax    # 0x147680
leaq 0x8(%rax), %rsi
movq %rdi, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
callq 0x72bb6
movl $0x88, %esi
leaq (%rbx,%rsi), %rdi
addq 0x102272(%rip), %rsi    # 0x13efd8
movq %rdi, 0x8(%rsp)
callq 0x72bb6
leaq 0x10a909(%rip), %rax    # 0x147680
movq 0x108(%rax), %rax
movq %rax, 0x108(%rbx)
movq 0x10(%r14), %r12
testq %r12, %r12
je 0x3ce40
leaq 0x30(%rsp), %r13
leaq 0xb0(%rsp), %rbp
movl $0x88, %r14d
addq 0x10222c(%rip), %r14    # 0x13efd8
leaq 0x28(%rsp), %r15
movq 0x20(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %r13, %rdi
movq 0x18(%rsp), %rsi
callq 0x72bb6
movq %rbp, %rdi
movq %r14, %rsi
callq 0x72bb6
leaq 0x10a8a6(%rip), %rax    # 0x147680
movq 0x108(%rax), %rax
movq %rax, 0x130(%rsp)
leaq 0x58(%r12), %rsi
movq %r15, %rdi
callq 0x709e6
movq %r15, %rdi
movq %rbx, %rsi
callq 0x709e6
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x7479a
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x7479a
movq 0x130(%rsp), %rax
movq %rax, 0x108(%rbx)
movq 0x10(%r12), %r12
movq %r15, %rdi
callq 0x70878
testq %r12, %r12
jne 0x3cdb1
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 0x70f00
jmp 0x3ce86
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x70f00
jmp 0x3ce7e
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x70878
movq %rbx, %rdi
callq 0x70878
movq %r14, %rdi
callq 0x220d0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x45806
cmpl $0x0, 0x3c(%r12)
jle 0x3d6e6
xorl %r13d, %r13d
movq 0x30(%r12), %rax
movq (%rax,%r13,8), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3e086
incq %r13
movslq 0x3c(%r12), %rax
cmpq %rax, %r13
jl 0x3d6c5
cmpl $0x0, 0x4c(%r12)
jle 0x3d712
xorl %r13d, %r13d
movq 0x40(%r12), %rax
movq (%rax,%r13,8), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3e512
incq %r13
movslq 0x4c(%r12), %rax
cmpq %rax, %r13
jl 0x3d6f1
cmpl $0x0, 0x2c(%r12)
jle 0x3d73e
xorl %r13d, %r13d
movq 0x20(%r12), %rax
movq (%rax,%r13,8), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3d69c
incq %r13
movslq 0x2c(%r12), %rax
cmpq %rax, %r13
jl 0x3d71d
movq %r15, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x45842
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x8a626
cmpl $0x0, 0x1c(%r14)
jle 0x3db60
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 0x3db36
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3dbbe
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 0x3db84
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3dc10
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 0x3dbd6
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3dc62
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 0x3dc28
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x88752
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x30(%rbx)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3dc98
popq %rbx
jmp 0x3ceae
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x88734
subq 0x10(%rbx), %rax
shrq $0x3, %rax
movq %r14, %rdi
movl %eax, %esi
callq 0x888c6
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x30(%rbx)
movq (%rbx), %rdi
addq $0x8, %rsp
testq %rdi, %rdi
je 0x3dcfd
popq %rbx
popq %r14
jmp 0x3ceae
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3dd36
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 0x3dd16
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x30(%rbx)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3dd56
popq %rbx
popq %r14
popq %r15
jmp 0x3ceae
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9fdcb(%rip), %xmm0    # 0xddba0
jne 0x3dde1
jp 0x3dde1
movq %rbp, %rdi
callq 0x3e114
leaq 0x28(%rbp), %rsi
movq %r13, %rdi
callq 0x4eeff
xorl %r14d, %r14d
ucomisd 0x8(%rsp), %xmm0
ja 0x3deca
movq %r15, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
cmpl $0x0, 0x1c(%rbp)
jle 0x3deca
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 0x4ec74
ucomisd 0x38(%rsp), %xmm0
jb 0x3deba
movapd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x3deba
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x3de62
movq %r15, (%rax)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
movq 0x30(%rsp), %r14
movsd %xmm1, 0x10(%rsp)
je 0x3de85
movq %rbx, %rsi
callq 0x76628
movsd 0x10(%rsp), %xmm1
testq %r14, %r14
movq 0x20(%rsp), %r15
je 0x3dea4
movq %r14, %rdi
leaq 0xa0ed7(%rip), %rsi     # 0xded70
callq 0x774fe
movsd 0x10(%rsp), %xmm1
movl $0x1, %r14d
testq %r15, %r15
je 0x3deb4
movsd %xmm1, (%r15)
movsd %xmm1, 0x8(%rsp)
incq %r12
movslq 0x1c(%rbp), %rax
cmpq %rax, %r12
jl 0x3de1b
movl %r14d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq