#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(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*/ glVertex3f(double, int, int /*<<< orphan*/);
void drawTriangle() {
  glClearColor(0.4, 0.4, 0.4, 0.4);
  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_TRIANGLES);
  glVertex3f(-0.7, 0.7, 0);
  glVertex3f(0.7, 0.7, 0);
  glVertex3f(0, -1, 0);
  glEnd();
  glFlush();
}


x86 assembly (clang, -O0):
<drawTriangle>:
push   %rbp
mov    %rsp,%rbp
movsd  0xe94(%rip),%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1070 <glClearColor@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
movsd  0xe68(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1080 <glColor3f@plt>
movsd  0xe4d(%rip),%xmm4
movsd  0xe4d(%rip),%xmm5
movaps %xmm4,%xmm0
movaps %xmm5,%xmm1
movaps %xmm4,%xmm2
movaps %xmm5,%xmm3
call   1050 <glOrtho@plt>
mov    0x2dfd(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
movsd  0xe16(%rip),%xmm0
xor    %esi,%esi
mov    %esi,%edi
call   1040 <glVertex3f@plt>
movsd  0xdfd(%rip),%xmm0
xor    %esi,%esi
mov    %esi,%edi
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <glVertex3f@plt>
mov    $0x0,%al
call   1060 <glEnd@plt>
mov    $0x0,%al
call   1090 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawTriangle>:
push   %rax
movsd  0xe77(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
movaps %xmm0,%xmm3
call   1070 <glClearColor@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
movsd  0xe5b(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1080 <glColor3f@plt>
movsd  0xe50(%rip),%xmm0
movsd  0xe40(%rip),%xmm1
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
movaps %xmm1,%xmm5
movaps %xmm0,%xmm4
call   1050 <glOrtho@plt>
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
movsd  0xe29(%rip),%xmm0
xor    %edi,%edi
xor    %esi,%esi
call   1040 <glVertex3f@plt>
movsd  0xe20(%rip),%xmm0
xor    %edi,%edi
xor    %esi,%esi
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <glVertex3f@plt>
xor    %eax,%eax
call   1060 <glEnd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_TRIANGLES = global i32 0
define void @drawTriangle() {
%1 = call i32 @glClearColor(double 4.000000e-01, double 4.000000e-01, double 4.000000e-01, double 4.000000e-01)
%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_TRIANGLES
%7 = call i32 @glBegin(i32 %6)
%8 = call i32 @glVertex3f(double 0xBFE6666666666666, i32 0, i32 0)
%9 = call i32 @glVertex3f(double 0x3FE6666666666666, i32 0, i32 0)
%10 = call i32 @glVertex3f(double 0.000000e+00, i32 -1, i32 0)
%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 @drawTriangle() {
%1 = tail call i32 @glClearColor(double 4.000000e-01, double 4.000000e-01, double 4.000000e-01, double 4.000000e-01)
%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_TRIANGLES
%7 = tail call i32 @glBegin(i32 %6)
%8 = tail call i32 @glVertex3f(double 0xBFE6666666666666, i32 0, i32 0)
%9 = tail call i32 @glVertex3f(double 0x3FE6666666666666, i32 0, i32 0)
%10 = tail call i32 @glVertex3f(double 0.000000e+00, i32 -1, i32 0)
%11 = tail call i32 (...) @glEnd()
%12 = tail call i32 (...) @glFlush()
ret void
}