#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 GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ GL_TRIANGLES;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glTranslatef(double, double, double);
int /*<<< orphan*/ glVertex3f(double, double, double);
int /*<<< orphan*/ glutSwapBuffers();
void render() {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glLoadIdentity();
  glTranslatef(0.0, 0.0, -4.0);
  glColor3f(1.0, 1.0, 1.0);
  glBegin(GL_TRIANGLES);
  glVertex3f(0.0, 1.0, 0.0);
  glVertex3f(-1.0, -1.0, 0.0);
  glVertex3f(1.0, -1.0, 0.0);
  glEnd();
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<render>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
mov    0x2e54(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1070 <glLoadIdentity@plt>
xorps  %xmm1,%xmm1
movsd  0xe63(%rip),%xmm2
movaps %xmm1,%xmm0
call   1090 <glTranslatef@plt>
movsd  0xe43(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1080 <glColor3f@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
xorps  %xmm2,%xmm2
movsd  0xe1f(%rip),%xmm1
movaps %xmm2,%xmm0
call   1040 <glVertex3f@plt>
movsd  0xe17(%rip),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm0
call   1040 <glVertex3f@plt>
movsd  0xdfc(%rip),%xmm0
movsd  0xdfc(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
mov    $0x0,%al
call   1060 <glEnd@plt>
mov    $0x0,%al
call   1050 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<render>:
push   %rax
mov    0x2e48(%rip),%rax
mov    0x2e59(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
call   1070 <glLoadIdentity@plt>
movsd  0xe59(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1090 <glTranslatef@plt>
movsd  0xe4e(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1080 <glColor3f@plt>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0xe27(%rip),%xmm1
call   1040 <glVertex3f@plt>
movsd  0xe22(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm1
call   1040 <glVertex3f@plt>
xorps  %xmm2,%xmm2
movsd  0xe04(%rip),%xmm0
movsd  0xe04(%rip),%xmm1
call   1040 <glVertex3f@plt>
xor    %eax,%eax
call   1060 <glEnd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_TRIANGLES = global i32 0
define void @render() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 (...) @glLoadIdentity()
%6 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double -4.000000e+00)
%7 = call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%8 = load i32, i32* @GL_TRIANGLES
%9 = call i32 @glBegin(i32 %8)
%10 = call i32 @glVertex3f(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%11 = call i32 @glVertex3f(double -1.000000e+00, double -1.000000e+00, double 0.000000e+00)
%12 = call i32 @glVertex3f(double 1.000000e+00, double -1.000000e+00, double 0.000000e+00)
%13 = call i32 (...) @glEnd()
%14 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_TRIANGLES = global i32 0
define void @render() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 (...) @glLoadIdentity()
%6 = tail call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double -4.000000e+00)
%7 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%8 = load i32, i32* @GL_TRIANGLES
%9 = tail call i32 @glBegin(i32 %8)
%10 = tail call i32 @glVertex3f(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%11 = tail call i32 @glVertex3f(double -1.000000e+00, double -1.000000e+00, double 0.000000e+00)
%12 = tail call i32 @glVertex3f(double 1.000000e+00, double -1.000000e+00, double 0.000000e+00)
%13 = tail call i32 (...) @glEnd()
%14 = tail call i32 (...) @glutSwapBuffers()
ret void
}