// File: /workspace/github_cpp_makefile_star2_O1/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 0xcf9af
movl $0x64, %edi
movl $0x64, %esi
callq 0xcfefc
movl 0x1187cc(%rip), %edi    # 0x13f9b8
movl 0x1187ca(%rip), %esi    # 0x13f9bc
callq 0xcff12
movl $0x92, %edi
callq 0xcff31
leaq 0xb5056(%rip), %rdi     # 0xdc25e
callq 0xd4efc
movl %eax, 0x11ddbd(%rip)    # 0x144fd0
callq 0x87afc
movl $0x809d, %edi           # imm = 0x809D
callq 0x21800
cvtsd2ss 0x11d646(%rip), %xmm0   # 0x144870
cvtsd2ss 0x11d646(%rip), %xmm1   # 0x144878
cvtsd2ss 0x11d646(%rip), %xmm2   # 0x144880
movss 0xb4dc2(%rip), %xmm3    # 0xdc004
callq 0x21e10
leaq 0x118772(%rip), %rsi    # 0x13f9c0
movl $0xb53, %edi            # imm = 0xB53
callq 0x221f0
movl $0xb51, %edi            # imm = 0xB51
movl $0x1, %esi
callq 0x21150
movl $0xb52, %edi            # imm = 0xB52
movl $0x1, %esi
callq 0x21150
leaq 0x118753(%rip), %rdx    # 0x13f9d0
movl $0x4000, %edi           # imm = 0x4000
movl $0x1201, %esi           # imm = 0x1201
callq 0x22090
movl $0x4000, %edi           # imm = 0x4000
callq 0x21800
leaq 0x118743(%rip), %rdx    # 0x13f9e0
movl $0x4001, %edi           # imm = 0x4001
movl $0x1201, %esi           # imm = 0x1201
callq 0x22090
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 -0x15f5(%rip), %rdi     # 0x25cff
callq 0xce404
leaq -0x892(%rip), %rdi      # 0x26a6e
callq 0xce459
leaq -0x56f(%rip), %rdi      # 0x26d9d
callq 0xce49b
leaq -0x5dd(%rip), %rdi      # 0x26d3b
callq 0xce4e3
leaq -0x7d7(%rip), %rdi      # 0x26b4d
callq 0xce82c
leaq -0x882(%rip), %rdi      # 0x26aae
popq %rax
jmp 0xce8bc