#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*/ conf_test();
int /*<<< orphan*/ date_test();
int /*<<< orphan*/ ical_test(char *);
scalar_t__ match(char *, char *);
int main(int argc, char **argv) {
  for (int i = 1; i < argc; i++) {
    if (match(argv[i], "date"))
      date_test();
    if (match(argv[i], "conf"))
      conf_test();
    if (match(argv[i], "ical"))
      ical_test(argv[++i]);
  }
  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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1209 <main+0xc9>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe84(%rip),%rsi
call   1060 <match@plt>
cmp    $0x0,%rax
je     1192 <main+0x52>
mov    $0x0,%al
call   1030 <date_test@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe60(%rip),%rsi
call   1060 <match@plt>
cmp    $0x0,%rax
je     11bb <main+0x7b>
mov    $0x0,%al
call   1050 <conf_test@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe3c(%rip),%rsi
call   1060 <match@plt>
cmp    $0x0,%rax
je     11f6 <main+0xb6>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <ical_test@plt>
jmp    11fb <main+0xbb>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     11d0 <main+0x90>
mov    %rsi,%rbx
mov    %edi,%r13d
mov    $0x1,%ebp
lea    0xe9f(%rip),%r15
lea    0xe9d(%rip),%r12
jmp    1178 <main+0x38>
nop
add    $0x1,%ebp
cmp    %r13d,%ebp
jge    11d0 <main+0x90>
movslq %ebp,%r14
mov    (%rbx,%r14,8),%rdi
lea    0xe7a(%rip),%rsi
call   1060 <match@plt>
test   %rax,%rax
je     1197 <main+0x57>
xor    %eax,%eax
call   1030 <date_test@plt>
mov    (%rbx,%r14,8),%rdi
mov    %r15,%rsi
call   1060 <match@plt>
test   %rax,%rax
je     11af <main+0x6f>
xor    %eax,%eax
call   1050 <conf_test@plt>
mov    (%rbx,%r14,8),%rdi
mov    %r12,%rsi
call   1060 <match@plt>
test   %rax,%rax
je     1170 <main+0x30>
lea    0x1(%r14),%ebp
mov    0x8(%rbx,%r14,8),%rdi
call   1040 <ical_test@plt>
jmp    1170 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"date\00"
@.str.1 = [5 x i8] c"conf\00"
@.str.2 = [5 x i8] c"ical\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %48, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %51
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i64 @match(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %11
%20 = call i32 (...) @date_test()
br label %21
21: ; preds = %19, %11
%22 = load i8**, i8*** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i64 @match(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %21
%30 = call i32 (...) @conf_test()
br label %31
31: ; preds = %29, %21
%32 = load i8**, i8*** %5
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %32, i64 %34
%36 = load i8*, i8** %35
%37 = call i64 @match(i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %47
39: ; preds = %31
%40 = load i8**, i8*** %5
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %40, i64 %43
%45 = load i8*, i8** %44
%46 = call i32 @ical_test(i8* %45)
br label %47
47: ; preds = %39, %31
br label %48
48: ; preds = %47
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %7
51: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"date\00"
@.str.1 = [5 x i8] c"conf\00"
@.str.2 = [5 x i8] c"ical\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %5, label %4
4: ; preds = %30, %2
ret i32 0
5: ; preds = %2, %30
%6 = phi i32 [ %32, %30 ], [ 1, %2 ]
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i64 @match(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %5
%13 = tail call i32 (...) @date_test()
br label %14
14: ; preds = %12, %5
%15 = load i8*, i8** %8
%16 = tail call i64 @match(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %14
%19 = tail call i32 (...) @conf_test()
br label %20
20: ; preds = %18, %14
%21 = load i8*, i8** %8
%22 = tail call i64 @match(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %30, label %24
24: ; preds = %20
%25 = add nsw i32 %6, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %1, i64 %26
%28 = load i8*, i8** %27
%29 = tail call i32 @ical_test(i8* %28)
br label %30
30: ; preds = %20, %24
%31 = phi i32 [ %25, %24 ], [ %6, %20 ]
%32 = add nsw i32 %31, 1
%33 = icmp slt i32 %32, %0
br i1 %33, label %5, label %4
}