#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*/ extractFiles(char *, char *, int *, int *);
int /*<<< orphan*/ findFiles(char *, int *, int *);
int *malloc(int);
int /*<<< orphan*/ outputMatrix(char *, int *, int *);
int /*<<< orphan*/ printHelp(char *);
int main(int argc, char **argv) {
  int *matrix = malloc(1024 * sizeof(int)), fc = 0;
  if (argc < 3) {
    printHelp(argv[0]);
  }
  if (argv[1][0] == '-') {
    switch (argv[1][1]) {
    case 'f':
      findFiles(argv[2], matrix, &fc);
      break;
    case 'x':
      findFiles(argv[2], matrix, &fc);
      extractFiles(argv[2], argv[2], matrix, &fc);
      break;
    case 'n':
      findFiles(argv[3], matrix, &fc);
      extractFiles(argv[3], argv[2], matrix, &fc);
      break;
    case 'd':
      findFiles(argv[3], matrix, &fc);
      outputMatrix(argv[2], matrix, &fc);
      break;
    case 'e':
      findFiles(argv[2], matrix, &fc);
      break;
    case 'h':
      printHelp(argv[0]);
      break;
    default:
      printHelp(argv[0]);
    }
  } else {
    printHelp(argv[0]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1000,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1191 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <printHelp@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    12ca <main+0x17a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
add    $0xffffff9c,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x14,%eax
ja     12b9 <main+0x169>
mov    -0x28(%rbp),%rax
lea    0xe32(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <findFiles@plt>
jmp    12c5 <main+0x175>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <findFiles@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <extractFiles@plt>
jmp    12c5 <main+0x175>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <findFiles@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <extractFiles@plt>
jmp    12c5 <main+0x175>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <findFiles@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1070 <outputMatrix@plt>
jmp    12c5 <main+0x175>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <findFiles@plt>
jmp    12c5 <main+0x175>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <printHelp@plt>
jmp    12c5 <main+0x175>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <printHelp@plt>
jmp    12d6 <main+0x186>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <printHelp@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1000,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
movl   $0x0,0xc(%rsp)
cmp    $0x2,%ebp
jg     117f <main+0x2f>
mov    (%rbx),%rdi
call   1030 <printHelp@plt>
mov    0x8(%rbx),%rax
cmpb   $0x2d,(%rax)
jne    11b7 <main+0x67>
movsbl 0x1(%rax),%eax
add    $0xffffff9c,%eax
cmp    $0x14,%eax
ja     11b7 <main+0x67>
lea    0xe65(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x10(%rbx),%rdi
lea    0xc(%rsp),%rdx
mov    %r14,%rsi
call   1050 <findFiles@plt>
jmp    11bf <main+0x6f>
mov    (%rbx),%rdi
call   1030 <printHelp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x18(%rbx),%rdi
lea    0xc(%rsp),%rbp
mov    %r14,%rsi
mov    %rbp,%rdx
call   1050 <findFiles@plt>
mov    0x10(%rbx),%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1070 <outputMatrix@plt>
jmp    11bf <main+0x6f>
mov    0x18(%rbx),%rdi
lea    0xc(%rsp),%rbp
mov    %r14,%rsi
mov    %rbp,%rdx
call   1050 <findFiles@plt>
mov    0x10(%rbx),%rsi
mov    0x18(%rbx),%rdi
jmp    1228 <main+0xd8>
mov    0x10(%rbx),%rdi
lea    0xc(%rsp),%rbp
mov    %r14,%rsi
mov    %rbp,%rdx
call   1050 <findFiles@plt>
mov    0x10(%rbx),%rdi
mov    %rdi,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
call   1040 <extractFiles@plt>
jmp    11bf <main+0x6f>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32* @malloc(i32 4096)
store i32* %8, i32** %6
store i32 0, i32* %7
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @printHelp(i8* %14)
br label %16
16: ; preds = %11, %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 45
br i1 %23, label %24, label %93
24: ; preds = %16
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
switch i32 %30, label %87 [
i32 102, label %31
i32 120, label %37
i32 110, label %51
i32 100, label %65
i32 101, label %76
i32 104, label %82
]
31: ; preds = %24
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = load i32*, i32** %6
%36 = call i32 @findFiles(i8* %34, i32* %35, i32* %7)
br label %92
37: ; preds = %24
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = load i32*, i32** %6
%42 = call i32 @findFiles(i8* %40, i32* %41, i32* %7)
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 2
%45 = load i8*, i8** %44
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 2
%48 = load i8*, i8** %47
%49 = load i32*, i32** %6
%50 = call i32 @extractFiles(i8* %45, i8* %48, i32* %49, i32* %7)
br label %92
51: ; preds = %24
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 3
%54 = load i8*, i8** %53
%55 = load i32*, i32** %6
%56 = call i32 @findFiles(i8* %54, i32* %55, i32* %7)
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 3
%59 = load i8*, i8** %58
%60 = load i8**, i8*** %5
%61 = getelementptr inbounds i8*, i8** %60, i64 2
%62 = load i8*, i8** %61
%63 = load i32*, i32** %6
%64 = call i32 @extractFiles(i8* %59, i8* %62, i32* %63, i32* %7)
br label %92
65: ; preds = %24
%66 = load i8**, i8*** %5
%67 = getelementptr inbounds i8*, i8** %66, i64 3
%68 = load i8*, i8** %67
%69 = load i32*, i32** %6
%70 = call i32 @findFiles(i8* %68, i32* %69, i32* %7)
%71 = load i8**, i8*** %5
%72 = getelementptr inbounds i8*, i8** %71, i64 2
%73 = load i8*, i8** %72
%74 = load i32*, i32** %6
%75 = call i32 @outputMatrix(i8* %73, i32* %74, i32* %7)
br label %92
76: ; preds = %24
%77 = load i8**, i8*** %5
%78 = getelementptr inbounds i8*, i8** %77, i64 2
%79 = load i8*, i8** %78
%80 = load i32*, i32** %6
%81 = call i32 @findFiles(i8* %79, i32* %80, i32* %7)
br label %92
82: ; preds = %24
%83 = load i8**, i8*** %5
%84 = getelementptr inbounds i8*, i8** %83, i64 0
%85 = load i8*, i8** %84
%86 = call i32 @printHelp(i8* %85)
br label %92
87: ; preds = %24
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i64 0
%90 = load i8*, i8** %89
%91 = call i32 @printHelp(i8* %90)
br label %92
92: ; preds = %87, %82, %76, %65, %51, %37, %31
br label %98
93: ; preds = %16
%94 = load i8**, i8*** %5
%95 = getelementptr inbounds i8*, i8** %94, i64 0
%96 = load i8*, i8** %95
%97 = call i32 @printHelp(i8* %96)
br label %98
98: ; preds = %93, %92
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = tail call i32* @malloc(i32 4096)
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = icmp slt i32 %0, 3
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %1
%9 = tail call i32 @printHelp(i8* %8)
br label %10
10: ; preds = %7, %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 45
br i1 %14, label %15, label %54
15: ; preds = %10
%16 = getelementptr inbounds i8, i8* %12, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
switch i32 %18, label %51 [
i32 102, label %19
i32 120, label %23
i32 110, label %29
i32 100, label %37
i32 101, label %44
i32 104, label %48
]
19: ; preds = %15
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = call i32 @findFiles(i8* %21, i32* %4, i32* %3)
br label %57
23: ; preds = %15
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @findFiles(i8* %25, i32* %4, i32* %3)
%27 = load i8*, i8** %24
%28 = call i32 @extractFiles(i8* %27, i8* %27, i32* %4, i32* %3)
br label %57
29: ; preds = %15
%30 = getelementptr inbounds i8*, i8** %1, i64 3
%31 = load i8*, i8** %30
%32 = call i32 @findFiles(i8* %31, i32* %4, i32* %3)
%33 = load i8*, i8** %30
%34 = getelementptr inbounds i8*, i8** %1, i64 2
%35 = load i8*, i8** %34
%36 = call i32 @extractFiles(i8* %33, i8* %35, i32* %4, i32* %3)
br label %57
37: ; preds = %15
%38 = getelementptr inbounds i8*, i8** %1, i64 3
%39 = load i8*, i8** %38
%40 = call i32 @findFiles(i8* %39, i32* %4, i32* %3)
%41 = getelementptr inbounds i8*, i8** %1, i64 2
%42 = load i8*, i8** %41
%43 = call i32 @outputMatrix(i8* %42, i32* %4, i32* %3)
br label %57
44: ; preds = %15
%45 = getelementptr inbounds i8*, i8** %1, i64 2
%46 = load i8*, i8** %45
%47 = call i32 @findFiles(i8* %46, i32* %4, i32* %3)
br label %57
48: ; preds = %15
%49 = load i8*, i8** %1
%50 = tail call i32 @printHelp(i8* %49)
br label %57
51: ; preds = %15
%52 = load i8*, i8** %1
%53 = tail call i32 @printHelp(i8* %52)
br label %57
54: ; preds = %10
%55 = load i8*, i8** %1
%56 = tail call i32 @printHelp(i8* %55)
br label %57
57: ; preds = %19, %23, %29, %37, %44, %48, %51, %54
ret i32 0
}