#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_FLAT;
int /*<<< orphan*/ GL_FOG_COLOR;
int /*<<< orphan*/ GL_FOG_END;
int /*<<< orphan*/ GL_FOG_HINT;
int /*<<< orphan*/ GL_FOG_MODE;
int /*<<< orphan*/ GL_FOG_START;
int /*<<< orphan*/ GL_LESS;
int /*<<< orphan*/ GL_LINEAR;
int /*<<< orphan*/ GL_NICEST;
int /*<<< orphan*/ afEyeNearFar(double, double);
int /*<<< orphan*/ afFogColor(double, double, double);
int /*<<< orphan*/ afFogMode(int /*<<< orphan*/);
int /*<<< orphan*/ afFogStartEnd(double, double);
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glDepthFunc(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glFogf(int /*<<< orphan*/, double);
int /*<<< orphan*/ glFogfv(int /*<<< orphan*/, double *);
int /*<<< orphan*/ glFogi(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glHint(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void myinit(void) {
  GLfloat fogColor[4] = {0.0, 0.0, 0.0, 1.0};
  glFogi(GL_FOG_MODE, GL_LINEAR);
  glHint(GL_FOG_HINT, GL_NICEST);
  glFogf(GL_FOG_START, 3.0);
  glFogf(GL_FOG_END, 5.0);
  glFogfv(GL_FOG_COLOR, fogColor);
  glClearColor(0.0, 0.0, 0.0, 1.0);
  glDepthFunc(GL_LESS);
  glEnable(GL_DEPTH_TEST);
  glShadeModel(GL_FLAT);
  afEyeNearFar(3.0, 5.0);
  afFogStartEnd(3.0, 5.0);
  afFogMode(GL_LINEAR);
  afFogColor(0.0, 0.0, 0.0);
}


x86 assembly (clang, -O0):
<myinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xe51(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe4e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe4b(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe48(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2db5(%rip),%rax
mov    (%rax),%edi
mov    0x2dd4(%rip),%rax
mov    (%rax),%esi
call   10c0 <glFogi@plt>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
mov    0x2d8d(%rip),%rax
mov    (%rax),%esi
call   10b0 <glHint@plt>
mov    0x2db7(%rip),%rax
mov    (%rax),%edi
movsd  0xdcd(%rip),%xmm0
call   1040 <glFogf@plt>
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
movsd  0xdbf(%rip),%xmm0
call   1040 <glFogf@plt>
mov    0x2d73(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1030 <glFogfv@plt>
xorps  %xmm2,%xmm2
movsd  0xda5(%rip),%xmm3
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1080 <glClearColor@plt>
mov    0x2d13(%rip),%rax
mov    (%rax),%edi
call   1070 <glDepthFunc@plt>
mov    0x2d15(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2d37(%rip),%rax
mov    (%rax),%edi
call   10e0 <glShadeModel@plt>
movsd  0xd58(%rip),%xmm0
movsd  0xd58(%rip),%xmm1
call   1090 <afEyeNearFar@plt>
movsd  0xd43(%rip),%xmm0
movsd  0xd43(%rip),%xmm1
call   10d0 <afFogStartEnd@plt>
mov    0x2d07(%rip),%rax
mov    (%rax),%edi
call   1050 <afFogMode@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   10a0 <afFogColor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myinit>:
push   %rbx
sub    $0x20,%rsp
movaps 0xe64(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe48(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2dcd(%rip),%rax
mov    (%rax),%edi
mov    0x2dec(%rip),%rbx
mov    (%rbx),%esi
call   10c0 <glFogi@plt>
mov    0x2dbe(%rip),%rax
mov    (%rax),%edi
mov    0x2da5(%rip),%rax
mov    (%rax),%esi
call   10b0 <glHint@plt>
mov    0x2dcf(%rip),%rax
mov    (%rax),%edi
movsd  0xde5(%rip),%xmm0
call   1040 <glFogf@plt>
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
movsd  0xdd7(%rip),%xmm0
call   1040 <glFogf@plt>
mov    0x2d8b(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <glFogfv@plt>
movsd  0xdc1(%rip),%xmm3
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1080 <glClearColor@plt>
mov    0x2d2c(%rip),%rax
mov    (%rax),%edi
call   1070 <glDepthFunc@plt>
mov    0x2d2e(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2d50(%rip),%rax
mov    (%rax),%edi
call   10e0 <glShadeModel@plt>
movsd  0xd71(%rip),%xmm0
movsd  0xd71(%rip),%xmm1
call   1090 <afEyeNearFar@plt>
movsd  0xd5c(%rip),%xmm0
movsd  0xd5c(%rip),%xmm1
call   10d0 <afFogStartEnd@plt>
mov    (%rbx),%edi
call   1050 <afFogMode@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   10a0 <afFogColor@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.myinit.fogColor = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@GL_FOG_MODE = global i32 0
@GL_LINEAR = global i32 0
@GL_FOG_HINT = global i32 0
@GL_NICEST = global i32 0
@GL_FOG_START = global i32 0
@GL_FOG_END = global i32 0
@GL_FOG_COLOR = 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 = bitcast [4 x double]* %1 to i8*
%3 = load i32, i32* @GL_FOG_MODE
%4 = load i32, i32* @GL_LINEAR
%5 = call i32 @glFogi(i32 %3, i32 %4)
%6 = load i32, i32* @GL_FOG_HINT
%7 = load i32, i32* @GL_NICEST
%8 = call i32 @glHint(i32 %6, i32 %7)
%9 = load i32, i32* @GL_FOG_START
%10 = call i32 @glFogf(i32 %9, double 3.000000e+00)
%11 = load i32, i32* @GL_FOG_END
%12 = call i32 @glFogf(i32 %11, double 5.000000e+00)
%13 = load i32, i32* @GL_FOG_COLOR
%14 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%15 = call i32 @glFogfv(i32 %13, double* %14)
%16 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%17 = load i32, i32* @GL_LESS
%18 = call i32 @glDepthFunc(i32 %17)
%19 = load i32, i32* @GL_DEPTH_TEST
%20 = call i32 @glEnable(i32 %19)
%21 = load i32, i32* @GL_FLAT
%22 = call i32 @glShadeModel(i32 %21)
%23 = call i32 @afEyeNearFar(double 3.000000e+00, double 5.000000e+00)
%24 = call i32 @afFogStartEnd(double 3.000000e+00, double 5.000000e+00)
%25 = load i32, i32* @GL_LINEAR
%26 = call i32 @afFogMode(i32 %25)
%27 = call i32 @afFogColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
@__const.myinit.fogColor = [4 x double] [double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@GL_FOG_MODE = global i32 0
@GL_LINEAR = global i32 0
@GL_FOG_HINT = global i32 0
@GL_NICEST = global i32 0
@GL_FOG_START = global i32 0
@GL_FOG_END = global i32 0
@GL_FOG_COLOR = 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 = bitcast [4 x double]* %1 to i8*
%3 = load i32, i32* @GL_FOG_MODE
%4 = load i32, i32* @GL_LINEAR
%5 = tail call i32 @glFogi(i32 %3, i32 %4)
%6 = load i32, i32* @GL_FOG_HINT
%7 = load i32, i32* @GL_NICEST
%8 = tail call i32 @glHint(i32 %6, i32 %7)
%9 = load i32, i32* @GL_FOG_START
%10 = tail call i32 @glFogf(i32 %9, double 3.000000e+00)
%11 = load i32, i32* @GL_FOG_END
%12 = tail call i32 @glFogf(i32 %11, double 5.000000e+00)
%13 = load i32, i32* @GL_FOG_COLOR
%14 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%15 = call i32 @glFogfv(i32 %13, double* %14)
%16 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%17 = load i32, i32* @GL_LESS
%18 = call i32 @glDepthFunc(i32 %17)
%19 = load i32, i32* @GL_DEPTH_TEST
%20 = call i32 @glEnable(i32 %19)
%21 = load i32, i32* @GL_FLAT
%22 = call i32 @glShadeModel(i32 %21)
%23 = call i32 @afEyeNearFar(double 3.000000e+00, double 5.000000e+00)
%24 = call i32 @afFogStartEnd(double 3.000000e+00, double 5.000000e+00)
%25 = load i32, i32* @GL_LINEAR
%26 = call i32 @afFogMode(i32 %25)
%27 = call i32 @afFogColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}