#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*/ printf(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ test_file();
int /*<<< orphan*/ test_kernel();
int /*<<< orphan*/ test_list();
int /*<<< orphan*/ test_net();
int /*<<< orphan*/ test_str();
int main(int argc, char **argv) {
  if (argc == 2) {
    if (strcmp("list", argv[1]) == 0) {
      test_list();
    } else if (strcmp("file", argv[1]) == 0) {
      test_file();
    } else if (strcmp("str", argv[1]) == 0) {
      test_str();
    } else if (strcmp("kernel", argv[1]) == 0) {
      test_kernel();
    } else if (strcmp("net", argv[1]) == 0) {
      test_net();
    } else if (strcmp("all", argv[1]) == 0) {
      test_list();
      test_file();
      test_str();
      test_kernel();
      test_net();
    }
  } else {
    printf("usage: %s [test]\n", argv[0]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    12c1 <main+0x151>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe61(%rip),%rdi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    11ba <main+0x4a>
mov    $0x0,%al
call   1080 <test_list@plt>
jmp    12bc <main+0x14c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe3c(%rip),%rdi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    11e4 <main+0x74>
mov    $0x0,%al
call   1060 <test_file@plt>
jmp    12b7 <main+0x147>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe17(%rip),%rdi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    120e <main+0x9e>
mov    $0x0,%al
call   1030 <test_str@plt>
jmp    12b2 <main+0x142>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdf1(%rip),%rdi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1238 <main+0xc8>
mov    $0x0,%al
call   1040 <test_kernel@plt>
jmp    12ad <main+0x13d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdce(%rip),%rdi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1262 <main+0xf2>
mov    $0x0,%al
call   1070 <test_net@plt>
jmp    12a8 <main+0x138>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xda8(%rip),%rdi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12a3 <main+0x133>
mov    $0x0,%al
call   1080 <test_list@plt>
mov    $0x0,%al
call   1060 <test_file@plt>
mov    $0x0,%al
call   1030 <test_str@plt>
mov    $0x0,%al
call   1040 <test_kernel@plt>
mov    $0x0,%al
call   1070 <test_net@plt>
jmp    12a8 <main+0x138>
jmp    12ad <main+0x13d>
jmp    12b2 <main+0x142>
jmp    12b7 <main+0x147>
jmp    12bc <main+0x14c>
jmp    12d4 <main+0x164>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xd4e(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    122c <main+0xbc>
mov    0x8(%rbx),%rsi
lea    0xe78(%rip),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     123d <main+0xcd>
mov    0x8(%rbx),%rsi
lea    0xe64(%rip),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1246 <main+0xd6>
mov    0x8(%rbx),%rsi
lea    0xe50(%rip),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     124f <main+0xdf>
mov    0x8(%rbx),%rsi
lea    0xe3b(%rip),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1258 <main+0xe8>
mov    0x8(%rbx),%rsi
lea    0xe2d(%rip),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1223 <main+0xb3>
mov    0x8(%rbx),%rsi
lea    0xe1c(%rip),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    125f <main+0xef>
xor    %eax,%eax
call   1080 <test_list@plt>
xor    %eax,%eax
call   1060 <test_file@plt>
xor    %eax,%eax
call   1030 <test_str@plt>
xor    %eax,%eax
call   1040 <test_kernel@plt>
xor    %eax,%eax
call   1070 <test_net@plt>
jmp    125f <main+0xef>
mov    (%rbx),%rsi
lea    0xde7(%rip),%rdi
call   1050 <printf@plt>
jmp    125f <main+0xef>
xor    %eax,%eax
call   1080 <test_list@plt>
jmp    125f <main+0xef>
xor    %eax,%eax
call   1060 <test_file@plt>
jmp    125f <main+0xef>
xor    %eax,%eax
call   1030 <test_str@plt>
jmp    125f <main+0xef>
xor    %eax,%eax
call   1040 <test_kernel@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"list\00"
@.str.1 = [5 x i8] c"file\00"
@.str.2 = [4 x i8] c"str\00"
@.str.3 = [7 x i8] c"kernel\00"
@.str.4 = [4 x i8] c"net\00"
@.str.5 = [4 x i8] c"all\00"
@.str.6 = [18 x i8] c"usage: %s [test]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %66
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = call i32 (...) @test_list()
br label %65
16: ; preds = %8
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %16
%23 = call i32 (...) @test_file()
br label %64
24: ; preds = %16
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %24
%31 = call i32 (...) @test_str()
br label %63
32: ; preds = %24
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i64 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %35)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %32
%39 = call i32 (...) @test_kernel()
br label %62
40: ; preds = %32
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 1
%43 = load i8*, i8** %42
%44 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %43)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %40
%47 = call i32 (...) @test_net()
br label %61
48: ; preds = %40
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %51)
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %60
54: ; preds = %48
%55 = call i32 (...) @test_list()
%56 = call i32 (...) @test_file()
%57 = call i32 (...) @test_str()
%58 = call i32 (...) @test_kernel()
%59 = call i32 (...) @test_net()
br label %60
60: ; preds = %54, %48
br label %61
61: ; preds = %60, %46
br label %62
62: ; preds = %61, %38
br label %63
63: ; preds = %62, %30
br label %64
64: ; preds = %63, %22
br label %65
65: ; preds = %64, %14
br label %71
66: ; preds = %2
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 0
%69 = load i8*, i8** %68
%70 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %69)
br label %71
71: ; preds = %66, %65
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"list\00"
@.str.1 = [5 x i8] c"file\00"
@.str.2 = [4 x i8] c"str\00"
@.str.3 = [7 x i8] c"kernel\00"
@.str.4 = [4 x i8] c"net\00"
@.str.5 = [4 x i8] c"all\00"
@.str.6 = [18 x i8] c"usage: %s [test]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %45
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (...) @test_list()
br label %48
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = tail call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = tail call i32 (...) @test_file()
br label %48
17: ; preds = %11
%18 = load i8*, i8** %5
%19 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = tail call i32 (...) @test_str()
br label %48
23: ; preds = %17
%24 = load i8*, i8** %5
%25 = tail call i64 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %24)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = tail call i32 (...) @test_kernel()
br label %48
29: ; preds = %23
%30 = load i8*, i8** %5
%31 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %30)
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = tail call i32 (...) @test_net()
br label %48
35: ; preds = %29
%36 = load i8*, i8** %5
%37 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %36)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %48
39: ; preds = %35
%40 = tail call i32 (...) @test_list()
%41 = tail call i32 (...) @test_file()
%42 = tail call i32 (...) @test_str()
%43 = tail call i32 (...) @test_kernel()
%44 = tail call i32 (...) @test_net()
br label %48
45: ; preds = %2
%46 = load i8*, i8** %1
%47 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %46)
br label %48
48: ; preds = %9, %21, %33, %39, %35, %27, %15, %45
ret i32 0
}