// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: rescue_missing_overlaps_aggressive(ma_ug_t*, asg_t*, ma_hit_t_alloc*, ma_sub_t*, R_to_U*, int, int, unsigned int, unsigned int, kvec_asg_arc_t_warp*, bub_label_t*)
void rescue_missing_overlaps_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 is_bubble_check, uint32_t is_primary_check,
kvec_asg_arc_t_warp* new_rtg_edges, bub_label_t* b_mask_t)
{
    uint32_t n_vtx, v, k, is_Unitig, uId, rId, endRid, oLen, w, max_oLen, max_oLen_i;
    asg_t* nsg = NULL;
    ma_utg_t* nsu = NULL;
    ma_ug_t *ug = NULL;
    asg_arc_t t, r_edge;
    kvec_t(asg_arc_t) new_edges;
    kv_init(new_edges);

    kvec_t(asg_arc_t) rbub_edges;
    kv_init(rbub_edges);

    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;
        
        if(v&1)
        {
            endRid = nsu->start^1;
        }
        else
        {
            endRid = nsu->end^1;
        }


        k = 0;
        rbub_edges.n = 0;
        while(get_edge2existing_node_advance(ug, r_g, sources, coverage_cut, ruIndex, 
                max_hang, min_ovlp, endRid, &uId, 1, &k, &r_edge, 1))
        {
            kv_push(asg_arc_t, rbub_edges, r_edge);
        }



        if(rbub_edges.n > 0)
        {
            ///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;

                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;
                    // get_R_to_U(ruIndex, t.v>>1, &uId, &is_Unitig);
                    // w = (uint32_t)-1;
                    // if(t.v == ug->u.a[uId].start) w = uId<<1;
                    // if(t.v == ug->u.a[uId].end) w = (uId<<1)^1;
                    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);
    }

    if(is_primary_check)
    {
        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);
    /*************************just for debug**************************/
    // debug_utg_graph(ug, r_g, 0, 0);
    /*************************just for debug**************************/
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %r9d, 0x5c(%rsp)
movq %r8, %rbp
movq %rcx, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movq %rsi, %r12
movq %rdi, %r13
movl 0x110(%rsp), %r11d
movl 0x108(%rsp), %ebx
testq %rdi, %rdi
movq %r8, 0x50(%rsp)
je 0xd79f0
movq 0x18(%r13), %r9
movl 0x14(%r9), %eax
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq %r13, %r15
jmp 0xd7a34
movq %r12, %rdi
callq 0xb10cd
movq %rax, %r15
movq 0x18(%rax), %r9
testl $0x7fffffff, 0x14(%r9)  # imm = 0x7FFFFFFF
je 0xd8352
movq 0x20(%r9), %rdx
xorl %esi, %esi
movb $0x0, 0x4(%rdx,%rsi,8)
incq %rsi
movl 0x14(%r9), %eax
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpq %rcx, %rsi
jb 0xd7a13
movl 0x110(%rsp), %r11d
testl %ecx, %ecx
je 0xd832b
xorl %ebx, %ebx
movq %r15, 0x48(%rsp)
movq %r9, 0x18(%rsp)
movl %ebx, 0x44(%rsp)
movq 0x10(%r15), %rcx
leaq (%rbx,%rbx,4), %rdx
cmpl $0x0, 0xc(%rcx,%rdx,8)
je 0xd7adf
movq 0x20(%r9), %rsi
cmpl $0x0, (%rsi,%rbx,8)
js 0xd7adf
testl %r11d, %r11d
je 0xd7a75
cmpb $0x1, 0x4(%rsi,%rbx,8)
je 0xd7adf
leaq (%rcx,%rdx,8), %r14
movl $0x0, 0x4(%rsp)
cmpl $0x0, 0x10(%r14)
je 0xd7adf
xorl %r15d, %r15d
movq 0x50(%rsp), %rbp
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rsi
shrq $0x21, %rsi
movq 0x20(%r12), %rax
leaq (%rax,%rsi,8), %r8
addq $0x4, %r8
movq %rbp, %rdi
movl %ebx, %edx
movl $0x1, %ecx
callq 0xa27e9
incq %r15
movl %r15d, 0x4(%rsp)
movl 0x10(%r14), %eax
cmpq %rax, %r15
jb 0xd7a90
movq 0x18(%rsp), %r9
movl 0x14(%r9), %eax
movq 0x48(%rsp), %r15
movl 0x110(%rsp), %r11d
incq %rbx
movl %eax, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
cmpq %rbp, %rbx
jb 0xd7a48
testl %ebp, %ebp
movl 0x108(%rsp), %ebx
je 0xd833c
addl %ebp, %ebp
xorl %r14d, %r14d
movq $0x0, 0xa0(%rsp)
xorl %r10d, %r10d
movq $0x0, 0x78(%rsp)
movq $0x0, 0x68(%rsp)
movq $0x0, 0x8(%rsp)
movl %r14d, %eax
shrl %eax
movl %eax, 0x44(%rsp)
movq 0x20(%r9), %rcx
cmpl $0x0, (%rcx,%rax,8)
js 0xd815f
testl %r11d, %r11d
je 0xd7b58
cmpb $0x1, 0x4(%rcx,%rax,8)
je 0xd815f
movq 0x10(%r15), %rcx
leaq (%rax,%rax,4), %rdx
cmpl $0x0, 0xc(%rcx,%rdx,8)
je 0xd815f
leaq (%rcx,%rdx,8), %rax
cmpl $0x0, (%rax)
js 0xd815f
cmpl $-0x1, 0x4(%rax)
je 0xd815f
cmpl $-0x1, 0x8(%rax)
je 0xd815f
movq %rdx, 0x98(%rsp)
movq 0x28(%r9), %rcx
movq (%rcx,%r14,8), %rcx
movq %rcx, %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rsi, %rdx
je 0xd7be8
movq 0x8(%r9), %rsi
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rsi,%rcx,8), %rcx
addq $0xc, %rcx
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
xorl %edi, %edi
movl (%rcx,%rsi), %r8d
notl %r8d
shrl $0x1f, %r8d
addl %r8d, %edi
addq $0x18, %rsi
cmpq %rsi, %rdx
jne 0xd7bc9
testl %edi, %edi
jne 0xd815f
movq %r10, 0x10(%rsp)
leaq 0x4(%rax), %rcx
addq $0x8, %rax
testb $0x1, %r14b
cmovneq %rcx, %rax
movl (%rax), %r11d
movl $0x1, %eax
xorl %eax, %r11d
movl $0x0, 0x4(%rsp)
subq $0x8, %rsp
movq %r15, %rdi
movq %r12, %rsi
movq 0x88(%rsp), %rdx
movq 0x90(%rsp), %rcx
movq 0x58(%rsp), %r8
movl 0x64(%rsp), %r9d
pushq %rax
leaq 0xc0(%rsp), %r10
pushq %r10
leaq 0x1c(%rsp), %r10
pushq %r10
pushq %rax
leaq 0x6c(%rsp), %rax
pushq %rax
movq %r11, 0xa0(%rsp)
pushq %r11
movl 0x138(%rsp), %eax
pushq %rax
callq 0x1072ad
addq $0x40, %rsp
testl %eax, %eax
je 0xd814d
movq %r13, 0x60(%rsp)
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %r13d, %r13d
movq 0x10(%rsp), %r10
cmpq 0xa0(%rsp), %r13
jne 0xd7cba
testq %r13, %r13
movq %rbx, %rcx
movl $0x2, %eax
cmoveq %rax, %rcx
movq %rcx, 0xa0(%rsp)
leaq (,%rcx,8), %rax
leaq (%rax,%rax,2), %rsi
movq %r10, %rdi
callq 0x2370
movq %rax, %r10
movq %r10, 0x10(%rsp)
incq %r13
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%r10,%r15)
movups 0xb0(%rsp), %xmm0
movups %xmm0, (%r10,%r15)
subq $0x8, %rsp
movq 0x50(%rsp), %rdi
movq %r12, %rsi
movq 0x88(%rsp), %rdx
movq 0x90(%rsp), %rcx
movq 0x58(%rsp), %r8
movl 0x64(%rsp), %r9d
movl $0x1, %eax
pushq %rax
leaq 0xc0(%rsp), %r10
pushq %r10
leaq 0x1c(%rsp), %r10
pushq %r10
pushq %rax
leaq 0x6c(%rsp), %rax
pushq %rax
pushq 0xa0(%rsp)
movl 0x138(%rsp), %eax
pushq %rax
callq 0x1072ad
movq 0x50(%rsp), %r10
addq $0x40, %rsp
addq $0x2, %rbx
addq $0x18, %r15
testl %eax, %eax
jne 0xd7c82
testq %r13, %r13
movl 0x108(%rsp), %ebx
je 0xd7e8d
movq 0x48(%rsp), %r15
movq %r15, %rdi
movq 0x50(%rsp), %rsi
movq %r10, %rdx
movl %r13d, %ecx
callq 0xf48e8
movl 0x110(%rsp), %r11d
testl %r11d, %r11d
je 0xd7e9c
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %edx, %edx
movq 0x10(%rsp), %r10
leaq (%rax,%rax,2), %rsi
movups (%r10,%rsi,8), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x10(%r10,%rsi,8), %rsi
movq %rsi, 0x30(%rsp)
movl 0x2c(%rsp), %edi
testl %edi, %edi
setns %r8b
cmpl %edx, %edi
seta %r9b
movl %eax, %esi
testb %r9b, %r8b
jne 0xd7dc7
movl %edx, %edi
movl %ecx, %esi
incl %eax
movl %esi, %ecx
movl %edi, %edx
cmpq %rax, %r13
ja 0xd7d94
movl %eax, 0x4(%rsp)
cmpl $-0x1, %esi
je 0xd8105
movl %esi, %eax
leaq (%rax,%rax,2), %rax
movups (%r10,%rax,8), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x10(%r10,%rax,8), %rax
movq %rax, 0x30(%rsp)
movl 0x28(%rsp), %edx
movq %r15, %rdi
movq 0x50(%rsp), %rsi
callq 0xf488a
cmpl $-0x1, %eax
je 0xd8148
movl %eax, %r13d
movl %eax, %r8d
xorl $0x1, %r8d
movq 0x18(%rsp), %r9
movq 0x28(%r9), %rax
movq (%rax,%r8,8), %rax
movq %rax, %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
andq %rdx, %rcx
movq 0x10(%rsp), %r10
movl 0x110(%rsp), %r11d
je 0xd810c
movq 0x8(%r9), %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 0xd7e68
testl %esi, %esi
je 0xd810c
movq 0x60(%rsp), %r13
jmp 0xd815f
movq 0x60(%rsp), %r13
movq 0x48(%rsp), %r15
jmp 0xd8152
movl $0x0, 0x4(%rsp)
movl %r14d, %eax
xorl $0x1, %eax
movl %eax, 0x94(%rsp)
xorl %ebx, %ebx
movq 0x10(%rsp), %r10
movq 0x18(%rsp), %r9
leaq (%rbx,%rbx,2), %rax
movups (%r10,%rax,8), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x10(%r10,%rax,8), %rax
movq %rax, 0x30(%rsp)
cmpl $0x0, 0x2c(%rsp)
js 0xd80e8
movl 0x28(%rsp), %edx
movq %r15, %rdi
movq 0x50(%rsp), %rsi
callq 0xf488a
movq %rax, 0xa8(%rsp)
cmpl $-0x1, %eax
je 0xd7f35
movq 0x78(%rsp), %rbx
movq 0x68(%rsp), %r15
cmpq %r15, %rbx
jne 0xd7f4c
leaq (%rbx,%rbx), %r15
testq %rbx, %rbx
movl $0x2, %eax
cmoveq %rax, %r15
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %rsi
movq 0x8(%rsp), %rdi
callq 0x2370
jmp 0xd7f51
movq 0x10(%rsp), %r10
movl 0x110(%rsp), %r11d
movq 0x18(%rsp), %r9
jmp 0xd80e8
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x1(%rbx), %rcx
movq %rcx, 0x70(%rsp)
leaq (%rbx,%rbx,2), %rdx
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rax,%rdx,8)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rax,%rdx,8)
movl 0x2c(%rsp), %r8d
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl %esi, %r8d
movq 0x48(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x98(%rsp), %rdx
movl (%rcx,%rdx,8), %edx
andl %esi, %edx
movzwl 0x30(%rsp), %r11d
movl %r11d, %r9d
shrl $0xe, %r9d
movzbl 0x32(%rsp), %r10d
shrl $0xf, %r11d
andl $0x1, %r9d
movq 0x18(%rsp), %rdi
movl %r14d, %esi
movq 0xa8(%rsp), %rbx
movl %ebx, %ecx
pushq %r11
pushq %r10
callq 0xeaa02
addq $0x10, %rsp
movl 0x24(%rsp), %eax
movl 0x28(%rsp), %r9d
xorl $0x1, %r9d
xorl $0x1, %eax
movq 0x80(%rsp), %rdi
movq 0x88(%rsp), %rsi
movl 0x5c(%rsp), %ecx
movl 0x100(%rsp), %r8d
leaq 0x20(%rsp), %rdx
pushq %rdx
pushq %rax
callq 0xb3df3
addq $0x10, %rsp
movq 0x70(%rsp), %rax
cmpq %r15, %rax
movq %r15, %rax
jne 0xd8049
leaq (%rax,%rax), %r15
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r15
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %rsi
movq 0x8(%rsp), %rdi
callq 0x2370
movq %r15, 0x68(%rsp)
jmp 0xd8053
movq %rax, 0x68(%rsp)
movq 0x8(%rsp), %rax
movq 0x48(%rsp), %r15
addq $0x2, 0x78(%rsp)
movq 0x70(%rsp), %rcx
leaq (%rcx,%rcx,2), %rdx
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rax,%rdx,8)
movaps 0x20(%rsp), %xmm0
movq %rax, 0x8(%rsp)
movups %xmm0, (%rax,%rdx,8)
movl 0x2c(%rsp), %r8d
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %r8d
movl %ebx, %esi
xorl $0x1, %esi
movq 0x10(%r15), %rax
shrl %ebx
leaq (%rbx,%rbx,4), %rcx
movl (%rax,%rcx,8), %edx
andl %edi, %edx
movzwl 0x30(%rsp), %eax
movl %eax, %r9d
shrl $0xe, %r9d
movzbl 0x32(%rsp), %r10d
shrl $0xf, %eax
andl $0x1, %r9d
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movl 0x94(%rsp), %ecx
pushq %rax
pushq %r10
callq 0xeaa02
movq %rbx, %r9
addq $0x10, %rsp
movl 0x4(%rsp), %ebx
movq 0x10(%rsp), %r10
movl 0x110(%rsp), %r11d
incl %ebx
movl %ebx, 0x4(%rsp)
cmpq %rbx, %r13
ja 0xd7ebd
movq 0x60(%rsp), %r13
movl 0x108(%rsp), %ebx
jmp 0xd815f
movq 0x60(%rsp), %r13
jmp 0xd815a
movq 0x78(%rsp), %rbx
movq 0x68(%rsp), %r15
cmpq %r15, %rbx
movq %r8, 0x70(%rsp)
jne 0xd8170
leaq (%rbx,%rbx), %r15
testq %rbx, %rbx
movl $0x2, %eax
cmoveq %rax, %r15
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %rsi
movq 0x8(%rsp), %rdi
callq 0x2370
jmp 0xd8175
movq 0x60(%rsp), %r13
movq 0x10(%rsp), %r10
movl 0x110(%rsp), %r11d
movq 0x18(%rsp), %r9
incq %r14
cmpq %rbp, %r14
jne 0xd7b31
jmp 0xd831f
movq 0x8(%rsp), %rax
leaq 0x1(%rbx), %rcx
movq %rcx, 0x8(%rsp)
leaq (%rbx,%rbx,2), %rdx
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rax,%rdx,8)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rax,%rdx,8)
movl 0x2c(%rsp), %r8d
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl %esi, %r8d
movq 0x48(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq 0x98(%rsp), %rdx
movl (%rcx,%rdx,8), %edx
andl %esi, %edx
movzwl 0x30(%rsp), %r11d
movl %r11d, %r9d
shrl $0xe, %r9d
movq %rax, %rbx
movzbl 0x32(%rsp), %r10d
shrl $0xf, %r11d
andl $0x1, %r9d
movq 0x18(%rsp), %rdi
movl %r14d, %esi
movl %r13d, %ecx
pushq %r11
pushq %r10
callq 0xeaa02
addq $0x10, %rsp
movl 0x24(%rsp), %eax
movl 0x28(%rsp), %r9d
xorl $0x1, %r9d
xorl $0x1, %eax
movq 0x80(%rsp), %rdi
movq 0x88(%rsp), %rsi
movl 0x5c(%rsp), %ecx
movl 0x100(%rsp), %r8d
leaq 0x20(%rsp), %rdx
pushq %rdx
pushq %rax
callq 0xb3df3
addq $0x10, %rsp
movq 0x8(%rsp), %rax
cmpq %r15, %rax
movq %r15, %rax
jne 0xd826e
leaq (%rax,%rax), %r15
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r15
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %rsi
movq %rbx, %rdi
callq 0x2370
movq %r15, 0x68(%rsp)
movq 0x48(%rsp), %r15
movl 0x108(%rsp), %ebx
jmp 0xd8282
movq %rax, 0x68(%rsp)
movq %rbx, %rax
movl 0x108(%rsp), %ebx
movq 0x48(%rsp), %r15
addq $0x2, 0x78(%rsp)
movq 0x8(%rsp), %rcx
leaq (%rcx,%rcx,2), %rdx
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rax,%rdx,8)
movaps 0x20(%rsp), %xmm0
movq %rax, 0x8(%rsp)
movups %xmm0, (%rax,%rdx,8)
movl 0x2c(%rsp), %r8d
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl %esi, %r8d
movq 0x10(%r15), %rax
shrl %r13d
leaq (,%r13,4), %rcx
addq %r13, %rcx
movl (%rax,%rcx,8), %edx
andl %esi, %edx
movl %r14d, %ecx
xorl $0x1, %ecx
movzwl 0x30(%rsp), %eax
movl %eax, %r9d
shrl $0xe, %r9d
movzbl 0x32(%rsp), %r10d
shrl $0xf, %eax
andl $0x1, %r9d
movq 0x18(%rsp), %r13
movq %r13, %rdi
movq 0x70(%rsp), %rsi
pushq %rax
pushq %r10
callq 0xeaa02
movq %r13, %r9
addq $0x10, %rsp
movq 0x60(%rsp), %r13
movq 0x10(%rsp), %r10
movl 0x110(%rsp), %r11d
jmp 0xd815f
movq 0x50(%rsp), %rbp
movq 0x78(%rsp), %r14
jmp 0xd8369
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
xorl %r10d, %r10d
jmp 0xd8369
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
xorl %r10d, %r10d
movq 0x50(%rsp), %rbp
jmp 0xd8369
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
xorl %r10d, %r10d
movl 0x110(%rsp), %r11d
movq %r10, 0x10(%rsp)
testl %ebx, %ebx
je 0xd85aa
movl $0x0, 0x4(%rsp)
testq %r14, %r14
je 0xd844b
xorl %ecx, %ecx
movl $0x10, %ebx
movq 0x8(%rsp), %r8
movl 0x4(%r12), %esi
movl %esi, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmpl (%r12), %edx
jne 0xd83e1
leal (%rdx,%rdx), %eax
testl %edx, %edx
cmovel %ebx, %eax
movl %eax, (%r12)
movq 0x8(%r12), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
callq 0x2370
movq 0x8(%rsp), %r8
movq %rax, 0x8(%r12)
movl 0x4(%r12), %esi
movl %esi, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl 0x4(%rsp), %ecx
jmp 0xd83e6
movq 0x8(%r12), %rax
leal 0x1(%rsi), %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl $0x80000000, %esi       # imm = 0x80000000
orl %edi, %esi
movl %esi, 0x4(%r12)
movl %edx, %edx
leaq (%rdx,%rdx,2), %rdx
movl %ecx, %esi
leaq (%rsi,%rsi,2), %rsi
movq 0x10(%r8,%rsi,8), %rdi
movq %rdi, 0x10(%rax,%rdx,8)
movups (%r8,%rsi,8), %xmm0
movups %xmm0, (%rax,%rdx,8)
incl %ecx
movl %ecx, 0x4(%rsp)
cmpq %rcx, %r14
ja 0xd8393
movq 0x28(%r12), %rdi
callq 0x2220
movq $0x0, 0x28(%r12)
andb $0x7f, 0x7(%r12)
movq %r12, %rdi
callq 0xa0a7d
movq %r14, %rbx
movq 0x120(%rsp), %r14
movl $0x64, %ecx
movq %r12, %rdx
xorl %r8d, %r8d
callq 0xe96a2
testq %rax, %rax
jne 0xd8456
movq %r12, %rdi
callq 0xa0a7d
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xa7e08
movl $0x0, 0x4(%rsp)
movq %rbx, %r14
testq %rbx, %rbx
movq 0x8(%rsp), %r10
je 0xd859a
xorl %ecx, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq (%rcx,%rcx,2), %rdx
movq (%r10,%rdx,8), %rcx
movq 0x20(%r12), %rsi
movq %rcx, %rdi
shrq $0x21, %rdi
cmpl $0x0, (%rsi,%rdi,8)
js 0xd8587
movl 0x8(%r10,%rdx,8), %edx
movl %edx, %edi
shrl %edi
cmpl $0x0, (%rsi,%rdi,8)
js 0xd8587
shrq $0x20, %rcx
movq 0x30(%r12), %rsi
cmpb $0x0, (%rsi,%rcx)
je 0xd84f1
movq %rdx, %rdi
xorq $0x1, %rdi
cmpb $0x0, (%rsi,%rdi)
jne 0xd8587
movq 0x8(%r12), %rsi
movq 0x28(%r12), %rdi
movq (%rdi,%rcx,8), %r8
movq %r8, %r9
andq %rax, %r9
je 0xd8542
shrq $0x20, %r8
shlq $0x3, %r9
leaq (%r9,%r9,2), %rdi
leaq (%r8,%r8,2), %r8
leaq (%rsi,%r8,8), %rsi
addq $0xc, %rsi
xorl %r8d, %r8d
cmpl %edx, -0x4(%rsi,%r8)
jne 0xd852f
orb $-0x80, 0x3(%rsi,%r8)
addq $0x18, %r8
cmpq %r8, %rdi
jne 0xd8522
movq 0x8(%r12), %rsi
movq 0x28(%r12), %rdi
xorl $0x1, %edx
movq (%rdi,%rdx,8), %rdi
movq %rdi, %rdx
andq %rax, %rdx
je 0xd8587
shrq $0x20, %rdi
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rdi,%rdi,2), %rdi
leaq (%rsi,%rdi,8), %rsi
addq $0xc, %rsi
xorl %edi, %edi
movl -0x4(%rsi,%rdi), %r8d
xorl %ecx, %r8d
cmpl $0x1, %r8d
jne 0xd857e
orb $-0x80, 0x3(%rsi,%rdi)
addq $0x18, %rdi
cmpq %rdi, %rdx
jne 0xd856b
movl 0x4(%rsp), %ecx
incl %ecx
movl %ecx, 0x4(%rsp)
cmpq %rcx, %r14
ja 0xd84a0
movq %r12, %rdi
callq 0xa0a7d
movl 0x110(%rsp), %r11d
testl %r11d, %r11d
je 0xd870d
movl $0x0, 0x4(%rsp)
testq %r14, %r14
je 0xd870d
movq %r14, %rbx
movq %r13, 0x60(%rsp)
movq 0x118(%rsp), %r14
xorl %ecx, %ecx
movl $0x10, %ebp
movl $0x2, %r13d
movq 0x8(%rsp), %r9
movl 0x4(%r12), %esi
movl %esi, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmpl (%r12), %edx
jne 0xd8634
leal (%rdx,%rdx), %eax
testl %edx, %edx
cmovel %ebp, %eax
movl %eax, (%r12)
movq 0x8(%r12), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
callq 0x2370
movq 0x8(%rsp), %r9
movq %rax, 0x8(%r12)
movl 0x4(%r12), %esi
movl %esi, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl 0x4(%rsp), %ecx
jmp 0xd8639
movq 0x8(%r12), %rax
leal 0x1(%rsi), %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl $0x80000000, %esi       # imm = 0x80000000
orl %edi, %esi
movl %esi, 0x4(%r12)
movl %edx, %edx
leaq (%rdx,%rdx,2), %rsi
movl %ecx, %edx
leaq (%rdx,%rdx,2), %rdi
movq 0x10(%r9,%rdi,8), %r8
movq %r8, 0x10(%rax,%rsi,8)
movups (%r9,%rdi,8), %xmm0
movups %xmm0, (%rax,%rsi,8)
testq %r14, %r14
je 0xd86d3
movq (%r14), %rsi
movq 0x10(%r14), %rax
cmpq 0x8(%r14), %rsi
jne 0xd86b1
leaq (%rsi,%rsi), %rcx
testq %rsi, %rsi
cmoveq %r13, %rcx
movq %rcx, 0x8(%r14)
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
movq %rax, %rdi
callq 0x2370
movq 0x8(%rsp), %r9
movq %rax, 0x10(%r14)
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movl %edx, %ecx
leaq (%rdx,%rdx,2), %rdx
leaq 0x1(%rsi), %rdi
movq %rdi, (%r14)
leaq (%rsi,%rsi,2), %rsi
movq 0x10(%r9,%rdx,8), %rdi
movq %rdi, 0x10(%rax,%rsi,8)
movups (%r9,%rdx,8), %xmm0
movups %xmm0, (%rax,%rsi,8)
incl %ecx
movl %ecx, 0x4(%rsp)
cmpq %rcx, %rbx
ja 0xd85e6
movq 0x28(%r12), %rdi
callq 0x2220
movq $0x0, 0x28(%r12)
andb $0x7f, 0x7(%r12)
movq %r12, %rdi
callq 0xa0a7d
movq 0x60(%rsp), %r13
movq 0x50(%rsp), %rbp
movq (%rbp), %rax
testq %rax, %rax
movq 0x8(%rsp), %rdi
je 0xd8754
movq 0x8(%rbp), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %esi
cmpl $-0x1, %esi
je 0xd8742
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl %esi, 0x44(%rsp)
cmpl $0x0, (%rcx,%rdx,4)
jns 0xd874a
movl $0xffffffff, (%rcx,%rdx,4) # imm = 0xFFFFFFFF
jmp 0xd874a
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
incq %rdx
movl %edx, %esi
cmpq %rsi, %rax
ja 0xd8721
testq %r13, %r13
jne 0xd8766
movq %r15, %rdi
callq 0xa0761
movq 0x8(%rsp), %rdi
callq 0x2220
movq 0x10(%rsp), %rdi
callq 0x2220
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq