#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_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_POSITION;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glLightfv(int /*<<< orphan*/, int /*<<< orphan*/, double *);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glTranslatef(int, int, double);
int /*<<< orphan*/ gluPerspective(int, int, double, int);
void init(void) {
  GLfloat pos[4] = {0.0, 0.0, 1.0, 1.0};
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(50., 1., .1, 10.);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  glTranslatef(0., 0., -3.5);
  glLightfv(GL_LIGHT0, GL_POSITION, pos);
  glEnable(GL_LIGHT0);
  glEnable(GL_LIGHTING);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xea1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe9e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe9b(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe98(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
call   1040 <glMatrixMode@plt>
mov    $0x0,%al
call   1070 <glLoadIdentity@plt>
mov    $0x32,%edi
mov    $0x1,%esi
movsd  0xe4d(%rip),%xmm0
mov    $0xa,%edx
call   1060 <gluPerspective@plt>
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
call   1040 <glMatrixMode@plt>
mov    $0x0,%al
call   1070 <glLoadIdentity@plt>
xor    %esi,%esi
movsd  0xe1c(%rip),%xmm0
mov    %esi,%edi
call   1080 <glTranslatef@plt>
mov    0x2df6(%rip),%rax
mov    (%rax),%edi
mov    0x2dd5(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2ddb(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbx
sub    $0x20,%rsp
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe98(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
call   1040 <glMatrixMode@plt>
xor    %eax,%eax
call   1070 <glLoadIdentity@plt>
movsd  0xe67(%rip),%xmm0
mov    $0x32,%edi
mov    $0x1,%esi
mov    $0xa,%edx
call   1060 <gluPerspective@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
call   1040 <glMatrixMode@plt>
xor    %eax,%eax
call   1070 <glLoadIdentity@plt>
movsd  0xe3e(%rip),%xmm0
xor    %edi,%edi
xor    %esi,%esi
call   1080 <glTranslatef@plt>
mov    0x2e0e(%rip),%rbx
mov    (%rbx),%edi
mov    0x2ded(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <glLightfv@plt>
mov    (%rbx),%edi
call   1050 <glEnable@plt>
mov    0x2dc5(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.init.pos = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+00, double 1.000000e+00]
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_LIGHT0 = global i32 0
@GL_POSITION = global i32 0
@GL_LIGHTING = global i32 0
define void @init() {
%1 = alloca [4 x double]
%2 = bitcast [4 x double]* %1 to i8*
%3 = load i32, i32* @GL_PROJECTION
%4 = call i32 @glMatrixMode(i32 %3)
%5 = call i32 (...) @glLoadIdentity()
%6 = call i32 @gluPerspective(i32 50, i32 1, double 1.000000e-01, i32 10)
%7 = load i32, i32* @GL_MODELVIEW
%8 = call i32 @glMatrixMode(i32 %7)
%9 = call i32 (...) @glLoadIdentity()
%10 = call i32 @glTranslatef(i32 0, i32 0, double -3.500000e+00)
%11 = load i32, i32* @GL_LIGHT0
%12 = load i32, i32* @GL_POSITION
%13 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%14 = call i32 @glLightfv(i32 %11, i32 %12, double* %13)
%15 = load i32, i32* @GL_LIGHT0
%16 = call i32 @glEnable(i32 %15)
%17 = load i32, i32* @GL_LIGHTING
%18 = call i32 @glEnable(i32 %17)
ret void
}

LLVM IR (-O2):
@__const.init.pos = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+00, double 1.000000e+00]
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_LIGHT0 = global i32 0
@GL_POSITION = global i32 0
@GL_LIGHTING = global i32 0
define void @init() {
%1 = alloca [4 x double]
%2 = bitcast [4 x double]* %1 to i8*
%3 = load i32, i32* @GL_PROJECTION
%4 = tail call i32 @glMatrixMode(i32 %3)
%5 = tail call i32 (...) @glLoadIdentity()
%6 = tail call i32 @gluPerspective(i32 50, i32 1, double 1.000000e-01, i32 10)
%7 = load i32, i32* @GL_MODELVIEW
%8 = tail call i32 @glMatrixMode(i32 %7)
%9 = tail call i32 (...) @glLoadIdentity()
%10 = tail call i32 @glTranslatef(i32 0, i32 0, double -3.500000e+00)
%11 = load i32, i32* @GL_LIGHT0
%12 = load i32, i32* @GL_POSITION
%13 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%14 = call i32 @glLightfv(i32 %11, i32 %12, double* %13)
%15 = load i32, i32* @GL_LIGHT0
%16 = call i32 @glEnable(i32 %15)
%17 = load i32, i32* @GL_LIGHTING
%18 = call i32 @glEnable(i32 %17)
ret void
}