#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*/ Delete_At_Beginning();
int /*<<< orphan*/ Delete_At_End();
int /*<<< orphan*/ Delete_With_Value(int);
int /*<<< orphan*/ Insert_After_Value(int, int);
int /*<<< orphan*/ Insert_At_Beginning(int);
int /*<<< orphan*/ Insert_At_End(int);
int /*<<< orphan*/ Length_Iterative();
int /*<<< orphan*/ Length_Recursive();
int /*<<< orphan*/ Print_Linked_List();
int /*<<< orphan*/ Search(int);
int main() {
  int i;
  for (i = 0; i < 5; i++)
    Insert_At_Beginning(i);
  Print_Linked_List();
  for (i = 5; i < 10; i++)
    Insert_At_End(i);
  Print_Linked_List();
  Insert_After_Value(5, 9);
  Insert_After_Value(10, 9);
  Print_Linked_List();
  for (i = 0; i < 3; i++)
    Delete_At_End();
  Print_Linked_List();
  for (i = 0; i < 3; i++)
    Delete_At_Beginning();
  Print_Linked_List();
  Delete_With_Value(1);
  Delete_With_Value(5);
  Print_Linked_List();
  Search(6);
  Search(8);
  Length_Iterative();
  Length_Recursive();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11d6 <main+0x36>
mov    -0x8(%rbp),%edi
call   1060 <Insert_At_Beginning@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b6 <main+0x16>
mov    $0x0,%al
call   1030 <Print_Linked_List@plt>
movl   $0x5,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1204 <main+0x64>
mov    -0x8(%rbp),%edi
call   1050 <Insert_At_End@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e4 <main+0x44>
mov    $0x0,%al
call   1030 <Print_Linked_List@plt>
mov    $0x5,%edi
mov    $0x9,%esi
call   1040 <Insert_After_Value@plt>
mov    $0xa,%edi
mov    $0x9,%esi
call   1040 <Insert_After_Value@plt>
mov    $0x0,%al
call   1030 <Print_Linked_List@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1256 <main+0xb6>
mov    $0x0,%al
call   10b0 <Delete_At_End@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1237 <main+0x97>
mov    $0x0,%al
call   1030 <Print_Linked_List@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1283 <main+0xe3>
mov    $0x0,%al
call   10a0 <Delete_At_Beginning@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1264 <main+0xc4>
mov    $0x0,%al
call   1030 <Print_Linked_List@plt>
mov    $0x1,%edi
call   1070 <Delete_With_Value@plt>
mov    $0x5,%edi
call   1070 <Delete_With_Value@plt>
mov    $0x0,%al
call   1030 <Print_Linked_List@plt>
mov    $0x6,%edi
call   10c0 <Search@plt>
mov    $0x8,%edi
call   10c0 <Search@plt>
mov    $0x0,%al
call   1080 <Length_Iterative@plt>
mov    $0x0,%al
call   1090 <Length_Recursive@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <Insert_At_Beginning@plt>
mov    $0x1,%edi
call   1060 <Insert_At_Beginning@plt>
mov    $0x2,%edi
call   1060 <Insert_At_Beginning@plt>
mov    $0x3,%edi
call   1060 <Insert_At_Beginning@plt>
mov    $0x4,%edi
call   1060 <Insert_At_Beginning@plt>
xor    %eax,%eax
call   1030 <Print_Linked_List@plt>
mov    $0x5,%edi
call   1050 <Insert_At_End@plt>
mov    $0x6,%edi
call   1050 <Insert_At_End@plt>
mov    $0x7,%edi
call   1050 <Insert_At_End@plt>
mov    $0x8,%edi
call   1050 <Insert_At_End@plt>
mov    $0x9,%edi
call   1050 <Insert_At_End@plt>
xor    %eax,%eax
call   1030 <Print_Linked_List@plt>
mov    $0x5,%edi
mov    $0x9,%esi
call   1040 <Insert_After_Value@plt>
mov    $0xa,%edi
mov    $0x9,%esi
call   1040 <Insert_After_Value@plt>
xor    %eax,%eax
call   1030 <Print_Linked_List@plt>
xor    %eax,%eax
call   10b0 <Delete_At_End@plt>
xor    %eax,%eax
call   10b0 <Delete_At_End@plt>
xor    %eax,%eax
call   10b0 <Delete_At_End@plt>
xor    %eax,%eax
call   1030 <Print_Linked_List@plt>
xor    %eax,%eax
call   10a0 <Delete_At_Beginning@plt>
xor    %eax,%eax
call   10a0 <Delete_At_Beginning@plt>
xor    %eax,%eax
call   10a0 <Delete_At_Beginning@plt>
xor    %eax,%eax
call   1030 <Print_Linked_List@plt>
mov    $0x1,%edi
call   1070 <Delete_With_Value@plt>
mov    $0x5,%edi
call   1070 <Delete_With_Value@plt>
xor    %eax,%eax
call   1030 <Print_Linked_List@plt>
mov    $0x6,%edi
call   10c0 <Search@plt>
mov    $0x8,%edi
call   10c0 <Search@plt>
xor    %eax,%eax
call   1080 <Length_Iterative@plt>
xor    %eax,%eax
call   1090 <Length_Recursive@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @Insert_At_Beginning(i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = call i32 (...) @Print_Linked_List()
store i32 5, i32* %2
br label %14
14: ; preds = %20, %12
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 10
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* %2
%19 = call i32 @Insert_At_End(i32 %18)
br label %20
20: ; preds = %17
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %14
23: ; preds = %14
%24 = call i32 (...) @Print_Linked_List()
%25 = call i32 @Insert_After_Value(i32 5, i32 9)
%26 = call i32 @Insert_After_Value(i32 10, i32 9)
%27 = call i32 (...) @Print_Linked_List()
store i32 0, i32* %2
br label %28
28: ; preds = %33, %23
%29 = load i32, i32* %2
%30 = icmp slt i32 %29, 3
br i1 %30, label %31, label %36
31: ; preds = %28
%32 = call i32 (...) @Delete_At_End()
br label %33
33: ; preds = %31
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %28
36: ; preds = %28
%37 = call i32 (...) @Print_Linked_List()
store i32 0, i32* %2
br label %38
38: ; preds = %43, %36
%39 = load i32, i32* %2
%40 = icmp slt i32 %39, 3
br i1 %40, label %41, label %46
41: ; preds = %38
%42 = call i32 (...) @Delete_At_Beginning()
br label %43
43: ; preds = %41
%44 = load i32, i32* %2
%45 = add nsw i32 %44, 1
store i32 %45, i32* %2
br label %38
46: ; preds = %38
%47 = call i32 (...) @Print_Linked_List()
%48 = call i32 @Delete_With_Value(i32 1)
%49 = call i32 @Delete_With_Value(i32 5)
%50 = call i32 (...) @Print_Linked_List()
%51 = call i32 @Search(i32 6)
%52 = call i32 @Search(i32 8)
%53 = call i32 (...) @Length_Iterative()
%54 = call i32 (...) @Length_Recursive()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Insert_At_Beginning(i32 0)
%2 = tail call i32 @Insert_At_Beginning(i32 1)
%3 = tail call i32 @Insert_At_Beginning(i32 2)
%4 = tail call i32 @Insert_At_Beginning(i32 3)
%5 = tail call i32 @Insert_At_Beginning(i32 4)
%6 = tail call i32 (...) @Print_Linked_List()
%7 = tail call i32 @Insert_At_End(i32 5)
%8 = tail call i32 @Insert_At_End(i32 6)
%9 = tail call i32 @Insert_At_End(i32 7)
%10 = tail call i32 @Insert_At_End(i32 8)
%11 = tail call i32 @Insert_At_End(i32 9)
%12 = tail call i32 (...) @Print_Linked_List()
%13 = tail call i32 @Insert_After_Value(i32 5, i32 9)
%14 = tail call i32 @Insert_After_Value(i32 10, i32 9)
%15 = tail call i32 (...) @Print_Linked_List()
%16 = tail call i32 (...) @Delete_At_End()
%17 = tail call i32 (...) @Delete_At_End()
%18 = tail call i32 (...) @Delete_At_End()
%19 = tail call i32 (...) @Print_Linked_List()
%20 = tail call i32 (...) @Delete_At_Beginning()
%21 = tail call i32 (...) @Delete_At_Beginning()
%22 = tail call i32 (...) @Delete_At_Beginning()
%23 = tail call i32 (...) @Print_Linked_List()
%24 = tail call i32 @Delete_With_Value(i32 1)
%25 = tail call i32 @Delete_With_Value(i32 5)
%26 = tail call i32 (...) @Print_Linked_List()
%27 = tail call i32 @Search(i32 6)
%28 = tail call i32 @Search(i32 8)
%29 = tail call i32 (...) @Length_Iterative()
%30 = tail call i32 (...) @Length_Recursive()
ret i32 0
}