#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 double GLdouble;

/* Variables and functions */
int /*<<< orphan*/ GL_COMPILE_AND_EXECUTE;
int /*<<< orphan*/ GL_TRIANGLES;
scalar_t__ findList(int, double *, int);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ glCallList(scalar_t__);
int /*<<< orphan*/ glEndList();
int /*<<< orphan*/ glNewList(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ makeModelPtr(int, double *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ octahedron(double *, double, int /*<<< orphan*/);
void auxSolidOctahedron(GLdouble radius) {
  GLdouble *sizeArray;
  GLuint displayList;
  static GLdouble center[3] = {0.0, 0.0, 0.0};
  sizeArray = (GLdouble *)malloc(sizeof(GLdouble) * 1);
  *sizeArray = radius;
  displayList = findList(16, sizeArray, 1);
  if (displayList == 0) {
    glNewList(makeModelPtr(16, sizeArray, 1), GL_COMPILE_AND_EXECUTE);
    octahedron(center, radius, GL_TRIANGLES);
    glEndList();
  } else {
    glCallList(displayList);
    free(sizeArray);
  }
}


x86 assembly (clang, -O0):
<auxSolidOctahedron>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x8,%edi
call   1080 <malloc@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rsi
mov    $0x10,%edi
mov    $0x1,%edx
call   1090 <findList@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1213 <auxSolidOctahedron+0x93>
mov    -0x10(%rbp),%rsi
mov    $0x10,%edi
mov    $0x1,%edx
call   1060 <makeModelPtr@plt>
mov    %eax,%edi
mov    0x2df2(%rip),%rax
mov    (%rax),%esi
call   1050 <glNewList@plt>
movsd  -0x8(%rbp),%xmm0
mov    0x2de7(%rip),%rax
mov    (%rax),%esi
lea    0x2e6e(%rip),%rdi
call   1040 <octahedron@plt>
mov    $0x0,%al
call   10a0 <glEndList@plt>
jmp    1225 <auxSolidOctahedron+0xa5>
mov    -0x18(%rbp),%rdi
call   1070 <glCallList@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auxSolidOctahedron>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x8,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rax)
mov    $0x10,%edi
mov    %rax,%rsi
mov    $0x1,%edx
call   1090 <findList@plt>
test   %rax,%rax
je     11ce <auxSolidOctahedron+0x4e>
mov    %rax,%rdi
call   1070 <glCallList@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <free@plt>
mov    $0x10,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1060 <makeModelPtr@plt>
mov    0x2df1(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1050 <glNewList@plt>
mov    0x2de9(%rip),%rax
mov    (%rax),%esi
lea    0x2e70(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1040 <octahedron@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    10a0 <glEndList@plt>

LLVM IR (-O0):
@auxSolidOctahedron.center = internal global [3 x double] zeroinitializer
@GL_COMPILE_AND_EXECUTE = global i32 0
@GL_TRIANGLES = global i32 0
define void @auxSolidOctahedron(double %0) {
%2 = alloca double
%3 = alloca double*
%4 = alloca i64
store double %0, double* %2
%5 = call i64 @malloc(i32 8)
%6 = inttoptr i64 %5 to double*
store double* %6, double** %3
%7 = load double, double* %2
%8 = load double*, double** %3
store double %7, double* %8
%9 = load double*, double** %3
%10 = call i64 @findList(i32 16, double* %9, i32 1)
store i64 %10, i64* %4
%11 = load i64, i64* %4
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %1
%14 = load double*, double** %3
%15 = call i32 @makeModelPtr(i32 16, double* %14, i32 1)
%16 = load i32, i32* @GL_COMPILE_AND_EXECUTE
%17 = call i32 @glNewList(i32 %15, i32 %16)
%18 = load double, double* %2
%19 = load i32, i32* @GL_TRIANGLES
%20 = call i32 @octahedron(double* getelementptr inbounds ([3 x double], [3 x double]* @auxSolidOctahedron.center, i64 0, i64 0), double %18, i32 %19)
%21 = call i32 (...) @glEndList()
br label %27
22: ; preds = %1
%23 = load i64, i64* %4
%24 = call i32 @glCallList(i64 %23)
%25 = load double*, double** %3
%26 = call i32 @free(double* %25)
br label %27
27: ; preds = %22, %13
ret void
}

LLVM IR (-O2):
@auxSolidOctahedron.center = internal global [3 x double] zeroinitializer
@GL_COMPILE_AND_EXECUTE = global i32 0
@GL_TRIANGLES = global i32 0
define void @auxSolidOctahedron(double %0) {
%2 = tail call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to double*
store double %0, double* %3
%4 = tail call i64 @findList(i32 16, double* %3, i32 1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = tail call i32 @makeModelPtr(i32 16, double* %3, i32 1)
%8 = load i32, i32* @GL_COMPILE_AND_EXECUTE
%9 = tail call i32 @glNewList(i32 %7, i32 %8)
%10 = load i32, i32* @GL_TRIANGLES
%11 = tail call i32 @octahedron(double* getelementptr inbounds ([3 x double], [3 x double]* @auxSolidOctahedron.center, i64 0, i64 0), double %0, i32 %10)
%12 = tail call i32 (...) @glEndList()
br label %16
13: ; preds = %1
%14 = tail call i32 @glCallList(i64 %4)
%15 = tail call i32 @free(double* %3)
br label %16
16: ; preds = %13, %6
ret void
}