// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: up_contain(kv_u_trans_t*, hc_links*, unsigned char*, asg_t*, kvec_t_u64_warp*)
uint32_t up_contain(kv_u_trans_t *ta, hc_links* link, uint8_t *uc_idx, asg_t *sg, kvec_t_u64_warp *buf)
{
    hc_edge *he = NULL, *ht = NULL, *hx = NULL;
    uint64_t t_d = (uint64_t)-1, hd;
    uint32_t qn, tn, qs, qe, ts, te, rev, is_c;
    u_trans_t *a = NULL, *p = NULL;
    asg_arc_t t;
    uint32_t i, k, st, occ, n, m;
    long long r_qs, r_qe, r_ts, r_te;
    int r;

    for (k = 0, buf->a.n = 0; k < ta->idx.n; k++)
    {
        if((uc_idx[k]&2)&&(!(uc_idx[k]&1)))///contain others
        {
            if(link->a.a[k].e.n == 0)
            {
                uc_idx[k] -= 2;
                continue;
            }
            a = u_trans_a(*ta, k);
            n = u_trans_n(*ta, k);
            for (st = 0, i = 1; i <= n; ++i)
            {
                if (i == n || a[i].tn != a[st].tn)
                {
                    for (m = st, p = &(a[st]); m < i; m++)
                    {
                        if(a[m].nw > p->nw) p = &(a[m]);
                    }

                    if(p->f == RC_2)///dis-connected
                    {
                        rev = p->rev;
                        qn = p->qn; 
                        qs = p->qs; 
                        qe = p->qe - 1;
                        if(rev)
                        {
                            tn = p->tn;
                            ts = sg->seq[tn].len - (p->te - 1) - 1;
                            te = sg->seq[tn].len - p->ts - 1;
                        }
                        else
                        {
                            tn = p->tn; 
                            ts = p->ts; 
                            te = p->te - 1;
                        }

                        classify_hap_overlap(qs, qe, sg->seq[qn].len, ts, te, sg->seq[tn].len, 
                                                                                &r_qs, &r_qe, &r_ts, &r_te);
                        
                        qs = r_qs; qe = r_qe + 1;
                        if(rev)
                        {
                            ts = sg->seq[tn].len - r_te - 1;
                            te = sg->seq[tn].len - r_ts - 1 + 1;
                        }
                        else
                        {
                            ts = r_ts; te = r_te + 1;
                        }

                        r = get_trans_ug_arch(qn, qs, qe, sg->seq[qn].len, 
                                            tn, ts, te, sg->seq[tn].len, rev, &t);
                        if(r == MA_HT_TCONT)//q contains t
                        {
                            hd = tn; hd <<= 32; hd |= qn;
                            kv_push(uint64_t, buf->a, hd);
                            ///qn->tn
                            he = get_hc_edge(link, qn, tn, 0);
                            if(!he)
                            {
                                push_hc_edge(&(link->a.a[qn]), tn, 0, 0, &t_d);
                                he = get_hc_edge(link, qn, tn, 0);
                            } 
                            hd = (te - ts) + qs;
                            if(hd < he->dis)
                            {
                                he->dis = hd << 1;
                                he->dis += 1;
                                he->dis <<= 1;
                                he->dis += 0;//s-direction
                                he->dis <<= 1;
                                he->dis += rev;//e-direction
                            }

                            ///tn->qn
                            he = get_hc_edge(link, tn, qn, 0);
                            if(!he)
                            {
                                push_hc_edge(&(link->a.a[tn]), qn, 0, 0, &t_d);
                                he = get_hc_edge(link, tn, qn, 0);
                            } 
                            hd = (te - ts) + sg->seq[qn].len - qe;
                            if(hd < he->dis)
                            {
                                he->dis = hd << 1;
                                he->dis += 1;
                                he->dis <<= 1;
                                he->dis += 0;//s-direction
                                he->dis <<= 1;
                                he->dis += rev;//e-direction
                            }
                        }
                    }
                    st = i;
                }
            }
            uc_idx[k] -= 2;
        }
    }
    
    uint64_t e0, e1;
    for (k = 0; k < buf->a.n; k++)
    {
        qn = buf->a.a[k] >> 32;
        tn = (uint32_t)buf->a.a[k];

        he = get_hc_edge(link, tn, qn, 0); //tn contains qn
        for (i = 0; i < link->a.a[tn].e.n; i++)
        {
            if(link->a.a[tn].e.a[i].del) continue;
            if(link->a.a[tn].e.a[i].uID == qn) continue;
            ht = &(link->a.a[tn].e.a[i]);
            if(ht->dis == (uint64_t)-1) continue;

            if((he->dis&(uint64_t)2) == (ht->dis&(uint64_t)2))///s in same direction
            {
                push_LCA_edges(he->dis>>3, ht->dis>>3, sg->seq[he->uID].len, sg->seq[ht->uID].len, 
                he->dis&1, ht->dis&1, &e0, &e1);

                ///forward
                hx = get_hc_edge(link, he->uID, ht->uID, 0);
                if(!hx)
                {
                    push_hc_edge(&(link->a.a[he->uID]), ht->uID, 0, 0, &t_d);
                    hx = get_hc_edge(link, he->uID, ht->uID, 0);
                }
                if ((e0>>3) < (hx->dis>>3)) hx->dis = e0;

                ///backward
                hx = get_hc_edge(link, ht->uID, he->uID, 0);
                if(!hx)
                {
                    push_hc_edge(&(link->a.a[ht->uID]), he->uID, 0, 0, &t_d);
                    hx = get_hc_edge(link, ht->uID, he->uID, 0);
                }
                if ((e1>>3) < (hx->dis>>3)) hx->dis = e1;
            }
            else
            {
                push_LCA_edges_rev(he, ht, sg->seq[he->uID].len, sg->seq[ht->uID].len, 
                sg->seq[tn].len, he->dis&1, ht->dis&1, &e0, &e1);

                ///forward
                hx = get_hc_edge(link, he->uID, ht->uID, 0);
                if(!hx)
                {
                    push_hc_edge(&(link->a.a[he->uID]), ht->uID, 0, 0, &t_d);
                    hx = get_hc_edge(link, he->uID, ht->uID, 0);
                }
                if ((e0>>3) < (hx->dis>>3)) hx->dis = e0;

                ///backward
                hx = get_hc_edge(link, ht->uID, he->uID, 0);
                if(!hx)
                {
                    push_hc_edge(&(link->a.a[ht->uID]), he->uID, 0, 0, &t_d);
                    hx = get_hc_edge(link, ht->uID, he->uID, 0);
                }
                if ((e1>>3) < (hx->dis>>3)) hx->dis = e1;
            }
        }
    }


    for (k = 0, occ = 0; k < ta->idx.n; k++)
    {
        if((uc_idx[k]&1) && (uc_idx[k]&2))
        {
            is_c = 0;
            a = u_trans_a(*ta, k);
            n = u_trans_n(*ta, k);
            for (st = 0, i = 1; i <= n; ++i)
            {
                if (i == n || a[i].tn != a[st].tn)
                {
                    for (m = st, p = &(a[st]); m < i; m++)
                    {
                        if(a[m].nw > p->nw) p = &(a[m]);
                    }

                    if(p->f == RC_2)///dis-connected
                    {
                        rev = p->rev;
                        qn = p->qn; 
                        qs = p->qs; 
                        qe = p->qe - 1;
                        if(rev)
                        {
                            tn = p->tn;
                            ts = sg->seq[tn].len - (p->te - 1) - 1;
                            te = sg->seq[tn].len - p->ts - 1;
                        }
                        else
                        {
                            tn = p->tn; 
                            ts = p->ts; 
                            te = p->te - 1;
                        }

                        classify_hap_overlap(qs, qe, sg->seq[qn].len, ts, te, sg->seq[tn].len, 
                                                                                &r_qs, &r_qe, &r_ts, &r_te);
                        
                        qs = r_qs; qe = r_qe + 1;
                        if(rev)
                        {
                            ts = sg->seq[tn].len - r_te - 1;
                            te = sg->seq[tn].len - r_ts - 1 + 1;
                        }
                        else
                        {
                            ts = r_ts; te = r_te + 1;
                        }

                        r = get_trans_ug_arch(qn, qs, qe, sg->seq[qn].len, 
                                            tn, ts, te, sg->seq[tn].len, rev, &t);
                        if(r == MA_HT_QCONT && (uc_idx[tn]&2))//t contains q
                        {
                            is_c = 1;
                        }
                    }
                    st = i;
                }
            }
            if(is_c == 0) uc_idx[k] -= 1;
        }
        if(uc_idx[k]&2) occ++;
    }

    return occ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, %r10
movq %rsi, %r9
movq $-0x1, 0x28(%rsp)
movq %r8, 0x48(%rsp)
movq $0x0, (%r8)
movq %rdi, 0x20(%rsp)
cmpq $0x0, 0x18(%rdi)
movq %rcx, 0x8(%rsp)
movq %rdx, 0x50(%rsp)
movq %rsi, (%rsp)
je 0x13df24
xorl %edi, %edi
movb (%rdx,%rdi), %al
movl %eax, %ecx
andb $0x3, %cl
cmpb $0x2, %cl
jne 0x13df13
movq 0x10(%r9), %rcx
leaq (%rdi,%rdi,2), %rsi
shlq $0x4, %rsi
cmpq $0x0, (%rcx,%rsi)
je 0x13df0e
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rax
movq %rdi, 0x80(%rsp)
movq (%rax,%rdi,8), %r8
testl %r8d, %r8d
je 0x13defe
movq %r8, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %r11
shlq $0x4, %r11
movq 0x20(%rsp), %rax
addq 0x10(%rax), %r11
movl $0x1, %r13d
xorl %edx, %edx
movq %r11, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movl %r13d, %ecx
movl %edx, %eax
cmpl %r8d, %r13d
je 0x13db91
leaq (%rcx,%rcx,2), %rsi
shlq $0x4, %rsi
movl 0x14(%r11,%rsi), %esi
leaq (%rax,%rax,2), %rdi
shlq $0x4, %rdi
cmpl 0x14(%r11,%rdi), %esi
je 0x13def2
leaq (%rax,%rax,2), %rsi
shlq $0x4, %rsi
addq %r11, %rsi
cmpl %r13d, %edx
jae 0x13dbcf
leaq (%rax,%rax,2), %rdx
shlq $0x4, %rdx
addq %r11, %rdx
subq %rax, %rcx
movsd 0x20(%rdx), %xmm0
ucomisd 0x20(%rsi), %xmm0
movq %rdx, %rax
ja 0x13dbc1
movq %rsi, %rax
addq $0x30, %rdx
movq %rax, %rsi
decq %rcx
jne 0x13dbaf
jmp 0x13dbd2
movq %rsi, %rax
movzbl 0x28(%rax), %ebx
movl %ebx, %ecx
andb $0x3f, %cl
movl %r13d, %edx
cmpb $0x2, %cl
jne 0x13def2
shrl $0x6, %ebx
movl 0x14(%rax), %ebp
andl $0x1, %ebx
je 0x13dc0f
movq 0x20(%r10), %rcx
movl (%rcx,%rbp,8), %ecx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %ecx
movl 0xc(%rax), %r8d
notl %r8d
addl %ecx, %r8d
subl 0x10(%rax), %ecx
jmp 0x13dc19
movl 0xc(%rax), %ecx
movl 0x10(%rax), %r8d
decl %r8d
movl 0x8(%rax), %r15d
movl (%rax), %edi
movl 0x4(%rax), %eax
decl %eax
movl %eax, %esi
movq 0x20(%r10), %rax
movl (%rax,%r15,8), %edx
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
andq %r11, %rdx
movl %ecx, %ecx
movl %r8d, %r8d
movl (%rax,%rbp,8), %r9d
andq %r11, %r9
leaq 0x38(%rsp), %rax
pushq %rax
leaq 0x48(%rsp), %rax
pushq %rax
leaq 0x78(%rsp), %rax
pushq %rax
leaq 0x88(%rsp), %rax
pushq %rax
movq %r10, %r14
callq 0x105f44
addq $0x20, %rsp
testb %bl, %bl
je 0x13dc90
movq 0x20(%r14), %rax
movl (%rax,%rbp,8), %r12d
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %r12d
movl 0x38(%rsp), %r9d
notl %r9d
addl %r12d, %r9d
subl 0x40(%rsp), %r12d
jmp 0x13dca2
movl 0x40(%rsp), %r9d
movl 0x38(%rsp), %r12d
incl %r12d
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movl 0x68(%rsp), %eax
movq %rax, 0x30(%rsp)
leal 0x1(%rax), %edx
movl 0x70(%rsp), %esi
movq 0x20(%r14), %rax
movl (%rax,%r15,8), %ecx
andl %edi, %ecx
movl (%rax,%rbp,8), %eax
andl %edi, %eax
movl %r15d, %edi
movq %rsi, 0x88(%rsp)
movl %ebp, %r8d
movl %r9d, 0x7c(%rsp)
leaq 0x90(%rsp), %r10
pushq %r10
pushq %rbx
pushq %rax
pushq %r12
callq 0x13d427
movq 0x28(%rsp), %r10
addq $0x20, %rsp
movl %r13d, %edx
cmpl $-0x3, %eax
movq (%rsp), %r9
movq 0x10(%rsp), %r8
movq 0x18(%rsp), %r11
jne 0x13def2
movq 0x48(%rsp), %rcx
movq 0x8(%rcx), %rax
cmpq %rax, (%rcx)
jne 0x13dd55
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%rcx)
movq 0x10(%rcx), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x18(%rsp), %r11
movq 0x10(%rsp), %r8
movq (%rsp), %r9
movq 0x48(%rsp), %rcx
movq 0x8(%rsp), %r10
movq %rax, 0x10(%rcx)
movq %rbp, %rax
shlq $0x20, %rax
orq %r15, %rax
movq %rcx, %rdi
movq (%rcx), %rcx
movq 0x10(%rdi), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rdi)
movq %rax, (%rdx,%rcx,8)
cmpq %r15, (%r9)
jbe 0x13dda7
movq 0x10(%r9), %rax
leaq (%r15,%r15,2), %rdx
shlq $0x4, %rdx
movq (%rax,%rdx), %rcx
testq %rcx, %rcx
je 0x13dda7
movq 0x10(%rax,%rdx), %rax
cmpb $0x0, 0x18(%rax)
js 0x13dd9e
cmpl %ebp, 0x8(%rax)
je 0x13dda9
addq $0x28, %rax
decq %rcx
jne 0x13dd93
xorl %eax, %eax
testq %rax, %rax
jne 0x13de00
movq %r15, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %r14
movq 0x10(%r9), %rdi
addq %r14, %rdi
xorpd %xmm0, %xmm0
movq %rbp, %rsi
xorl %edx, %edx
leaq 0x28(%rsp), %rcx
callq 0x13b8bb
movq (%rsp), %r9
movq 0x10(%r9), %rax
movq 0x10(%rax,%r14), %rax
cmpb $0x0, 0x18(%rax)
js 0x13ddeb
cmpl %ebp, 0x8(%rax)
je 0x13ddf1
addq $0x28, %rax
jmp 0x13dde0
movq 0x8(%rsp), %r10
movq 0x10(%rsp), %r8
movq 0x18(%rsp), %r11
subl 0x7c(%rsp), %r12d
movq 0x88(%rsp), %rcx
addl %r12d, %ecx
cmpq %rcx, 0x10(%rax)
jbe 0x13de22
leaq (%rbx,%rcx,8), %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rax)
cmpq %rbp, (%r9)
jbe 0x13de5d
movq 0x10(%r9), %rax
leaq (,%rbp,2), %rdx
addq %rbp, %rdx
shlq $0x4, %rdx
movq (%rax,%rdx), %rcx
testq %rcx, %rcx
je 0x13de5d
movq 0x10(%rax,%rdx), %rax
cmpb $0x0, 0x18(%rax)
js 0x13de54
cmpl %r15d, 0x8(%rax)
je 0x13de5f
addq $0x28, %rax
decq %rcx
jne 0x13de48
xorl %eax, %eax
testq %rax, %rax
jne 0x13debb
shlq $0x4, %rbp
leaq (,%rbp,2), %r14
addq %rbp, %r14
movq 0x10(%r9), %rdi
addq %r14, %rdi
xorpd %xmm0, %xmm0
movq %r15, %rsi
xorl %edx, %edx
leaq 0x28(%rsp), %rcx
callq 0x13b8bb
movq (%rsp), %r9
movq 0x10(%r9), %rax
movq 0x10(%rax,%r14), %rax
cmpb $0x0, 0x18(%rax)
js 0x13dea6
cmpl %r15d, 0x8(%rax)
je 0x13deac
addq $0x28, %rax
jmp 0x13de9a
movq 0x8(%rsp), %r10
movq 0x10(%rsp), %r8
movq 0x18(%rsp), %r11
movq 0x20(%r10), %rcx
movl (%rcx,%r15,8), %ecx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl %edx, %ecx
movq 0x30(%rsp), %rdx
notl %edx
addl %edx, %r12d
addl %ecx, %r12d
movl %r13d, %edx
cmpq %r12, 0x10(%rax)
jbe 0x13def2
movzbl %bl, %ecx
leaq (%rcx,%r12,8), %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rax)
movl %r13d, %edx
incl %r13d
cmpl %r8d, %r13d
jbe 0x13db67
movq 0x50(%rsp), %rdx
movq 0x80(%rsp), %rdi
movb (%rdx,%rdi), %al
addb $-0x2, %al
movb %al, (%rdx,%rdi)
incl %edi
movq 0x20(%rsp), %rax
cmpq %rdi, 0x18(%rax)
ja 0x13daf7
movq 0x48(%rsp), %rax
cmpq $0x0, (%rax)
je 0x13e396
xorl %esi, %esi
movq 0x10(%rax), %rax
movq (%rax,%rsi,8), %rax
movl %eax, %ecx
movq %rax, %rdx
shrq $0x20, %rdx
leaq (%rcx,%rcx,2), %rbx
movq %rcx, 0x18(%rsp)
cmpq %rcx, (%r9)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x30(%rsp)
jbe 0x13df90
movq 0x10(%r9), %rcx
movq %rbx, %rdx
shlq $0x4, %rdx
movq (%rcx,%rdx), %rax
testq %rax, %rax
je 0x13df94
movq 0x10(%rcx,%rdx), %rbp
movq 0x10(%rsp), %rdx
cmpb $0x0, 0x18(%rbp)
js 0x13df87
cmpl 0x8(%rbp), %edx
je 0x13df9b
addq $0x28, %rbp
decq %rax
jne 0x13df7c
xorl %ebp, %ebp
jmp 0x13df9b
xorl %ebp, %ebp
movq 0x10(%rsp), %rdx
movq 0x10(%r9), %r14
shlq $0x4, %rbx
cmpq $0x0, (%r14,%rbx)
je 0x13e37c
xorl %r13d, %r13d
movq 0x10(%r14,%rbx), %rax
leaq (,%r13,4), %rcx
addq %r13, %rcx
cmpb $0x0, 0x18(%rax,%rcx,8)
js 0x13e36b
leaq (%rax,%rcx,8), %r15
movl 0x8(%r15), %r12d
cmpl %edx, %r12d
je 0x13e36b
movq 0x10(%r15), %rax
cmpq $-0x1, %rax
je 0x13e36b
movq 0x10(%rbp), %r9
movl %r9d, %ecx
xorl %eax, %ecx
testb $0x2, %cl
jne 0x13e092
movq %r9, %rdi
shrq $0x3, %rdi
movq %rax, %rsi
shrq $0x3, %rsi
movq 0x20(%r10), %rcx
movl 0x8(%rbp), %edx
movl (%rcx,%rdx,8), %edx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andq %r8, %rdx
movl (%rcx,%r12,8), %ecx
andq %r8, %rcx
andl $0x1, %r9d
andl $0x1, %eax
movl %r9d, %r8d
movl %eax, %r9d
leaq 0x58(%rsp), %rax
pushq %rax
leaq 0x68(%rsp), %rax
pushq %rax
callq 0x13d827
addq $0x10, %rsp
movl 0x8(%rbp), %ecx
movq (%rsp), %r9
cmpq %rcx, (%r9)
jbe 0x13e124
leaq (%rcx,%rcx,2), %rax
shlq $0x4, %rax
movq (%r14,%rax), %rdx
testq %rdx, %rdx
movq 0x8(%rsp), %r10
je 0x13e08b
movq 0x10(%r14,%rax), %rax
cmpb $0x0, 0x18(%rax)
js 0x13e082
cmpl %r12d, 0x8(%rax)
je 0x13e12b
addq $0x28, %rax
decq %rdx
jne 0x13e072
xorl %eax, %eax
jmp 0x13e12b
movq 0x20(%r10), %rsi
movl 0x8(%rbp), %ecx
movl (%rsi,%rcx,8), %edx
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andq %rdi, %rdx
movl (%rsi,%r12,8), %ecx
andq %rdi, %rcx
movq 0x18(%rsp), %r8
movl (%rsi,%r8,8), %r8d
andq %rdi, %r8
andl $0x1, %r9d
andl $0x1, %eax
subq $0x8, %rsp
movq %rbp, %rdi
movq %r15, %rsi
leaq 0x60(%rsp), %r10
pushq %r10
leaq 0x70(%rsp), %r10
pushq %r10
pushq %rax
callq 0x13d94d
addq $0x20, %rsp
movl 0x8(%rbp), %ecx
movq (%rsp), %r9
cmpq %rcx, (%r9)
jbe 0x13e182
leaq (%rcx,%rcx,2), %rax
shlq $0x4, %rax
movq (%r14,%rax), %rdx
testq %rdx, %rdx
movq 0x8(%rsp), %r10
je 0x13e120
movq 0x10(%r14,%rax), %rax
cmpb $0x0, 0x18(%rax)
js 0x13e117
cmpl %r12d, 0x8(%rax)
je 0x13e189
addq $0x28, %rax
decq %rdx
jne 0x13e10b
xorl %eax, %eax
jmp 0x13e189
xorl %eax, %eax
movq 0x8(%rsp), %r10
testq %rax, %rax
jne 0x13e1e9
leaq (%rcx,%rcx,2), %rax
shlq $0x4, %rax
addq %rax, %r14
xorpd %xmm0, %xmm0
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
leaq 0x28(%rsp), %rcx
callq 0x13b8bb
movq (%rsp), %r9
movl 0x8(%rbp), %eax
movl 0x8(%r15), %ecx
movq 0x10(%r9), %rdx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movq 0x10(%rdx,%rax), %rax
cmpb $0x0, 0x18(%rax)
js 0x13e17c
cmpl %ecx, 0x8(%rax)
je 0x13e1e4
addq $0x28, %rax
jmp 0x13e171
xorl %eax, %eax
movq 0x8(%rsp), %r10
testq %rax, %rax
jne 0x13e29d
leaq (%rcx,%rcx,2), %rax
shlq $0x4, %rax
addq %rax, %r14
xorpd %xmm0, %xmm0
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
leaq 0x28(%rsp), %rcx
callq 0x13b8bb
movq (%rsp), %r9
movl 0x8(%rbp), %eax
movl 0x8(%r15), %ecx
movq 0x10(%r9), %rdx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movq 0x10(%rdx,%rax), %rax
cmpb $0x0, 0x18(%rax)
js 0x13e1de
cmpl %ecx, 0x8(%rax)
je 0x13e298
addq $0x28, %rax
jmp 0x13e1cf
movq 0x8(%rsp), %r10
movq 0x60(%rsp), %rcx
movq %rcx, %rdx
shrq $0x3, %rdx
movq 0x10(%rax), %rsi
shrq $0x3, %rsi
cmpq %rsi, %rdx
jae 0x13e206
movq %rcx, 0x10(%rax)
movl 0x8(%r15), %ecx
movl 0x8(%rbp), %esi
cmpq %rcx, (%r9)
jbe 0x13e240
movq 0x10(%r9), %rax
leaq (%rcx,%rcx,2), %rdi
shlq $0x4, %rdi
movq (%rax,%rdi), %rdx
testq %rdx, %rdx
je 0x13e240
movq 0x10(%rax,%rdi), %rax
cmpb $0x0, 0x18(%rax)
js 0x13e237
cmpl %esi, 0x8(%rax)
je 0x13e242
addq $0x28, %rax
decq %rdx
jne 0x13e22c
xorl %eax, %eax
testq %rax, %rax
jne 0x13e349
leaq (%rcx,%rcx,2), %rdi
shlq $0x4, %rdi
addq 0x10(%r9), %rdi
xorpd %xmm0, %xmm0
xorl %edx, %edx
leaq 0x28(%rsp), %rcx
callq 0x13b8bb
movq (%rsp), %r9
movl 0x8(%r15), %eax
movl 0x8(%rbp), %ecx
movq 0x10(%r9), %rdx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movq 0x10(%rdx,%rax), %rax
cmpb $0x0, 0x18(%rax)
js 0x13e292
cmpl %ecx, 0x8(%rax)
je 0x13e344
addq $0x28, %rax
jmp 0x13e283
movq 0x8(%rsp), %r10
movq 0x60(%rsp), %rcx
movq %rcx, %rdx
shrq $0x3, %rdx
movq 0x10(%rax), %rsi
shrq $0x3, %rsi
cmpq %rsi, %rdx
jae 0x13e2ba
movq %rcx, 0x10(%rax)
movl 0x8(%r15), %ecx
movl 0x8(%rbp), %esi
cmpq %rcx, (%r9)
jbe 0x13e2f4
movq 0x10(%r9), %rax
leaq (%rcx,%rcx,2), %rdi
shlq $0x4, %rdi
movq (%rax,%rdi), %rdx
testq %rdx, %rdx
je 0x13e2f4
movq 0x10(%rax,%rdi), %rax
cmpb $0x0, 0x18(%rax)
js 0x13e2eb
cmpl %esi, 0x8(%rax)
je 0x13e2f6
addq $0x28, %rax
decq %rdx
jne 0x13e2e0
xorl %eax, %eax
testq %rax, %rax
jne 0x13e349
leaq (%rcx,%rcx,2), %rdi
shlq $0x4, %rdi
addq 0x10(%r9), %rdi
xorpd %xmm0, %xmm0
xorl %edx, %edx
leaq 0x28(%rsp), %rcx
callq 0x13b8bb
movq (%rsp), %r9
movl 0x8(%r15), %eax
movl 0x8(%rbp), %ecx
movq 0x10(%r9), %rdx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movq 0x10(%rdx,%rax), %rax
cmpb $0x0, 0x18(%rax)
js 0x13e33e
cmpl %ecx, 0x8(%rax)
je 0x13e344
addq $0x28, %rax
jmp 0x13e333
movq 0x8(%rsp), %r10
movq 0x58(%rsp), %rcx
movq %rcx, %rdx
shrq $0x3, %rdx
movq 0x10(%rax), %rsi
shrq $0x3, %rsi
cmpq %rsi, %rdx
movq 0x10(%rsp), %rdx
jae 0x13e36b
movq %rcx, 0x10(%rax)
incl %r13d
movq 0x10(%r9), %r14
cmpq %r13, (%r14,%rbx)
ja 0x13dfb1
movq 0x30(%rsp), %rsi
incl %esi
movq 0x48(%rsp), %rax
cmpq %rsi, (%rax)
movq 0x50(%rsp), %rdx
ja 0x13df35
movq 0x20(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x13e5e7
xorl %ecx, %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
xorl %esi, %esi
movb (%rdx,%rcx), %al
notb %al
testb $0x3, %al
jne 0x13e5c9
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rax
movq (%rax,%rcx,8), %r9
testl %r9d, %r9d
je 0x13e5c6
movl %esi, 0x30(%rsp)
movq %rcx, 0x18(%rsp)
movq %r9, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %r13
shlq $0x4, %r13
movq 0x20(%rsp), %rax
addq 0x10(%rax), %r13
movl $0x1, %ebp
xorl %eax, %eax
movl $0x0, (%rsp)
movq %r9, 0x10(%rsp)
movl %ebp, %ecx
movl %eax, %esi
cmpl %r9d, %ebp
je 0x13e430
leaq (%rcx,%rcx,2), %rdx
shlq $0x4, %rdx
movl 0x14(%r13,%rdx), %edx
leaq (%rsi,%rsi,2), %rdi
shlq $0x4, %rdi
cmpl 0x14(%r13,%rdi), %edx
je 0x13e5a7
leaq (%rsi,%rsi,2), %rdx
shlq $0x4, %rdx
addq %r13, %rdx
cmpl %ebp, %eax
jae 0x13e46d
leaq (%rsi,%rsi,2), %rdi
shlq $0x4, %rdi
addq %r13, %rdi
subq %rsi, %rcx
movsd 0x20(%rdi), %xmm0
ucomisd 0x20(%rdx), %xmm0
movq %rdi, %rax
ja 0x13e45f
movq %rdx, %rax
addq $0x30, %rdi
movq %rax, %rdx
decq %rcx
jne 0x13e44d
jmp 0x13e470
movq %rdx, %rax
movzbl 0x28(%rax), %ebx
movl %ebx, %ecx
andb $0x3f, %cl
cmpb $0x2, %cl
jne 0x13e4a4
shrl $0x6, %ebx
movl 0x14(%rax), %r14d
andl $0x1, %ebx
je 0x13e4ab
movq 0x20(%r10), %rcx
movl (%rcx,%r14,8), %ecx
andl %r8d, %ecx
movl 0xc(%rax), %r8d
notl %r8d
addl %ecx, %r8d
subl 0x10(%rax), %ecx
jmp 0x13e4b5
movl %ebp, %eax
jmp 0x13e5a7
movl 0xc(%rax), %ecx
movl 0x10(%rax), %r8d
decl %r8d
movl 0x8(%rax), %r15d
movl (%rax), %edi
movl 0x4(%rax), %eax
decl %eax
movl %eax, %esi
movq 0x20(%r10), %rax
movl (%rax,%r15,8), %edx
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
andq %r11, %rdx
movl %ecx, %ecx
movl %r8d, %r8d
movl (%rax,%r14,8), %r9d
andq %r11, %r9
leaq 0x38(%rsp), %rax
pushq %rax
leaq 0x48(%rsp), %rax
pushq %rax
leaq 0x78(%rsp), %rax
pushq %rax
leaq 0x88(%rsp), %rax
pushq %rax
movq %r10, %r12
callq 0x105f44
addq $0x20, %rsp
testb %bl, %bl
je 0x13e52d
movq 0x20(%r12), %rax
movl (%rax,%r14,8), %eax
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %eax
movl 0x38(%rsp), %r9d
notl %r9d
addl %eax, %r9d
subl 0x40(%rsp), %eax
jmp 0x13e53e
movl 0x40(%rsp), %r9d
movl 0x38(%rsp), %eax
incl %eax
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movl 0x68(%rsp), %edx
incl %edx
movl 0x70(%rsp), %esi
movq 0x20(%r12), %rdi
movl (%rdi,%r15,8), %ecx
andl %r8d, %ecx
movl (%rdi,%r14,8), %r10d
andl %r8d, %r10d
movl %r15d, %edi
movl %r14d, %r8d
leaq 0x90(%rsp), %r11
pushq %r11
pushq %rbx
pushq %r10
pushq %rax
callq 0x13d427
addq $0x20, %rsp
cmpl $-0x2, %eax
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
jne 0x13e59b
movq 0x50(%rsp), %rax
testb $0x2, (%rax,%r14)
movl $0x1, %eax
movl (%rsp), %ecx
cmovnel %eax, %ecx
movl %ecx, (%rsp)
movl %ebp, %eax
movq 0x8(%rsp), %r10
movq 0x10(%rsp), %r9
incl %ebp
cmpl %r9d, %ebp
jbe 0x13e407
cmpl $0x0, (%rsp)
movq 0x50(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl 0x30(%rsp), %esi
jne 0x13e5c9
decb (%rdx,%rcx)
movzbl (%rdx,%rcx), %eax
btl $0x1, %eax
adcl $0x0, %esi
incl %ecx
movq 0x20(%rsp), %rax
cmpq %rcx, 0x18(%rax)
ja 0x13e3b0
jmp 0x13e5e9
xorl %esi, %esi
movl %esi, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq