#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_FLAT;
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_POSITION;
int /*<<< orphan*/ GL_SHININESS;
int /*<<< orphan*/ GL_SPECULAR;
int /*<<< orphan*/ glClearAccum(double, double, double, double);
int /*<<< orphan*/ glClearColor(double, double, double, double);
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*/ glMaterialf(int /*<<< orphan*/, int /*<<< orphan*/, double);
int /*<<< orphan*/ glMaterialfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                double *);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void myinit(void) {
  GLfloat mat_ambient[] = {1.0, 1.0, 1.0, 1.0};
  GLfloat mat_specular[] = {1.0, 1.0, 1.0, 1.0};
  GLfloat light_position[] = {0.0, 0.0, 10.0, 1.0};
  GLfloat lm_ambient[] = {0.2, 0.2, 0.2, 1.0};
  glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
  glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
  glMaterialf(GL_FRONT, GL_SHININESS, 50.0);
  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);
  glShadeModel(GL_FLAT);
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glClearAccum(0.0, 0.0, 0.0, 0.0);
}


x86 assembly (clang, -O0):
<myinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0xe6e(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe6b(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe68(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe65(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xe42(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe3f(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe3c(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe39(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe36(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe33(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe30(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe2d(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe2a(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe27(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xe24(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe21(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0x2d7e(%rip),%rax
mov    (%rax),%edi
mov    0x2d95(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   10b0 <glMaterialfv@plt>
mov    0x2d63(%rip),%rax
mov    (%rax),%edi
mov    0x2d6a(%rip),%rax
mov    (%rax),%esi
lea    -0x40(%rbp),%rdx
call   10b0 <glMaterialfv@plt>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
mov    0x2d57(%rip),%rax
mov    (%rax),%esi
movsd  0xd65(%rip),%xmm0
call   1040 <glMaterialf@plt>
mov    0x2d11(%rip),%rax
mov    (%rax),%edi
mov    0x2cf8(%rip),%rax
mov    (%rax),%esi
lea    -0x60(%rbp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d06(%rip),%rax
mov    (%rax),%edi
lea    -0x80(%rbp),%rsi
call   1050 <glLightModelfv@plt>
mov    0x2ccc(%rip),%rax
mov    (%rax),%edi
call   1070 <glEnable@plt>
mov    0x2cd6(%rip),%rax
mov    (%rax),%edi
call   1070 <glEnable@plt>
mov    0x2c98(%rip),%rax
mov    (%rax),%edi
call   1080 <glDepthFunc@plt>
mov    0x2c9a(%rip),%rax
mov    (%rax),%edi
call   1070 <glEnable@plt>
mov    0x2cb4(%rip),%rax
mov    (%rax),%edi
call   10a0 <glShadeModel@plt>
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1090 <glClearColor@plt>
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1060 <glClearAccum@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myinit>:
push   %rbx
sub    $0x80,%rsp
movaps 0xe81(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xe65(%rip),%xmm1
movaps %xmm1,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm1,0x40(%rsp)
movaps 0xe7f(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe63(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe87(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe6b(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2de0(%rip),%rbx
mov    (%rbx),%edi
mov    0x2df7(%rip),%rax
mov    (%rax),%esi
lea    0x60(%rsp),%rdx
call   10b0 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2dd2(%rip),%rax
mov    (%rax),%esi
lea    0x40(%rsp),%rdx
call   10b0 <glMaterialfv@plt>
mov    (%rbx),%edi
mov    0x2dc5(%rip),%rax
mov    (%rax),%esi
movsd  0xdd3(%rip),%xmm0
call   1040 <glMaterialf@plt>
mov    0x2d7f(%rip),%rbx
mov    (%rbx),%edi
mov    0x2d66(%rip),%rax
mov    (%rax),%esi
lea    0x20(%rsp),%rdx
call   1030 <glLightfv@plt>
mov    0x2d73(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1050 <glLightModelfv@plt>
mov    0x2d3a(%rip),%rax
mov    (%rax),%edi
call   1070 <glEnable@plt>
mov    (%rbx),%edi
call   1070 <glEnable@plt>
mov    0x2d0d(%rip),%rax
mov    (%rax),%edi
call   1080 <glDepthFunc@plt>
mov    0x2d0f(%rip),%rax
mov    (%rax),%edi
call   1070 <glEnable@plt>
mov    0x2d29(%rip),%rax
mov    (%rax),%edi
call   10a0 <glShadeModel@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1090 <glClearColor@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1060 <glClearAccum@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.myinit.mat_ambient = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.myinit.mat_specular = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.myinit.light_position = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+01, double 1.000000e+00]
@__const.myinit.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_SPECULAR = global i32 0
@GL_SHININESS = 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_FLAT = global i32 0
define void @myinit() {
%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_FRONT
%10 = load i32, i32* @GL_AMBIENT
%11 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%12 = call i32 @glMaterialfv(i32 %9, i32 %10, double* %11)
%13 = load i32, i32* @GL_FRONT
%14 = load i32, i32* @GL_SPECULAR
%15 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%16 = call i32 @glMaterialfv(i32 %13, i32 %14, double* %15)
%17 = load i32, i32* @GL_FRONT
%18 = load i32, i32* @GL_SHININESS
%19 = call i32 @glMaterialf(i32 %17, i32 %18, double 5.000000e+01)
%20 = load i32, i32* @GL_LIGHT0
%21 = load i32, i32* @GL_POSITION
%22 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%23 = call i32 @glLightfv(i32 %20, i32 %21, double* %22)
%24 = load i32, i32* @GL_LIGHT_MODEL_AMBIENT
%25 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%26 = call i32 @glLightModelfv(i32 %24, double* %25)
%27 = load i32, i32* @GL_LIGHTING
%28 = call i32 @glEnable(i32 %27)
%29 = load i32, i32* @GL_LIGHT0
%30 = call i32 @glEnable(i32 %29)
%31 = load i32, i32* @GL_LESS
%32 = call i32 @glDepthFunc(i32 %31)
%33 = load i32, i32* @GL_DEPTH_TEST
%34 = call i32 @glEnable(i32 %33)
%35 = load i32, i32* @GL_FLAT
%36 = call i32 @glShadeModel(i32 %35)
%37 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%38 = call i32 @glClearAccum(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
@__const.myinit.mat_specular = [4 x double] [double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.myinit.light_position = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+01, double 1.000000e+00]
@__const.myinit.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_SPECULAR = global i32 0
@GL_SHININESS = 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_FLAT = global i32 0
define void @myinit() {
%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_FRONT
%10 = load i32, i32* @GL_AMBIENT
%11 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%12 = call i32 @glMaterialfv(i32 %9, i32 %10, double* %11)
%13 = load i32, i32* @GL_FRONT
%14 = load i32, i32* @GL_SPECULAR
%15 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%16 = call i32 @glMaterialfv(i32 %13, i32 %14, double* %15)
%17 = load i32, i32* @GL_FRONT
%18 = load i32, i32* @GL_SHININESS
%19 = call i32 @glMaterialf(i32 %17, i32 %18, double 5.000000e+01)
%20 = load i32, i32* @GL_LIGHT0
%21 = load i32, i32* @GL_POSITION
%22 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%23 = call i32 @glLightfv(i32 %20, i32 %21, double* %22)
%24 = load i32, i32* @GL_LIGHT_MODEL_AMBIENT
%25 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%26 = call i32 @glLightModelfv(i32 %24, double* %25)
%27 = load i32, i32* @GL_LIGHTING
%28 = call i32 @glEnable(i32 %27)
%29 = load i32, i32* @GL_LIGHT0
%30 = call i32 @glEnable(i32 %29)
%31 = load i32, i32* @GL_LESS
%32 = call i32 @glDepthFunc(i32 %31)
%33 = load i32, i32* @GL_DEPTH_TEST
%34 = call i32 @glEnable(i32 %33)
%35 = load i32, i32* @GL_FLAT
%36 = call i32 @glShadeModel(i32 %35)
%37 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%38 = call i32 @glClearAccum(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}