#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*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int /*<<< orphan*/ test5();
int /*<<< orphan*/ test6();
int /*<<< orphan*/ test7();
int /*<<< orphan*/ test8();
int main(int argc, char **argv) {
  char *test;
  if (argc < 2) {
    printf("Usage: test_linked_list test1|test2|...test12\n");
    exit(1);
  }
  test = argv[1];
  printf("Running %s\n", test);
  if (strcmp(test, "test1") == 0) {
    test1();
  } else if (strcmp(test, "test2") == 0) {
    test2();
  } else if (strcmp(test, "test3") == 0) {
    test3();
  } else if (strcmp(test, "test4") == 0) {
    test4();
  } else if (strcmp(test, "test5") == 0) {
    test5();
  } else if (strcmp(test, "test6") == 0) {
    test6();
  } else if (strcmp(test, "test7") == 0) {
    test7();
  } else if (strcmp(test, "test8") == 0) {
    test8();
  } else {
    printf("Test not found!!n");
    exit(1);
  }
}


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)
cmpl   $0x2,-0x8(%rbp)
jge    11e8 <main+0x38>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe2a(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    122c <main+0x7c>
mov    $0x0,%al
call   1060 <test1@plt>
jmp    1371 <main+0x1c1>
mov    -0x18(%rbp),%rdi
lea    0xe0a(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1252 <main+0xa2>
mov    $0x0,%al
call   10b0 <test2@plt>
jmp    136c <main+0x1bc>
mov    -0x18(%rbp),%rdi
lea    0xdea(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1278 <main+0xc8>
mov    $0x0,%al
call   1050 <test3@plt>
jmp    1367 <main+0x1b7>
mov    -0x18(%rbp),%rdi
lea    0xdca(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    129e <main+0xee>
mov    $0x0,%al
call   10a0 <test4@plt>
jmp    1362 <main+0x1b2>
mov    -0x18(%rbp),%rdi
lea    0xdaa(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    12c4 <main+0x114>
mov    $0x0,%al
call   1040 <test5@plt>
jmp    135d <main+0x1ad>
mov    -0x18(%rbp),%rdi
lea    0xd8a(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    12ea <main+0x13a>
mov    $0x0,%al
call   1090 <test6@plt>
jmp    1358 <main+0x1a8>
mov    -0x18(%rbp),%rdi
lea    0xd6a(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1310 <main+0x160>
mov    $0x0,%al
call   1030 <test7@plt>
jmp    1353 <main+0x1a3>
mov    -0x18(%rbp),%rdi
lea    0xd4a(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1336 <main+0x186>
mov    $0x0,%al
call   10c0 <test8@plt>
jmp    134e <main+0x19e>
lea    0xd2e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
jmp    1353 <main+0x1a3>
jmp    1358 <main+0x1a8>
jmp    135d <main+0x1ad>
jmp    1362 <main+0x1b2>
jmp    1367 <main+0x1b7>
jmp    136c <main+0x1bc>
jmp    1371 <main+0x1c1>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jle    12d1 <main+0x111>
mov    0x8(%rsi),%rbx
lea    0xe2b(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe26(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1290 <main+0xd0>
lea    0xe14(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1299 <main+0xd9>
lea    0xe02(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12a2 <main+0xe2>
lea    0xdf4(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12ab <main+0xeb>
lea    0xde6(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12b4 <main+0xf4>
lea    0xdd8(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12bd <main+0xfd>
lea    0xdca(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12c6 <main+0x106>
lea    0xdbc(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    12e7 <main+0x127>
xor    %eax,%eax
call   10d0 <test8@plt>
jmp    12cd <main+0x10d>
xor    %eax,%eax
call   1070 <test1@plt>
jmp    12cd <main+0x10d>
xor    %eax,%eax
call   10c0 <test2@plt>
jmp    12cd <main+0x10d>
xor    %eax,%eax
call   1060 <test3@plt>
jmp    12cd <main+0x10d>
xor    %eax,%eax
call   10b0 <test4@plt>
jmp    12cd <main+0x10d>
xor    %eax,%eax
call   1050 <test5@plt>
jmp    12cd <main+0x10d>
xor    %eax,%eax
call   10a0 <test6@plt>
jmp    12cd <main+0x10d>
xor    %eax,%eax
call   1040 <test7@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xd76(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xd4e(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Usage: test_linked_list test1|test2|...test12\0A\00"
@.str.1 = [12 x i8] c"Running %s\0A\00"
@.str.2 = [6 x i8] c"test1\00"
@.str.3 = [6 x i8] c"test2\00"
@.str.4 = [6 x i8] c"test3\00"
@.str.5 = [6 x i8] c"test4\00"
@.str.6 = [6 x i8] c"test5\00"
@.str.7 = [6 x i8] c"test6\00"
@.str.8 = [6 x i8] c"test7\00"
@.str.9 = [6 x i8] c"test8\00"
@.str.10 = [18 x i8] c"Test not found!!n\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = load i8*, i8** %6
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %12
%22 = call i32 (...) @test1()
br label %75
23: ; preds = %12
%24 = load i8*, i8** %6
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 (...) @test2()
br label %74
29: ; preds = %23
%30 = load i8*, i8** %6
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 (...) @test3()
br label %73
35: ; preds = %29
%36 = load i8*, i8** %6
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i32 (...) @test4()
br label %72
41: ; preds = %35
%42 = load i8*, i8** %6
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = call i32 (...) @test5()
br label %71
47: ; preds = %41
%48 = load i8*, i8** %6
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = call i32 (...) @test6()
br label %70
53: ; preds = %47
%54 = load i8*, i8** %6
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %53
%58 = call i32 (...) @test7()
br label %69
59: ; preds = %53
%60 = load i8*, i8** %6
%61 = call i64 @strcmp(i8* %60, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %59
%64 = call i32 (...) @test8()
br label %68
65: ; preds = %59
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
%67 = call i32 @exit(i32 1)
unreachable
68: ; preds = %63
br label %69
69: ; preds = %68, %57
br label %70
70: ; preds = %69, %51
br label %71
71: ; preds = %70, %45
br label %72
72: ; preds = %71, %39
br label %73
73: ; preds = %72, %33
br label %74
74: ; preds = %73, %27
br label %75
75: ; preds = %74, %21
%76 = load i32, i32* %3
ret i32 %76
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"Running %s\0A\00"
@.str.2 = [6 x i8] c"test1\00"
@.str.3 = [6 x i8] c"test2\00"
@.str.4 = [6 x i8] c"test3\00"
@.str.5 = [6 x i8] c"test4\00"
@.str.6 = [6 x i8] c"test5\00"
@.str.7 = [6 x i8] c"test6\00"
@.str.8 = [6 x i8] c"test7\00"
@.str.9 = [6 x i8] c"test8\00"
@.str.10 = [18 x i8] c"Test not found!!n\00"
@str = [46 x i8] c"Usage: test_linked_list test1|test2|...test12\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = tail call i32 (...) @test1()
br label %53
15: ; preds = %7
%16 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = tail call i32 (...) @test2()
br label %53
20: ; preds = %15
%21 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = tail call i32 (...) @test3()
br label %53
25: ; preds = %20
%26 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = tail call i32 (...) @test4()
br label %53
30: ; preds = %25
%31 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = tail call i32 (...) @test5()
br label %53
35: ; preds = %30
%36 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = tail call i32 (...) @test6()
br label %53
40: ; preds = %35
%41 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = tail call i32 (...) @test7()
br label %53
45: ; preds = %40
%46 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = tail call i32 (...) @test8()
br label %53
50: ; preds = %45
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
%52 = tail call i32 @exit(i32 1)
unreachable
53: ; preds = %18, %28, %38, %48, %43, %33, %23, %13
ret i32 0
}