#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_DIFFUSE;
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ GL_LIGHT_MODEL_AMBIENT;
int /*<<< orphan*/ GL_LIGHT_MODEL_TWO_SIDE;
int /*<<< orphan*/ GL_POSITION;
double GL_TRUE;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glLightModelfv(int /*<<< orphan*/, double *);
int /*<<< orphan*/ glLightfv(int /*<<< orphan*/, int /*<<< orphan*/, double *);
void setLighting(void) {
  GLfloat ambient[] = {1.0, 1.0, 1.0, 1.0};
  GLfloat diffuse0[] = {1.0, 1.0, 1.0, 1.0};
  GLfloat position0[] = {0.0, 22.0, 50.0, 0.0};
  GLfloat lmodel_ambient[] = {0.0, 0.0, 0.0, 1.0};
  GLfloat lmodel_twoside[] = {GL_TRUE};
  glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
  glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
  glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
  glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse0);
  glLightfv(GL_LIGHT0, GL_POSITION, position0);
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
}


x86 assembly (clang, -O0):
<setLighting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0xebe(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xe92(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe8f(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe8c(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe89(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe86(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe83(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe80(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe7d(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe7a(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe77(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xe74(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe71(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0x2dd6(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    0x2ddb(%rip),%rax
mov    (%rax),%edi
lea    -0x80(%rbp),%rsi
call   1040 <glLightModelfv@plt>
mov    0x2d99(%rip),%rax
mov    (%rax),%edi
lea    -0x88(%rbp),%rsi
call   1040 <glLightModelfv@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
mov    0x2dbb(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
mov    0x2d58(%rip),%rax
mov    (%rax),%esi
lea    -0x40(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d76(%rip),%rax
mov    (%rax),%edi
mov    0x2d55(%rip),%rax
mov    (%rax),%esi
lea    -0x60(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d3b(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2d4d(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setLighting>:
push   %rbx
sub    $0x90,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xeb2(%rip),%xmm1
movaps %xmm1,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm1,0x50(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    0x2e34(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
lea    0x10(%rsp),%rsi
call   1040 <glLightModelfv@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1040 <glLightModelfv@plt>
mov    0x2e0d(%rip),%rbx
mov    (%rbx),%edi
mov    0x2e1c(%rip),%rax
mov    (%rax),%esi
lea    0x70(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    (%rbx),%edi
mov    0x2dbf(%rip),%rax
mov    (%rax),%esi
lea    0x50(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    (%rbx),%edi
mov    0x2dc2(%rip),%rax
mov    (%rax),%esi
lea    0x30(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    0x2da7(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    (%rbx),%edi
call   1050 <glEnable@plt>
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.setLighting.ambient = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.setLighting.diffuse0 = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.setLighting.position0 = [4 x double] [double 0.000000e+00, double 2.200000e+01, double 5.000000e+01, double 0.000000e+00]
@__const.setLighting.lmodel_ambient = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@GL_TRUE = global double 0.000000e+00
@GL_LIGHT_MODEL_AMBIENT = global i32 0
@GL_LIGHT_MODEL_TWO_SIDE = global i32 0
@GL_LIGHT0 = global i32 0
@GL_AMBIENT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_POSITION = global i32 0
@GL_LIGHTING = global i32 0
define void @setLighting() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = alloca [4 x double]
%4 = alloca [4 x double]
%5 = alloca [1 x double]
%6 = bitcast [4 x double]* %1 to i8*
%7 = bitcast [4 x double]* %2 to i8*
%8 = bitcast [4 x double]* %3 to i8*
%9 = bitcast [4 x double]* %4 to i8*
%10 = getelementptr inbounds [1 x double], [1 x double]* %5, i64 0, i64 0
%11 = load double, double* @GL_TRUE
store double %11, double* %10
%12 = load i32, i32* @GL_LIGHT_MODEL_AMBIENT
%13 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%14 = call i32 @glLightModelfv(i32 %12, double* %13)
%15 = load i32, i32* @GL_LIGHT_MODEL_TWO_SIDE
%16 = getelementptr inbounds [1 x double], [1 x double]* %5, i64 0, i64 0
%17 = call i32 @glLightModelfv(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_LIGHT0
%23 = load i32, i32* @GL_DIFFUSE
%24 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%25 = call i32 @glLightfv(i32 %22, i32 %23, double* %24)
%26 = load i32, i32* @GL_LIGHT0
%27 = load i32, i32* @GL_POSITION
%28 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%29 = call i32 @glLightfv(i32 %26, i32 %27, double* %28)
%30 = load i32, i32* @GL_LIGHTING
%31 = call i32 @glEnable(i32 %30)
%32 = load i32, i32* @GL_LIGHT0
%33 = call i32 @glEnable(i32 %32)
ret void
}

LLVM IR (-O2):
@__const.setLighting.diffuse0 = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.setLighting.position0 = [4 x double] [double 0.000000e+00, double 2.200000e+01, double 5.000000e+01, double 0.000000e+00]
@__const.setLighting.lmodel_ambient = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@GL_TRUE = global double 0.000000e+00
@GL_LIGHT_MODEL_AMBIENT = global i32 0
@GL_LIGHT_MODEL_TWO_SIDE = global i32 0
@GL_LIGHT0 = global i32 0
@GL_AMBIENT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_POSITION = global i32 0
@GL_LIGHTING = global i32 0
define void @setLighting() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = alloca [4 x double]
%4 = alloca [4 x double]
%5 = alloca [1 x double]
%6 = bitcast [4 x double]* %1 to i8*
%7 = bitcast [4 x double]* %2 to i8*
%8 = bitcast [4 x double]* %3 to i8*
%9 = bitcast [4 x double]* %4 to i8*
%10 = bitcast [1 x double]* %5 to i8*
%11 = getelementptr inbounds [1 x double], [1 x double]* %5, i64 0, i64 0
%12 = load double, double* @GL_TRUE
store double %12, double* %11
%13 = load i32, i32* @GL_LIGHT_MODEL_AMBIENT
%14 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%15 = call i32 @glLightModelfv(i32 %13, double* %14)
%16 = load i32, i32* @GL_LIGHT_MODEL_TWO_SIDE
%17 = call i32 @glLightModelfv(i32 %16, double* %11)
%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_LIGHT0
%23 = load i32, i32* @GL_DIFFUSE
%24 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%25 = call i32 @glLightfv(i32 %22, i32 %23, double* %24)
%26 = load i32, i32* @GL_LIGHT0
%27 = load i32, i32* @GL_POSITION
%28 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%29 = call i32 @glLightfv(i32 %26, i32 %27, double* %28)
%30 = load i32, i32* @GL_LIGHTING
%31 = call i32 @glEnable(i32 %30)
%32 = load i32, i32* @GL_LIGHT0
%33 = call i32 @glEnable(i32 %32)
ret void
}