#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 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 main() {
  printf("Hello world!\n");
  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));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
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   10d0 <addFirst@plt>
xor    %edi,%edi
call   10d0 <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   10e0 <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   10e0 <printAll@plt>
mov    $0x5,%edi
call   1060 <rmv@plt>
mov    $0x0,%al
call   10e0 <printAll@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1050 <rmvS@plt>
mov    $0x0,%al
call   10e0 <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   10e0 <printAll@plt>
mov    $0x4,%edi
mov    $0x2,%esi
call   1050 <rmvS@plt>
mov    $0x0,%al
call   10e0 <printAll@plt>
mov    $0x3,%edi
mov    $0x5,%esi
call   1050 <rmvS@plt>
mov    $0x0,%al
call   10e0 <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   10e0 <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   10e0 <printAll@plt>
lea    0xcd1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x8,%edi
call   10b0 <printNode@plt>
lea    0xcb7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xcbf(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   10c0 <printNodeS@plt>
mov    $0x1e,%edi
call   1040 <getNodeValue@plt>
mov    %eax,%esi
lea    0xcb8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe63(%rip),%rdi
call   1050 <puts@plt>
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   10f0 <addFirst@plt>
xor    %edi,%edi
call   10f0 <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   1100 <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   1100 <printAll@plt>
mov    $0x5,%edi
call   1080 <rmv@plt>
xor    %eax,%eax
call   1100 <printAll@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1070 <rmvS@plt>
xor    %eax,%eax
call   1100 <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   1100 <printAll@plt>
mov    $0x4,%edi
mov    $0x2,%esi
call   1070 <rmvS@plt>
xor    %eax,%eax
call   1100 <printAll@plt>
mov    $0x3,%edi
mov    $0x5,%esi
call   1070 <rmvS@plt>
xor    %eax,%eax
call   1100 <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   1100 <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   1100 <printAll@plt>
lea    0xcb3(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x8,%edi
call   10d0 <printNode@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xca5(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   10e0 <printNodeS@plt>
mov    $0x1e,%edi
call   1060 <getNodeValue@plt>
lea    0xca0(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
@.str.1 = [20 x i8] c"The 5. element is: \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [31 x i8] c"The first three elements are: \00"
@.str.4 = [24 x i8] c"The last element is %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @init(i32 10, i32 20)
%4 = call i32 @insrt(i32 1, i32 15)
%5 = call i32 @addLast(i32 30)
%6 = call i32 @addLast(i32 40)
%7 = call i32 @addFirst(i32 5)
%8 = call i32 @addFirst(i32 0)
%9 = call i32 @insrt(i32 1, i32 2)
%10 = call i32 @insrt(i32 7, i32 35)
%11 = call i32 (...) @printAll()
%12 = call i32 @rmv(i32 6)
%13 = call i32 @rmv(i32 3)
%14 = call i32 @rmv(i32 0)
%15 = call i32 (...) @printAll()
%16 = call i32 @rmv(i32 5)
%17 = call i32 (...) @printAll()
%18 = call i32 @rmvS(i32 0, i32 2)
%19 = call i32 (...) @printAll()
%20 = call i32 (i32, i32, i32, i32, ...) @insrtS(i32 30, i32 4, i32 50, i32 60, i32 70, i32 80)
%21 = call i32 (...) @printAll()
%22 = call i32 @rmvS(i32 4, i32 2)
%23 = call i32 (...) @printAll()
%24 = call i32 @rmvS(i32 3, i32 5)
%25 = call i32 (...) @printAll()
%26 = call i32 (i32, i32, i32, i32, ...) @insrtS(i32 2, i32 5, i32 26, i32 27, i32 28, i32 29, i32 30)
%27 = call i32 (...) @printAll()
%28 = call i32 (i32, i32, i32, i32, ...) @insrtS(i32 0, i32 2, i32 0, i32 4)
%29 = call i32 (...) @printAll()
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%31 = call i32 @printNode(i32 8)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%34 = call i32 @printNodeS(i32 0, i32 3)
%35 = call i32 @getNodeValue(i32 30)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %35)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"The 5. element is: \00"
@.str.3 = [31 x i8] c"The first three elements are: \00"
@.str.4 = [24 x i8] c"The last element is %d\0A\00"
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @init(i32 10, i32 20)
%3 = tail call i32 @insrt(i32 1, i32 15)
%4 = tail call i32 @addLast(i32 30)
%5 = tail call i32 @addLast(i32 40)
%6 = tail call i32 @addFirst(i32 5)
%7 = tail call i32 @addFirst(i32 0)
%8 = tail call i32 @insrt(i32 1, i32 2)
%9 = tail call i32 @insrt(i32 7, i32 35)
%10 = tail call i32 (...) @printAll()
%11 = tail call i32 @rmv(i32 6)
%12 = tail call i32 @rmv(i32 3)
%13 = tail call i32 @rmv(i32 0)
%14 = tail call i32 (...) @printAll()
%15 = tail call i32 @rmv(i32 5)
%16 = tail call i32 (...) @printAll()
%17 = tail call i32 @rmvS(i32 0, i32 2)
%18 = tail call i32 (...) @printAll()
%19 = tail call i32 (i32, i32, i32, i32, ...) @insrtS(i32 30, i32 4, i32 50, i32 60, i32 70, i32 80)
%20 = tail call i32 (...) @printAll()
%21 = tail call i32 @rmvS(i32 4, i32 2)
%22 = tail call i32 (...) @printAll()
%23 = tail call i32 @rmvS(i32 3, i32 5)
%24 = tail call i32 (...) @printAll()
%25 = tail call i32 (i32, i32, i32, i32, ...) @insrtS(i32 2, i32 5, i32 26, i32 27, i32 28, i32 29, i32 30)
%26 = tail call i32 (...) @printAll()
%27 = tail call i32 (i32, i32, i32, i32, ...) @insrtS(i32 0, i32 2, i32 0, i32 4)
%28 = tail call i32 (...) @printAll()
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%30 = tail call i32 @printNode(i32 8)
%31 = tail call i32 @putchar(i32 10)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%33 = tail call i32 @printNodeS(i32 0, i32 3)
%34 = tail call i32 @getNodeValue(i32 30)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %34)
ret i32 0
}