#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_DEPTH_TEST;
int /*<<< orphan*/ GL_DIFFUSE;
int /*<<< orphan*/ GL_FRONT;
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ GL_LIGHT_MODEL_AMBIENT;
int /*<<< orphan*/ GL_POSITION;
int /*<<< orphan*/ GL_SHININESS;
int /*<<< orphan*/ GL_SMOOTH;
int /*<<< orphan*/ GL_SPECULAR;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glLightModelfv(int /*<<< orphan*/, double *);
int /*<<< orphan*/ glLightfv(int /*<<< orphan*/, int /*<<< orphan*/, double *);
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                double *);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void light_init(void) {
  GLfloat mat_specular[] = {1.0, 1.0, 1.0, 1.0};
  GLfloat mat_shininess[] = {50.0};
  GLfloat light_position[] = {1.0, 1.0, 1.0, 0.0};
  GLfloat white_light[] = {1.0, 1.0, 1.0, 1.0};
  GLfloat lmodel_ambient[] = {0.1, 0.1, 0.1, 1.0};
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glShadeModel(GL_SMOOTH);
  glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
  glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
  glLightfv(GL_LIGHT0, GL_POSITION, light_position);
  glLightfv(GL_LIGHT0, GL_DIFFUSE, white_light);
  glLightfv(GL_LIGHT0, GL_SPECULAR, white_light);
  glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glEnable(GL_DEPTH_TEST);
}


x86 assembly (clang, -O0):
<light_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0xe8e(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe8b(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe88(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe85(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe77(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe74(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe71(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe6e(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe2b(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe28(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe25(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe22(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe3f(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xe39(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xe33(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe30(%rip),%rax
mov    %rax,-0x78(%rbp)
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1060 <glClearColor@plt>
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
call   1070 <glShadeModel@plt>
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
mov    0x2d8d(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1080 <glMaterialfv@plt>
mov    0x2d6b(%rip),%rax
mov    (%rax),%edi
mov    0x2d7a(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1080 <glMaterialfv@plt>
mov    0x2d40(%rip),%rax
mov    (%rax),%edi
mov    0x2d27(%rip),%rax
mov    (%rax),%esi
lea    -0x50(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d25(%rip),%rax
mov    (%rax),%edi
mov    0x2cfc(%rip),%rax
mov    (%rax),%esi
lea    -0x70(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d0a(%rip),%rax
mov    (%rax),%edi
mov    0x2d21(%rip),%rax
mov    (%rax),%esi
lea    -0x70(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2cf7(%rip),%rax
mov    (%rax),%edi
lea    -0x90(%rbp),%rsi
call   1040 <glLightModelfv@plt>
mov    0x2cc2(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2ccc(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2c8e(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<light_init>:
push   %r15
push   %r14
push   %rbx
sub    $0x90,%rsp
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe9e(%rip),%xmm1
movaps %xmm1,0x70(%rsp)
movabs $0x4049000000000000,%rax
mov    %rax,0x8(%rsp)
movaps 0xe73(%rip),%xmm2
movaps %xmm2,0x60(%rsp)
movaps 0xe57(%rip),%xmm2
movaps %xmm2,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm1,0x30(%rsp)
movaps 0xe91(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe75(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1060 <glClearColor@plt>
mov    0x2db8(%rip),%rax
mov    (%rax),%edi
call   1070 <glShadeModel@plt>
mov    0x2de2(%rip),%rbx
mov    (%rbx),%edi
mov    0x2de9(%rip),%r15
mov    (%r15),%esi
lea    0x70(%rsp),%rdx
call   1080 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2ddb(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1080 <glMaterialfv@plt>
mov    0x2da0(%rip),%r14
mov    (%r14),%edi
mov    0x2d86(%rip),%rax
mov    (%rax),%esi
lea    0x50(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    (%r14),%edi
mov    0x2d60(%rip),%rax
mov    (%rax),%esi
lea    0x30(%rsp),%rbx
mov    %rbx,%rdx
call   1030 <glLightfv@plt>
mov    (%r14),%edi
mov    (%r15),%esi
mov    %rbx,%rdx
call   1030 <glLightfv@plt>
mov    0x2d64(%rip),%rax
mov    (%rax),%edi
lea    0x10(%rsp),%rsi
call   1040 <glLightModelfv@plt>
mov    0x2d31(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    (%r14),%edi
call   1050 <glEnable@plt>
mov    0x2d03(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
add    $0x90,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.light_init.mat_specular = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.light_init.mat_shininess = [1 x double] [double 5.000000e+01]
@__const.light_init.light_position = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 0.000000e+00]
@__const.light_init.white_light = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.light_init.lmodel_ambient = [4 x double] [double 1.000000e-01, double 1.000000e-01, double 1.000000e-01, double 1.000000e+00]
@GL_SMOOTH = global i32 0
@GL_FRONT = global i32 0
@GL_SPECULAR = global i32 0
@GL_SHININESS = global i32 0
@GL_LIGHT0 = global i32 0
@GL_POSITION = global i32 0
@GL_DIFFUSE = global i32 0
@GL_LIGHT_MODEL_AMBIENT = global i32 0
@GL_LIGHTING = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @light_init() {
%1 = alloca [4 x double]
%2 = alloca [1 x double]
%3 = alloca [4 x double]
%4 = alloca [4 x double]
%5 = alloca [4 x double]
%6 = bitcast [4 x double]* %1 to i8*
%7 = bitcast [1 x double]* %2 to i8*
%8 = bitcast [4 x double]* %3 to i8*
%9 = bitcast [4 x double]* %4 to i8*
%10 = bitcast [4 x double]* %5 to i8*
%11 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%12 = load i32, i32* @GL_SMOOTH
%13 = call i32 @glShadeModel(i32 %12)
%14 = load i32, i32* @GL_FRONT
%15 = load i32, i32* @GL_SPECULAR
%16 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%17 = call i32 @glMaterialfv(i32 %14, i32 %15, double* %16)
%18 = load i32, i32* @GL_FRONT
%19 = load i32, i32* @GL_SHININESS
%20 = getelementptr inbounds [1 x double], [1 x double]* %2, i64 0, i64 0
%21 = call i32 @glMaterialfv(i32 %18, i32 %19, double* %20)
%22 = load i32, i32* @GL_LIGHT0
%23 = load i32, i32* @GL_POSITION
%24 = getelementptr inbounds [4 x double], [4 x double]* %3, 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_DIFFUSE
%28 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%29 = call i32 @glLightfv(i32 %26, i32 %27, double* %28)
%30 = load i32, i32* @GL_LIGHT0
%31 = load i32, i32* @GL_SPECULAR
%32 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%33 = call i32 @glLightfv(i32 %30, i32 %31, double* %32)
%34 = load i32, i32* @GL_LIGHT_MODEL_AMBIENT
%35 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%36 = call i32 @glLightModelfv(i32 %34, double* %35)
%37 = load i32, i32* @GL_LIGHTING
%38 = call i32 @glEnable(i32 %37)
%39 = load i32, i32* @GL_LIGHT0
%40 = call i32 @glEnable(i32 %39)
%41 = load i32, i32* @GL_DEPTH_TEST
%42 = call i32 @glEnable(i32 %41)
ret void
}

LLVM IR (-O2):
@__const.light_init.light_position = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 0.000000e+00]
@__const.light_init.white_light = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.light_init.lmodel_ambient = [4 x double] [double 1.000000e-01, double 1.000000e-01, double 1.000000e-01, double 1.000000e+00]
@GL_SMOOTH = global i32 0
@GL_FRONT = global i32 0
@GL_SPECULAR = global i32 0
@GL_SHININESS = global i32 0
@GL_LIGHT0 = global i32 0
@GL_POSITION = global i32 0
@GL_DIFFUSE = global i32 0
@GL_LIGHT_MODEL_AMBIENT = global i32 0
@GL_LIGHTING = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @light_init() {
%1 = alloca [4 x double]
%2 = alloca [1 x double]
%3 = alloca [4 x double]
%4 = alloca [4 x double]
%5 = alloca [4 x double]
%6 = bitcast [4 x double]* %1 to i8*
%7 = bitcast [1 x double]* %2 to i8*
%8 = bitcast [1 x double]* %2 to i64*
store i64 4632233691727265792, i64* %8
%9 = bitcast [4 x double]* %3 to i8*
%10 = bitcast [4 x double]* %4 to i8*
%11 = bitcast [4 x double]* %5 to i8*
%12 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%13 = load i32, i32* @GL_SMOOTH
%14 = tail call i32 @glShadeModel(i32 %13)
%15 = load i32, i32* @GL_FRONT
%16 = load i32, i32* @GL_SPECULAR
%17 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%18 = call i32 @glMaterialfv(i32 %15, i32 %16, double* %17)
%19 = load i32, i32* @GL_FRONT
%20 = load i32, i32* @GL_SHININESS
%21 = getelementptr inbounds [1 x double], [1 x double]* %2, i64 0, i64 0
%22 = call i32 @glMaterialfv(i32 %19, i32 %20, double* %21)
%23 = load i32, i32* @GL_LIGHT0
%24 = load i32, i32* @GL_POSITION
%25 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%26 = call i32 @glLightfv(i32 %23, i32 %24, double* %25)
%27 = load i32, i32* @GL_LIGHT0
%28 = load i32, i32* @GL_DIFFUSE
%29 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%30 = call i32 @glLightfv(i32 %27, i32 %28, double* %29)
%31 = load i32, i32* @GL_LIGHT0
%32 = load i32, i32* @GL_SPECULAR
%33 = call i32 @glLightfv(i32 %31, i32 %32, double* %29)
%34 = load i32, i32* @GL_LIGHT_MODEL_AMBIENT
%35 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%36 = call i32 @glLightModelfv(i32 %34, double* %35)
%37 = load i32, i32* @GL_LIGHTING
%38 = call i32 @glEnable(i32 %37)
%39 = load i32, i32* @GL_LIGHT0
%40 = call i32 @glEnable(i32 %39)
%41 = load i32, i32* @GL_DEPTH_TEST
%42 = call i32 @glEnable(i32 %41)
ret void
}