LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/sparsepp/./sparsepp/spp.h
// Function: std::pair<unsigned int const, unsigned int>& spp::sparse_hashtable<std::pair<unsigned int const, unsigned int>, unsigned int, Hash32, spp::sparse_hash_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, spp::libc_allocator<std::pair<unsigned int const, unsigned int>>>::SelectKey, spp::sparse_hash_map<unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>, spp::libc_allocator<std::pair<unsigned int const, unsigned int>>>::SetKey, std::equal_to<unsigned int>, spp::libc_allocator<std::pair<unsigned int const, unsigned int>>>::_insert_at<std::pair<unsigned int const, unsigned int>>(std::pair<unsigned int const, unsigned int>&, unsigned long, bool)
reference _insert_at(T& obj, size_type pos, bool erased)
    {
        if (size() >= max_size())
        {
            throw_exception(std::length_error("insert overflow"));
        }
        if (erased)
        {
            assert(num_deleted);
            --num_deleted;
        }
        return table.set(pos, obj);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movabsq $0x1fffffffffffffff, %rax # imm = 0x1FFFFFFFFFFFFFFF
cmpq %rax, 0x48(%rdi)
jb 0x25eb
leaq 0x16a1(%rip), %rsi      # 0x3c71
movq %rsp, %r12
movq %r12, %rdi
callq 0x10c0
movq %r12, %rdi
callq 0x18b7
movq %rsp, %rdi
callq 0x1178
testb %bpl, %bpl
je 0x2600
movq 0x28(%r15), %rax
testq %rax, %rax
je 0x261f
decq %rax
movq %rax, 0x28(%r15)
addq $0x30, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x26f4
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x165b(%rip), %rdi      # 0x3c81
leaq 0xa9a(%rip), %rsi       # 0x30c7
leaq 0x1659(%rip), %rcx      # 0x3c8d
movl $0xc67, %edx            # imm = 0xC67
callq 0x10a0
movq %rax, %rbx
movq %rsp, %rdi
callq 0x1178
movq %rbx, %rdi
callq 0x1150
nop
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/sparsepp/./sparsepp/spp.h
// Function: spp::sparsetable<std::pair<unsigned int const, unsigned int>, spp::libc_allocator<std::pair<unsigned int const, unsigned int>>>::get_iter(unsigned long)
ne_iterator get_iter(size_type i)
    {
        //assert(test(i));    // how can a nonempty_iterator point to an empty bucket?

        size_type grp_idx = group_num(i);

        return ne_iterator(_first_group + grp_idx,
                           (_first_group[grp_idx].ne_begin() +
                            _first_group[grp_idx].pos_to_offset(pos_in_group(i))));
    }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rcx
movq %rsi, %rdx
shrq $0x5, %rdx
movq (%rdi), %rax
pushq $-0x1
popq %rdi
shll %cl, %edi
imulq $0x18, %rdx, %rcx
notl %edi
andl 0x8(%rax,%rcx), %edi
leaq (%rax,%rcx), %rsi
movl %edi, %edx
shrl %edx
andl $0x15555555, %edx       # imm = 0x15555555
subl %edx, %edi
movl $0x33333333, %edx       # imm = 0x33333333
movl %edi, %r8d
andl %edx, %r8d
shrl $0x2, %edi
andl %edx, %edi
addl %r8d, %edi
movl %edi, %edx
shrl $0x4, %edx
addl %edi, %edx
andl $0xf0f0f0f, %edx        # imm = 0xF0F0F0F
imull $0x1010101, %edx, %edx  # imm = 0x1010101
shrl $0x15, %edx
andl $-0x8, %edx
addq (%rax,%rcx), %rdx
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x2768
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/sparsepp/./sparsepp/spp.h
// Function: std::pair<unsigned int const, unsigned int>& spp::sparsetable<std::pair<unsigned int const, unsigned int>, spp::libc_allocator<std::pair<unsigned int const, unsigned int>>>::set<std::pair<unsigned int const, unsigned int>>(unsigned long, std::pair<unsigned int const, unsigned int>&)
reference set(size_type i, Val &val)
    {
        assert(i < _table_size);
        group_type &group = which_group(i);
        typename group_type::size_type old_numbuckets = group.num_nonempty();
        pointer p(group.set(_alloc, pos_in_group(i), val));
        _num_buckets += group.num_nonempty() - old_numbuckets;
        return *p;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq %rsi, 0x10(%rdi)
jbe 0x2748
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
movq (%rdi), %r14
movq %rsi, %rax
shrq $0x5, %rax
imulq $0x18, %rax, %r15
leaq (%r14,%r15), %rdi
movzbl 0x10(%r14,%r15), %r12d
leaq 0x21(%rbx), %rsi
andl $0x1f, %edx
callq 0x22c6
movzbl 0x10(%r14,%r15), %ecx
subq %r12, %rcx
addq %rcx, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x111a(%rip), %rdi      # 0x3869
leaq 0x971(%rip), %rsi       # 0x30c7
leaq 0x1837(%rip), %rcx      # 0x3f94
movl $0x8be, %edx            # imm = 0x8BE
callq 0x10a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/mshinfo/mshinfo.cpp
// Function: NumBoundaryEdges(gaps::R3Mesh*)
int NumBoundaryEdges(R3Mesh *mesh)
{
  // Count number of boundary edges
  int count = 0;
  for (int i = 0; i < mesh->NEdges(); i++) {
    R3MeshEdge *edge = mesh->Edge(i);
    R3MeshFace *face0 = mesh->FaceOnEdge(edge, 0);
    R3MeshFace *face1 = mesh->FaceOnEdge(edge, 1);
    if (!face0 || !face1) count++;
  }
  return count;
}

// Assembly:
movl 0x24(%rdi), %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
xorl %eax, %eax
cmpq %rdx, %rcx
je 0xe075
movq 0x18(%rdi), %rsi
movq (%rsi,%rdx,8), %rsi
cmpq $0x0, 0x18(%rsi)
sete %r8b
cmpq $0x0, 0x20(%rsi)
sete %sil
orb %r8b, %sil
movzbl %sil, %esi
addl %esi, %eax
incq %rdx
jmp 0xe048
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/scnview/scnview.cpp
// Function: DrawBBoxes(gaps::R3Scene*, gaps::R3SceneNode*)
static void 
DrawBBoxes(R3Scene *scene, R3SceneNode *node)
{
  // Draw node bounding box
  node->BBox().Outline();

  // Push transformation
  node->Transformation().Push();

  // Draw children bboxes
  for (int i = 0; i < node->NChildren(); i++) {
    R3SceneNode *child = node->Child(i);
    DrawBBoxes(scene, child);
  }

  // Pop transformation
  node->Transformation().Pop();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x386ba
movq (%rax), %rcx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq *0xb0(%rcx)
leaq 0x58(%rbx), %r14
movq 0x58(%rbx), %rax
movq %r14, %rdi
callq *0xb0(%rax)
xorl %r15d, %r15d
movslq 0x2c(%rbx), %rax
cmpq %rax, %r15
jge 0x25638
movq 0x20(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x255ed
incq %r15
jmp 0x2561d
movq (%r14), %rax
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmpq *0xb8(%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/scnview/scnview.cpp
// Function: GLUTResize(int, int)
void GLUTResize(int w, int h)
{
  // Resize window
  glViewport(0, 0, w, h);

  // Resize viewer viewport
  viewer->ResizeViewport(0, 0, w, h);

  // Resize scene viewport
  scene->SetViewport(viewer->Viewport());

  // Remember window size 
  GLUTwindow_width = w;
  GLUTwindow_height = h;

  // Redraw
  glutPostRedisplay();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
xorl %edi, %edi
xorl %esi, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x21220
movq 0x10e2a4(%rip), %rdi    # 0x133908
xorl %esi, %esi
xorl %edx, %edx
movl %ebp, %ecx
movl %ebx, %r8d
callq 0x3a03a
movq 0x10e27f(%rip), %rdi    # 0x1338f8
movl $0x98, %esi
addq 0x10e283(%rip), %rsi    # 0x133908
callq 0x27a3e
movl %ebp, 0x109344(%rip)    # 0x12e9d4
movl %ebx, 0x109342(%rip)    # 0x12e9d8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xb878c
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/scnview/scnview.cpp
// Function: GLUTSpecial(int, int, int)
void GLUTSpecial(int key, int x, int y)
{
  // Invert y coordinate
  y = GLUTwindow_height - y;

  // Process keyboard button event
  switch (key) {
  case GLUT_KEY_LEFT:
    viewer->TranslateCamera(0.1*viewer->Camera().Left());
    break;
  case GLUT_KEY_RIGHT:
    viewer->TranslateCamera(0.1*viewer->Camera().Right());
    break;
  case GLUT_KEY_DOWN:
    viewer->TranslateCamera(0.1*viewer->Camera().Down());
    break;
  case GLUT_KEY_UP:
    viewer->TranslateCamera(0.1*viewer->Camera().Up());
    break;
  }    

  // Remember mouse position 
  GLUTmouse[0] = x;
  GLUTmouse[1] = y;

  // Remember modifiers 
  GLUTmodifiers = glutGetModifiers();

  // Redraw
  glutPostRedisplay();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebp
movl %esi, %ebx
movl 0x108c25(%rip), %r13d   # 0x12e9d8
addl $-0x64, %edi
cmpl $0x3, %edi
ja 0x25e5c
leaq 0x9f2ca(%rip), %rax     # 0xc5090
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x10db32(%rip), %rsi    # 0x133908
leaq 0x8(%rsi), %r14
addq $0x20, %rsi
jmp 0x25e00
movq 0x10db21(%rip), %rsi    # 0x133908
leaq 0x8(%rsi), %r14
addq $0x20, %rsi
jmp 0x25e3c
movq 0x10db10(%rip), %rsi    # 0x133908
leaq 0x8(%rsi), %r14
addq $0x38, %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x6c99a
leaq 0x8(%rsp), %r12
movsd 0x9f216(%rip), %xmm0    # 0xc5030
movq %r12, %rdi
movq %r15, %rsi
callq 0x6c72a
movq %r14, %rdi
movq %r12, %rsi
jmp 0x25e57
movq 0x10dad4(%rip), %rsi    # 0x133908
leaq 0x8(%rsi), %r14
addq $0x38, %rsi
leaq 0x8(%rsp), %r15
movsd 0x9f1e7(%rip), %xmm0    # 0xc5030
movq %r15, %rdi
callq 0x6c72a
movq %r14, %rdi
movq %r15, %rsi
callq 0x3c038
subl %ebp, %r13d
movl %ebx, 0x10db43(%rip)    # 0x1339a8
movl %r13d, 0x10db40(%rip)   # 0x1339ac
callq 0xbd22a
movl %eax, 0x10db3d(%rip)    # 0x1339b4
callq 0xb878c
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/scnview/scnview.cpp
// Function: GLUTInit(int*, char**)
void GLUTInit(int *argc, char **argv)
{
  // Open window 
  glutInit(argc, argv);
  glutInitWindowPosition(100, 100);
  glutInitWindowSize(GLUTwindow_width, GLUTwindow_height);
  glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_ALPHA);
  GLUTwindow = glutCreateWindow("Scene Viewer");
  
  // Initialize grfx (after create context because calls glewInit)
  RNInitGrfx();

  // Initialize depth testing
  glEnable(GL_DEPTH_TEST);

  // Initialize lighting
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  static GLfloat lmodel_ambient[] = { 0.2, 0.2, 0.2, 1.0 };
  glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
  glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
  glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
  glEnable(GL_NORMALIZE);
  glEnable(GL_LIGHTING); 

  // Initialize color settings
  glEnable(GL_COLOR_MATERIAL);
  glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);

  // Initialize GLUT callback functions 
  glutDisplayFunc(GLUTRedraw);
  glutReshapeFunc(GLUTResize);
  glutKeyboardFunc(GLUTKeyboard);
  glutSpecialFunc(GLUTSpecial);
  glutMouseFunc(GLUTMouse);
  glutMotionFunc(GLUTMotion);
}

// Assembly:
pushq %rbx
callq 0xb936d
pushq $0x64
popq %rdi
movl %edi, %esi
callq 0xb9868
movl 0x1087bd(%rip), %edi    # 0x12e9d4
movl 0x1087bb(%rip), %esi    # 0x12e9d8
callq 0xb987e
pushq $0x1a
popq %rdi
callq 0xb989d
leaq 0x9efa2(%rip), %rdi     # 0xc51d3
callq 0xbe3c4
movl %eax, 0x10d6b4(%rip)    # 0x1338f0
callq 0x7bd38
movl $0xb71, %edi            # imm = 0xB71
callq 0x21820
movl $0x1700, %edi           # imm = 0x1700
callq 0x21cc0
callq 0x21c50
leaq 0x10877f(%rip), %rsi    # 0x12e9e0
movl $0xb53, %edi            # imm = 0xB53
callq 0x22220
pushq $0x1
popq %rbx
movl $0xb51, %edi            # imm = 0xB51
movl %ebx, %esi
callq 0x21150
movl $0xb52, %edi            # imm = 0xB52
movl %ebx, %esi
callq 0x21150
movl $0xba1, %edi            # imm = 0xBA1
callq 0x21820
movl $0xb50, %edi            # imm = 0xB50
callq 0x21820
movl $0xb57, %edi            # imm = 0xB57
callq 0x21820
movl $0x404, %edi            # imm = 0x404
movl $0x1602, %esi           # imm = 0x1602
callq 0x21590
leaq -0x1acb(%rip), %rdi     # 0x247ef
callq 0xb7e8c
leaq -0xc7d(%rip), %rdi      # 0x25649
callq 0xb7ee1
leaq -0x447(%rip), %rdi      # 0x25e8b
callq 0xb7f23
leaq -0x544(%rip), %rdi      # 0x25d9a
callq 0xb7f6b
leaq -0x9ff(%rip), %rdi      # 0x258eb
callq 0xb82b2
leaq -0xc55(%rip), %rdi      # 0x256a1
popq %rbx
jmp 0xb8342
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/scnview/scnview.cpp
// Function: GLUTMainLoop()
void GLUTMainLoop(void)
{
  // Just checking
  if (!viewer || !scene) return;
  
  // Initialize viewing center
  center = scene->BBox().Centroid();

  // Define headlight
  if (headlight) {
    static GLfloat light0_diffuse[] = { 0.5, 0.5, 0.5, 1.0 };
    static GLfloat light0_position[] = { 0.0, 0.0, 1.0, 0.0 };
    glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse);
    glLightfv(GL_LIGHT0, GL_POSITION, light0_position);
    glEnable(GL_LIGHT0);
  }
  
  // Run main loop -- never returns 
  glutMainLoop();
}

// Assembly:
cmpq $0x0, 0x10d604(%rip)    # 0x133908
setne %al
movq 0x10d5ea(%rip), %rdi    # 0x1338f8
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2638e
pushq %rbx
subq $0x20, %rsp
callq 0x27352
movq (%rax), %rcx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq *0x68(%rcx)
leaq 0x10d59b(%rip), %rdi    # 0x1338d8
movq %rbx, %rsi
callq 0x6bb5e
cmpb $0x1, 0x10d624(%rip)    # 0x133970
jne 0x26384
leaq 0x10869b(%rip), %rdx    # 0x12e9f0
movl $0x4000, %edi           # imm = 0x4000
movl $0x1201, %esi           # imm = 0x1201
callq 0x220c0
leaq 0x108695(%rip), %rdx    # 0x12ea00
movl $0x4000, %edi           # imm = 0x4000
movl $0x1203, %esi           # imm = 0x1203
callq 0x220c0
movl $0x4000, %edi           # imm = 0x4000
callq 0x21820
callq 0xbb77f
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::R3Scene()
R3Scene::
R3Scene(void)
  : nodes(),
    lights(),
    materials(),
    brdfs(),
    textures(),
    referenced_scenes(),
    info(),
    viewer(),
    ambient(0.2, 0.2, 0.2),
    background(0, 0, 0),
    filename(NULL),
    name(NULL),
    data(NULL)
{
  // Create root node
  root = new R3SceneNode(this);

  // Initialize viewer
  viewer.SetCamera(R3default_camera);
  viewer.SetViewport(R2default_viewport);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
movq %rbx, %rdi
callq 0x7c1c6
leaq 0x18(%r14), %r15
movq %r15, %rdi
movq %rbx, 0x20(%rsp)
callq 0x7c1c6
leaq 0x28(%r14), %r12
movq %r12, %rdi
movq %r15, 0x18(%rsp)
callq 0x7c1c6
leaq 0x38(%r14), %r13
movq %r13, %rdi
movq %r12, 0x10(%rsp)
callq 0x7c1c6
movq %r13, 0x8(%rsp)
leaq 0x48(%r14), %r13
movq %r13, %rdi
callq 0x7c1c6
leaq 0x58(%r14), %rbp
movq %rbp, %rdi
callq 0x7c1c6
leaq 0x68(%r14), %rbx
movq %rbx, %rdi
callq 0x3608c
leaq 0x70(%r14), %r15
movq %r15, %rdi
callq 0x39e5a
leaq 0x118(%r14), %rdi
movsd 0x9e016(%rip), %xmm0    # 0xc54a0
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x7c03e
leaq 0x130(%r14), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x7c03e
xorps %xmm0, %xmm0
movups %xmm0, 0x148(%r14)
andq $0x0, 0x158(%r14)
movl $0x1b0, %edi            # imm = 0x1B0
callq 0x218d0
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x37a1e
movq %r12, (%r14)
leaq 0x10c5c1(%rip), %rsi    # 0x133aa0
movq %r15, %rdi
callq 0x39f3a
leaq 0x10752a(%rip), %rsi    # 0x12ea18
movq %r15, %rdi
callq 0x39f94
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x1b0, %esi            # imm = 0x1B0
movq %r12, %rdi
callq 0x218f0
jmp 0x2753d
movq %rax, %r14
jmp 0x27545
movq %rax, %r14
jmp 0x2754d
movq %rax, %r14
jmp 0x27555
movq %rax, %r14
jmp 0x2755d
movq %rax, %r14
jmp 0x27567
movq %rax, %r14
jmp 0x27571
movq %rax, %r14
jmp 0x2757b
movq %rax, %r14
movq %r15, %rdi
callq 0x39f2e
movq %rbx, %rdi
callq 0x34350
movq %rbp, %rdi
callq 0x7c234
movq %r13, %rdi
callq 0x7c234
movq 0x8(%rsp), %rdi
callq 0x7c234
movq 0x10(%rsp), %rdi
callq 0x7c234
movq 0x18(%rsp), %rdi
callq 0x7c234
movq 0x20(%rsp), %rdi
callq 0x7c234
movq %r14, %rdi
callq 0x220e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::Node(char const*) const
R3SceneNode *R3Scene::
Node(const char *name) const
{
  // Search nodes for matching name
  for (int i = 0; i < NNodes(); i++) {
    R3SceneNode *node = Node(i);
    if (!node->Name()) continue;
    if (!strcmp(node->Name(), name)) return node;
  }

  // Node not found
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movslq 0x14(%rdi), %r15
movq 0x8(%rdi), %r12
xorl %r13d, %r13d
cmpq %r15, %r13
jge 0x27633
movq (%r12,%r13,8), %r14
movq 0x1a0(%r14), %rdi
testq %rdi, %rdi
je 0x2762e
movq %rbx, %rsi
callq 0x21d30
testl %eax, %eax
je 0x27636
incq %r13
jmp 0x2760d
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::Material(char const*) const
R3Material *R3Scene::
Material(const char *name) const
{
  // Search materials for matching name
  for (int i = 0; i < NMaterials(); i++) {
    R3Material *material = Material(i);
    if (!material->Name()) continue;
    if (!strcmp(material->Name(), name)) return material;
  }

  // Material not found
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movslq 0x34(%rdi), %r15
movq 0x28(%rdi), %r12
xorl %r13d, %r13d
cmpq %r15, %r13
jge 0x2767e
movq (%r12,%r13,8), %r14
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x27679
movq %rbx, %rsi
callq 0x21d30
testl %eax, %eax
je 0x27681
incq %r13
jmp 0x2765b
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::Light(char const*) const
R3Light *R3Scene::
Light(const char *name) const
{
  // Search lights for matching name
  for (int i = 0; i < NLights(); i++) {
    R3Light *light = Light(i);
    if (!light->Name()) continue;
    if (!strcmp(light->Name(), name)) return light;
  }

  // Light not found
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movslq 0x24(%rdi), %r15
movq 0x18(%rdi), %r12
xorl %r13d, %r13d
cmpq %r15, %r13
jge 0x276c8
movq (%r12,%r13,8), %r14
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x276c3
movq %rbx, %rsi
callq 0x21d30
testl %eax, %eax
je 0x276cb
incq %r13
jmp 0x276a5
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::Brdf(char const*) const
R3Brdf *R3Scene::
Brdf(const char *name) const
{
  // Search brdfs for matching name
  for (int i = 0; i < NBrdfs(); i++) {
    R3Brdf *brdf = Brdf(i);
    if (!brdf->Name()) continue;
    if (!strcmp(brdf->Name(), name)) return brdf;
  }

  // Brdf not found
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movslq 0x44(%rdi), %r15
movq 0x38(%rdi), %r12
xorl %r13d, %r13d
cmpq %r15, %r13
jge 0x27712
movq (%r12,%r13,8), %r14
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x2770d
movq %rbx, %rsi
callq 0x21d30
testl %eax, %eax
je 0x27715
incq %r13
jmp 0x276ef
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::Texture(char const*) const
R2Texture *R3Scene::
Texture(const char *name) const
{
  // Search textures for matching name
  for (int i = 0; i < NTextures(); i++) {
    R2Texture *texture = Texture(i);
    if (!texture->Name()) continue;
    if (!strcmp(texture->Name(), name)) return texture;
  }

  // Texture not found
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movslq 0x54(%rdi), %r15
movq 0x48(%rdi), %r12
xorl %r13d, %r13d
cmpq %r15, %r13
jge 0x2775c
movq (%r12,%r13,8), %r14
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x27757
movq %rbx, %rsi
callq 0x21d30
testl %eax, %eax
je 0x2775f
incq %r13
jmp 0x27739
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::ReferencedScene(char const*) const
R3Scene *R3Scene::
ReferencedScene(const char *name) const
{
  // Search textures for matching name
  for (int i = 0; i < NReferencedScenes(); i++) {
    R3Scene *referenced_scene = ReferencedScene(i);
    if (!referenced_scene->Name()) continue;
    if (!strcmp(referenced_scene->Name(), name)) return referenced_scene;
  }

  // Referenced scene not found
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movslq 0x64(%rdi), %r15
movq 0x58(%rdi), %r12
xorl %r13d, %r13d
cmpq %r15, %r13
jge 0x277a9
movq (%r12,%r13,8), %r14
movq 0x150(%r14), %rdi
testq %rdi, %rdi
je 0x277a4
movq %rbx, %rsi
callq 0x21d30
testl %eax, %eax
je 0x277ac
incq %r13
jmp 0x27783
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::RemoveNode(gaps::R3SceneNode*)
void R3Scene::
RemoveNode(R3SceneNode *node) 
{
  // Remove node
  assert(node->scene == this);
  assert(node->scene_index >= 0);
  RNArrayEntry *entry = nodes.KthEntry(node->scene_index);
  assert(nodes.EntryContents(entry) == node);
  R3SceneNode *tail = nodes.Tail();
  nodes.EntryContents(entry) = tail;
  tail->scene_index = node->scene_index;
  nodes.RemoveTail();
  node->scene_index = -1;
  node->scene = NULL;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
leaq 0x8(%rdi), %rax
movslq 0x8(%rsi), %rcx
movq 0x8(%rdi), %rdx
movslq 0x14(%rdi), %rsi
movq -0x8(%rdx,%rsi,8), %rsi
movq %rsi, (%rdx,%rcx,8)
movl %ecx, 0x8(%rsi)
movq %rax, %rdi
callq 0x3436e
orl $-0x1, 0x8(%rbx)
andq $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::RemoveLight(gaps::R3Light*)
void R3Scene::
RemoveLight(R3Light *light) 
{
  // Remove light
  assert(light->scene == this);
  assert(light->scene_index >= 0);
  RNArrayEntry *entry = lights.KthEntry(light->scene_index);
  assert(lights.EntryContents(entry) == light);
  R3Light *tail = lights.Tail();
  lights.EntryContents(entry) = tail;
  tail->scene_index = light->scene_index;
  lights.RemoveTail();
  light->scene_index = -1;
  light->scene = NULL;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
leaq 0x18(%rdi), %rax
movslq 0x10(%rsi), %rcx
movq 0x18(%rdi), %rdx
movslq 0x24(%rdi), %rsi
movq -0x8(%rdx,%rsi,8), %rsi
movq %rsi, (%rdx,%rcx,8)
movl %ecx, 0x10(%rsi)
movq %rax, %rdi
callq 0x3436e
orl $-0x1, 0x10(%rbx)
andq $0x0, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::RemoveMaterial(gaps::R3Material*)
void R3Scene::
RemoveMaterial(R3Material *material) 
{
  // Remove material
  assert(material->scene == this);
  assert(material->scene_index >= 0);
  RNArrayEntry *entry = materials.KthEntry(material->scene_index);
  assert(materials.EntryContents(entry) == material);
  R3Material *tail = materials.Tail();
  materials.EntryContents(entry) = tail;
  tail->scene_index = material->scene_index;
  materials.RemoveTail();
  material->scene_index = -1;
  material->scene = NULL;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
leaq 0x28(%rdi), %rax
movslq 0x8(%rsi), %rcx
movq 0x28(%rdi), %rdx
movslq 0x34(%rdi), %rsi
movq -0x8(%rdx,%rsi,8), %rsi
movq %rsi, (%rdx,%rcx,8)
movl %ecx, 0x8(%rsi)
movq %rax, %rdi
callq 0x3436e
orl $-0x1, 0x8(%rbx)
andq $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::RemoveBrdf(gaps::R3Brdf*)
void R3Scene::
RemoveBrdf(R3Brdf *brdf) 
{
  // Remove brdf
  assert(brdf->scene == this);
  assert(brdf->scene_index >= 0);
  RNArrayEntry *entry = brdfs.KthEntry(brdf->scene_index);
  assert(brdfs.EntryContents(entry) == brdf);
  R3Brdf *tail = brdfs.Tail();
  brdfs.EntryContents(entry) = tail;
  tail->scene_index = brdf->scene_index;
  brdfs.RemoveTail();
  brdf->scene_index = -1;
  brdf->scene = NULL;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
leaq 0x38(%rdi), %rax
movslq 0x10(%rsi), %rcx
movq 0x38(%rdi), %rdx
movslq 0x44(%rdi), %rsi
movq -0x8(%rdx,%rsi,8), %rsi
movq %rsi, (%rdx,%rcx,8)
movl %ecx, 0x10(%rsi)
movq %rax, %rdi
callq 0x3436e
orl $-0x1, 0x10(%rbx)
andq $0x0, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::RemoveTexture(gaps::R2Texture*)
void R3Scene::
RemoveTexture(R2Texture *texture) 
{
  // Remove texture
  assert(texture->scene == this);
  assert(texture->scene_index >= 0);
  RNArrayEntry *entry = textures.KthEntry(texture->scene_index);
  assert(textures.EntryContents(entry) == texture);
  R2Texture *tail = textures.Tail();
  textures.EntryContents(entry) = tail;
  tail->scene_index = texture->scene_index;
  textures.RemoveTail();
  texture->scene_index = -1;
  texture->scene = NULL;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
leaq 0x48(%rdi), %rax
movslq 0x8(%rsi), %rcx
movq 0x48(%rdi), %rdx
movslq 0x54(%rdi), %rsi
movq -0x8(%rdx,%rsi,8), %rsi
movq %rsi, (%rdx,%rcx,8)
movl %ecx, 0x8(%rsi)
movq %rax, %rdi
callq 0x3436e
orl $-0x1, 0x8(%rbx)
andq $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::RemoveReferences()
void R3Scene::
RemoveReferences(void)
{
  // Replace all references with copies of referenced scenes
  R3SceneRemoveReferences(this, root);

  // Remove/delete referenced scenes
  while (NReferencedScenes() > 0) {
    R3Scene *referenced_scene = ReferencedScene(0);
    RemoveReferencedScene(referenced_scene);
    delete referenced_scene;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rsi
callq 0x27add
leaq 0x58(%rbx), %r14
cmpl $0x0, 0x64(%rbx)
jle 0x27ad7
movq (%r14), %rax
movq (%rax), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x360ba
testq %r15, %r15
je 0x27ac8
movq %r15, %rdi
callq 0x2758e
movl $0x160, %esi            # imm = 0x160
movq %r15, %rdi
callq 0x218f0
jmp 0x27aa4
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3SceneRemoveReferences(gaps::R3Scene*, gaps::R3SceneNode*)
static void
R3SceneRemoveReferences(R3Scene *scene, R3SceneNode *node)
{
  // Recurse to children
  for (int i = 0; i < node->NChildren(); i++) {
    R3SceneNode *child = node->Child(i);
    R3SceneRemoveReferences(scene, child);
  }

  // Insert copy of all referenced scenes
  for (int i = 0; i < node->NReferences(); i++) {
    R3SceneReference *reference = node->Reference(i);
    R3Scene *referenced_scene = reference->ReferencedScene();
    CopyScene(referenced_scene, scene, node, &(reference->Materials()));
  }

  // Remove references
  while (node->NReferences() > 0) {
    R3SceneReference *reference = node->Reference(0);
    node->RemoveReference(reference);
    delete reference;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movslq 0x2c(%rbx), %rax
cmpq %rax, %r15
jge 0x27b09
movq 0x20(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x27add
incq %r15
jmp 0x27aeb
xorl %r15d, %r15d
movslq 0x4c(%rbx), %rax
cmpq %rax, %r15
jge 0x27b34
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rcx
movq (%rcx), %rdi
addq $0x8, %rcx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x33e93
incq %r15
jmp 0x27b0c
pushq $0x30
popq %r14
testl %eax, %eax
jle 0x27b6b
movq 0x40(%rbx), %rax
movq (%rax), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x37dd2
testq %r15, %r15
je 0x27b5b
movq %r15, %rdi
callq 0x39c38
movq %r15, %rdi
movq %r14, %rsi
callq 0x218f0
movl 0x4c(%rbx), %eax
jmp 0x27b38
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3SceneRemoveHierarchy(gaps::R3Scene*, gaps::R3SceneNode*, gaps::R3Affine const&)
static void
R3SceneRemoveHierarchy(R3Scene *scene, R3SceneNode *node, const R3Affine& parent_transformation)
{
  // Compute transformation
  R3Affine transformation = R3identity_affine;
  transformation.Transform(parent_transformation);
  transformation.Transform(node->Transformation());

  // Recurse to children
  for (int i = 0; i < node->NChildren(); i++) {
    R3SceneNode *child = node->Child(i);
    R3SceneRemoveHierarchy(scene, child, transformation);
  }

  // Check if should move node to root
  R3SceneNode *root = scene->Root();
  if (node != root) {
    R3SceneNode *parent = node->Parent();
    if (parent && (parent != root)) {
      // Assign transformation
      node->SetTransformation(transformation);

      // Move node to be child of root
      parent->RemoveChild(node);
      root->InsertChild(node);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10eae5(%rip), %rsi    # 0x1366a0
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x34464
movq %r12, %rdi
movq %r15, %rsi
callq 0x669c2
leaq 0x58(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x669c2
xorl %r12d, %r12d
leaq 0x8(%rsp), %r15
movslq 0x2c(%rbx), %rax
cmpq %rax, %r12
jge 0x27c0a
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x27b9d
incq %r12
jmp 0x27be9
movq (%r14), %r14
cmpq %rbx, %r14
je 0x27c49
movq 0x10(%rbx), %r15
testq %r15, %r15
sete %al
cmpq %r14, %r15
sete %cl
orb %al, %cl
jne 0x27c49
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x38b02
movq %r15, %rdi
movq %rbx, %rsi
callq 0x37de8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3898c
leaq 0x8(%rsp), %rdi
callq 0x66856
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x27c66
jmp 0x27c66
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x66856
movq %rbx, %rdi
callq 0x220e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3SceneRemoveTransformations(gaps::R3Scene*, gaps::R3SceneNode*, gaps::R3Affine const&)
static void
R3SceneRemoveTransformations(R3Scene *scene, R3SceneNode *node, const R3Affine& parent_transformation)
{
  // Compute transformation
  R3Affine transformation = R3identity_affine;
  transformation.Transform(parent_transformation);
  transformation.Transform(node->Transformation());

  // Check if node has references
  if (node->NReferences() > 0) {
    node->SetTransformation(transformation);
    return;
  }

  // Transform elements
  for (int i = 0; i < node->NElements(); i++) {
    R3SceneElement *element = node->Element(i);
    element->Transform(transformation);
  }

  // Recurse to children
  for (int i = 0; i < node->NChildren(); i++) {
    R3SceneNode *child = node->Child(i);
    R3SceneRemoveTransformations(scene, child, transformation);
  }

  // Remove transformation
  node->SetTransformation(R3identity_affine);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10e9fd(%rip), %r14    # 0x1366a0
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x34464
movq %r12, %rdi
movq %r15, %rsi
callq 0x669c2
leaq 0x58(%rbx), %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x669c2
cmpl $0x0, 0x4c(%rbx)
jg 0x27d24
xorl %r12d, %r12d
leaq 0x8(%rsp), %r15
movslq 0x3c(%rbx), %rax
cmpq %rax, %r12
jge 0x27cfb
movq 0x30(%rbx), %rax
movq (%rax,%r12,8), %rdi
movq %r15, %rsi
callq 0x39762
incq %r12
jmp 0x27cdd
xorl %r12d, %r12d
leaq 0x8(%rsp), %r15
movslq 0x2c(%rbx), %rax
cmpq %rax, %r12
jge 0x27d21
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %rdi
movq %r15, %rsi
callq 0x27c88
incq %r12
jmp 0x27d03
movq %r14, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x38b02
leaq 0x8(%rsp), %rdi
callq 0x66856
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x27d4c
jmp 0x27d4c
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x66856
movq %rbx, %rdi
callq 0x220e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3SceneSubdivideTriangles(gaps::R3Scene*, gaps::R3SceneNode*, double)
static void
R3SceneSubdivideTriangles(R3Scene *scene, R3SceneNode *node, RNLength max_edge_length)
{
  // Check max edge length
  if (RNIsNegativeOrZero(max_edge_length)) return;

  // Transform max_edge_length
  RNScalar scale = node->Transformation().ScaleFactor();
  if (RNIsNotZero(scale)) max_edge_length /= scale;

  // Subdivide triangles in elements
  for (int i = 0; i < node->NElements(); i++) {
    R3SceneElement *element = node->Element(i);
    for (int j = 0; j < element->NShapes(); j++) {
      R3Shape *shape = element->Shape(j);
      if (shape->ClassID() == R3TriangleArray::CLASS_ID()) {
        R3TriangleArray *triangles = (R3TriangleArray *) shape;
        triangles->Subdivide(max_edge_length);
      }
    }
  }

  // Subdivide triangles in references
  for (int i = 0; i < node->NReferences(); i++) {
    R3SceneReference *reference = node->Reference(i);
    R3Scene *referenced_scene = reference->ReferencedScene();
    R3SceneSubdivideTriangles(referenced_scene, referenced_scene->Root(), max_edge_length);
  }

  // Recurse to children
  for (int i = 0; i < node->NChildren(); i++) {
    R3SceneNode *child = node->Child(i);
    R3SceneSubdivideTriangles(scene, child, max_edge_length);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x10737c(%rip), %r14    # 0x12f0f8
movsd (%r14), %xmm1
ucomisd %xmm0, %xmm1
jae 0x27e96
movq %rdi, %rbx
addq $0x58, %rdi
movq 0x58(%rbx), %rax
movapd %xmm0, (%rsp)
callq *0xc0(%rax)
movapd %xmm0, %xmm3
movsd (%r14), %xmm0
movapd 0x9d77e(%rip), %xmm1    # 0xc5530
xorpd %xmm0, %xmm1
movapd (%rsp), %xmm4
movapd %xmm4, %xmm2
divsd %xmm3, %xmm2
cmpnltsd %xmm3, %xmm0
cmpnltsd %xmm1, %xmm3
movapd %xmm3, %xmm1
andnpd %xmm2, %xmm1
andpd %xmm4, %xmm3
orpd %xmm1, %xmm3
andpd %xmm0, %xmm3
andnpd %xmm2, %xmm0
orpd %xmm0, %xmm3
movapd %xmm3, (%rsp)
xorl %r15d, %r15d
movslq 0x3c(%rbx), %rax
cmpq %rax, %r15
jge 0x27e4a
movq 0x30(%rbx), %rax
movq (%rax,%r15,8), %r12
xorl %r13d, %r13d
movslq 0x1c(%r12), %rax
cmpq %rax, %r13
jge 0x27e45
movq 0x10(%r12), %rax
movq (%rax,%r13,8), %r14
movq (%r14), %rax
movq %r14, %rdi
callq *0xb8(%rax)
movl %eax, %ebp
callq 0x5f048
cmpl %eax, %ebp
jne 0x27e40
movq (%r14), %rax
movq %r14, %rdi
movapd (%rsp), %xmm0
callq *0x228(%rax)
incq %r13
jmp 0x27e05
incq %r15
jmp 0x27df1
xorl %r14d, %r14d
movslq 0x4c(%rbx), %rax
cmpq %rax, %r14
jge 0x27e73
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rax
movq (%rax), %rax
movq (%rax), %rdi
movapd (%rsp), %xmm0
callq 0x27d67
incq %r14
jmp 0x27e4d
xorl %r14d, %r14d
movslq 0x2c(%rbx), %rax
cmpq %rax, %r14
jge 0x27e96
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
movapd (%rsp), %xmm0
callq 0x27d67
incq %r14
jmp 0x27e76
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x50(%rsp), %r14
movsd 0x9d157(%rip), %xmm0    # 0xc5018
movq %r14, %rdi
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x7c03e
leaq 0x38(%rsp), %r12
movsd 0x9d5cc(%rip), %xmm0    # 0xc54a8
movsd 0x9d5cc(%rip), %xmm1    # 0xc54b0
movsd 0x9d5cc(%rip), %xmm2    # 0xc54b8
movq %r12, %rdi
callq 0x6c034
movq %r12, %rdi
callq 0x6c336
pushq $0x68
popq %rdi
callq 0x218d0
movq %rax, %r15
pushq $0x1
popq %rcx
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
movsd 0x9d0fd(%rip), %xmm0    # 0xc5018
callq 0x3e054
movq %rbx, %rdi
movq %r15, %rsi
callq 0x277fe
leaq 0x20(%rsp), %r14
movsd 0x9d108(%rip), %xmm0    # 0xc5040
movq %r14, %rdi
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x7c03e
leaq 0x8(%rsp), %r12
movsd 0x9d56d(%rip), %xmm1    # 0xc54c0
movsd 0x9d56d(%rip), %xmm0    # 0xc54c8
movq %r12, %rdi
movaps %xmm0, %xmm2
callq 0x6c034
movq %r12, %rdi
callq 0x6c336
pushq $0x68
popq %rdi
callq 0x218d0
movq %rax, %r15
movsd 0x9d097(%rip), %xmm0    # 0xc5018
pushq $0x1
popq %rcx
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x3e054
movq %rbx, %rdi
movq %r15, %rsi
callq 0x277fe
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x27fab
movq %rax, %rbx
pushq $0x68
popq %rsi
movq %r15, %rdi
callq 0x218f0
movq %rbx, %rdi
callq 0x220e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
movupd 0x118(%rdi), %xmm0
cvtpd2ps %xmm0, %xmm0
movlpd %xmm0, 0x10ba35(%rip)   # 0x133a30
cvtsd2ss 0x128(%rdi), %xmm0
movl %esi, %ebp
leaq 0x10ba24(%rip), %rsi    # 0x133a30
movss %xmm0, 0x10ba24(%rip)   # 0x133a38
movl $0x3f800000, 0x10ba1e(%rip) # imm = 0x3F800000
movl $0xb53, %edi            # imm = 0xB53
callq 0x22220
movl %ebp, %r12d
xorl %r15d, %r15d
movslq 0x24(%r14), %rax
cmpq %rax, %r15
jge 0x28052
leaq (%r12,%r15), %rsi
cmpl %ebx, %esi
jg 0x28052
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
incq %r15
jmp 0x2802e
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x10bb77(%rip), %rdi    # 0x133e40
xorl %esi, %esi
callq 0x3effc
cmpl $0x8, 0x24(%r14)
movq (%r14), %rsi
jl 0x282ee
leaq 0x10e3bf(%rip), %rdx    # 0x1366a0
movq %r14, %rdi
movq %rbx, %rcx
callq 0x28310
jmp 0x282fb
movq %rsi, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x390e8
leaq 0x10bb3e(%rip), %rdi    # 0x133e40
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3effc
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::DrawNodeWithLights(gaps::R3Scene const*, gaps::R3SceneNode*, gaps::R3Affine const&, gaps::RNFlags, int, int)
static void 
DrawNodeWithLights(const R3Scene *scene, R3SceneNode *node,
  const R3Affine& parent_transformation, const R3DrawFlags draw_flags,
  int min_light = 0, int max_light = 7)
{
  // Load lights
  if ((node->NElements() > 0) || (node->NReferences() > 0)) {
    R3Box world_bbox = node->BBox();
    world_bbox.Transform(parent_transformation);
    scene->LoadLights(world_bbox, min_light, max_light);
  }
  
  // Push transformation
  R3Affine transformation = parent_transformation;
  transformation.Transform(node->Transformation());
  transformation.Push();

  // Draw elements
  for (int i = 0; i < node->NElements(); i++) {
    R3SceneElement *element = node->Element(i);
    element->Draw(draw_flags);
  }

  // Draw references
  for (int i = 0; i < node->NReferences(); i++) {
    R3SceneReference *reference = node->Reference(i);
    reference->Draw(draw_flags);
  }

  // Pop transformation
  transformation.Pop();

  // Draw children
  for (int i = 0; i < node->NChildren(); i++) {
    R3SceneNode *child = node->Child(i);
    DrawNodeWithLights(scene, child, transformation, draw_flags, min_light, max_light);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x0, 0x3c(%rsi)
jg 0x28339
cmpl $0x0, 0x4c(%r14)
jle 0x28373
movq %r14, %rdi
callq 0x386ba
movq %rsp, %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x63ce2
movq %r13, %rdi
movq %r12, %rsi
callq 0x648b2
movq %rsp, %rsi
pushq $0x1
popq %rdx
pushq $0x7
popq %rcx
movq %r15, %rdi
callq 0x2805e
movq %rsp, %rdi
callq 0x6499a
movq %rsp, %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x34464
leaq 0x58(%r14), %rsi
movq %r13, %rdi
callq 0x669c2
movq %rsp, %rdi
callq 0x40294
xorl %r12d, %r12d
movslq 0x3c(%r14), %rax
cmpq %rax, %r12
jge 0x283b8
movq 0x30(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x39a8a
incq %r12
jmp 0x28398
xorl %r12d, %r12d
movslq 0x4c(%r14), %rax
cmpq %rax, %r12
jge 0x283db
movq 0x40(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x39e28
incq %r12
jmp 0x283bb
movq %rsp, %rdi
callq 0x402d0
xorl %r13d, %r13d
movq %rsp, %r12
movslq 0x2c(%r14), %rax
cmpq %rax, %r13
jge 0x2840d
movq 0x20(%r14), %rax
movq (%rax,%r13,8), %rsi
movq %r15, %rdi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x28310
incq %r13
jmp 0x283e9
movq %rsp, %rdi
callq 0x66856
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6499a
jmp 0x28444
jmp 0x28439
jmp 0x28439
jmp 0x28439
movq %rax, %rbx
movq %rsp, %rdi
callq 0x66856
movq %rbx, %rdi
callq 0x220e0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x2ba62
movq (%r14), %rbx
movq %rsi, %rdi
callq 0x3169b
testq %rax, %rax
je 0x2bac5
movq %rax, %r12
pushq $0x60
popq %rdi
callq 0x218d0
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
callq 0x394c0
movq %r15, %rdi
movq %r12, %rsi
callq 0x3971a
movl $0x1b0, %edi            # imm = 0x1B0
callq 0x218d0
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x37a1e
movq %r12, %rdi
movq %r15, %rsi
callq 0x389c8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3898c
pushq $0x1
popq %rax
jmp 0x2bac7
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 0x2bae9
movq %rax, %rbx
pushq $0x60
popq %rsi
movq %r15, %rdi
callq 0x218f0
movq %rbx, %rdi
callq 0x220e0
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x2e
popq %rsi
movq %rbx, %rdi
callq 0x219c0
testq %rax, %rax
je 0x2e628
movq %rax, %r15
leaq 0x96fb6(%rip), %rsi     # 0xc558b
pushq $0x4
popq %rdx
movq %rax, %rdi
callq 0x213e0
testl %eax, %eax
je 0x2e63d
leaq 0x97c85(%rip), %rsi     # 0xc6270
pushq $0x4
popq %rdx
movq %r15, %rdi
callq 0x213e0
testl %eax, %eax
je 0x2e64a
leaq 0x96fae(%rip), %rsi     # 0xc55af
pushq $0x4
popq %rdx
movq %r15, %rdi
callq 0x213e0
testl %eax, %eax
je 0x2e657
leaq 0x96fd3(%rip), %rdi     # 0xc55ea
xorl %ebp, %ebp
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x7e83e
jmp 0x2e66d
leaq 0x96f31(%rip), %rdi     # 0xc5560
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x7e83e
jmp 0x2e66d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2e67a
jmp 0x2e662
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2ec6e
jmp 0x2e662
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2ec92
testl %eax, %eax
je 0x2e66b
pushq $0x1
popq %rbp
jmp 0x2e66d
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq