// File: /workspace/github_cpp_makefile_star2_O2/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 0x7e861
pushq $0x64
popq %rdi
movl %edi, %esi
callq 0x7ed5c
movl 0xf3b7d(%rip), %edi     # 0x11688c
movl 0xf3b7b(%rip), %esi     # 0x116890
callq 0x7ed72
movl $0x92, %edi
callq 0x7ed91
leaq 0x9248e(%rip), %rdi     # 0xb51b9
callq 0x838b8
movl %eax, 0xf8a62(%rip)     # 0x11b798
callq 0x7aebc
movl $0x809d, %edi           # imm = 0x809D
callq 0x1f6d0
movss 0x922c3(%rip), %xmm0    # 0xb5010
movss 0x922af(%rip), %xmm3    # 0xb5004
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x1fc40
leaq 0xf3b39(%rip), %rsi     # 0x1168a0
movl $0xb53, %edi            # imm = 0xB53
callq 0x1ff60
pushq $0x1
popq %rsi
movl $0xb51, %edi            # imm = 0xB51
callq 0x1f130
leaq 0xf3b2b(%rip), %rdx     # 0x1168b0
movl $0x4000, %edi           # imm = 0x4000
movl $0x1201, %esi           # imm = 0x1201
callq 0x1fe50
movl $0x4000, %edi           # imm = 0x4000
callq 0x1f6d0
leaq 0xf3b1b(%rip), %rdx     # 0x1168c0
movl $0x4001, %edi           # imm = 0x4001
movl $0x1201, %esi           # imm = 0x1201
callq 0x1fe50
movl $0x4001, %edi           # imm = 0x4001
callq 0x1f6d0
movl $0xba1, %edi            # imm = 0xBA1
callq 0x1f6d0
movl $0xb50, %edi            # imm = 0xB50
callq 0x1f6d0
movl $0xb71, %edi            # imm = 0xB71
callq 0x1f6d0
leaq -0x1164(%rip), %rdi     # 0x21c7f
callq 0x7d380
leaq -0x70e(%rip), %rdi      # 0x226e1
callq 0x7d3d5
leaq -0x40a(%rip), %rdi      # 0x229f1
callq 0x7d417
leaq -0x5b3(%rip), %rdi      # 0x22854
callq 0x7d45f
leaq -0x608(%rip), %rdi      # 0x2280b
callq 0x7d7a6
leaq -0x6fe(%rip), %rdi      # 0x22721
popq %rax
jmp 0x7d836