// File: /workspace/github_cpp_makefile_star2_O2/karel-brinda[P]ococo/ext/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, 0x30(%rdi)
jne 0x1545f
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0x14ed8
movl (%r14), %eax
testl %eax, %eax
js 0x14ec8
testb $0x4, 0xc(%r14)
jne 0x14ec8
cmpl %eax, 0x18(%rbx)
jne 0x14ee4
movl 0x1c(%rbx), %eax
cmpl 0x4(%r14), %eax
jne 0x14ee4
movq (%rbx), %rax
movl (%rax), %eax
cmpl 0x34(%rbx), %eax
jle 0x14ee4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14dfe
jmp 0x1545d
movl $0x1, 0x28(%rbx)
jmp 0x1545d
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x1123c
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x153e2
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 0x153e2
movl 0x10(%r15), %edx
movl 0x1c(%r15), %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
leal (%rdx,%rdx), %eax
cmpl %eax, %ecx
jge 0x153e2
movq %rdx, 0x28(%rsp)
movq 0x28(%r15), %rsi
movq %rsi, 0x18(%rsp)
movq %rdi, 0x8(%rsp)
callq 0x15887
movq 0x8(%rsp), %rdi
movl %eax, %r12d
cmpl (%rdi), %eax
movq %r15, 0x58(%rsp)
jne 0x14f8a
movl 0x8(%rdi), %eax
cmpl 0xc(%rdi), %eax
jb 0x15255
movl 0x4(%rdi), %eax
addl %eax, %eax
cmpl %eax, %r12d
jbe 0x15237
decl %r12d
jmp 0x1523a
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 0x15c11
movl %eax, 0x14(%rsp)
testl %eax, %eax
js 0x151fd
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 0x15c11
testl %eax, %eax
js 0x151fd
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 0x150b6
movl %r15d, %ecx
subl 0x4(%r12), %ecx
cmpl %ecx, %r13d
jge 0x150b6
leaq 0x70(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x64(%rsp), %rdx
leaq 0x4c(%rsp), %rcx
leaq 0x44(%rsp), %r8
callq 0x15d27
jmp 0x1507f
movl %eax, 0x14(%rsp)
testl %eax, %eax
js 0x151fd
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 0x1510f
movl %r12d, %edx
subl 0x4(%r15), %edx
cmpl %edx, %ecx
jge 0x1510f
leaq 0x68(%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x24(%rsp), %rcx
leaq 0x20(%rsp), %r8
callq 0x15d27
jmp 0x150dc
testl %eax, %eax
js 0x151fd
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 0x1507b
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 0x151c8
movq 0x28(%rsp), %rsi
leaq (%rsi,%rdx), %rax
movb (%rsi,%rdx), %dl
cmpb %dl, %dil
jae 0x151e3
movzbl %dl, %edx
cvtsi2sd %edx, %xmm0
mulsd 0x2f05b(%rip), %xmm0    # 0x44218
cvttsd2si %xmm0, %edx
movb %dl, (%rax)
movq %rcx, %rax
jmp 0x151f5
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 0x151f3
cvtsi2sd %edi, %xmm0
mulsd 0x2f029(%rip), %xmm0    # 0x44218
cvttsd2si %xmm0, %edx
movb %dl, (%rcx)
movb $0x0, (%rax)
jmp 0x1507b
movq 0x60(%rbx), %rdi
movq 0x50(%rsp), %rsi
callq 0x15948
movq 0x30(%rsp), %r15
movl 0x3c(%r15), %eax
decl %eax
cmpl 0x4c(%r15), %eax
jne 0x154aa
movq %r15, %rdi
callq 0x1137c
movl %eax, 0x3c(%r15)
decl %eax
movl %eax, 0x4c(%r15)
jmp 0x153e2
incl %r12d
movl %r12d, %esi
callq 0x15994
movq 0x8(%rsp), %rcx
movl (%rcx), %r12d
movl %r12d, %r9d
testl %eax, %eax
js 0x153d3
leal -0x1(%r12), %r13d
movq 0x18(%rsp), %rdi
callq 0x15979
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 0x1528b
movl %edi, %r9d
jmp 0x15366
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 0x1533c
testb $0x1, %al
jne 0x15311
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 0x4750
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 0x1533c
btl %r13d, %r10d
cmovbl %r15d, %r9d
addl %r12d, %r15d
andl %edx, %r15d
incl %r12d
cmpl %edi, %r15d
jne 0x152af
movb $0x1, %al
movq 0x50(%rsp), %rdx
movl %edx, %ecx
cmpl %edx, %r9d
movq 0x58(%rsp), %r15
je 0x15359
jmp 0x15366
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 0x153a6
testb $0x1, %dl
je 0x153d3
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 0x153d3
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 0x60(%rbx), %rax
movq 0x20(%rax), %rax
movl %r9d, %ecx
movq %r15, (%rax,%rcx,8)
movq 0x10(%rbx), %r15
movq 0x38(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x38(%rbx)
movq %rax, 0x30(%r15)
movl 0x4(%r14), %eax
movl %eax, 0x38(%r15)
movq %r14, %rdi
callq 0x1137c
movl %eax, 0x3c(%r15)
movups 0x2ee1f(%rip), %xmm0    # 0x44230
movups %xmm0, 0x40(%r15)
movq 0x10(%rbx), %rax
movl 0x3c(%rax), %ecx
leal -0x1(%rcx), %edx
movl %edx, 0x4c(%rax)
movl (%r14), %edx
cmpl 0x20(%rbx), %edx
jl 0x15470
movl 0x38(%rax), %esi
jne 0x15435
cmpl 0x24(%rbx), %esi
jl 0x15485
movl %edx, 0x20(%rbx)
movl %esi, 0x24(%rbx)
cmpl 0x1c(%rbx), %ecx
jg 0x15449
movl (%rax), %eax
xorl %ebp, %ebp
cmpl 0x18(%rbx), %eax
jle 0x1545f
movq (%rbx), %rdi
callq 0x14790
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 0x41b59(%rip), %rax     # 0x56fd0
movq (%rax), %rcx
leaq 0x2f2db(%rip), %rdi     # 0x4475c
pushq $0x45
jmp 0x15498
movq 0x41b44(%rip), %rax     # 0x56fd0
movq (%rax), %rcx
leaq 0x2f30c(%rip), %rdi     # 0x447a2
pushq $0x3f
popq %rsi
pushq $0x1
popq %rdx
callq 0x4a20
movl $0x1, 0x30(%rbx)
jmp 0x1545f
leaq 0x2f406(%rip), %rdi     # 0x448b7
leaq 0x2f3ae(%rip), %rsi     # 0x44866
leaq 0x2f40d(%rip), %rcx     # 0x448cc
movl $0x745, %edx            # imm = 0x745
callq 0x4360