// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/pileup.c
// Function: test_mpileup
static int test_mpileup(ptest_t *input) {
    bam_mplp_t iter = NULL;
    const bam_pileup1_t *pileups[1] = { NULL };
    int n_plp[1] = { 0 };
    int tid, pos, n = 0;

    iter = bam_mplp_init(1, readaln, (void **) &input);
    if (!iter) {
        perror("bam_plp_init");
        goto fail;
    }
    if (bam_mplp_init_overlaps(iter) < 0) {
        perror("bam_mplp_init_overlaps");
        goto fail;
    }

    while ((n = bam_mplp_auto(iter, &tid, &pos, n_plp, pileups)) > 0) {
        if (tid < 0) break;
        if (tid >= input->fp_hdr->n_targets) {
            fprintf(stderr,
                    "bam_mplp_auto returned tid %d >= header n_targets %d\n",
                    tid, input->fp_hdr->n_targets);
            goto fail;
        }

        printf("%s\t%d\t%d\t", input->fp_hdr->target_name[tid], pos+1, n_plp[0]);

        if (print_pileup_seq(pileups[0], n_plp[0]) < 0)
            goto fail;

        putchar('\t');
        print_pileup_qual(pileups[0], n_plp[0]);

        putchar('\n');
    }
    if (n < 0) {
        fprintf(stderr, "bam_plp_auto failed for \"%s\"\n", input->fname);
        goto fail;
    }

    bam_mplp_destroy(iter);
    return 0;

 fail:
    bam_mplp_destroy(iter);
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x4260
leaq -0x24(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x4260
movl $0x0, -0x30(%rbp)
movl $0x1, %edi
leaq 0x2d9(%rip), %rsi       # 0x5fe0
leaq -0x10(%rbp), %rdx
callq 0x30cc0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5d2c
leaq 0xe033b(%rip), %rdi     # 0xe605d
callq 0x43d0
jmp 0x5e52
movq -0x18(%rbp), %rdi
callq 0x30e10
cmpl $0x0, %eax
jge 0x5d4b
leaq 0xe0329(%rip), %rdi     # 0xe606a
callq 0x43d0
jmp 0x5e52
jmp 0x5d4d
movq -0x18(%rbp), %rdi
leaq -0x24(%rbp), %rcx
leaq -0x20(%rbp), %r8
leaq -0x28(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
callq 0x31250
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
jle 0x5e19
cmpl $0x0, -0x28(%rbp)
jge 0x5d7d
jmp 0x5e19
movl -0x28(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
cmpl (%rcx), %eax
jl 0x5db6
movq 0xfe245(%rip), %rax     # 0x103fd8
movq (%rax), %rdi
movl -0x28(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl (%rax), %ecx
leaq 0xe02d7(%rip), %rsi     # 0xe6081
movb $0x0, %al
callq 0x46f0
jmp 0x5e52
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl -0x2c(%rbp), %edx
addl $0x1, %edx
movl -0x24(%rbp), %ecx
leaq 0xe02dd(%rip), %rdi     # 0xe60b7
movb $0x0, %al
callq 0x4060
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x6040
cmpl $0x0, %eax
jge 0x5df4
jmp 0x5e52
movl $0x9, %edi
callq 0x46a0
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x62f0
movl $0xa, %edi
callq 0x46a0
jmp 0x5d4d
cmpl $0x0, -0x30(%rbp)
jge 0x5e40
movq 0xfe1b2(%rip), %rax     # 0x103fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0xe028a(%rip), %rsi     # 0xe60c1
movb $0x0, %al
callq 0x46f0
jmp 0x5e52
movq -0x18(%rbp), %rdi
callq 0x30ec0
movl $0x0, -0x4(%rbp)
jmp 0x5e62
movq -0x18(%rbp), %rdi
callq 0x30ec0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)