#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_COLOR_MATERIAL;
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_DIFFUSE;
int /*<<< orphan*/ GL_FRONT_AND_BACK;
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHT1;
int /*<<< orphan*/ GL_LIGHT2;
int /*<<< orphan*/ GL_LIGHT3;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ GL_LIGHT_MODEL_LOCAL_VIEWER;
int /*<<< orphan*/ GL_NORMALIZE;
int /*<<< orphan*/ glColorMaterial(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glLightModeli(int /*<<< orphan*/, int);
int /*<<< orphan*/ glLightfv(int /*<<< orphan*/, int /*<<< orphan*/, double *);
void initGraphicsState(void) {
  GLfloat lightColor[4] = {0.6, 0.6, 0.6, 1.0};
  glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
  glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor);
  glLightfv(GL_LIGHT1, GL_DIFFUSE, lightColor);
  glLightfv(GL_LIGHT2, GL_DIFFUSE, lightColor);
  glLightfv(GL_LIGHT3, GL_DIFFUSE, lightColor);
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glEnable(GL_LIGHT1);
  glEnable(GL_LIGHT2);
  glEnable(GL_LIGHT3);
  glEnable(GL_DEPTH_TEST);
  glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
  glEnable(GL_COLOR_MATERIAL);
  glEnable(GL_NORMALIZE);
}


x86 assembly (clang, -O0):
<initGraphicsState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xeb1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1060 <glLightModeli@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
mov    0x2e11(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2def(%rip),%rax
mov    (%rax),%edi
mov    0x2df6(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
mov    0x2ddb(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
mov    0x2dc0(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2db6(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2dd8(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2d82(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2d5e(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2d60(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2d9a(%rip),%rax
mov    (%rax),%edi
mov    0x2d51(%rip),%rax
mov    (%rax),%esi
call   1040 <glColorMaterial@plt>
mov    0x2d6b(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2d4d(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initGraphicsState>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe9f(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1060 <glLightModeli@plt>
mov    0x2e61(%rip),%r15
mov    (%r15),%edi
mov    0x2e1f(%rip),%r14
mov    (%r14),%esi
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1030 <glLightfv@plt>
mov    0x2dfa(%rip),%r12
mov    (%r12),%edi
mov    (%r14),%esi
mov    %rbx,%rdx
call   1030 <glLightfv@plt>
mov    0x2e24(%rip),%r13
mov    0x0(%r13),%edi
mov    (%r14),%esi
mov    %rbx,%rdx
call   1030 <glLightfv@plt>
mov    0x2dc6(%rip),%rbp
mov    0x0(%rbp),%edi
mov    (%r14),%esi
mov    %rbx,%rdx
call   1030 <glLightfv@plt>
mov    0x2dd1(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    (%r15),%edi
call   1050 <glEnable@plt>
mov    (%r12),%edi
call   1050 <glEnable@plt>
mov    0x0(%r13),%edi
call   1050 <glEnable@plt>
mov    0x0(%rbp),%edi
call   1050 <glEnable@plt>
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%esi
call   1040 <glColorMaterial@plt>
mov    0x2da2(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2d84(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.initGraphicsState.lightColor = [4 x double] [double 6.000000e-01, double 6.000000e-01, double 6.000000e-01, double 1.000000e+00]
@GL_LIGHT_MODEL_LOCAL_VIEWER = global i32 0
@GL_LIGHT0 = global i32 0
@GL_DIFFUSE = global i32 0
@GL_LIGHT1 = global i32 0
@GL_LIGHT2 = global i32 0
@GL_LIGHT3 = global i32 0
@GL_LIGHTING = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_COLOR_MATERIAL = global i32 0
@GL_NORMALIZE = global i32 0
define void @initGraphicsState() {
%1 = alloca [4 x double]
%2 = bitcast [4 x double]* %1 to i8*
%3 = load i32, i32* @GL_LIGHT_MODEL_LOCAL_VIEWER
%4 = call i32 @glLightModeli(i32 %3, i32 1)
%5 = load i32, i32* @GL_LIGHT0
%6 = load i32, i32* @GL_DIFFUSE
%7 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%8 = call i32 @glLightfv(i32 %5, i32 %6, double* %7)
%9 = load i32, i32* @GL_LIGHT1
%10 = load i32, i32* @GL_DIFFUSE
%11 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%12 = call i32 @glLightfv(i32 %9, i32 %10, double* %11)
%13 = load i32, i32* @GL_LIGHT2
%14 = load i32, i32* @GL_DIFFUSE
%15 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%16 = call i32 @glLightfv(i32 %13, i32 %14, double* %15)
%17 = load i32, i32* @GL_LIGHT3
%18 = load i32, i32* @GL_DIFFUSE
%19 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%20 = call i32 @glLightfv(i32 %17, i32 %18, double* %19)
%21 = load i32, i32* @GL_LIGHTING
%22 = call i32 @glEnable(i32 %21)
%23 = load i32, i32* @GL_LIGHT0
%24 = call i32 @glEnable(i32 %23)
%25 = load i32, i32* @GL_LIGHT1
%26 = call i32 @glEnable(i32 %25)
%27 = load i32, i32* @GL_LIGHT2
%28 = call i32 @glEnable(i32 %27)
%29 = load i32, i32* @GL_LIGHT3
%30 = call i32 @glEnable(i32 %29)
%31 = load i32, i32* @GL_DEPTH_TEST
%32 = call i32 @glEnable(i32 %31)
%33 = load i32, i32* @GL_FRONT_AND_BACK
%34 = load i32, i32* @GL_DIFFUSE
%35 = call i32 @glColorMaterial(i32 %33, i32 %34)
%36 = load i32, i32* @GL_COLOR_MATERIAL
%37 = call i32 @glEnable(i32 %36)
%38 = load i32, i32* @GL_NORMALIZE
%39 = call i32 @glEnable(i32 %38)
ret void
}

LLVM IR (-O2):
@__const.initGraphicsState.lightColor = [4 x double] [double 6.000000e-01, double 6.000000e-01, double 6.000000e-01, double 1.000000e+00]
@GL_LIGHT_MODEL_LOCAL_VIEWER = global i32 0
@GL_LIGHT0 = global i32 0
@GL_DIFFUSE = global i32 0
@GL_LIGHT1 = global i32 0
@GL_LIGHT2 = global i32 0
@GL_LIGHT3 = global i32 0
@GL_LIGHTING = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_COLOR_MATERIAL = global i32 0
@GL_NORMALIZE = global i32 0
define void @initGraphicsState() {
%1 = alloca [4 x double]
%2 = bitcast [4 x double]* %1 to i8*
%3 = load i32, i32* @GL_LIGHT_MODEL_LOCAL_VIEWER
%4 = tail call i32 @glLightModeli(i32 %3, i32 1)
%5 = load i32, i32* @GL_LIGHT0
%6 = load i32, i32* @GL_DIFFUSE
%7 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%8 = call i32 @glLightfv(i32 %5, i32 %6, double* %7)
%9 = load i32, i32* @GL_LIGHT1
%10 = load i32, i32* @GL_DIFFUSE
%11 = call i32 @glLightfv(i32 %9, i32 %10, double* %7)
%12 = load i32, i32* @GL_LIGHT2
%13 = load i32, i32* @GL_DIFFUSE
%14 = call i32 @glLightfv(i32 %12, i32 %13, double* %7)
%15 = load i32, i32* @GL_LIGHT3
%16 = load i32, i32* @GL_DIFFUSE
%17 = call i32 @glLightfv(i32 %15, i32 %16, double* %7)
%18 = load i32, i32* @GL_LIGHTING
%19 = call i32 @glEnable(i32 %18)
%20 = load i32, i32* @GL_LIGHT0
%21 = call i32 @glEnable(i32 %20)
%22 = load i32, i32* @GL_LIGHT1
%23 = call i32 @glEnable(i32 %22)
%24 = load i32, i32* @GL_LIGHT2
%25 = call i32 @glEnable(i32 %24)
%26 = load i32, i32* @GL_LIGHT3
%27 = call i32 @glEnable(i32 %26)
%28 = load i32, i32* @GL_DEPTH_TEST
%29 = call i32 @glEnable(i32 %28)
%30 = load i32, i32* @GL_FRONT_AND_BACK
%31 = load i32, i32* @GL_DIFFUSE
%32 = call i32 @glColorMaterial(i32 %30, i32 %31)
%33 = load i32, i32* @GL_COLOR_MATERIAL
%34 = call i32 @glEnable(i32 %33)
%35 = load i32, i32* @GL_NORMALIZE
%36 = call i32 @glEnable(i32 %35)
ret void
}