#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*/ glEnd();
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glVertex2f(double, double);
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  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):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1070 <glBegin@plt>
movsd  0xe90(%rip),%xmm1
movaps %xmm1,%xmm0
call   1060 <glVertex2f@plt>
movsd  0xe80(%rip),%xmm0
movsd  0xe70(%rip),%xmm1
call   1060 <glVertex2f@plt>
movsd  0xe63(%rip),%xmm1
movaps %xmm1,%xmm0
call   1060 <glVertex2f@plt>
movsd  0xe53(%rip),%xmm0
movsd  0xe53(%rip),%xmm1
call   1060 <glVertex2f@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
mov    $0x0,%al
call   1050 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1070 <glBegin@plt>
movsd  0xe8b(%rip),%xmm0
movaps %xmm0,%xmm1
call   1060 <glVertex2f@plt>
movsd  0xe83(%rip),%xmm1
movsd  0xe73(%rip),%xmm0
call   1060 <glVertex2f@plt>
movsd  0xe6e(%rip),%xmm0
movaps %xmm0,%xmm1
call   1060 <glVertex2f@plt>
movsd  0xe5e(%rip),%xmm0
movsd  0xe4e(%rip),%xmm1
call   1060 <glVertex2f@plt>
xor    %eax,%eax
call   1040 <glEnd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_POLYGON = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = load i32, i32* @GL_POLYGON
%4 = call i32 @glBegin(i32 %3)
%5 = call i32 @glVertex2f(double -5.000000e-01, double -5.000000e-01)
%6 = call i32 @glVertex2f(double -5.000000e-01, double 5.000000e-01)
%7 = call i32 @glVertex2f(double 5.000000e-01, double 5.000000e-01)
%8 = call i32 @glVertex2f(double 5.000000e-01, double -5.000000e-01)
%9 = call i32 (...) @glEnd()
%10 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_POLYGON = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = load i32, i32* @GL_POLYGON
%4 = tail call i32 @glBegin(i32 %3)
%5 = tail call i32 @glVertex2f(double -5.000000e-01, double -5.000000e-01)
%6 = tail call i32 @glVertex2f(double -5.000000e-01, double 5.000000e-01)
%7 = tail call i32 @glVertex2f(double 5.000000e-01, double 5.000000e-01)
%8 = tail call i32 @glVertex2f(double 5.000000e-01, double -5.000000e-01)
%9 = tail call i32 (...) @glEnd()
%10 = tail call i32 (...) @glFlush()
ret void
}