#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 */
struct linkedList {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addBackListTest(struct linkedList *);
int /*<<< orphan*/ addFrontListTest(struct linkedList *);
int /*<<< orphan*/ backListTest(struct linkedList *);
int /*<<< orphan*/ bagInterfaceTest(struct linkedList *);
struct linkedList *createLinkedList();
int /*<<< orphan*/ deleteLinkedList(struct linkedList *);
int /*<<< orphan*/ emptyTest(struct linkedList *);
int /*<<< orphan*/ frontListTest(struct linkedList *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ removeBackListTest(struct linkedList *);
int /*<<< orphan*/ removeFrontListTest(struct linkedList *);
int main(int argc, char *argv[]) {
  printf("\n\nHello from test code!\n");
  printf("Create a linked list...\n");
  struct linkedList *nlst;
  nlst = createLinkedList();
  printf("\nDeque Interface Test Begin!\n");
  addFrontListTest(nlst);
  addBackListTest(nlst);
  frontListTest(nlst);
  backListTest(nlst);
  removeFrontListTest(nlst);
  removeBackListTest(nlst);
  emptyTest(nlst);
  printf("\n\nBag Interface Test Begin!\n");
  bagInterfaceTest(nlst);
  deleteLinkedList(nlst);
  printf("\nTest Finished!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe33(%rip),%rdi
call   1070 <printf@plt>
lea    0xe40(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1060 <createLinkedList@plt>
mov    %rax,-0x18(%rbp)
lea    0xe42(%rip),%rdi
call   1070 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <addFrontListTest@plt>
mov    -0x18(%rbp),%rdi
call   10c0 <addBackListTest@plt>
mov    -0x18(%rbp),%rdi
call   1090 <frontListTest@plt>
mov    -0x18(%rbp),%rdi
call   1040 <backListTest@plt>
mov    -0x18(%rbp),%rdi
call   1050 <removeFrontListTest@plt>
mov    -0x18(%rbp),%rdi
call   1080 <removeBackListTest@plt>
mov    -0x18(%rbp),%rdi
call   10a0 <emptyTest@plt>
lea    0xe15(%rip),%rdi
call   1070 <printf@plt>
mov    -0x18(%rbp),%rdi
call   10d0 <bagInterfaceTest@plt>
mov    -0x18(%rbp),%rdi
call   10b0 <deleteLinkedList@plt>
lea    0xe14(%rip),%rdi
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xe48(%rip),%rdi
call   1050 <puts@plt>
lea    0xe54(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1070 <createLinkedList@plt>
mov    %rax,%rbx
lea    0xe56(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1030 <addFrontListTest@plt>
mov    %rbx,%rdi
call   10c0 <addBackListTest@plt>
mov    %rbx,%rdi
call   1090 <frontListTest@plt>
mov    %rbx,%rdi
call   1040 <backListTest@plt>
mov    %rbx,%rdi
call   1060 <removeFrontListTest@plt>
mov    %rbx,%rdi
call   1080 <removeBackListTest@plt>
mov    %rbx,%rdi
call   10a0 <emptyTest@plt>
lea    0xe2f(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   10d0 <bagInterfaceTest@plt>
mov    %rbx,%rdi
call   10b0 <deleteLinkedList@plt>
lea    0xe2f(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.linkedList = type { i32 }
@.str = [25 x i8] c"\0A\0AHello from test code!\0A\00"
@.str.1 = [25 x i8] c"Create a linked list...\0A\00"
@.str.2 = [30 x i8] c"\0ADeque Interface Test Begin!\0A\00"
@.str.3 = [29 x i8] c"\0A\0ABag Interface Test Begin!\0A\00"
@.str.4 = [17 x i8] c"\0ATest Finished!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.linkedList*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%9 = call %struct.linkedList* (...) @createLinkedList()
store %struct.linkedList* %9, %struct.linkedList** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%11 = load %struct.linkedList*, %struct.linkedList** %6
%12 = call i32 @addFrontListTest(%struct.linkedList* %11)
%13 = load %struct.linkedList*, %struct.linkedList** %6
%14 = call i32 @addBackListTest(%struct.linkedList* %13)
%15 = load %struct.linkedList*, %struct.linkedList** %6
%16 = call i32 @frontListTest(%struct.linkedList* %15)
%17 = load %struct.linkedList*, %struct.linkedList** %6
%18 = call i32 @backListTest(%struct.linkedList* %17)
%19 = load %struct.linkedList*, %struct.linkedList** %6
%20 = call i32 @removeFrontListTest(%struct.linkedList* %19)
%21 = load %struct.linkedList*, %struct.linkedList** %6
%22 = call i32 @removeBackListTest(%struct.linkedList* %21)
%23 = load %struct.linkedList*, %struct.linkedList** %6
%24 = call i32 @emptyTest(%struct.linkedList* %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%26 = load %struct.linkedList*, %struct.linkedList** %6
%27 = call i32 @bagInterfaceTest(%struct.linkedList* %26)
%28 = load %struct.linkedList*, %struct.linkedList** %6
%29 = call i32 @deleteLinkedList(%struct.linkedList* %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.linkedList = type { i32 }
@str = [24 x i8] c"\0A\0AHello from test code!\00"
@str.5 = [24 x i8] c"Create a linked list...\00"
@str.6 = [29 x i8] c"\0ADeque Interface Test Begin!\00"
@str.7 = [28 x i8] c"\0A\0ABag Interface Test Begin!\00"
@str.8 = [16 x i8] c"\0ATest Finished!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
%5 = tail call %struct.linkedList* (...) @createLinkedList()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%7 = tail call i32 @addFrontListTest(%struct.linkedList* %5)
%8 = tail call i32 @addBackListTest(%struct.linkedList* %5)
%9 = tail call i32 @frontListTest(%struct.linkedList* %5)
%10 = tail call i32 @backListTest(%struct.linkedList* %5)
%11 = tail call i32 @removeFrontListTest(%struct.linkedList* %5)
%12 = tail call i32 @removeBackListTest(%struct.linkedList* %5)
%13 = tail call i32 @emptyTest(%struct.linkedList* %5)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.7, i64 0, i64 0))
%15 = tail call i32 @bagInterfaceTest(%struct.linkedList* %5)
%16 = tail call i32 @deleteLinkedList(%struct.linkedList* %5)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}