#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*/ glColor3f(double, double, double);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glRotatef(int, double, double, double);
int /*<<< orphan*/ glTranslatef(double, double, int);
int /*<<< orphan*/ gluCylinder(int /*<<< orphan*/, double, double, double, int,
                               int);
int /*<<< orphan*/ gluNewQuadric();
int /*<<< orphan*/ glutSolidCone(double, double, int, int);
int /*<<< orphan*/ glutSolidCube(double);
void mainCastle() {
  int ztranslate = -1;
  glPushMatrix();
  glColor3f(0.8, 0.8, 0.8);
  glTranslatef(0, 1.3, -1);
  glRotatef(20, 0.0, 1.0, 0.0);
  glutSolidCube(1.8);
  glPopMatrix();
  glPushMatrix();
  glColor3f(0.8, 0.8, 0.8);
  glTranslatef(1.0, 1.7, ztranslate);
  glRotatef(-90., 1.0, 0.0, 0.0);
  gluCylinder(gluNewQuadric(), 0.5, 0.5, 1.0, 32, 32);
  glPopMatrix();
  glPushMatrix();
  glColor3f(0.65, 0.0, 0.0);
  glTranslatef(1.0, 2.7, ztranslate);
  glRotatef(-90., 1.0, 0.0, 0.0);
  glutSolidCone(0.70, 0.60, 20, 16);
  glPopMatrix();
  glPushMatrix();
  glColor3f(0.8, 0.8, 0.8);
  glTranslatef(1.0, 1.7, ztranslate);
  glRotatef(90, 1.0, 0.0, 0.0);
  glutSolidCone(0.5, 0.5, 20, 12);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<mainCastle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1080 <glPushMatrix@plt>
movsd  0xe6a(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1070 <glColor3f@plt>
xorps  %xmm0,%xmm0
movsd  0xe84(%rip),%xmm1
mov    $0xffffffff,%edi
call   10a0 <glTranslatef@plt>
mov    $0x14,%edi
xorps  %xmm2,%xmm2
movsd  0xe2a(%rip),%xmm1
movaps %xmm2,%xmm0
call   10b0 <glRotatef@plt>
movsd  0xe52(%rip),%xmm0
call   1050 <glutSolidCube@plt>
mov    $0x0,%al
call   1060 <glPopMatrix@plt>
mov    $0x0,%al
call   1080 <glPushMatrix@plt>
movsd  0xe0f(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1070 <glColor3f@plt>
mov    -0x4(%rbp),%edi
movsd  0xde9(%rip),%xmm0
movsd  0xde9(%rip),%xmm1
call   10a0 <glTranslatef@plt>
mov    $0xffffffa6,%edi
movsd  0xdcf(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   10b0 <glRotatef@plt>
mov    $0x0,%al
call   1040 <gluNewQuadric@plt>
mov    %eax,%edi
movsd  0xdab(%rip),%xmm1
movsd  0xdab(%rip),%xmm2
mov    $0x20,%edx
movaps %xmm1,%xmm0
mov    %edx,%esi
call   1090 <gluCylinder@plt>
mov    $0x0,%al
call   1060 <glPopMatrix@plt>
mov    $0x0,%al
call   1080 <glPushMatrix@plt>
movsd  0xdb6(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1070 <glColor3f@plt>
mov    -0x4(%rbp),%edi
movsd  0xd70(%rip),%xmm0
movsd  0xd90(%rip),%xmm1
call   10a0 <glTranslatef@plt>
mov    $0xffffffa6,%edi
movsd  0xd56(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   10b0 <glRotatef@plt>
movsd  0xd5b(%rip),%xmm0
movsd  0xd5b(%rip),%xmm1
mov    $0x14,%edi
mov    $0x10,%esi
call   1030 <glutSolidCone@plt>
mov    $0x0,%al
call   1060 <glPopMatrix@plt>
mov    $0x0,%al
call   1080 <glPushMatrix@plt>
movsd  0xd26(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1070 <glColor3f@plt>
mov    -0x4(%rbp),%edi
movsd  0xd00(%rip),%xmm0
movsd  0xd00(%rip),%xmm1
call   10a0 <glTranslatef@plt>
mov    $0x5a,%edi
movsd  0xce6(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   10b0 <glRotatef@plt>
movsd  0xccb(%rip),%xmm1
mov    $0x14,%edi
mov    $0xc,%esi
movaps %xmm1,%xmm0
call   1030 <glutSolidCone@plt>
mov    $0x0,%al
call   1060 <glPopMatrix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mainCastle>:
push   %rax
xor    %eax,%eax
call   1080 <glPushMatrix@plt>
movsd  0xe60(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1070 <glColor3f@plt>
movsd  0xe55(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    $0xffffffff,%edi
call   10a0 <glTranslatef@plt>
movsd  0xe48(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
mov    $0x14,%edi
call   10b0 <glRotatef@plt>
movsd  0xe38(%rip),%xmm0
call   1050 <glutSolidCube@plt>
xor    %eax,%eax
call   1060 <glPopMatrix@plt>
xor    %eax,%eax
call   1080 <glPushMatrix@plt>
movsd  0xe05(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1070 <glColor3f@plt>
movsd  0xe12(%rip),%xmm1
movsd  0xdfa(%rip),%xmm0
mov    $0xffffffff,%edi
call   10a0 <glTranslatef@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0xffffffa6,%edi
movsd  0xddd(%rip),%xmm0
call   10b0 <glRotatef@plt>
xor    %eax,%eax
call   1040 <gluNewQuadric@plt>
movsd  0xde1(%rip),%xmm0
mov    %eax,%edi
movaps %xmm0,%xmm1
movsd  0xdbc(%rip),%xmm2
mov    $0x20,%esi
mov    $0x20,%edx
call   1090 <gluCylinder@plt>
xor    %eax,%eax
call   1060 <glPopMatrix@plt>
xor    %eax,%eax
call   1080 <glPushMatrix@plt>
movsd  0xdb7(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1070 <glColor3f@plt>
movsd  0xdac(%rip),%xmm1
movsd  0xd7c(%rip),%xmm0
mov    $0xffffffff,%edi
call   10a0 <glTranslatef@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0xffffffa6,%edi
movsd  0xd5f(%rip),%xmm0
call   10b0 <glRotatef@plt>
movsd  0xd82(%rip),%xmm0
movsd  0xd82(%rip),%xmm1
mov    $0x14,%edi
mov    $0x10,%esi
call   1030 <glutSolidCone@plt>
xor    %eax,%eax
call   1060 <glPopMatrix@plt>
xor    %eax,%eax
call   1080 <glPushMatrix@plt>
movsd  0xd15(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1070 <glColor3f@plt>
movsd  0xd12(%rip),%xmm0
movsd  0xd1a(%rip),%xmm1
mov    $0xffffffff,%edi
call   10a0 <glTranslatef@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x5a,%edi
movsd  0xced(%rip),%xmm0
call   10b0 <glRotatef@plt>
movsd  0xcf8(%rip),%xmm0
movaps %xmm0,%xmm1
mov    $0x14,%edi
mov    $0xc,%esi
call   1030 <glutSolidCone@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <glPopMatrix@plt>

LLVM IR (-O0):
define void @mainCastle() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 (...) @glPushMatrix()
%3 = call i32 @glColor3f(double 8.000000e-01, double 8.000000e-01, double 8.000000e-01)
%4 = call i32 @glTranslatef(double 0.000000e+00, double 1.300000e+00, i32 -1)
%5 = call i32 @glRotatef(i32 20, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%6 = call i32 @glutSolidCube(double 1.800000e+00)
%7 = call i32 (...) @glPopMatrix()
%8 = call i32 (...) @glPushMatrix()
%9 = call i32 @glColor3f(double 8.000000e-01, double 8.000000e-01, double 8.000000e-01)
%10 = load i32, i32* %1
%11 = call i32 @glTranslatef(double 1.000000e+00, double 1.700000e+00, i32 %10)
%12 = call i32 @glRotatef(i32 -90, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%13 = call i32 (...) @gluNewQuadric()
%14 = call i32 @gluCylinder(i32 %13, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, i32 32, i32 32)
%15 = call i32 (...) @glPopMatrix()
%16 = call i32 (...) @glPushMatrix()
%17 = call i32 @glColor3f(double 6.500000e-01, double 0.000000e+00, double 0.000000e+00)
%18 = load i32, i32* %1
%19 = call i32 @glTranslatef(double 1.000000e+00, double 2.700000e+00, i32 %18)
%20 = call i32 @glRotatef(i32 -90, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%21 = call i32 @glutSolidCone(double 0x3FE6666666666666, double 6.000000e-01, i32 20, i32 16)
%22 = call i32 (...) @glPopMatrix()
%23 = call i32 (...) @glPushMatrix()
%24 = call i32 @glColor3f(double 8.000000e-01, double 8.000000e-01, double 8.000000e-01)
%25 = load i32, i32* %1
%26 = call i32 @glTranslatef(double 1.000000e+00, double 1.700000e+00, i32 %25)
%27 = call i32 @glRotatef(i32 90, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%28 = call i32 @glutSolidCone(double 5.000000e-01, double 5.000000e-01, i32 20, i32 12)
%29 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @mainCastle() {
%1 = tail call i32 (...) @glPushMatrix()
%2 = tail call i32 @glColor3f(double 8.000000e-01, double 8.000000e-01, double 8.000000e-01)
%3 = tail call i32 @glTranslatef(double 0.000000e+00, double 1.300000e+00, i32 -1)
%4 = tail call i32 @glRotatef(i32 20, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%5 = tail call i32 @glutSolidCube(double 1.800000e+00)
%6 = tail call i32 (...) @glPopMatrix()
%7 = tail call i32 (...) @glPushMatrix()
%8 = tail call i32 @glColor3f(double 8.000000e-01, double 8.000000e-01, double 8.000000e-01)
%9 = tail call i32 @glTranslatef(double 1.000000e+00, double 1.700000e+00, i32 -1)
%10 = tail call i32 @glRotatef(i32 -90, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%11 = tail call i32 (...) @gluNewQuadric()
%12 = tail call i32 @gluCylinder(i32 %11, double 5.000000e-01, double 5.000000e-01, double 1.000000e+00, i32 32, i32 32)
%13 = tail call i32 (...) @glPopMatrix()
%14 = tail call i32 (...) @glPushMatrix()
%15 = tail call i32 @glColor3f(double 6.500000e-01, double 0.000000e+00, double 0.000000e+00)
%16 = tail call i32 @glTranslatef(double 1.000000e+00, double 2.700000e+00, i32 -1)
%17 = tail call i32 @glRotatef(i32 -90, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%18 = tail call i32 @glutSolidCone(double 0x3FE6666666666666, double 6.000000e-01, i32 20, i32 16)
%19 = tail call i32 (...) @glPopMatrix()
%20 = tail call i32 (...) @glPushMatrix()
%21 = tail call i32 @glColor3f(double 8.000000e-01, double 8.000000e-01, double 8.000000e-01)
%22 = tail call i32 @glTranslatef(double 1.000000e+00, double 1.700000e+00, i32 -1)
%23 = tail call i32 @glRotatef(i32 90, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%24 = tail call i32 @glutSolidCone(double 5.000000e-01, double 5.000000e-01, i32 20, i32 12)
%25 = tail call i32 (...) @glPopMatrix()
ret void
}