#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 GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ GL_POLYGON;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3fv(int const *);
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glRotatef(int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ glVertex3f(int, int, int const);
int /*<<< orphan*/ glViewport(int, int, int, int);
int /*<<< orphan*/ glutSolidIcosahedron();
void DrawObject(int x, int y, int w, int h, const GLfloat *color) {
  const GLfloat z = -1;
  glViewport(x, y, w, h);
  glDisable(GL_LIGHTING);
  glColor3fv(color);
  glBegin(GL_POLYGON);
  glVertex3f(-1, -1, z);
  glVertex3f(1, -1, z);
  glVertex3f(1, 1, z);
  glVertex3f(-1, 1, z);
  glEnd();
  glEnable(GL_LIGHTING);
  glPushMatrix();
  glRotatef(30, 1, 0, 0);
  glRotatef(30, 0, 1, 0);
  glutSolidIcosahedron();
  glPopMatrix();
}


x86 assembly (clang, -O0):
<DrawObject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   10d0 <glViewport@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
call   10a0 <glDisable@plt>
mov    -0x18(%rbp),%rdi
call   1030 <glColor3fv@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
call   10b0 <glBegin@plt>
mov    $0xffffffff,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1040 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0xffffffff,%edx
mov    %edx,%esi
call   1040 <glVertex3f@plt>
mov    $0x1,%esi
mov    $0xffffffff,%edx
mov    %esi,%edi
call   1040 <glVertex3f@plt>
mov    $0xffffffff,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1040 <glVertex3f@plt>
mov    $0x0,%al
call   1060 <glEnd@plt>
mov    0x2d84(%rip),%rax
mov    (%rax),%edi
call   1050 <glEnable@plt>
mov    $0x0,%al
call   1080 <glPushMatrix@plt>
mov    $0x1e,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   10c0 <glRotatef@plt>
mov    $0x1e,%edi
xor    %ecx,%ecx
mov    $0x1,%edx
mov    %ecx,%esi
call   10c0 <glRotatef@plt>
mov    $0x0,%al
call   1090 <glutSolidIcosahedron@plt>
mov    $0x0,%al
call   1070 <glPopMatrix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawObject>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%rbx
call   10d0 <glViewport@plt>
mov    0x2e15(%rip),%r14
mov    (%r14),%edi
call   10a0 <glDisable@plt>
mov    %rbx,%rdi
call   1030 <glColor3fv@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
call   10b0 <glBegin@plt>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
call   1040 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
call   1040 <glVertex3f@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
call   1040 <glVertex3f@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
call   1040 <glVertex3f@plt>
xor    %eax,%eax
call   1060 <glEnd@plt>
mov    (%r14),%edi
call   1050 <glEnable@plt>
xor    %eax,%eax
call   1080 <glPushMatrix@plt>
mov    $0x1e,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   10c0 <glRotatef@plt>
mov    $0x1e,%edi
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   10c0 <glRotatef@plt>
xor    %eax,%eax
call   1090 <glutSolidIcosahedron@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <glPopMatrix@plt>

LLVM IR (-O0):
@GL_LIGHTING = global i32 0
@GL_POLYGON = global i32 0
define void @DrawObject(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
store i32 -1, i32* %11
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = call i32 @glViewport(i32 %12, i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* @GL_LIGHTING
%18 = call i32 @glDisable(i32 %17)
%19 = load i32*, i32** %10
%20 = call i32 @glColor3fv(i32* %19)
%21 = load i32, i32* @GL_POLYGON
%22 = call i32 @glBegin(i32 %21)
%23 = call i32 @glVertex3f(i32 -1, i32 -1, i32 -1)
%24 = call i32 @glVertex3f(i32 1, i32 -1, i32 -1)
%25 = call i32 @glVertex3f(i32 1, i32 1, i32 -1)
%26 = call i32 @glVertex3f(i32 -1, i32 1, i32 -1)
%27 = call i32 (...) @glEnd()
%28 = load i32, i32* @GL_LIGHTING
%29 = call i32 @glEnable(i32 %28)
%30 = call i32 (...) @glPushMatrix()
%31 = call i32 @glRotatef(i32 30, i32 1, i32 0, i32 0)
%32 = call i32 @glRotatef(i32 30, i32 0, i32 1, i32 0)
%33 = call i32 (...) @glutSolidIcosahedron()
%34 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
@GL_LIGHTING = global i32 0
@GL_POLYGON = global i32 0
define void @DrawObject(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = tail call i32 @glViewport(i32 %0, i32 %1, i32 %2, i32 %3)
%7 = load i32, i32* @GL_LIGHTING
%8 = tail call i32 @glDisable(i32 %7)
%9 = tail call i32 @glColor3fv(i32* %4)
%10 = load i32, i32* @GL_POLYGON
%11 = tail call i32 @glBegin(i32 %10)
%12 = tail call i32 @glVertex3f(i32 -1, i32 -1, i32 -1)
%13 = tail call i32 @glVertex3f(i32 1, i32 -1, i32 -1)
%14 = tail call i32 @glVertex3f(i32 1, i32 1, i32 -1)
%15 = tail call i32 @glVertex3f(i32 -1, i32 1, i32 -1)
%16 = tail call i32 (...) @glEnd()
%17 = load i32, i32* @GL_LIGHTING
%18 = tail call i32 @glEnable(i32 %17)
%19 = tail call i32 (...) @glPushMatrix()
%20 = tail call i32 @glRotatef(i32 30, i32 1, i32 0, i32 0)
%21 = tail call i32 @glRotatef(i32 30, i32 0, i32 1, i32 0)
%22 = tail call i32 (...) @glutSolidIcosahedron()
%23 = tail call i32 (...) @glPopMatrix()
ret void
}