// File: 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
movq %rsp, %rbp
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $-0x1, -0x50(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x0, -0x88(%rbp)
movl $0x0, -0xa8(%rbp)
movq -0x30(%rbp), %rax
movq $0x0, (%rax)
movl -0xa8(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x1d0008
movq -0x20(%rbp), %rax
movl -0xa8(%rbp), %ecx
movzbl (%rax,%rcx), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1cfff2
movq -0x20(%rbp), %rax
movl -0xa8(%rbp), %ecx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1cfff2
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xa8(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
jne 0x1cf9c4
movq -0x20(%rbp), %rax
movl -0xa8(%rbp), %ecx
movzbl (%rax,%rcx), %edx
subl $0x2, %edx
movb %dl, (%rax,%rcx)
jmp 0x1cfff4
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0xa8(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0xa8(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0xb4(%rbp)
movl $0x0, -0xac(%rbp)
movl $0x1, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
cmpl -0xb4(%rbp), %eax
ja 0x1cffde
movl -0xa4(%rbp), %eax
cmpl -0xb4(%rbp), %eax
je 0x1cfa67
movq -0x80(%rbp), %rax
movl -0xa4(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq -0x80(%rbp), %rcx
movl -0xac(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x14(%rcx), %eax
je 0x1cffc8
movl -0xac(%rbp), %eax
movl %eax, -0xb8(%rbp)
movq -0x80(%rbp), %rax
movl -0xac(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movl -0xb8(%rbp), %eax
cmpl -0xa4(%rbp), %eax
jae 0x1cfae8
movq -0x80(%rbp), %rax
movl -0xb8(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movq -0x88(%rbp), %rax
ucomisd 0x20(%rax), %xmm0
jbe 0x1cfad5
movq -0x80(%rbp), %rax
movl -0xb8(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
jmp 0x1cfad7
movl -0xb8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb8(%rbp)
jmp 0x1cfa8b
movq -0x88(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x2, %eax
jne 0x1cffbc
movq -0x88(%rbp), %rax
movb 0x28(%rax), %al
shrb $0x6, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x74(%rbp)
movq -0x88(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x88(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x88(%rbp), %rax
movl 0x4(%rax), %eax
subl $0x1, %eax
movl %eax, -0x68(%rbp)
cmpl $0x0, -0x74(%rbp)
je 0x1cfb9e
movq -0x88(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0x88(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
subl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x6c(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0x88(%rbp), %rcx
subl 0xc(%rcx), %eax
subl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x1cfbc8
movq -0x88(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x88(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x88(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x1, %eax
movl %eax, -0x70(%rbp)
movl -0x64(%rbp), %eax
movl %eax, %edi
movl -0x68(%rbp), %eax
movl %eax, %esi
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x5c(%rbp), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edx
movl -0x6c(%rbp), %eax
movl %eax, %ecx
movl -0x70(%rbp), %eax
movl %eax, %r8d
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %r9d
movl (%rax,%r9,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %r9d
leaq -0xc0(%rbp), %rbx
leaq -0xc8(%rbp), %r11
leaq -0xd0(%rbp), %r10
leaq -0xd8(%rbp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x170800
movq -0xc0(%rbp), %rax
movl %eax, -0x64(%rbp)
movq -0xc8(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x68(%rbp)
cmpl $0x0, -0x74(%rbp)
je 0x1cfcac
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
subq -0xd8(%rbp), %rax
subq $0x1, %rax
movl %eax, -0x6c(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
subq -0xd0(%rbp), %rax
subq $0x1, %rax
addq $0x1, %rax
movl %eax, -0x70(%rbp)
jmp 0x1cfcc4
movq -0xd0(%rbp), %rax
movl %eax, -0x6c(%rbp)
movq -0xd8(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x70(%rbp)
movl -0x5c(%rbp), %edi
movl -0x64(%rbp), %esi
movl -0x68(%rbp), %edx
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x5c(%rbp), %ecx
movl (%rax,%rcx,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl -0x60(%rbp), %r8d
movl -0x6c(%rbp), %r9d
movl -0x70(%rbp), %ebx
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %r10d
movl (%rax,%r10,8), %r11d
andl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movl -0x74(%rbp), %r10d
leaq -0xa0(%rbp), %rax
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x1ce710
movl %eax, -0xdc(%rbp)
cmpl $-0x3, -0xdc(%rbp)
jne 0x1cffba
movl -0x60(%rbp), %eax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x58(%rbp)
movl -0x5c(%rbp), %eax
orq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1cfdc7
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1cfd86
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xf8(%rbp)
jmp 0x1cfd94
movl $0x2, %eax
movq %rax, -0xf8(%rbp)
jmp 0x1cfd94
movq -0xf8(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rdi
movl -0x5c(%rbp), %eax
movl %eax, %esi
movl -0x60(%rbp), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1cfe4a
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x5c(%rbp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movl -0x60(%rbp), %eax
movl %eax, %esi
xorps %xmm0, %xmm0
xorl %edx, %edx
leaq -0x50(%rbp), %rcx
callq 0x1cb380
movq -0x18(%rbp), %rdi
movl -0x5c(%rbp), %eax
movl %eax, %esi
movl -0x60(%rbp), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x38(%rbp)
movl -0x70(%rbp), %eax
subl -0x6c(%rbp), %eax
addl -0x64(%rbp), %eax
movl %eax, %eax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1cfec5
movq -0x58(%rbp), %rcx
shlq %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
shlq %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x0, %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
shlq %rcx
movq %rcx, 0x10(%rax)
movl -0x74(%rbp), %eax
movl %eax, %ecx
movq -0x38(%rbp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
movl -0x60(%rbp), %eax
movl %eax, %esi
movl -0x5c(%rbp), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1cff27
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x60(%rbp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movl -0x5c(%rbp), %eax
movl %eax, %esi
xorps %xmm0, %xmm0
xorl %edx, %edx
leaq -0x50(%rbp), %rcx
callq 0x1cb380
movq -0x18(%rbp), %rdi
movl -0x60(%rbp), %eax
movl %eax, %esi
movl -0x5c(%rbp), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x38(%rbp)
movl -0x70(%rbp), %eax
subl -0x6c(%rbp), %eax
movq -0x28(%rbp), %rcx
movq 0x20(%rcx), %rcx
movl -0x5c(%rbp), %edx
movl (%rcx,%rdx,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addl %ecx, %eax
subl -0x68(%rbp), %eax
movl %eax, %eax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1cffb8
movq -0x58(%rbp), %rcx
shlq %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
shlq %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x0, %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
shlq %rcx
movq %rcx, 0x10(%rax)
movl -0x74(%rbp), %eax
movl %eax, %ecx
movq -0x38(%rbp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
jmp 0x1cffba
jmp 0x1cffbc
movl -0xa4(%rbp), %eax
movl %eax, -0xac(%rbp)
jmp 0x1cffca
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x1cfa19
movq -0x20(%rbp), %rax
movl -0xa8(%rbp), %ecx
movzbl (%rax,%rcx), %edx
subl $0x2, %edx
movb %dl, (%rax,%rcx)
jmp 0x1cfff4
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
jmp 0x1cf948
movl $0x0, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1d0539
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xa8(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x5c(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xa8(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
movl -0x60(%rbp), %eax
movl %eax, %esi
movl -0x5c(%rbp), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x38(%rbp)
movl $0x0, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x60(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x1d0523
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x60(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0xa4(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movb 0x18(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x1d00cb
jmp 0x1d050f
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x60(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0xa4(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x5c(%rbp), %eax
jne 0x1d00fb
jmp 0x1d050f
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x60(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0xa4(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq $-0x1, 0x10(%rax)
jne 0x1d0132
jmp 0x1d050f
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
andq $0x2, %rax
movq -0x40(%rbp), %rcx
movq 0x10(%rcx), %rcx
andq $0x2, %rcx
cmpq %rcx, %rax
jne 0x1d032a
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
shrq $0x3, %rdi
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rsi
shrq $0x3, %rsi
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x38(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edx
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x40(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
andq $0x1, %rax
movl %eax, %r8d
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
andq $0x1, %rax
movl %eax, %r9d
leaq -0xe8(%rbp), %r10
leaq -0xf0(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1cf000
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x1d0255
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
xorps %xmm0, %xmm0
xorl %edx, %edx
leaq -0x50(%rbp), %rcx
callq 0x1cb380
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x48(%rbp)
movq -0xe8(%rbp), %rax
shrq $0x3, %rax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
shrq $0x3, %rcx
cmpq %rcx, %rax
jae 0x1d0280
movq -0xe8(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x1d02fa
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
xorps %xmm0, %xmm0
xorl %edx, %edx
leaq -0x50(%rbp), %rcx
callq 0x1cb380
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x48(%rbp)
movq -0xf0(%rbp), %rax
shrq $0x3, %rax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
shrq $0x3, %rcx
cmpq %rcx, %rax
jae 0x1d0325
movq -0xf0(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x1d050d
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x38(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edx
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x40(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %r8d
movl (%rax,%r8,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %r8d
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
andq $0x1, %rax
movl %eax, %r9d
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
andq $0x1, %rax
movl %eax, %r11d
leaq -0xe8(%rbp), %r10
leaq -0xf0(%rbp), %rax
movl %r11d, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1cf420
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x1d043b
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
xorps %xmm0, %xmm0
xorl %edx, %edx
leaq -0x50(%rbp), %rcx
callq 0x1cb380
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x48(%rbp)
movq -0xe8(%rbp), %rax
shrq $0x3, %rax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
shrq $0x3, %rcx
cmpq %rcx, %rax
jae 0x1d0466
movq -0xe8(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x1d04e0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
xorps %xmm0, %xmm0
xorl %edx, %edx
leaq -0x50(%rbp), %rcx
callq 0x1cb380
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1d09c0
movq %rax, -0x48(%rbp)
movq -0xf0(%rbp), %rax
shrq $0x3, %rax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
shrq $0x3, %rcx
cmpq %rcx, %rax
jae 0x1d050b
movq -0xf0(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x1d050d
jmp 0x1d050f
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x1d0078
jmp 0x1d0525
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
jmp 0x1d0012
movl $0x0, -0xa8(%rbp)
movl $0x0, -0xb0(%rbp)
movl -0xa8(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x1d09a1
movq -0x20(%rbp), %rax
movl -0xa8(%rbp), %ecx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1d0966
movq -0x20(%rbp), %rax
movl -0xa8(%rbp), %ecx
movzbl (%rax,%rcx), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1d0966
movl $0x0, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0xa8(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0xa8(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0xb4(%rbp)
movl $0x0, -0xac(%rbp)
movl $0x1, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
cmpl -0xb4(%rbp), %eax
ja 0x1d094a
movl -0xa4(%rbp), %eax
cmpl -0xb4(%rbp), %eax
je 0x1d063f
movq -0x80(%rbp), %rax
movl -0xa4(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq -0x80(%rbp), %rcx
movl -0xac(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x14(%rcx), %eax
je 0x1d0934
movl -0xac(%rbp), %eax
movl %eax, -0xb8(%rbp)
movq -0x80(%rbp), %rax
movl -0xac(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movl -0xb8(%rbp), %eax
cmpl -0xa4(%rbp), %eax
jae 0x1d06c0
movq -0x80(%rbp), %rax
movl -0xb8(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movq -0x88(%rbp), %rax
ucomisd 0x20(%rax), %xmm0
jbe 0x1d06ad
movq -0x80(%rbp), %rax
movl -0xb8(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
jmp 0x1d06af
movl -0xb8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb8(%rbp)
jmp 0x1d0663
movq -0x88(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x2, %eax
jne 0x1d0928
movq -0x88(%rbp), %rax
movb 0x28(%rax), %al
shrb $0x6, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x74(%rbp)
movq -0x88(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x88(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x88(%rbp), %rax
movl 0x4(%rax), %eax
subl $0x1, %eax
movl %eax, -0x68(%rbp)
cmpl $0x0, -0x74(%rbp)
je 0x1d0776
movq -0x88(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0x88(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
subl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x6c(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0x88(%rbp), %rcx
subl 0xc(%rcx), %eax
subl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x1d07a0
movq -0x88(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x88(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x88(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x1, %eax
movl %eax, -0x70(%rbp)
movl -0x64(%rbp), %eax
movl %eax, %edi
movl -0x68(%rbp), %eax
movl %eax, %esi
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x5c(%rbp), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edx
movl -0x6c(%rbp), %eax
movl %eax, %ecx
movl -0x70(%rbp), %eax
movl %eax, %r8d
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %r9d
movl (%rax,%r9,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %r9d
leaq -0xc0(%rbp), %rbx
leaq -0xc8(%rbp), %r11
leaq -0xd0(%rbp), %r10
leaq -0xd8(%rbp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x170800
movq -0xc0(%rbp), %rax
movl %eax, -0x64(%rbp)
movq -0xc8(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x68(%rbp)
cmpl $0x0, -0x74(%rbp)
je 0x1d0884
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
subq -0xd8(%rbp), %rax
subq $0x1, %rax
movl %eax, -0x6c(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
subq -0xd0(%rbp), %rax
subq $0x1, %rax
addq $0x1, %rax
movl %eax, -0x70(%rbp)
jmp 0x1d089c
movq -0xd0(%rbp), %rax
movl %eax, -0x6c(%rbp)
movq -0xd8(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x70(%rbp)
movl -0x5c(%rbp), %edi
movl -0x64(%rbp), %esi
movl -0x68(%rbp), %edx
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x5c(%rbp), %ecx
movl (%rax,%rcx,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl -0x60(%rbp), %r8d
movl -0x6c(%rbp), %r9d
movl -0x70(%rbp), %ebx
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %r10d
movl (%rax,%r10,8), %r11d
andl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movl -0x74(%rbp), %r10d
leaq -0xa0(%rbp), %rax
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x1ce710
movl %eax, -0xdc(%rbp)
cmpl $-0x2, -0xdc(%rbp)
jne 0x1d0926
movq -0x20(%rbp), %rax
movl -0x60(%rbp), %ecx
movzbl (%rax,%rcx), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1d0926
movl $0x1, -0x78(%rbp)
jmp 0x1d0928
movl -0xa4(%rbp), %eax
movl %eax, -0xac(%rbp)
jmp 0x1d0936
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x1d05f1
cmpl $0x0, -0x78(%rbp)
jne 0x1d0964
movq -0x20(%rbp), %rax
movl -0xa8(%rbp), %ecx
movzbl (%rax,%rcx), %edx
subl $0x1, %edx
movb %dl, (%rax,%rcx)
jmp 0x1d0966
movq -0x20(%rbp), %rax
movl -0xa8(%rbp), %ecx
movzbl (%rax,%rcx), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1d098b
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb0(%rbp)
jmp 0x1d098d
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
jmp 0x1d054d
movl -0xb0(%rbp), %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %rbp
retq
nopw %cs:(%rax,%rax)