#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*/ glClearColor(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(int, int, int);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glVertex3f(double, double, int /*<<< orphan*/);
void Desenha(void) {
  glClearColor(0, 0, 0, 0);
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(1, 1, 0);
  glBegin(GL_TRIANGLES);
  glVertex3f(-0.4, 0.5, 0);
  glVertex3f(-0.8, -0.5, 0);
  glVertex3f(0, -0.5, 0);
  glColor3f(1, 0, 0);
  glVertex3f(0.4, 0.5, 0);
  glVertex3f(0, -0.5, 0);
  glVertex3f(0.8, -0.5, 0);
  glColor3f(0, 0, 1);
  glVertex3f(-0.4, 0.5, 0);
  glVertex3f(0.4, 0.5, 0);
  glVertex3f(0, -0.5, 0);
  glColor3f(0, 0, 1);
  glVertex3f(-0.8, 0.5, 0);
  glVertex3f(-0.4, 0.5, 0);
  glVertex3f(-0.8, -0.5, 0);
  glColor3f(0, 0, 1);
  glVertex3f(0.4, 0.5, 0);
  glVertex3f(0.8, 0.5, 0);
  glVertex3f(0.8, -0.5, 0);
  glEnd();
  glFlush();
}


x86 assembly (clang, -O0):
<Desenha>:
push   %rbp
mov    %rsp,%rbp
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1060 <glClearColor@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    $0x1,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1070 <glColor3f@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
call   1090 <glBegin@plt>
movsd  0xe75(%rip),%xmm0
movsd  0xe55(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xe56(%rip),%xmm0
movsd  0xe36(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
movsd  0xe24(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
mov    $0x1,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <glColor3f@plt>
movsd  0xe17(%rip),%xmm0
movsd  0xe07(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
movsd  0xded(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xdd6(%rip),%xmm0
movsd  0xdd6(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1070 <glColor3f@plt>
movsd  0xdd9(%rip),%xmm0
movsd  0xdb9(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xdb2(%rip),%xmm0
movsd  0xda2(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
movsd  0xd88(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1070 <glColor3f@plt>
movsd  0xd83(%rip),%xmm0
movsd  0xd6b(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xd74(%rip),%xmm0
movsd  0xd54(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xd55(%rip),%xmm0
movsd  0xd35(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1070 <glColor3f@plt>
movsd  0xd28(%rip),%xmm0
movsd  0xd18(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xcf9(%rip),%xmm0
movsd  0xd01(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xce2(%rip),%xmm0
movsd  0xce2(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
mov    $0x0,%al
call   1050 <glEnd@plt>
mov    $0x0,%al
call   1080 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Desenha>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1060 <glClearColor@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    $0x1,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1070 <glColor3f@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
call   1090 <glBegin@plt>
movsd  0xe4d(%rip),%xmm0
movsd  0xe4d(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xe46(%rip),%xmm0
movsd  0xe46(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
movsd  0xe34(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <glColor3f@plt>
movsd  0xe1f(%rip),%xmm0
movsd  0xdff(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
movsd  0xdfd(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xdfe(%rip),%xmm0
movsd  0xde6(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1070 <glColor3f@plt>
movsd  0xdb1(%rip),%xmm0
movsd  0xdb1(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xdba(%rip),%xmm0
movsd  0xd9a(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
movsd  0xd98(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1070 <glColor3f@plt>
movsd  0xd73(%rip),%xmm0
movsd  0xd63(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xd4c(%rip),%xmm0
movsd  0xd4c(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xd45(%rip),%xmm0
movsd  0xd45(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1070 <glColor3f@plt>
movsd  0xd30(%rip),%xmm0
movsd  0xd10(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xd21(%rip),%xmm0
movsd  0xcf9(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@plt>
movsd  0xd0a(%rip),%xmm0
movsd  0xcf2(%rip),%xmm1
xor    %edi,%edi
call   1040 <glVertex3f@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_TRIANGLES = global i32 0
define void @Desenha() {
%1 = call i32 @glClearColor(i32 0, i32 0, i32 0, i32 0)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = call i32 @glClear(i32 %2)
%4 = call i32 @glColor3f(i32 1, i32 1, i32 0)
%5 = load i32, i32* @GL_TRIANGLES
%6 = call i32 @glBegin(i32 %5)
%7 = call i32 @glVertex3f(double -4.000000e-01, double 5.000000e-01, i32 0)
%8 = call i32 @glVertex3f(double -8.000000e-01, double -5.000000e-01, i32 0)
%9 = call i32 @glVertex3f(double 0.000000e+00, double -5.000000e-01, i32 0)
%10 = call i32 @glColor3f(i32 1, i32 0, i32 0)
%11 = call i32 @glVertex3f(double 4.000000e-01, double 5.000000e-01, i32 0)
%12 = call i32 @glVertex3f(double 0.000000e+00, double -5.000000e-01, i32 0)
%13 = call i32 @glVertex3f(double 8.000000e-01, double -5.000000e-01, i32 0)
%14 = call i32 @glColor3f(i32 0, i32 0, i32 1)
%15 = call i32 @glVertex3f(double -4.000000e-01, double 5.000000e-01, i32 0)
%16 = call i32 @glVertex3f(double 4.000000e-01, double 5.000000e-01, i32 0)
%17 = call i32 @glVertex3f(double 0.000000e+00, double -5.000000e-01, i32 0)
%18 = call i32 @glColor3f(i32 0, i32 0, i32 1)
%19 = call i32 @glVertex3f(double -8.000000e-01, double 5.000000e-01, i32 0)
%20 = call i32 @glVertex3f(double -4.000000e-01, double 5.000000e-01, i32 0)
%21 = call i32 @glVertex3f(double -8.000000e-01, double -5.000000e-01, i32 0)
%22 = call i32 @glColor3f(i32 0, i32 0, i32 1)
%23 = call i32 @glVertex3f(double 4.000000e-01, double 5.000000e-01, i32 0)
%24 = call i32 @glVertex3f(double 8.000000e-01, double 5.000000e-01, i32 0)
%25 = call i32 @glVertex3f(double 8.000000e-01, double -5.000000e-01, i32 0)
%26 = call i32 (...) @glEnd()
%27 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_TRIANGLES = global i32 0
define void @Desenha() {
%1 = tail call i32 @glClearColor(i32 0, i32 0, i32 0, i32 0)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = tail call i32 @glClear(i32 %2)
%4 = tail call i32 @glColor3f(i32 1, i32 1, i32 0)
%5 = load i32, i32* @GL_TRIANGLES
%6 = tail call i32 @glBegin(i32 %5)
%7 = tail call i32 @glVertex3f(double -4.000000e-01, double 5.000000e-01, i32 0)
%8 = tail call i32 @glVertex3f(double -8.000000e-01, double -5.000000e-01, i32 0)
%9 = tail call i32 @glVertex3f(double 0.000000e+00, double -5.000000e-01, i32 0)
%10 = tail call i32 @glColor3f(i32 1, i32 0, i32 0)
%11 = tail call i32 @glVertex3f(double 4.000000e-01, double 5.000000e-01, i32 0)
%12 = tail call i32 @glVertex3f(double 0.000000e+00, double -5.000000e-01, i32 0)
%13 = tail call i32 @glVertex3f(double 8.000000e-01, double -5.000000e-01, i32 0)
%14 = tail call i32 @glColor3f(i32 0, i32 0, i32 1)
%15 = tail call i32 @glVertex3f(double -4.000000e-01, double 5.000000e-01, i32 0)
%16 = tail call i32 @glVertex3f(double 4.000000e-01, double 5.000000e-01, i32 0)
%17 = tail call i32 @glVertex3f(double 0.000000e+00, double -5.000000e-01, i32 0)
%18 = tail call i32 @glColor3f(i32 0, i32 0, i32 1)
%19 = tail call i32 @glVertex3f(double -8.000000e-01, double 5.000000e-01, i32 0)
%20 = tail call i32 @glVertex3f(double -4.000000e-01, double 5.000000e-01, i32 0)
%21 = tail call i32 @glVertex3f(double -8.000000e-01, double -5.000000e-01, i32 0)
%22 = tail call i32 @glColor3f(i32 0, i32 0, i32 1)
%23 = tail call i32 @glVertex3f(double 4.000000e-01, double 5.000000e-01, i32 0)
%24 = tail call i32 @glVertex3f(double 8.000000e-01, double 5.000000e-01, i32 0)
%25 = tail call i32 @glVertex3f(double 8.000000e-01, double -5.000000e-01, i32 0)
%26 = tail call i32 (...) @glEnd()
%27 = tail call i32 (...) @glFlush()
ret void
}