// File: /workspace/github_cpp_makefile_star2_O3/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 %rax
callq 0xcdacd
movl $0x64, %edi
movl $0x64, %esi
callq 0xce01d
movl 0x11681e(%rip), %edi    # 0x13d9b8
movl 0x11681c(%rip), %esi    # 0x13d9bc
callq 0xce033
movl $0x92, %edi
callq 0xce052
leaq 0xb30a8(%rip), %rdi     # 0xda25e
callq 0xd3002
movl %eax, 0x11be0f(%rip)    # 0x142fd0
callq 0x869a0
movl $0x809d, %edi           # imm = 0x809D
callq 0x21800
cvtsd2ss 0x11b698(%rip), %xmm0   # 0x142870
cvtsd2ss 0x11b698(%rip), %xmm1   # 0x142878
cvtsd2ss 0x11b698(%rip), %xmm2   # 0x142880
movss 0xb2e14(%rip), %xmm3    # 0xda004
callq 0x21e00
leaq 0x1167c4(%rip), %rsi    # 0x13d9c0
movl $0xb53, %edi            # imm = 0xB53
callq 0x221e0
movl $0xb51, %edi            # imm = 0xB51
movl $0x1, %esi
callq 0x21150
movl $0xb52, %edi            # imm = 0xB52
movl $0x1, %esi
callq 0x21150
leaq 0x1167a5(%rip), %rdx    # 0x13d9d0
movl $0x4000, %edi           # imm = 0x4000
movl $0x1201, %esi           # imm = 0x1201
callq 0x22080
movl $0x4000, %edi           # imm = 0x4000
callq 0x21800
leaq 0x116795(%rip), %rdx    # 0x13d9e0
movl $0x4001, %edi           # imm = 0x4001
movl $0x1201, %esi           # imm = 0x1201
callq 0x22080
movl $0x4001, %edi           # imm = 0x4001
callq 0x21800
movl $0xba1, %edi            # imm = 0xBA1
callq 0x21800
movl $0xb57, %edi            # imm = 0xB57
callq 0x21800
movl $0x408, %edi            # imm = 0x408
movl $0x1602, %esi           # imm = 0x1602
callq 0x21580
movl $0xb71, %edi            # imm = 0xB71
callq 0x21800
movl $0xb44, %edi            # imm = 0xB44
callq 0x21800
leaq -0x15e3(%rip), %rdi     # 0x25cbf
callq 0xcc554
leaq -0x895(%rip), %rdi      # 0x26a19
callq 0xcc5a9
leaq -0x56f(%rip), %rdi      # 0x26d4b
callq 0xcc5eb
leaq -0x5dd(%rip), %rdi      # 0x26ce9
callq 0xcc633
leaq -0x7da(%rip), %rdi      # 0x26af8
callq 0xcc97c
leaq -0x885(%rip), %rdi      # 0x26a59
popq %rax
jmp 0xcca0c