#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 _8SVX_prettyPrint(char *, int);
int getopt(int, char **, char *);
int optind;
int /*<<< orphan*/ printUsage(char *);
int /*<<< orphan*/ printVersion(char *);
int main(int argc, char *argv[]) {
  int options = 0;
  char *filename;
  int c;
  while ((c = getopt(argc, argv, "chv")) != -1) {
    switch (c) {
    case 'c':
      options |= 0x01;
      break;
    case 'h':
      printUsage(argv[0]);
      return 0;
    case '?':
      printUsage(argv[0]);
      return 1;
    case 'v':
      printVersion(argv[0]);
      return 0;
    }
  }
  if (optind >= argc)
    filename = NULL;
  else
    filename = argv[optind];
  return _8SVX_prettyPrint(filename, options);
}


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)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe95(%rip),%rdx
call   1060 <getopt@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
je     121e <main+0xde>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x3f,%eax
je     11e9 <main+0xa9>
jmp    1190 <main+0x50>
mov    -0x28(%rbp),%eax
sub    $0x63,%eax
je     11c3 <main+0x83>
jmp    11a1 <main+0x61>
mov    -0x28(%rbp),%eax
sub    $0x68,%eax
je     11d1 <main+0x91>
jmp    11b2 <main+0x72>
mov    -0x28(%rbp),%eax
sub    $0x76,%eax
je     1201 <main+0xc1>
jmp    1219 <main+0xd9>
mov    -0x14(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1219 <main+0xd9>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <printUsage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1262 <main+0x122>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <printUsage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1262 <main+0x122>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <printVersion@plt>
movl   $0x0,-0x4(%rbp)
jmp    1262 <main+0x122>
jmp    115d <main+0x1d>
mov    0x2dc3(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jl     123d <main+0xfd>
movq   $0x0,-0x20(%rbp)
jmp    1253 <main+0x113>
mov    -0x10(%rbp),%rax
mov    0x2da0(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <_8SVX_prettyPrint@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %r14d,%r14d
lea    0xeaa(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1060 <getopt@plt>
cmp    $0x62,%eax
jle    1190 <main+0x50>
cmp    $0x63,%eax
je     119c <main+0x5c>
cmp    $0x76,%eax
je     11a4 <main+0x64>
cmp    $0x68,%eax
jne    1160 <main+0x20>
jmp    11ae <main+0x6e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0xffffffff,%eax
je     11ba <main+0x7a>
cmp    $0x3f,%eax
jne    1160 <main+0x20>
jmp    11ce <main+0x8e>
mov    $0x1,%r14d
jmp    1160 <main+0x20>
mov    (%rbx),%rdi
call   1040 <printVersion@plt>
jmp    11b6 <main+0x76>
mov    (%rbx),%rdi
call   1050 <printUsage@plt>
xor    %eax,%eax
jmp    11db <main+0x9b>
mov    0x2e27(%rip),%rax
movslq (%rax),%rax
cmp    %ebp,%eax
jge    11e6 <main+0xa6>
mov    (%rbx,%rax,8),%rdi
jmp    11e8 <main+0xa8>
mov    (%rbx),%rdi
call   1050 <printUsage@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edi,%edi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <_8SVX_prettyPrint@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"chv\00"
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %9
9: ; preds = %34, %2
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @getopt(i32 %10, i8** %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %12, i32* %8
%13 = icmp ne i32 %12, -1
br i1 %13, label %14, label %35
14: ; preds = %9
%15 = load i32, i32* %8
switch i32 %15, label %34 [
i32 99, label %16
i32 104, label %19
i32 63, label %24
i32 118, label %29
]
16: ; preds = %14
%17 = load i32, i32* %6
%18 = or i32 %17, 1
store i32 %18, i32* %6
br label %34
19: ; preds = %14
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 @printUsage(i8* %22)
store i32 0, i32* %3
br label %50
24: ; preds = %14
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = call i32 @printUsage(i8* %27)
store i32 1, i32* %3
br label %50
29: ; preds = %14
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = call i32 @printVersion(i8* %32)
store i32 0, i32* %3
br label %50
34: ; preds = %14, %16
br label %9
35: ; preds = %9
%36 = load i32, i32* @optind
%37 = load i32, i32* %4
%38 = icmp sge i32 %36, %37
br i1 %38, label %39, label %40
39: ; preds = %35
store i8* null, i8** %7
br label %46
40: ; preds = %35
%41 = load i8**, i8*** %5
%42 = load i32, i32* @optind
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %41, i64 %43
%45 = load i8*, i8** %44
store i8* %45, i8** %7
br label %46
46: ; preds = %40, %39
%47 = load i8*, i8** %7
%48 = load i32, i32* %6
%49 = call i32 @_8SVX_prettyPrint(i8* %47, i32 %48)
store i32 %49, i32* %3
br label %50
50: ; preds = %46, %29, %24, %19
%51 = load i32, i32* %3
ret i32 %51
}

LLVM IR (-O2):
@.str = [4 x i8] c"chv\00"
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %5, %2
%4 = phi i32 [ 0, %2 ], [ 1, %5 ]
br label %5
5: ; preds = %3, %5
%6 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
switch i32 %6, label %5 [
i32 -1, label %16
i32 99, label %3
i32 104, label %7
i32 63, label %10
i32 118, label %13
]
7: ; preds = %5
%8 = load i8*, i8** %1
%9 = tail call i32 @printUsage(i8* %8)
br label %26
10: ; preds = %5
%11 = load i8*, i8** %1
%12 = tail call i32 @printUsage(i8* %11)
br label %26
13: ; preds = %5
%14 = load i8*, i8** %1
%15 = tail call i32 @printVersion(i8* %14)
br label %26
16: ; preds = %5
%17 = load i32, i32* @optind
%18 = icmp slt i32 %17, %0
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = sext i32 %17 to i64
%21 = getelementptr inbounds i8*, i8** %1, i64 %20
%22 = load i8*, i8** %21
br label %23
23: ; preds = %16, %19
%24 = phi i8* [ %22, %19 ], [ null, %16 ]
%25 = tail call i32 @_8SVX_prettyPrint(i8* %24, i32 %4)
br label %26
26: ; preds = %23, %13, %10, %7
%27 = phi i32 [ 0, %13 ], [ 1, %10 ], [ 0, %7 ], [ %25, %23 ]
ret i32 %27
}