#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*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ GL_QUADS;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glColor3f(int, int, int);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(int, int, int, int, int, int);
int /*<<< orphan*/ glVertex3f(double, double, int);
int /*<<< orphan*/ gluLookAt(int, int, int, int, int, int, int, int, int);
void DrawAQuad() {
  glClearColor(1.0, 1.0, 1.0, 1.0);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(-1., 1., -1., 1., 1., 20.);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  gluLookAt(0., 0., 10., 0., 0., 0., 0., 1., 0.);
  glBegin(GL_QUADS);
  glColor3f(1., 0., 0.);
  glVertex3f(-.75, -.75, 0.);
  glColor3f(0., 1., 0.);
  glVertex3f(.75, -.75, 0.);
  glColor3f(0., 0., 1.);
  glVertex3f(.75, .75, 0.);
  glColor3f(0., 0., 1.);
  glVertex3f(-.75, .75, 0.);
  glEnd();
}


x86 assembly (clang, -O0):
<DrawAQuad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xe60(%rip),%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1090 <glClearColor@plt>
mov    0x2dfb(%rip),%rax
mov    (%rax),%edi
mov    0x2e1a(%rip),%rax
or     (%rax),%edi
call   1040 <glClear@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
mov    $0x0,%al
call   10a0 <glLoadIdentity@plt>
mov    $0xffffffff,%edx
mov    $0x1,%r8d
mov    $0x14,%r9d
mov    %edx,%edi
mov    %r8d,%esi
mov    %r8d,%ecx
call   1070 <glOrtho@plt>
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
mov    $0x0,%al
call   10a0 <glLoadIdentity@plt>
xor    %r9d,%r9d
mov    $0xa,%edx
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x1,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <gluLookAt@plt>
mov    0x2d8c(%rip),%rax
mov    (%rax),%edi
call   10c0 <glBegin@plt>
mov    $0x1,%edi
xor    %edx,%edx
mov    %edx,%esi
call   10b0 <glColor3f@plt>
movsd  0xd8f(%rip),%xmm1
xor    %edi,%edi
movaps %xmm1,%xmm0
call   1060 <glVertex3f@plt>
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   10b0 <glColor3f@plt>
movsd  0xd77(%rip),%xmm0
movsd  0xd67(%rip),%xmm1
xor    %edi,%edi
call   1060 <glVertex3f@plt>
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   10b0 <glColor3f@plt>
movsd  0xd52(%rip),%xmm1
xor    %edi,%edi
movaps %xmm1,%xmm0
call   1060 <glVertex3f@plt>
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   10b0 <glColor3f@plt>
movsd  0xd2a(%rip),%xmm0
movsd  0xd2a(%rip),%xmm1
xor    %edi,%edi
call   1060 <glVertex3f@plt>
mov    $0x0,%al
call   1080 <glEnd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawAQuad>:
push   %rax
movsd  0xe57(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
movaps %xmm0,%xmm3
call   1090 <glClearColor@plt>
mov    0x2e02(%rip),%rax
mov    0x2e23(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1040 <glClear@plt>
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
xor    %eax,%eax
call   10a0 <glLoadIdentity@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
mov    $0x14,%r9d
call   1070 <glOrtho@plt>
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
xor    %eax,%eax
call   10a0 <glLoadIdentity@plt>
sub    $0x8,%rsp
xor    %edi,%edi
xor    %esi,%esi
mov    $0xa,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x1
push   $0x0
call   1030 <gluLookAt@plt>
add    $0x20,%rsp
mov    0x2d98(%rip),%rax
mov    (%rax),%edi
call   10c0 <glBegin@plt>
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10b0 <glColor3f@plt>
movsd  0xda3(%rip),%xmm0
movaps %xmm0,%xmm1
xor    %edi,%edi
call   1060 <glVertex3f@plt>
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   10b0 <glColor3f@plt>
movsd  0xd8b(%rip),%xmm0
movsd  0xd7b(%rip),%xmm1
xor    %edi,%edi
call   1060 <glVertex3f@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   10b0 <glColor3f@plt>
movsd  0xd66(%rip),%xmm0
movaps %xmm0,%xmm1
xor    %edi,%edi
call   1060 <glVertex3f@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   10b0 <glColor3f@plt>
movsd  0xd3e(%rip),%xmm0
movsd  0xd3e(%rip),%xmm1
xor    %edi,%edi
call   1060 <glVertex3f@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <glEnd@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_QUADS = global i32 0
define void @DrawAQuad() {
%1 = call i32 @glClearColor(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%4 = or i32 %2, %3
%5 = call i32 @glClear(i32 %4)
%6 = load i32, i32* @GL_PROJECTION
%7 = call i32 @glMatrixMode(i32 %6)
%8 = call i32 (...) @glLoadIdentity()
%9 = call i32 @glOrtho(i32 -1, i32 1, i32 -1, i32 1, i32 1, i32 20)
%10 = load i32, i32* @GL_MODELVIEW
%11 = call i32 @glMatrixMode(i32 %10)
%12 = call i32 (...) @glLoadIdentity()
%13 = call i32 @gluLookAt(i32 0, i32 0, i32 10, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0)
%14 = load i32, i32* @GL_QUADS
%15 = call i32 @glBegin(i32 %14)
%16 = call i32 @glColor3f(i32 1, i32 0, i32 0)
%17 = call i32 @glVertex3f(double -7.500000e-01, double -7.500000e-01, i32 0)
%18 = call i32 @glColor3f(i32 0, i32 1, i32 0)
%19 = call i32 @glVertex3f(double 7.500000e-01, double -7.500000e-01, i32 0)
%20 = call i32 @glColor3f(i32 0, i32 0, i32 1)
%21 = call i32 @glVertex3f(double 7.500000e-01, double 7.500000e-01, i32 0)
%22 = call i32 @glColor3f(i32 0, i32 0, i32 1)
%23 = call i32 @glVertex3f(double -7.500000e-01, double 7.500000e-01, i32 0)
%24 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_QUADS = global i32 0
define void @DrawAQuad() {
%1 = tail call i32 @glClearColor(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%4 = or i32 %3, %2
%5 = tail call i32 @glClear(i32 %4)
%6 = load i32, i32* @GL_PROJECTION
%7 = tail call i32 @glMatrixMode(i32 %6)
%8 = tail call i32 (...) @glLoadIdentity()
%9 = tail call i32 @glOrtho(i32 -1, i32 1, i32 -1, i32 1, i32 1, i32 20)
%10 = load i32, i32* @GL_MODELVIEW
%11 = tail call i32 @glMatrixMode(i32 %10)
%12 = tail call i32 (...) @glLoadIdentity()
%13 = tail call i32 @gluLookAt(i32 0, i32 0, i32 10, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0)
%14 = load i32, i32* @GL_QUADS
%15 = tail call i32 @glBegin(i32 %14)
%16 = tail call i32 @glColor3f(i32 1, i32 0, i32 0)
%17 = tail call i32 @glVertex3f(double -7.500000e-01, double -7.500000e-01, i32 0)
%18 = tail call i32 @glColor3f(i32 0, i32 1, i32 0)
%19 = tail call i32 @glVertex3f(double 7.500000e-01, double -7.500000e-01, i32 0)
%20 = tail call i32 @glColor3f(i32 0, i32 0, i32 1)
%21 = tail call i32 @glVertex3f(double 7.500000e-01, double 7.500000e-01, i32 0)
%22 = tail call i32 @glColor3f(i32 0, i32 0, i32 1)
%23 = tail call i32 @glVertex3f(double -7.500000e-01, double 7.500000e-01, i32 0)
%24 = tail call i32 (...) @glEnd()
ret void
}