// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0xacd96
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xacff9
cmpq $0x0, -0x18(%rbp)
je 0xacfe7
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jge 0xacdc3
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xac640
movl $0x0, -0x4(%rbp)
jmp 0xacff9
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xffff, %rax           # imm = 0xFFFF
andl $0x4, %eax
cmpl $0x0, %eax
je 0xacdf6
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xac640
movl $0x0, -0x4(%rbp)
jmp 0xacff9
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jne 0xace40
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0xace40
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x3c(%rcx), %eax
jle 0xace40
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xac640
movl $0x0, -0x4(%rbp)
jmp 0xacff9
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xa5ec0
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0xad010
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x40(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl %ecx, 0x38(%rax)
movq -0x18(%rbp), %rdi
callq 0xa60f0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl %ecx, 0x3c(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x5a2ac(%rip), %rcx     # 0x107164
movq %rcx, 0x40(%rax)
movq 0x5a2a9(%rip), %rcx     # 0x10716c
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x3c(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl %ecx, 0x4c(%rax)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0xacf1e
movq 0x580da(%rip), %rax     # 0x104fd0
movq (%rax), %rdi
leaq 0x3790c(%rip), %rsi     # 0xe480c
movb $0x0, %al
callq 0x6a80
movq -0x10(%rbp), %rax
movl $0x1, 0x38(%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xacff9
movq -0x18(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jne 0xacf70
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x38(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
jge 0xacf70
movq 0x58088(%rip), %rax     # 0x104fd0
movq (%rax), %rdi
leaq 0x37900(%rip), %rsi     # 0xe4852
movb $0x0, %al
callq 0x6a80
movq -0x10(%rbp), %rax
movl $0x1, 0x38(%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xacff9
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x38(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x3c(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jg 0xacfb6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jle 0xacfe5
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xabf90
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x50(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x50(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0xacff2
movq -0x10(%rbp), %rax
movl $0x1, 0x30(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)