#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 */

/* Variables and functions */
int /*<<< orphan*/ deleteAll();
int /*<<< orphan*/ initNode(int);
int /*<<< orphan*/ insert(int /*<<< orphan*/);
int /*<<< orphan*/ iterate();
int main(void) {
  int test[] = {8, 3, 2, 6, 1, 5, 4, 7, 9, 0};
  int i = 0;
  for (i = 0; i < 10; i++) {
    insert(initNode(test[i]));
  }
  iterate();
  deleteAll();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe96(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11ae <main+0x5e>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edi
call   1030 <initNode@plt>
mov    %eax,%edi
call   1060 <insert@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1182 <main+0x32>
mov    $0x0,%al
call   1070 <iterate@plt>
mov    $0x0,%al
call   1050 <deleteAll@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1030 <initNode@plt>
mov    %eax,%edi
call   1050 <insert@plt>
mov    $0x3,%edi
call   1030 <initNode@plt>
mov    %eax,%edi
call   1050 <insert@plt>
mov    $0x2,%edi
call   1030 <initNode@plt>
mov    %eax,%edi
call   1050 <insert@plt>
mov    $0x6,%edi
call   1030 <initNode@plt>
mov    %eax,%edi
call   1050 <insert@plt>
mov    $0x1,%edi
call   1030 <initNode@plt>
mov    %eax,%edi
call   1050 <insert@plt>
mov    $0x5,%edi
call   1030 <initNode@plt>
mov    %eax,%edi
call   1050 <insert@plt>
mov    $0x4,%edi
call   1030 <initNode@plt>
mov    %eax,%edi
call   1050 <insert@plt>
mov    $0x7,%edi
call   1030 <initNode@plt>
mov    %eax,%edi
call   1050 <insert@plt>
mov    $0x9,%edi
call   1030 <initNode@plt>
mov    %eax,%edi
call   1050 <insert@plt>
xor    %edi,%edi
call   1030 <initNode@plt>
mov    %eax,%edi
call   1050 <insert@plt>
xor    %eax,%eax
call   1060 <iterate@plt>
xor    %eax,%eax
call   1040 <deleteAll@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.test = [10 x i32] [i32 8, i32 3, i32 2, i32 6, i32 1, i32 5, i32 4, i32 7, i32 9, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
store i32 0, i32* %3
store i32 0, i32* %3
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = call i32 @initNode(i32 %12)
%14 = call i32 @insert(i32 %13)
br label %15
15: ; preds = %8
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = call i32 (...) @iterate()
%20 = call i32 (...) @deleteAll()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @initNode(i32 8)
%2 = tail call i32 @insert(i32 %1)
%3 = tail call i32 @initNode(i32 3)
%4 = tail call i32 @insert(i32 %3)
%5 = tail call i32 @initNode(i32 2)
%6 = tail call i32 @insert(i32 %5)
%7 = tail call i32 @initNode(i32 6)
%8 = tail call i32 @insert(i32 %7)
%9 = tail call i32 @initNode(i32 1)
%10 = tail call i32 @insert(i32 %9)
%11 = tail call i32 @initNode(i32 5)
%12 = tail call i32 @insert(i32 %11)
%13 = tail call i32 @initNode(i32 4)
%14 = tail call i32 @insert(i32 %13)
%15 = tail call i32 @initNode(i32 7)
%16 = tail call i32 @insert(i32 %15)
%17 = tail call i32 @initNode(i32 9)
%18 = tail call i32 @insert(i32 %17)
%19 = tail call i32 @initNode(i32 0)
%20 = tail call i32 @insert(i32 %19)
%21 = tail call i32 (...) @iterate()
%22 = tail call i32 (...) @deleteAll()
ret i32 0
}