LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movl %esi, 0x10(%rsp)
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %ecx
xorl %esi, %esi
movl %esi, %edi
callq 0x22240
movq 0x1d36f4(%rip), %rdi    # 0x1fbc28
movl 0x14(%rsp), %ecx
movl 0x10(%rsp), %r8d
xorl %edx, %edx
movl %edx, %esi
callq 0x5a640
movq 0x1d36cb(%rip), %rax    # 0x1fbc18
movq %rax, 0x8(%rsp)
movq 0x1d36cf(%rip), %rdi    # 0x1fbc28
callq 0x2b6d0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x2d1a0
movl 0x14(%rsp), %eax
movl %eax, 0x1cd54f(%rip)    # 0x1f5ac4
movl 0x10(%rsp), %eax
movl %eax, 0x1cd549(%rip)    # 0x1f5ac8
callq 0x179f80
addq $0x18, %rsp
retq
nopl (%rax)
// File: 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:
subq $0xc8, %rsp
movl %edi, 0xc4(%rsp)
movl %esi, 0xc0(%rsp)
movl %edx, 0xbc(%rsp)
movl 0x1cc9a6(%rip), %eax    # 0x1f5ac8
movl 0xbc(%rsp), %ecx
subl %ecx, %eax
movl %eax, 0xbc(%rsp)
movl 0xc4(%rsp), %eax
addl $-0x64, %eax
movl %eax, %ecx
movq %rcx, 0x20(%rsp)
subl $0x3, %eax
ja 0x29295
movq 0x20(%rsp), %rax
leaq 0x164f3c(%rip), %rcx    # 0x18e094
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x1d2ac0(%rip), %rax    # 0x1fbc28
movq %rax, 0x18(%rsp)
movq 0x1d2ab4(%rip), %rdi    # 0x1fbc28
callq 0x2b4d0
movq %rax, %rsi
leaq 0x88(%rsp), %rdi
callq 0x2b850
leaq 0xa0(%rsp), %rdi
movsd 0x164eaf(%rip), %xmm0   # 0x18e048
leaq 0x88(%rsp), %rsi
callq 0x2b630
movq 0x18(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x2b740
jmp 0x29295
movq 0x1d2a64(%rip), %rax    # 0x1fbc28
movq %rax, 0x10(%rsp)
movq 0x1d2a58(%rip), %rdi    # 0x1fbc28
callq 0x2b4d0
movq %rax, %rdi
callq 0x2b720
movq %rax, %rsi
leaq 0x70(%rsp), %rdi
movsd 0x164e5b(%rip), %xmm0   # 0x18e048
callq 0x2b630
movq 0x10(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x2b740
jmp 0x29295
movq 0x1d2a1b(%rip), %rax    # 0x1fbc28
movq %rax, 0x8(%rsp)
movq 0x1d2a0f(%rip), %rdi    # 0x1fbc28
callq 0x2b4d0
movq %rax, %rsi
leaq 0x40(%rsp), %rdi
callq 0x2b7c0
leaq 0x58(%rsp), %rdi
movsd 0x164e10(%rip), %xmm0   # 0x18e048
leaq 0x40(%rsp), %rsi
callq 0x2b630
movq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x2b740
jmp 0x29295
movq 0x1d29ce(%rip), %rax    # 0x1fbc28
movq %rax, (%rsp)
movq 0x1d29c3(%rip), %rdi    # 0x1fbc28
callq 0x2b4d0
movq %rax, %rdi
callq 0x2b890
movq %rax, %rsi
leaq 0x28(%rsp), %rdi
movsd 0x164dc6(%rip), %xmm0   # 0x18e048
callq 0x2b630
movq (%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x2b740
movl 0xc0(%rsp), %eax
movl %eax, 0x1d2a26(%rip)    # 0x1fbcc8
movl 0xbc(%rsp), %eax
movl %eax, 0x1d2a1d(%rip)    # 0x1fbccc
callq 0x1821b0
movl %eax, 0x1d2a1a(%rip)    # 0x1fbcd4
callq 0x179f80
addq $0xc8, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x17b1f0
movl $0x64, %esi
movl %esi, %edi
callq 0x17b970
movl 0x1cc295(%rip), %edi    # 0x1f5ac4
movl 0x1cc293(%rip), %esi    # 0x1f5ac8
callq 0x17b9b0
movl $0x1a, %edi
callq 0x17b9f0
leaq 0x164a24(%rip), %rdi    # 0x18e26f
callq 0x184210
movl %eax, 0x1d23ba(%rip)    # 0x1fbc10
callq 0xeed00
movl $0xb71, %edi            # imm = 0xB71
callq 0x22910
movl $0x1700, %edi           # imm = 0x1700
callq 0x22e50
callq 0x22dd0
movl $0xb53, %edi            # imm = 0xB53
leaq 0x1cc250(%rip), %rsi    # 0x1f5ad0
callq 0x233e0
movl $0xb51, %edi            # imm = 0xB51
movl $0x1, %esi
callq 0x22170
movl $0xb52, %edi            # imm = 0xB52
movl $0x1, %esi
callq 0x22170
movl $0xba1, %edi            # imm = 0xBA1
callq 0x22910
movl $0xb50, %edi            # imm = 0xB50
callq 0x22910
movl $0xb57, %edi            # imm = 0xB57
callq 0x22910
movl $0x404, %edi            # imm = 0x404
movl $0x1602, %esi           # imm = 0x1602
callq 0x22640
leaq -0x2ab7(%rip), %rdi     # 0x26e20
callq 0x179190
leaq -0x13d3(%rip), %rdi     # 0x28510
callq 0x179210
leaq -0x61f(%rip), %rdi      # 0x292d0
callq 0x179280
leaq -0x7fb(%rip), %rdi      # 0x29100
callq 0x1792f0
leaq -0xfc7(%rip), %rdi      # 0x28940
callq 0x179820
leaq -0x1383(%rip), %rdi     # 0x28590
callq 0x179900
addq $0x18, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x18, %rsp
cmpq $0x0, 0x1d22fc(%rip)    # 0x1fbc28
je 0x29938
cmpq $0x0, 0x1d22e2(%rip)    # 0x1fbc18
jne 0x2993a
jmp 0x299a5
movq 0x1d22d7(%rip), %rdi    # 0x1fbc18
callq 0x2b590
movq %rax, %rsi
movq (%rsi), %rax
movq %rsp, %rdi
callq *0x68(%rax)
leaq 0x1d229f(%rip), %rdi    # 0x1fbbf8
movq %rsp, %rsi
callq 0xccf00
cmpl $0x0, 0x1d2328(%rip)    # 0x1fbc90
je 0x299a0
movl $0x4000, %edi           # imm = 0x4000
movl $0x1201, %esi           # imm = 0x1201
leaq 0x1cc165(%rip), %rdx    # 0x1f5ae0
callq 0x23270
movl $0x4000, %edi           # imm = 0x4000
movl $0x1203, %esi           # imm = 0x1203
leaq 0x1cc15f(%rip), %rdx    # 0x1f5af0
callq 0x23270
movl $0x4000, %edi           # imm = 0x4000
callq 0x22910
callq 0x17eff0
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/apps/scnview/scnview.cpp
// Function: main
int main(int argc, char **argv)
{
  // Initialize packages
  if (!R3InitGraphics()) exit(-1);

  // Parse program arguments
  if (!ParseArgs(argc, argv)) exit(-1);

  // Read scene
  scene = ReadScene(input_scene_name);
  if (!scene) exit(-1);

  // Read cameras
  if (input_cameras_name) {
    cameras = ReadCameras(input_cameras_name);
    if (!cameras) exit(-1);
  }

  // Read categories
  if (input_categories_name) {
    if (!ReadCategories(input_categories_name)) exit(-1);
  }

  // Read/create lights
  if (input_lights_name) { if (!ReadLights(input_lights_name)) exit(-1); }
  else { scene->CreateDirectionalLights(); headlight = 1; }

  // Create viewer
  viewer = CreateBirdsEyeViewer(scene);
  if (!viewer) exit(-1);

  // Initialize GLUT
  GLUTInit(&argc, argv);

  // Run GLUT interface
  GLUTMainLoop();

  // Return success 
  return 0;
}

// Assembly:
subq $0x18, %rsp
movl $0x0, 0x14(%rsp)
movl %edi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
callq 0x2c1b0
cmpl $0x0, %eax
jne 0x299d9
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x22c60
movl 0x10(%rsp), %edi
movq 0x8(%rsp), %rsi
callq 0x29b00
cmpl $0x0, %eax
jne 0x299f6
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x22c60
movq 0x1d230b(%rip), %rdi    # 0x1fbd08
callq 0x2a440
movq %rax, 0x1d220f(%rip)    # 0x1fbc18
cmpq $0x0, 0x1d2207(%rip)    # 0x1fbc18
jne 0x29a1d
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x22c60
cmpq $0x0, 0x1d22eb(%rip)    # 0x1fbd10
je 0x29a50
movq 0x1d22e2(%rip), %rdi    # 0x1fbd10
callq 0x2a680
movq %rax, 0x1d21fe(%rip)    # 0x1fbc38
cmpq $0x0, 0x1d21f6(%rip)    # 0x1fbc38
jne 0x29a4e
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x22c60
jmp 0x29a50
cmpq $0x0, 0x1d22c0(%rip)    # 0x1fbd18
je 0x29a77
movq 0x1d22b7(%rip), %rdi    # 0x1fbd18
callq 0x2ab00
cmpl $0x0, %eax
jne 0x29a75
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x22c60
jmp 0x29a77
cmpq $0x0, 0x1d22a1(%rip)    # 0x1fbd20
je 0x29a9e
movq 0x1d2298(%rip), %rdi    # 0x1fbd20
callq 0x2aba0
cmpl $0x0, %eax
jne 0x29a9c
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x22c60
jmp 0x29ab4
movq 0x1d2173(%rip), %rdi    # 0x1fbc18
callq 0x2db20
movl $0x1, 0x1d21dc(%rip)    # 0x1fbc90
movq 0x1d215d(%rip), %rdi    # 0x1fbc18
callq 0x2ac50
movq %rax, 0x1d2161(%rip)    # 0x1fbc28
cmpq $0x0, 0x1d2159(%rip)    # 0x1fbc28
jne 0x29adb
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x22c60
movq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x29800
callq 0x29920
xorl %eax, %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/apps/scnview/scnview.cpp
// Function: ReadCategories(char const*)
static int
ReadCategories(const char *filename)
{
  // Start statistics
  RNTime start_time;
  start_time.Read();

  // Read file
  if (!scene->ReadSUNCGModelFile(filename)) return 0;

  // Print statistics
  if (print_verbose) {
    printf("Read categories from %s ...\n", filename);
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    fflush(stdout);
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
leaq 0x8(%rsp), %rdi
callq 0xeeb80
leaq 0x8(%rsp), %rdi
callq 0x2b680
movq 0x1d10f4(%rip), %rdi    # 0x1fbc18
movq 0x18(%rsp), %rsi
callq 0x42030
cmpl $0x0, %eax
jne 0x2ab3d
movl $0x0, 0x24(%rsp)
jmp 0x2ab88
cmpl $0x0, 0x1d11e4(%rip)    # 0x1fbd28
je 0x2ab80
movq 0x18(%rsp), %rsi
leaq 0x1639f8(%rip), %rdi    # 0x18e54a
movb $0x0, %al
callq 0x22090
leaq 0x8(%rsp), %rdi
callq 0xeec40
leaq 0x1638e6(%rip), %rdi    # 0x18e450
movb $0x1, %al
callq 0x22090
movq 0x1ca418(%rip), %rax    # 0x1f4f90
movq (%rax), %rdi
callq 0x22c00
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/apps/scnview/scnview.cpp
// Function: ReadLights(char const*)
static int
ReadLights(const char *filename)
{
  // Start statistics
  RNTime start_time;
  start_time.Read();

  // Read lights file
  if (!scene->ReadSUNCGLightsFile(filename)) return 0;

  // Print statistics
  if (print_verbose) {
    printf("Read lights from %s ...\n", filename);
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    printf("  # Lights = %d\n", scene->NLights());
    fflush(stdout);
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
leaq 0x8(%rsp), %rdi
callq 0xeeb80
leaq 0x8(%rsp), %rdi
callq 0x2b680
movq 0x1d1054(%rip), %rdi    # 0x1fbc18
movq 0x18(%rsp), %rsi
callq 0x412b0
cmpl $0x0, %eax
jne 0x2abdd
movl $0x0, 0x24(%rsp)
jmp 0x2ac44
cmpl $0x0, 0x1d1144(%rip)    # 0x1fbd28
je 0x2ac3c
movq 0x18(%rsp), %rsi
leaq 0x163975(%rip), %rdi    # 0x18e567
movb $0x0, %al
callq 0x22090
leaq 0x8(%rsp), %rdi
callq 0xeec40
leaq 0x163846(%rip), %rdi    # 0x18e450
movb $0x1, %al
callq 0x22090
movq 0x1d1000(%rip), %rdi    # 0x1fbc18
callq 0x2b9f0
movl %eax, %esi
leaq 0x163851(%rip), %rdi    # 0x18e477
movb $0x0, %al
callq 0x22090
movq 0x1ca35c(%rip), %rax    # 0x1f4f90
movq (%rax), %rdi
callq 0x22c00
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/apps/scnview/scnview.cpp
// Function: CreateBirdsEyeViewer(gaps::R3Scene const*)
static R3Viewer *
CreateBirdsEyeViewer(const R3Scene *scene)
{
  // Setup camera view looking down the Z axis
  R3Box bbox = scene->BBox();
  assert(!bbox.IsEmpty());
  RNLength r = bbox.DiagonalRadius();
  assert((r > 0.0) && RNIsFinite(r));
  if (!initial_camera) initial_camera_origin = scene->Centroid() - initial_camera_towards * (2.5 * r);
  R3Camera camera(initial_camera_origin, initial_camera_towards, initial_camera_up, 0.4, 0.4, 0.01 * r, 100.0 * r);
  R2Viewport viewport(0, 0, GLUTwindow_width, GLUTwindow_height);
  return new R3Viewer(camera, viewport);
}

// Assembly:
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x150(%rsp)
movq 0x150(%rsp), %rdi
callq 0x2b590
movq %rax, %rsi
leaq 0x118(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xb72c0
movq 0x8(%rsp), %rdi
callq 0x2b5b0
movsd %xmm0, 0x10(%rsp)
jmp 0x2ac93
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x110(%rsp)
cmpl $0x0, 0x1d1097(%rip)    # 0x1fbd40
jne 0x2ad41
movq 0x150(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0x2c170
jmp 0x2acc6
movsd 0x110(%rsp), %xmm0
movsd 0x1633a9(%rip), %xmm1   # 0x18e080
mulsd %xmm1, %xmm0
leaq 0x1d0eb6(%rip), %rsi    # 0x1fbb98
leaq 0xb8(%rsp), %rdi
callq 0xce8a0
jmp 0x2acf1
leaq 0xe8(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0xcd7d0
jmp 0x2ad10
leaq 0x1d0eb1(%rip), %rdi    # 0x1fbbc8
leaq 0xe8(%rsp), %rsi
callq 0xccf00
jmp 0x2ad26
jmp 0x2ad41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
jmp 0x2ae0e
movsd 0x110(%rsp), %xmm3
movsd 0x1632e6(%rip), %xmm0   # 0x18e038
movaps %xmm3, %xmm2
mulsd %xmm0, %xmm2
movsd 0x1632cf(%rip), %xmm0   # 0x18e030
mulsd %xmm0, %xmm3
leaq 0x1d0e5c(%rip), %rsi    # 0x1fbbc8
leaq 0x1d0e25(%rip), %rdx    # 0x1fbb98
leaq 0x1d0e36(%rip), %rcx    # 0x1fbbb0
leaq 0x28(%rsp), %rdi
movsd 0x1632e1(%rip), %xmm1   # 0x18e068
movaps %xmm1, %xmm0
callq 0x5d920
jmp 0x2ad91
movl 0x1cad2d(%rip), %ecx    # 0x1f5ac4
movl 0x1cad2a(%rip), %r8d    # 0x1f5ac8
leaq 0x18(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x5ef90
jmp 0x2adae
movl $0xa8, %edi
callq 0x229e0
movq %rax, (%rsp)
jmp 0x2adbe
movq (%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x5a320
jmp 0x2add3
leaq 0x118(%rsp), %rdi
callq 0x2c1a0
movq (%rsp), %rax
addq $0x158, %rsp            # imm = 0x158
retq
movq (%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
movl $0xa8, %esi
callq 0x22a00
leaq 0x118(%rsp), %rdi
callq 0x2c1a0
movq 0x108(%rsp), %rdi
callq 0x23290
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Graphics.cpp
// Function: gaps::R3InitGraphics()
int R3InitGraphics(void)
{
    // Check whether are already initialized 
    if ((R3graphics_active_count++) > 0) return TRUE;

    // Initialize dependencies
    if (!R3InitShapes()) return FALSE;

    // Initialize submodules 
    if (!R3InitMaterial()) return FALSE;

    // return OK status 
    return TRUE;
}

// Assembly:
pushq %rax
movl 0x1cfb8d(%rip), %eax    # 0x1fbd44
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x1cfb82(%rip)    # 0x1fbd44
cmpl $0x0, %eax
jle 0x2c1d1
movl $0x1, 0x4(%rsp)
jmp 0x2c201
callq 0x66270
cmpl $0x0, %eax
jne 0x2c1e5
movl $0x0, 0x4(%rsp)
jmp 0x2c201
callq 0x63370
cmpl $0x0, %eax
jne 0x2c1f9
movl $0x0, 0x4(%rsp)
jmp 0x2c201
movl $0x1, 0x4(%rsp)
movl 0x4(%rsp), %eax
popq %rcx
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::~R3Scene()
R3Scene::
~R3Scene(void)
{
  // Delete everything
  // ???

  // Delete filename
  if (filename) free(filename);

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

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x148(%rax)
je 0x2c50e
movq 0x8(%rsp), %rax
movq 0x148(%rax), %rdi
callq 0x22c30
movq 0x8(%rsp), %rax
cmpq $0x0, 0x150(%rax)
je 0x2c52e
movq 0x8(%rsp), %rax
movq 0x150(%rax), %rdi
callq 0x22c30
movq 0x8(%rsp), %rdi
addq $0x70, %rdi
callq 0x5a400
movq 0x8(%rsp), %rdi
addq $0x68, %rdi
callq 0x481b0
movq 0x8(%rsp), %rdi
addq $0x58, %rdi
callq 0x481c0
movq 0x8(%rsp), %rdi
addq $0x48, %rdi
callq 0x481d0
movq 0x8(%rsp), %rdi
addq $0x38, %rdi
callq 0x481e0
movq 0x8(%rsp), %rdi
addq $0x28, %rdi
callq 0x481f0
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
callq 0x48200
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
callq 0x48210
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x2bf50
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x2c648
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x2bf70
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x2b800
cmpq $0x0, %rax
jne 0x2c611
jmp 0x2c63b
movq 0x10(%rsp), %rdi
callq 0x2b800
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x22ec0
cmpl $0x0, %eax
jne 0x2c639
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x2c651
jmp 0x2c63b
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x2c5d0
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x2c020
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x2c6f8
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x48220
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x48250
cmpq $0x0, %rax
jne 0x2c6c1
jmp 0x2c6eb
movq 0x10(%rsp), %rdi
callq 0x48250
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x22ec0
cmpl $0x0, %eax
jne 0x2c6e9
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x2c701
jmp 0x2c6eb
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x2c680
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x2b9f0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x2c7a8
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x2ba10
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x48260
cmpq $0x0, %rax
jne 0x2c771
jmp 0x2c79b
movq 0x10(%rsp), %rdi
callq 0x48260
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x22ec0
cmpl $0x0, %eax
jne 0x2c799
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x2c7b1
jmp 0x2c79b
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x2c730
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x2c040
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x2c858
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x48270
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x482a0
cmpq $0x0, %rax
jne 0x2c821
jmp 0x2c84b
movq 0x10(%rsp), %rdi
callq 0x482a0
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x22ec0
cmpl $0x0, %eax
jne 0x2c849
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x2c861
jmp 0x2c84b
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x2c7e0
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x2c060
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x2c908
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x482b0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x482e0
cmpq $0x0, %rax
jne 0x2c8d1
jmp 0x2c8fb
movq 0x10(%rsp), %rdi
callq 0x482e0
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x22ec0
cmpl $0x0, %eax
jne 0x2c8f9
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x2c911
jmp 0x2c8fb
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x2c890
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x2c080
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x2c9b8
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x482f0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x48320
cmpq $0x0, %rax
jne 0x2c981
jmp 0x2c9ab
movq 0x10(%rsp), %rdi
callq 0x48320
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x22ec0
cmpl $0x0, %eax
jne 0x2c9a9
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x2c9c1
jmp 0x2c9ab
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x2c940
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
addq $0x8, %rdi
movq 0x28(%rsp), %rax
movl 0x8(%rax), %esi
callq 0x48370
movq 0x10(%rsp), %rdi
movq %rax, 0x20(%rsp)
addq $0x8, %rdi
callq 0x48390
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x8, %rdi
movq 0x20(%rsp), %rsi
callq 0x483a0
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x8(%rax)
addq $0x8, %rdi
callq 0x483b0
movq 0x28(%rsp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rax
movq $0x0, (%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
addq $0x18, %rdi
movq 0x28(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x48370
movq 0x10(%rsp), %rdi
movq %rax, 0x20(%rsp)
addq $0x18, %rdi
callq 0x48400
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x18, %rdi
movq 0x20(%rsp), %rsi
callq 0x48410
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x10(%rax)
addq $0x18, %rdi
callq 0x483b0
movq 0x28(%rsp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rax
movq $0x0, 0x8(%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
addq $0x28, %rdi
movq 0x28(%rsp), %rax
movl 0x8(%rax), %esi
callq 0x48370
movq 0x10(%rsp), %rdi
movq %rax, 0x20(%rsp)
addq $0x28, %rdi
callq 0x48450
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x28, %rdi
movq 0x20(%rsp), %rsi
callq 0x48460
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x8(%rax)
addq $0x28, %rdi
callq 0x483b0
movq 0x28(%rsp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rax
movq $0x0, (%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
addq $0x38, %rdi
movq 0x28(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x48370
movq 0x10(%rsp), %rdi
movq %rax, 0x20(%rsp)
addq $0x38, %rdi
callq 0x484a0
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x38, %rdi
movq 0x20(%rsp), %rsi
callq 0x484b0
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x10(%rax)
addq $0x38, %rdi
callq 0x483b0
movq 0x28(%rsp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rax
movq $0x0, 0x8(%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Graphics/R3Scene.cpp
// Function: gaps::R3Scene::SetName(char const*)
void R3Scene::
SetName(const char *name)
{
  // Set name
  if (this->name) free(this->name);
  if (name) this->name = RNStrdup(name);
  else this->name = NULL;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, 0x150(%rax)
je 0x2d231
movq (%rsp), %rax
movq 0x150(%rax), %rdi
callq 0x22c30
cmpq $0x0, 0x8(%rsp)
je 0x2d253
movq 0x8(%rsp), %rdi
callq 0xf3800
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x150(%rax)
jmp 0x2d262
movq (%rsp), %rax
movq $0x0, 0x150(%rax)
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movq (%rdi), %rsi
callq 0x2d310
movq 0x10(%rsp), %rdi
callq 0x2c080
cmpl $0x0, %eax
jle 0x2d305
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x482f0
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rsi
callq 0x2cf00
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x2d303
movq 0x8(%rsp), %rdi
callq 0x2c4e0
movq 0x8(%rsp), %rdi
movl $0x160, %esi            # imm = 0x160
callq 0x22a00
jmp 0x2d2ab
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x58(%rsp), %rdi
callq 0x2baf0
movl %eax, %ecx
movl 0x24(%rsp), %eax
cmpl %ecx, %eax
jge 0x2d371
movq 0x58(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x2bb10
movq %rax, 0x48(%rsp)
movq 0x60(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x2d310
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x2d326
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x20(%rsp)
movq 0x58(%rsp), %rdi
callq 0x2bb40
movl %eax, %ecx
movl 0x20(%rsp), %eax
cmpl %ecx, %eax
jge 0x2d406
movq 0x58(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0x2bb60
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
callq 0x2bb90
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
callq 0x49d20
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rax, %rcx
callq 0x42cd0
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x2d379
jmp 0x2d408
movq 0x58(%rsp), %rdi
callq 0x2bb40
cmpl $0x0, %eax
jle 0x2d45f
movq 0x58(%rsp), %rdi
xorl %esi, %esi
callq 0x2bb60
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x55cd0
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x2d45d
movq (%rsp), %rdi
callq 0x59ce0
movq (%rsp), %rdi
movl $0x30, %esi
callq 0x22a00
jmp 0x2d408
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x188, %rsp            # imm = 0x188
movq %rdi, 0x180(%rsp)
movq %rsi, 0x178(%rsp)
movq %rdx, 0x170(%rsp)
leaq 0x1d14fa(%rip), %rsi    # 0x1fe9d0
leaq 0x60(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x48c80
movq 0x30(%rsp), %rdi
movq 0x170(%rsp), %rsi
callq 0xc1dd0
jmp 0x2d4f9
movq 0x178(%rsp), %rdi
callq 0x2bae0
movq %rax, 0x28(%rsp)
jmp 0x2d50d
movq 0x28(%rsp), %rsi
leaq 0x60(%rsp), %rdi
callq 0xc1dd0
jmp 0x2d51e
movl $0x0, 0x50(%rsp)
movl 0x50(%rsp), %eax
movl %eax, 0x20(%rsp)
movq 0x178(%rsp), %rdi
callq 0x2baf0
movl %eax, 0x24(%rsp)
jmp 0x2d541
movl 0x20(%rsp), %eax
movl 0x24(%rsp), %ecx
cmpl %ecx, %eax
jge 0x2d5b4
movq 0x178(%rsp), %rdi
movl 0x50(%rsp), %esi
callq 0x2bb10
movq %rax, 0x18(%rsp)
jmp 0x2d565
movq 0x18(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x180(%rsp), %rdi
movq 0x48(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0x2d4b0
jmp 0x2d588
jmp 0x2d58a
movl 0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x50(%rsp)
jmp 0x2d526
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x60(%rsp), %rdi
callq 0xc1b00
jmp 0x2d665
movq 0x180(%rsp), %rdi
callq 0x2b510
movq %rax, 0x10(%rsp)
jmp 0x2d5c8
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x178(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0x2d653
movq 0x178(%rsp), %rdi
callq 0x49480
movq %rax, 0x8(%rsp)
jmp 0x2d5f5
movq 0x8(%rsp), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x2d651
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0x2d651
movq 0x178(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x577d0
jmp 0x2d627
movq 0x38(%rsp), %rdi
movq 0x178(%rsp), %rsi
callq 0x55d10
jmp 0x2d63b
movq 0x40(%rsp), %rdi
movq 0x178(%rsp), %rsi
callq 0x57450
jmp 0x2d64f
jmp 0x2d651
jmp 0x2d653
leaq 0x60(%rsp), %rdi
callq 0xc1b00
addq $0x188, %rsp            # imm = 0x188
retq
movq 0x58(%rsp), %rdi
callq 0x23290
nop
// File: 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:
subq $0x198, %rsp            # imm = 0x198
movq %rdi, 0x190(%rsp)
movq %rsi, 0x188(%rsp)
movq %rdx, 0x180(%rsp)
leaq 0x1d131a(%rip), %rsi    # 0x1fe9d0
leaq 0x70(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x48c80
movq 0x38(%rsp), %rdi
movq 0x180(%rsp), %rsi
callq 0xc1dd0
jmp 0x2d6d9
movq 0x188(%rsp), %rdi
callq 0x2bae0
movq %rax, 0x30(%rsp)
jmp 0x2d6ed
movq 0x30(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0xc1dd0
jmp 0x2d6fe
movq 0x188(%rsp), %rdi
callq 0x2bb40
movl %eax, 0x2c(%rsp)
jmp 0x2d711
movl 0x2c(%rsp), %eax
cmpl $0x0, %eax
jle 0x2d758
movq 0x188(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x577d0
jmp 0x2d72e
movl $0x1, 0x60(%rsp)
jmp 0x2d860
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x70(%rsp), %rdi
callq 0xc1b00
jmp 0x2d872
movl $0x0, 0x5c(%rsp)
movl 0x5c(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x188(%rsp), %rdi
callq 0x2bba0
movl %eax, 0x28(%rsp)
jmp 0x2d77b
movl 0x24(%rsp), %eax
movl 0x28(%rsp), %ecx
cmpl %ecx, %eax
jge 0x2d7c9
movq 0x188(%rsp), %rdi
movl 0x5c(%rsp), %esi
callq 0x2bbc0
movq %rax, 0x18(%rsp)
jmp 0x2d79f
movq 0x18(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x59450
jmp 0x2d7ba
jmp 0x2d7bc
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x2d760
movl $0x0, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
movl %eax, 0x10(%rsp)
movq 0x188(%rsp), %rdi
callq 0x2baf0
movl %eax, 0x14(%rsp)
jmp 0x2d7ec
movl 0x10(%rsp), %eax
movl 0x14(%rsp), %ecx
cmpl %ecx, %eax
jge 0x2d842
movq 0x188(%rsp), %rdi
movl 0x4c(%rsp), %esi
callq 0x2bb10
movq %rax, 0x8(%rsp)
jmp 0x2d810
movq 0x8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x190(%rsp), %rdi
movq 0x40(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x2d690
jmp 0x2d833
jmp 0x2d835
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x2d7d1
movq 0x188(%rsp), %rdi
leaq 0x1d117f(%rip), %rsi    # 0x1fe9d0
callq 0x577d0
jmp 0x2d858
movl $0x0, 0x60(%rsp)
leaq 0x70(%rsp), %rdi
callq 0xc1b00
addq $0x198, %rsp            # imm = 0x198
retq
movq 0x68(%rsp), %rdi
callq 0x23290
nopl (%rax)
// File: 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:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0xa8(%rsp), %rdi
movq %rdi, 0x28(%rsp)
movsd 0x1604bf(%rip), %xmm2   # 0x18e010
movsd %xmm2, 0x30(%rsp)
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xef340
leaq 0x90(%rsp), %rdi
movq %rdi, 0x20(%rsp)
movsd 0x160a11(%rip), %xmm0   # 0x18e588
movsd 0x160a11(%rip), %xmm1   # 0x18e590
movsd 0x160a11(%rip), %xmm2   # 0x18e598
callq 0xcd9d0
movq 0x20(%rsp), %rdi
callq 0xce130
movl $0x68, %edi
callq 0x229e0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movsd 0x30(%rsp), %xmm0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x38(%rsp)
movl $0x1, %ecx
callq 0x62270
jmp 0x2dbc7
movq 0x18(%rsp), %rdi
movq 0x38(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rsi
callq 0x2cad0
leaq 0x60(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movsd 0x160428(%rip), %xmm2   # 0x18e020
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xef340
leaq 0x48(%rsp), %rdi
movq %rdi, (%rsp)
movsd 0x16043c(%rip), %xmm1   # 0x18e050
movsd 0x160984(%rip), %xmm2   # 0x18e5a0
movaps %xmm2, %xmm0
callq 0xcd9d0
movq (%rsp), %rdi
callq 0xce130
movl $0x68, %edi
callq 0x229e0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movsd 0x1603bd(%rip), %xmm0   # 0x18e010
movl $0x1, %ecx
callq 0x62270
jmp 0x2dc5f
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rsi
callq 0x2cad0
addq $0xc8, %rsp
retq
movq 0x38(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
movl $0x68, %esi
callq 0x22a00
jmp 0x2dcc2
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
movl $0x68, %esi
callq 0x22a00
movq 0x80(%rsp), %rdi
callq 0x23290
nop
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movl %edx, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x2be80
movq %rax, %rdi
callq 0x2b4a0
movq 0x10(%rsp), %rdi
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1cdef7(%rip)   # 0x1fbd50
callq 0x2be80
movq %rax, %rdi
callq 0x2b4b0
movq 0x10(%rsp), %rdi
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1cdedd(%rip)   # 0x1fbd54
callq 0x2be80
movq %rax, %rdi
callq 0x2b4c0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1cdec8(%rip)   # 0x1fbd58
movss 0x1601f0(%rip), %xmm0   # 0x18e088
movss %xmm0, 0x1cdebc(%rip)   # 0x1fbd5c
movl $0xb53, %edi            # imm = 0xB53
leaq 0x1cdea4(%rip), %rsi    # 0x1fbd50
callq 0x233e0
movl $0x0, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movq 0x10(%rsp), %rdi
movl 0x20(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x2b9f0
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x2df2b
movq 0x10(%rsp), %rdi
movl 0x20(%rsp), %esi
callq 0x2ba10
movq %rax, 0x18(%rsp)
movl 0x2c(%rsp), %eax
addl 0x24(%rsp), %eax
cmpl 0x28(%rsp), %eax
jle 0x2df00
jmp 0x2df2b
movq 0x18(%rsp), %rdi
movl 0x2c(%rsp), %esi
addl 0x24(%rsp), %esi
movq (%rdi), %rax
callq *0x70(%rax)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x2dec1
movl 0x24(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rsi, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
leaq 0x1cdc82(%rip), %rdi    # 0x1fc170
xorl %esi, %esi
callq 0x64360
movq (%rsp), %rdi
callq 0x2b9f0
cmpl $0x7, %eax
jle 0x2e533
movq (%rsp), %rdi
movq (%rdi), %rsi
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rcx
leaq 0x1d04b0(%rip), %rdx    # 0x1fe9d0
movl $0x1, %r8d
movl $0x7, %r9d
callq 0x2e570
jmp 0x2e552
movq (%rsp), %rax
movq (%rax), %rdi
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x58170
leaq 0x1cdc17(%rip), %rdi    # 0x1fc170
xorl %esi, %esi
callq 0x64360
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0x35642
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rdi
callq 0x3cd50
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x40(%rsp)
jne 0x35666
movl $0x0, 0x64(%rsp)
jmp 0x35730
movl $0x60, %edi
callq 0x229e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
xorl %eax, %eax
movl %eax, %esi
callq 0x58f20
jmp 0x35686
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x59370
movl $0x1b0, %edi            # imm = 0x1B0
callq 0x229e0
movq 0x18(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
callq 0x555e0
jmp 0x356c0
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x57510
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x57450
movl $0x1, 0x64(%rsp)
jmp 0x35730
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
movl $0x60, %esi
callq 0x22a00
jmp 0x35739
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
movl $0x1b0, %esi            # imm = 0x1B0
callq 0x22a00
jmp 0x35739
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0x23290
nopw %cs:(%rax,%rax)