#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef double GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_AMBIENT;
int /*<<< orphan*/ GL_AMBIENT_AND_DIFFUSE;
int /*<<< orphan*/ GL_COLOR_MATERIAL;
int /*<<< orphan*/ GL_CULL_FACE;
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ GL_FRONT_AND_BACK;
int /*<<< orphan*/ GL_LEQUAL;
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ GL_LIGHT_MODEL_LOCAL_VIEWER;
int /*<<< orphan*/ GL_LIGHT_MODEL_TWO_SIDE;
int /*<<< orphan*/ GL_SPECULAR;
int /*<<< orphan*/ glClearColor(double, double, int, int);
int /*<<< orphan*/ glDepthFunc(int /*<<< orphan*/);
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glLightModeli(int /*<<< orphan*/, int);
int /*<<< orphan*/ glLightfv(int /*<<< orphan*/, int /*<<< orphan*/, double *);
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                double *);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void InitOpenGL(void) {
  GLfloat light_ambient[] = {0.4, 0.4, 0.4, 0.0};
  GLfloat red[] = {1.0, 0.0, 0.0, 1.0};
  GLfloat mat_no_specular[] = {0.0, 0.0, 0.0, 1.0};
  glClearColor(0.7, 0.7, 1, 1);
  glEnable(GL_COLOR_MATERIAL);
  glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, red);
  glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_no_specular);
  glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1);
  glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
  glDepthFunc(GL_LEQUAL);
  glEnable(GL_DEPTH_TEST);
  glDisable(GL_CULL_FACE);
  glShadeModel(GL_FLAT);
}


x86 assembly (clang, -O0):
<InitOpenGL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0xe81(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe7e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe7b(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe78(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xe75(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe72(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe6f(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe6c(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe69(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe66(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe63(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe60(%rip),%rax
mov    %rax,-0x48(%rbp)
movsd  0xdec(%rip),%xmm1
mov    $0x1,%esi
movaps %xmm1,%xmm0
mov    %esi,%edi
call   1060 <glClearColor@plt>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
mov    0x2d67(%rip),%rax
mov    (%rax),%esi
lea    -0x40(%rbp),%rdx
call   10a0 <glMaterialfv@plt>
mov    0x2d85(%rip),%rax
mov    (%rax),%edi
mov    0x2d8c(%rip),%rax
mov    (%rax),%esi
lea    -0x60(%rbp),%rdx
call   10a0 <glMaterialfv@plt>
mov    0x2d5a(%rip),%rax
mov    (%rax),%edi
mov    0x2d79(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d0f(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2d31(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2ceb(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1070 <glLightModeli@plt>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1070 <glLightModeli@plt>
mov    0x2cd5(%rip),%rax
mov    (%rax),%edi
call   1050 <glDepthFunc@plt>
mov    0x2ca7(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2ca1(%rip),%rax
mov    (%rax),%edi
call   1090 <glDisable@plt>
mov    0x2cdb(%rip),%rax
mov    (%rax),%edi
call   1080 <glShadeModel@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitOpenGL>:
push   %rbx
sub    $0x60,%rsp
movaps 0xe94(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe78(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe80(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe88(%rip),%xmm0
movaps %xmm0,(%rsp)
movsd  0xe2c(%rip),%xmm0
movaps %xmm0,%xmm1
mov    $0x1,%edi
mov    $0x1,%esi
call   1060 <glClearColor@plt>
mov    0x2dd3(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2ddd(%rip),%rbx
mov    (%rbx),%edi
mov    0x2da4(%rip),%rax
mov    (%rax),%esi
lea    0x20(%rsp),%rdx
call   10a0 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2dcf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   10a0 <glMaterialfv@plt>
mov    0x2d9e(%rip),%rbx
mov    (%rbx),%edi
mov    0x2dbd(%rip),%rax
mov    (%rax),%esi
lea    0x40(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d52(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    (%rbx),%edi
call   1040 <glEnable@plt>
mov    0x2d35(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1070 <glLightModeli@plt>
mov    0x2d42(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1070 <glLightModeli@plt>
mov    0x2d1f(%rip),%rax
mov    (%rax),%edi
call   1050 <glDepthFunc@plt>
mov    0x2cf1(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2ceb(%rip),%rax
mov    (%rax),%edi
call   1090 <glDisable@plt>
mov    0x2d25(%rip),%rax
mov    (%rax),%edi
call   1080 <glShadeModel@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.InitOpenGL.light_ambient = [4 x double] [double 4.000000e-01, double 4.000000e-01, double 4.000000e-01, double 0.000000e+00]
@__const.InitOpenGL.red = [4 x double] [double 1.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@__const.InitOpenGL.mat_no_specular = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@GL_COLOR_MATERIAL = global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_AMBIENT_AND_DIFFUSE = global i32 0
@GL_SPECULAR = global i32 0
@GL_LIGHT0 = global i32 0
@GL_AMBIENT = global i32 0
@GL_LIGHTING = global i32 0
@GL_LIGHT_MODEL_TWO_SIDE = global i32 0
@GL_LIGHT_MODEL_LOCAL_VIEWER = global i32 0
@GL_LEQUAL = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_CULL_FACE = global i32 0
@GL_FLAT = global i32 0
define void @InitOpenGL() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %1 to i8*
%5 = bitcast [4 x double]* %2 to i8*
%6 = bitcast [4 x double]* %3 to i8*
%7 = call i32 @glClearColor(double 0x3FE6666666666666, double 0x3FE6666666666666, i32 1, i32 1)
%8 = load i32, i32* @GL_COLOR_MATERIAL
%9 = call i32 @glEnable(i32 %8)
%10 = load i32, i32* @GL_FRONT_AND_BACK
%11 = load i32, i32* @GL_AMBIENT_AND_DIFFUSE
%12 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%13 = call i32 @glMaterialfv(i32 %10, i32 %11, double* %12)
%14 = load i32, i32* @GL_FRONT_AND_BACK
%15 = load i32, i32* @GL_SPECULAR
%16 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%17 = call i32 @glMaterialfv(i32 %14, i32 %15, double* %16)
%18 = load i32, i32* @GL_LIGHT0
%19 = load i32, i32* @GL_AMBIENT
%20 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%21 = call i32 @glLightfv(i32 %18, i32 %19, double* %20)
%22 = load i32, i32* @GL_LIGHTING
%23 = call i32 @glEnable(i32 %22)
%24 = load i32, i32* @GL_LIGHT0
%25 = call i32 @glEnable(i32 %24)
%26 = load i32, i32* @GL_LIGHT_MODEL_TWO_SIDE
%27 = call i32 @glLightModeli(i32 %26, i32 1)
%28 = load i32, i32* @GL_LIGHT_MODEL_LOCAL_VIEWER
%29 = call i32 @glLightModeli(i32 %28, i32 1)
%30 = load i32, i32* @GL_LEQUAL
%31 = call i32 @glDepthFunc(i32 %30)
%32 = load i32, i32* @GL_DEPTH_TEST
%33 = call i32 @glEnable(i32 %32)
%34 = load i32, i32* @GL_CULL_FACE
%35 = call i32 @glDisable(i32 %34)
%36 = load i32, i32* @GL_FLAT
%37 = call i32 @glShadeModel(i32 %36)
ret void
}

LLVM IR (-O2):
@__const.InitOpenGL.light_ambient = [4 x double] [double 4.000000e-01, double 4.000000e-01, double 4.000000e-01, double 0.000000e+00]
@__const.InitOpenGL.red = [4 x double] [double 1.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@__const.InitOpenGL.mat_no_specular = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@GL_COLOR_MATERIAL = global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_AMBIENT_AND_DIFFUSE = global i32 0
@GL_SPECULAR = global i32 0
@GL_LIGHT0 = global i32 0
@GL_AMBIENT = global i32 0
@GL_LIGHTING = global i32 0
@GL_LIGHT_MODEL_TWO_SIDE = global i32 0
@GL_LIGHT_MODEL_LOCAL_VIEWER = global i32 0
@GL_LEQUAL = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_CULL_FACE = global i32 0
@GL_FLAT = global i32 0
define void @InitOpenGL() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %1 to i8*
%5 = bitcast [4 x double]* %2 to i8*
%6 = bitcast [4 x double]* %3 to i8*
%7 = tail call i32 @glClearColor(double 0x3FE6666666666666, double 0x3FE6666666666666, i32 1, i32 1)
%8 = load i32, i32* @GL_COLOR_MATERIAL
%9 = tail call i32 @glEnable(i32 %8)
%10 = load i32, i32* @GL_FRONT_AND_BACK
%11 = load i32, i32* @GL_AMBIENT_AND_DIFFUSE
%12 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%13 = call i32 @glMaterialfv(i32 %10, i32 %11, double* %12)
%14 = load i32, i32* @GL_FRONT_AND_BACK
%15 = load i32, i32* @GL_SPECULAR
%16 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%17 = call i32 @glMaterialfv(i32 %14, i32 %15, double* %16)
%18 = load i32, i32* @GL_LIGHT0
%19 = load i32, i32* @GL_AMBIENT
%20 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%21 = call i32 @glLightfv(i32 %18, i32 %19, double* %20)
%22 = load i32, i32* @GL_LIGHTING
%23 = call i32 @glEnable(i32 %22)
%24 = load i32, i32* @GL_LIGHT0
%25 = call i32 @glEnable(i32 %24)
%26 = load i32, i32* @GL_LIGHT_MODEL_TWO_SIDE
%27 = call i32 @glLightModeli(i32 %26, i32 1)
%28 = load i32, i32* @GL_LIGHT_MODEL_LOCAL_VIEWER
%29 = call i32 @glLightModeli(i32 %28, i32 1)
%30 = load i32, i32* @GL_LEQUAL
%31 = call i32 @glDepthFunc(i32 %30)
%32 = load i32, i32* @GL_DEPTH_TEST
%33 = call i32 @glEnable(i32 %32)
%34 = load i32, i32* @GL_CULL_FACE
%35 = call i32 @glDisable(i32 %34)
%36 = load i32, i32* @GL_FLAT
%37 = call i32 @glShadeModel(i32 %36)
ret void
}