// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/sam.c
// Function: bam_mplp64_auto
int bam_mplp64_auto(bam_mplp_t iter, int *_tid, hts_pos_t *_pos, int *n_plp, const bam_pileup1_t **plp)
{
    int i, ret = 0;
    hts_pos_t new_min_pos = HTS_POS_MAX;
    uint32_t new_min_tid = (uint32_t)-1;
    for (i = 0; i < iter->n; ++i) {
        if (iter->pos[i] == iter->min_pos && iter->tid[i] == iter->min_tid) {
            int tid;
            hts_pos_t pos;
            iter->plp[i] = bam_plp64_auto(iter->iter[i], &tid, &pos, &iter->n_plp[i]);
            if ( iter->iter[i]->error ) return -1;
            if (iter->plp[i]) {
                iter->tid[i] = tid;
                iter->pos[i] = pos;
            } else {
                iter->tid[i] = 0;
                iter->pos[i] = 0;
            }
        }
        if (iter->plp[i]) {
            if (iter->tid[i] < new_min_tid) {
                new_min_tid = iter->tid[i];
                new_min_pos = iter->pos[i];
            } else if (iter->tid[i] == new_min_tid && iter->pos[i] < new_min_pos) {
                new_min_pos = iter->pos[i];
            }
        }
    }
    iter->min_pos = new_min_pos;
    iter->min_tid = new_min_tid;
    if (new_min_pos == HTS_POS_MAX) return 0;
    *_tid = new_min_tid; *_pos = new_min_pos;
    for (i = 0; i < iter->n; ++i) {
        if (iter->pos[i] == iter->min_pos && iter->tid[i] == iter->min_tid) {
            n_plp[i] = iter->n_plp[i], plp[i] = iter->plp[i];
            ++ret;
        } else n_plp[i] = 0, plp[i] = 0;
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl $0x0, -0x38(%rbp)
movabsq $0x7fffffff7fffffff, %rax # imm = 0x7FFFFFFF7FFFFFFF
movq %rax, -0x40(%rbp)
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x451a2
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x45101
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x45101
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movslq -0x34(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rcx
leaq -0x48(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x44a10
movq %rax, %rdx
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x38(%rax)
je 0x4509d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x452a6
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x450d8
movl -0x48(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x50(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x450ff
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
jmp 0x45101
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x45192
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x44(%rbp), %eax
jae 0x45150
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
jmp 0x45190
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x44(%rbp), %eax
jne 0x4518e
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x40(%rbp), %rax
jge 0x4518e
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
jmp 0x45190
jmp 0x45192
jmp 0x45194
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x44fef
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x44(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movabsq $0x7fffffff7fffffff, %rax # imm = 0x7FFFFFFF7FFFFFFF
cmpq %rax, -0x40(%rbp)
jne 0x451d4
movl $0x0, -0x4(%rbp)
jmp 0x452a6
movl -0x44(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x40(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x452a0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x45271
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x45271
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x45290
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
jmp 0x45292
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x451ef
movl -0x38(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop