#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_DEPTH_TEST;
int /*<<< orphan*/ GL_FRONT;
int /*<<< orphan*/ GL_LESS;
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ GL_LIGHT_MODEL_AMBIENT;
int /*<<< orphan*/ GL_NORMALIZE;
int /*<<< orphan*/ GL_POSITION;
int /*<<< orphan*/ GL_SMOOTH;
int /*<<< orphan*/ StoreTheGuy_SL();
int /*<<< orphan*/ StoreTheGuy_SL2();
int /*<<< orphan*/ glDepthFunc(int /*<<< orphan*/);
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 GuyGLInit(void) {
  GLfloat mat_ambient[] = {1.0, 1.0, 1.0, 1.0};
  GLfloat light_position[] = {0.3, 0.5, 0.8, 0.0};
  GLfloat lm_ambient[] = {0.2, 0.2, 0.2, 1.0};
  glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
  glLightfv(GL_LIGHT0, GL_POSITION, light_position);
  glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lm_ambient);
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glDepthFunc(GL_LESS);
  glEnable(GL_DEPTH_TEST);
  glEnable(GL_NORMALIZE);
  glShadeModel(GL_SMOOTH);
  StoreTheGuy_SL();
  StoreTheGuy_SL2();
}


x86 assembly (clang, -O0):
<GuyGLInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0xe71(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe6e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe6b(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe68(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xe65(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe62(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe5f(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe5c(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe59(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe56(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe53(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe50(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x2dcd(%rip),%rax
mov    (%rax),%edi
mov    0x2dd4(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   10a0 <glMaterialfv@plt>
mov    0x2da2(%rip),%rax
mov    (%rax),%edi
mov    0x2d89(%rip),%rax
mov    (%rax),%esi
lea    -0x40(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d8f(%rip),%rax
mov    (%rax),%edi
lea    -0x60(%rbp),%rsi
call   1050 <glLightModelfv@plt>
mov    0x2d55(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2d67(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2d19(%rip),%rax
mov    (%rax),%edi
call   1070 <glDepthFunc@plt>
mov    0x2d1b(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2d25(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2d07(%rip),%rax
mov    (%rax),%edi
call   1080 <glShadeModel@plt>
mov    $0x0,%al
call   1040 <StoreTheGuy_SL@plt>
mov    $0x0,%al
call   1090 <StoreTheGuy_SL2@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GuyGLInit>:
push   %rbx
sub    $0x60,%rsp
movaps 0xe84(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe68(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe8c(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe70(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe94(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe78(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
mov    0x2e14(%rip),%rax
mov    (%rax),%esi
lea    0x40(%rsp),%rdx
call   10a0 <glMaterialfv@plt>
mov    0x2de1(%rip),%rbx
mov    (%rbx),%edi
mov    0x2dc8(%rip),%rax
mov    (%rax),%esi
lea    0x20(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    0x2dcd(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1050 <glLightModelfv@plt>
mov    0x2d94(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    (%rbx),%edi
call   1060 <glEnable@plt>
mov    0x2d5f(%rip),%rax
mov    (%rax),%edi
call   1070 <glDepthFunc@plt>
mov    0x2d61(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2d6b(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2d4d(%rip),%rax
mov    (%rax),%edi
call   1080 <glShadeModel@plt>
xor    %eax,%eax
call   1040 <StoreTheGuy_SL@plt>
xor    %eax,%eax
call   1090 <StoreTheGuy_SL2@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.GuyGLInit.mat_ambient = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.GuyGLInit.light_position = [4 x double] [double 3.000000e-01, double 5.000000e-01, double 8.000000e-01, double 0.000000e+00]
@__const.GuyGLInit.lm_ambient = [4 x double] [double 2.000000e-01, double 2.000000e-01, double 2.000000e-01, double 1.000000e+00]
@GL_FRONT = global i32 0
@GL_AMBIENT = global i32 0
@GL_LIGHT0 = global i32 0
@GL_POSITION = global i32 0
@GL_LIGHT_MODEL_AMBIENT = global i32 0
@GL_LIGHTING = global i32 0
@GL_LESS = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_NORMALIZE = global i32 0
@GL_SMOOTH = global i32 0
define void @GuyGLInit() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %1 to i8*
%5 = bitcast [4 x double]* %2 to i8*
%6 = bitcast [4 x double]* %3 to i8*
%7 = load i32, i32* @GL_FRONT
%8 = load i32, i32* @GL_AMBIENT
%9 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%10 = call i32 @glMaterialfv(i32 %7, i32 %8, double* %9)
%11 = load i32, i32* @GL_LIGHT0
%12 = load i32, i32* @GL_POSITION
%13 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%14 = call i32 @glLightfv(i32 %11, i32 %12, double* %13)
%15 = load i32, i32* @GL_LIGHT_MODEL_AMBIENT
%16 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%17 = call i32 @glLightModelfv(i32 %15, double* %16)
%18 = load i32, i32* @GL_LIGHTING
%19 = call i32 @glEnable(i32 %18)
%20 = load i32, i32* @GL_LIGHT0
%21 = call i32 @glEnable(i32 %20)
%22 = load i32, i32* @GL_LESS
%23 = call i32 @glDepthFunc(i32 %22)
%24 = load i32, i32* @GL_DEPTH_TEST
%25 = call i32 @glEnable(i32 %24)
%26 = load i32, i32* @GL_NORMALIZE
%27 = call i32 @glEnable(i32 %26)
%28 = load i32, i32* @GL_SMOOTH
%29 = call i32 @glShadeModel(i32 %28)
%30 = call i32 (...) @StoreTheGuy_SL()
%31 = call i32 (...) @StoreTheGuy_SL2()
ret void
}

LLVM IR (-O2):
@__const.GuyGLInit.mat_ambient = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.GuyGLInit.light_position = [4 x double] [double 3.000000e-01, double 5.000000e-01, double 8.000000e-01, double 0.000000e+00]
@__const.GuyGLInit.lm_ambient = [4 x double] [double 2.000000e-01, double 2.000000e-01, double 2.000000e-01, double 1.000000e+00]
@GL_FRONT = global i32 0
@GL_AMBIENT = global i32 0
@GL_LIGHT0 = global i32 0
@GL_POSITION = global i32 0
@GL_LIGHT_MODEL_AMBIENT = global i32 0
@GL_LIGHTING = global i32 0
@GL_LESS = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_NORMALIZE = global i32 0
@GL_SMOOTH = global i32 0
define void @GuyGLInit() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %1 to i8*
%5 = bitcast [4 x double]* %2 to i8*
%6 = bitcast [4 x double]* %3 to i8*
%7 = load i32, i32* @GL_FRONT
%8 = load i32, i32* @GL_AMBIENT
%9 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%10 = call i32 @glMaterialfv(i32 %7, i32 %8, double* %9)
%11 = load i32, i32* @GL_LIGHT0
%12 = load i32, i32* @GL_POSITION
%13 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%14 = call i32 @glLightfv(i32 %11, i32 %12, double* %13)
%15 = load i32, i32* @GL_LIGHT_MODEL_AMBIENT
%16 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%17 = call i32 @glLightModelfv(i32 %15, double* %16)
%18 = load i32, i32* @GL_LIGHTING
%19 = call i32 @glEnable(i32 %18)
%20 = load i32, i32* @GL_LIGHT0
%21 = call i32 @glEnable(i32 %20)
%22 = load i32, i32* @GL_LESS
%23 = call i32 @glDepthFunc(i32 %22)
%24 = load i32, i32* @GL_DEPTH_TEST
%25 = call i32 @glEnable(i32 %24)
%26 = load i32, i32* @GL_NORMALIZE
%27 = call i32 @glEnable(i32 %26)
%28 = load i32, i32* @GL_SMOOTH
%29 = call i32 @glShadeModel(i32 %28)
%30 = call i32 (...) @StoreTheGuy_SL()
%31 = call i32 (...) @StoreTheGuy_SL2()
ret void
}