#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*/ compress(char *, int);
int /*<<< orphan*/ decompress(char *);
int /*<<< orphan*/ maxCompress(char *);
int /*<<< orphan*/ multipleCompress(char *, char *);
int /*<<< orphan*/ multipleDecompress(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc <= 1) {
    printf("Please, enter:\n -c <file path> to compress\n -d <file path> to "
           "decompress\n -m<c or d> <quantity> <file path>\n");
    return (1);
  }
  if (argv[1][1] == 'c')
    compress(argv[2], false);
  else if (argv[1][1] == 'd')
    decompress(argv[2]);
  else if (argv[1][1] == 'a') {
    compress(argv[2], false);
    decompress(argv[3]);
  } else if (argv[1][1] == 'm') {
    if (argv[1][2] == 'c')
      multipleCompress(argv[2], argv[3]);
    else if (argv[1][2] == 'd')
      multipleDecompress(argv[2], argv[3]);
    else if (argv[1][2] == 'm')
      maxCompress(argv[2]);
  } else
    printf("Please, enter:\n -c <file path> to compress\n -d <file path> to "
           "decompress\n -m<c or d> <quantity> <file path>\n");
  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   $0x1,-0x8(%rbp)
jg     1198 <main+0x38>
lea    0xe79(%rip),%rdi
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12e4 <main+0x184>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x63,%eax
jne    11c1 <main+0x61>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %esi,%esi
call   1030 <compress@plt>
jmp    12dd <main+0x17d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x64,%eax
jne    11e8 <main+0x88>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <decompress@plt>
jmp    12d8 <main+0x178>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x61,%eax
jne    121e <main+0xbe>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %esi,%esi
call   1030 <compress@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <decompress@plt>
jmp    12d3 <main+0x173>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6d,%eax
jne    12c2 <main+0x162>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x2(%rax),%eax
cmp    $0x63,%eax
jne    1262 <main+0x102>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1040 <multipleCompress@plt>
jmp    12bd <main+0x15d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x2(%rax),%eax
cmp    $0x64,%eax
jne    1291 <main+0x131>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1050 <multipleDecompress@plt>
jmp    12b8 <main+0x158>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x2(%rax),%eax
cmp    $0x6d,%eax
jne    12b3 <main+0x153>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <maxCompress@plt>
jmp    12b8 <main+0x158>
jmp    12bd <main+0x15d>
jmp    12ce <main+0x16e>
lea    0xd37(%rip),%rdi
call   1060 <printf@plt>
jmp    12d3 <main+0x173>
jmp    12d8 <main+0x178>
jmp    12dd <main+0x17d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x1,%edi
jg     117e <main+0x1e>
lea    0xec5(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%ebp
jmp    1203 <main+0xa3>
mov    %rsi,%rbx
mov    0x8(%rsi),%rax
mov    0x1(%rax),%cl
add    $0x9f,%cl
cmp    $0xc,%cl
ja     11f5 <main+0x95>
movzbl %cl,%ecx
lea    0xe66(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    0x10(%rbx),%rdi
xor    %ebp,%ebp
xor    %esi,%esi
call   1030 <compress@plt>
mov    0x18(%rbx),%rdi
call   1080 <decompress@plt>
jmp    1203 <main+0xa3>
mov    0x10(%rbx),%rdi
xor    %ebp,%ebp
xor    %esi,%esi
call   1030 <compress@plt>
jmp    1203 <main+0xa3>
mov    0x10(%rbx),%rdi
call   1080 <decompress@plt>
jmp    1201 <main+0xa1>
mov    0x2(%rax),%al
xor    %ebp,%ebp
cmp    $0x6d,%al
je     120c <main+0xac>
cmp    $0x64,%al
je     1217 <main+0xb7>
cmp    $0x63,%al
jne    1203 <main+0xa3>
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rsi
call   1040 <multipleCompress@plt>
jmp    1203 <main+0xa3>
lea    0xe38(%rip),%rdi
call   1050 <puts@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x10(%rbx),%rdi
call   1070 <maxCompress@plt>
jmp    1203 <main+0xa3>
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rsi
call   1060 <multipleDecompress@plt>
jmp    1203 <main+0xa3>

LLVM IR (-O0):
@.str = [109 x i8] c"Please, enter:\0A -c <file path> to compress\0A -d <file path> to decompress\0A -m<c or d> <quantity> <file path>\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 sle i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %115
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 99
br i1 %17, label %18, label %23
18: ; preds = %10
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = call i32 @compress(i8* %21, i32 0)
br label %114
23: ; preds = %10
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 100
br i1 %30, label %31, label %36
31: ; preds = %23
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = call i32 @decompress(i8* %34)
br label %113
36: ; preds = %23
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = getelementptr inbounds i8, i8* %39, i64 1
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 97
br i1 %43, label %44, label %53
44: ; preds = %36
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
%48 = call i32 @compress(i8* %47, i32 0)
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 3
%51 = load i8*, i8** %50
%52 = call i32 @decompress(i8* %51)
br label %112
53: ; preds = %36
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %55
%57 = getelementptr inbounds i8, i8* %56, i64 1
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 109
br i1 %60, label %61, label %109
61: ; preds = %53
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 1
%64 = load i8*, i8** %63
%65 = getelementptr inbounds i8, i8* %64, i64 2
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 99
br i1 %68, label %69, label %77
69: ; preds = %61
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 2
%72 = load i8*, i8** %71
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 3
%75 = load i8*, i8** %74
%76 = call i32 @multipleCompress(i8* %72, i8* %75)
br label %108
77: ; preds = %61
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 1
%80 = load i8*, i8** %79
%81 = getelementptr inbounds i8, i8* %80, i64 2
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 100
br i1 %84, label %85, label %93
85: ; preds = %77
%86 = load i8**, i8*** %5
%87 = getelementptr inbounds i8*, i8** %86, i64 2
%88 = load i8*, i8** %87
%89 = load i8**, i8*** %5
%90 = getelementptr inbounds i8*, i8** %89, i64 3
%91 = load i8*, i8** %90
%92 = call i32 @multipleDecompress(i8* %88, i8* %91)
br label %107
93: ; preds = %77
%94 = load i8**, i8*** %5
%95 = getelementptr inbounds i8*, i8** %94, i64 1
%96 = load i8*, i8** %95
%97 = getelementptr inbounds i8, i8* %96, i64 2
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 109
br i1 %100, label %101, label %106
101: ; preds = %93
%102 = load i8**, i8*** %5
%103 = getelementptr inbounds i8*, i8** %102, i64 2
%104 = load i8*, i8** %103
%105 = call i32 @maxCompress(i8* %104)
br label %106
106: ; preds = %101, %93
br label %107
107: ; preds = %106, %85
br label %108
108: ; preds = %107, %69
br label %111
109: ; preds = %53
%110 = call i32 @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0))
br label %111
111: ; preds = %109, %108
br label %112
112: ; preds = %111, %44
br label %113
113: ; preds = %112, %31
br label %114
114: ; preds = %113, %18
store i32 0, i32* %3
br label %115
115: ; preds = %114, %8
%116 = load i32, i32* %3
ret i32 %116
}

LLVM IR (-O2):
@str.1 = [108 x i8] c"Please, enter:\0A -c <file path> to compress\0A -d <file path> to decompress\0A -m<c or d> <quantity> <file path>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @str.1, i64 0, i64 0))
br label %47
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
switch i8 %10, label %45 [
i8 99, label %11
i8 100, label %15
i8 97, label %19
i8 109, label %26
]
11: ; preds = %6
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @compress(i8* %13, i32 0)
br label %47
15: ; preds = %6
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i32 @decompress(i8* %17)
br label %47
19: ; preds = %6
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = tail call i32 @compress(i8* %21, i32 0)
%23 = getelementptr inbounds i8*, i8** %1, i64 3
%24 = load i8*, i8** %23
%25 = tail call i32 @decompress(i8* %24)
br label %47
26: ; preds = %6
%27 = getelementptr inbounds i8, i8* %8, i64 2
%28 = load i8, i8* %27
switch i8 %28, label %47 [
i8 99, label %29
i8 100, label %35
i8 109, label %41
]
29: ; preds = %26
%30 = getelementptr inbounds i8*, i8** %1, i64 2
%31 = load i8*, i8** %30
%32 = getelementptr inbounds i8*, i8** %1, i64 3
%33 = load i8*, i8** %32
%34 = tail call i32 @multipleCompress(i8* %31, i8* %33)
br label %47
35: ; preds = %26
%36 = getelementptr inbounds i8*, i8** %1, i64 2
%37 = load i8*, i8** %36
%38 = getelementptr inbounds i8*, i8** %1, i64 3
%39 = load i8*, i8** %38
%40 = tail call i32 @multipleDecompress(i8* %37, i8* %39)
br label %47
41: ; preds = %26
%42 = getelementptr inbounds i8*, i8** %1, i64 2
%43 = load i8*, i8** %42
%44 = tail call i32 @maxCompress(i8* %43)
br label %47
45: ; preds = %6
%46 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @str.1, i64 0, i64 0))
br label %47
47: ; preds = %11, %19, %29, %41, %35, %45, %15, %26, %4
%48 = phi i32 [ 1, %4 ], [ 0, %26 ], [ 0, %15 ], [ 0, %45 ], [ 0, %35 ], [ 0, %41 ], [ 0, %29 ], [ 0, %19 ], [ 0, %11 ]
ret i32 %48
}