#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_SPECULAR;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glLightModelfv(int /*<<< orphan*/, double *);
int /*<<< orphan*/ glLightfv(int /*<<< orphan*/, int /*<<< orphan*/, double *);
void init_light() {
  GLfloat light_ambient[] = {0.1, 0.1, 0.1, 1};
  GLfloat light_diffuse[] = {0.7, 0.7, 0.7, 1};
  GLfloat light_specular[] = {0.9, 0.9, 0.9, 1};
  GLfloat model_ambient[] = {0.4, 0.4, 0.4, 1};
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
  glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
  glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
  glLightModelfv(GL_LIGHT_MODEL_AMBIENT, model_ambient);
}


x86 assembly (clang, -O0):
<init_light>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%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    0x2dce(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
mov    0x2dd9(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2da7(%rip),%rax
mov    (%rax),%edi
mov    0x2d86(%rip),%rax
mov    (%rax),%esi
lea    -0x40(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d8c(%rip),%rax
mov    (%rax),%edi
mov    0x2d9b(%rip),%rax
mov    (%rax),%esi
lea    -0x60(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d79(%rip),%rax
mov    (%rax),%edi
lea    -0x80(%rbp),%rsi
call   1040 <glLightModelfv@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_light>:
push   %rbx
sub    $0x80,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2e24(%rip),%rbx
mov    (%rbx),%edi
call   1050 <glEnable@plt>
mov    (%rbx),%edi
mov    0x2e34(%rip),%rax
mov    (%rax),%esi
lea    0x60(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    (%rbx),%edi
mov    0x2de7(%rip),%rax
mov    (%rax),%esi
lea    0x40(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    (%rbx),%edi
mov    0x2e02(%rip),%rax
mov    (%rax),%esi
lea    0x20(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1040 <glLightModelfv@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.init_light.light_ambient = [4 x double] [double 1.000000e-01, double 1.000000e-01, double 1.000000e-01, double 1.000000e+00]
@__const.init_light.light_diffuse = [4 x double] [double 0x3FE6666666666666, double 0x3FE6666666666666, double 0x3FE6666666666666, double 1.000000e+00]
@__const.init_light.light_specular = [4 x double] [double 9.000000e-01, double 9.000000e-01, double 9.000000e-01, double 1.000000e+00]
@__const.init_light.model_ambient = [4 x double] [double 4.000000e-01, double 4.000000e-01, double 4.000000e-01, double 1.000000e+00]
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_AMBIENT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_SPECULAR = global i32 0
@GL_LIGHT_MODEL_AMBIENT = global i32 0
define void @init_light() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = alloca [4 x double]
%4 = alloca [4 x double]
%5 = bitcast [4 x double]* %1 to i8*
%6 = bitcast [4 x double]* %2 to i8*
%7 = bitcast [4 x double]* %3 to i8*
%8 = bitcast [4 x double]* %4 to i8*
%9 = load i32, i32* @GL_LIGHTING
%10 = call i32 @glEnable(i32 %9)
%11 = load i32, i32* @GL_LIGHT0
%12 = call i32 @glEnable(i32 %11)
%13 = load i32, i32* @GL_LIGHT0
%14 = load i32, i32* @GL_AMBIENT
%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_LIGHT0
%18 = load i32, i32* @GL_DIFFUSE
%19 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%20 = call i32 @glLightfv(i32 %17, i32 %18, double* %19)
%21 = load i32, i32* @GL_LIGHT0
%22 = load i32, i32* @GL_SPECULAR
%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_AMBIENT
%26 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%27 = call i32 @glLightModelfv(i32 %25, double* %26)
ret void
}

LLVM IR (-O2):
@__const.init_light.light_ambient = [4 x double] [double 1.000000e-01, double 1.000000e-01, double 1.000000e-01, double 1.000000e+00]
@__const.init_light.light_diffuse = [4 x double] [double 0x3FE6666666666666, double 0x3FE6666666666666, double 0x3FE6666666666666, double 1.000000e+00]
@__const.init_light.light_specular = [4 x double] [double 9.000000e-01, double 9.000000e-01, double 9.000000e-01, double 1.000000e+00]
@__const.init_light.model_ambient = [4 x double] [double 4.000000e-01, double 4.000000e-01, double 4.000000e-01, double 1.000000e+00]
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_AMBIENT = global i32 0
@GL_DIFFUSE = global i32 0
@GL_SPECULAR = global i32 0
@GL_LIGHT_MODEL_AMBIENT = global i32 0
define void @init_light() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = alloca [4 x double]
%4 = alloca [4 x double]
%5 = bitcast [4 x double]* %1 to i8*
%6 = bitcast [4 x double]* %2 to i8*
%7 = bitcast [4 x double]* %3 to i8*
%8 = bitcast [4 x double]* %4 to i8*
%9 = load i32, i32* @GL_LIGHTING
%10 = tail call i32 @glEnable(i32 %9)
%11 = load i32, i32* @GL_LIGHT0
%12 = tail call i32 @glEnable(i32 %11)
%13 = load i32, i32* @GL_LIGHT0
%14 = load i32, i32* @GL_AMBIENT
%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_LIGHT0
%18 = load i32, i32* @GL_DIFFUSE
%19 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%20 = call i32 @glLightfv(i32 %17, i32 %18, double* %19)
%21 = load i32, i32* @GL_LIGHT0
%22 = load i32, i32* @GL_SPECULAR
%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_AMBIENT
%26 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%27 = call i32 @glLightModelfv(i32 %25, double* %26)
ret void
}