#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 /*<<< orphan*/ descompress(char *);
int /*<<< orphan*/ print_ajuda();
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  switch (argc) {
  case 1:
  case 2:
    print_ajuda();
    break;
  default:
    if (!strcmp(argv[1], "h")) {
      print_ajuda();
    } else if (!strcmp(argv[1], "c")) {
      int i;
      for (i = 2; i < argc; i++) {
        compress(argv[i]);
      }
    } else if (!strcmp(argv[1], "d")) {
      int i;
      for (i = 2; i < argc; i++) {
        descompress(argv[i]);
      }
    }
    break;
  }
  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    -0x8(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x1,%eax
ja     1176 <main+0x36>
jmp    116a <main+0x2a>
mov    $0x0,%al
call   1060 <print_ajuda@plt>
jmp    1256 <main+0x116>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    119f <main+0x5f>
mov    $0x0,%al
call   1060 <print_ajuda@plt>
jmp    1251 <main+0x111>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe54(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11f3 <main+0xb3>
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ee <main+0xae>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <compress@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c3 <main+0x83>
jmp    124c <main+0x10c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe02(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1247 <main+0x107>
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1242 <main+0x102>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <descompress@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1217 <main+0xd7>
jmp    1247 <main+0x107>
jmp    124c <main+0x10c>
jmp    1251 <main+0x111>
jmp    1256 <main+0x116>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%r14d
lea    -0x1(%r14),%eax
cmp    $0x2,%eax
jb     11c4 <main+0x84>
mov    %rsi,%r12
mov    0x8(%rsi),%r15
lea    0xe9e(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11c4 <main+0x84>
lea    0xe8d(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11d9 <main+0x99>
lea    0xe7c(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    11cb <main+0x8b>
cmp    $0x3,%r14d
jl     11cb <main+0x8b>
mov    %r14d,%r14d
mov    $0x2,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r12,%rbx,8),%rdi
call   1050 <descompress@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    11b0 <main+0x70>
jmp    11cb <main+0x8b>
xor    %eax,%eax
call   1060 <print_ajuda@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
cmp    $0x3,%r14d
jl     11cb <main+0x8b>
mov    %r14d,%r14d
mov    $0x2,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r12,%rbx,8),%rdi
call   1030 <compress@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    11f0 <main+0xb0>
jmp    11cb <main+0x8b>

LLVM IR (-O0):
@.str = [2 x i8] c"h\00"
@.str.1 = [2 x i8] c"c\00"
@.str.2 = [2 x i8] c"d\00"
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 = load i32, i32* %4
switch i32 %8, label %11 [
i32 1, label %9
i32 2, label %9
]
9: ; preds = %2, %2
%10 = call i32 (...) @print_ajuda()
br label %66
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %11
%18 = call i32 (...) @print_ajuda()
br label %65
19: ; preds = %11
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %41, label %25
25: ; preds = %19
store i32 2, i32* %6
br label %26
26: ; preds = %37, %25
%27 = load i32, i32* %6
%28 = load i32, i32* %4
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %40
30: ; preds = %26
%31 = load i8**, i8*** %5
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %31, i64 %33
%35 = load i8*, i8** %34
%36 = call i32 @compress(i8* %35)
br label %37
37: ; preds = %30
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %26
40: ; preds = %26
br label %64
41: ; preds = %19
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = call i32 @strcmp(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%46 = icmp ne i32 %45, 0
br i1 %46, label %63, label %47
47: ; preds = %41
store i32 2, i32* %7
br label %48
48: ; preds = %59, %47
%49 = load i32, i32* %7
%50 = load i32, i32* %4
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %62
52: ; preds = %48
%53 = load i8**, i8*** %5
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %53, i64 %55
%57 = load i8*, i8** %56
%58 = call i32 @descompress(i8* %57)
br label %59
59: ; preds = %52
%60 = load i32, i32* %7
%61 = add nsw i32 %60, 1
store i32 %61, i32* %7
br label %48
62: ; preds = %48
br label %63
63: ; preds = %62, %41
br label %64
64: ; preds = %63, %40
br label %65
65: ; preds = %64, %17
br label %66
66: ; preds = %65, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"h\00"
@.str.1 = [2 x i8] c"c\00"
@.str.2 = [2 x i8] c"d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add i32 %0, -1
%4 = icmp ult i32 %3, 2
br i1 %4, label %38, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %38, label %10
10: ; preds = %5
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = icmp sgt i32 %0, 2
br i1 %14, label %15, label %40
15: ; preds = %13
%16 = zext i32 %0 to i64
br label %17
17: ; preds = %15, %17
%18 = phi i64 [ 2, %15 ], [ %22, %17 ]
%19 = getelementptr inbounds i8*, i8** %1, i64 %18
%20 = load i8*, i8** %19
%21 = tail call i32 @compress(i8* %20)
%22 = add nuw nsw i64 %18, 1
%23 = icmp eq i64 %22, %16
br i1 %23, label %40, label %17
24: ; preds = %10
%25 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
%27 = icmp sgt i32 %0, 2
%28 = and i1 %26, %27
br i1 %28, label %29, label %40
29: ; preds = %24
%30 = zext i32 %0 to i64
br label %31
31: ; preds = %29, %31
%32 = phi i64 [ 2, %29 ], [ %36, %31 ]
%33 = getelementptr inbounds i8*, i8** %1, i64 %32
%34 = load i8*, i8** %33
%35 = tail call i32 @descompress(i8* %34)
%36 = add nuw nsw i64 %32, 1
%37 = icmp eq i64 %36, %30
br i1 %37, label %40, label %31
38: ; preds = %5, %2
%39 = tail call i32 (...) @print_ajuda()
br label %40
40: ; preds = %31, %17, %38, %13, %24
ret i32 0
}