#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*/ insert_test_beginning();
int /*<<< orphan*/ insert_test_end();
int /*<<< orphan*/ insert_test_invalid();
int /*<<< orphan*/ insert_test_middle();
int /*<<< orphan*/ push_pop_back_test();
int /*<<< orphan*/ push_pop_front_test();
int /*<<< orphan*/ remove_test_all();
int /*<<< orphan*/ remove_test_beginning();
int /*<<< orphan*/ remove_test_end();
int /*<<< orphan*/ remove_test_invalid();
int /*<<< orphan*/ remove_test_middle();
int /*<<< orphan*/ run_case(char *, int /*<<< orphan*/);
int /*<<< orphan*/ size_test();
int /*<<< orphan*/ test_begin(char *);
int /*<<< orphan*/ test_end();
void linked_list_test(void) {
  test_begin("Linked list test");
  run_case("insert_test_beginning", insert_test_beginning());
  run_case("insert_test_middle", insert_test_middle());
  run_case("insert_test_end", insert_test_end());
  run_case("insert_test_invalid", insert_test_invalid());
  run_case("remove_test_beginning", remove_test_beginning());
  run_case("remove_test_middle", remove_test_middle());
  run_case("remove_test_end", remove_test_end());
  run_case("remove_test_invalid", remove_test_invalid());
  run_case("size_test", size_test());
  run_case("remove_test_all", remove_test_all());
  run_case("push_pop_front_test", push_pop_front_test());
  run_case("push_pop_back_test", push_pop_back_test());
  test_end();
}


x86 assembly (clang, -O0):
<linked_list_test>:
push   %rbp
mov    %rsp,%rbp
lea    0xe05(%rip),%rdi
call   1080 <test_begin@plt>
mov    $0x0,%al
call   10b0 <insert_test_beginning@plt>
mov    %eax,%esi
lea    0xe01(%rip),%rdi
call   10e0 <run_case@plt>
mov    $0x0,%al
call   10c0 <insert_test_middle@plt>
mov    %eax,%esi
lea    0xe02(%rip),%rdi
call   10e0 <run_case@plt>
mov    $0x0,%al
call   1110 <insert_test_end@plt>
mov    %eax,%esi
lea    0xe00(%rip),%rdi
call   10e0 <run_case@plt>
mov    $0x0,%al
call   1070 <insert_test_invalid@plt>
mov    %eax,%esi
lea    0xdfb(%rip),%rdi
call   10e0 <run_case@plt>
mov    $0x0,%al
call   1050 <remove_test_beginning@plt>
mov    %eax,%esi
lea    0xdfa(%rip),%rdi
call   10e0 <run_case@plt>
mov    $0x0,%al
call   1040 <remove_test_middle@plt>
mov    %eax,%esi
lea    0xdfb(%rip),%rdi
call   10e0 <run_case@plt>
mov    $0x0,%al
call   1090 <remove_test_end@plt>
mov    %eax,%esi
lea    0xdf9(%rip),%rdi
call   10e0 <run_case@plt>
mov    $0x0,%al
call   1030 <remove_test_invalid@plt>
mov    %eax,%esi
lea    0xdf4(%rip),%rdi
call   10e0 <run_case@plt>
mov    $0x0,%al
call   10a0 <size_test@plt>
mov    %eax,%esi
lea    0xdf3(%rip),%rdi
call   10e0 <run_case@plt>
mov    $0x0,%al
call   1060 <remove_test_all@plt>
mov    %eax,%esi
lea    0xde8(%rip),%rdi
call   10e0 <run_case@plt>
mov    $0x0,%al
call   1100 <push_pop_front_test@plt>
mov    %eax,%esi
lea    0xde3(%rip),%rdi
call   10e0 <run_case@plt>
mov    $0x0,%al
call   10d0 <push_pop_back_test@plt>
mov    %eax,%esi
lea    0xde2(%rip),%rdi
call   10e0 <run_case@plt>
mov    $0x0,%al
call   10f0 <test_end@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<linked_list_test>:
push   %rax
lea    0xe08(%rip),%rdi
call   1080 <test_begin@plt>
xor    %eax,%eax
call   10b0 <insert_test_beginning@plt>
lea    0xe06(%rip),%rdi
mov    %eax,%esi
call   10e0 <run_case@plt>
xor    %eax,%eax
call   10c0 <insert_test_middle@plt>
lea    0xe07(%rip),%rdi
mov    %eax,%esi
call   10e0 <run_case@plt>
xor    %eax,%eax
call   1110 <insert_test_end@plt>
lea    0xe05(%rip),%rdi
mov    %eax,%esi
call   10e0 <run_case@plt>
xor    %eax,%eax
call   1070 <insert_test_invalid@plt>
lea    0xe00(%rip),%rdi
mov    %eax,%esi
call   10e0 <run_case@plt>
xor    %eax,%eax
call   1050 <remove_test_beginning@plt>
lea    0xdff(%rip),%rdi
mov    %eax,%esi
call   10e0 <run_case@plt>
xor    %eax,%eax
call   1040 <remove_test_middle@plt>
lea    0xe00(%rip),%rdi
mov    %eax,%esi
call   10e0 <run_case@plt>
xor    %eax,%eax
call   1090 <remove_test_end@plt>
lea    0xdfe(%rip),%rdi
mov    %eax,%esi
call   10e0 <run_case@plt>
xor    %eax,%eax
call   1030 <remove_test_invalid@plt>
lea    0xdf9(%rip),%rdi
mov    %eax,%esi
call   10e0 <run_case@plt>
xor    %eax,%eax
call   10a0 <size_test@plt>
lea    0xdf8(%rip),%rdi
mov    %eax,%esi
call   10e0 <run_case@plt>
xor    %eax,%eax
call   1060 <remove_test_all@plt>
lea    0xded(%rip),%rdi
mov    %eax,%esi
call   10e0 <run_case@plt>
xor    %eax,%eax
call   1100 <push_pop_front_test@plt>
lea    0xde8(%rip),%rdi
mov    %eax,%esi
call   10e0 <run_case@plt>
xor    %eax,%eax
call   10d0 <push_pop_back_test@plt>
lea    0xde7(%rip),%rdi
mov    %eax,%esi
call   10e0 <run_case@plt>
xor    %eax,%eax
pop    %rcx
jmp    10f0 <test_end@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Linked list test\00"
@.str.1 = [22 x i8] c"insert_test_beginning\00"
@.str.2 = [19 x i8] c"insert_test_middle\00"
@.str.3 = [16 x i8] c"insert_test_end\00"
@.str.4 = [20 x i8] c"insert_test_invalid\00"
@.str.5 = [22 x i8] c"remove_test_beginning\00"
@.str.6 = [19 x i8] c"remove_test_middle\00"
@.str.7 = [16 x i8] c"remove_test_end\00"
@.str.8 = [20 x i8] c"remove_test_invalid\00"
@.str.9 = [10 x i8] c"size_test\00"
@.str.10 = [16 x i8] c"remove_test_all\00"
@.str.11 = [20 x i8] c"push_pop_front_test\00"
@.str.12 = [19 x i8] c"push_pop_back_test\00"
define void @linked_list_test() {
%1 = call i32 @test_begin(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @insert_test_beginning()
%3 = call i32 @run_case(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @insert_test_middle()
%5 = call i32 @run_case(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @insert_test_end()
%7 = call i32 @run_case(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @insert_test_invalid()
%9 = call i32 @run_case(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @remove_test_beginning()
%11 = call i32 @run_case(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %10)
%12 = call i32 (...) @remove_test_middle()
%13 = call i32 @run_case(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %12)
%14 = call i32 (...) @remove_test_end()
%15 = call i32 @run_case(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i32 %14)
%16 = call i32 (...) @remove_test_invalid()
%17 = call i32 @run_case(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 %16)
%18 = call i32 (...) @size_test()
%19 = call i32 @run_case(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %18)
%20 = call i32 (...) @remove_test_all()
%21 = call i32 @run_case(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 %20)
%22 = call i32 (...) @push_pop_front_test()
%23 = call i32 @run_case(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 %22)
%24 = call i32 (...) @push_pop_back_test()
%25 = call i32 @run_case(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i32 %24)
%26 = call i32 (...) @test_end()
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Linked list test\00"
@.str.1 = [22 x i8] c"insert_test_beginning\00"
@.str.2 = [19 x i8] c"insert_test_middle\00"
@.str.3 = [16 x i8] c"insert_test_end\00"
@.str.4 = [20 x i8] c"insert_test_invalid\00"
@.str.5 = [22 x i8] c"remove_test_beginning\00"
@.str.6 = [19 x i8] c"remove_test_middle\00"
@.str.7 = [16 x i8] c"remove_test_end\00"
@.str.8 = [20 x i8] c"remove_test_invalid\00"
@.str.9 = [10 x i8] c"size_test\00"
@.str.10 = [16 x i8] c"remove_test_all\00"
@.str.11 = [20 x i8] c"push_pop_front_test\00"
@.str.12 = [19 x i8] c"push_pop_back_test\00"
define void @linked_list_test() {
%1 = tail call i32 @test_begin(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @insert_test_beginning()
%3 = tail call i32 @run_case(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @insert_test_middle()
%5 = tail call i32 @run_case(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @insert_test_end()
%7 = tail call i32 @run_case(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @insert_test_invalid()
%9 = tail call i32 @run_case(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %8)
%10 = tail call i32 (...) @remove_test_beginning()
%11 = tail call i32 @run_case(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %10)
%12 = tail call i32 (...) @remove_test_middle()
%13 = tail call i32 @run_case(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %12)
%14 = tail call i32 (...) @remove_test_end()
%15 = tail call i32 @run_case(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i32 %14)
%16 = tail call i32 (...) @remove_test_invalid()
%17 = tail call i32 @run_case(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 %16)
%18 = tail call i32 (...) @size_test()
%19 = tail call i32 @run_case(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %18)
%20 = tail call i32 (...) @remove_test_all()
%21 = tail call i32 @run_case(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 %20)
%22 = tail call i32 (...) @push_pop_front_test()
%23 = tail call i32 @run_case(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 %22)
%24 = tail call i32 (...) @push_pop_back_test()
%25 = tail call i32 @run_case(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i32 %24)
%26 = tail call i32 (...) @test_end()
ret void
}