// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x4260
movl $0x0, -0x2c(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0xe1a46(%rip), %rdx     # 0xe7541
callq 0x40d0
movl %eax, -0x30(%rbp)
cmpl $-0x1, %eax
je 0x5b48
movl -0x30(%rbp), %eax
subl $0x6d, %eax
jne 0x5b1b
jmp 0x5b12
movl $0x1, -0x2c(%rbp)
jmp 0x5b46
movq 0xfe4b6(%rip), %rax     # 0x103fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0xe04d1(%rip), %rsi     # 0xe6004
movb $0x0, %al
callq 0x46f0
movl $0x1, -0x4(%rbp)
jmp 0x5caf
jmp 0x5aed
movq 0xfe491(%rip), %rax     # 0x103fe0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jl 0x5b81
movq 0xfe47b(%rip), %rax     # 0x103fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0xe0496(%rip), %rsi     # 0xe6004
movb $0x0, %al
callq 0x46f0
movl $0x1, -0x4(%rbp)
jmp 0x5caf
movq -0x10(%rbp), %rax
movq 0xfe454(%rip), %rcx     # 0x103fe0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq 0xe36a2(%rip), %rsi     # 0xe9244
callq 0xa190
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x5bf2
movq 0xfe41f(%rip), %rax     # 0x103fd8
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
callq 0x4050
movl (%rax), %edi
callq 0x4140
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rdx
movq %rax, %rcx
leaq 0xe043b(%rip), %rsi     # 0xe6021
movb $0x0, %al
callq 0x46f0
jmp 0x5c88
movq -0x20(%rbp), %rdi
callq 0x23870
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5c43
movq 0xfe3cb(%rip), %rax     # 0x103fd8
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
callq 0x4050
movl (%rax), %edi
callq 0x4140
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq %rax, %rcx
leaq 0xe03ff(%rip), %rsi     # 0xe6039
movb $0x0, %al
callq 0x46f0
jmp 0x5c88
cmpl $0x0, -0x2c(%rbp)
je 0x5c5b
leaq -0x28(%rbp), %rdi
callq 0x5cc0
cmpl $0x0, %eax
jge 0x5c59
jmp 0x5c88
jmp 0x5c6d
leaq -0x28(%rbp), %rdi
callq 0x5e70
cmpl $0x0, %eax
jge 0x5c6b
jmp 0x5c88
jmp 0x5c6d
movq -0x18(%rbp), %rdi
callq 0x1de10
movq -0x20(%rbp), %rdi
callq 0xc2b0
movl $0x0, -0x4(%rbp)
jmp 0x5caf
cmpq $0x0, -0x18(%rbp)
je 0x5c98
movq -0x18(%rbp), %rdi
callq 0x1de10
cmpq $0x0, -0x20(%rbp)
je 0x5ca8
movq -0x20(%rbp), %rdi
callq 0xc2b0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)