#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 scalar_t__ GLuint;
typedef void *GLdouble;
typedef int /*<<< orphan*/ GLUquadricObj;

/* Variables and functions */
int /*<<< orphan*/ GLU_FILL;
int /*<<< orphan*/ GLU_SMOOTH;
int /*<<< orphan*/ GL_COMPILE_AND_EXECUTE;
scalar_t__ findList(int, void **, int);
int /*<<< orphan*/ free(void **);
int /*<<< orphan*/ glCallList(scalar_t__);
int /*<<< orphan*/ glEndList();
int /*<<< orphan*/ glNewList(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glRotatef(double, double, double, double);
int /*<<< orphan*/ glTranslatef(double, double, double);
int /*<<< orphan*/ gluCylinder(int /*<<< orphan*/ *, void *, void *, void *,
                               int, int);
int /*<<< orphan*/ *gluNewQuadric();
int /*<<< orphan*/ gluQuadricDrawStyle(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ gluQuadricNormals(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ makeModelPtr(int, void **, int);
scalar_t__ malloc(int);
void auxSolidCylinder(GLdouble radius, GLdouble height) {
  GLUquadricObj *quadObj;
  GLdouble *sizeArray, *tmp;
  GLuint displayList;
  sizeArray = (GLdouble *)malloc(sizeof(GLdouble) * 2);
  tmp = sizeArray;
  *tmp++ = radius;
  *tmp++ = height;
  displayList = findList(14, sizeArray, 2);
  if (displayList == 0) {
    glNewList(makeModelPtr(14, sizeArray, 2), GL_COMPILE_AND_EXECUTE);
    glPushMatrix();
    glRotatef(90.0, 1.0, 0.0, 0.0);
    glTranslatef(0.0, 0.0, -1.0);
    quadObj = gluNewQuadric();
    gluQuadricDrawStyle(quadObj, GLU_FILL);
    gluQuadricNormals(quadObj, GLU_SMOOTH);
    gluCylinder(quadObj, radius, radius, height, 12, 2);
    glPopMatrix();
    glEndList();
  } else {
    glCallList(displayList);
    free(sizeArray);
  }
}


x86 assembly (clang, -O0):
<auxSolidCylinder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x10,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x28(%rbp)
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x28(%rbp)
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rsi
mov    $0xe,%edi
mov    $0x2,%edx
call   10f0 <findList@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    131f <auxSolidCylinder+0x12f>
mov    -0x20(%rbp),%rsi
mov    $0xe,%edi
mov    $0x2,%edx
call   1070 <makeModelPtr@plt>
mov    %eax,%edi
mov    0x2d50(%rip),%rax
mov    (%rax),%esi
call   1050 <glNewList@plt>
mov    $0x0,%al
call   1090 <glPushMatrix@plt>
movsd  0xd72(%rip),%xmm0
movsd  0xd72(%rip),%xmm1
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm2
call   1100 <glRotatef@plt>
xorps  %xmm1,%xmm1
movsd  0xd4c(%rip),%xmm2
movaps %xmm1,%xmm0
call   10e0 <glTranslatef@plt>
mov    $0x0,%al
call   1040 <gluNewQuadric@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d06(%rip),%rax
mov    (%rax),%esi
call   1080 <gluQuadricDrawStyle@plt>
mov    -0x18(%rbp),%rdi
mov    0x2d04(%rip),%rax
mov    (%rax),%esi
call   10d0 <gluQuadricNormals@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0xc,%r8d
mov    $0x2,%r9d
call   10c0 <gluCylinder@plt>
mov    $0x0,%al
call   1060 <glPopMatrix@plt>
mov    $0x0,%al
call   1110 <glEndList@plt>
jmp    1331 <auxSolidCylinder+0x141>
mov    -0x30(%rbp),%rdi
call   10a0 <glCallList@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auxSolidCylinder>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x10,%edi
call   10b0 <malloc@plt>
mov    %rax,%rbx
mov    %r15,(%rax)
mov    %r14,0x8(%rax)
mov    $0xe,%edi
mov    %rax,%rsi
mov    $0x2,%edx
call   10f0 <findList@plt>
test   %rax,%rax
je     123b <auxSolidCylinder+0x4b>
mov    %rax,%rdi
call   10a0 <glCallList@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>
mov    $0xe,%edi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1070 <makeModelPtr@plt>
mov    0x2d7c(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1050 <glNewList@plt>
xor    %eax,%eax
call   1090 <glPushMatrix@plt>
movsd  0xd94(%rip),%xmm0
movsd  0xd94(%rip),%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1100 <glRotatef@plt>
movsd  0xd89(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   10e0 <glTranslatef@plt>
xor    %eax,%eax
call   1040 <gluNewQuadric@plt>
mov    %rax,%rbx
mov    0x2d35(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1080 <gluQuadricDrawStyle@plt>
mov    0x2d34(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   10d0 <gluQuadricNormals@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    $0xc,%r8d
mov    $0x2,%r9d
call   10c0 <gluCylinder@plt>
xor    %eax,%eax
call   1060 <glPopMatrix@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1110 <glEndList@plt>

LLVM IR (-O0):
@GL_COMPILE_AND_EXECUTE = global i32 0
@GLU_FILL = global i32 0
@GLU_SMOOTH = global i32 0
define void @auxSolidCylinder(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = call i64 @malloc(i32 16)
%10 = inttoptr i64 %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %6
store i8** %11, i8*** %7
%12 = load i8*, i8** %3
%13 = load i8**, i8*** %7
%14 = getelementptr inbounds i8*, i8** %13, i32 1
store i8** %14, i8*** %7
store i8* %12, i8** %13
%15 = load i8*, i8** %4
%16 = load i8**, i8*** %7
%17 = getelementptr inbounds i8*, i8** %16, i32 1
store i8** %17, i8*** %7
store i8* %15, i8** %16
%18 = load i8**, i8*** %6
%19 = call i64 @findList(i32 14, i8** %18, i32 2)
store i64 %19, i64* %8
%20 = load i64, i64* %8
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %44
22: ; preds = %2
%23 = load i8**, i8*** %6
%24 = call i32 @makeModelPtr(i32 14, i8** %23, i32 2)
%25 = load i32, i32* @GL_COMPILE_AND_EXECUTE
%26 = call i32 @glNewList(i32 %24, i32 %25)
%27 = call i32 (...) @glPushMatrix()
%28 = call i32 @glRotatef(double 9.000000e+01, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%29 = call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double -1.000000e+00)
%30 = call i32* (...) @gluNewQuadric()
store i32* %30, i32** %5
%31 = load i32*, i32** %5
%32 = load i32, i32* @GLU_FILL
%33 = call i32 @gluQuadricDrawStyle(i32* %31, i32 %32)
%34 = load i32*, i32** %5
%35 = load i32, i32* @GLU_SMOOTH
%36 = call i32 @gluQuadricNormals(i32* %34, i32 %35)
%37 = load i32*, i32** %5
%38 = load i8*, i8** %3
%39 = load i8*, i8** %3
%40 = load i8*, i8** %4
%41 = call i32 @gluCylinder(i32* %37, i8* %38, i8* %39, i8* %40, i32 12, i32 2)
%42 = call i32 (...) @glPopMatrix()
%43 = call i32 (...) @glEndList()
br label %49
44: ; preds = %2
%45 = load i64, i64* %8
%46 = call i32 @glCallList(i64 %45)
%47 = load i8**, i8*** %6
%48 = call i32 @free(i8** %47)
br label %49
49: ; preds = %44, %22
ret void
}

LLVM IR (-O2):
@GL_COMPILE_AND_EXECUTE = global i32 0
@GLU_FILL = global i32 0
@GLU_SMOOTH = global i32 0
define void @auxSolidCylinder(i8* %0, i8* %1) {
%3 = tail call i64 @malloc(i32 16)
%4 = inttoptr i64 %3 to i8**
%5 = getelementptr inbounds i8*, i8** %4, i64 1
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = tail call i64 @findList(i32 14, i8** %4, i32 2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %2
%9 = tail call i32 @makeModelPtr(i32 14, i8** %4, i32 2)
%10 = load i32, i32* @GL_COMPILE_AND_EXECUTE
%11 = tail call i32 @glNewList(i32 %9, i32 %10)
%12 = tail call i32 (...) @glPushMatrix()
%13 = tail call i32 @glRotatef(double 9.000000e+01, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%14 = tail call i32 @glTranslatef(double 0.000000e+00, double 0.000000e+00, double -1.000000e+00)
%15 = tail call i32* (...) @gluNewQuadric()
%16 = load i32, i32* @GLU_FILL
%17 = tail call i32 @gluQuadricDrawStyle(i32* %15, i32 %16)
%18 = load i32, i32* @GLU_SMOOTH
%19 = tail call i32 @gluQuadricNormals(i32* %15, i32 %18)
%20 = tail call i32 @gluCylinder(i32* %15, i8* %0, i8* %0, i8* %1, i32 12, i32 2)
%21 = tail call i32 (...) @glPopMatrix()
%22 = tail call i32 (...) @glEndList()
br label %26
23: ; preds = %2
%24 = tail call i32 @glCallList(i64 %6)
%25 = tail call i32 @free(i8** %4)
br label %26
26: ; preds = %23, %8
ret void
}