// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: rescue_contained_reads_aggressive(ma_ug_t*, asg_t*, ma_hit_t_alloc*, ma_sub_t*, R_to_U*, int, int, unsigned int, unsigned int, unsigned int, kvec_asg_arc_t_warp*, kvec_t_u32_warp*, bub_label_t*)
void rescue_contained_reads_aggressive(ma_ug_t *i_ug, asg_t *r_g, ma_hit_t_alloc* sources, ma_sub_t *coverage_cut,
R_to_U* ruIndex, int max_hang, int min_ovlp, uint32_t chainLenThres, uint32_t is_bubble_check, uint32_t is_primary_check, kvec_asg_arc_t_warp* new_rtg_edges, 
kvec_t_u32_warp* new_rtg_nodes, bub_label_t* b_mask_t)
{
    uint32_t n_vtx, v, k, contain_rId, is_Unitig, uId, rId, endRid, oLen, w, max_oLen, max_oLen_i = (uint32_t)-1;
    uint32_t ava_max, ava_ol_max, ava_min_chain, ava_cur, ava_chainLen, test_oLen, is_update;
    asg_t* nsg = NULL;
    ma_utg_t* nsu = NULL;
    asg_arc_t t, t_max, r_edge;
    t_max.v = t_max.ul = t.v = t.ul = (uint32_t)-1;
    ma_hit_t *h = NULL, *h_max = NULL;
    ma_hit_t_alloc* x = NULL;
    ma_ug_t* ug = NULL;
    uint64_t a_nodes;
    
    kvec_t(asg_arc_t) new_edges;
    kv_init(new_edges);

    kvec_t(asg_arc_t) rbub_edges;
    kv_init(rbub_edges);

    kvec_t_u64_warp u_vecs;
    kv_init(u_vecs.a);

    kvec_t_u32_warp chain_buffer;
    kv_init(chain_buffer.a);

    kvec_asg_arc_t_warp chain_edges;
    kv_init(chain_edges.a);

    if(i_ug != NULL)
    {
        ug = i_ug;
    }
    else
    {
        ug = ma_ug_gen(r_g);
        for (v = 0; v < ug->g->n_seq; v++)
        {
            ug->g->seq[v].c = PRIMARY_LABLE;
        }
    }
    nsg = ug->g;
    
    for (v = 0; v < nsg->n_seq; v++)
    {
        uId = v;
        nsu = &(ug->u.a[uId]);
        if(nsu->m == 0) continue;
        if(nsg->seq[v].del) continue;
        if(is_primary_check && nsg->seq[v].c==ALTER_LABLE) continue;
        for (k = 0; k < nsu->n; k++)
        {
            rId = nsu->a[k]>>33;
            set_R_to_U(ruIndex, rId, uId, 1, &(r_g->seq[rId].c));
        }
    }




    n_vtx = nsg->n_seq * 2;
    for (v = 0; v < n_vtx; v++)
    {
        uId = v>>1;
        if(nsg->seq[uId].del) continue;
        if(is_primary_check && nsg->seq[uId].c==ALTER_LABLE) continue;
        nsu = &(ug->u.a[uId]);
        if(nsu->m == 0) continue;
        if(nsu->circ || nsu->start == UINT32_MAX || nsu->end == UINT32_MAX) continue;
        if(get_real_length(nsg, v, NULL) != 0) continue;
        ///we probably don't need this line
        ///if(get_real_length(nsg, v^1, NULL) == 0) continue;
        if(v&1)
        {
            endRid = nsu->start^1;
        }
        else
        {
            endRid = nsu->end^1;
        }

        ///x is the end read of a tip
        ///find all overlap of x
        x = &(sources[(endRid>>1)]);
        ava_ol_max = ava_max = 0; ava_min_chain = (uint32_t)-1;
        h_max = NULL;
        for (k = 0; k < x->length; k++)
        {
            ///h is the edge of endRid
            h = &(x->buffer[k]);
            ///means we found a contained read
            if(get_contained_reads_chain(h, sources, coverage_cut, ruIndex, ug, r_g, 
            max_hang, min_ovlp, endRid, uId, &chain_buffer, NULL, &ava_cur, &test_oLen, 
            &ava_chainLen, chainLenThres, 1))
            {
                is_update = 0;
                if(ava_chainLen < ava_min_chain)
                {
                    is_update = 1;
                }
                else if(ava_chainLen == ava_min_chain)
                {
                    if(ava_cur > ava_max)
                    {
                        is_update = 1;
                    }
                    else if(ava_cur == ava_max && test_oLen > ava_ol_max)
                    {
                        is_update = 1;
                    }
                }
                if(is_update)
                {
                    ava_min_chain = ava_chainLen;
                    ava_max = ava_cur;
                    ava_ol_max = test_oLen;
                    h_max = h;
                }
            }
        }





        if(ava_max > 0)
        {
            //get all edges between contained reads
            get_contained_reads_chain(h_max, sources, coverage_cut, ruIndex, ug, r_g, 
            max_hang, min_ovlp, endRid, uId, &chain_buffer, &chain_edges, &ava_cur, &test_oLen, 
            &ava_chainLen, chainLenThres, 1);
            if(chain_edges.a.n < 1) continue;
            ///the last cantained read
            t_max = chain_edges.a.a[chain_edges.a.n-1];

            k = 0; rbub_edges.n = 0;
            ///edges from the last contained read to other unitigs
            while(get_edge2existing_node_advance(ug, r_g, sources, coverage_cut, ruIndex, 
                    max_hang, min_ovlp, t_max.v, chain_buffer.a.a, chain_buffer.a.n, &k, &r_edge, 1))
            {
               kv_push(asg_arc_t, rbub_edges, r_edge);
            }

            ///need to do transitive reduction
            ///note here is different to standard transitive reduction
            minor_transitive_reduction(ug, ruIndex, rbub_edges.a, rbub_edges.n);
            if(is_primary_check)
            {
                max_oLen = 0; max_oLen_i = (uint32_t)-1;
                for (k = 0; k < rbub_edges.n; k++)
                {
                    t = rbub_edges.a[k];
                    if(t.del) continue;
                    if(t.ol > max_oLen)
                    {
                        max_oLen = t.ol;
                        max_oLen_i = k;
                    }
                }

                if(max_oLen_i == (uint32_t)-1) continue;
                t = rbub_edges.a[max_oLen_i];
                w = get_corresponding_uId(ug, ruIndex, t.v);
                if(w == ((uint32_t)(-1))) continue;
                if(get_real_length(nsg, w^1, NULL)!=0) continue;
            }
            
            //recover all contained reads
            for (k = 0; k < chain_edges.a.n; k++)
            {
                t_max = chain_edges.a.a[k];
                ///save all infor for reverting
                get_R_to_U(ruIndex, t_max.v>>1, &contain_rId, &is_Unitig);
                a_nodes=contain_rId; 
                a_nodes=a_nodes<<32; 
                a_nodes=a_nodes|((uint64_t)(t_max.v>>1));
                kv_push(uint64_t, u_vecs.a, a_nodes);


                //(t_max.ul>>32)----->(t_max.v/r_edge.ul>>32)----->r_edge.v
                //need to recover (t_max.v/r_edge.ul>>32), 1. set .del = 0 2. set ruIndex
                r_g->seq[t_max.v>>1].del = 0;
                coverage_cut[t_max.v>>1].del = 0;
                coverage_cut[t_max.v>>1].c = PRIMARY_LABLE;
                //add recover to the end of the unitig
                append_rId_to_Unitig(r_g, ug, v, t_max.v, sources, coverage_cut, ruIndex, max_hang, 
                min_ovlp);

                get_edge_from_source(sources, coverage_cut, ruIndex, max_hang, min_ovlp, 
                (t_max.ul>>32), t_max.v, &t);
                kv_push(asg_arc_t, new_edges, t);

                get_edge_from_source(sources, coverage_cut, ruIndex, max_hang, min_ovlp, 
                (t_max.v^1), ((t_max.ul>>32)^1), &t);
                kv_push(asg_arc_t, new_edges, t);
            }

            if(is_primary_check)
            {
                t = rbub_edges.a[max_oLen_i];
                w = get_corresponding_uId(ug, ruIndex, t.v);
                if(w == ((uint32_t)(-1))) continue;
                kv_push(asg_arc_t, new_edges, t);
                oLen = t.ol;
                asg_append_edges_to_srt(nsg, v, ug->u.a[v>>1].len, w, oLen, t.strong, t.el, t.no_l_indel);

                get_edge_from_source(sources, coverage_cut, ruIndex, max_hang, min_ovlp, 
                (t.v^1), ((t.ul>>32)^1), &t);
                kv_push(asg_arc_t, new_edges, t);
                oLen = t.ol;
                asg_append_edges_to_srt(nsg, w^1, ug->u.a[w>>1].len, v^1, oLen, t.strong, t.el, t.no_l_indel);
            }
            else
            {
                for (k = 0; k < rbub_edges.n; k++)
                {
                    t = rbub_edges.a[k];
                    if(t.del) continue;
                    w = get_corresponding_uId(ug, ruIndex, t.v);
                    if(w == ((uint32_t)(-1))) continue;
            
                    kv_push(asg_arc_t, new_edges, t);
                    oLen = t.ol;
                    asg_append_edges_to_srt(nsg, v, ug->u.a[v>>1].len, w, oLen, t.strong, t.el, t.no_l_indel);


                    get_edge_from_source(sources, coverage_cut, ruIndex, max_hang, min_ovlp, 
                    (t.v^1), ((t.ul>>32)^1), &t);
                    kv_push(asg_arc_t, new_edges, t);
                    oLen = t.ol;
                    asg_append_edges_to_srt(nsg, w^1, ug->u.a[w>>1].len, v^1, oLen, t.strong, t.el, t.no_l_indel);
                }
            }
            
        }
    }

    asg_arc_t* p = NULL;
    if(is_bubble_check)
    {
        
        for (k = 0; k < new_edges.n; k++)
        {
            p = asg_arc_pushp(r_g);
            *p = new_edges.a[k];
        }

        if(new_edges.n != 0)
        {
            free(r_g->idx);
            r_g->idx = 0;
            r_g->is_srt = 0;
            asg_cleanup(r_g);
        }
        
        pre_clean(sources, coverage_cut, r_g, 0);

        lable_all_bubbles(r_g, b_mask_t);

        for (k = 0; k < new_edges.n; k++)
        {
            v = new_edges.a[k].ul>>32;
            w = new_edges.a[k].v;

            if(r_g->seq[v>>1].del) continue;
            if(r_g->seq[w>>1].del) continue;
            ///if this edge is at a bubble
            if(r_g->seq_vis[v]!=0 && r_g->seq_vis[w^1]!=0) continue;

            asg_arc_del(r_g, v, w, 1);
            asg_arc_del(r_g, w^1, v^1, 1);
        }
        asg_cleanup(r_g);


        // w=max_contain_rId; w=w<<32; w=w|(t_max.v>>1);
        // kv_push(uint64_t, u_vecs.a, w);
        for (k = 0; k < u_vecs.a.n; k++)
        {
            w = (uint32_t)u_vecs.a.a[k];
            w = w<<1;
            if(!r_g->seq[w>>1].del && get_real_length(r_g, w, NULL)!=0) continue;
            if(!r_g->seq[w>>1].del && get_real_length(r_g, (w^1), NULL)!=0) continue;
            w=w>>1;
            r_g->seq[w].del = 1;
            coverage_cut[w].del = 1;
            set_R_to_U(ruIndex, ((uint32_t)(u_vecs.a.a[k])), (u_vecs.a.a[k]>>32), 0, NULL);
        }
    }

    ///actually we don't update sources
    ///during the the primary_check, we need to recover everything for r_g, coverage_cut and ruIndex
    if(is_primary_check)
    {
        ///don't remove nodes and edges
        /**
        for (k = 0; k < u_vecs.a.n; k++)
        {
            w = (uint32_t)u_vecs.a.a[k];
            r_g->seq[w].del = 1;
            coverage_cut[w].del = 1;
            set_R_to_U(ruIndex, ((uint32_t)(u_vecs.a.a[k])), (u_vecs.a.a[k]>>32), 0);
        }
        **/
       if(new_rtg_nodes)
       {
           for(k = 0; k < u_vecs.a.n; k++)
           {
                w = (uint32_t)u_vecs.a.a[k];
                kv_push(uint32_t, new_rtg_nodes->a, w);
           }
       }

       
        for (k = 0; k < new_edges.n; k++)
        {
            p = asg_arc_pushp(r_g);
            *p = new_edges.a[k];
            if(new_rtg_edges) kv_push(asg_arc_t, new_rtg_edges->a, new_edges.a[k]);
        }

        if(new_edges.n != 0)
        {
            free(r_g->idx);
            r_g->idx = 0;
            r_g->is_srt = 0;
            asg_cleanup(r_g);
        }
    }


    for (v = 0; v < ruIndex->len; v++)
    {
        get_R_to_U(ruIndex, v, &uId, &is_Unitig);
        if(is_Unitig == 1) ruIndex->index[v] = (uint32_t)-1;
    }


    if(i_ug == NULL) ma_ug_destroy(ug);
    kv_destroy(new_edges);
    kv_destroy(rbub_edges);
    kv_destroy(u_vecs.a);
    kv_destroy(chain_buffer.a);
    kv_destroy(chain_edges.a);
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %r9, 0xa0(%rsp)
movq %r8, %r13
movq %rcx, 0x98(%rsp)
movq %rdx, %r15
movq %rsi, %r12
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x40(%rsp)
movl $0xffffffff, 0x48(%rsp) # imm = 0xFFFFFFFF
xorl %eax, %eax
movq %rax, 0x120(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x110(%rsp)
movq %rax, 0xf0(%rsp)
movaps %xmm0, 0xe0(%rsp)
movq %rdi, %r10
movq %rdi, 0x108(%rsp)
testq %rdi, %rdi
jne 0xd74dd
movq %r12, %rdi
callq 0xb0285
movq %rax, %r10
movq 0x18(%rax), %rax
testl $0x7fffffff, 0x14(%rax) # imm = 0x7FFFFFFF
je 0xd74dd
movq 0x20(%rax), %rcx
xorl %edx, %edx
movb $0x0, 0x4(%rcx,%rdx,8)
incq %rdx
movl 0x14(%rax), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
cmpq %rsi, %rdx
jb 0xd74c7
movq 0x18(%r10), %rsi
movl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
andl 0x14(%rsi), %ebx
movq %rsi, 0x30(%rsp)
je 0xd7596
xorl %r14d, %r14d
movq %r10, %rbp
movq 0x10(%r10), %rax
leaq (%r14,%r14,4), %rcx
cmpl $0x0, 0xc(%rax,%rcx,8)
je 0xd7579
movq 0x30(%rsp), %rdx
movq 0x20(%rdx), %rdx
cmpl $0x0, (%rdx,%r14,8)
js 0xd7579
cmpl $0x0, 0x198(%rsp)
je 0xd752b
cmpb $0x1, 0x4(%rdx,%r14,8)
je 0xd7579
leaq (%rax,%rcx,8), %rbx
movl $0x0, 0x8(%rsp)
cmpl $0x0, 0x10(%rbx)
je 0xd7579
xorl %eax, %eax
movq 0x18(%rbx), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rsi
shrq $0x21, %rsi
movq 0x20(%r12), %rax
leaq (%rax,%rsi,8), %r8
addq $0x4, %r8
movq %r13, %rdi
movl %r14d, %edx
movl $0x1, %ecx
callq 0xa1cd4
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
cmpl 0x10(%rbx), %eax
jb 0xd753f
incq %r14
movq 0x30(%rsp), %rsi
movl 0x14(%rsi), %ebx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
cmpq %rbx, %r14
movq %rbp, %r10
jb 0xd74f7
testl %ebx, %ebx
movq %r10, 0x10(%rsp)
je 0xd83c8
addl %ebx, %ebx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %edx, %edx
movq $0x0, 0x90(%rsp)
movq $0x0, 0xd0(%rsp)
xorl %r14d, %r14d
movq $0x0, 0xd8(%rsp)
xorl %ecx, %ecx
movq $0x0, 0x28(%rsp)
movq $0x0, 0x70(%rsp)
xorl %r11d, %r11d
movq %r13, 0x88(%rsp)
movq %r15, 0x60(%rsp)
movl %edx, %ebp
shrl %ebp
movq 0x20(%rsi), %rax
cmpl $0x0, (%rax,%rbp,8)
js 0xd7870
cmpl $0x0, 0x198(%rsp)
je 0xd761e
cmpb $0x1, 0x4(%rax,%rbp,8)
je 0xd7870
movq 0x10(%r10), %rax
leaq (,%rbp,4), %r8
addq %rbp, %r8
cmpl $0x0, 0xc(%rax,%r8,8)
je 0xd7870
movq %r8, 0xc8(%rsp)
leaq (%rax,%r8,8), %rax
cmpl $0x0, (%rax)
js 0xd7870
cmpl $-0x1, 0x4(%rax)
je 0xd7870
cmpl $-0x1, 0x8(%rax)
je 0xd7870
movl %edi, 0xc(%rsp)
movq %rcx, 0x18(%rsp)
movq 0x28(%rsi), %rcx
movq (%rcx,%rdx,8), %rcx
movq %rcx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rsi, %rdi
je 0xd76c4
movq 0x30(%rsp), %rsi
movq 0x8(%rsi), %rsi
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rsi,%rcx,8), %rcx
addq $0xc, %rcx
shlq $0x3, %rdi
leaq (%rdi,%rdi,2), %r9
xorl %esi, %esi
xorl %edi, %edi
movl (%rcx,%rsi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %edi
addq $0x18, %rsi
cmpq %rsi, %r9
jne 0xd76a5
testl %edi, %edi
jne 0xd7862
leaq 0x4(%rax), %rcx
addq $0x8, %rax
testb $0x1, %dl
cmovneq %rcx, %rax
movl (%rax), %eax
movl %eax, %ecx
xorl $0x1, %ecx
movq %rcx, 0x68(%rsp)
shrl %eax
leaq (%rax,%rax,2), %rax
movl $0x0, 0x8(%rsp)
cmpl $0x0, 0xc(%r15,%rax,8)
movq %rdx, 0x20(%rsp)
movq %r14, 0x80(%rsp)
movq %r11, 0x38(%rsp)
je 0xd7850
leaq (%r15,%rax,8), %r15
movq $0x0, 0xb0(%rsp)
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl $0x0, 0xb8(%rsp)
movl $0x0, 0x78(%rsp)
xorl %eax, %eax
movl %eax, %eax
leaq (%rax,%rax,4), %r13
shlq $0x3, %r13
addq (%r15), %r13
subq $0x8, %rsp
movq %r13, %rdi
movq 0x68(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0x90(%rsp), %rcx
movq 0x18(%rsp), %r8
movq %r12, %r9
pushq $0x1
movl 0x198(%rsp), %eax
pushq %rax
leaq 0xdc(%rsp), %rax
pushq %rax
leaq 0xc8(%rsp), %rax
pushq %rax
leaq 0xd4(%rsp), %rax
pushq %rax
pushq $0x0
leaq 0x148(%rsp), %rax
pushq %rax
pushq %rbp
pushq 0xb0(%rsp)
movl 0x1d0(%rsp), %eax
pushq %rax
pushq 0xf8(%rsp)
callq 0xf2a1d
addq $0x60, %rsp
testl %eax, %eax
je 0xd780e
movl 0xc4(%rsp), %eax
cmpl %r14d, %eax
jae 0xd77ed
movl 0xac(%rsp), %ecx
movl %ecx, 0x78(%rsp)
movl 0xa8(%rsp), %ecx
movl %ecx, 0xb8(%rsp)
movl %eax, %r14d
movq %r13, 0xb0(%rsp)
jmp 0xd780e
jne 0xd780e
movl 0x78(%rsp), %ecx
cmpl %ecx, 0xac(%rsp)
ja 0xd77c7
jne 0xd780e
movl 0xb8(%rsp), %ecx
cmpl %ecx, 0xa8(%rsp)
ja 0xd77c7
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
cmpl 0xc(%r15), %eax
jb 0xd7736
cmpl $0x0, 0x78(%rsp)
sete %al
movq 0x88(%rsp), %r13
movq 0x10(%rsp), %r10
movq 0x80(%rsp), %r14
movq 0x38(%rsp), %r11
movq 0x60(%rsp), %r15
movq 0x20(%rsp), %rdx
jmp 0xd785e
movb $0x1, %al
movq $0x0, 0xb0(%rsp)
testb %al, %al
je 0xd7881
movq 0x18(%rsp), %rcx
movq 0x30(%rsp), %rsi
movl 0xc(%rsp), %edi
incq %rdx
cmpq %rbx, %rdx
jne 0xd75f7
jmp 0xd83e5
subq $0x8, %rsp
movq 0xb8(%rsp), %rdi
movq %r15, %rsi
movq 0xa0(%rsp), %rdx
movq %r13, %rcx
movq %r10, %r8
movq %r12, %r9
pushq $0x1
movl 0x198(%rsp), %eax
pushq %rax
leaq 0xdc(%rsp), %rax
pushq %rax
leaq 0xc8(%rsp), %rax
pushq %rax
leaq 0xd4(%rsp), %rax
pushq %rax
leaq 0x110(%rsp), %rax
pushq %rax
leaq 0x148(%rsp), %rax
pushq %rax
pushq %rbp
pushq 0xb0(%rsp)
movl 0x1d0(%rsp), %eax
pushq %rax
pushq 0xf8(%rsp)
movq %r10, %rbp
callq 0xf2a1d
addq $0x60, %rsp
movq 0xe0(%rsp), %rax
testq %rax, %rax
je 0xd7aaf
movq 0xf0(%rsp), %rcx
leaq (%rax,%rax,2), %rax
movl -0x10(%rcx,%rax,8), %r14d
movl $0x0, 0x8(%rsp)
xorl %r15d, %r15d
movq $0x0, 0x68(%rsp)
movl 0x110(%rsp), %eax
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
movq %r12, %rsi
movq 0x68(%rsp), %rdx
movq 0xa0(%rsp), %rcx
movq %r13, %r8
movq 0xa8(%rsp), %r9
pushq $0x1
leaq 0x140(%rsp), %r10
pushq %r10
leaq 0x20(%rsp), %r10
pushq %r10
pushq %rax
pushq 0x148(%rsp)
pushq %r14
movl 0x1b8(%rsp), %eax
pushq %rax
callq 0x102d41
addq $0x40, %rsp
testl %eax, %eax
je 0xd7a12
movq 0xd8(%rsp), %rax
movq 0x68(%rsp), %rcx
cmpq %rax, %rcx
movq 0x18(%rsp), %rdi
jne 0xd79e2
leaq (%rax,%rax), %r13
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r13
leaq (,%r13,8), %rax
leaq (%rax,%rax,2), %rsi
callq 0x2370
movq 0x68(%rsp), %rcx
movq %rax, %rdi
movq %r13, 0xd8(%rsp)
movq 0x88(%rsp), %r13
incq %rcx
movq %rcx, 0x68(%rsp)
movq 0x140(%rsp), %rax
movq %rax, 0x10(%rdi,%r15)
movups 0x130(%rsp), %xmm0
movq %rdi, 0x18(%rsp)
movups %xmm0, (%rdi,%r15)
addq $0x18, %r15
jmp 0xd7931
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movq 0x18(%rsp), %rdx
movq 0x68(%rsp), %rbp
movl %ebp, %ecx
callq 0xf24f6
cmpl $0x0, 0x198(%rsp)
movq 0x80(%rsp), %r14
movq 0x38(%rsp), %r11
movq 0x60(%rsp), %r15
movq 0x20(%rsp), %rdx
je 0xd7bd8
testq %rbp, %rbp
je 0xd7acf
movq %r11, %rbp
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %edx, %edx
movq 0x10(%rsp), %r10
movq 0x68(%rsp), %r11
leaq (%rax,%rax,2), %rsi
movq 0x18(%rsp), %rdi
movups (%rdi,%rsi,8), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x10(%rdi,%rsi,8), %rsi
movq %rsi, 0x50(%rsp)
movl 0x4c(%rsp), %esi
testl %esi, %esi
setns %dil
cmpl %edx, %esi
seta %r8b
testb %r8b, %dil
movl %eax, %edi
jne 0xd7aa2
movl %edx, %esi
movl %ecx, %edi
incl %eax
movl %edi, %ecx
movl %esi, %edx
cmpq %rax, %r11
ja 0xd7a6b
jmp 0xd7ade
movq 0x18(%rsp), %rcx
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
movl 0xc(%rsp), %edi
movq %rbp, %r10
movq 0x38(%rsp), %r11
jmp 0xd7870
movq %r11, %rbp
xorl %eax, %eax
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movq 0x10(%rsp), %r10
movl %eax, 0x8(%rsp)
cmpl $-0x1, %edi
je 0xd7b9d
movl %edi, 0xc(%rsp)
movl %edi, %eax
leaq (%rax,%rax,2), %rax
movq 0x18(%rsp), %rcx
movups (%rcx,%rax,8), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x10(%rcx,%rax,8), %rax
movq %rax, 0x50(%rsp)
movl 0x48(%rsp), %edx
movq %r10, %rdi
movq %r13, %rsi
callq 0xf2482
cmpl $-0x1, %eax
je 0xd7bb3
xorl $0x1, %eax
movq 0x30(%rsp), %rdx
movq 0x28(%rdx), %rcx
movq (%rcx,%rax,8), %rax
movq %rax, %rcx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rsi, %rcx
movq %rbp, %r11
je 0xd7bd3
movq 0x8(%rdx), %rdx
shrq $0x20, %rax
leaq (%rax,%rax,2), %rax
leaq (%rdx,%rax,8), %rax
addq $0xc, %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
xorl %esi, %esi
movl (%rax,%rdx), %edi
notl %edi
shrl $0x1f, %edi
addl %edi, %esi
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0xd7b69
testl %esi, %esi
movq 0x20(%rsp), %rdx
je 0xd7bd8
movq 0x18(%rsp), %rcx
movq 0x30(%rsp), %rsi
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %r10
jmp 0xd7870
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movq 0x18(%rsp), %rcx
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
jmp 0xd7bcb
movq 0x18(%rsp), %rcx
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %r10
movq %rbp, %r11
jmp 0xd7870
movq 0x20(%rsp), %rdx
movl $0x0, 0x8(%rsp)
cmpq $0x0, 0xe0(%rsp)
je 0xd7ecc
movq 0x28(%rsp), %r15
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %rax
movq %rax, 0x78(%rsp)
xorl %eax, %eax
movq %r11, 0x38(%rsp)
movq %r14, %rdi
movq %r15, 0x28(%rsp)
movq 0xf0(%rsp), %rcx
leaq (%rax,%rax,2), %rax
movl 0x8(%rcx,%rax,8), %r14d
movq %r14, 0xb8(%rsp)
shrl %r14d
movabsq $-0x100000000, %rbp     # imm = 0xFFFFFFFF00000000
cmpq %r14, (%r13)
jbe 0xd7c5a
movq 0x8(%r13), %rsi
movl (%rsi,%r14,4), %esi
movl %esi, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
cmpl $-0x1, %esi
cmovel %esi, %ebp
shlq $0x20, %rbp
movq (%rcx,%rax,8), %rax
movq %rax, 0xb0(%rsp)
movq 0xd0(%rsp), %rax
cmpq %rax, 0x90(%rsp)
jne 0xd7cac
leaq (%rax,%rax), %r13
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r13
leaq (,%r13,8), %rsi
callq 0x2370
movq 0x20(%rsp), %rdx
movq %r13, 0xd0(%rsp)
movq 0x88(%rsp), %r10
jmp 0xd7cb2
movq %rdi, %rax
movq %r13, %r10
orq %r14, %rbp
movq %rax, 0x80(%rsp)
movq 0x90(%rsp), %rcx
movq %rbp, (%rax,%rcx,8)
movq 0x20(%r12), %rax
andl $0x7fffffff, (%rax,%r14,8) # imm = 0x7FFFFFFF
leaq (%r14,%r14,2), %rax
movq 0x98(%rsp), %r14
andb $0x7f, 0x3(%r14,%rax,4)
movb $0x0, 0x8(%r14,%rax,4)
subq $0x8, %rsp
movq %r12, %rdi
movq 0x18(%rsp), %rsi
movq 0xc0(%rsp), %r15
movl %r15d, %ecx
movq 0x68(%rsp), %r13
movq %r13, %r8
movq %r14, %r9
movl 0x188(%rsp), %eax
pushq %rax
movq 0xb0(%rsp), %rbp
pushq %rbp
pushq %r10
callq 0xf1dce
addq $0x20, %rsp
movq 0xb0(%rsp), %rax
shrq $0x20, %rax
movq %r13, %rdi
movq %rax, %r13
movq %r14, %rsi
movl %ebp, %ecx
movl 0x180(%rsp), %r8d
movl %r13d, %r9d
leaq 0x40(%rsp), %rax
pushq %rax
pushq %r15
callq 0xb2ced
addq $0x10, %rsp
movq 0x70(%rsp), %r14
cmpq %r14, 0x28(%rsp)
jne 0xd7d98
movq %r14, %rax
addq %r14, %r14
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %rsi
movq 0x38(%rsp), %rdi
callq 0x2370
movq %rax, %rbp
jmp 0xd7d9d
movq 0x38(%rsp), %rbp
movq 0x50(%rsp), %rax
movq 0x78(%rsp), %rcx
movq %rax, 0x10(%rbp,%rcx)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rbp,%rcx)
movq 0xb8(%rsp), %r9
xorl $0x1, %r9d
xorl $0x1, %r13d
movq 0x60(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rcx
movl 0x180(%rsp), %r8d
leaq 0x40(%rsp), %rax
pushq %rax
pushq %r13
callq 0xb2ced
addq $0x10, %rsp
movq 0x28(%rsp), %rax
incq %rax
movq %rax, %r15
cmpq %r14, %rax
movq 0x88(%rsp), %r13
jne 0xd7e4e
movq %r14, %rax
addq %r14, %r14
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %rsi
movq %rbp, %rdi
callq 0x2370
movq %rax, %r11
movq %r14, 0x70(%rsp)
movq 0x10(%rsp), %r10
movq 0x80(%rsp), %r14
movq 0x18(%rsp), %rcx
jmp 0xd7e68
movq %r14, 0x70(%rsp)
movq 0x10(%rsp), %r10
movq 0x80(%rsp), %r14
movq 0x18(%rsp), %rcx
movq %rbp, %r11
movq 0x20(%rsp), %rdx
movq 0x50(%rsp), %rax
movq 0x78(%rsp), %rsi
movq %rax, 0x28(%r11,%rsi)
movaps 0x40(%rsp), %xmm0
movups %xmm0, 0x18(%r11,%rsi)
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
addq $0x30, %rsi
movq %rsi, 0x78(%rsp)
incq %r15
incq 0x90(%rsp)
cmpq %rax, 0xe0(%rsp)
ja 0xd7c07
movq 0x28(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %r15
movl 0xc(%rsp), %edi
jmp 0xd7eda
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %r10
cmpl $0x0, 0x198(%rsp)
movq %r14, 0x80(%rsp)
je 0xd805b
movq %r11, %rbp
movl %edi, %eax
leaq (%rax,%rax,2), %rax
movups (%rcx,%rax,8), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x10(%rcx,%rax,8), %rax
movq %rax, 0x50(%rsp)
movl 0x48(%rsp), %edx
movq %r10, %rdi
movq %r13, %rsi
callq 0xf2482
cmpl $-0x1, %eax
je 0xd82eb
movl %eax, %r15d
movq 0x70(%rsp), %r14
cmpq %r14, 0x28(%rsp)
jne 0xd7f5c
movq %r14, %rax
addq %r14, %r14
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %rsi
movq %rbp, %rdi
callq 0x2370
movq %rax, %rbp
movq 0xc8(%rsp), %rdx
movq 0x28(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x38(%rsp)
leaq (%rax,%rax,2), %rax
movq 0x50(%rsp), %rcx
movq %rcx, 0x10(%rbp,%rax,8)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rbp,%rax,8)
movl 0x4c(%rsp), %r8d
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %r8d
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax,%rdx,8), %edx
andl %ecx, %edx
movzwl 0x50(%rsp), %eax
movl %eax, %r9d
shrl $0xe, %r9d
movzbl 0x52(%rsp), %r10d
shrl $0xf, %eax
andl $0x1, %r9d
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %r15d, %ecx
pushq %rax
pushq %r10
callq 0xe907b
addq $0x10, %rsp
movl 0x44(%rsp), %eax
movl 0x48(%rsp), %r9d
xorl $0x1, %r9d
xorl $0x1, %eax
movq 0x60(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rcx
movl 0x180(%rsp), %r8d
leaq 0x40(%rsp), %rdx
pushq %rdx
pushq %rax
callq 0xb2ced
addq $0x10, %rsp
movq 0x38(%rsp), %rax
cmpq %r14, %rax
jne 0xd830c
leaq (%r14,%r14), %r13
testq %r14, %r14
movl $0x2, %eax
cmoveq %rax, %r13
leaq (,%r13,8), %rax
leaq (%rax,%rax,2), %rsi
movq %rbp, %rdi
callq 0x2370
movq %rax, %rbp
movq %r13, 0x70(%rsp)
movq 0x88(%rsp), %r13
jmp 0xd8311
movl $0x0, 0x8(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0xd83b9
movq 0x20(%rsp), %rdx
movl %edx, %eax
xorl $0x1, %eax
movl %eax, 0x78(%rsp)
xorl %eax, %eax
movq 0x30(%rsp), %rsi
leaq (%rax,%rax,2), %rax
movups (%rcx,%rax,8), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x10(%rcx,%rax,8), %rax
movq %rax, 0x50(%rsp)
cmpl $0x0, 0x4c(%rsp)
js 0xd82d1
movq %r11, %r15
movl 0x48(%rsp), %edx
movq %r10, %rdi
movq %r13, %rsi
callq 0xf2482
cmpl $-0x1, %eax
je 0xd81ef
movl %eax, %r13d
movq 0x70(%rsp), %r14
cmpq %r14, 0x28(%rsp)
movq %r15, %r11
jne 0xd80fc
movq %r14, %rax
addq %r14, %r14
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %rsi
movq %r11, %rdi
callq 0x2370
movq %rax, %r11
movq 0x10(%rsp), %rdx
movq 0x28(%rsp), %rax
leaq 0x1(%rax), %rbp
leaq (%rax,%rax,2), %rax
movq 0x50(%rsp), %rcx
movq %rcx, 0x10(%r11,%rax,8)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%r11,%rax,8)
movl 0x4c(%rsp), %r8d
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %r8d
movq 0x10(%rdx), %rax
movq 0xc8(%rsp), %rdx
movl (%rax,%rdx,8), %edx
andl %ecx, %edx
movzwl 0x50(%rsp), %eax
movl %eax, %r9d
shrl $0xe, %r9d
movzbl 0x52(%rsp), %r10d
shrl $0xf, %eax
andl $0x1, %r9d
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %r13d, %ecx
pushq %rax
pushq %r10
movq %r11, %r15
callq 0xe907b
addq $0x10, %rsp
movl 0x44(%rsp), %eax
movl 0x48(%rsp), %r9d
xorl $0x1, %r9d
xorl $0x1, %eax
movq 0x60(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rcx
movl 0x180(%rsp), %r8d
leaq 0x40(%rsp), %rdx
pushq %rdx
pushq %rax
callq 0xb2ced
addq $0x10, %rsp
movq %rbp, 0x38(%rsp)
cmpq %r14, %rbp
jne 0xd8217
movq %r15, %rdi
leaq (%r14,%r14), %r15
testq %r14, %r14
movl $0x2, %eax
cmoveq %rax, %r15
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %rsi
callq 0x2370
movq %r15, 0x70(%rsp)
movq %rax, %r11
movq 0x10(%rsp), %rbp
jmp 0xd8224
movq 0x88(%rsp), %r13
movq 0x18(%rsp), %rcx
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
movl 0xc(%rsp), %edi
movq 0x10(%rsp), %r10
movq %r15, %r11
jmp 0xd82cc
movq %r14, 0x70(%rsp)
movq 0x10(%rsp), %rbp
movq %r15, %r11
addq $0x2, 0x28(%rsp)
movq 0x38(%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x50(%rsp), %rcx
movq %rcx, 0x10(%r11,%rax,8)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%r11,%rax,8)
movl 0x4c(%rsp), %r8d
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %r8d
movl %r13d, %esi
xorl $0x1, %esi
movq 0x10(%rbp), %rax
shrl %r13d
leaq (,%r13,4), %rcx
addq %r13, %rcx
movl (%rax,%rcx,8), %edx
andl %edi, %edx
movzwl 0x50(%rsp), %eax
movl %eax, %r9d
shrl $0xe, %r9d
movzbl 0x52(%rsp), %r10d
shrl $0xf, %eax
andl $0x1, %r9d
movq 0x30(%rsp), %r14
movq %r14, %rdi
movl 0x78(%rsp), %ecx
pushq %rax
pushq %r10
movq %r11, %r15
callq 0xe907b
movq %r15, %r11
movq %rbp, %r10
movq %r14, %rsi
addq $0x10, %rsp
movq 0x88(%rsp), %r13
movq 0x80(%rsp), %r14
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rdx
movl 0xc(%rsp), %edi
movq 0x60(%rsp), %r15
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
cmpq %rax, 0x68(%rsp)
ja 0xd8084
jmp 0xd7870
movq 0x10(%rsp), %r10
movq 0x18(%rsp), %rcx
movq %rbp, %r11
movq 0x60(%rsp), %r15
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
jmp 0xd786c
movq %r14, 0x70(%rsp)
addq $0x2, 0x28(%rsp)
movq 0x38(%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x50(%rsp), %rcx
movq %rcx, 0x10(%rbp,%rax,8)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rbp,%rax,8)
movl 0x4c(%rsp), %r8d
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %r8d
movl %r15d, %esi
xorl $0x1, %esi
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
shrl %r15d
leaq (%r15,%r15,4), %rcx
movl (%rax,%rcx,8), %edx
andl %edi, %edx
movq 0x20(%rsp), %r15
movl %r15d, %ecx
xorl $0x1, %ecx
movzwl 0x50(%rsp), %eax
movl %eax, %r9d
shrl $0xe, %r9d
movzbl 0x52(%rsp), %r10d
shrl $0xf, %eax
andl $0x1, %r9d
movq 0x30(%rsp), %r14
movq %r14, %rdi
pushq %rax
pushq %r10
callq 0xe907b
movq 0x20(%rsp), %r10
movq %r15, %rdx
movq %r14, %rsi
addq $0x10, %rsp
movq 0x80(%rsp), %r14
movq 0x18(%rsp), %rcx
movq %rbp, %r11
movq 0x60(%rsp), %r15
jmp 0xd786c
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rdx
jmp 0xd7870
xorl %r11d, %r11d
movq $0x0, 0x28(%rsp)
xorl %ecx, %ecx
xorl %r14d, %r14d
movq $0x0, 0x90(%rsp)
movq %rcx, 0x18(%rsp)
cmpl $0x0, 0x190(%rsp)
movq %r11, 0x38(%rsp)
je 0xd875a
movl $0x0, 0x8(%rsp)
movq 0x28(%rsp), %rbx
testq %rbx, %rbx
je 0xd84d4
movl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
movl $0x10, %ebp
movl 0x4(%r12), %ecx
andl %ebx, %ecx
movl (%r12), %eax
cmpl %eax, %ecx
jne 0xd8455
leal (%rax,%rax), %ecx
testl %eax, %eax
cmovel %ebp, %ecx
movl %ecx, (%r12)
movq 0x8(%r12), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
movq %r11, %r15
callq 0x2370
movq %r15, %r11
movq %rax, 0x8(%r12)
movq 0x8(%r12), %rax
movl 0x4(%r12), %ecx
movl %ecx, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leal 0x1(%rcx), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %esi, %ecx
movl %ecx, 0x4(%r12)
leaq (%rdx,%rdx,2), %rcx
movl 0x8(%rsp), %edx
leaq (%rdx,%rdx,2), %rsi
movups (%r11,%rsi,8), %xmm0
movups %xmm0, (%rax,%rcx,8)
movq 0x10(%r11,%rsi,8), %rsi
movq %rsi, 0x10(%rax,%rcx,8)
leal 0x1(%rdx), %eax
movl %eax, 0x8(%rsp)
cmpq %rax, 0x28(%rsp)
ja 0xd841d
movq 0x28(%r12), %rdi
callq 0x2220
movq $0x0, 0x28(%r12)
andb $0x7f, 0x7(%r12)
movq %r12, %rdi
callq 0xa02fa
movq 0x28(%rsp), %rbx
movq 0x1b0(%rsp), %r15
movl $0x64, %ecx
movq %r12, %rdx
xorl %r8d, %r8d
callq 0xe7e99
testq %rax, %rax
jne 0xd84dc
movq %r12, %rdi
callq 0xa02fa
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xa6dbe
movl $0x0, 0x8(%rsp)
testq %rbx, %rbx
movq 0x38(%rsp), %r9
je 0xd861d
xorl %ecx, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq (%rcx,%rcx,2), %rdx
movq (%r9,%rdx,8), %rcx
movq 0x20(%r12), %rsi
movq %rcx, %rdi
shrq $0x21, %rdi
cmpl $0x0, (%rsi,%rdi,8)
js 0xd860a
movl 0x8(%r9,%rdx,8), %edx
movl %edx, %edi
shrl %edi
cmpl $0x0, (%rsi,%rdi,8)
js 0xd860a
shrq $0x20, %rcx
movq 0x30(%r12), %rsi
cmpb $0x0, (%rsi,%rcx)
je 0xd8574
movq %rdx, %rdi
xorq $0x1, %rdi
cmpb $0x0, (%rsi,%rdi)
jne 0xd860a
movq 0x28(%r12), %rsi
movq (%rsi,%rcx,8), %rdi
movq %rdi, %rsi
andq %rax, %rsi
je 0xd85bb
movq 0x8(%r12), %r8
shrq $0x20, %rdi
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
leaq (%rdi,%rdi,2), %rdi
leaq (%r8,%rdi,8), %rdi
addq $0xc, %rdi
xorl %r8d, %r8d
cmpl %edx, -0x4(%rdi,%r8)
jne 0xd85b2
orb $-0x80, 0x3(%rdi,%r8)
addq $0x18, %r8
cmpq %r8, %rsi
jne 0xd85a5
xorl $0x1, %edx
movq 0x28(%r12), %rsi
movq (%rsi,%rdx,8), %rsi
movq %rsi, %rdx
andq %rax, %rdx
je 0xd860a
movq 0x8(%r12), %rdi
shrq $0x20, %rsi
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rsi,%rsi,2), %rsi
leaq (%rdi,%rsi,8), %rsi
addq $0xc, %rsi
xorl %edi, %edi
movl -0x4(%rsi,%rdi), %r8d
xorl %ecx, %r8d
cmpl $0x1, %r8d
jne 0xd8601
orb $-0x80, 0x3(%rsi,%rdi)
addq $0x18, %rdi
cmpq %rdi, %rdx
jne 0xd85ee
movl 0x8(%rsp), %ecx
incl %ecx
movl %ecx, 0x8(%rsp)
cmpq %rcx, %rbx
ja 0xd8523
movq %r12, %rdi
callq 0xa02fa
movl $0x0, 0x8(%rsp)
cmpq $0x0, 0x90(%rsp)
je 0xd875a
xorl %eax, %eax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq (%r14,%rax,8), %rsi
movq 0x20(%r12), %rax
movl %esi, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl (%rax,%rcx,8), %edx
testl %edx, %edx
js 0xd870c
addl %esi, %esi
movq 0x28(%r12), %rdi
movl %esi, %esi
movq (%rdi,%rsi,8), %rdi
movq %rdi, %r8
andq %rbx, %r8
je 0xd86b7
movq 0x8(%r12), %r9
shrq $0x20, %rdi
leaq (%rdi,%rdi,2), %rdi
leaq (%r9,%rdi,8), %rdi
addq $0xc, %rdi
shlq $0x3, %r8
leaq (%r8,%r8,2), %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
movl (%rdi,%r9), %r11d
notl %r11d
shrl $0x1f, %r11d
addl %r11d, %r10d
addq $0x18, %r9
cmpq %r9, %r8
jne 0xd8697
testl %r10d, %r10d
jne 0xd8742
testl %edx, %edx
js 0xd870c
movq 0x28(%r12), %rdi
movq 0x8(%rdi,%rsi,8), %rsi
movq %rsi, %rdi
andq %rbx, %rdi
je 0xd870c
movq 0x8(%r12), %r8
shrq $0x20, %rsi
leaq (%rsi,%rsi,2), %rsi
leaq (%r8,%rsi,8), %rsi
addq $0xc, %rsi
shlq $0x3, %rdi
leaq (%rdi,%rdi,2), %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
movl (%rsi,%r8), %r10d
notl %r10d
shrl $0x1f, %r10d
addl %r10d, %r9d
addq $0x18, %r8
cmpq %r8, %rdi
jne 0xd86f0
testl %r9d, %r9d
jne 0xd8742
orl $0x80000000, %edx       # imm = 0x80000000
movl %edx, (%rax,%rcx,8)
leaq (%rcx,%rcx,2), %rax
movq 0x98(%rsp), %rcx
orb $-0x80, 0x3(%rcx,%rax,4)
movl 0x8(%rsp), %eax
movq (%r14,%rax,8), %rsi
movq %rsi, %rdx
shrq $0x20, %rdx
movq %r13, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xa1cd4
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
cmpq %rax, 0x90(%rsp)
ja 0xd8643
cmpl $0x0, 0x198(%rsp)
movq 0x10(%rsp), %rdi
je 0xd8933
movq 0x1a8(%rsp), %rbx
testq %rbx, %rbx
je 0xd87ec
movl $0x0, 0x8(%rsp)
cmpq $0x0, 0x90(%rsp)
je 0xd87ec
xorl %eax, %eax
movl $0x2, %r15d
movl (%r14,%rax,8), %ebp
movq 0x8(%rbx), %rax
cmpq %rax, (%rbx)
jne 0xd87c7
leaq (%rax,%rax), %rsi
testq %rax, %rax
cmoveq %r15, %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
shlq $0x2, %rsi
callq 0x2370
movq 0x10(%rsp), %rdi
movq %rax, 0x10(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movl %ebp, (%rcx,%rax,4)
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
cmpq %rax, 0x90(%rsp)
ja 0xd8795
movl $0x0, 0x8(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0xd8933
movq 0x1a0(%rsp), %rbx
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movl $0x10, %r15d
movl 0x4(%r12), %ecx
andl %ebp, %ecx
movl (%r12), %eax
cmpl %eax, %ecx
jne 0xd8846
leal (%rax,%rax), %ecx
testl %eax, %eax
cmovel %r15d, %ecx
movl %ecx, (%r12)
movq 0x8(%r12), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq %rax, 0x8(%r12)
movl 0x4(%r12), %eax
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leal 0x1(%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %eax       # imm = 0x80000000
orl %edx, %eax
movq 0x8(%r12), %rdx
movl %eax, 0x4(%r12)
leaq (%rcx,%rcx,2), %rax
movl 0x8(%rsp), %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x38(%rsp), %rsi
movups (%rsi,%rcx,8), %xmm0
movups %xmm0, (%rdx,%rax,8)
movq 0x10(%rsi,%rcx,8), %rcx
movq %rcx, 0x10(%rdx,%rax,8)
testq %rbx, %rbx
je 0xd88f8
movq 0x8(%rbx), %rax
cmpq %rax, (%rbx)
jne 0xd88c7
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq %rcx, 0x8(%rbx)
movq 0x10(%rbx), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq %rax, 0x10(%rbx)
movl 0x8(%rsp), %eax
leaq (%rax,%rax,2), %rax
movq (%rbx), %rcx
movq 0x10(%rbx), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%rbx)
leaq (%rcx,%rcx,2), %rcx
movq 0x38(%rsp), %rdi
movq 0x10(%rdi,%rax,8), %rsi
movq %rsi, 0x10(%rdx,%rcx,8)
movups (%rdi,%rax,8), %xmm0
movups %xmm0, (%rdx,%rcx,8)
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
cmpq %rax, 0x28(%rsp)
ja 0xd8813
movq 0x28(%r12), %rdi
callq 0x2220
movq $0x0, 0x28(%r12)
andb $0x7f, 0x7(%r12)
movq %r12, %rdi
callq 0xa02fa
movq 0x10(%rsp), %rdi
movq (%r13), %rax
testq %rax, %rax
movq %r14, %rbx
movq 0x38(%rsp), %r14
je 0xd8965
movq 0x8(%r13), %rcx
xorl %edx, %edx
cmpl $-0x2, (%rcx,%rdx,4)
jg 0xd895b
movq 0x8(%r13), %rsi
movl $0xffffffff, (%rsi,%rdx,4) # imm = 0xFFFFFFFF
incq %rdx
movl %edx, %esi
cmpq %rsi, %rax
ja 0xd894a
cmpq $0x0, 0x108(%rsp)
jne 0xd8975
callq 0xa0004
movq %r14, %rdi
callq 0x2220
movq 0x18(%rsp), %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x2220
movq 0x120(%rsp), %rdi
callq 0x2220
movq 0xf0(%rsp), %rdi
callq 0x2220
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq