#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_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ GL_LIGHT_MODEL_AMBIENT;
int /*<<< orphan*/ GL_POSITION;
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*/ glShadeModel(int /*<<< orphan*/);
void init() {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glShadeModel(GL_SMOOTH);
  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};
  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):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1060 <glClearColor@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
call   1070 <glShadeModel@plt>
mov    0xe82(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe7f(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe7c(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe79(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xe76(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe73(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe70(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe6d(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe6a(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe67(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe64(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe61(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
mov    0x2dbd(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2dbb(%rip),%rax
mov    (%rax),%edi
mov    0x2d92(%rip),%rax
mov    (%rax),%esi
lea    -0x40(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
mov    0x2daf(%rip),%rax
mov    (%rax),%esi
lea    -0x40(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d8d(%rip),%rax
mov    (%rax),%edi
lea    -0x60(%rbp),%rsi
call   1040 <glLightModelfv@plt>
mov    0x2d5b(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2d65(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %r14
push   %rbx
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1060 <glClearColor@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1070 <glShadeModel@plt>
movaps 0xe93(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe77(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe9b(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe7f(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea3(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe87(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2e14(%rip),%r14
mov    (%r14),%edi
mov    0x2dfa(%rip),%rax
mov    (%rax),%esi
lea    0x40(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    (%r14),%edi
mov    0x2dd4(%rip),%rax
mov    (%rax),%esi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdx
call   1030 <glLightfv@plt>
mov    (%r14),%edi
mov    0x2df3(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdx
call   1030 <glLightfv@plt>
mov    0x2dd2(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1040 <glLightModelfv@plt>
mov    0x2da1(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    (%r14),%edi
call   1050 <glEnable@plt>
mov    0x2d73(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@GL_SMOOTH = global i32 0
@__const.init.light_position = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 0.000000e+00]
@__const.init.white_light = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.init.lmodel_ambient = [4 x double] [double 1.000000e-01, double 1.000000e-01, double 1.000000e-01, double 1.000000e+00]
@GL_LIGHT0 = global i32 0
@GL_POSITION = global i32 0
@GL_DIFFUSE = global i32 0
@GL_SPECULAR = global i32 0
@GL_LIGHT_MODEL_AMBIENT = global i32 0
@GL_LIGHTING = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @init() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = alloca [4 x double]
%4 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%5 = load i32, i32* @GL_SMOOTH
%6 = call i32 @glShadeModel(i32 %5)
%7 = bitcast [4 x double]* %1 to i8*
%8 = bitcast [4 x double]* %2 to i8*
%9 = bitcast [4 x double]* %3 to i8*
%10 = load i32, i32* @GL_LIGHT0
%11 = load i32, i32* @GL_POSITION
%12 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%13 = call i32 @glLightfv(i32 %10, i32 %11, double* %12)
%14 = load i32, i32* @GL_LIGHT0
%15 = load i32, i32* @GL_DIFFUSE
%16 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%17 = call i32 @glLightfv(i32 %14, i32 %15, double* %16)
%18 = load i32, i32* @GL_LIGHT0
%19 = load i32, i32* @GL_SPECULAR
%20 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%21 = call i32 @glLightfv(i32 %18, i32 %19, double* %20)
%22 = load i32, i32* @GL_LIGHT_MODEL_AMBIENT
%23 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%24 = call i32 @glLightModelfv(i32 %22, double* %23)
%25 = load i32, i32* @GL_LIGHTING
%26 = call i32 @glEnable(i32 %25)
%27 = load i32, i32* @GL_LIGHT0
%28 = call i32 @glEnable(i32 %27)
%29 = load i32, i32* @GL_DEPTH_TEST
%30 = call i32 @glEnable(i32 %29)
ret void
}

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