#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 */
typedef int /*<<< orphan*/ gzFile;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ gzclose(int /*<<< orphan*/);
int /*<<< orphan*/ gzdopen(int /*<<< orphan*/, char *);
int /*<<< orphan*/ gzopen(char *, char *);
int /*<<< orphan*/ maq2tam_core(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  gzFile fp;
  if (argc == 1) {
    fprintf(stderr, "Version: %s\n", "r439");
    fprintf(stderr, "Usage: maq2sam <in.map> [<readGroup>]\n");
    return 1;
  }
  fp =
      strcmp(argv[1], "-") ? gzopen(argv[1], "r") : gzdopen(fileno(stdin), "r");
  maq2tam_core(fp, argc > 2 ? argv[2] : 0);
  gzclose(fp);
  return 0;
}


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)
cmpl   $0x1,-0x8(%rbp)
jne    11d1 <main+0x61>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
lea    0xe60(%rip),%rsi
lea    0xe66(%rip),%rdx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2e23(%rip),%rax
mov    (%rax),%edi
lea    0xe54(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1277 <main+0x107>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe59(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     120b <main+0x9b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3d(%rip),%rsi
call   1090 <gzopen@plt>
mov    %eax,-0x18(%rbp)
jmp    122a <main+0xba>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
call   1070 <fileno@plt>
mov    %eax,%edi
lea    0xe19(%rip),%rsi
call   1040 <gzdopen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1251 <main+0xe1>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    125c <main+0xec>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    125c <main+0xec>
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1080 <maq2tam_core@plt>
mov    -0x14(%rbp),%edi
call   1030 <gzclose@plt>
movl   $0x0,-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
cmp    $0x1,%edi
jne    11b1 <main+0x41>
mov    0x2e55(%rip),%rbx
mov    (%rbx),%edi
lea    0xe74(%rip),%rsi
lea    0xe7a(%rip),%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe6f(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%ebx
jmp    121b <main+0xab>
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe78(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11dd <main+0x6d>
mov    0x8(%r14),%rdi
lea    0xe65(%rip),%rsi
call   1090 <gzopen@plt>
jmp    11f9 <main+0x89>
mov    0x2e04(%rip),%rax
mov    (%rax),%edi
call   1070 <fileno@plt>
lea    0xe49(%rip),%rsi
mov    %eax,%edi
call   1040 <gzdopen@plt>
mov    %eax,%r15d
xor    %ebx,%ebx
cmp    $0x3,%ebp
jl     1209 <main+0x99>
mov    0x10(%r14),%rsi
jmp    120b <main+0x9b>
xor    %esi,%esi
mov    %r15d,%edi
call   1080 <maq2tam_core@plt>
mov    %r15d,%edi
call   1030 <gzclose@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"Version: %s\0A\00"
@.str.1 = [5 x i8] c"r439\00"
@.str.2 = [39 x i8] c"Usage: maq2sam <in.map> [<readGroup>]\0A\00"
@.str.3 = [2 x i8] c"-\00"
@.str.4 = [2 x i8] c"r\00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %44
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %14
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @gzopen(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %29
25: ; preds = %14
%26 = load i32, i32* @stdin
%27 = call i32 @fileno(i32 %26)
%28 = call i32 @gzdopen(i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %29
29: ; preds = %25, %20
%30 = phi i32 [ %24, %20 ], [ %28, %25 ]
store i32 %30, i32* %6
%31 = load i32, i32* %6
%32 = load i32, i32* %4
%33 = icmp sgt i32 %32, 2
br i1 %33, label %34, label %38
34: ; preds = %29
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
br label %39
38: ; preds = %29
br label %39
39: ; preds = %38, %34
%40 = phi i8* [ %37, %34 ], [ null, %38 ]
%41 = call i32 @maq2tam_core(i32 %31, i8* %40)
%42 = load i32, i32* %6
%43 = call i32 @gzclose(i32 %42)
store i32 0, i32* %3
br label %44
44: ; preds = %39, %9
%45 = load i32, i32* %3
ret i32 %45
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"Version: %s\0A\00"
@.str.1 = [5 x i8] c"r439\00"
@.str.2 = [39 x i8] c"Usage: maq2sam <in.map> [<readGroup>]\0A\00"
@.str.3 = [2 x i8] c"-\00"
@.str.4 = [2 x i8] c"r\00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
br label %31
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %9
%15 = load i8*, i8** %10
%16 = tail call i32 @gzopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %21
17: ; preds = %9
%18 = load i32, i32* @stdin
%19 = tail call i32 @fileno(i32 %18)
%20 = tail call i32 @gzdopen(i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %21
21: ; preds = %17, %14
%22 = phi i32 [ %16, %14 ], [ %20, %17 ]
%23 = icmp sgt i32 %0, 2
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = getelementptr inbounds i8*, i8** %1, i64 2
%26 = load i8*, i8** %25
br label %27
27: ; preds = %21, %24
%28 = phi i8* [ %26, %24 ], [ null, %21 ]
%29 = tail call i32 @maq2tam_core(i32 %22, i8* %28)
%30 = tail call i32 @gzclose(i32 %22)
br label %31
31: ; preds = %27, %4
%32 = phi i32 [ 1, %4 ], [ 0, %27 ]
ret i32 %32
}