#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 ILBM_ILBMtoACBM(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getopt(int, char **, char *);
char *optarg;
int /*<<< orphan*/ printUsage(char *);
int /*<<< orphan*/ printVersion(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  char *inputFilename = NULL;
  char *outputFilename = NULL;
  int c;
  while ((c = getopt(argc, argv, "i:o:hv")) != -1) {
    switch (c) {
    case 'i':
      inputFilename = optarg;
      break;
    case 'o':
      outputFilename = optarg;
      break;
    case 'h':
      printUsage(argv[0]);
      return 0;
    case '?':
      printUsage(argv[0]);
      return 1;
    case 'v':
      printVersion(argv[0]);
      return 0;
    }
  }
  if (inputFilename == NULL && outputFilename == NULL) {
    fprintf(
        stderr,
        "ERROR: At least an input file or output file must be specified!\n");
    return 1;
  } else
    return ILBM_ILBMtoACBM(inputFilename, outputFilename);
}


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)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe7c(%rip),%rdx
call   1070 <getopt@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
je     1260 <main+0x110>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x3f,%eax
je     122b <main+0xdb>
jmp    11a9 <main+0x59>
mov    -0x28(%rbp),%eax
sub    $0x68,%eax
je     1213 <main+0xc3>
jmp    11ba <main+0x6a>
mov    -0x28(%rbp),%eax
sub    $0x69,%eax
je     11ed <main+0x9d>
jmp    11cb <main+0x7b>
mov    -0x28(%rbp),%eax
sub    $0x6f,%eax
je     1200 <main+0xb0>
jmp    11dc <main+0x8c>
mov    -0x28(%rbp),%eax
sub    $0x76,%eax
je     1243 <main+0xf3>
jmp    125b <main+0x10b>
mov    0x2e04(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    125b <main+0x10b>
mov    0x2df1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    125b <main+0x10b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <printUsage@plt>
movl   $0x0,-0x4(%rbp)
jmp    12a7 <main+0x157>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <printUsage@plt>
movl   $0x1,-0x4(%rbp)
jmp    12a7 <main+0x157>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <printVersion@plt>
movl   $0x0,-0x4(%rbp)
jmp    12a7 <main+0x157>
jmp    1176 <main+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1297 <main+0x147>
cmpq   $0x0,-0x20(%rbp)
jne    1297 <main+0x147>
mov    0x2d5b(%rip),%rax
mov    (%rax),%edi
lea    0xd81(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12a7 <main+0x157>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <ILBM_ILBMtoACBM@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   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %r14d,%r14d
lea    0xed2(%rip),%r12
lea    0xe8f(%rip),%r13
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1070 <getopt@plt>
lea    -0x68(%rax),%ecx
cmp    $0xe,%ecx
ja     11b0 <main+0x60>
movslq 0x0(%r13,%rcx,4),%rax
add    %r13,%rax
jmp    *%rax
mov    0x2e52(%rip),%rax
mov    (%rax),%r14
jmp    1180 <main+0x30>
nopl   0x0(%rax,%rax,1)
cmp    $0xffffffff,%eax
je     11eb <main+0x9b>
cmp    $0x3f,%eax
jne    1180 <main+0x30>
jmp    120f <main+0xbf>
mov    0x2e35(%rip),%rax
mov    (%rax),%r15
jmp    1180 <main+0x30>
mov    (%rbx),%rdi
call   1060 <printUsage@plt>
jmp    11da <main+0x8a>
mov    (%rbx),%rdi
call   1040 <printVersion@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14,%rax
or     %r15,%rax
jne    121e <main+0xce>
mov    0x2dde(%rip),%rax
mov    (%rax),%edi
lea    0xe40(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
jmp    11dc <main+0x8c>
mov    (%rbx),%rdi
call   1060 <printUsage@plt>
mov    $0x1,%eax
jmp    11dc <main+0x8c>
mov    %r14,%rdi
mov    %r15,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <ILBM_ILBMtoACBM@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"i:o:hv\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [65 x i8] c"ERROR: At least an input file or output file must be specified!\0A\00"
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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %7
br label %9
9: ; preds = %35, %2
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @getopt(i32 %10, i8** %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %12, i32* %8
%13 = icmp ne i32 %12, -1
br i1 %13, label %14, label %36
14: ; preds = %9
%15 = load i32, i32* %8
switch i32 %15, label %35 [
i32 105, label %16
i32 111, label %18
i32 104, label %20
i32 63, label %25
i32 118, label %30
]
16: ; preds = %14
%17 = load i8*, i8** @optarg
store i8* %17, i8** %6
br label %35
18: ; preds = %14
%19 = load i8*, i8** @optarg
store i8* %19, i8** %7
br label %35
20: ; preds = %14
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i32 @printUsage(i8* %23)
store i32 0, i32* %3
br label %49
25: ; preds = %14
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 0
%28 = load i8*, i8** %27
%29 = call i32 @printUsage(i8* %28)
store i32 1, i32* %3
br label %49
30: ; preds = %14
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 0
%33 = load i8*, i8** %32
%34 = call i32 @printVersion(i8* %33)
store i32 0, i32* %3
br label %49
35: ; preds = %14, %18, %16
br label %9
36: ; preds = %9
%37 = load i8*, i8** %6
%38 = icmp eq i8* %37, null
br i1 %38, label %39, label %45
39: ; preds = %36
%40 = load i8*, i8** %7
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = load i32, i32* @stderr
%44 = call i32 @fprintf(i32 %43, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %49
45: ; preds = %39, %36
%46 = load i8*, i8** %6
%47 = load i8*, i8** %7
%48 = call i32 @ILBM_ILBMtoACBM(i8* %46, i8* %47)
store i32 %48, i32* %3
br label %49
49: ; preds = %45, %42, %30, %25, %20
%50 = load i32, i32* %3
ret i32 %50
}

LLVM IR (-O2):
@.str = [7 x i8] c"i:o:hv\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [65 x i8] c"ERROR: At least an input file or output file must be specified!\0A\00"
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %10, %2
%4 = phi i8* [ %11, %10 ], [ null, %2 ]
%5 = phi i8* [ %7, %10 ], [ null, %2 ]
br label %6
6: ; preds = %3, %12
%7 = phi i8* [ %5, %3 ], [ %13, %12 ]
br label %8
8: ; preds = %6, %8
%9 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
switch i32 %9, label %8 [
i32 -1, label %23
i32 105, label %10
i32 111, label %12
i32 104, label %14
i32 63, label %17
i32 118, label %20
]
10: ; preds = %8
%11 = load i8*, i8** @optarg
br label %3
12: ; preds = %8
%13 = load i8*, i8** @optarg
br label %6
14: ; preds = %8
%15 = load i8*, i8** %1
%16 = tail call i32 @printUsage(i8* %15)
br label %32
17: ; preds = %8
%18 = load i8*, i8** %1
%19 = tail call i32 @printUsage(i8* %18)
br label %32
20: ; preds = %8
%21 = load i8*, i8** %1
%22 = tail call i32 @printVersion(i8* %21)
br label %32
23: ; preds = %8
%24 = icmp eq i8* %4, null
%25 = icmp eq i8* %7, null
%26 = select i1 %24, i1 %25, i1 false
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i32, i32* @stderr
%29 = tail call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
br label %32
30: ; preds = %23
%31 = tail call i32 @ILBM_ILBMtoACBM(i8* %4, i8* %7)
br label %32
32: ; preds = %30, %27, %20, %17, %14
%33 = phi i32 [ 0, %20 ], [ 1, %17 ], [ 0, %14 ], [ 1, %27 ], [ %31, %30 ]
ret i32 %33
}