// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/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;
        }
        bam_copy1(&iter->tail->b, b);
        overlap_push(iter, iter->tail);
#ifndef BAM_NO_ID
        iter->tail->b.id = iter->id++;
#endif
        iter->tail->beg = b->core.pos;
        iter->tail->end = bam_endpos(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) {
            fprintf(stderr, "[bam_pileup_core] the input is not sorted (chromosomes out of order)\n");
            iter->error = 1;
            return -1;
        }
        if ((b->core.tid == iter->max_tid) && (iter->tail->beg < iter->max_pos)) {
            fprintf(stderr, "[bam_pileup_core] the input is not sorted (reads out of order)\n");
            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) {
            iter->tail->next = mp_alloc(iter->mp);
            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 $0x78, %rsp
pushq $-0x1
popq %rbp
cmpl $0x0, 0x38(%rdi)
jne 0x65b85
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0x655fe
movl (%r14), %eax
testl %eax, %eax
js 0x655ee
testb $0x4, 0xc(%r14)
jne 0x655ee
cmpl %eax, 0x20(%rbx)
jne 0x6560a
movl 0x24(%rbx), %eax
cmpl 0x4(%r14), %eax
jne 0x6560a
movq (%rbx), %rax
movl (%rax), %eax
cmpl 0x3c(%rbx), %eax
jle 0x6560a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x65524
jmp 0x65b83
movl $0x1, 0x30(%rbx)
jmp 0x65b83
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x61926
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x65b08
movq 0x10(%rbx), %r15
movq 0x8(%r15), %r13
movabsq $0xa00000000, %rax      # imm = 0xA00000000
andq %r13, %rax
movabsq $0x200000000, %rcx      # imm = 0x200000000
cmpq %rcx, %rax
jne 0x65b08
movl 0x10(%r15), %edx
movl 0x1c(%r15), %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
leal (%rdx,%rdx), %eax
cmpl %eax, %ecx
jge 0x65b08
movq %rdx, 0x28(%rsp)
movq 0x28(%r15), %rsi
movq %rsi, 0x18(%rsp)
movq %rdi, 0x8(%rsp)
callq 0x65f77
movq 0x8(%rsp), %rdi
movl %eax, %r12d
cmpl (%rdi), %eax
movq %r15, 0x58(%rsp)
jne 0x656b0
movl 0x8(%rdi), %eax
cmpl 0xc(%rdi), %eax
jb 0x6597b
movl 0x4(%rdi), %eax
addl %eax, %eax
cmpl %eax, %r12d
jbe 0x6595d
decl %r12d
jmp 0x65960
movq 0x20(%rdi), %rax
movq %r12, 0x50(%rsp)
movl %r12d, %ecx
movq (%rax,%rcx,8), %r8
movq 0x8(%r8), %rax
movl %eax, %ecx
shrl $0x18, %ecx
addq 0x28(%r8), %rcx
leaq 0x70(%rsp), %rdi
movq %rcx, (%rdi)
shrq $0x30, %rax
leaq (%rcx,%rax,4), %rsi
leaq 0x64(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x4c(%rsp), %rcx
andl $0x0, (%rcx)
movl %r13d, %eax
andl $0x0, 0x48(%rsp)
shrl $0x18, %eax
andl $0x0, 0x24(%rsp)
movq 0x18(%rsp), %r12
addq %rax, %r12
movq %r12, 0x68(%rsp)
movl 0x10(%r8), %eax
movl %eax, 0x38(%rsp)
movl 0x4(%r15), %r15d
movl %r15d, %eax
movq %r8, 0x30(%rsp)
subl 0x4(%r8), %eax
leaq 0x44(%rsp), %r8
movl %eax, (%r8)
andl $0x0, 0x20(%rsp)
movq %rsi, 0x8(%rsp)
callq 0x66301
movl %eax, 0x14(%rsp)
testl %eax, %eax
js 0x65923
shrq $0x30, %r13
leaq (%r12,%r13,4), %rsi
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rdx
leaq 0x24(%rsp), %rcx
leaq 0x20(%rsp), %r8
movq %rsi, 0x18(%rsp)
callq 0x66301
testl %eax, %eax
js 0x65923
movl 0x38(%rsp), %eax
incl %eax
sarl %eax
cltq
addq 0x8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x28(%rsp), %rax
incl %eax
sarl %eax
cltq
addq 0x18(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %r12
movl 0x14(%rsp), %eax
movl 0x44(%rsp), %r13d
testl %r13d, %r13d
js 0x657dc
movl %r15d, %ecx
subl 0x4(%r12), %ecx
cmpl %ecx, %r13d
jge 0x657dc
leaq 0x70(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x64(%rsp), %rdx
leaq 0x4c(%rsp), %rcx
leaq 0x44(%rsp), %r8
callq 0x66417
jmp 0x657a5
movl %eax, 0x14(%rsp)
testl %eax, %eax
js 0x65923
movq 0x30(%rsp), %rax
movl 0x4(%rax), %r12d
addl %r13d, %r12d
cmpl %r12d, %r15d
cmovgl %r15d, %r12d
xorl %eax, %eax
movq 0x58(%rsp), %r15
movl 0x20(%rsp), %ecx
testl %ecx, %ecx
js 0x65835
movl %r12d, %edx
subl 0x4(%r15), %edx
cmpl %edx, %ecx
jge 0x65835
leaq 0x68(%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x24(%rsp), %rcx
leaq 0x20(%rsp), %r8
callq 0x66417
jmp 0x65802
testl %eax, %eax
js 0x65923
movq 0x58(%rsp), %rax
addl 0x4(%rax), %ecx
cmpl %ecx, %r12d
cmovlel %ecx, %r12d
movl %r12d, %r15d
incl %r15d
movq 0x30(%rsp), %r12
addl 0x4(%r12), %r13d
cmpl %ecx, %r13d
jne 0x657a1
movslq 0x4c(%rsp), %rax
leal (,%rax,4), %ecx
movl %eax, %edx
sarl %edx
movslq %edx, %rdx
movq 0x8(%rsp), %rsi
movzbl (%rsi,%rdx), %esi
notb %cl
andb $0x4, %cl
shrl %cl, %esi
movslq 0x24(%rsp), %rdx
movl %edx, %ecx
sarl %ecx
movslq %ecx, %rcx
movq 0x18(%rsp), %rdi
movzbl (%rdi,%rcx), %r8d
leal (,%rdx,4), %ecx
notb %cl
andb $0x4, %cl
shrl %cl, %r8d
movq 0x38(%rsp), %rdi
leaq (%rdi,%rax), %rcx
movzbl (%rdi,%rax), %edi
xorl %esi, %r8d
testb $0xf, %r8b
je 0x658ee
movq 0x28(%rsp), %rsi
leaq (%rsi,%rdx), %rax
movb (%rsi,%rdx), %dl
cmpb %dl, %dil
jae 0x65909
movzbl %dl, %edx
cvtsi2sd %edx, %xmm0
mulsd 0x23965(%rip), %xmm0    # 0x89248
cvttsd2si %xmm0, %edx
movb %dl, (%rax)
movq %rcx, %rax
jmp 0x6591b
movq 0x28(%rsp), %rsi
leaq (%rsi,%rdx), %rax
movzbl (%rsi,%rdx), %edx
addl %edi, %edx
movl $0xc8, %esi
cmpl %esi, %edx
cmovael %esi, %edx
jmp 0x65919
cvtsi2sd %edi, %xmm0
mulsd 0x23933(%rip), %xmm0    # 0x89248
cvttsd2si %xmm0, %edx
movb %dl, (%rcx)
movb $0x0, (%rax)
jmp 0x657a1
movq 0x68(%rbx), %rdi
movq 0x50(%rsp), %rsi
callq 0x66038
movq 0x30(%rsp), %r15
movl 0x3c(%r15), %eax
decl %eax
cmpl 0x4c(%r15), %eax
jne 0x65bd0
movq %r15, %rdi
callq 0x61a66
movl %eax, 0x3c(%r15)
decl %eax
movl %eax, 0x4c(%r15)
jmp 0x65b08
incl %r12d
movl %r12d, %esi
callq 0x66084
movq 0x8(%rsp), %rcx
movl (%rcx), %r12d
movl %r12d, %r9d
testl %eax, %eax
js 0x65af9
leal -0x1(%r12), %r13d
movq 0x18(%rsp), %rdi
callq 0x66069
movq 0x8(%rsp), %r8
movl %eax, %edi
andl %r13d, %edi
movq 0x10(%r8), %rsi
movl %edi, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %eax
leal (%rdi,%rdi), %ecx
shrl %cl, %eax
testb $0x2, %al
je 0x659b1
movl %edi, %r9d
jmp 0x65a8c
movl %r13d, %edx
movq %r12, %rax
pushq $0x1
popq %r12
movl %edi, %r15d
movq %rax, 0x50(%rsp)
movl %eax, %r9d
movq %rsi, 0x38(%rsp)
movq %rdi, 0x28(%rsp)
movl %r13d, 0x60(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %r10d
leal (%r15,%r15), %r13d
andl $0x1e, %r13d
movl %r10d, %eax
movl %r13d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x65a62
testb $0x1, %al
jne 0x65a37
movq 0x18(%r8), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x18(%rsp), %rsi
movq %r9, 0x30(%rsp)
movl %r10d, 0x14(%rsp)
callq 0x6a50
movl 0x14(%rsp), %r10d
movl 0x60(%rsp), %edx
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %r9
movq 0x8(%rsp), %r8
testl %eax, %eax
je 0x65a62
btl %r13d, %r10d
cmovbl %r15d, %r9d
addl %r12d, %r15d
andl %edx, %r15d
incl %r12d
cmpl %edi, %r15d
jne 0x659d5
movb $0x1, %al
movq 0x50(%rsp), %rdx
movl %edx, %ecx
cmpl %edx, %r9d
movq 0x58(%rsp), %r15
je 0x65a7f
jmp 0x65a8c
movl %r13d, %ecx
shrl %cl, %r10d
testb $0x2, %r10b
sete %al
movl %r9d, %ecx
movl %r15d, %edi
movq 0x58(%rsp), %r15
movq 0x50(%rsp), %rdx
cmpl %edx, %ecx
cmovel %edi, %ecx
testb %al, %al
cmovnel %edi, %ecx
movl %ecx, %r9d
movl %r9d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %edx
leal (%r9,%r9), %ecx
andl $0x1e, %ecx
shrl %cl, %edx
testb $0x2, %dl
movq 0x18(%rsp), %rdi
jne 0x65acc
testb $0x1, %dl
je 0x65af9
movq 0x18(%r8), %rdx
movl %r9d, %esi
movq %rdi, (%rdx,%rsi,8)
pushq $0x3
popq %rdx
shll %cl, %edx
notl %edx
movq 0x10(%r8), %rcx
andl %edx, (%rcx,%rax,4)
incl 0x4(%r8)
jmp 0x65af9
movq 0x18(%r8), %rdx
movl %r9d, %esi
movq %rdi, (%rdx,%rsi,8)
pushq $0x3
popq %rdx
shll %cl, %edx
notl %edx
movq 0x10(%r8), %rcx
andl %edx, (%rcx,%rax,4)
movq 0x4(%r8), %xmm0
pcmpeqd %xmm1, %xmm1
psubd %xmm1, %xmm0
movq %xmm0, 0x4(%r8)
movq 0x68(%rbx), %rax
movq 0x20(%rax), %rax
movl %r9d, %ecx
movq %r15, (%rax,%rcx,8)
movq 0x10(%rbx), %r15
movq 0x40(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x40(%rbx)
movq %rax, 0x30(%r15)
movl 0x4(%r14), %eax
movl %eax, 0x38(%r15)
movq %r14, %rdi
callq 0x61a66
movl %eax, 0x3c(%r15)
movups 0x23729(%rip), %xmm0    # 0x89260
movups %xmm0, 0x40(%r15)
movq 0x10(%rbx), %rax
movl 0x3c(%rax), %ecx
leal -0x1(%rcx), %edx
movl %edx, 0x4c(%rax)
movl (%r14), %edx
cmpl 0x28(%rbx), %edx
jl 0x65b96
movl 0x38(%rax), %esi
jne 0x65b5b
cmpl 0x2c(%rbx), %esi
jl 0x65bab
movl %edx, 0x28(%rbx)
movl %esi, 0x2c(%rbx)
cmpl 0x24(%rbx), %ecx
jg 0x65b6f
movl (%rax), %eax
xorl %ebp, %ebp
cmpl 0x20(%rbx), %eax
jle 0x65b85
movq (%rbx), %rdi
callq 0x64e78
movq 0x10(%rbx), %rcx
movq %rax, 0x50(%rcx)
movq %rax, 0x10(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4d43b(%rip), %rax     # 0xb2fd8
movq (%rax), %rcx
leaq 0x23b9b(%rip), %rdi     # 0x89742
pushq $0x45
jmp 0x65bbe
movq 0x4d426(%rip), %rax     # 0xb2fd8
movq (%rax), %rcx
leaq 0x23bcc(%rip), %rdi     # 0x89788
pushq $0x3f
popq %rsi
pushq $0x1
popq %rdx
callq 0x6e70
movl $0x1, 0x38(%rbx)
jmp 0x65b85
leaq 0x23cc6(%rip), %rdi     # 0x8989d
leaq 0x23c6e(%rip), %rsi     # 0x8984c
leaq 0x23ccd(%rip), %rcx     # 0x898b2
movl $0x721, %edx            # imm = 0x721
callq 0x6460