// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/apps/grdview/grdview.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("OpenGL Viewer");

  // Initialize grfx package (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 lights
  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);
  static GLfloat light0_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
  glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse);
  glEnable(GL_LIGHT0);
  static GLfloat light1_diffuse[] = { 0.5, 0.5, 0.5, 1.0 };
  glLightfv(GL_LIGHT1, GL_DIFFUSE, light1_diffuse);
  glEnable(GL_LIGHT1);
  glEnable(GL_NORMALIZE);
  glEnable(GL_LIGHTING);

  // Initialize graphics modes 
  glEnable(GL_DEPTH_TEST);

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

  // Initialize font
#if (RN_OS == RN_WINDOWSNT)
  int font = glGenLists(256);
  wglUseFontBitmaps(wglGetCurrentDC(), 0, 256, font); 
  glListBase(font);
#endif
}

// Assembly:
pushq %rax
callq 0x88641
movl $0x64, %edi
movl $0x64, %esi
callq 0x88b91
movl 0xfe0cd(%rip), %edi     # 0x12187c
movl 0xfe0cb(%rip), %esi     # 0x121880
callq 0x88ba7
movl $0x92, %edi
callq 0x88bc6
leaq 0xa09ee(%rip), %rdi     # 0xc41b9
callq 0x8db76
movl %eax, 0x102fb2(%rip)    # 0x126788
callq 0x848d4
movl $0x809d, %edi           # imm = 0x809D
callq 0x1f6c0
movss 0xa0823(%rip), %xmm0    # 0xc4010
movss 0xa080f(%rip), %xmm3    # 0xc4004
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x1fc10
leaq 0xfe089(%rip), %rsi     # 0x121890
movl $0xb53, %edi            # imm = 0xB53
callq 0x1ff30
movl $0xb51, %edi            # imm = 0xB51
movl $0x1, %esi
callq 0x1f130
leaq 0xfe079(%rip), %rdx     # 0x1218a0
movl $0x4000, %edi           # imm = 0x4000
movl $0x1201, %esi           # imm = 0x1201
callq 0x1fe20
movl $0x4000, %edi           # imm = 0x4000
callq 0x1f6c0
leaq 0xfe069(%rip), %rdx     # 0x1218b0
movl $0x4001, %edi           # imm = 0x4001
movl $0x1201, %esi           # imm = 0x1201
callq 0x1fe20
movl $0x4001, %edi           # imm = 0x4001
callq 0x1f6c0
movl $0xba1, %edi            # imm = 0xBA1
callq 0x1f6c0
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f6c0
movl $0xb71, %edi            # imm = 0xB71
callq 0x1f6c0
leaq -0x1356(%rip), %rdi     # 0x2252f
callq 0x870c8
leaq -0x76d(%rip), %rdi      # 0x23124
callq 0x8711d
leaq -0x41d(%rip), %rdi      # 0x23480
callq 0x8715f
leaq -0x5e1(%rip), %rdi      # 0x232c8
callq 0x871a7
leaq -0x636(%rip), %rdi      # 0x2327f
callq 0x874f0
leaq -0x75d(%rip), %rdi      # 0x23164
popq %rax
jmp 0x87580