#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*/ addFirst(int);
int /*<<< orphan*/ addLast(int);
int cnt();
int /*<<< orphan*/ destruct();
int getNodeValue(int);
int /*<<< orphan*/ init(int, int);
int /*<<< orphan*/ insrt(int, int);
int /*<<< orphan*/ insrtS(int, int, int, int, ...);
int /*<<< orphan*/ printAll();
int /*<<< orphan*/ printNode(int);
int /*<<< orphan*/ printNodeS(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rmv(int);
int /*<<< orphan*/ rmvS(int, int);
int /*<<< orphan*/ rmvVal(int);
int /*<<< orphan*/ rmvValS(int);
int srchIndex(int);
int /*<<< orphan*/ srt();
int main() {
  init(10, 20);
  insrt(1, 15);
  addLast(30);
  addLast(40);
  addFirst(5);
  addFirst(0);
  insrt(1, 2);
  insrt(7, 35);
  printAll();
  rmv(6);
  rmv(3);
  rmv(0);
  printAll();
  rmv(5);
  printAll();
  rmvS(0, 2);
  printAll();
  insrtS(30, 4, 50, 60, 70, 80);
  printAll();
  rmvS(4, 2);
  printAll();
  rmvS(3, 5);
  printAll();
  insrtS(2, 5, 26, 27, 28, 29, 30);
  printAll();
  insrtS(0, 2, 0, 4);
  printAll();
  printf("The 5. element is: ");
  printNode(8);
  printf("\n");
  printf("The first three elements are: ");
  printNodeS(0, 3);
  printf("The last element is %d\n", getNodeValue(30));
  printf("The index of %d is %d\n", 28, srchIndex(28));
  printf("The index of %d is %d\n", 999, srchIndex(999));
  printf("The length of the list is: %d\n", cnt());
  rmvVal(27);
  printAll();
  insrtS(3, 5, 99, 88, 77, 66, 4);
  srt();
  printf("After Sorting the array:\n");
  printAll();
  rmvValS(4);
  printf("After removing the 4s:\n");
  printAll();
  destruct();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x14,%esi
call   10a0 <init@plt>
mov    $0x1,%edi
mov    $0xf,%esi
call   1030 <insrt@plt>
mov    $0x1e,%edi
call   1080 <addLast@plt>
mov    $0x28,%edi
call   1080 <addLast@plt>
mov    $0x5,%edi
call   1130 <addFirst@plt>
xor    %edi,%edi
call   1130 <addFirst@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <insrt@plt>
mov    $0x7,%edi
mov    $0x23,%esi
call   1030 <insrt@plt>
mov    $0x0,%al
call   1140 <printAll@plt>
mov    $0x6,%edi
call   1060 <rmv@plt>
mov    $0x3,%edi
call   1060 <rmv@plt>
xor    %edi,%edi
call   1060 <rmv@plt>
mov    $0x0,%al
call   1140 <printAll@plt>
mov    $0x5,%edi
call   1060 <rmv@plt>
mov    $0x0,%al
call   1140 <printAll@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1050 <rmvS@plt>
mov    $0x0,%al
call   1140 <printAll@plt>
mov    $0x1e,%edi
mov    $0x4,%esi
mov    $0x32,%edx
mov    $0x3c,%ecx
mov    $0x46,%r8d
mov    $0x50,%r9d
mov    $0x0,%al
call   1090 <insrtS@plt>
mov    $0x0,%al
call   1140 <printAll@plt>
mov    $0x4,%edi
mov    $0x2,%esi
call   1050 <rmvS@plt>
mov    $0x0,%al
call   1140 <printAll@plt>
mov    $0x3,%edi
mov    $0x5,%esi
call   1050 <rmvS@plt>
mov    $0x0,%al
call   1140 <printAll@plt>
mov    $0x2,%edi
mov    $0x5,%esi
mov    $0x1a,%edx
mov    $0x1b,%ecx
mov    $0x1c,%r8d
mov    $0x1d,%r9d
movl   $0x1e,(%rsp)
mov    $0x0,%al
call   1090 <insrtS@plt>
mov    $0x0,%al
call   1140 <printAll@plt>
xor    %edx,%edx
mov    $0x2,%esi
mov    $0x4,%ecx
mov    %edx,%edi
mov    $0x0,%al
call   1090 <insrtS@plt>
mov    $0x0,%al
call   1140 <printAll@plt>
lea    0xc71(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x8,%edi
call   10f0 <printNode@plt>
lea    0xd0a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xc5f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1110 <printNodeS@plt>
mov    $0x1e,%edi
call   1040 <getNodeValue@plt>
mov    %eax,%esi
lea    0xc58(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1c,%edi
call   10c0 <srchIndex@plt>
mov    %eax,%edx
lea    0xc56(%rip),%rdi
mov    $0x1c,%esi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x3e7,%edi
call   10c0 <srchIndex@plt>
mov    %eax,%edx
lea    0xc37(%rip),%rdi
mov    $0x3e7,%esi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x0,%al
call   1100 <cnt@plt>
mov    %eax,%esi
lea    0xc32(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1b,%edi
call   10e0 <rmvVal@plt>
mov    $0x0,%al
call   1140 <printAll@plt>
mov    $0x3,%edi
mov    $0x5,%esi
mov    $0x63,%edx
mov    $0x58,%ecx
mov    $0x4d,%r8d
mov    $0x42,%r9d
movl   $0x4,(%rsp)
mov    $0x0,%al
call   1090 <insrtS@plt>
mov    $0x0,%al
call   1120 <srt@plt>
lea    0xbfd(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x0,%al
call   1140 <printAll@plt>
mov    $0x4,%edi
call   10b0 <rmvValS@plt>
lea    0xbf8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x0,%al
call   1140 <printAll@plt>
mov    $0x0,%al
call   10d0 <destruct@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0xa,%edi
mov    $0x14,%esi
call   10c0 <init@plt>
mov    $0x1,%edi
mov    $0xf,%esi
call   1040 <insrt@plt>
mov    $0x1e,%edi
call   10a0 <addLast@plt>
mov    $0x28,%edi
call   10a0 <addLast@plt>
mov    $0x5,%edi
call   1150 <addFirst@plt>
xor    %edi,%edi
call   1150 <addFirst@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <insrt@plt>
mov    $0x7,%edi
mov    $0x23,%esi
call   1040 <insrt@plt>
xor    %eax,%eax
call   1160 <printAll@plt>
mov    $0x6,%edi
call   1080 <rmv@plt>
mov    $0x3,%edi
call   1080 <rmv@plt>
xor    %edi,%edi
call   1080 <rmv@plt>
xor    %eax,%eax
call   1160 <printAll@plt>
mov    $0x5,%edi
call   1080 <rmv@plt>
xor    %eax,%eax
call   1160 <printAll@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1070 <rmvS@plt>
xor    %eax,%eax
call   1160 <printAll@plt>
mov    $0x1e,%edi
mov    $0x4,%esi
mov    $0x32,%edx
mov    $0x3c,%ecx
mov    $0x46,%r8d
mov    $0x50,%r9d
xor    %eax,%eax
call   10b0 <insrtS@plt>
xor    %eax,%eax
call   1160 <printAll@plt>
mov    $0x4,%edi
mov    $0x2,%esi
call   1070 <rmvS@plt>
xor    %eax,%eax
call   1160 <printAll@plt>
mov    $0x3,%edi
mov    $0x5,%esi
call   1070 <rmvS@plt>
xor    %eax,%eax
call   1160 <printAll@plt>
movl   $0x1e,(%rsp)
mov    $0x2,%edi
mov    $0x5,%esi
mov    $0x1a,%edx
mov    $0x1b,%ecx
mov    $0x1c,%r8d
mov    $0x1d,%r9d
xor    %eax,%eax
call   10b0 <insrtS@plt>
xor    %eax,%eax
call   1160 <printAll@plt>
xor    %edi,%edi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x4,%ecx
xor    %eax,%eax
call   10b0 <insrtS@plt>
xor    %eax,%eax
call   1160 <printAll@plt>
lea    0xc5b(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x8,%edi
call   1110 <printNode@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xc4d(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1130 <printNodeS@plt>
mov    $0x1e,%edi
call   1060 <getNodeValue@plt>
lea    0xc48(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x1c,%edi
call   10e0 <srchIndex@plt>
lea    0xc46(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1c,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x3e7,%edi
call   10e0 <srchIndex@plt>
mov    %rbx,%rdi
mov    $0x3e7,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1090 <printf@plt>
xor    %eax,%eax
call   1120 <cnt@plt>
lea    0xc23(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x1b,%edi
call   1100 <rmvVal@plt>
xor    %eax,%eax
call   1160 <printAll@plt>
movl   $0x4,(%rsp)
mov    $0x3,%edi
mov    $0x5,%esi
mov    $0x63,%edx
mov    $0x58,%ecx
mov    $0x4d,%r8d
mov    $0x42,%r9d
xor    %eax,%eax
call   10b0 <insrtS@plt>
xor    %eax,%eax
call   1140 <srt@plt>
lea    0xbec(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1160 <printAll@plt>
mov    $0x4,%edi
call   10d0 <rmvValS@plt>
lea    0xbe8(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1160 <printAll@plt>
xor    %eax,%eax
call   10f0 <destruct@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"The 5. element is: \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [31 x i8] c"The first three elements are: \00"
@.str.3 = [24 x i8] c"The last element is %d\0A\00"
@.str.4 = [23 x i8] c"The index of %d is %d\0A\00"
@.str.5 = [31 x i8] c"The length of the list is: %d\0A\00"
@.str.6 = [26 x i8] c"After Sorting the array:\0A\00"
@.str.7 = [24 x i8] c"After removing the 4s:\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @init(i32 10, i32 20)
%3 = call i32 @insrt(i32 1, i32 15)
%4 = call i32 @addLast(i32 30)
%5 = call i32 @addLast(i32 40)
%6 = call i32 @addFirst(i32 5)
%7 = call i32 @addFirst(i32 0)
%8 = call i32 @insrt(i32 1, i32 2)
%9 = call i32 @insrt(i32 7, i32 35)
%10 = call i32 (...) @printAll()
%11 = call i32 @rmv(i32 6)
%12 = call i32 @rmv(i32 3)
%13 = call i32 @rmv(i32 0)
%14 = call i32 (...) @printAll()
%15 = call i32 @rmv(i32 5)
%16 = call i32 (...) @printAll()
%17 = call i32 @rmvS(i32 0, i32 2)
%18 = call i32 (...) @printAll()
%19 = call i32 (i32, i32, i32, i32, ...) @insrtS(i32 30, i32 4, i32 50, i32 60, i32 70, i32 80)
%20 = call i32 (...) @printAll()
%21 = call i32 @rmvS(i32 4, i32 2)
%22 = call i32 (...) @printAll()
%23 = call i32 @rmvS(i32 3, i32 5)
%24 = call i32 (...) @printAll()
%25 = call i32 (i32, i32, i32, i32, ...) @insrtS(i32 2, i32 5, i32 26, i32 27, i32 28, i32 29, i32 30)
%26 = call i32 (...) @printAll()
%27 = call i32 (i32, i32, i32, i32, ...) @insrtS(i32 0, i32 2, i32 0, i32 4)
%28 = call i32 (...) @printAll()
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%30 = call i32 @printNode(i32 8)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%33 = call i32 @printNodeS(i32 0, i32 3)
%34 = call i32 @getNodeValue(i32 30)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %34)
%36 = call i32 @srchIndex(i32 28)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 28, i32 %36)
%38 = call i32 @srchIndex(i32 999)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 999, i32 %38)
%40 = call i32 (...) @cnt()
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %40)
%42 = call i32 @rmvVal(i32 27)
%43 = call i32 (...) @printAll()
%44 = call i32 (i32, i32, i32, i32, ...) @insrtS(i32 3, i32 5, i32 99, i32 88, i32 77, i32 66, i32 4)
%45 = call i32 (...) @srt()
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%47 = call i32 (...) @printAll()
%48 = call i32 @rmvValS(i32 4)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%50 = call i32 (...) @printAll()
%51 = call i32 (...) @destruct()
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"The 5. element is: \00"
@.str.2 = [31 x i8] c"The first three elements are: \00"
@.str.3 = [24 x i8] c"The last element is %d\0A\00"
@.str.4 = [23 x i8] c"The index of %d is %d\0A\00"
@.str.5 = [31 x i8] c"The length of the list is: %d\0A\00"
@str = [25 x i8] c"After Sorting the array:\00"
@str.8 = [23 x i8] c"After removing the 4s:\00"
define i32 @main() {
%1 = tail call i32 @init(i32 10, i32 20)
%2 = tail call i32 @insrt(i32 1, i32 15)
%3 = tail call i32 @addLast(i32 30)
%4 = tail call i32 @addLast(i32 40)
%5 = tail call i32 @addFirst(i32 5)
%6 = tail call i32 @addFirst(i32 0)
%7 = tail call i32 @insrt(i32 1, i32 2)
%8 = tail call i32 @insrt(i32 7, i32 35)
%9 = tail call i32 (...) @printAll()
%10 = tail call i32 @rmv(i32 6)
%11 = tail call i32 @rmv(i32 3)
%12 = tail call i32 @rmv(i32 0)
%13 = tail call i32 (...) @printAll()
%14 = tail call i32 @rmv(i32 5)
%15 = tail call i32 (...) @printAll()
%16 = tail call i32 @rmvS(i32 0, i32 2)
%17 = tail call i32 (...) @printAll()
%18 = tail call i32 (i32, i32, i32, i32, ...) @insrtS(i32 30, i32 4, i32 50, i32 60, i32 70, i32 80)
%19 = tail call i32 (...) @printAll()
%20 = tail call i32 @rmvS(i32 4, i32 2)
%21 = tail call i32 (...) @printAll()
%22 = tail call i32 @rmvS(i32 3, i32 5)
%23 = tail call i32 (...) @printAll()
%24 = tail call i32 (i32, i32, i32, i32, ...) @insrtS(i32 2, i32 5, i32 26, i32 27, i32 28, i32 29, i32 30)
%25 = tail call i32 (...) @printAll()
%26 = tail call i32 (i32, i32, i32, i32, ...) @insrtS(i32 0, i32 2, i32 0, i32 4)
%27 = tail call i32 (...) @printAll()
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%29 = tail call i32 @printNode(i32 8)
%30 = tail call i32 @putchar(i32 10)
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%32 = tail call i32 @printNodeS(i32 0, i32 3)
%33 = tail call i32 @getNodeValue(i32 30)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %33)
%35 = tail call i32 @srchIndex(i32 28)
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 28, i32 %35)
%37 = tail call i32 @srchIndex(i32 999)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 999, i32 %37)
%39 = tail call i32 (...) @cnt()
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %39)
%41 = tail call i32 @rmvVal(i32 27)
%42 = tail call i32 (...) @printAll()
%43 = tail call i32 (i32, i32, i32, i32, ...) @insrtS(i32 3, i32 5, i32 99, i32 88, i32 77, i32 66, i32 4)
%44 = tail call i32 (...) @srt()
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%46 = tail call i32 (...) @printAll()
%47 = tail call i32 @rmvValS(i32 4)
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.8, i64 0, i64 0))
%49 = tail call i32 (...) @printAll()
%50 = tail call i32 (...) @destruct()
ret i32 0
}