// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x28(%rsp)
movq %rsi, %rbx
movl %edi, %ebp
movb $0x1, %cl
leaq 0x6ca37(%rip), %r14     # 0x72515
movl %ecx, %r15d
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x40f0
xorl %ecx, %ecx
cmpl $0x6d, %eax
je 0x5ade
cmpl $-0x1, %eax
jne 0x5d41
movq 0x914d3(%rip), %rax     # 0x96fd8
movslq (%rax), %rax
cmpl %ebp, %eax
jge 0x5d41
movq (%rbx,%rax,8), %rbx
movq %rbx, 0x18(%rsp)
leaq 0x6e459(%rip), %rsi     # 0x73f79
movq %rbx, %rdi
callq 0x832f
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x5d64
movq %rax, %rdi
callq 0x15e6e
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x5d83
testb $0x1, %r15b
je 0x5c16
andl $0x0, 0x4(%rsp)
leaq 0x330(%rip), %rdi       # 0x5e92
leaq 0x18(%rsp), %rsi
callq 0x1c852
movq %rax, %rbx
testq %rax, %rax
je 0x5db2
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
leaq 0x4(%rsp), %r12
pushq $0xa
popq %rbp
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x1dc10
testq %rax, %rax
je 0x5d01
movl 0x10(%rsp), %edx
testl %edx, %edx
js 0x5d01
movq %rax, %r13
movq 0x28(%rsp), %rax
movl (%rax), %ecx
cmpl %ecx, %edx
jge 0x5ddf
movq 0x20(%rax), %rax
movq (%rax,%rdx,8), %rsi
movl 0x8(%rsp), %edx
incl %edx
movl 0x4(%rsp), %ecx
leaq 0x6b4dc(%rip), %rdi     # 0x710b7
xorl %eax, %eax
callq 0x4060
movl 0x4(%rsp), %esi
movq %r13, %rdi
callq 0x5ec3
testl %eax, %eax
js 0x5e16
pushq $0x9
popq %rdi
callq 0x46d0
movl 0x4(%rsp), %esi
movq %r13, %rdi
callq 0x6083
movl %ebp, %edi
callq 0x46d0
jmp 0x5b8a
leaq 0x18(%rsp), %rax
leaq 0x10(%rsp), %rdx
andq $0x0, 0x8(%rsp)
movq %rax, (%rdx)
andl $0x0, 0x4(%rsp)
leaq 0x25d(%rip), %rsi       # 0x5e92
pushq $0x1
popq %rdi
callq 0x1dccd
movq %rax, %rbx
testq %rax, %rax
je 0x5dc0
movq %rbx, %rdi
callq 0x1ddb7
testl %eax, %eax
js 0x5dc9
leaq 0x30(%rsp), %r15
leaq 0x4(%rsp), %r12
leaq 0x8(%rsp), %r13
leaq 0x6b448(%rip), %rbp     # 0x710b7
pushq $0xa
popq %r14
movq %rbx, %rdi
leaq 0x34(%rsp), %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x1dfed
testl %eax, %eax
jle 0x5d16
movl 0x34(%rsp), %edx
testl %edx, %edx
js 0x5d16
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax), %ecx
cmpl %ecx, %edx
jge 0x5e50
movq 0x20(%rax), %rax
movq (%rax,%rdx,8), %rsi
movl 0x30(%rsp), %edx
incl %edx
movl 0x4(%rsp), %ecx
movq %rbp, %rdi
xorl %eax, %eax
callq 0x4060
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
callq 0x5ec3
testl %eax, %eax
js 0x5dd5
pushq $0x9
popq %rdi
callq 0x46d0
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
callq 0x6083
movl %r14d, %edi
callq 0x46d0
jmp 0x5c73
cmpl $0x0, 0x4(%rsp)
js 0x5df9
movq %rbx, %rdi
callq 0x1c911
jmp 0x5d26
testl %eax, %eax
js 0x5e6d
movq %rbx, %rdi
callq 0x1de05
movq 0x28(%rsp), %rdi
callq 0x12e3e
movq 0x20(%rsp), %rdi
callq 0x9505
xorl %ebx, %ebx
jmp 0x5e3f
movq 0x91288(%rip), %rax     # 0x96fd0
movq (%rax), %rdi
movq (%rbx), %rdx
leaq 0x6b2af(%rip), %rsi     # 0x71004
xorl %eax, %eax
callq 0x4720
pushq $0x1
popq %rbx
jmp 0x5e3f
movq 0x91265(%rip), %rax     # 0x96fd0
movq (%rax), %r14
callq 0x4050
movl (%rax), %edi
callq 0x4160
leaq 0x6b2a0(%rip), %rsi     # 0x71021
jmp 0x5da0
movq 0x91246(%rip), %rax     # 0x96fd0
movq (%rax), %r14
callq 0x4050
movl (%rax), %edi
callq 0x4160
leaq 0x6b299(%rip), %rsi     # 0x71039
movq %r14, %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4720
jmp 0x5e1e
leaq 0x6b2a4(%rip), %rdi     # 0x7105d
callq 0x43e0
jmp 0x5e16
leaq 0x6b296(%rip), %rdi     # 0x7105d
jmp 0x5dd0
leaq 0x6b29a(%rip), %rdi     # 0x7106a
callq 0x43e0
movq %rbx, %rdi
callq 0x1de05
jmp 0x5e1e
movq 0x911ea(%rip), %rax     # 0x96fd0
movq (%rax), %rdi
leaq 0x6b30c(%rip), %rsi     # 0x710fc
xorl %eax, %eax
callq 0x4720
jmp 0x5e16
movq 0x911d0(%rip), %rax     # 0x96fd0
movq (%rax), %rdi
movq 0x18(%rsp), %rdx
leaq 0x6b2b2(%rip), %rsi     # 0x710c1
xorl %eax, %eax
callq 0x4720
movq %rbx, %rdi
callq 0x1c911
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x5e2d
callq 0x12e3e
movq 0x20(%rsp), %rdi
pushq $0x1
popq %rbx
testq %rdi, %rdi
je 0x5e3f
callq 0x9505
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x91179(%rip), %rax     # 0x96fd0
movq (%rax), %rdi
leaq 0x6b220(%rip), %rsi     # 0x71081
xorl %eax, %eax
callq 0x4720
jmp 0x5dd5
movq 0x9115c(%rip), %rax     # 0x96fd0
movq (%rax), %rdi
movq 0x10(%rsp), %rax
movq (%rax), %rdx
leaq 0x6b23b(%rip), %rsi     # 0x710c1
xorl %eax, %eax
callq 0x4720
jmp 0x5dd5