// File: /workspace/github_c_makefile_star2_O1/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
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x1, %cl
leaq 0x8c562(%rip), %r14     # 0x9246b
movl %ecx, %r15d
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x40f0
xorl %ecx, %ecx
cmpl $0x6d, %eax
je 0x5f09
cmpl $-0x1, %eax
jne 0x61ec
movq 0xab0a8(%rip), %rax     # 0xb0fd8
movslq (%rax), %rax
cmpl %ebp, %eax
jge 0x61f6
movq (%rbx,%rax,8), %rdi
movq %rdi, 0x20(%rsp)
leaq 0x8e0bc(%rip), %rsi     # 0x94007
callq 0x99cb
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x6208
movq %rax, %rdi
callq 0x1987d
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x6217
testb $0x1, %r15b
je 0x5fea
movl $0x0, 0x4(%rsp)
leaq 0x34d(%rip), %rdi       # 0x62d6
leaq 0x20(%rsp), %rsi
callq 0x23e56
movq %rax, %rbx
testq %rax, %rax
je 0x6223
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %rdx
leaq 0x4(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x25cea
movq %rax, %r15
testq %rax, %rax
sete %al
movl (%r14), %edx
testl %edx, %edx
sets %cl
orb %al, %cl
je 0x6096
cmpl $0x0, 0x4(%rsp)
js 0x6248
movq %rbx, %rdi
callq 0x23f46
jmp 0x607b
leaq 0x20(%rsp), %rax
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq $0x0, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
leaq 0x2c7(%rip), %rsi       # 0x62d6
movl $0x1, %edi
callq 0x25e1a
movq %rax, %rbx
testq %rax, %rax
je 0x6231
movq %rbx, %rdi
callq 0x25f13
testl %eax, %eax
js 0x623a
leaq 0x1c(%rsp), %r14
leaq 0x18(%rsp), %rdx
leaq 0x4(%rsp), %rcx
leaq 0x8(%rsp), %r8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2619f
testl %eax, %eax
setle %cl
movl (%r14), %edx
testl %edx, %edx
sets %sil
orb %cl, %sil
je 0x613b
testl %eax, %eax
js 0x6254
movq %rbx, %rdi
callq 0x25f8a
movq 0x30(%rsp), %rdi
callq 0x16146
movq 0x28(%rsp), %rdi
callq 0xac35
xorl %ebx, %ebx
jmp 0x62c5
leaq 0x8b01a(%rip), %r14     # 0x910b7
leaq 0x10(%rsp), %r12
leaq 0x8(%rsp), %r13
leaq 0x4(%rsp), %rbp
movq 0x30(%rsp), %rax
movl (%rax), %ecx
cmpl %ecx, %edx
jge 0x6260
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 0x6308
testl %eax, %eax
js 0x6278
movl $0x9, %edi
callq 0x46d0
movl 0x4(%rsp), %esi
movq %r15, %rdi
callq 0x64ed
movl $0xa, %edi
callq 0x46d0
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x25cea
testq %rax, %rax
je 0x5fd2
movq %rax, %r15
movl 0x10(%rsp), %edx
testl %edx, %edx
jns 0x60ac
jmp 0x5fd2
leaq 0x8af75(%rip), %r14     # 0x910b7
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 0x6282
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 0x6308
testl %eax, %eax
js 0x629a
movl $0x9, %edi
callq 0x46d0
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
callq 0x64ed
movl $0xa, %edi
callq 0x46d0
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %rbp, %r8
callq 0x2619f
testl %eax, %eax
jle 0x606b
movl 0x1c(%rsp), %edx
testl %edx, %edx
jns 0x6156
jmp 0x606b
movq %rbx, %rdi
callq 0x4abf
jmp 0x61fe
movq %rbx, %rdi
callq 0x49e0
movl $0x1, %ebx
jmp 0x62c5
leaq 0x20(%rsp), %rdi
callq 0x4a84
jmp 0x62a2
leaq 0x20(%rsp), %rdi
callq 0x4a49
jmp 0x62a2
leaq 0x8ae33(%rip), %rdi     # 0x9105d
callq 0x43e0
jmp 0x6278
leaq 0x8ae25(%rip), %rdi     # 0x9105d
jmp 0x6241
leaq 0x8ae29(%rip), %rdi     # 0x9106a
callq 0x43e0
jmp 0x629a
leaq 0x20(%rsp), %rdi
callq 0x4a25
jmp 0x6278
leaq 0x10(%rsp), %rdi
callq 0x49fe
jmp 0x629a
movq 0xaad69(%rip), %rax     # 0xb0fd0
movq (%rax), %rdi
leaq 0x8ae8b(%rip), %rsi     # 0x910fc
xorl %eax, %eax
callq 0x4720
movq %rbx, %rdi
callq 0x23f46
jmp 0x62a2
movq 0xaad47(%rip), %rax     # 0xb0fd0
movq (%rax), %rdi
leaq 0x8adee(%rip), %rsi     # 0x91081
xorl %eax, %eax
callq 0x4720
movq %rbx, %rdi
callq 0x25f8a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x62b1
callq 0x16146
movq 0x28(%rsp), %rdi
movl $0x1, %ebx
testq %rdi, %rdi
je 0x62c5
callq 0xac35
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq