#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 /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
int /*<<< orphan*/ gluOrtho2D(double, double, double, double);
void init_test01(void) {
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(-0.5, 639.5, -0.5, 479.5);
  glMatrixMode(GL_MODELVIEW);
  glShadeModel(GL_FLAT);
  glDisable(GL_DEPTH_TEST);
  glClearColor(0.0, 0.1, 1.0, 0.0);
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(1.0, 0.0, 0.0);
}


x86 assembly (clang, -O0):
<init_test01>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
call   1040 <glMatrixMode@plt>
mov    $0x0,%al
call   1060 <glLoadIdentity@plt>
movsd  0xe6f(%rip),%xmm2
movsd  0xe6f(%rip),%xmm1
movsd  0xe6f(%rip),%xmm3
movaps %xmm2,%xmm0
call   1080 <gluOrtho2D@plt>
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
call   1040 <glMatrixMode@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
call   1090 <glShadeModel@plt>
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
call   10a0 <glDisable@plt>
xorps  %xmm3,%xmm3
movsd  0xe1a(%rip),%xmm1
movsd  0xe0a(%rip),%xmm2
movaps %xmm3,%xmm0
call   1050 <glClearColor@plt>
mov    0x2dc3(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
movsd  0xdec(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1070 <glColor3f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_test01>:
push   %rax
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
call   1040 <glMatrixMode@plt>
xor    %eax,%eax
call   1060 <glLoadIdentity@plt>
movsd  0xe62(%rip),%xmm1
movsd  0xe62(%rip),%xmm0
movsd  0xe62(%rip),%xmm3
movaps %xmm0,%xmm2
call   1080 <gluOrtho2D@plt>
mov    0x2e23(%rip),%rax
mov    (%rax),%edi
call   1040 <glMatrixMode@plt>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
call   1090 <glShadeModel@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%edi
call   10a0 <glDisable@plt>
movsd  0xe30(%rip),%xmm1
movsd  0xe30(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm3,%xmm3
call   1050 <glClearColor@plt>
mov    0x2dc6(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xe09(%rip),%xmm0
pop    %rax
jmp    1070 <glColor3f@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_FLAT = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_COLOR_BUFFER_BIT = global i32 0
define void @init_test01() {
%1 = load i32, i32* @GL_PROJECTION
%2 = call i32 @glMatrixMode(i32 %1)
%3 = call i32 (...) @glLoadIdentity()
%4 = call i32 @gluOrtho2D(double -5.000000e-01, double 6.395000e+02, double -5.000000e-01, double 4.795000e+02)
%5 = load i32, i32* @GL_MODELVIEW
%6 = call i32 @glMatrixMode(i32 %5)
%7 = load i32, i32* @GL_FLAT
%8 = call i32 @glShadeModel(i32 %7)
%9 = load i32, i32* @GL_DEPTH_TEST
%10 = call i32 @glDisable(i32 %9)
%11 = call i32 @glClearColor(double 0.000000e+00, double 1.000000e-01, double 1.000000e+00, double 0.000000e+00)
%12 = load i32, i32* @GL_COLOR_BUFFER_BIT
%13 = call i32 @glClear(i32 %12)
%14 = call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_FLAT = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_COLOR_BUFFER_BIT = global i32 0
define void @init_test01() {
%1 = load i32, i32* @GL_PROJECTION
%2 = tail call i32 @glMatrixMode(i32 %1)
%3 = tail call i32 (...) @glLoadIdentity()
%4 = tail call i32 @gluOrtho2D(double -5.000000e-01, double 6.395000e+02, double -5.000000e-01, double 4.795000e+02)
%5 = load i32, i32* @GL_MODELVIEW
%6 = tail call i32 @glMatrixMode(i32 %5)
%7 = load i32, i32* @GL_FLAT
%8 = tail call i32 @glShadeModel(i32 %7)
%9 = load i32, i32* @GL_DEPTH_TEST
%10 = tail call i32 @glDisable(i32 %9)
%11 = tail call i32 @glClearColor(double 0.000000e+00, double 1.000000e-01, double 1.000000e+00, double 0.000000e+00)
%12 = load i32, i32* @GL_COLOR_BUFFER_BIT
%13 = tail call i32 @glClear(i32 %12)
%14 = tail call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}