// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/pileup.c
// Function: main
int main(int argc, char **argv) {
    ptest_t g = { NULL, NULL, NULL };
    int use_mpileup = 0, opt;

    while ((opt = getopt(argc, argv, "m")) != -1) {
        switch (opt) {
        case 'm':
            use_mpileup = 1;
            break;
        default:
            fprintf(stderr, "Usage: %s [-m] <sorted.sam>\n", argv[0]);
            return EXIT_FAILURE;
        }
    }

    if (optind >= argc) {
        fprintf(stderr, "Usage: %s [-m] <sorted.sam>\n", argv[0]);
        return EXIT_FAILURE;
    }

    g.fname = argv[optind];
    g.fp = sam_open(g.fname, "r");
    if (!g.fp) {
        fprintf(stderr, "Couldn't open \"%s\" : %s", g.fname, strerror(errno));
        goto fail;
    }
    g.fp_hdr = sam_hdr_read(g.fp);
    if (!g.fp_hdr) {
        fprintf(stderr, "Couldn't read header from \"%s\" : %s",
                g.fname, strerror(errno));
        goto fail;
    }

    if (use_mpileup) {
        if (test_mpileup(&g) < 0)
            goto fail;
    } else {
        if (test_pileup(&g) < 0)
            goto fail;
    }

    sam_hdr_destroy(g.fp_hdr);
    sam_close(g.fp);

    return EXIT_SUCCESS;

 fail:
    if (g.fp_hdr) sam_hdr_destroy(g.fp_hdr);
    if (g.fp) sam_close(g.fp);
    return EXIT_FAILURE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movl %edi, %ebp
movq $0x0, 0x30(%rsp)
movb $0x1, %cl
leaq 0x8a5ba(%rip), %r14     # 0x904cb
movl %ecx, %r15d
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x40f0
xorl %ecx, %ecx
cmpl $0x6d, %eax
je 0x5f11
cmpl $-0x1, %eax
jne 0x61f7
movq 0xaa0a0(%rip), %rax     # 0xaffd8
movslq (%rax), %rax
cmpl %ebp, %eax
jge 0x6201
movq (%rbx,%rax,8), %rbx
movq %rbx, 0x20(%rsp)
leaq 0x8c05b(%rip), %rsi     # 0x91fae
movq %rbx, %rdi
callq 0x9668
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x6213
movq %rax, %rdi
callq 0x19201
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x6220
testb $0x1, %r15b
je 0x5ff5
movl $0x0, 0x4(%rsp)
leaq 0x349(%rip), %rdi       # 0x62dd
leaq 0x20(%rsp), %rsi
callq 0x23482
movq %rax, %rbx
testq %rax, %rax
je 0x622a
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %rdx
leaq 0x4(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x24ebd
movq %rax, %r15
testq %rax, %rax
sete %al
movl (%r14), %edx
testl %edx, %edx
sets %cl
orb %al, %cl
je 0x60a1
cmpl $0x0, 0x4(%rsp)
js 0x624f
movq %rbx, %rdi
callq 0x2355b
jmp 0x6086
leaq 0x20(%rsp), %rax
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq $0x0, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
leaq 0x2c3(%rip), %rsi       # 0x62dd
movl $0x1, %edi
callq 0x24ff6
movq %rax, %rbx
testq %rax, %rax
je 0x6238
movq %rbx, %rdi
callq 0x250ef
testl %eax, %eax
js 0x6241
leaq 0x1c(%rsp), %r14
leaq 0x18(%rsp), %rdx
leaq 0x4(%rsp), %rcx
leaq 0x8(%rsp), %r8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x25381
testl %eax, %eax
setle %cl
movl (%r14), %edx
testl %edx, %edx
sets %sil
orb %cl, %sil
je 0x6146
testl %eax, %eax
js 0x625b
movq %rbx, %rdi
callq 0x25166
movq 0x30(%rsp), %rdi
callq 0x15ae2
movq 0x28(%rsp), %rdi
callq 0xa8ca
xorl %ebx, %ebx
jmp 0x62cc
leaq 0x8900f(%rip), %r14     # 0x8f0b7
leaq 0x10(%rsp), %r12
leaq 0x8(%rsp), %r13
leaq 0x4(%rsp), %rbp
movq 0x30(%rsp), %rax
movl (%rax), %ecx
cmpl %ecx, %edx
jge 0x6267
movq 0x20(%rax), %rax
movl %edx, %ecx
movq (%rax,%rcx,8), %rsi
movl 0x8(%rsp), %edx
incl %edx
movl 0x4(%rsp), %ecx
movq %r14, %rdi
xorl %eax, %eax
callq 0x4060
movl 0x4(%rsp), %esi
movq %r15, %rdi
callq 0x630f
testl %eax, %eax
js 0x627f
movl $0x9, %edi
callq 0x46d0
movl 0x4(%rsp), %esi
movq %r15, %rdi
callq 0x64e0
movl $0xa, %edi
callq 0x46d0
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x24ebd
testq %rax, %rax
je 0x5fdd
movq %rax, %r15
movl 0x10(%rsp), %edx
testl %edx, %edx
jns 0x60b7
jmp 0x5fdd
leaq 0x88f6a(%rip), %r14     # 0x8f0b7
leaq 0x1c(%rsp), %r15
leaq 0x18(%rsp), %r12
leaq 0x4(%rsp), %r13
leaq 0x8(%rsp), %rbp
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax), %ecx
cmpl %ecx, %edx
jge 0x6289
movq 0x20(%rax), %rax
movl %edx, %ecx
movq (%rax,%rcx,8), %rsi
movl 0x18(%rsp), %edx
incl %edx
movl 0x4(%rsp), %ecx
movq %r14, %rdi
xorl %eax, %eax
callq 0x4060
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
callq 0x630f
testl %eax, %eax
js 0x62a1
movl $0x9, %edi
callq 0x46d0
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
callq 0x64e0
movl $0xa, %edi
callq 0x46d0
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %rbp, %r8
callq 0x25381
testl %eax, %eax
jle 0x6076
movl 0x1c(%rsp), %edx
testl %edx, %edx
jns 0x6161
jmp 0x6076
movq %rbx, %rdi
callq 0x4abf
jmp 0x6209
movq %rbx, %rdi
callq 0x49e0
movl $0x1, %ebx
jmp 0x62cc
movq %rbx, %rdi
callq 0x4a84
jmp 0x62a9
movq %rbx, %rdi
callq 0x4a49
jmp 0x62a9
leaq 0x88e2c(%rip), %rdi     # 0x8f05d
callq 0x43e0
jmp 0x627f
leaq 0x88e1e(%rip), %rdi     # 0x8f05d
jmp 0x6248
leaq 0x88e22(%rip), %rdi     # 0x8f06a
callq 0x43e0
jmp 0x62a1
leaq 0x20(%rsp), %rdi
callq 0x4a25
jmp 0x627f
leaq 0x10(%rsp), %rdi
callq 0x49fe
jmp 0x62a1
movq 0xa9d62(%rip), %rax     # 0xaffd0
movq (%rax), %rdi
leaq 0x88e84(%rip), %rsi     # 0x8f0fc
xorl %eax, %eax
callq 0x4720
movq %rbx, %rdi
callq 0x2355b
jmp 0x62a9
movq 0xa9d40(%rip), %rax     # 0xaffd0
movq (%rax), %rdi
leaq 0x88de7(%rip), %rsi     # 0x8f081
xorl %eax, %eax
callq 0x4720
movq %rbx, %rdi
callq 0x25166
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x62b8
callq 0x15ae2
movq 0x28(%rsp), %rdi
movl $0x1, %ebx
testq %rdi, %rdi
je 0x62cc
callq 0xa8ca
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq