#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*/ compression_main(int, char const **);
int /*<<< orphan*/ decompression_main(int, char const **);
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  switch ((int)argv[1][0]) {
  case 'c':
    compression_main(argc, argv);
    return 1;
  case 'd':
    decompression_main(argc, argv);
    return 1;
  default:
    printf("ERROR: use 'c' for compression or 'd' for decompression as first "
           "argument.\n");
    return 0;
  }
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x63,%eax
je     1173 <main+0x43>
jmp    1162 <main+0x32>
mov    -0x14(%rbp),%eax
sub    $0x64,%eax
je     118b <main+0x5b>
jmp    11a3 <main+0x73>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <compression_main@plt>
movl   $0x1,-0x4(%rbp)
jmp    11b6 <main+0x86>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <decompression_main@plt>
movl   $0x1,-0x4(%rbp)
jmp    11b6 <main+0x86>
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rax
movsbl (%rax),%eax
cmp    $0x64,%eax
je     1149 <main+0x19>
cmp    $0x63,%eax
jne    1155 <main+0x25>
call   1040 <compression_main@plt>
jmp    114e <main+0x1e>
call   1050 <decompression_main@plt>
mov    $0x1,%eax
pop    %rcx
ret
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"ERROR: use 'c' for compression or 'd' for decompression as first argument.\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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
switch i32 %11, label %20 [
i32 99, label %12
i32 100, label %16
]
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @compression_main(i32 %13, i8** %14)
store i32 1, i32* %3
br label %22
16: ; preds = %2
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = call i32 @decompression_main(i32 %17, i8** %18)
store i32 1, i32* %3
br label %22
20: ; preds = %2
%21 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %22
22: ; preds = %20, %16, %12
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@str = [75 x i8] c"ERROR: use 'c' for compression or 'd' for decompression as first argument.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %11 [
i32 99, label %7
i32 100, label %9
]
7: ; preds = %2
%8 = tail call i32 @compression_main(i32 %0, i8** %1)
br label %13
9: ; preds = %2
%10 = tail call i32 @decompression_main(i32 %0, i8** %1)
br label %13
11: ; preds = %2
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
br label %13
13: ; preds = %11, %9, %7
%14 = phi i32 [ 0, %11 ], [ 1, %9 ], [ 1, %7 ]
ret i32 %14
}