#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 */
typedef int /*<<< orphan*/ GLhandleARB;
typedef int GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ GL_QUADS;
int /*<<< orphan*/ GL_TRUE;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glClearColor(float, float, float, float);
int /*<<< orphan*/ glColorMask(int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glRotatef(float, float, float, float);
int /*<<< orphan*/ glTexCoord2f(float, float);
int /*<<< orphan*/ glUseProgramObjectARB(int /*<<< orphan*/);
int /*<<< orphan*/ glVertex2f(float, float);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ gluLookAt(float, float, float, float, float, float, float,
                             float, float);
int /*<<< orphan*/ gluPerspective(float, int, float, float);
void renderScene(GLhandleARB programObj, float posx, float posy, float zoom,
                 float rotx, float rotz) {
  int width, height;
  if (height < 1)
    height = 1;
  if (width < 1)
    width = 1;
  glClearColor(0.0f, 0.0f, 0.5f, 0.0f);
  glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
  glClear(GL_COLOR_BUFFER_BIT);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(45.0f / zoom, (GLfloat)width / (GLfloat)height, 1.0f, 100.0f);
  glViewport(0, 0, width, height);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  glUseProgramObjectARB(programObj);
  gluLookAt(10.0f / width * posx, -10.0f / height * posy, 12.0f,
            10.0f / width * posx, -10.0f / height * posy, 0.0f, 0.0f, 1.0f,
            0.0f);
  glRotatef(-rotx, 1.0f, 0.0f, 0.0f);
  glRotatef(rotz, 0.0f, 0.0f, 1.0f);
  glBegin(GL_QUADS);
  glTexCoord2f(0.0f, 1.0f);
  glVertex2f(-5.0f, -5.0f);
  glTexCoord2f(1.0f, 1.0f);
  glVertex2f(5.0f, -5.0f);
  glTexCoord2f(1.0f, 0.0f);
  glVertex2f(5.0f, 5.0f);
  glTexCoord2f(0.0f, 0.0f);
  glVertex2f(-5.0f, 5.0f);
  glEnd();
  glUseProgramObjectARB(0);
}


x86 assembly (clang, -O0):
<renderScene>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
movss  %xmm4,-0x18(%rbp)
cmpl   $0x1,-0x20(%rbp)
jge    1215 <renderScene+0x35>
movl   $0x1,-0x20(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jge    1226 <renderScene+0x46>
movl   $0x1,-0x1c(%rbp)
xorps  %xmm3,%xmm3
movss  0xdef(%rip),%xmm2
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
call   1080 <glClearColor@plt>
mov    0x2d8d(%rip),%rax
mov    (%rax),%edi
mov    0x2d84(%rip),%rax
mov    (%rax),%esi
mov    0x2d7b(%rip),%rax
mov    (%rax),%edx
mov    0x2d72(%rip),%rax
mov    (%rax),%ecx
call   10d0 <glColorMask@plt>
mov    0x2d54(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
mov    0x2d4e(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
mov    $0x0,%al
call   1090 <glLoadIdentity@plt>
movss  0xd8c(%rip),%xmm0
divss  -0x10(%rbp),%xmm0
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x20(%rbp)
mov    %eax,%edi
movss  0xd62(%rip),%xmm1
movss  0xd6a(%rip),%xmm2
call   1070 <gluPerspective@plt>
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1100 <glViewport@plt>
mov    0x2d17(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
mov    $0x0,%al
call   1090 <glLoadIdentity@plt>
mov    -0x4(%rbp),%edi
call   10a0 <glUseProgramObjectARB@plt>
cvtsi2ssl -0x1c(%rbp),%xmm1
movss  0xd28(%rip),%xmm0
divss  %xmm1,%xmm0
mulss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm2
movss  0xd0e(%rip),%xmm1
divss  %xmm2,%xmm1
mulss  -0xc(%rbp),%xmm1
cvtsi2ssl -0x1c(%rbp),%xmm2
movss  0xcfc(%rip),%xmm3
divss  %xmm2,%xmm3
mulss  -0x8(%rbp),%xmm3
cvtsi2ssl -0x20(%rbp),%xmm2
movss  0xce2(%rip),%xmm4
divss  %xmm2,%xmm4
mulss  -0xc(%rbp),%xmm4
movss  0xccd(%rip),%xmm2
xorps  %xmm8,%xmm8
movss  0xcbd(%rip),%xmm7
movaps %xmm8,%xmm5
movaps %xmm8,%xmm6
movss  %xmm8,(%rsp)
call   1030 <gluLookAt@plt>
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xc90(%rip),%xmm1
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm2
call   10f0 <glRotatef@plt>
movss  -0x18(%rbp),%xmm0
xorps  %xmm2,%xmm2
movss  0xc75(%rip),%xmm3
movaps %xmm2,%xmm1
call   10f0 <glRotatef@plt>
mov    0x2c46(%rip),%rax
mov    (%rax),%edi
call   10e0 <glBegin@plt>
xorps  %xmm0,%xmm0
movss  0xc54(%rip),%xmm1
call   10c0 <glTexCoord2f@plt>
movss  0xc3f(%rip),%xmm1
movaps %xmm1,%xmm0
call   10b0 <glVertex2f@plt>
movss  0xc37(%rip),%xmm1
movaps %xmm1,%xmm0
call   10c0 <glTexCoord2f@plt>
movss  0xc23(%rip),%xmm0
movss  0xc17(%rip),%xmm1
call   10b0 <glVertex2f@plt>
movss  0xc12(%rip),%xmm0
xorps  %xmm1,%xmm1
call   10c0 <glTexCoord2f@plt>
movss  0xbfe(%rip),%xmm1
movaps %xmm1,%xmm0
call   10b0 <glVertex2f@plt>
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   10c0 <glTexCoord2f@plt>
movss  0xbdf(%rip),%xmm0
movss  0xbdb(%rip),%xmm1
call   10b0 <glVertex2f@plt>
mov    $0x0,%al
call   1060 <glEnd@plt>
xor    %edi,%edi
call   10a0 <glUseProgramObjectARB@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renderScene>:
push   %rbx
sub    $0x30,%rsp
movss  %xmm4,0x1c(%rsp)
movaps %xmm3,0x20(%rsp)
movss  %xmm2,0x10(%rsp)
movss  %xmm1,0x18(%rsp)
movss  %xmm0,0x14(%rsp)
mov    %edi,%ebx
movss  0xdf4(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm3,%xmm3
call   1080 <glClearColor@plt>
mov    0x2daf(%rip),%rax
mov    (%rax),%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   10d0 <glColorMask@plt>
mov    0x2d8b(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
mov    0x2d85(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
xor    %eax,%eax
call   1090 <glLoadIdentity@plt>
movss  0xdab(%rip),%xmm0
divss  0x10(%rsp),%xmm0
movss  0xda1(%rip),%xmm1
movss  0xd9d(%rip),%xmm2
call   1070 <gluPerspective@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1100 <glViewport@plt>
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
xor    %eax,%eax
call   1090 <glLoadIdentity@plt>
mov    %ebx,%edi
call   10a0 <glUseProgramObjectARB@plt>
movss  0x14(%rsp),%xmm0
mulss  0xd69(%rip),%xmm0
movss  0x18(%rsp),%xmm1
mulss  0xd5f(%rip),%xmm1
movl   $0x0,(%rsp)
movss  0xd54(%rip),%xmm2
xorps  %xmm5,%xmm5
xorps  %xmm6,%xmm6
movaps %xmm0,%xmm3
movaps %xmm1,%xmm4
movss  0xd30(%rip),%xmm7
call   1030 <gluLookAt@plt>
movaps 0x20(%rsp),%xmm0
xorps  0xd47(%rip),%xmm0
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
movss  0xd11(%rip),%xmm1
call   10f0 <glRotatef@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movss  0x1c(%rsp),%xmm0
movss  0xcf8(%rip),%xmm3
call   10f0 <glRotatef@plt>
mov    0x2ccc(%rip),%rax
mov    (%rax),%edi
call   10e0 <glBegin@plt>
xorps  %xmm0,%xmm0
movss  0xcda(%rip),%xmm1
call   10c0 <glTexCoord2f@plt>
movss  0xce1(%rip),%xmm0
movaps %xmm0,%xmm1
call   10b0 <glVertex2f@plt>
movss  0xcbd(%rip),%xmm0
movaps %xmm0,%xmm1
call   10c0 <glTexCoord2f@plt>
movss  0xcc5(%rip),%xmm0
movss  0xcb9(%rip),%xmm1
call   10b0 <glVertex2f@plt>
xorps  %xmm1,%xmm1
movss  0xc95(%rip),%xmm0
call   10c0 <glTexCoord2f@plt>
movss  0xca0(%rip),%xmm0
movaps %xmm0,%xmm1
call   10b0 <glVertex2f@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   10c0 <glTexCoord2f@plt>
movss  0xc81(%rip),%xmm0
movss  0xc7d(%rip),%xmm1
call   10b0 <glVertex2f@plt>
xor    %eax,%eax
call   1060 <glEnd@plt>
xor    %edi,%edi
add    $0x30,%rsp
pop    %rbx
jmp    10a0 <glUseProgramObjectARB@plt>

LLVM IR (-O0):
@GL_TRUE = global i32 0
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_QUADS = global i32 0
define void @renderScene(i32 %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%15 = load i32, i32* %14
%16 = icmp slt i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %6
store i32 1, i32* %14
br label %18
18: ; preds = %17, %6
%19 = load i32, i32* %13
%20 = icmp slt i32 %19, 1
br i1 %20, label %21, label %22
21: ; preds = %18
store i32 1, i32* %13
br label %22
22: ; preds = %21, %18
%23 = call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 5.000000e-01, float 0.000000e+00)
%24 = load i32, i32* @GL_TRUE
%25 = load i32, i32* @GL_TRUE
%26 = load i32, i32* @GL_TRUE
%27 = load i32, i32* @GL_TRUE
%28 = call i32 @glColorMask(i32 %24, i32 %25, i32 %26, i32 %27)
%29 = load i32, i32* @GL_COLOR_BUFFER_BIT
%30 = call i32 @glClear(i32 %29)
%31 = load i32, i32* @GL_PROJECTION
%32 = call i32 @glMatrixMode(i32 %31)
%33 = call i32 (...) @glLoadIdentity()
%34 = load float, float* %10
%35 = fdiv float 4.500000e+01, %34
%36 = load i32, i32* %13
%37 = load i32, i32* %14
%38 = sdiv i32 %36, %37
%39 = call i32 @gluPerspective(float %35, i32 %38, float 1.000000e+00, float 1.000000e+02)
%40 = load i32, i32* %13
%41 = load i32, i32* %14
%42 = call i32 @glViewport(i32 0, i32 0, i32 %40, i32 %41)
%43 = load i32, i32* @GL_MODELVIEW
%44 = call i32 @glMatrixMode(i32 %43)
%45 = call i32 (...) @glLoadIdentity()
%46 = load i32, i32* %7
%47 = call i32 @glUseProgramObjectARB(i32 %46)
%48 = load i32, i32* %13
%49 = sitofp i32 %48 to float
%50 = fdiv float 1.000000e+01, %49
%51 = load float, float* %8
%52 = fmul float %50, %51
%53 = load i32, i32* %14
%54 = sitofp i32 %53 to float
%55 = fdiv float -1.000000e+01, %54
%56 = load float, float* %9
%57 = fmul float %55, %56
%58 = load i32, i32* %13
%59 = sitofp i32 %58 to float
%60 = fdiv float 1.000000e+01, %59
%61 = load float, float* %8
%62 = fmul float %60, %61
%63 = load i32, i32* %14
%64 = sitofp i32 %63 to float
%65 = fdiv float -1.000000e+01, %64
%66 = load float, float* %9
%67 = fmul float %65, %66
%68 = call i32 @gluLookAt(float %52, float %57, float 1.200000e+01, float %62, float %67, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00)
%69 = load float, float* %11
%70 = fneg float %69
%71 = call i32 @glRotatef(float %70, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00)
%72 = load float, float* %12
%73 = call i32 @glRotatef(float %72, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00)
%74 = load i32, i32* @GL_QUADS
%75 = call i32 @glBegin(i32 %74)
%76 = call i32 @glTexCoord2f(float 0.000000e+00, float 1.000000e+00)
%77 = call i32 @glVertex2f(float -5.000000e+00, float -5.000000e+00)
%78 = call i32 @glTexCoord2f(float 1.000000e+00, float 1.000000e+00)
%79 = call i32 @glVertex2f(float 5.000000e+00, float -5.000000e+00)
%80 = call i32 @glTexCoord2f(float 1.000000e+00, float 0.000000e+00)
%81 = call i32 @glVertex2f(float 5.000000e+00, float 5.000000e+00)
%82 = call i32 @glTexCoord2f(float 0.000000e+00, float 0.000000e+00)
%83 = call i32 @glVertex2f(float -5.000000e+00, float 5.000000e+00)
%84 = call i32 (...) @glEnd()
%85 = call i32 @glUseProgramObjectARB(i32 0)
ret void
}

LLVM IR (-O2):
@GL_TRUE = global i32 0
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_QUADS = global i32 0
define void @renderScene(i32 %0, float %1, float %2, float %3, float %4, float %5) {
%7 = tail call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 5.000000e-01, float 0.000000e+00)
%8 = load i32, i32* @GL_TRUE
%9 = tail call i32 @glColorMask(i32 %8, i32 %8, i32 %8, i32 %8)
%10 = load i32, i32* @GL_COLOR_BUFFER_BIT
%11 = tail call i32 @glClear(i32 %10)
%12 = load i32, i32* @GL_PROJECTION
%13 = tail call i32 @glMatrixMode(i32 %12)
%14 = tail call i32 (...) @glLoadIdentity()
%15 = fdiv float 4.500000e+01, %3
%16 = tail call i32 @gluPerspective(float %15, i32 poison, float 1.000000e+00, float 1.000000e+02)
%17 = tail call i32 @glViewport(i32 0, i32 0, i32 undef, i32 undef)
%18 = load i32, i32* @GL_MODELVIEW
%19 = tail call i32 @glMatrixMode(i32 %18)
%20 = tail call i32 (...) @glLoadIdentity()
%21 = tail call i32 @glUseProgramObjectARB(i32 %0)
%22 = fmul float %1, 0x7FF0000000000000
%23 = fmul float %2, 0xFFF0000000000000
%24 = tail call i32 @gluLookAt(float %22, float %23, float 1.200000e+01, float %22, float %23, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00)
%25 = fneg float %4
%26 = tail call i32 @glRotatef(float %25, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00)
%27 = tail call i32 @glRotatef(float %5, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00)
%28 = load i32, i32* @GL_QUADS
%29 = tail call i32 @glBegin(i32 %28)
%30 = tail call i32 @glTexCoord2f(float 0.000000e+00, float 1.000000e+00)
%31 = tail call i32 @glVertex2f(float -5.000000e+00, float -5.000000e+00)
%32 = tail call i32 @glTexCoord2f(float 1.000000e+00, float 1.000000e+00)
%33 = tail call i32 @glVertex2f(float 5.000000e+00, float -5.000000e+00)
%34 = tail call i32 @glTexCoord2f(float 1.000000e+00, float 0.000000e+00)
%35 = tail call i32 @glVertex2f(float 5.000000e+00, float 5.000000e+00)
%36 = tail call i32 @glTexCoord2f(float 0.000000e+00, float 0.000000e+00)
%37 = tail call i32 @glVertex2f(float -5.000000e+00, float 5.000000e+00)
%38 = tail call i32 (...) @glEnd()
%39 = tail call i32 @glUseProgramObjectARB(i32 0)
ret void
}