// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/sam.c
// Function: overlap_push
static int overlap_push(bam_plp_t iter, lbnode_t *node)
{
    if ( !iter->overlaps ) return 0;

    // mapped mates and paired reads only
    if ( node->b.core.flag&BAM_FMUNMAP || !(node->b.core.flag&BAM_FPROPER_PAIR) ) return 0;

    // no overlap possible, unless some wild cigar
    if ( (node->b.core.mtid >= 0 && node->b.core.tid != node->b.core.mtid)
         || (llabs(node->b.core.isize) >= 2*node->b.core.l_qseq
         && node->b.core.mpos >= node->end) // for those wild cigars
       ) return 0;

    khiter_t kitr = kh_get(olap_hash, iter->overlaps, bam_get_qname(&node->b));
    if ( kitr==kh_end(iter->overlaps) )
    {
        // Only add reads where the mate is still to arrive
        if (node->b.core.mpos >= node->b.core.pos ||
            ((node->b.core.flag & BAM_FPAIRED) && node->b.core.mpos == -1)) {
            int ret;
            kitr = kh_put(olap_hash, iter->overlaps, bam_get_qname(&node->b), &ret);
            if (ret < 0) return -1;
            kh_value(iter->overlaps, kitr) = node;
        }
    }
    else
    {
        lbnode_t *a = kh_value(iter->overlaps, kitr);
        int err = tweak_overlap_quality(&a->b, &node->b);
        kh_del(olap_hash, iter->overlaps, kitr);
        assert(a->end-1 == a->s.end);
        return err;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x68(%rax)
jne 0x44867
movl $0x0, -0x4(%rbp)
jmp 0x44a05
movq -0x18(%rbp), %rax
movzwl 0x10(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x44887
movq -0x18(%rbp), %rax
movzwl 0x10(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x44893
movl $0x0, -0x4(%rbp)
jmp 0x44a05
movq -0x18(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
jl 0x448ad
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jne 0x448e2
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, %rcx
negq %rcx
cmovnsq %rcx, %rax
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
shll %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jl 0x448ee
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x58(%rcx), %rax
jl 0x448ee
movl $0x0, -0x4(%rbp)
jmp 0x44a05
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x47c60
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x68(%rcx), %rcx
cmpl (%rcx), %eax
jne 0x44988
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jge 0x44941
movq -0x18(%rbp), %rax
movzwl 0x10(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x44986
movq -0x18(%rbp), %rax
cmpq $-0x1, 0x20(%rax)
jne 0x44986
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
leaq -0x20(%rbp), %rdx
callq 0x47e80
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x20(%rbp)
jge 0x4496f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x44a05
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
jmp 0x449fe
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x481e0
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
movl -0x1c(%rbp), %esi
callq 0x47db0
movq -0x28(%rbp), %rax
movq 0x58(%rax), %rax
subq $0x1, %rax
movq -0x28(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jne 0x449d7
jmp 0x449f6
leaq 0xae41c(%rip), %rdi     # 0xf2dfa
leaq 0xad85f(%rip), %rsi     # 0xf2244
movl $0x17aa, %edx           # imm = 0x17AA
leaq 0xae41e(%rip), %rcx     # 0xf2e0f
callq 0x42e0
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x44a05
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop