#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_POLYGON;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glOrtho(double, double, double, double, double, double);
int /*<<< orphan*/ glVertex2f(double, double);
void renderFunction() {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(1.0, 1.0, 1.0);
  glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
  glBegin(GL_POLYGON);
  glVertex2f(-0.5, -0.5);
  glVertex2f(-0.5, 0.5);
  glVertex2f(0.5, 0.5);
  glVertex2f(0.5, -0.5);
  glEnd();
  glFlush();
}


x86 assembly (clang, -O0):
<renderFunction>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1060 <glClearColor@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
movsd  0xe6d(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1070 <glColor3f@plt>
movsd  0xe52(%rip),%xmm4
movsd  0xe52(%rip),%xmm5
movaps %xmm4,%xmm0
movaps %xmm5,%xmm1
movaps %xmm4,%xmm2
movaps %xmm5,%xmm3
call   1040 <glOrtho@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
movsd  0xe1b(%rip),%xmm1
movaps %xmm1,%xmm0
call   1090 <glVertex2f@plt>
movsd  0xe0b(%rip),%xmm0
movsd  0xdfb(%rip),%xmm1
call   1090 <glVertex2f@plt>
movsd  0xdee(%rip),%xmm1
movaps %xmm1,%xmm0
call   1090 <glVertex2f@plt>
movsd  0xdde(%rip),%xmm0
movsd  0xdde(%rip),%xmm1
call   1090 <glVertex2f@plt>
mov    $0x0,%al
call   1050 <glEnd@plt>
mov    $0x0,%al
call   1080 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<renderFunction>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1060 <glClearColor@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
movsd  0xe58(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1070 <glColor3f@plt>
movsd  0xe4d(%rip),%xmm0
movsd  0xe3d(%rip),%xmm1
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
movaps %xmm1,%xmm5
movaps %xmm0,%xmm4
call   1040 <glOrtho@plt>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
movsd  0xe26(%rip),%xmm0
movaps %xmm0,%xmm1
call   1090 <glVertex2f@plt>
movsd  0xe1e(%rip),%xmm1
movsd  0xe0e(%rip),%xmm0
call   1090 <glVertex2f@plt>
movsd  0xe09(%rip),%xmm0
movaps %xmm0,%xmm1
call   1090 <glVertex2f@plt>
movsd  0xdf9(%rip),%xmm0
movsd  0xde9(%rip),%xmm1
call   1090 <glVertex2f@plt>
xor    %eax,%eax
call   1050 <glEnd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_POLYGON = global i32 0
define void @renderFunction() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = call i32 @glClear(i32 %2)
%4 = call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%5 = call i32 @glOrtho(double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
%6 = load i32, i32* @GL_POLYGON
%7 = call i32 @glBegin(i32 %6)
%8 = call i32 @glVertex2f(double -5.000000e-01, double -5.000000e-01)
%9 = call i32 @glVertex2f(double -5.000000e-01, double 5.000000e-01)
%10 = call i32 @glVertex2f(double 5.000000e-01, double 5.000000e-01)
%11 = call i32 @glVertex2f(double 5.000000e-01, double -5.000000e-01)
%12 = call i32 (...) @glEnd()
%13 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_POLYGON = global i32 0
define void @renderFunction() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = tail call i32 @glClear(i32 %2)
%4 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%5 = tail call i32 @glOrtho(double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
%6 = load i32, i32* @GL_POLYGON
%7 = tail call i32 @glBegin(i32 %6)
%8 = tail call i32 @glVertex2f(double -5.000000e-01, double -5.000000e-01)
%9 = tail call i32 @glVertex2f(double -5.000000e-01, double 5.000000e-01)
%10 = tail call i32 @glVertex2f(double 5.000000e-01, double 5.000000e-01)
%11 = tail call i32 @glVertex2f(double 5.000000e-01, double -5.000000e-01)
%12 = tail call i32 (...) @glEnd()
%13 = tail call i32 (...) @glFlush()
ret void
}