#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 */

/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ fogindex_renderSphere(int, double, double);
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glIndexi(int);
void fogindex_display(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glIndexi(16);
  fogindex_renderSphere(-2., -0.5, -1.0);
  fogindex_renderSphere(-1., -0.5, -2.0);
  fogindex_renderSphere(0., -0.5, -3.0);
  fogindex_renderSphere(1., -0.5, -4.0);
  fogindex_renderSphere(2., -0.5, -5.0);
  glFlush();
}


x86 assembly (clang, -O0):
<fogindex_display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    0x2e94(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x10,%edi
call   1050 <glIndexi@plt>
mov    $0xfffffffe,%edi
movsd  0xe8e(%rip),%xmm0
movsd  0xeae(%rip),%xmm1
call   1060 <fogindex_renderSphere@plt>
mov    $0xffffffff,%edi
movsd  0xe74(%rip),%xmm0
movsd  0xe8c(%rip),%xmm1
call   1060 <fogindex_renderSphere@plt>
xor    %edi,%edi
movsd  0xe5d(%rip),%xmm0
movsd  0xe6d(%rip),%xmm1
call   1060 <fogindex_renderSphere@plt>
mov    $0x1,%edi
movsd  0xe43(%rip),%xmm0
movsd  0xe4b(%rip),%xmm1
call   1060 <fogindex_renderSphere@plt>
mov    $0x2,%edi
movsd  0xe29(%rip),%xmm0
movsd  0xe29(%rip),%xmm1
call   1060 <fogindex_renderSphere@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fogindex_display>:
push   %rax
mov    0x2e90(%rip),%rax
mov    0x2e99(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x10,%edi
call   1050 <glIndexi@plt>
movsd  0xe96(%rip),%xmm0
movsd  0xe96(%rip),%xmm1
mov    $0xfffffffe,%edi
call   1060 <fogindex_renderSphere@plt>
movsd  0xe8c(%rip),%xmm1
mov    $0xffffffff,%edi
movsd  0xe6f(%rip),%xmm0
call   1060 <fogindex_renderSphere@plt>
movsd  0xe7a(%rip),%xmm1
xor    %edi,%edi
movsd  0xe58(%rip),%xmm0
call   1060 <fogindex_renderSphere@plt>
movsd  0xe6b(%rip),%xmm1
mov    $0x1,%edi
movsd  0xe3e(%rip),%xmm0
call   1060 <fogindex_renderSphere@plt>
movsd  0xe59(%rip),%xmm1
mov    $0x2,%edi
movsd  0xe24(%rip),%xmm0
call   1060 <fogindex_renderSphere@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @fogindex_display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 @glIndexi(i32 16)
%6 = call i32 @fogindex_renderSphere(i32 -2, double -5.000000e-01, double -1.000000e+00)
%7 = call i32 @fogindex_renderSphere(i32 -1, double -5.000000e-01, double -2.000000e+00)
%8 = call i32 @fogindex_renderSphere(i32 0, double -5.000000e-01, double -3.000000e+00)
%9 = call i32 @fogindex_renderSphere(i32 1, double -5.000000e-01, double -4.000000e+00)
%10 = call i32 @fogindex_renderSphere(i32 2, double -5.000000e-01, double -5.000000e+00)
%11 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @fogindex_display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 @glIndexi(i32 16)
%6 = tail call i32 @fogindex_renderSphere(i32 -2, double -5.000000e-01, double -1.000000e+00)
%7 = tail call i32 @fogindex_renderSphere(i32 -1, double -5.000000e-01, double -2.000000e+00)
%8 = tail call i32 @fogindex_renderSphere(i32 0, double -5.000000e-01, double -3.000000e+00)
%9 = tail call i32 @fogindex_renderSphere(i32 1, double -5.000000e-01, double -4.000000e+00)
%10 = tail call i32 @fogindex_renderSphere(i32 2, double -5.000000e-01, double -5.000000e+00)
%11 = tail call i32 (...) @glFlush()
ret void
}