#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_TRIANGLES;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glVertex2i(int, int);
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  glBegin(GL_TRIANGLES);
  glColor3f(0.0, 0.0, 1.0);
  glVertex2i(0, 0);
  glColor3f(0.0, 1.0, 0.0);
  glVertex2i(200, 200);
  glColor3f(1.0, 0.0, 0.0);
  glVertex2i(20, 200);
  glEnd();
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1080 <glBegin@plt>
xorps  %xmm1,%xmm1
movsd  0xe75(%rip),%xmm2
movaps %xmm1,%xmm0
call   1060 <glColor3f@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <glVertex2i@plt>
xorps  %xmm2,%xmm2
movsd  0xe59(%rip),%xmm1
movaps %xmm2,%xmm0
call   1060 <glColor3f@plt>
mov    $0xc8,%esi
mov    %esi,%edi
call   1030 <glVertex2i@plt>
movsd  0xe3d(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1060 <glColor3f@plt>
mov    $0x14,%edi
mov    $0xc8,%esi
call   1030 <glVertex2i@plt>
mov    $0x0,%al
call   1050 <glEnd@plt>
mov    $0x0,%al
call   1070 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1080 <glBegin@plt>
movsd  0xe7b(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1060 <glColor3f@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <glVertex2i@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0xe59(%rip),%xmm1
call   1060 <glColor3f@plt>
mov    $0xc8,%edi
mov    $0xc8,%esi
call   1030 <glVertex2i@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xe37(%rip),%xmm0
call   1060 <glColor3f@plt>
mov    $0x14,%edi
mov    $0xc8,%esi
call   1030 <glVertex2i@plt>
xor    %eax,%eax
call   1050 <glEnd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_TRIANGLES = 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_TRIANGLES
%4 = call i32 @glBegin(i32 %3)
%5 = call i32 @glColor3f(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%6 = call i32 @glVertex2i(i32 0, i32 0)
%7 = call i32 @glColor3f(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%8 = call i32 @glVertex2i(i32 200, i32 200)
%9 = call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%10 = call i32 @glVertex2i(i32 20, i32 200)
%11 = call i32 (...) @glEnd()
%12 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_TRIANGLES = 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_TRIANGLES
%4 = tail call i32 @glBegin(i32 %3)
%5 = tail call i32 @glColor3f(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%6 = tail call i32 @glVertex2i(i32 0, i32 0)
%7 = tail call i32 @glColor3f(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%8 = tail call i32 @glVertex2i(i32 200, i32 200)
%9 = tail call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%10 = tail call i32 @glVertex2i(i32 20, i32 200)
%11 = tail call i32 (...) @glEnd()
%12 = tail call i32 (...) @glFlush()
ret void
}