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

/* Variables and functions */
int /*<<< orphan*/ GL_COMPILE_AND_EXECUTE;
int /*<<< orphan*/ GL_LINE_LOOP;
int /*<<< orphan*/ drawbox(int, int, int, int, int, int, int /*<<< orphan*/);
scalar_t__ findList(int, int *, int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ glCallList(scalar_t__);
int /*<<< orphan*/ glEndList();
int /*<<< orphan*/ glNewList(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ makeModelPtr(int, int *, int);
scalar_t__ malloc(int);
void auxWireCube(GLdouble size) {
  GLdouble *sizeArray;
  GLuint displayList;
  sizeArray = (GLdouble *)malloc(sizeof(GLdouble) * 1);
  *sizeArray = size;
  displayList = findList(1, sizeArray, 1);
  if (displayList == 0) {
    glNewList(makeModelPtr(1, sizeArray, 1), GL_COMPILE_AND_EXECUTE);
    drawbox(-size / 2., size / 2., -size / 2., size / 2., -size / 2., size / 2.,
            GL_LINE_LOOP);
    glEndList();
  } else {
    glCallList(displayList);
    free(sizeArray);
  }
}


x86 assembly (clang, -O0):
<auxWireCube>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1070 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1090 <findList@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    128a <auxWireCube+0x10a>
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1050 <makeModelPtr@plt>
mov    %eax,%edi
mov    0x2dfe(%rip),%rax
mov    (%rax),%esi
call   1040 <glNewList@plt>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe0e(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xdf9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
xor    %eax,%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xde0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edx
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xdcb(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
xor    %eax,%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xdb2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r8d
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xd9c(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r9d
mov    0x2d74(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
call   1080 <drawbox@plt>
mov    $0x0,%al
call   10a0 <glEndList@plt>
jmp    129c <auxWireCube+0x11c>
mov    -0x18(%rbp),%rdi
call   1060 <glCallList@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auxWireCube>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x4,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,(%rax)
mov    $0x1,%edi
mov    %rax,%rsi
mov    $0x1,%edx
call   1090 <findList@plt>
test   %rax,%rax
je     11c1 <auxWireCube+0x41>
mov    %rax,%rdi
call   1060 <glCallList@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <makeModelPtr@plt>
mov    0x2dfe(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <glNewList@plt>
cvtsi2sd %ebp,%xmm0
neg    %ebp
cvtsi2sd %ebp,%xmm1
movsd  0xe0b(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
mulsd  %xmm2,%xmm0
cvttsd2si %xmm0,%ecx
mov    0x2ddc(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    %ecx,%esi
mov    %edi,%edx
mov    %edi,%r8d
mov    %ecx,%r9d
call   1080 <drawbox@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    10a0 <glEndList@plt>

LLVM IR (-O0):
@GL_COMPILE_AND_EXECUTE = global i32 0
@GL_LINE_LOOP = global i32 0
define void @auxWireCube(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i64
store i32 %0, i32* %2
%5 = call i64 @malloc(i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32, i32* %2
%8 = load i32*, i32** %3
store i32 %7, i32* %8
%9 = load i32*, i32** %3
%10 = call i64 @findList(i32 1, i32* %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 %48
13: ; preds = %1
%14 = load i32*, i32** %3
%15 = call i32 @makeModelPtr(i32 1, i32* %14, i32 1)
%16 = load i32, i32* @GL_COMPILE_AND_EXECUTE
%17 = call i32 @glNewList(i32 %15, i32 %16)
%18 = load i32, i32* %2
%19 = sub nsw i32 0, %18
%20 = sitofp i32 %19 to double
%21 = fdiv double %20, 2.000000e+00
%22 = fptosi double %21 to i32
%23 = load i32, i32* %2
%24 = sitofp i32 %23 to double
%25 = fdiv double %24, 2.000000e+00
%26 = fptosi double %25 to i32
%27 = load i32, i32* %2
%28 = sub nsw i32 0, %27
%29 = sitofp i32 %28 to double
%30 = fdiv double %29, 2.000000e+00
%31 = fptosi double %30 to i32
%32 = load i32, i32* %2
%33 = sitofp i32 %32 to double
%34 = fdiv double %33, 2.000000e+00
%35 = fptosi double %34 to i32
%36 = load i32, i32* %2
%37 = sub nsw i32 0, %36
%38 = sitofp i32 %37 to double
%39 = fdiv double %38, 2.000000e+00
%40 = fptosi double %39 to i32
%41 = load i32, i32* %2
%42 = sitofp i32 %41 to double
%43 = fdiv double %42, 2.000000e+00
%44 = fptosi double %43 to i32
%45 = load i32, i32* @GL_LINE_LOOP
%46 = call i32 @drawbox(i32 %22, i32 %26, i32 %31, i32 %35, i32 %40, i32 %44, i32 %45)
%47 = call i32 (...) @glEndList()
br label %53
48: ; preds = %1
%49 = load i64, i64* %4
%50 = call i32 @glCallList(i64 %49)
%51 = load i32*, i32** %3
%52 = call i32 @free(i32* %51)
br label %53
53: ; preds = %48, %13
ret void
}

LLVM IR (-O2):
@GL_COMPILE_AND_EXECUTE = global i32 0
@GL_LINE_LOOP = global i32 0
define void @auxWireCube(i32 %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32 %0, i32* %3
%4 = tail call i64 @findList(i32 1, i32* %3, i32 1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %20
6: ; preds = %1
%7 = tail call i32 @makeModelPtr(i32 1, i32* %3, i32 1)
%8 = load i32, i32* @GL_COMPILE_AND_EXECUTE
%9 = tail call i32 @glNewList(i32 %7, i32 %8)
%10 = sub nsw i32 0, %0
%11 = sitofp i32 %10 to double
%12 = fmul double %11, 5.000000e-01
%13 = fptosi double %12 to i32
%14 = sitofp i32 %0 to double
%15 = fmul double %14, 5.000000e-01
%16 = fptosi double %15 to i32
%17 = load i32, i32* @GL_LINE_LOOP
%18 = tail call i32 @drawbox(i32 %13, i32 %16, i32 %13, i32 %16, i32 %13, i32 %16, i32 %17)
%19 = tail call i32 (...) @glEndList()
br label %23
20: ; preds = %1
%21 = tail call i32 @glCallList(i64 %4)
%22 = tail call i32 @free(i32* %3)
br label %23
23: ; preds = %20, %6
ret void
}