// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_plp_push
int bam_plp_push(bam_plp_t iter, const bam1_t *b)
{
    if (iter->error) return -1;
    if (b) {
        if (b->core.tid < 0) { overlap_remove(iter, b); return 0; }
        // Skip only unmapped reads here, any additional filtering must be done in iter->func
        if (b->core.flag & BAM_FUNMAP) { overlap_remove(iter, b); return 0; }
        if (iter->tid == b->core.tid && iter->pos == b->core.pos && iter->mp->cnt > iter->maxcnt)
        {
            overlap_remove(iter, b);
            return 0;
        }
        if (bam_copy1(&iter->tail->b, b) == NULL)
            return -1;
        iter->tail->b.id = iter->id++;
        iter->tail->beg = b->core.pos;
        // Use raw rlen rather than bam_endpos() which adjusts rlen=0 to rlen=1
        iter->tail->end = b->core.pos + bam_cigar2rlen(b->core.n_cigar, bam_get_cigar(b));
        iter->tail->s = g_cstate_null; iter->tail->s.end = iter->tail->end - 1; // initialize cstate_t
        if (b->core.tid < iter->max_tid) {
            hts_log_error("The input is not sorted (chromosomes out of order)");
            iter->error = 1;
            return -1;
        }
        if ((b->core.tid == iter->max_tid) && (iter->tail->beg < iter->max_pos)) {
            hts_log_error("The input is not sorted (reads out of order)");
            iter->error = 1;
            return -1;
        }
        iter->max_tid = b->core.tid; iter->max_pos = iter->tail->beg;
        if (iter->tail->end > iter->pos || iter->tail->b.core.tid > iter->tid) {
            lbnode_t *next = mp_alloc(iter->mp);
            if (!next) {
                iter->error = 1;
                return -1;
            }
            if (iter->plp_construct) {
                if (iter->plp_construct(iter->data, &iter->tail->b,
                                        &iter->tail->cd) < 0) {
                    mp_free(iter->mp, next);
                    iter->error = 1;
                    return -1;
                }
            }
            if (overlap_push(iter, iter->tail) < 0) {
                mp_free(iter->mp, next);
                iter->error = 1;
                return -1;
            }
            iter->tail->next = next;
            iter->tail = iter->tail->next;
        }
    } else iter->is_eof = 1;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
pushq $-0x1
popq %r12
cmpl $0x0, 0x38(%rdi)
je 0x27990
movl %r12d, %eax
jmp 0x279d8
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0x279cf
movl 0x8(%r14), %eax
testl %eax, %eax
js 0x279c2
testb $0x4, 0x10(%r14)
jne 0x279c2
cmpl %eax, 0x18(%rbx)
jne 0x279ea
movq 0x20(%rbx), %rax
cmpq (%r14), %rax
jne 0x279ea
movq (%rbx), %rax
movl (%rax), %eax
cmpl 0x3c(%rbx), %eax
jle 0x279ea
movq %rbx, %rdi
movq %r14, %rsi
callq 0x27878
jmp 0x279d6
movl $0x1, 0x30(%rbx)
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x1dfcb
testq %rax, %rax
je 0x2798b
movq 0x10(%rbx), %r15
movq 0x40(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x40(%rbx)
movq %rax, 0x30(%r15)
movq (%r14), %r13
movq %r13, 0x50(%r15)
movl 0x14(%r14), %edi
movzwl 0x12(%r14), %esi
addq 0x38(%r14), %rsi
callq 0x1e4e1
addq %r13, %rax
movq %rax, 0x58(%r15)
movupd 0x51a39(%rip), %xmm0    # 0x79470
andq $0x0, 0x70(%r15)
movupd %xmm0, 0x60(%r15)
movq 0x10(%rbx), %rax
movq 0x58(%rax), %rcx
leaq -0x1(%rcx), %rdx
movq %rdx, 0x70(%rax)
movl 0x8(%r14), %edx
cmpl 0x1c(%rbx), %edx
jge 0x27a7f
leaq 0x52413(%rip), %rsi     # 0x79e75
leaq 0x52419(%rip), %rdx     # 0x79e82
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x110c6
movl $0x1, 0x38(%rbx)
jmp 0x2798b
movq 0x50(%rax), %rsi
jne 0x27a9b
cmpq 0x28(%rbx), %rsi
jge 0x27a9b
leaq 0x523e3(%rip), %rsi     # 0x79e75
leaq 0x5241c(%rip), %rdx     # 0x79eb5
jmp 0x27a69
movl %edx, 0x1c(%rbx)
movq %rsi, 0x28(%rbx)
cmpq 0x20(%rbx), %rcx
jg 0x27ab6
movl 0x8(%rax), %ecx
xorl %eax, %eax
cmpl 0x18(%rbx), %ecx
jle 0x279d8
movq (%rbx), %rdi
callq 0x270a9
testq %rax, %rax
je 0x27a73
movq %rax, %r15
movq 0x70(%rbx), %rax
testq %rax, %rax
je 0x27ae8
movq 0x10(%rbx), %rsi
movq 0x60(%rbx), %rdi
leaq 0x80(%rsi), %rdx
callq *%rax
testl %eax, %eax
js 0x28190
movq 0x68(%rbx), %rdx
testq %rdx, %rdx
je 0x282f8
movq 0x10(%rbx), %r13
movzwl 0x10(%r13), %ebp
movl %ebp, %eax
andl $0xa, %eax
cmpw $0x2, %ax
jne 0x282f8
movl 0x1c(%r13), %eax
testl %eax, %eax
js 0x27b1f
cmpl %eax, 0x8(%r13)
jne 0x282f8
movq 0x28(%r13), %rax
movq %rax, %rcx
negq %rcx
cmovsq %rax, %rcx
movslq 0x18(%r13), %rsi
leaq (%rsi,%rsi), %rax
cmpq %rax, %rcx
jl 0x27b48
movq 0x20(%r13), %rax
cmpq 0x58(%r13), %rax
jge 0x282f8
movq %rsi, 0x30(%rsp)
movq 0x38(%r13), %r14
movq %rdx, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x29bd1
movq 0x8(%rsp), %rdx
movl %eax, %esi
cmpl (%rdx), %eax
jne 0x27bb3
movq %r14, 0x20(%rsp)
movq 0x20(%r13), %rax
cmpq (%r13), %rax
jge 0x27b93
testb $0x1, %bpl
sete %cl
cmpq $-0x1, %rax
setne %al
orb %cl, %al
jne 0x282f8
movl 0x8(%rdx), %eax
cmpl 0xc(%rdx), %eax
jb 0x2814d
movl 0x4(%rdx), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0x28138
decl %esi
jmp 0x2813a
movq %r15, 0x48(%rsp)
movq 0x20(%rdx), %rax
movl %esi, 0x9c(%rsp)
movl %esi, %ecx
movq (%rax,%rcx,8), %r9
movzwl 0x12(%r9), %r8d
addq 0x38(%r9), %r8
leaq 0x90(%rsp), %rdi
movq %r8, (%rdi)
movl 0x14(%r9), %ebp
movzwl 0x12(%r13), %eax
addq %rax, %r14
movq %r14, 0x78(%rsp)
movl 0x14(%r13), %eax
movq %rax, 0x18(%rsp)
leaq 0xa0(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x70(%rsp), %rcx
andq $0x0, (%rcx)
andq $0x0, 0x88(%rsp)
andq $0x0, 0x40(%rsp)
movq %r8, 0x80(%rsp)
leaq (%r8,%rbp,4), %rsi
movl 0x18(%r9), %r15d
movq %r13, 0x28(%rsp)
movq (%r13), %rax
movq %rax, 0x8(%rsp)
movq %r9, 0x10(%rsp)
subq (%r9), %rax
leaq 0x68(%rsp), %r8
movq %rax, (%r8)
andq $0x0, 0x38(%rsp)
movq %rsi, 0x58(%rsp)
callq 0x29f67
testl %eax, %eax
js 0x280fc
movq %rbp, 0x20(%rsp)
movl %eax, %ebp
movq 0x18(%rsp), %r13
leaq (%r14,%r13,4), %rsi
leaq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rdx
leaq 0x40(%rsp), %rcx
leaq 0x38(%rsp), %r8
movq %rsi, 0x60(%rsp)
callq 0x29f67
testl %eax, %eax
js 0x280fc
movq 0x20(%rsp), %rax
shll $0x2, %eax
addq %rax, 0x80(%rsp)
incl %r15d
sarl %r15d
movslq %r15d, %rax
movq %rax, 0x50(%rsp)
shll $0x2, %r13d
addq %r13, %r14
movq %r14, 0x20(%rsp)
movq 0x30(%rsp), %rax
incl %eax
sarl %eax
cltq
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %r15
movq 0x38(%r15), %rcx
movsbl (%rcx), %eax
xorl %r13d, %r13d
movl $0x0, %edx
testl %eax, %eax
je 0x27d04
incq %rcx
movsbl (%rcx), %edx
testl %edx, %edx
je 0x27cfd
imull $0x1f, %eax, %eax
addl %edx, %eax
jmp 0x27cec
movl %eax, %edx
movq 0x10(%rsp), %r15
movq 0x50(%rsp), %rax
addq 0x80(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x18(%rsp), %rax
addq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
movl %edx, %eax
shll $0xf, %eax
notl %eax
addl %edx, %eax
movl %eax, %ecx
shrl $0xa, %ecx
xorl %eax, %ecx
leal (%rcx,%rcx,8), %eax
movl %eax, %ecx
shrl $0x6, %ecx
xorl %eax, %ecx
movl %ecx, %eax
shll $0xb, %eax
notl %eax
addl %ecx, %eax
movl %eax, %ecx
shrl $0x10, %ecx
xorl %eax, %ecx
andl $0x1, %ecx
movl %ecx, %eax
xorl $0x1, %eax
movl %ecx, 0x30(%rsp)
cvtsi2sd %ecx, %xmm0
movsd 0x51829(%rip), %xmm1    # 0x79590
mulsd %xmm1, %xmm0
movsd %xmm0, 0xb0(%rsp)
movl %eax, 0x98(%rsp)
cvtsi2sd %eax, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0xa8(%rsp)
movl %ebp, %eax
movq 0x68(%rsp), %r14
testl %eax, %eax
js 0x27dd1
testq %r14, %r14
js 0x27dd1
movl %eax, %ebp
movq 0x8(%rsp), %rax
subq (%r15), %rax
cmpq %rax, %r14
jge 0x27ddb
leaq 0x90(%rsp), %rdi
movq 0x58(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
leaq 0x70(%rsp), %rcx
leaq 0x68(%rsp), %r8
callq 0x2a06f
jmp 0x27d8e
movl %eax, %ebp
testl %eax, %eax
js 0x2830c
movq 0x38(%rsp), %r15
testl %r13d, %r13d
js 0x27e25
testq %r15, %r15
js 0x27e25
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
subq %rax, %rcx
cmpq %rcx, %r15
jge 0x27e36
leaq 0x78(%rsp), %rdi
movq 0x60(%rsp), %rsi
leaq 0x88(%rsp), %rdx
leaq 0x40(%rsp), %rcx
leaq 0x38(%rsp), %r8
callq 0x2a06f
movl %eax, %r13d
jmp 0x27ddb
testl %r13d, %r13d
js 0x28309
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
addq %r14, %rcx
movq 0x8(%rsp), %rdx
cmpq %rcx, %rdx
cmovleq %rcx, %rdx
addq %r15, %rax
cmpq %rax, %rdx
cmovleq %rax, %rdx
incq %rdx
movq %rdx, 0x8(%rsp)
cmpq %rax, %rcx
jne 0x27f1b
movq 0x70(%rsp), %rdx
movq 0x10(%rsp), %r15
movslq 0x18(%r15), %rax
movb $0x1, %r14b
cmpq %rax, %rdx
jg 0x28108
movq 0x40(%rsp), %rax
movq 0x28(%rsp), %rcx
movslq 0x18(%rcx), %rcx
cmpq %rcx, %rax
jg 0x28108
movq %rdx, %rcx
sarq %rcx
movq 0x80(%rsp), %rsi
movzbl (%rsi,%rcx), %esi
leal (,%rdx,4), %ecx
notb %cl
andb $0x4, %cl
shrl %cl, %esi
movq %rax, %rcx
sarq %rcx
movq 0x20(%rsp), %rdi
movzbl (%rdi,%rcx), %edi
leal (,%rax,4), %ecx
notb %cl
andb $0x4, %cl
shrl %cl, %edi
xorl %esi, %edi
movq 0x50(%rsp), %r8
movzbl (%r8,%rdx), %ecx
testb $0xf, %dil
je 0x2806d
movq 0x18(%rsp), %rdi
movb (%rdi,%rax), %sil
cvtsi2sd %ecx, %xmm0
cmpb %sil, %cl
jbe 0x2809e
mulsd 0x51686(%rip), %xmm0    # 0x79590
cvttsd2si %xmm0, %ecx
movb %cl, (%r8,%rdx)
movb $0x0, (%rdi,%rax)
jmp 0x27d8c
jge 0x27fc5
movq 0x78(%rsp), %rax
movq 0x28(%rsp), %rdx
movzwl 0x12(%rdx), %ecx
addq 0x38(%rdx), %rcx
cmpq %rcx, %rax
jbe 0x27fc5
movl -0x4(%rax), %eax
andl $0xf, %eax
cmpl $0x2, %eax
jne 0x27fc5
movq 0x50(%rsp), %r14
movq 0x70(%rsp), %rax
cmpl $0x0, 0x30(%rsp)
jne 0x27f5c
xorl %ecx, %ecx
jmp 0x27f71
movzbl (%r14,%rax), %ecx
cvtsi2sd %ecx, %xmm0
mulsd 0x51623(%rip), %xmm0    # 0x79590
cvttsd2si %xmm0, %ecx
movb %cl, (%r14,%rax)
leaq 0x90(%rsp), %rdi
movq 0x58(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
leaq 0x70(%rsp), %rcx
leaq 0x68(%rsp), %r8
callq 0x2a06f
testl %eax, %eax
js 0x280fc
movq 0x10(%rsp), %rax
movq (%rax), %rax
addq 0x68(%rsp), %rax
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
addq %r15, %rcx
cmpq %rcx, %rax
jl 0x27f4c
xorl %ebp, %ebp
jmp 0x27e68
movq 0x90(%rsp), %rax
movq 0x10(%rsp), %r15
movzwl 0x12(%r15), %ecx
addq 0x38(%r15), %rcx
cmpq %rcx, %rax
jbe 0x27d8c
movl -0x4(%rax), %eax
andl $0xf, %eax
cmpl $0x2, %eax
jne 0x27d8c
movq 0x40(%rsp), %rax
cmpl $0x0, 0x30(%rsp)
jne 0x2801a
movq 0x18(%rsp), %rdx
movzbl (%rdx,%rax), %ecx
cvtsi2sd %ecx, %xmm0
mulsd 0x5157c(%rip), %xmm0    # 0x79590
cvttsd2si %xmm0, %ecx
jmp 0x28021
xorl %ecx, %ecx
movq 0x18(%rsp), %rdx
movb %cl, (%rdx,%rax)
leaq 0x78(%rsp), %rdi
movq 0x60(%rsp), %rsi
leaq 0x88(%rsp), %rdx
leaq 0x40(%rsp), %rcx
leaq 0x38(%rsp), %r8
callq 0x2a06f
movl %eax, %r13d
testl %eax, %eax
js 0x28243
movq 0x28(%rsp), %rax
movq (%rax), %rax
addq 0x38(%rsp), %rax
movq (%r15), %rcx
addq %r14, %rcx
cmpq %rcx, %rax
jl 0x27ff3
jmp 0x27e68
movq 0x18(%rsp), %rdi
movzbl (%rdi,%rax), %esi
addl %ecx, %esi
movl $0xc8, %ecx
cmpl %ecx, %esi
cmovael %ecx, %esi
movl %esi, %ecx
imull 0x30(%rsp), %ecx
movb %cl, (%r8,%rdx)
imull 0x98(%rsp), %esi
movb %sil, (%rdi,%rax)
jmp 0x27d8c
cmpb %sil, %cl
jae 0x280c9
movzbl %sil, %ecx
cvtsi2sd %ecx, %xmm0
mulsd 0x514dd(%rip), %xmm0    # 0x79590
cvttsd2si %xmm0, %ecx
movq 0x18(%rsp), %rsi
movb %cl, (%rsi,%rax)
movb $0x0, (%r8,%rdx)
jmp 0x27d8c
mulsd 0xb0(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
movb %cl, (%r8,%rdx)
movq 0x18(%rsp), %rdx
movzbl (%rdx,%rax), %ecx
cvtsi2sd %ecx, %xmm0
mulsd 0xa8(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
movb %cl, (%rdx,%rax)
jmp 0x27d8c
cmpl $-0x1, %eax
setne %r14b
movq 0x10(%rsp), %r15
movq 0x68(%rbx), %rdi
movl 0x9c(%rsp), %esi
callq 0x29c92
movq 0x58(%r15), %rax
decq %rax
cmpq 0x70(%r15), %rax
jne 0x28314
testb %r14b, %r14b
movq 0x48(%rsp), %r15
jne 0x28190
jmp 0x282f8
incl %esi
movq 0x8(%rsp), %rdi
callq 0x29cdd
movq 0x8(%rsp), %rdx
testl %eax, %eax
js 0x28190
movl (%rdx), %r12d
leal -0x1(%r12), %ebp
movq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x29cc3
movq 0x8(%rsp), %rdi
movl %eax, %r8d
movl %ebp, 0x60(%rsp)
andl %ebp, %r8d
movq 0x10(%rdi), %rdx
movl %r8d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %eax
leal (%r8,%r8), %ecx
shrl %cl, %eax
testb $0x2, %al
je 0x281a0
movl %r8d, %r12d
jmp 0x28282
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x271c4
jmp 0x27a73
movq %r13, 0x28(%rsp)
movq %r15, 0x48(%rsp)
pushq $0x1
popq %r14
movl %r8d, %r13d
movq %r12, 0x30(%rsp)
movq %rdx, 0x58(%rsp)
movq %r8, 0x10(%rsp)
movl %r13d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %r15d
leal (,%r13,2), %ebp
andl $0x1e, %ebp
movl %r15d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x28250
testb $0x1, %al
jne 0x2820c
movq 0x18(%rdi), %rax
movl %r13d, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x20(%rsp), %rsi
callq 0x46c0
movq 0x10(%rsp), %r8
movq 0x58(%rsp), %rdx
movq 0x8(%rsp), %rdi
testl %eax, %eax
je 0x28250
btl %ebp, %r15d
cmovbl %r13d, %r12d
addl %r14d, %r13d
andl 0x60(%rsp), %r13d
incl %r14d
cmpl %r8d, %r13d
jne 0x281c0
movb $0x1, %al
movq 0x30(%rsp), %rsi
movl %esi, %ecx
cmpl %esi, %r12d
movq 0x48(%rsp), %r15
movq 0x28(%rsp), %r13
movq 0x20(%rsp), %r14
je 0x28271
jmp 0x28282
cmpl $-0x1, %r13d
setne %r14b
jmp 0x28108
movl %ebp, %ecx
shrl %cl, %r15d
testb $0x2, %r15b
sete %al
movl %r12d, %ecx
movl %r13d, %r8d
movq 0x48(%rsp), %r15
movq 0x28(%rsp), %r13
movq 0x20(%rsp), %r14
cmpl 0x30(%rsp), %ecx
cmovel %r8d, %ecx
testb %al, %al
cmovnel %r8d, %ecx
movl %ecx, %r12d
movl %r12d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %edx
leal (%r12,%r12), %ecx
andl $0x1e, %ecx
shrl %cl, %edx
testb $0x2, %dl
jne 0x282a3
testb $0x1, %dl
jne 0x282d0
movl %r12d, %edx
jmp 0x282ec
movq 0x18(%rdi), %rsi
movl %r12d, %edx
movq %r14, (%rsi,%rdx,8)
pushq $0x3
popq %rsi
shll %cl, %esi
notl %esi
movq 0x10(%rdi), %rcx
andl %esi, (%rcx,%rax,4)
movq 0x4(%rdi), %xmm0
pcmpeqd %xmm1, %xmm1
psubd %xmm1, %xmm0
movq %xmm0, 0x4(%rdi)
jmp 0x282ec
movq 0x18(%rdi), %rsi
movl %r12d, %edx
movq %r14, (%rsi,%rdx,8)
pushq $0x3
popq %rsi
shll %cl, %esi
notl %esi
movq 0x10(%rdi), %rcx
andl %esi, (%rcx,%rax,4)
incl 0x4(%rdi)
movq 0x68(%rbx), %rax
movq 0x20(%rax), %rax
movq %r13, (%rax,%rdx,8)
movq 0x10(%rbx), %rax
movq %r15, 0x78(%rax)
movq %r15, 0x10(%rbx)
jmp 0x279d6
movl %r13d, %ebp
cmpl $-0x1, %ebp
jmp 0x280ff
leaq 0x52514(%rip), %rdi     # 0x7a82f
leaq 0x5195f(%rip), %rsi     # 0x79c81
leaq 0x5251b(%rip), %rcx     # 0x7a844
movl $0x17aa, %edx           # imm = 0x17AA
callq 0x42f0