#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_LINE;
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*/ makeModelPtr(int, void **, int);
scalar_t__ malloc(int);
void auxWireCone(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_LINE);
    gluCylinder(quadObj, base, 0.0, height, 15, 10);
    glEndList();
  } else {
    glCallList(displayList);
    free(sizeArray);
  }
}


x86 assembly (clang, -O0):
<auxWireCone>:
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   10b0 <findList@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    127f <auxWireCone+0xdf>
mov    -0x20(%rbp),%rsi
mov    $0x9,%edi
mov    $0x2,%edx
call   1060 <makeModelPtr@plt>
mov    %eax,%edi
mov    0x2da8(%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    0x2d9b(%rip),%rax
mov    (%rax),%esi
call   1070 <gluQuadricDrawStyle@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   10c0 <glEndList@plt>
jmp    1291 <auxWireCone+0xf1>
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):
<auxWireCone>:
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   10b0 <findList@plt>
test   %rax,%rax
je     11eb <auxWireCone+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    0x2dd4(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1050 <glNewList@plt>
xor    %eax,%eax
call   1040 <gluNewQuadric@plt>
mov    %rax,%rbx
mov    0x2dca(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1070 <gluQuadricDrawStyle@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    10c0 <glEndList@plt>

LLVM IR (-O0):
@GL_COMPILE_AND_EXECUTE = global i32 0
@GLU_LINE = global i32 0
define void @auxWireCone(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 %36
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_LINE
%30 = call i32 @gluQuadricDrawStyle(i32* %28, i32 %29)
%31 = load i32*, i32** %5
%32 = load i8*, i8** %3
%33 = load i8*, i8** %4
%34 = call i32 @gluCylinder(i32* %31, i8* %32, double 0.000000e+00, i8* %33, i32 15, i32 10)
%35 = call i32 (...) @glEndList()
br label %41
36: ; preds = %2
%37 = load i64, i64* %8
%38 = call i32 @glCallList(i64 %37)
%39 = load i8**, i8*** %6
%40 = call i32 @free(i8** %39)
br label %41
41: ; preds = %36, %22
ret void
}

LLVM IR (-O2):
@GL_COMPILE_AND_EXECUTE = global i32 0
@GLU_LINE = global i32 0
define void @auxWireCone(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 %17
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_LINE
%14 = tail call i32 @gluQuadricDrawStyle(i32* %12, i32 %13)
%15 = tail call i32 @gluCylinder(i32* %12, i8* %0, double 0.000000e+00, i8* %1, i32 15, i32 10)
%16 = tail call i32 (...) @glEndList()
br label %20
17: ; preds = %2
%18 = tail call i32 @glCallList(i64 %6)
%19 = tail call i32 @free(i8** %4)
br label %20
20: ; preds = %17, %8
ret void
}