#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_FRONT;
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ GL_POSITION;
int /*<<< orphan*/ GL_SHININESS;
int /*<<< orphan*/ GL_SPECULAR;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glLightfv(int /*<<< orphan*/, int /*<<< orphan*/, double *);
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                double *);
void initlights(void) {
  GLfloat ambient[] = {0.2, 0.2, 0.2, 1.0};
  GLfloat position[] = {0.0, 0.0, 2.0, 1.0};
  GLfloat mat_diffuse[] = {0.6, 0.6, 0.6, 1.0};
  GLfloat mat_specular[] = {1.0, 1.0, 1.0, 1.0};
  GLfloat mat_shininess[] = {50.0};
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
  glLightfv(GL_LIGHT0, GL_POSITION, position);
  glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
  glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
  glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
}


x86 assembly (clang, -O0):
<initlights>:
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    0xeb2(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeaf(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeac(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea9(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea6(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xea3(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xea0(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe9d(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe9a(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe97(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xe94(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe91(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe8e(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0x2db0(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2dba(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
mov    0x2dcb(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
mov    0x2d78(%rip),%rax
mov    (%rax),%esi
lea    -0x40(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d7e(%rip),%rax
mov    (%rax),%edi
mov    0x2d4d(%rip),%rax
mov    (%rax),%esi
lea    -0x60(%rbp),%rdx
call   1050 <glMaterialfv@plt>
mov    0x2d63(%rip),%rax
mov    (%rax),%edi
mov    0x2d6a(%rip),%rax
mov    (%rax),%esi
lea    -0x80(%rbp),%rdx
call   1050 <glMaterialfv@plt>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
mov    0x2d57(%rip),%rax
mov    (%rax),%esi
lea    -0x88(%rbp),%rdx
call   1050 <glMaterialfv@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initlights>:
push   %rbx
sub    $0x90,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xec2(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x4049000000000000,%rax
mov    %rax,0x8(%rsp)
mov    0x2dff(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2e09(%rip),%rbx
mov    (%rbx),%edi
call   1040 <glEnable@plt>
mov    (%rbx),%edi
mov    0x2e21(%rip),%rax
mov    (%rax),%esi
lea    0x70(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    (%rbx),%edi
mov    0x2dd4(%rip),%rax
mov    (%rax),%esi
lea    0x50(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    0x2dd9(%rip),%rbx
mov    (%rbx),%edi
mov    0x2da8(%rip),%rax
mov    (%rax),%esi
lea    0x30(%rsp),%rdx
call   1050 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2dcb(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%rdx
call   1050 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2dbe(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1050 <glMaterialfv@plt>
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.initlights.ambient = [4 x double] [double 2.000000e-01, double 2.000000e-01, double 2.000000e-01, double 1.000000e+00]
@__const.initlights.position = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 2.000000e+00, double 1.000000e+00]
@__const.initlights.mat_diffuse = [4 x double] [double 6.000000e-01, double 6.000000e-01, double 6.000000e-01, double 1.000000e+00]
@__const.initlights.mat_specular = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.initlights.mat_shininess = [1 x double] [double 5.000000e+01]
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_AMBIENT = global i32 0
@GL_POSITION = global i32 0
@GL_FRONT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_SPECULAR = global i32 0
@GL_SHININESS = global i32 0
define void @initlights() {
%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 = load i32, i32* @GL_LIGHTING
%12 = call i32 @glEnable(i32 %11)
%13 = load i32, i32* @GL_LIGHT0
%14 = call i32 @glEnable(i32 %13)
%15 = load i32, i32* @GL_LIGHT0
%16 = load i32, i32* @GL_AMBIENT
%17 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%18 = call i32 @glLightfv(i32 %15, i32 %16, double* %17)
%19 = load i32, i32* @GL_LIGHT0
%20 = load i32, i32* @GL_POSITION
%21 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%22 = call i32 @glLightfv(i32 %19, i32 %20, double* %21)
%23 = load i32, i32* @GL_FRONT
%24 = load i32, i32* @GL_DIFFUSE
%25 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%26 = call i32 @glMaterialfv(i32 %23, i32 %24, double* %25)
%27 = load i32, i32* @GL_FRONT
%28 = load i32, i32* @GL_SPECULAR
%29 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%30 = call i32 @glMaterialfv(i32 %27, i32 %28, double* %29)
%31 = load i32, i32* @GL_FRONT
%32 = load i32, i32* @GL_SHININESS
%33 = getelementptr inbounds [1 x double], [1 x double]* %5, i64 0, i64 0
%34 = call i32 @glMaterialfv(i32 %31, i32 %32, double* %33)
ret void
}

LLVM IR (-O2):
@__const.initlights.ambient = [4 x double] [double 2.000000e-01, double 2.000000e-01, double 2.000000e-01, double 1.000000e+00]
@__const.initlights.position = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 2.000000e+00, double 1.000000e+00]
@__const.initlights.mat_diffuse = [4 x double] [double 6.000000e-01, double 6.000000e-01, double 6.000000e-01, double 1.000000e+00]
@__const.initlights.mat_specular = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_AMBIENT = global i32 0
@GL_POSITION = global i32 0
@GL_FRONT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_SPECULAR = global i32 0
@GL_SHININESS = global i32 0
define void @initlights() {
%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 = bitcast [1 x double]* %5 to i64*
store i64 4632233691727265792, i64* %11
%12 = load i32, i32* @GL_LIGHTING
%13 = tail call i32 @glEnable(i32 %12)
%14 = load i32, i32* @GL_LIGHT0
%15 = tail call i32 @glEnable(i32 %14)
%16 = load i32, i32* @GL_LIGHT0
%17 = load i32, i32* @GL_AMBIENT
%18 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%19 = call i32 @glLightfv(i32 %16, i32 %17, double* %18)
%20 = load i32, i32* @GL_LIGHT0
%21 = load i32, i32* @GL_POSITION
%22 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%23 = call i32 @glLightfv(i32 %20, i32 %21, double* %22)
%24 = load i32, i32* @GL_FRONT
%25 = load i32, i32* @GL_DIFFUSE
%26 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%27 = call i32 @glMaterialfv(i32 %24, i32 %25, double* %26)
%28 = load i32, i32* @GL_FRONT
%29 = load i32, i32* @GL_SPECULAR
%30 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%31 = call i32 @glMaterialfv(i32 %28, i32 %29, double* %30)
%32 = load i32, i32* @GL_FRONT
%33 = load i32, i32* @GL_SHININESS
%34 = getelementptr inbounds [1 x double], [1 x double]* %5, i64 0, i64 0
%35 = call i32 @glMaterialfv(i32 %32, i32 %33, double* %34)
ret void
}