// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/sam.c
// Function: bam_plp64_auto
const bam_pileup1_t *bam_plp64_auto(bam_plp_t iter, int *_tid, hts_pos_t *_pos, int *_n_plp)
{
    const bam_pileup1_t *plp;
    if (iter->func == 0 || iter->error) { *_n_plp = -1; return 0; }
    if ((plp = bam_plp64_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
    else { // no pileup line can be obtained; read alignments
        *_n_plp = 0;
        if (iter->is_eof) return 0;
        int ret;
        while ( (ret=iter->func(iter->data, iter->b)) >= 0) {
            if (bam_plp_push(iter, iter->b) < 0) {
                *_n_plp = -1;
                return 0;
            }
            if ((plp = bam_plp64_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
            // otherwise no pileup line can be returned; read the next alignment.
        }
        if ( ret < -1 ) { iter->error = ret; *_n_plp = -1; return 0; }
        if (bam_plp_push(iter, 0) < 0) {
            *_n_plp = -1;
            return 0;
        }
        if ((plp = bam_plp64_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
        return 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x44a3d
movq -0x10(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0x44a54
movq -0x28(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq $0x0, -0x8(%rbp)
jmp 0x44b98
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x43830
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x44a80
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x44b98
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0x44aa1
movq $0x0, -0x8(%rbp)
jmp 0x44b98
jmp 0x44aa3
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x60(%rcx), %rdi
movq -0x10(%rbp), %rcx
movq 0x50(%rcx), %rsi
callq *%rax
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jl 0x44b1d
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rsi
callq 0x444a0
cmpl $0x0, %eax
jge 0x44af2
movq -0x28(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq $0x0, -0x8(%rbp)
jmp 0x44b98
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x43830
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x44b1b
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x44b98
jmp 0x44aa3
cmpl $-0x1, -0x34(%rbp)
jge 0x44b41
movl -0x34(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x28(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq $0x0, -0x8(%rbp)
jmp 0x44b98
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x444a0
cmpl $0x0, %eax
jge 0x44b67
movq -0x28(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq $0x0, -0x8(%rbp)
jmp 0x44b98
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x43830
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x44b90
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x44b98
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)