#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_LIGHT0;
int /*<<< orphan*/ GL_LIGHT1;
int /*<<< orphan*/ GL_LIGHT2;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ GL_LIGHT_MODEL_TWO_SIDE;
int /*<<< orphan*/ GL_NORMALIZE;
int /*<<< orphan*/ GL_POSITION;
int /*<<< orphan*/ GL_SMOOTH;
int /*<<< orphan*/ GL_TRUE;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glLightModeli(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glLightfv(int /*<<< orphan*/, int /*<<< orphan*/, double *);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void initLighting() {
  GLfloat light_position1[] = {-1.0, 0.0, 0.0, 0.0};
  GLfloat light_position2[] = {1.0, 0.0, 0.0, 0.0};
  GLfloat ambient[] = {0.3, 0.3, 0.3, 1.0};
  glShadeModel(GL_SMOOTH);
  glLightfv(GL_LIGHT1, GL_POSITION, light_position1);
  glLightfv(GL_LIGHT2, GL_POSITION, light_position2);
  glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
  glLightfv(GL_LIGHT2, GL_AMBIENT, ambient);
  glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glEnable(GL_LIGHT1);
  glEnable(GL_LIGHT2);
  glEnable(GL_NORMALIZE);
}


x86 assembly (clang, -O0):
<initLighting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%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    0xea5(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xea2(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe9f(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe9c(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe99(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe96(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe93(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe90(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x2dcd(%rip),%rax
mov    (%rax),%edi
call   1060 <glShadeModel@plt>
mov    0x2db7(%rip),%rax
mov    (%rax),%edi
mov    0x2dd6(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2ddc(%rip),%rax
mov    (%rax),%edi
mov    0x2dbb(%rip),%rax
mov    (%rax),%esi
lea    -0x40(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d81(%rip),%rax
mov    (%rax),%edi
mov    0x2dd0(%rip),%rax
mov    (%rax),%esi
lea    -0x60(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
mov    0x2db5(%rip),%rax
mov    (%rax),%esi
lea    -0x60(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d5b(%rip),%rax
mov    (%rax),%edi
mov    0x2d72(%rip),%rax
mov    (%rax),%esi
call   1050 <glLightModeli@plt>
mov    0x2d4c(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2d6e(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2d18(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2d1c(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initLighting>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
movaps 0xebe(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xea2(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xece(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2e07(%rip),%rax
mov    (%rax),%edi
call   1060 <glShadeModel@plt>
mov    0x2df1(%rip),%r14
mov    (%r14),%edi
mov    0x2e0f(%rip),%rbx
mov    (%rbx),%esi
lea    0x40(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    0x2e14(%rip),%r15
mov    (%r15),%edi
mov    (%rbx),%esi
lea    0x20(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    (%r14),%edi
mov    0x2e13(%rip),%rbx
mov    (%rbx),%esi
mov    %rsp,%r12
mov    %r12,%rdx
call   1030 <glLightfv@plt>
mov    (%r15),%edi
mov    (%rbx),%esi
mov    %r12,%rdx
call   1030 <glLightfv@plt>
mov    0x2daa(%rip),%rax
mov    (%rax),%edi
mov    0x2dc1(%rip),%rax
mov    (%rax),%esi
call   1050 <glLightModeli@plt>
mov    0x2d9b(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2dbd(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    (%r14),%edi
call   1040 <glEnable@plt>
mov    (%r15),%edi
call   1040 <glEnable@plt>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.initLighting.light_position1 = [4 x double] [double -1.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00]
@__const.initLighting.light_position2 = [4 x double] [double 1.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00]
@__const.initLighting.ambient = [4 x double] [double 3.000000e-01, double 3.000000e-01, double 3.000000e-01, double 1.000000e+00]
@GL_SMOOTH = global i32 0
@GL_LIGHT1 = global i32 0
@GL_POSITION = global i32 0
@GL_LIGHT2 = global i32 0
@GL_AMBIENT = global i32 0
@GL_LIGHT_MODEL_TWO_SIDE = global i32 0
@GL_TRUE = global i32 0
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_NORMALIZE = global i32 0
define void @initLighting() {
%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 = load i32, i32* @GL_SMOOTH
%8 = call i32 @glShadeModel(i32 %7)
%9 = load i32, i32* @GL_LIGHT1
%10 = load i32, i32* @GL_POSITION
%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_POSITION
%15 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%16 = call i32 @glLightfv(i32 %13, i32 %14, double* %15)
%17 = load i32, i32* @GL_LIGHT1
%18 = load i32, i32* @GL_AMBIENT
%19 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%20 = call i32 @glLightfv(i32 %17, i32 %18, double* %19)
%21 = load i32, i32* @GL_LIGHT2
%22 = load i32, i32* @GL_AMBIENT
%23 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%24 = call i32 @glLightfv(i32 %21, i32 %22, double* %23)
%25 = load i32, i32* @GL_LIGHT_MODEL_TWO_SIDE
%26 = load i32, i32* @GL_TRUE
%27 = call i32 @glLightModeli(i32 %25, i32 %26)
%28 = load i32, i32* @GL_LIGHTING
%29 = call i32 @glEnable(i32 %28)
%30 = load i32, i32* @GL_LIGHT0
%31 = call i32 @glEnable(i32 %30)
%32 = load i32, i32* @GL_LIGHT1
%33 = call i32 @glEnable(i32 %32)
%34 = load i32, i32* @GL_LIGHT2
%35 = call i32 @glEnable(i32 %34)
%36 = load i32, i32* @GL_NORMALIZE
%37 = call i32 @glEnable(i32 %36)
ret void
}

LLVM IR (-O2):
@__const.initLighting.light_position1 = [4 x double] [double -1.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00]
@__const.initLighting.light_position2 = [4 x double] [double 1.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00]
@__const.initLighting.ambient = [4 x double] [double 3.000000e-01, double 3.000000e-01, double 3.000000e-01, double 1.000000e+00]
@GL_SMOOTH = global i32 0
@GL_LIGHT1 = global i32 0
@GL_POSITION = global i32 0
@GL_LIGHT2 = global i32 0
@GL_AMBIENT = global i32 0
@GL_LIGHT_MODEL_TWO_SIDE = global i32 0
@GL_TRUE = global i32 0
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_NORMALIZE = global i32 0
define void @initLighting() {
%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 = load i32, i32* @GL_SMOOTH
%8 = tail call i32 @glShadeModel(i32 %7)
%9 = load i32, i32* @GL_LIGHT1
%10 = load i32, i32* @GL_POSITION
%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_POSITION
%15 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%16 = call i32 @glLightfv(i32 %13, i32 %14, double* %15)
%17 = load i32, i32* @GL_LIGHT1
%18 = load i32, i32* @GL_AMBIENT
%19 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%20 = call i32 @glLightfv(i32 %17, i32 %18, double* %19)
%21 = load i32, i32* @GL_LIGHT2
%22 = load i32, i32* @GL_AMBIENT
%23 = call i32 @glLightfv(i32 %21, i32 %22, double* %19)
%24 = load i32, i32* @GL_LIGHT_MODEL_TWO_SIDE
%25 = load i32, i32* @GL_TRUE
%26 = call i32 @glLightModeli(i32 %24, i32 %25)
%27 = load i32, i32* @GL_LIGHTING
%28 = call i32 @glEnable(i32 %27)
%29 = load i32, i32* @GL_LIGHT0
%30 = call i32 @glEnable(i32 %29)
%31 = load i32, i32* @GL_LIGHT1
%32 = call i32 @glEnable(i32 %31)
%33 = load i32, i32* @GL_LIGHT2
%34 = call i32 @glEnable(i32 %33)
%35 = load i32, i32* @GL_NORMALIZE
%36 = call i32 @glEnable(i32 %35)
ret void
}