#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*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ decompress(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char getopt(int, char **, char *);
int /*<<< orphan*/ optarg;
int optind;
int /*<<< orphan*/ printHelp(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ startCompress(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  char *document = NULL;
  char option;
  int help = 0;
  int index;
  while ((option = getopt(argc, argv, "z:u:h")) != -1)
    switch (option) {
    case 'z':
      startCompress(optarg);
      break;
    case 'u':
      decompress(optarg);
      break;
    case 'h':
    default:
      help = 1;
    }
  for (index = optind; index < argc; index++) {
    printf("\n\tNon-option argument %s\n", argv[index]);
    help = 1;
  }
  if (help || argc < 2) {
    printHelp(argv[0]);
    exit(EXIT_FAILURE);
  }
  return EXIT_SUCCESS;
}


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)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe6d(%rip),%rdx
call   1060 <getopt@plt>
mov    %al,-0x19(%rbp)
movsbl %al,%eax
cmp    $0xffffffff,%eax
je     1215 <main+0xb5>
movsbl -0x19(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x68,%eax
je     1204 <main+0xa4>
jmp    11bc <main+0x5c>
mov    -0x28(%rbp),%eax
sub    $0x75,%eax
je     11f1 <main+0x91>
jmp    11cd <main+0x6d>
mov    -0x28(%rbp),%eax
sub    $0x7a,%eax
jne    1209 <main+0xa9>
jmp    11de <main+0x7e>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
call   1050 <startCompress@plt>
jmp    1210 <main+0xb0>
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
call   1080 <decompress@plt>
jmp    1210 <main+0xb0>
jmp    1209 <main+0xa9>
movl   $0x1,-0x20(%rbp)
jmp    1185 <main+0x25>
mov    0x2dc4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    125a <main+0xfa>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xdc6(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1221 <main+0xc1>
cmpl   $0x0,-0x20(%rbp)
jne    126e <main+0x10e>
cmpl   $0x2,-0x8(%rbp)
jge    1288 <main+0x128>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <printHelp@plt>
mov    0x2d4f(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    0x2d39(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%r13d
lea    0xe88(%rip),%rdx
call   1060 <getopt@plt>
cmp    $0xff,%al
je     11dc <main+0x7c>
xor    %ebp,%ebp
mov    0x2e6e(%rip),%r12
lea    0xe6f(%rip),%r15
jmp    11bf <main+0x5f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r12),%edi
call   1080 <decompress@plt>
mov    %ebp,%ebx
mov    %r13d,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <getopt@plt>
mov    %ebx,%ebp
cmp    $0xff,%al
je     11de <main+0x7e>
movsbl %al,%eax
cmp    $0x75,%eax
je     11a0 <main+0x40>
mov    $0x1,%ebx
cmp    $0x7a,%eax
jne    11ab <main+0x4b>
mov    (%r12),%edi
call   1050 <startCompress@plt>
jmp    11a9 <main+0x49>
xor    %ebx,%ebx
mov    0x2dfb(%rip),%rax
movslq (%rax),%rax
cmp    %r13d,%eax
jl     120f <main+0xaf>
cmp    $0x2,%r13d
jl     1235 <main+0xd5>
test   %ebx,%ebx
jne    1235 <main+0xd5>
mov    0x2dca(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    (%r14,%rax,8),%rbx
sub    %eax,%r13d
xor    %ebp,%ebp
lea    0xde7(%rip),%r15
nop
mov    (%rbx,%rbp,8),%rsi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %ebp,%r13d
jne    1220 <main+0xc0>
mov    (%r14),%rdi
call   1030 <printHelp@plt>
mov    0x2d8c(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"z:u:h\00"
@optarg = global i32 0
@optind = global i32 0
@.str.1 = [26 x i8] c"\0A\09Non-option argument %s\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i32 0, i32* %8
br label %10
10: ; preds = %27, %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call signext i8 @getopt(i32 %11, i8** %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8 %13, i8* %7
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, -1
br i1 %15, label %16, label %28
16: ; preds = %10
%17 = load i8, i8* %7
%18 = sext i8 %17 to i32
switch i32 %18, label %26 [
i32 122, label %19
i32 117, label %22
i32 104, label %25
]
19: ; preds = %16
%20 = load i32, i32* @optarg
%21 = call i32 @startCompress(i32 %20)
br label %27
22: ; preds = %16
%23 = load i32, i32* @optarg
%24 = call i32 @decompress(i32 %23)
br label %27
25: ; preds = %16
br label %26
26: ; preds = %16, %25
store i32 1, i32* %8
br label %27
27: ; preds = %26, %22, %19
br label %10
28: ; preds = %10
%29 = load i32, i32* @optind
store i32 %29, i32* %9
br label %30
30: ; preds = %41, %28
%31 = load i32, i32* %9
%32 = load i32, i32* %4
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %44
34: ; preds = %30
%35 = load i8**, i8*** %5
%36 = load i32, i32* %9
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %35, i64 %37
%39 = load i8*, i8** %38
%40 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %39)
store i32 1, i32* %8
br label %41
41: ; preds = %34
%42 = load i32, i32* %9
%43 = add nsw i32 %42, 1
store i32 %43, i32* %9
br label %30
44: ; preds = %30
%45 = load i32, i32* %8
%46 = icmp ne i32 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %44
%48 = load i32, i32* %4
%49 = icmp slt i32 %48, 2
br i1 %49, label %50, label %57
50: ; preds = %47, %44
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 0
%53 = load i8*, i8** %52
%54 = call i32 @printHelp(i8* %53)
%55 = load i32, i32* @EXIT_FAILURE
%56 = call i32 @exit(i32 %55)
unreachable
57: ; preds = %47
%58 = load i32, i32* @EXIT_SUCCESS
ret i32 %58
}

LLVM IR (-O2):
@.str = [6 x i8] c"z:u:h\00"
@optarg = global i32 0
@optind = global i32 0
@.str.1 = [26 x i8] c"\0A\09Non-option argument %s\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8 %3, -1
br i1 %4, label %19, label %5
5: ; preds = %2, %15
%6 = phi i8 [ %17, %15 ], [ %3, %2 ]
%7 = phi i32 [ %16, %15 ], [ 0, %2 ]
%8 = sext i8 %6 to i32
switch i32 %8, label %15 [
i32 122, label %9
i32 117, label %12
]
9: ; preds = %5
%10 = load i32, i32* @optarg
%11 = tail call i32 @startCompress(i32 %10)
br label %15
12: ; preds = %5
%13 = load i32, i32* @optarg
%14 = tail call i32 @decompress(i32 %13)
br label %15
15: ; preds = %5, %12, %9
%16 = phi i32 [ %7, %12 ], [ %7, %9 ], [ 1, %5 ]
%17 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i8 %17, -1
br i1 %18, label %19, label %5
19: ; preds = %15, %2
%20 = phi i32 [ 0, %2 ], [ %16, %15 ]
%21 = load i32, i32* @optind
%22 = icmp slt i32 %21, %0
br i1 %22, label %23, label %33
23: ; preds = %19
%24 = sext i32 %21 to i64
br label %25
25: ; preds = %23, %25
%26 = phi i64 [ %24, %23 ], [ %30, %25 ]
%27 = getelementptr inbounds i8*, i8** %1, i64 %26
%28 = load i8*, i8** %27
%29 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = add nsw i64 %26, 1
%31 = trunc i64 %30 to i32
%32 = icmp eq i32 %31, %0
br i1 %32, label %37, label %25
33: ; preds = %19
%34 = icmp ne i32 %20, 0
%35 = icmp slt i32 %0, 2
%36 = or i1 %35, %34
br i1 %36, label %37, label %42
37: ; preds = %25, %33
%38 = load i8*, i8** %1
%39 = tail call i32 @printHelp(i8* %38)
%40 = load i32, i32* @EXIT_FAILURE
%41 = tail call i32 @exit(i32 %40)
unreachable
42: ; preds = %33
%43 = load i32, i32* @EXIT_SUCCESS
ret i32 %43
}