#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_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ drawTriangle(double, double, double, double, double, double,
                                double);
int /*<<< orphan*/ drawViewVolume(double, double, double, double, double,
                                  double);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ gluLookAt(double, double, double, double, double, double,
                             double, double, double);
int /*<<< orphan*/ gluPerspective(double, double, double, double);
void drawScene(void) {
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(40.0, 4.0 / 3.0, 1.0, 100.0);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  gluLookAt(7.5, 7.5, 12.5, 2.5, 2.5, -5.0, 0.0, 1.0, 0.0);
  glColor3f(0.0, 1.0, 0.0);
  drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, -5.0);
  glColor3f(1.0, 0.0, 0.0);
  drawTriangle(2.0, 7.0, 3.0, 7.0, 2.5, 8.0, -5.0);
  glColor3f(1.0, 1.0, 0.0);
  drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, 0.0);
  drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, -10.0);
  drawViewVolume(0.0, 5.0, 0.0, 5.0, 0.0, 10.0);
}


x86 assembly (clang, -O0):
<drawScene>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
mov    $0x0,%al
call   1070 <glLoadIdentity@plt>
movsd  0xecb(%rip),%xmm0
movsd  0xecb(%rip),%xmm1
movsd  0xe8b(%rip),%xmm2
movsd  0xec3(%rip),%xmm3
call   1060 <gluPerspective@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
mov    $0x0,%al
call   1070 <glLoadIdentity@plt>
movsd  0xe81(%rip),%xmm1
movsd  0xe81(%rip),%xmm2
movsd  0xe41(%rip),%xmm4
movsd  0xe61(%rip),%xmm5
xorps  %xmm8,%xmm8
movsd  0xe3d(%rip),%xmm7
movaps %xmm1,%xmm0
movaps %xmm4,%xmm3
movaps %xmm8,%xmm6
movsd  %xmm8,(%rsp)
call   1030 <gluLookAt@plt>
xorps  %xmm2,%xmm2
movsd  0xe1d(%rip),%xmm1
movaps %xmm2,%xmm0
call   1080 <glColor3f@plt>
movsd  0xded(%rip),%xmm3
movsd  0xded(%rip),%xmm5
movsd  0xded(%rip),%xmm4
movsd  0xe0d(%rip),%xmm6
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm5,%xmm2
call   1040 <drawTriangle@plt>
movsd  0xddf(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1080 <glColor3f@plt>
movsd  0xdac(%rip),%xmm0
movsd  0xdcc(%rip),%xmm3
movsd  0xda4(%rip),%xmm2
movsd  0xda4(%rip),%xmm4
movsd  0xdbc(%rip),%xmm5
movsd  0xdbc(%rip),%xmm6
movaps %xmm3,%xmm1
call   1040 <drawTriangle@plt>
movsd  0xd94(%rip),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm0
call   1080 <glColor3f@plt>
movsd  0xd61(%rip),%xmm3
movsd  0xd61(%rip),%xmm5
movsd  0xd61(%rip),%xmm4
xorps  %xmm6,%xmm6
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm5,%xmm2
call   1040 <drawTriangle@plt>
movsd  0xd38(%rip),%xmm3
movsd  0xd38(%rip),%xmm5
movsd  0xd38(%rip),%xmm4
movsd  0xd38(%rip),%xmm6
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm5,%xmm2
call   1040 <drawTriangle@plt>
xorps  %xmm4,%xmm4
movsd  0xcf7(%rip),%xmm3
movsd  0xcf7(%rip),%xmm5
movaps %xmm4,%xmm0
movaps %xmm3,%xmm1
movaps %xmm4,%xmm2
call   1090 <drawViewVolume@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawScene>:
push   %rax
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
xor    %eax,%eax
call   1070 <glLoadIdentity@plt>
movsd  0xe72(%rip),%xmm0
movsd  0xe72(%rip),%xmm1
movsd  0xe72(%rip),%xmm2
movsd  0xe72(%rip),%xmm3
call   1060 <gluPerspective@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
xor    %eax,%eax
call   1070 <glLoadIdentity@plt>
movq   $0x0,(%rsp)
movsd  0xe50(%rip),%xmm0
movsd  0xe50(%rip),%xmm2
movsd  0xe50(%rip),%xmm3
movsd  0xe50(%rip),%xmm5
xorps  %xmm6,%xmm6
movaps %xmm0,%xmm1
movaps %xmm3,%xmm4
movsd  0xe17(%rip),%xmm7
call   1030 <gluLookAt@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0xe04(%rip),%xmm1
call   1080 <glColor3f@plt>
movsd  0xe27(%rip),%xmm0
movsd  0xe27(%rip),%xmm2
movaps %xmm0,%xmm1
movaps %xmm0,%xmm3
movsd  0xe01(%rip),%xmm4
movaps %xmm2,%xmm5
movsd  0xdfe(%rip),%xmm6
call   1040 <drawTriangle@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xdc3(%rip),%xmm0
call   1080 <glColor3f@plt>
movsd  0xdf6(%rip),%xmm1
movsd  0xdf6(%rip),%xmm5
movsd  0xdd6(%rip),%xmm0
movsd  0xdd6(%rip),%xmm2
movaps %xmm1,%xmm3
movsd  0xdb3(%rip),%xmm4
movsd  0xdb3(%rip),%xmm6
call   1040 <drawTriangle@plt>
xorps  %xmm2,%xmm2
movsd  0xd7b(%rip),%xmm0
movaps %xmm0,%xmm1
call   1080 <glColor3f@plt>
xorps  %xmm6,%xmm6
movsd  0xd98(%rip),%xmm0
movaps %xmm0,%xmm1
movsd  0xd95(%rip),%xmm2
movaps %xmm0,%xmm3
movsd  0xd72(%rip),%xmm4
movaps %xmm2,%xmm5
call   1040 <drawTriangle@plt>
movsd  0xd92(%rip),%xmm6
movsd  0xd6a(%rip),%xmm0
movaps %xmm0,%xmm1
movsd  0xd67(%rip),%xmm2
movaps %xmm0,%xmm3
movsd  0xd44(%rip),%xmm4
movaps %xmm2,%xmm5
call   1040 <drawTriangle@plt>
movsd  0xd6c(%rip),%xmm1
movsd  0xd6c(%rip),%xmm5
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
xorps  %xmm4,%xmm4
movaps %xmm1,%xmm3
pop    %rax
jmp    1090 <drawViewVolume@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @drawScene() {
%1 = load i32, i32* @GL_PROJECTION
%2 = call i32 @glMatrixMode(i32 %1)
%3 = call i32 (...) @glLoadIdentity()
%4 = call i32 @gluPerspective(double 4.000000e+01, double 0x3FF5555555555555, double 1.000000e+00, double 1.000000e+02)
%5 = load i32, i32* @GL_MODELVIEW
%6 = call i32 @glMatrixMode(i32 %5)
%7 = call i32 (...) @glLoadIdentity()
%8 = call i32 @gluLookAt(double 7.500000e+00, double 7.500000e+00, double 1.250000e+01, double 2.500000e+00, double 2.500000e+00, double -5.000000e+00, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%9 = call i32 @glColor3f(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%10 = call i32 @drawTriangle(double 2.000000e+00, double 2.000000e+00, double 3.000000e+00, double 2.000000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e+00)
%11 = call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%12 = call i32 @drawTriangle(double 2.000000e+00, double 7.000000e+00, double 3.000000e+00, double 7.000000e+00, double 2.500000e+00, double 8.000000e+00, double -5.000000e+00)
%13 = call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 0.000000e+00)
%14 = call i32 @drawTriangle(double 2.000000e+00, double 2.000000e+00, double 3.000000e+00, double 2.000000e+00, double 2.500000e+00, double 3.000000e+00, double 0.000000e+00)
%15 = call i32 @drawTriangle(double 2.000000e+00, double 2.000000e+00, double 3.000000e+00, double 2.000000e+00, double 2.500000e+00, double 3.000000e+00, double -1.000000e+01)
%16 = call i32 @drawViewVolume(double 0.000000e+00, double 5.000000e+00, double 0.000000e+00, double 5.000000e+00, double 0.000000e+00, double 1.000000e+01)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @drawScene() {
%1 = load i32, i32* @GL_PROJECTION
%2 = tail call i32 @glMatrixMode(i32 %1)
%3 = tail call i32 (...) @glLoadIdentity()
%4 = tail call i32 @gluPerspective(double 4.000000e+01, double 0x3FF5555555555555, double 1.000000e+00, double 1.000000e+02)
%5 = load i32, i32* @GL_MODELVIEW
%6 = tail call i32 @glMatrixMode(i32 %5)
%7 = tail call i32 (...) @glLoadIdentity()
%8 = tail call i32 @gluLookAt(double 7.500000e+00, double 7.500000e+00, double 1.250000e+01, double 2.500000e+00, double 2.500000e+00, double -5.000000e+00, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%9 = tail call i32 @glColor3f(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%10 = tail call i32 @drawTriangle(double 2.000000e+00, double 2.000000e+00, double 3.000000e+00, double 2.000000e+00, double 2.500000e+00, double 3.000000e+00, double -5.000000e+00)
%11 = tail call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%12 = tail call i32 @drawTriangle(double 2.000000e+00, double 7.000000e+00, double 3.000000e+00, double 7.000000e+00, double 2.500000e+00, double 8.000000e+00, double -5.000000e+00)
%13 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 0.000000e+00)
%14 = tail call i32 @drawTriangle(double 2.000000e+00, double 2.000000e+00, double 3.000000e+00, double 2.000000e+00, double 2.500000e+00, double 3.000000e+00, double 0.000000e+00)
%15 = tail call i32 @drawTriangle(double 2.000000e+00, double 2.000000e+00, double 3.000000e+00, double 2.000000e+00, double 2.500000e+00, double 3.000000e+00, double -1.000000e+01)
%16 = tail call i32 @drawViewVolume(double 0.000000e+00, double 5.000000e+00, double 0.000000e+00, double 5.000000e+00, double 0.000000e+00, double 1.000000e+01)
ret void
}