#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_POLYGON;
int /*<<< orphan*/ GL_QUADS;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glColor3f(float, float, float);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glTranslatef(float, float, float);
int /*<<< orphan*/ glVertex3f(float, float, float);
int /*<<< orphan*/ glutSwapBuffers();
void DrawGLScene() {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glLoadIdentity();
  glTranslatef(-1.5f, 0.0f, -6.0f);
  glBegin(GL_POLYGON);
  glColor3f(1.0f, 0.0f, 0.0f);
  glVertex3f(0.0f, 1.0f, 0.0f);
  glColor3f(0.0f, 1.0f, 0.0f);
  glVertex3f(1.0f, -1.0f, 0.0f);
  glColor3f(0.0f, 0.0f, 1.0f);
  glVertex3f(-1.0f, -1.0f, 0.0f);
  glEnd();
  glTranslatef(3.0f, 0.0f, 0.0f);
  glColor3f(0.5f, 0.5f, 1.0f);
  glBegin(GL_QUADS);
  glVertex3f(-1.0f, 1.0f, 0.0f);
  glVertex3f(1.0f, 1.0f, 0.0f);
  glVertex3f(1.0f, -1.0f, 0.0f);
  glVertex3f(-1.0f, -1.0f, 0.0f);
  glEnd();
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<DrawGLScene>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
mov    0x2e4c(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1070 <glLoadIdentity@plt>
movss  0xe66(%rip),%xmm0
xorps  %xmm1,%xmm1
movss  0xe5f(%rip),%xmm2
call   1090 <glTranslatef@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
movss  0xe34(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1080 <glColor3f@plt>
xorps  %xmm2,%xmm2
movss  0xe1e(%rip),%xmm1
movaps %xmm2,%xmm0
call   1040 <glVertex3f@plt>
xorps  %xmm2,%xmm2
movss  0xe0b(%rip),%xmm1
movaps %xmm2,%xmm0
call   1080 <glColor3f@plt>
movss  0xdfb(%rip),%xmm0
movss  0xdef(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
xorps  %xmm1,%xmm1
movss  0xde0(%rip),%xmm2
movaps %xmm1,%xmm0
call   1080 <glColor3f@plt>
movss  0xdcc(%rip),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm0
call   1040 <glVertex3f@plt>
mov    $0x0,%al
call   1060 <glEnd@plt>
movss  0xdbe(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1090 <glTranslatef@plt>
movss  0xda7(%rip),%xmm1
movss  0xd9b(%rip),%xmm2
movaps %xmm1,%xmm0
call   1080 <glColor3f@plt>
mov    0x2d60(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
movss  0xd79(%rip),%xmm0
movss  0xd75(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
movss  0xd65(%rip),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm0
call   1040 <glVertex3f@plt>
movss  0xd52(%rip),%xmm0
movss  0xd46(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
movss  0xd36(%rip),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm0
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):
<DrawGLScene>:
push   %rax
mov    0x2e40(%rip),%rax
mov    0x2e51(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
call   1070 <glLoadIdentity@plt>
movss  0xe59(%rip),%xmm0
movss  0xe55(%rip),%xmm2
xorps  %xmm1,%xmm1
call   1090 <glTranslatef@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
movss  0xe3b(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1080 <glColor3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movss  0xe22(%rip),%xmm1
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movss  0xe0f(%rip),%xmm1
call   1080 <glColor3f@plt>
movss  0xe06(%rip),%xmm1
xorps  %xmm2,%xmm2
movss  0xdf7(%rip),%xmm0
call   1040 <glVertex3f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movss  0xde4(%rip),%xmm2
call   1080 <glColor3f@plt>
xorps  %xmm2,%xmm2
movss  0xdd8(%rip),%xmm0
movaps %xmm0,%xmm1
call   1040 <glVertex3f@plt>
xor    %eax,%eax
call   1060 <glEnd@plt>
movss  0xdc5(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1090 <glTranslatef@plt>
movss  0xdb6(%rip),%xmm0
movaps %xmm0,%xmm1
movss  0xd9f(%rip),%xmm2
call   1080 <glColor3f@plt>
mov    0x2d63(%rip),%rax
mov    (%rax),%edi
call   10a0 <glBegin@plt>
xorps  %xmm2,%xmm2
movss  0xd85(%rip),%xmm0
movss  0xd79(%rip),%xmm1
call   1040 <glVertex3f@plt>
xorps  %xmm2,%xmm2
movss  0xd69(%rip),%xmm0
movaps %xmm0,%xmm1
call   1040 <glVertex3f@plt>
xorps  %xmm2,%xmm2
movss  0xd56(%rip),%xmm0
movss  0xd52(%rip),%xmm1
call   1040 <glVertex3f@plt>
xorps  %xmm2,%xmm2
movss  0xd42(%rip),%xmm0
movaps %xmm0,%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_POLYGON = global i32 0
@GL_QUADS = global i32 0
define void @DrawGLScene() {
%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(float -1.500000e+00, float 0.000000e+00, float -6.000000e+00)
%7 = load i32, i32* @GL_POLYGON
%8 = call i32 @glBegin(i32 %7)
%9 = call i32 @glColor3f(float 1.000000e+00, float 0.000000e+00, float 0.000000e+00)
%10 = call i32 @glVertex3f(float 0.000000e+00, float 1.000000e+00, float 0.000000e+00)
%11 = call i32 @glColor3f(float 0.000000e+00, float 1.000000e+00, float 0.000000e+00)
%12 = call i32 @glVertex3f(float 1.000000e+00, float -1.000000e+00, float 0.000000e+00)
%13 = call i32 @glColor3f(float 0.000000e+00, float 0.000000e+00, float 1.000000e+00)
%14 = call i32 @glVertex3f(float -1.000000e+00, float -1.000000e+00, float 0.000000e+00)
%15 = call i32 (...) @glEnd()
%16 = call i32 @glTranslatef(float 3.000000e+00, float 0.000000e+00, float 0.000000e+00)
%17 = call i32 @glColor3f(float 5.000000e-01, float 5.000000e-01, float 1.000000e+00)
%18 = load i32, i32* @GL_QUADS
%19 = call i32 @glBegin(i32 %18)
%20 = call i32 @glVertex3f(float -1.000000e+00, float 1.000000e+00, float 0.000000e+00)
%21 = call i32 @glVertex3f(float 1.000000e+00, float 1.000000e+00, float 0.000000e+00)
%22 = call i32 @glVertex3f(float 1.000000e+00, float -1.000000e+00, float 0.000000e+00)
%23 = call i32 @glVertex3f(float -1.000000e+00, float -1.000000e+00, float 0.000000e+00)
%24 = call i32 (...) @glEnd()
%25 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_POLYGON = global i32 0
@GL_QUADS = global i32 0
define void @DrawGLScene() {
%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(float -1.500000e+00, float 0.000000e+00, float -6.000000e+00)
%7 = load i32, i32* @GL_POLYGON
%8 = tail call i32 @glBegin(i32 %7)
%9 = tail call i32 @glColor3f(float 1.000000e+00, float 0.000000e+00, float 0.000000e+00)
%10 = tail call i32 @glVertex3f(float 0.000000e+00, float 1.000000e+00, float 0.000000e+00)
%11 = tail call i32 @glColor3f(float 0.000000e+00, float 1.000000e+00, float 0.000000e+00)
%12 = tail call i32 @glVertex3f(float 1.000000e+00, float -1.000000e+00, float 0.000000e+00)
%13 = tail call i32 @glColor3f(float 0.000000e+00, float 0.000000e+00, float 1.000000e+00)
%14 = tail call i32 @glVertex3f(float -1.000000e+00, float -1.000000e+00, float 0.000000e+00)
%15 = tail call i32 (...) @glEnd()
%16 = tail call i32 @glTranslatef(float 3.000000e+00, float 0.000000e+00, float 0.000000e+00)
%17 = tail call i32 @glColor3f(float 5.000000e-01, float 5.000000e-01, float 1.000000e+00)
%18 = load i32, i32* @GL_QUADS
%19 = tail call i32 @glBegin(i32 %18)
%20 = tail call i32 @glVertex3f(float -1.000000e+00, float 1.000000e+00, float 0.000000e+00)
%21 = tail call i32 @glVertex3f(float 1.000000e+00, float 1.000000e+00, float 0.000000e+00)
%22 = tail call i32 @glVertex3f(float 1.000000e+00, float -1.000000e+00, float 0.000000e+00)
%23 = tail call i32 @glVertex3f(float -1.000000e+00, float -1.000000e+00, float 0.000000e+00)
%24 = tail call i32 (...) @glEnd()
%25 = tail call i32 (...) @glutSwapBuffers()
ret void
}