#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*/ evtest_list(int);
int /*<<< orphan*/ evtest_test(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Usage: evtest FILE\n");
    printf("       evtest --list\n");
    printf("       evtest --list-verbose\n");
    exit(1);
  } else if (strcmp(argv[1], "--list-verbose") == 0) {
    evtest_list(1);
    return 0;
  } else if (strcmp(argv[1], "--list") == 0 || strcmp(argv[1], "-l") == 0) {
    evtest_list(0);
    return 0;
  } else {
    evtest_test(argv[1]);
    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)
je     119e <main+0x4e>
lea    0xe89(%rip),%rdi
call   1050 <printf@plt>
lea    0xe91(%rip),%rdi
call   1050 <printf@plt>
lea    0xe9b(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11d2 <main+0x82>
mov    $0x1,%edi
call   1040 <evtest_list@plt>
movl   $0x0,-0x4(%rbp)
jmp    1235 <main+0xe5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe76(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     120e <main+0xbe>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe5f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1221 <main+0xd1>
xor    %edi,%edi
call   1040 <evtest_list@plt>
movl   $0x0,-0x4(%rbp)
jmp    1235 <main+0xe5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <evtest_test@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    11b5 <main+0x65>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xed5(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11a7 <main+0x57>
mov    0x8(%rbx),%rdi
lea    0xeab(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11a3 <main+0x53>
mov    0x8(%rbx),%rdi
lea    0xe72(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11a3 <main+0x53>
mov    0x8(%rbx),%rdi
call   1040 <evtest_test@plt>
jmp    11b1 <main+0x61>
xor    %edi,%edi
jmp    11ac <main+0x5c>
mov    $0x1,%edi
call   1050 <evtest_list@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe57(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Usage: evtest FILE\0A\00"
@.str.1 = [22 x i8] c" evtest --list\0A\00"
@.str.2 = [30 x i8] c" evtest --list-verbose\0A\00"
@.str.3 = [15 x i8] c"--list-verbose\00"
@.str.4 = [7 x i8] c"--list\00"
@.str.5 = [3 x i8] c"-l\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 ne i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 @evtest_list(i32 1)
store i32 0, i32* %3
br label %40
21: ; preds = %13
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %33, label %27
27: ; preds = %21
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %27, %21
%34 = call i32 @evtest_list(i32 0)
store i32 0, i32* %3
br label %40
35: ; preds = %27
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i32 @evtest_test(i8* %38)
store i32 0, i32* %3
br label %40
40: ; preds = %35, %33, %19
%41 = load i32, i32* %3
ret i32 %41
}

LLVM IR (-O2):
@.str.3 = [15 x i8] c"--list-verbose\00"
@.str.4 = [7 x i8] c"--list\00"
@.str.5 = [3 x i8] c"-l\00"
@str = [19 x i8] c"Usage: evtest FILE\00"
@str.6 = [21 x i8] c" evtest --list\00"
@str.7 = [29 x i8] c" evtest --list-verbose\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.6, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.7, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = tail call i32 @evtest_list(i32 1)
br label %29
16: ; preds = %9
%17 = load i8*, i8** %10
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %16
%21 = load i8*, i8** %10
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20, %16
%25 = tail call i32 @evtest_list(i32 0)
br label %29
26: ; preds = %20
%27 = load i8*, i8** %10
%28 = tail call i32 @evtest_test(i8* %27)
br label %29
29: ; preds = %26, %24, %14
ret i32 0
}