// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/mshview/mshview.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 (after create context because calls glewInit)
  RNInitGrfx();

  // Initialize multisampling
  glEnable(GL_MULTISAMPLE);
  
  // Initialize background color 
  glClearColor(background[0], background[1], background[2], 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);
  glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 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);

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

  // Initialize graphics modes  
  glEnable(GL_DEPTH_TEST);
  glEnable(GL_CULL_FACE);

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

// Assembly:
pushq %rbx
callq 0xb8c41
pushq $0x64
popq %rdi
movl %edi, %esi
callq 0xb913c
movl 0x1086b9(%rip), %edi    # 0x12e9d8
movl 0x1086b7(%rip), %esi    # 0x12e9dc
callq 0xb9152
movl $0x92, %edi
callq 0xb9171
leaq 0x9ef23(%rip), %rdi     # 0xc525e
callq 0xbdc98
movl %eax, 0x10dcaa(%rip)    # 0x133ff0
callq 0x7b60c
movl $0x809d, %edi           # imm = 0x809D
callq 0x21810
cvtsd2ss 0x10d533(%rip), %xmm0   # 0x133890
cvtsd2ss 0x10d533(%rip), %xmm1   # 0x133898
cvtsd2ss 0x10d533(%rip), %xmm2   # 0x1338a0
movss 0x9ec8f(%rip), %xmm3    # 0xc5004
callq 0x21e20
leaq 0x10865f(%rip), %rsi    # 0x12e9e0
movl $0xb53, %edi            # imm = 0xB53
callq 0x22200
pushq $0x1
popq %rbx
movl $0xb51, %edi            # imm = 0xB51
movl %ebx, %esi
callq 0x21150
movl $0xb52, %edi            # imm = 0xB52
movl %ebx, %esi
callq 0x21150
leaq 0x108643(%rip), %rdx    # 0x12e9f0
movl $0x4000, %edi           # imm = 0x4000
movl $0x1201, %esi           # imm = 0x1201
callq 0x220a0
movl $0x4000, %edi           # imm = 0x4000
callq 0x21810
leaq 0x108633(%rip), %rdx    # 0x12ea00
movl $0x4001, %edi           # imm = 0x4001
movl $0x1201, %esi           # imm = 0x1201
callq 0x220a0
movl $0x4001, %edi           # imm = 0x4001
callq 0x21810
movl $0xba1, %edi            # imm = 0xBA1
callq 0x21810
movl $0xb57, %edi            # imm = 0xB57
callq 0x21810
movl $0x408, %edi            # imm = 0x408
movl $0x1602, %esi           # imm = 0x1602
callq 0x21580
movl $0xb71, %edi            # imm = 0xB71
callq 0x21810
movl $0xb44, %edi            # imm = 0xB44
callq 0x21810
leaq -0x1385(%rip), %rdi     # 0x2509f
callq 0xb7760
leaq -0x876(%rip), %rdi      # 0x25bba
callq 0xb77b5
leaq -0x557(%rip), %rdi      # 0x25ee5
callq 0xb77f7
leaq -0x5c5(%rip), %rdi      # 0x25e83
callq 0xb783f
leaq -0x7bf(%rip), %rdi      # 0x25c95
callq 0xb7b86
leaq -0x866(%rip), %rdi      # 0x25bfa
popq %rbx
jmp 0xb7c16