#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*/ gluCylinder(int /*<<< orphan*/ *, void *, double, 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 auxSolidCone(GLdouble base, GLdouble height) {
  GLUquadricObj *quadObj;
  GLdouble *sizeArray, *tmp;
  GLuint displayList;
  sizeArray = (GLdouble *)malloc(sizeof(GLdouble) * 2);
  tmp = sizeArray;
  *tmp++ = base;
  *tmp++ = height;
  displayList = findList(9, sizeArray, 2);
  if (displayList == 0) {
    glNewList(makeModelPtr(9, sizeArray, 2), GL_COMPILE_AND_EXECUTE);
    quadObj = gluNewQuadric();
    gluQuadricDrawStyle(quadObj, GLU_FILL);
    gluQuadricNormals(quadObj, GLU_SMOOTH);
    gluCylinder(quadObj, base, 0.0, height, 15, 10);
    glEndList();
  } else {
    glCallList(displayList);
    free(sizeArray);
  }
}


x86 assembly (clang, -O0):
<auxSolidCone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x10,%edi
call   1090 <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    $0x9,%edi
mov    $0x2,%edx
call   10c0 <findList@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    12a1 <auxSolidCone+0xf1>
mov    -0x20(%rbp),%rsi
mov    $0x9,%edi
mov    $0x2,%edx
call   1060 <makeModelPtr@plt>
mov    %eax,%edi
mov    0x2d90(%rip),%rax
mov    (%rax),%esi
call   1050 <glNewList@plt>
mov    $0x0,%al
call   1040 <gluNewQuadric@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d7b(%rip),%rax
mov    (%rax),%esi
call   1070 <gluQuadricDrawStyle@plt>
mov    -0x18(%rbp),%rdi
mov    0x2d79(%rip),%rax
mov    (%rax),%esi
call   10b0 <gluQuadricNormals@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xorps  %xmm0,%xmm0
mov    $0xf,%ecx
mov    $0xa,%r8d
call   10a0 <gluCylinder@plt>
mov    $0x0,%al
call   10d0 <glEndList@plt>
jmp    12b3 <auxSolidCone+0x103>
mov    -0x30(%rbp),%rdi
call   1080 <glCallList@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auxSolidCone>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x10,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    %r15,(%rax)
mov    %r14,0x8(%rax)
mov    $0x9,%edi
mov    %rax,%rsi
mov    $0x2,%edx
call   10c0 <findList@plt>
test   %rax,%rax
je     11fb <auxSolidCone+0x4b>
mov    %rax,%rdi
call   1080 <glCallList@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>
mov    $0x9,%edi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1060 <makeModelPtr@plt>
mov    0x2dbc(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1050 <glNewList@plt>
xor    %eax,%eax
call   1040 <gluNewQuadric@plt>
mov    %rax,%rbx
mov    0x2daa(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1070 <gluQuadricDrawStyle@plt>
mov    0x2da9(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   10b0 <gluQuadricNormals@plt>
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0xf,%ecx
mov    $0xa,%r8d
call   10a0 <gluCylinder@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    10d0 <glEndList@plt>

LLVM IR (-O0):
@GL_COMPILE_AND_EXECUTE = global i32 0
@GLU_FILL = global i32 0
@GLU_SMOOTH = global i32 0
define void @auxSolidCone(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 9, 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 %39
22: ; preds = %2
%23 = load i8**, i8*** %6
%24 = call i32 @makeModelPtr(i32 9, i8** %23, i32 2)
%25 = load i32, i32* @GL_COMPILE_AND_EXECUTE
%26 = call i32 @glNewList(i32 %24, i32 %25)
%27 = call i32* (...) @gluNewQuadric()
store i32* %27, i32** %5
%28 = load i32*, i32** %5
%29 = load i32, i32* @GLU_FILL
%30 = call i32 @gluQuadricDrawStyle(i32* %28, i32 %29)
%31 = load i32*, i32** %5
%32 = load i32, i32* @GLU_SMOOTH
%33 = call i32 @gluQuadricNormals(i32* %31, i32 %32)
%34 = load i32*, i32** %5
%35 = load i8*, i8** %3
%36 = load i8*, i8** %4
%37 = call i32 @gluCylinder(i32* %34, i8* %35, double 0.000000e+00, i8* %36, i32 15, i32 10)
%38 = call i32 (...) @glEndList()
br label %44
39: ; preds = %2
%40 = load i64, i64* %8
%41 = call i32 @glCallList(i64 %40)
%42 = load i8**, i8*** %6
%43 = call i32 @free(i8** %42)
br label %44
44: ; preds = %39, %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 @auxSolidCone(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 9, i8** %4, i32 2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = tail call i32 @makeModelPtr(i32 9, 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* (...) @gluNewQuadric()
%13 = load i32, i32* @GLU_FILL
%14 = tail call i32 @gluQuadricDrawStyle(i32* %12, i32 %13)
%15 = load i32, i32* @GLU_SMOOTH
%16 = tail call i32 @gluQuadricNormals(i32* %12, i32 %15)
%17 = tail call i32 @gluCylinder(i32* %12, i8* %0, double 0.000000e+00, i8* %1, i32 15, i32 10)
%18 = tail call i32 (...) @glEndList()
br label %22
19: ; preds = %2
%20 = tail call i32 @glCallList(i64 %6)
%21 = tail call i32 @free(i8** %4)
br label %22
22: ; preds = %19, %8
ret void
}