// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/prpview/prpview.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_RGB | GLUT_DEPTH | GLUT_MULTISAMPLE);
  GLUTwindow = glutCreateWindow("Property Viewer");

  // Initialize grfx (after create context because calls glewInit)
  RNInitGrfx();

  // Initialize multisampling
  glEnable(GL_MULTISAMPLE);
  
  // Initialize background color 
  glClearColor(200.0/255.0, 200.0/255.0, 200.0/255.0, 1.0);

  // 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);
  glEnable(GL_NORMALIZE);
  glEnable(GL_LIGHTING); 

  // Initialize headlight
  static GLfloat light0_diffuse[] = { 1, 1, 1, 1 };
  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);

  // Initialize backlight
  static GLfloat light1_diffuse[] = { 1, 1, 1, 1 };
  static GLfloat light1_position[] = { 0.0, 0.0, -1.0, 0.0 };
  glLightfv(GL_LIGHT1, GL_DIFFUSE, light1_diffuse);
  glLightfv(GL_LIGHT1, GL_POSITION, light1_position);
  glEnable(GL_LIGHT1);

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

  // Initialize graphics modes  
  glEnable(GL_DEPTH_TEST);
  glShadeModel(GL_SMOOTH);

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

// Assembly:
pushq %rax
callq 0xbd1c5
pushq $0x64
popq %rdi
movl %edi, %esi
callq 0xbd6c0
movl 0x10ee08(%rip), %edi    # 0x1349d0
movl 0x10edfe(%rip), %esi    # 0x1349cc
callq 0xbd6d6
movl $0x92, %edi
callq 0xbd6f5
leaq 0xa3630(%rip), %rdi     # 0xc9214
callq 0xc221c
movl %eax, 0x113d71(%rip)    # 0x139960
callq 0x7fb90
movl $0x809d, %edi           # imm = 0x809D
callq 0x21810
movss 0xa3406(%rip), %xmm0    # 0xc900c
movss 0xa33f6(%rip), %xmm3    # 0xc9004
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x21e20
movl $0x1700, %edi           # imm = 0x1700
callq 0x21ca0
callq 0x21c30
leaq 0x10edb1(%rip), %rsi    # 0x1349e0
movl $0xb53, %edi            # imm = 0xB53
callq 0x22200
pushq $0x1
popq %rsi
movl $0xb51, %edi            # imm = 0xB51
callq 0x21140
movl $0xba1, %edi            # imm = 0xBA1
callq 0x21810
movl $0xb50, %edi            # imm = 0xB50
callq 0x21810
leaq 0x10ed8f(%rip), %rdx    # 0x1349f0
movl $0x4000, %edi           # imm = 0x4000
movl $0x1201, %esi           # imm = 0x1201
callq 0x220a0
leaq 0x10ed89(%rip), %rdx    # 0x134a00
movl $0x4000, %edi           # imm = 0x4000
movl $0x1203, %esi           # imm = 0x1203
callq 0x220a0
movl $0x4000, %edi           # imm = 0x4000
callq 0x21810
leaq 0x10ed79(%rip), %rdx    # 0x134a10
movl $0x4001, %edi           # imm = 0x4001
movl $0x1201, %esi           # imm = 0x1201
callq 0x220a0
leaq 0x10ed73(%rip), %rdx    # 0x134a20
movl $0x4001, %edi           # imm = 0x4001
movl $0x1203, %esi           # imm = 0x1203
callq 0x220a0
movl $0x4001, %edi           # imm = 0x4001
callq 0x21810
movl $0xb57, %edi            # imm = 0xB57
callq 0x21810
movl $0x408, %edi            # imm = 0x408
movl $0x1602, %esi           # imm = 0x1602
callq 0x21570
movl $0xb71, %edi            # imm = 0xB71
callq 0x21810
movl $0x1d01, %edi           # imm = 0x1D01
callq 0x22020
leaq -0x14a7(%rip), %rdi     # 0x24853
callq 0xbbce4
leaq -0x699(%rip), %rdi      # 0x2566d
callq 0xbbd39
leaq -0x230(%rip), %rdi      # 0x25ae2
callq 0xbbd7b
leaq -0x475(%rip), %rdi      # 0x258a9
callq 0xbbdc3
leaq -0x5e2(%rip), %rdi      # 0x25748
callq 0xbc10a
leaq -0x689(%rip), %rdi      # 0x256ad
popq %rax
jmp 0xbc19a