// File: /workspace/github_cpp_makefile_star2_O2/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, 0x6c(%rsp)
movq %r8, %rbx
movq %rcx, 0x90(%rsp)
movq %rdx, 0x88(%rsp)
movq %rsi, %r12
testq %rdi, %rdi
movq %rdi, 0xa8(%rsp)
je 0x9b0db
movq 0x18(%rdi), %rbp
movq %rdi, 0x18(%rsp)
xorl %r14d, %r14d
movq %rbp, 0x60(%rsp)
movl 0x14(%rbp), %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
cmpq %rbp, %r14
jae 0x9a7de
movl %r14d, 0x5c(%rsp)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %r15
imulq $0x28, %r14, %rax
cmpl $0x0, 0xc(%r15,%rax)
movq 0x60(%rsp), %rbp
je 0x9a799
movq 0x20(%rbp), %rcx
cmpl $0x0, (%rcx,%r14,8)
js 0x9a799
cmpl $0x0, 0x110(%rsp)
je 0x9a79e
cmpb $0x1, 0x4(%rcx,%r14,8)
jne 0x9a79e
incq %r14
jmp 0x9a74b
addq %rax, %r15
xorl %r13d, %r13d
movl %r13d, 0xc(%rsp)
movl 0x10(%r15), %eax
cmpq %rax, %r13
jae 0x9a799
movq 0x18(%r15), %rax
movq (%rax,%r13,8), %rsi
shrq $0x21, %rsi
movq 0x20(%r12), %rax
leaq (%rax,%rsi,8), %r8
addq $0x4, %r8
movq %rbx, %rdi
movl %r14d, %edx
pushq $0x1
popq %rcx
callq 0x6ab56
incq %r13
jmp 0x9a7a4
addl %ebp, %ebp
xorl %edx, %edx
xorl %r15d, %r15d
movq $0x0, 0x70(%rsp)
movq $0x0, 0x48(%rsp)
xorl %r14d, %r14d
xorl %r13d, %r13d
cmpl %ebp, %edx
je 0x9ae64
movl %edx, %eax
shrl %eax
movl %eax, 0x5c(%rsp)
movq 0x60(%rsp), %rcx
movq 0x20(%rcx), %rcx
cmpl $0x0, (%rcx,%rax,8)
js 0x9a893
cmpl $0x0, 0x110(%rsp)
je 0x9a82d
cmpb $0x1, 0x4(%rcx,%rax,8)
je 0x9a893
movq %r13, 0x50(%rsp)
movq %r14, %r13
movq 0x18(%rsp), %rcx
movq 0x10(%rcx), %r14
imulq $0x28, %rax, %rax
cmpl $0x0, 0xc(%r14,%rax)
je 0x9a88b
addq %rax, %r14
cmpl $0x0, (%r14)
js 0x9a88b
cmpl $-0x1, 0x4(%r14)
je 0x9a88b
cmpl $-0x1, 0x8(%r14)
je 0x9a88b
movq %rax, 0xa0(%rsp)
movq 0x60(%rsp), %rdi
movq %rdx, %rsi
movq %rdx, 0x10(%rsp)
xorl %edx, %edx
callq 0xc2e7a
testl %eax, %eax
je 0x9a89a
movq %r13, %r14
movq 0x10(%rsp), %rdx
jmp 0x9a88e
movq %r13, %r14
movq 0x50(%rsp), %r13
incl %edx
jmp 0x9a7fd
movq %r15, 0x78(%rsp)
leaq 0x4(%r14), %rax
addq $0x8, %r14
testb $0x1, 0x10(%rsp)
cmovneq %rax, %r14
movl (%r14), %eax
andl $0x0, 0xc(%rsp)
xorl $0x1, %eax
movq %rax, 0x40(%rsp)
xorl %r15d, %r15d
movq $0x0, 0x38(%rsp)
movq %r13, %r14
movq 0x50(%rsp), %r13
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
movq %r12, %rsi
movq 0x90(%rsp), %rdx
movq 0x98(%rsp), %rcx
movq %rbx, %r8
movl 0x74(%rsp), %r9d
pushq $0x1
popq %rax
pushq %rax
leaq 0xc0(%rsp), %r10
pushq %r10
leaq 0x24(%rsp), %r10
pushq %r10
pushq %rax
leaq 0x84(%rsp), %rax
pushq %rax
pushq 0x70(%rsp)
movl 0x138(%rsp), %eax
pushq %rax
callq 0xc47e9
addq $0x40, %rsp
testl %eax, %eax
je 0x9a98e
movq 0x38(%rsp), %rcx
cmpq %r13, %rcx
jne 0x9a963
movq %r14, %rdi
leaq (,%r13,2), %r14
testq %r13, %r13
pushq $0x2
popq %rax
cmoveq %rax, %r14
imulq $0x18, %r14, %rsi
callq 0x2370
movq 0x38(%rsp), %rcx
movq %r14, %r13
movq %rax, %r14
incq %rcx
movq %rcx, 0x38(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%r14,%r15)
movups 0xb0(%rsp), %xmm0
movups %xmm0, (%r14,%r15)
addq $0x18, %r15
jmp 0x9a8d4
movq 0x38(%rsp), %rcx
testq %rcx, %rcx
je 0x9aa7a
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xb5486
cmpl $0x0, 0x110(%rsp)
movq %r14, 0x40(%rsp)
movq 0x78(%rsp), %r15
movq %r13, 0x50(%rsp)
je 0x9aa89
xorl %eax, %eax
xorl %edx, %edx
pushq $-0x1
popq %rcx
movq 0x38(%rsp), %r10
movl %eax, %esi
cmpq %rsi, %r10
jbe 0x9aa17
imulq $0x18, %rsi, %rsi
movups (%r14,%rsi), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x10(%r14,%rsi), %rsi
movq %rsi, 0x30(%rsp)
movl 0x2c(%rsp), %esi
testl %esi, %esi
setns %r8b
cmpl %edx, %esi
seta %r9b
movl %eax, %edi
testb %r9b, %r8b
jne 0x9aa0f
movl %edx, %esi
movl %ecx, %edi
incl %eax
movl %esi, %edx
movl %edi, %ecx
jmp 0x9a9d5
movl %eax, 0xc(%rsp)
cmpl $-0x1, %ecx
je 0x9aa7f
movl %ecx, %eax
imulq $0x18, %rax, %rax
movups (%r14,%rax), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x10(%r14,%rax), %rax
movq %rax, 0x30(%rsp)
movl 0x28(%rsp), %edx
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0xb542c
cmpl $-0x1, %eax
je 0x9aa73
movl %eax, %r14d
xorl $0x1, %r14d
movq 0x60(%rsp), %rdi
movl %r14d, %esi
xorl %edx, %edx
movq %rax, 0x38(%rsp)
callq 0xc2e7a
testl %eax, %eax
je 0x9acbd
movq 0x40(%rsp), %r14
jmp 0x9aa7f
movq 0x78(%rsp), %r15
movq 0x10(%rsp), %rdx
jmp 0x9a893
movq 0x10(%rsp), %rdx
movl %edx, %eax
xorl $0x1, %eax
movl %eax, 0x9c(%rsp)
xorl %r15d, %r15d
movq 0x38(%rsp), %rcx
movl %r15d, 0xc(%rsp)
movl %r15d, %eax
cmpq %rax, %rcx
jbe 0x9acb3
imulq $0x18, %rax, %rax
movups (%r14,%rax), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x10(%r14,%rax), %rax
movq %rax, 0x30(%rsp)
cmpl $0x0, 0x2c(%rsp)
js 0x9acab
movl 0x28(%rsp), %edx
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0xb542c
cmpl $-0x1, %eax
je 0x9ab24
movl %eax, %r11d
movq 0x70(%rsp), %r14
cmpq %r14, 0x48(%rsp)
jne 0x9ab2e
movq %r14, %rax
addq %r14, %r14
testq %rax, %rax
pushq $0x2
popq %rax
cmoveq %rax, %r14
imulq $0x18, %r14, %rsi
movq 0x78(%rsp), %rdi
movq %r11, %r15
callq 0x2370
movq %r15, %r11
movq %rax, %r15
jmp 0x9ab33
movq 0x10(%rsp), %rdx
jmp 0x9aca6
movq 0x78(%rsp), %r15
movq 0x10(%rsp), %rsi
movq 0x48(%rsp), %rax
leaq 0x1(%rax), %r13
imulq $0x18, %rax, %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%r15,%rax)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%r15,%rax)
movl 0x2c(%rsp), %r8d
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %r8d
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq 0xa0(%rsp), %rdx
movl (%rax,%rdx), %edx
andl %ecx, %edx
movzwl 0x30(%rsp), %eax
movl %eax, %r9d
shrl $0xe, %r9d
movzbl 0x32(%rsp), %r10d
shrl $0xf, %eax
andl $0x1, %r9d
movq 0x60(%rsp), %rdi
movq %r11, 0x80(%rsp)
movl %r11d, %ecx
pushq %rax
pushq %r10
callq 0xac072
popq %rcx
popq %rdx
movl 0x24(%rsp), %eax
movl 0x28(%rsp), %r9d
xorl $0x1, %r9d
xorl $0x1, %eax
movq 0x88(%rsp), %rdi
movq 0x90(%rsp), %rsi
movl 0x6c(%rsp), %ecx
movl 0x100(%rsp), %r8d
leaq 0x20(%rsp), %rdx
pushq %rdx
pushq %rax
callq 0x79204
popq %rcx
popq %rdx
cmpq %r14, %r13
jne 0x9ac0d
movq %r14, %rax
addq %r14, %r14
testq %rax, %rax
pushq $0x2
popq %rax
cmoveq %rax, %r14
imulq $0x18, %r14, %rsi
movq %r15, %rdi
callq 0x2370
movq %rax, %r15
movq %r14, 0x70(%rsp)
movq 0x40(%rsp), %r14
addq $0x2, 0x48(%rsp)
imulq $0x18, %r13, %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%r15,%rax)
movaps 0x20(%rsp), %xmm0
movq %r15, 0x78(%rsp)
movups %xmm0, (%r15,%rax)
movl 0x2c(%rsp), %r8d
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %r8d
movq 0x80(%rsp), %rcx
movl %ecx, %esi
xorl $0x1, %esi
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
shrl %ecx
imulq $0x28, %rcx, %rcx
movl (%rax,%rcx), %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 0x60(%rsp), %rdi
movl 0x9c(%rsp), %ecx
pushq %rax
pushq %r10
callq 0xac072
popq %rcx
popq %rdx
movl 0xc(%rsp), %r15d
movq 0x10(%rsp), %rdx
movq 0x50(%rsp), %r13
movq 0x38(%rsp), %rcx
incl %r15d
jmp 0x9aaa2
movq 0x78(%rsp), %r15
jmp 0x9a893
movl %r14d, 0x80(%rsp)
movq 0x70(%rsp), %r13
cmpq %r13, 0x48(%rsp)
jne 0x9acf5
movq %r15, %rdi
leaq (,%r13,2), %r15
testq %r13, %r13
pushq $0x2
popq %rax
cmoveq %rax, %r15
imulq $0x18, %r15, %rsi
callq 0x2370
movq %r15, %r13
movq %rax, %r15
movq 0x10(%rsp), %rsi
movq 0x48(%rsp), %rax
leaq 0x1(%rax), %r14
imulq $0x18, %rax, %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%r15,%rax)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%r15,%rax)
movl 0x2c(%rsp), %r8d
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %r8d
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq 0xa0(%rsp), %rdx
movl (%rax,%rdx), %edx
andl %ecx, %edx
movzwl 0x30(%rsp), %eax
movl %eax, %r9d
shrl $0xe, %r9d
movzbl 0x32(%rsp), %r10d
shrl $0xf, %eax
andl $0x1, %r9d
movq 0x60(%rsp), %rdi
movq 0x38(%rsp), %rcx
pushq %rax
pushq %r10
callq 0xac072
popq %rcx
popq %rdx
movl 0x24(%rsp), %eax
movl 0x28(%rsp), %r9d
xorl $0x1, %r9d
xorl $0x1, %eax
movq 0x88(%rsp), %rdi
movq 0x90(%rsp), %rsi
movl 0x6c(%rsp), %ecx
movl 0x100(%rsp), %r8d
leaq 0x20(%rsp), %rdx
pushq %rdx
pushq %rax
callq 0x79204
popq %rcx
popq %rdx
cmpq %r13, %r14
jne 0x9add2
movq %r15, %rdi
leaq (,%r13,2), %r15
testq %r13, %r13
pushq $0x2
popq %rax
cmoveq %rax, %r15
imulq $0x18, %r15, %rsi
callq 0x2370
movq %r15, 0x70(%rsp)
movq %rax, %r15
jmp 0x9add7
movq %r13, 0x70(%rsp)
movl 0x80(%rsp), %esi
addq $0x2, 0x48(%rsp)
imulq $0x18, %r14, %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%r15,%rax)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%r15,%rax)
movl 0x2c(%rsp), %r8d
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
andl %edi, %r8d
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x38(%rsp), %rcx
shrl %ecx
imulq $0x28, %rcx, %rcx
movl (%rax,%rcx), %edx
andl %edi, %edx
movq 0x10(%rsp), %r14
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 0x60(%rsp), %rdi
pushq %rax
pushq %r10
callq 0xac072
movq %r14, %rdx
addq $0x10, %rsp
movq 0x40(%rsp), %r14
jmp 0x9a88e
movq %r14, 0x40(%rsp)
cmpl $0x0, 0x108(%rsp)
je 0x9af92
xorl %eax, %eax
movq 0x48(%rsp), %r14
movl %eax, 0xc(%rsp)
movl %eax, %eax
cmpq %rax, %r14
jbe 0x9aeaf
movq %r12, %rdi
callq 0x6c45d
movl 0xc(%rsp), %ecx
imulq $0x18, %rcx, %rdx
movq 0x10(%r15,%rdx), %rsi
movq %rsi, 0x10(%rax)
movups (%r15,%rdx), %xmm0
movups %xmm0, (%rax)
leal 0x1(%rcx), %eax
jmp 0x9ae7e
testq %r14, %r14
je 0x9aed2
movq 0x28(%r12), %rdi
callq 0x2220
andq $0x0, 0x28(%r12)
andb $0x7f, 0x7(%r12)
movq %r12, %rdi
callq 0x694eb
xorl %ebp, %ebp
movq 0x88(%rsp), %rdi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0xb4c38
movq %r12, %rdi
movq 0x120(%rsp), %rsi
callq 0xb5068
movl %ebp, 0xc(%rsp)
movl %ebp, %eax
cmpq %rax, 0x48(%rsp)
jbe 0x9af8a
imulq $0x18, %rax, %rcx
movq %r15, %rsi
movq (%r15,%rcx), %r15
movq 0x20(%r12), %rax
movq %r15, %rdx
shrq $0x21, %rdx
cmpl $0x0, (%rax,%rdx,8)
js 0x9af7d
movq %rsi, %r14
movl 0x8(%rsi,%rcx), %edx
movl %edx, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x9af80
shrq $0x20, %r15
movq 0x30(%r12), %rax
movq %rdx, %r13
xorq $0x1, %r13
cmpb $0x0, (%rax,%r15)
je 0x9af53
cmpb $0x0, (%rax,%r13)
jne 0x9af80
movq %r12, %rdi
movl %r15d, %esi
pushq $0x1
popq %rbp
movl %ebp, %ecx
callq 0x6db50
xorl $0x1, %r15d
movq %r12, %rdi
movl %r13d, %esi
movl %r15d, %edx
movl %ebp, %ecx
callq 0x6db50
movl 0xc(%rsp), %ebp
jmp 0x9af80
movq %rsi, %r14
incl %ebp
movq %r14, %r15
jmp 0x9aef6
movq %r12, %rdi
callq 0x694eb
cmpl $0x0, 0x110(%rsp)
movq 0x118(%rsp), %r14
movq 0x48(%rsp), %r13
je 0x9b066
xorl %ecx, %ecx
movl %ecx, 0xc(%rsp)
movl %ecx, %eax
cmpq %rax, %r13
jbe 0x9b043
movq %r12, %rdi
callq 0x6c45d
movl 0xc(%rsp), %ecx
imulq $0x18, %rcx, %rdx
movups (%r15,%rdx), %xmm0
movups %xmm0, (%rax)
movq 0x10(%r15,%rdx), %rdx
movq %rdx, 0x10(%rax)
testq %r14, %r14
je 0x9b03c
movq (%r14), %rdx
movq 0x10(%r14), %rax
cmpq 0x8(%r14), %rdx
jne 0x9b01a
leaq (%rdx,%rdx), %rcx
testq %rdx, %rdx
pushq $0x2
popq %rdx
cmoveq %rdx, %rcx
movq %rcx, 0x8(%r14)
imulq $0x18, %rcx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%r14)
movl 0xc(%rsp), %ecx
movq (%r14), %rdx
imulq $0x18, %rcx, %rsi
leaq 0x1(%rdx), %rdi
movq %rdi, (%r14)
imulq $0x18, %rdx, %rdx
movq 0x10(%r15,%rsi), %rdi
movq %rdi, 0x10(%rax,%rdx)
movups (%r15,%rsi), %xmm0
movups %xmm0, (%rax,%rdx)
incl %ecx
jmp 0x9afaf
testq %r13, %r13
je 0x9b066
movq 0x28(%r12), %rdi
callq 0x2220
andq $0x0, 0x28(%r12)
andb $0x7f, 0x7(%r12)
movq %r12, %rdi
callq 0x694eb
movq (%rbx), %rax
xorl %ecx, %ecx
movq 0xa8(%rsp), %rdi
movq 0x40(%rsp), %r14
movl %ecx, %ecx
cmpq %rcx, %rax
jbe 0x9b0aa
movq 0x8(%rbx), %rdx
movl (%rdx,%rcx,4), %esi
cmpl $-0x1, %esi
je 0x9b0a1
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl %esi, 0x5c(%rsp)
cmpl $0x0, (%rdx,%rcx,4)
jns 0x9b0a6
orl $-0x1, (%rdx,%rcx,4)
jmp 0x9b0a6
orl $-0x1, 0x5c(%rsp)
incl %ecx
jmp 0x9b078
testq %rdi, %rdi
jne 0x9b0b9
movq 0x18(%rsp), %rdi
callq 0x6921d
movq %r15, %rdi
callq 0x2220
movq %r14, %rdi
callq 0x2220
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x76d91
movq %rax, 0x18(%rsp)
movq 0x18(%rax), %rbp
xorl %eax, %eax
movl 0x14(%rbp), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpq %rcx, %rax
jae 0x9a743
movq 0x20(%rbp), %rcx
movb $0x0, 0x4(%rcx,%rax,8)
incq %rax
jmp 0x9b0ee