// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Overlaps.cpp
// Function: rescue_no_coverage_aggressive(asg_t*, ma_hit_t_alloc*, ma_hit_t_alloc*, ma_sub_t**, R_to_U*, int, int, long long, unsigned int, bub_label_t*)
void rescue_no_coverage_aggressive(asg_t *r_g, ma_hit_t_alloc* sources_count, 
ma_hit_t_alloc* reverse_source, ma_sub_t **coverage_cut, R_to_U* ruIndex, int max_hang, int min_ovlp, 
long long bubble_dist, uint32_t chainLenThres, bub_label_t* b_mask_t)
{
    uint32_t n_vtx, v, k, kv, is_Unitig, uId, rId, endRid, w;
    uint32_t ava_max, ava_ol_max, ava_min_chain, ava_cur, ava_chainLen, test_oLen, is_update;
    uint64_t interval_beg, intervalLen;
    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;
    ma_sub_t *sq = NULL;
    ma_sub_t *st = NULL;
    int32_t r;
    
    kvec_t(asg_arc_t) new_utg_edges;
    kv_init(new_utg_edges);

    kvec_t(asg_arc_t) new_rtg_edges;
    kv_init(new_rtg_edges);

    kvec_t(asg_arc_t) hap_edges;
    kv_init(hap_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_u64_warp intervals;
    kv_init(intervals.a);

    kvec_t_u32_warp chain_buffer;
    kv_init(chain_buffer.a);

    kvec_asg_arc_t_warp chain_edges;
    kv_init(chain_edges.a);


    ug = ma_ug_gen(r_g);
    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;
        nsg->seq[v].c = PRIMARY_LABLE;
        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;
        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 = &(sources_count[(endRid>>1)]);
        for (k = 0; k < x->length; k++)
        {
            ///h is the edge of endRid
            h = &(x->buffer[k]);
            sq = &((*coverage_cut)[Get_qn(*h)]);
            st = &((*coverage_cut)[Get_tn(*h)]);
            ///sq, st, and h cannot be deleted
            if(sq->del || st->del || h->del) continue;
            r = ma_hit2arc(h, sq->e - sq->s, st->e - st->s, max_hang, 
                                            asm_opt.max_hang_rate, min_ovlp, &t);
            if(r < 0) continue;
            if((t.ul>>32) != endRid) continue;
            break;
        }
        ///means there is >0 edges
        if(k != x->length) continue;

        ///x is the end read of a tip
        ///find all overlap of x
        x = &(reverse_source[(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 = &(x->buffer[k]);
            ///means we found a contained read
            if(get_no_coverage_reads_chain_simple(h, sources_count, reverse_source, *coverage_cut, 
            ruIndex, ug, r_g, max_hang, min_ovlp, endRid, uId, &chain_buffer, NULL, &ava_cur, 
            &test_oLen, &ava_chainLen, chainLenThres))
            {
                
                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_no_coverage_reads_chain_simple(h_max, sources_count, reverse_source, 
            *coverage_cut, ruIndex, ug, r_g, max_hang, min_ovlp, endRid, uId, &chain_buffer, 
            &chain_edges, &ava_cur, &test_oLen, &ava_chainLen, chainLenThres);
            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, reverse_source, *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);

            for (k = 0, kv = 0; k < rbub_edges.n; k++)
            {
                t = rbub_edges.a[k];
                if(t.del) continue;
                kv++;
            }

            if(kv != 1) continue;

            interval_beg = hap_edges.n;
            
            //just saves all nodes here
            ///note that only the first edge is generated from reverse_source, 
            ///others are generated from source
            for (k = 0; k < chain_edges.a.n; k++)
            {
                kv_push(asg_arc_t, hap_edges, chain_edges.a.a[k]);
            }

            for (k = 0; k < rbub_edges.n; k++)
            {
                t = rbub_edges.a[k];
                if(t.del) continue;
                kv_push(asg_arc_t, hap_edges, t);
            }


            if(check_if_no_coverage(r_g, hap_edges.a+interval_beg, hap_edges.n - interval_beg) == 0)
            {
                hap_edges.n = interval_beg;
                continue;
            }

            ///there is just one edge
            ///connect multiple edges is too difficult
            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_rtg_edges, t);

                get_edge_from_source(reverse_source, *coverage_cut, ruIndex, max_hang, min_ovlp, 
                (t.v^1), ((t.ul>>32)^1), &t);
                kv_push(asg_arc_t, new_rtg_edges, t);


                ///for unitig graph
                asg_append_edges_to_srt(nsg, v, ug->u.a[v>>1].len, w, 0, 0, 0, 0);
                asg_append_edges_to_srt(nsg, w^1, ug->u.a[w>>1].len, v^1, 0, 0, 0, 0);

                t.ul = v; t.ul = t.ul<<32; t.v = w;
                kv_push(asg_arc_t, new_utg_edges, t);

                t.ul = w^1; t.ul = t.ul<<32; t.v = v^1;
                kv_push(asg_arc_t, new_utg_edges, t);

            }

            kv_push(uint64_t, u_vecs.a, v);

            intervalLen = hap_edges.n - interval_beg;
            interval_beg = interval_beg << 32;
            interval_beg = interval_beg | intervalLen;
            kv_push(uint64_t, intervals.a, interval_beg);
        }
    }

    nsg->seq_vis = (uint8_t*)calloc(nsg->n_seq*2, sizeof(uint8_t));    
    lable_all_bubbles(nsg, b_mask_t);


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

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

        asg_arc_del(nsg, v, w, 1);
        asg_arc_del(nsg, w^1, v^1, 1);
        new_rtg_edges.a[k].del = 1;
    }
    free(nsg->seq_vis); nsg->seq_vis = NULL;


    new_utg_edges.n = 0;
    asg_arc_t* list = NULL;
    uint32_t nextNode, curNode, pre_num_nodes = r_g->n_seq;
    ///u_vecs saves the unitig Id
    for (k = 0; k < u_vecs.a.n; k++)
    {
        w = (uint32_t)u_vecs.a.a[k];
        ///do nothing
        if(get_real_length(r_g, w, NULL) == 0) continue;

        interval_beg = intervals.a.a[k]>>32;
        intervalLen = intervals.a.a[k] & ((uint64_t)0xffffffff);
        list = hap_edges.a + interval_beg;
        if(intervalLen < 2) continue;///fprintf(stderr, "No enough edges\n");
        fprintf(stderr, "\n(%u) w>>1: %u, w&1: %u\n", k, w>>1, w&1);
        ///continue;


        if(create_fake_read(r_g, list, intervalLen) == 0) continue;


        curNode = list[0].ul>>32;
        nextNode = (r_g->n_seq - 1)<<1;
        /*****************for debug**********************/
        generate_edge(r_g, curNode, nextNode, 0, 0, 0, 0, 0, &t);
        kv_push(asg_arc_t, new_utg_edges, t);

        generate_edge(r_g, nextNode^1, curNode^1, 0, 0, 0, 0, 0, &t);
        kv_push(asg_arc_t, new_utg_edges, t);
        /*****************for debug**********************/
        // fprintf(stderr, "curNode>>1: %u, curNode&1: %u, nextNode>>1: %u, nextNode&1: %u\n", 
        // curNode>>1, curNode&1, nextNode>>1, nextNode&1);


        curNode = (r_g->n_seq - 1)<<1;
        nextNode = list[intervalLen - 1].v;
        /*****************for debug**********************/
        generate_edge(r_g, curNode, nextNode, 0, 0, 0, 0, 0, &t);
        kv_push(asg_arc_t, new_utg_edges, t);

        generate_edge(r_g, nextNode^1, curNode^1, 0, 0, 0, 0, 0, &t);
        kv_push(asg_arc_t, new_utg_edges, t);
        /*****************for debug**********************/
        // fprintf(stderr, "curNode>>1: %u, curNode&1: %u, nextNode>>1: %u, nextNode&1: %u\n", 
        // curNode>>1, curNode&1, nextNode>>1, nextNode&1);
    }

    


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

    
    free(r_g->idx);
    r_g->idx = 0;
    r_g->is_srt = 0;
    asg_cleanup(r_g);

    if(r_g->n_seq > pre_num_nodes)
    {
        (*coverage_cut) = (ma_sub_t*)realloc((*coverage_cut), r_g->n_seq*sizeof(ma_sub_t));
        R_INF.trio_flag = (uint8_t*)realloc(R_INF.trio_flag, r_g->n_seq*sizeof(uint8_t));
        ruIndex->index = (uint32_t*)realloc(ruIndex->index, r_g->n_seq*sizeof(uint32_t));
        ruIndex->len = r_g->n_seq;
        for (k = pre_num_nodes; k < r_g->n_seq; k++)
        {
            ruIndex->index[k] = (uint32_t)-1;
            R_INF.trio_flag[k] = AMBIGU;
            (*coverage_cut)[k].del = 0;
            (*coverage_cut)[k].c = PRIMARY_LABLE;
            (*coverage_cut)[k].s = 0;
            (*coverage_cut)[k].e = r_g->seq[k].len;
        }
    }
    

    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;
    }


    ma_ug_destroy(ug);
    kv_destroy(new_utg_edges);
    kv_destroy(hap_edges);
    kv_destroy(new_rtg_edges);
    kv_destroy(rbub_edges);
    kv_destroy(u_vecs.a);
    kv_destroy(chain_buffer.a);
    kv_destroy(chain_edges.a);
    kv_destroy(intervals.a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movq %r9, 0x98(%rsp)
movq %r8, %r13
movq %rcx, %rbx
movq %rdx, 0xf0(%rsp)
movq %rsi, 0x178(%rsp)
movq %rdi, %r12
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x20(%rsp)
movl $0xffffffff, 0x28(%rsp) # imm = 0xFFFFFFFF
xorl %eax, %eax
movq %rax, 0x190(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x180(%rsp)
movq %rax, 0x160(%rsp)
movaps %xmm0, 0x150(%rsp)
callq 0xb10cd
movq %rax, 0xa0(%rsp)
movq 0x18(%rax), %rbp
movl 0x14(%rbp), %edi
testl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movq %r13, 0x48(%rsp)
movq %rbx, 0x18(%rsp)
je 0x10236f
movq %rbp, 0x58(%rsp)
xorl %ebx, %ebx
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
leaq (%rbx,%rbx,4), %rcx
cmpl $0x0, 0xc(%rax,%rcx,8)
movq 0x58(%rsp), %rbp
je 0x1013e6
movq 0x20(%rbp), %rdx
cmpl $0x0, (%rdx,%rbx,8)
js 0x1013e6
leaq (%rax,%rcx,8), %r14
movb $0x0, 0x4(%rdx,%rbx,8)
movl $0x0, 0x4(%rsp)
cmpl $0x0, 0x10(%r14)
je 0x1013e6
xorl %r15d, %r15d
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 %r13, %rdi
movl %ebx, %edx
movl $0x1, %ecx
callq 0xa27e9
incq %r15
movl %r15d, 0x4(%rsp)
movl 0x10(%r14), %eax
cmpq %rax, %r15
jb 0x1013ad
incq %rbx
movl 0x14(%rbp), %edi
movl %edi, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
cmpq %rbp, %rbx
jb 0x10136c
testl %ebp, %ebp
je 0x1023bf
addl %ebp, %ebp
movl $0x0, %edi
movl $0x0, %eax
movq %rax, 0x100(%rsp)
movl $0x0, %eax
movq %rax, 0x130(%rsp)
movl $0x0, %eax
movq %rax, 0xc8(%rsp)
movl $0x0, %eax
movq %rax, 0x80(%rsp)
movl $0x0, %eax
movq %rax, 0x128(%rsp)
movl $0x0, %eax
movq %rax, 0x50(%rsp)
movq $0x0, 0x148(%rsp)
movq $0x0, 0x70(%rsp)
xorl %ecx, %ecx
movq $0x0, 0x108(%rsp)
movq $0x0, 0x78(%rsp)
movq $0x0, 0x138(%rsp)
movq $0x0, 0x110(%rsp)
movq $0x0, 0xe0(%rsp)
movq $0x0, 0x88(%rsp)
movq $0x0, 0xb0(%rsp)
xorl %r11d, %r11d
movq 0x18(%rsp), %r14
movl %edi, %r10d
shrl %r10d
movq 0x58(%rsp), %rax
movq 0x20(%rax), %rax
cmpl $0x0, (%rax,%r10,8)
js 0x1018c2
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
leaq (%r10,%r10,4), %rdx
cmpl $0x0, 0xc(%rax,%rdx,8)
je 0x1018c2
leaq (%rax,%rdx,8), %rax
cmpl $0x0, (%rax)
js 0x1018c2
cmpl $-0x1, 0x4(%rax)
je 0x1018c2
cmpl $-0x1, 0x8(%rax)
je 0x1018c2
movq %rdx, 0x140(%rsp)
movq %rcx, 0x68(%rsp)
movq 0x58(%rsp), %rcx
movq 0x28(%rcx), %rcx
movq (%rcx,%rdi,8), %rcx
movq %rcx, %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rsi, %rdx
movq %rdi, 0x60(%rsp)
je 0x101592
movq 0x58(%rsp), %rsi
movq 0x8(%rsi), %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 0x10156e
testl %edi, %edi
movq 0x60(%rsp), %rdi
jne 0x101dad
leaq 0x4(%rax), %rcx
addq $0x8, %rax
testb $0x1, %dil
cmovneq %rcx, %rax
movl (%rax), %eax
movq %rax, %rcx
xorq $0x1, %rcx
movq %rcx, 0xc0(%rsp)
shrl %eax
leaq (%rax,%rax,2), %rcx
movq 0x178(%rsp), %rax
movl 0xc(%rax,%rcx,8), %r15d
movq 0x20(%rsp), %r8
movl 0x28(%rsp), %edx
movl %edx, 0xd4(%rsp)
movl $0x0, 0x4(%rsp)
testq %r15, %r15
movq %r11, 0x8(%rsp)
movq %r10, 0xe8(%rsp)
movq %rcx, 0x170(%rsp)
je 0x101917
movq %r8, 0x118(%rsp)
leaq (%rax,%rcx,8), %rax
movq (%rax), %rdi
movq (%r14), %r8
leaq 0x194143(%rip), %rax    # 0x295758
movss 0x158(%rax), %xmm0
movl 0x2c(%rsp), %eax
movl %eax, 0xd0(%rsp)
movzwl 0x30(%rsp), %eax
movl %eax, 0xac(%rsp)
movb 0x32(%rsp), %al
movb %al, 0x17(%rsp)
addq $0x21, %rdi
xorl %edx, %edx
movq %r15, 0xb8(%rsp)
movq %r8, 0x40(%rsp)
movq -0x21(%rdi), %rbx
movq %rbx, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %r10
movl (%r8,%r10,4), %ecx
testl %ecx, %ecx
js 0x101768
movl -0x15(%rdi), %esi
leaq (%rsi,%rsi,2), %rax
leaq (%r8,%rax,4), %r8
movl (%r8), %eax
testl %eax, %eax
js 0x101763
movq -0x9(%rdi), %r9
testq %r9, %r9
js 0x101763
movl 0x4(%r8), %r13d
subl %eax, %r13d
testl %r9d, %r9d
movq %r9, 0x120(%rsp)
js 0x1016b3
movl -0x11(%rdi), %eax
movl -0xd(%rdi), %r8d
subl %r8d, %r13d
movl %r13d, %r14d
movl %eax, %r13d
jmp 0x1016c0
movl -0x11(%rdi), %eax
movl -0xd(%rdi), %r8d
subl %r8d, %r13d
movl %eax, %r14d
movq 0x40(%rsp), %r9
leaq (%r9,%r10,4), %r9
movl 0x4(%r9), %r11d
subl %ecx, %r11d
cmpl %ebx, %r13d
movl %ebx, %r15d
cmovll %r13d, %r15d
movl -0x19(%rdi), %ecx
movl %r11d, %r10d
movl %ecx, 0x90(%rsp)
subl %ecx, %r10d
cmpl %r14d, %r10d
movl %r14d, %ecx
cmovll %r10d, %ecx
movq 0x98(%rsp), %r9
cmpl %r9d, %r15d
jg 0x10174c
cmpl %r9d, %ecx
jg 0x10174c
movl 0x90(%rsp), %r9d
subl %ebx, %r9d
cvtsi2ss %r9, %xmm1
addl %r15d, %r9d
addl %ecx, %r9d
cvtsi2ss %r9, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
ja 0x10174c
subl %eax, %r8d
xorps %xmm1, %xmm1
cvtsi2ss %r8, %xmm1
addl %r15d, %ecx
addl %r8d, %ecx
xorps %xmm2, %xmm2
cvtsi2ss %rcx, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
jbe 0x101781
movq 0x48(%rsp), %r13
movq 0x18(%rsp), %r14
movq 0x8(%rsp), %r11
movq 0xb8(%rsp), %r15
movq 0x40(%rsp), %r8
incq %rdx
movl %edx, 0x4(%rsp)
addq $0x28, %rdi
cmpq %rdx, %r15
jne 0x10164f
jmp 0x1018d9
cmpl %r14d, %r10d
setl %al
setg %r10b
cmpl %r13d, %ebx
setg %r15b
setl %r8b
orb %r10b, %r15b
cmpb $0x1, %r15b
jne 0x10174c
orb %al, %r8b
movq 0xb8(%rsp), %r15
je 0x10189a
movl 0x1f0(%rsp), %eax
cmpl %eax, %r9d
movq 0x40(%rsp), %r8
jl 0x1018ae
cmpl %eax, %ecx
jl 0x1018ae
movq 0x120(%rsp), %r9
testl %r9d, %r9d
setns %cl
addl 0x90(%rsp), %r14d
movl %r11d, %r8d
subl %r14d, %r8d
xorl %r14d, %r14d
movl %ebx, %eax
subl %r13d, %eax
setle %r14b
setg %r10b
cmovlel %r8d, %eax
xorb %cl, %r10b
movzbl %r10b, %ecx
shrq $0x1f, %rbx
andl $-0x2, %ebx
orq %r14, %rbx
leal (%rcx,%rsi,2), %esi
movq %rbx, %rcx
shlq $0x20, %rcx
addq %rax, %rcx
movq %rcx, 0x118(%rsp)
subl %eax, %r11d
andl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movl %r11d, 0xd0(%rsp)
shrl $0x10, %r9d
andl $0x4000, %r9d           # imm = 0x4000
movl 0xac(%rsp), %r8d
andl $0x3fff, %r8d           # imm = 0x3FFF
orl %r9d, %r8d
movb -0x1(%rdi), %cl
movb %cl, 0x17(%rsp)
movzbl (%rdi), %ecx
shll $0xf, %ecx
orl %r8d, %ecx
movl %ecx, 0xac(%rsp)
testl %eax, %eax
movl %esi, 0xd4(%rsp)
js 0x10189a
cmpl 0xc0(%rsp), %ebx
movq 0x48(%rsp), %r13
movq 0x18(%rsp), %r14
movq 0x8(%rsp), %r11
movq 0x40(%rsp), %r8
jne 0x101768
jmp 0x10231c
movq 0x48(%rsp), %r13
movq 0x18(%rsp), %r14
movq 0x8(%rsp), %r11
jmp 0x101763
movq 0x48(%rsp), %r13
movq 0x18(%rsp), %r14
movq 0x8(%rsp), %r11
jmp 0x101768
movq %rcx, %rdx
incq %rdi
movq %rdx, %rcx
cmpq %rbp, %rdi
jne 0x1014c7
jmp 0x10234d
movl 0xd0(%rsp), %eax
movl %eax, 0x2c(%rsp)
movl 0xac(%rsp), %eax
movw %ax, 0x30(%rsp)
movb 0x17(%rsp), %al
movb %al, 0x32(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x20(%rsp)
movl 0xd4(%rsp), %eax
movl %eax, 0x28(%rsp)
movq 0x60(%rsp), %rdi
jmp 0x101932
xorl %edx, %edx
movl 0xd4(%rsp), %esi
movq %r8, 0x20(%rsp)
movl %esi, 0x28(%rsp)
cmpl %r15d, %edx
jne 0x101dad
movl $0x0, 0x4(%rsp)
movq 0xf0(%rsp), %rax
movq 0x170(%rsp), %rcx
cmpl $0x0, 0xc(%rax,%rcx,8)
je 0x101dad
leaq (%rax,%rcx,8), %r13
movq $0x0, 0x90(%rsp)
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movl $0x0, 0x40(%rsp)
xorl %edx, %edx
movl %edx, %eax
leaq (%rax,%rax,4), %rbx
shlq $0x3, %rbx
addq (%r13), %rbx
movq 0x18(%rsp), %rax
movq (%rax), %rcx
subq $0x10, %rsp
movq %rbx, %rdi
movq 0x100(%rsp), %rdx
movq 0x58(%rsp), %r8
movq 0xb0(%rsp), %r9
leaq 0x10c(%rsp), %rax
pushq %rax
leaq 0xf0(%rsp), %rax
pushq %rax
leaq 0xfc(%rsp), %rax
pushq %rax
pushq $0x0
leaq 0x1b0(%rsp), %rax
pushq %rax
pushq 0x120(%rsp)
pushq 0x100(%rsp)
movl 0x238(%rsp), %eax
pushq %rax
pushq 0xe8(%rsp)
pushq %r12
callq 0x1005d9
addq $0x60, %rsp
testl %eax, %eax
je 0x101a47
movl 0xfc(%rsp), %eax
cmpl %r14d, %eax
jae 0x101a24
movl 0xdc(%rsp), %ecx
movl %ecx, 0x40(%rsp)
movl 0xd8(%rsp), %ecx
movq %rbx, 0x90(%rsp)
jmp 0x101a4d
jne 0x101a47
movl 0xdc(%rsp), %edx
movl 0xd8(%rsp), %ecx
cmpl 0x40(%rsp), %edx
jbe 0x101a40
movl %edx, 0x40(%rsp)
jmp 0x101a1a
jne 0x101a47
cmpl %r15d, %ecx
ja 0x101a1a
movl %r15d, %ecx
movl %r14d, %eax
movl 0x4(%rsp), %edx
incl %edx
movl %edx, 0x4(%rsp)
movl %eax, %r14d
movl %ecx, %r15d
cmpl 0xc(%r13), %edx
jb 0x101978
cmpl $0x0, 0x40(%rsp)
je 0x101d74
movq 0x18(%rsp), %r14
movq (%r14), %rcx
subq $0x10, %rsp
movq 0xa0(%rsp), %rdi
movq 0x100(%rsp), %rdx
movq 0x58(%rsp), %r13
movq %r13, %r8
movq 0xb0(%rsp), %r9
leaq 0x10c(%rsp), %rax
pushq %rax
leaq 0xf0(%rsp), %rax
pushq %rax
leaq 0xfc(%rsp), %rax
pushq %rax
leaq 0x178(%rsp), %rax
pushq %rax
leaq 0x1b0(%rsp), %rax
pushq %rax
pushq 0x120(%rsp)
pushq 0x100(%rsp)
movl 0x238(%rsp), %eax
pushq %rax
pushq 0xe8(%rsp)
pushq %r12
callq 0x1005d9
addq $0x60, %rsp
movq 0x150(%rsp), %rax
testq %rax, %rax
je 0x101d80
movq 0x160(%rsp), %rcx
leaq (%rax,%rax,2), %rax
movl -0x10(%rcx,%rax,8), %ebx
movl $0x0, 0x4(%rsp)
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x98(%rsp), %r9
movq 0x18(%rsp), %rax
movq (%rax), %rcx
movl 0x180(%rsp), %eax
subq $0x8, %rsp
movq 0xa8(%rsp), %rdi
movq %r12, %rsi
movq 0xf8(%rsp), %rdx
movq %r13, %r8
pushq $0x1
leaq 0x1b0(%rsp), %r10
pushq %r10
leaq 0x1c(%rsp), %r10
pushq %r10
pushq %rax
pushq 0x1b8(%rsp)
pushq %rbx
movl 0x228(%rsp), %eax
pushq %rax
callq 0x1072ad
addq $0x40, %rsp
testl %eax, %eax
je 0x101c0a
movq 0x148(%rsp), %rax
cmpq %rax, %r15
movq 0x70(%rsp), %rdi
jne 0x101bd7
movq %rbx, %r13
movq %r15, %rbx
leaq (%rax,%rax), %r15
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r15
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %rsi
callq 0x2370
movq %rax, %rdi
movq %r15, 0x148(%rsp)
movq %rbx, %r15
movq %r13, %rbx
movq 0x48(%rsp), %r13
movq 0x98(%rsp), %r9
incq %r15
movq 0x1b0(%rsp), %rax
movq %rax, 0x10(%rdi,%r14)
movups 0x1a0(%rsp), %xmm0
movq %rdi, 0x70(%rsp)
movups %xmm0, (%rdi,%r14)
addq $0x18, %r14
jmp 0x101b2a
movq 0xa0(%rsp), %rdi
movq %r13, %rsi
movq 0x70(%rsp), %rdx
movl %r15d, %ecx
callq 0xf48e8
testq %r15, %r15
je 0x101d87
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x70(%rsp), %rsi
leaq (%rax,%rax,2), %rdx
movups (%rsi,%rdx,8), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x10(%rsi,%rdx,8), %rdx
movq %rdx, 0x30(%rsp)
movl 0x2c(%rsp), %edx
notl %edx
shrl $0x1f, %edx
addl %edx, %ecx
incl %eax
cmpq %rax, %r15
ja 0x101c34
movl %eax, 0x4(%rsp)
cmpl $0x1, %ecx
movq 0x18(%rsp), %r14
movq 0x50(%rsp), %rax
movq 0x8(%rsp), %r11
movq 0x60(%rsp), %rdi
jne 0x101da8
movq %r15, 0x40(%rsp)
movl $0x0, 0x4(%rsp)
cmpq $0x0, 0x150(%rsp)
movq 0x68(%rsp), %rdx
je 0x101db7
leaq (%rdx,%rdx), %rbx
leaq (,%rdx,8), %rax
leaq (%rax,%rax,2), %r15
xorl %r8d, %r8d
movq %rdx, %r9
movq 0x70(%rsp), %rdi
movq 0x108(%rsp), %r14
cmpq %r14, %r9
jne 0x101d08
testq %r9, %r9
movq %rbx, %r14
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %rsi
movq 0x78(%rsp), %rdi
movq %r9, 0xc0(%rsp)
callq 0x2370
movq 0xc0(%rsp), %r9
movq 0x70(%rsp), %rdi
movl 0x4(%rsp), %r8d
jmp 0x101d0d
movq 0x78(%rsp), %rax
movq 0x160(%rsp), %rcx
movl %r8d, %edx
leaq (%rdx,%rdx,2), %rdx
incq %r9
movq 0x10(%rcx,%rdx,8), %rsi
movq %rsi, 0x10(%rax,%r15)
movups (%rcx,%rdx,8), %xmm0
movq %rax, 0x78(%rsp)
movups %xmm0, (%rax,%r15)
incl %r8d
movl %r8d, 0x4(%rsp)
addq $0x2, %rbx
addq $0x18, %r15
cmpq %r8, 0x150(%rsp)
ja 0x101cc2
movl $0x0, 0x4(%rsp)
cmpq $0x0, 0x40(%rsp)
movq 0x18(%rsp), %r15
movq 0x68(%rsp), %rdx
jne 0x101dca
jmp 0x101e60
movq 0x68(%rsp), %rdx
movq 0x48(%rsp), %r13
jmp 0x101d94
movq 0x68(%rsp), %rdx
jmp 0x101d99
movl $0x0, 0x4(%rsp)
movq 0x68(%rsp), %rdx
movq 0x18(%rsp), %r14
movq 0x8(%rsp), %r11
movq 0x60(%rsp), %rdi
jmp 0x1018c5
movq %rax, 0x50(%rsp)
movq 0x68(%rsp), %rdx
jmp 0x1018c5
movq %r14, %r15
movq %rdx, %r9
movq 0x70(%rsp), %rdi
movq 0x108(%rsp), %r14
xorl %esi, %esi
leaq (%rsi,%rsi,2), %rcx
movups (%rdi,%rcx,8), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x10(%rdi,%rcx,8), %rcx
movq %rcx, 0x30(%rsp)
cmpl $0x0, 0x2c(%rsp)
js 0x101e4f
cmpq %r14, %r9
jne 0x101e26
leaq (%r9,%r9), %r14
testq %r9, %r9
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %rsi
movq 0x78(%rsp), %rdi
movq %r9, %rbx
callq 0x2370
movq %rbx, %r9
movq 0x70(%rsp), %rdi
movl 0x4(%rsp), %esi
jmp 0x101e2b
movq 0x78(%rsp), %rax
leaq (%r9,%r9,2), %rcx
incq %r9
movq 0x30(%rsp), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movaps 0x20(%rsp), %xmm0
movq %rax, 0x78(%rsp)
movups %xmm0, (%rax,%rcx,8)
movq 0x68(%rsp), %rdx
incl %esi
movl %esi, 0x4(%rsp)
cmpq %rsi, 0x40(%rsp)
ja 0x101dcc
movq %r14, 0x108(%rsp)
leaq (%rdx,%rdx,2), %rax
movq 0x78(%rsp), %rcx
leaq (%rcx,%rax,8), %rsi
movq %r9, 0xc0(%rsp)
movq %r9, %r14
subq %rdx, %r14
movq %r12, %rdi
movq %rdx, %rbx
movl %r14d, %edx
callq 0x100fa6
testl %eax, %eax
je 0x10220c
movq %r14, 0x120(%rsp)
movl $0x0, 0x4(%rsp)
movq 0x40(%rsp), %rbx
testq %rbx, %rbx
movq 0x50(%rsp), %rdx
movq 0x8(%rsp), %rdi
je 0x102221
movq 0x60(%rsp), %rax
movl %eax, %r15d
xorl $0x1, %r15d
shlq $0x20, %rax
movq %rax, 0xb8(%rsp)
xorl %r14d, %r14d
movq 0x88(%rsp), %rsi
movl %r15d, 0xe8(%rsp)
leaq (%r14,%r14,2), %rax
movq 0x70(%rsp), %rcx
movups (%rcx,%rax,8), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x10(%rcx,%rax,8), %rax
movq %rax, 0x30(%rsp)
cmpl $0x0, 0x2c(%rsp)
js 0x1021f9
movq %rsi, 0x88(%rsp)
movq %rdi, 0x8(%rsp)
movl 0x28(%rsp), %edx
movq 0xa0(%rsp), %rdi
movq %r13, %rsi
callq 0xf488a
cmpl $-0x1, %eax
je 0x101f87
movq 0x138(%rsp), %r13
movq 0x110(%rsp), %rbx
cmpq %rbx, %r13
movl %eax, 0x90(%rsp)
jne 0x101f9e
leaq (,%r13,2), %rbx
testq %r13, %r13
movl $0x2, %eax
cmoveq %rax, %rbx
leaq (,%rbx,8), %rax
leaq (%rax,%rax,2), %rsi
movq 0xe0(%rsp), %rdi
callq 0x2370
movq %rax, %r15
jmp 0x101fa6
movq 0x50(%rsp), %rdx
movq 0x8(%rsp), %rdi
movq 0x88(%rsp), %rsi
jmp 0x1021f9
movq 0xe0(%rsp), %r15
leaq 0x1(%r13), %r14
leaq (,%r13,2), %rax
addq %r13, %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%r15,%rax,8)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%r15,%rax,8)
movq 0x18(%rsp), %rax
movq (%rax), %rsi
movl 0x24(%rsp), %eax
movl 0x28(%rsp), %r9d
xorl $0x1, %r9d
xorl $0x1, %eax
movq 0xf0(%rsp), %rdi
movq 0x98(%rsp), %rcx
movl 0x1f0(%rsp), %r8d
leaq 0x20(%rsp), %rdx
pushq %rdx
pushq %rax
callq 0xb3df3
addq $0x10, %rsp
cmpq %rbx, %r14
jne 0x10203f
leaq (%rbx,%rbx), %r13
testq %rbx, %rbx
movl $0x2, %eax
cmoveq %rax, %r13
leaq (,%r13,8), %rax
leaq (%rax,%rax,2), %rsi
movq %r15, %rdi
callq 0x2370
movq %rax, %r15
movq %r13, 0x110(%rsp)
jmp 0x102047
movq %rbx, 0x110(%rsp)
movq 0x140(%rsp), %rdx
leaq (%r14,%r14,2), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%r15,%rax,8)
movaps 0x20(%rsp), %xmm0
movq %r15, 0xe0(%rsp)
movups %xmm0, (%r15,%rax,8)
movq 0xa0(%rsp), %r14
movq 0x10(%r14), %rax
movl (%rax,%rdx,8), %edx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %edx
movq 0x58(%rsp), %r15
movq %r15, %rdi
movq 0x60(%rsp), %rsi
movl 0x90(%rsp), %ebx
movl %ebx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %r13d, %r13d
pushq %r13
pushq %r13
callq 0xeaa02
addq $0x10, %rsp
movl %ebx, %esi
xorl $0x1, %esi
movq 0x10(%r14), %rax
movl %ebx, %ecx
shrl %ecx
leaq (%rcx,%rcx,4), %rcx
movl (%rax,%rcx,8), %edx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %edx
movq %r15, %rdi
movq %rsi, %r15
movl 0xe8(%rsp), %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %r13
pushq %r13
callq 0xeaa02
addq $0x10, %rsp
movq 0xb8(%rsp), %rax
movq %rax, 0x20(%rsp)
movl %ebx, 0x28(%rsp)
movq 0xb0(%rsp), %rdx
movq 0x88(%rsp), %rsi
cmpq %rdx, %rsi
jne 0x102148
leaq (%rsi,%rsi), %r14
testq %rsi, %rsi
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %rsi
movq 0x8(%rsp), %rdi
callq 0x2370
movq 0x88(%rsp), %rsi
movq %r14, %rdx
movq %rax, %rdi
jmp 0x10214d
movq 0x8(%rsp), %rdi
movq 0x40(%rsp), %rbx
leaq 0x1(%rsi), %r14
leaq (%rsi,%rsi,2), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rdi,%rax,8)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rdi,%rax,8)
shlq $0x20, %r15
movq %r15, 0x20(%rsp)
movl 0xe8(%rsp), %r15d
movl %r15d, 0x28(%rsp)
cmpq %rdx, %r14
jne 0x1021be
leaq (%rdx,%rdx), %r13
testq %rdx, %rdx
movl $0x2, %eax
cmoveq %rax, %r13
leaq (,%r13,8), %rax
leaq (%rax,%rax,2), %rsi
callq 0x2370
movq 0x88(%rsp), %rsi
movq %rax, %rdi
movq %r13, 0xb0(%rsp)
jmp 0x1021c6
movq %rdx, 0xb0(%rsp)
movq 0x48(%rsp), %r13
movq 0x50(%rsp), %rdx
addq $0x2, 0x138(%rsp)
addq $0x2, %rsi
leaq (%r14,%r14,2), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rdi,%rax,8)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rdi,%rax,8)
movl 0x4(%rsp), %r14d
incl %r14d
movl %r14d, 0x4(%rsp)
cmpq %r14, %rbx
ja 0x101eec
jmp 0x102229
movq %rbx, %rdx
movq 0x8(%rsp), %r11
movq 0x60(%rsp), %rdi
movq %r15, %r14
jmp 0x1018c5
movq 0x88(%rsp), %rsi
movq 0x80(%rsp), %r15
cmpq 0x128(%rsp), %r15
movq %rdi, 0x8(%rsp)
movq %rsi, 0x88(%rsp)
jne 0x102273
leaq (%r15,%r15), %rcx
testq %r15, %r15
movl $0x2, %eax
cmoveq %rax, %rcx
movq %rcx, 0x128(%rsp)
leaq (,%rcx,8), %rsi
movq %rdx, %rdi
callq 0x2370
movq %rax, %rdx
movq 0x18(%rsp), %rbx
movq 0x100(%rsp), %r14
movq 0x60(%rsp), %rdi
movq %rdi, (%rdx,%r15,8)
cmpq 0x130(%rsp), %r14
movq %rdx, 0x50(%rsp)
jne 0x1022cc
leaq (%r14,%r14), %rcx
testq %r14, %r14
movl $0x2, %eax
cmoveq %rax, %rcx
movq %rcx, 0x130(%rsp)
leaq (,%rcx,8), %rsi
movq 0xc8(%rsp), %rdi
callq 0x2370
movq 0x60(%rsp), %rdi
jmp 0x1022d4
movq 0xc8(%rsp), %rax
movq 0x8(%rsp), %r11
movq 0x68(%rsp), %rcx
movq 0xc0(%rsp), %rdx
incq 0x80(%rsp)
shlq $0x20, %rcx
movq 0x120(%rsp), %rsi
orq %rcx, %rsi
movq %rax, 0xc8(%rsp)
movq %rsi, (%rax,%r14,8)
incq %r14
movq %r14, 0x100(%rsp)
movq %rbx, %r14
jmp 0x1018c5
movl 0xd0(%rsp), %eax
movl %eax, 0x2c(%rsp)
movl 0xac(%rsp), %eax
movw %ax, 0x30(%rsp)
movb 0x17(%rsp), %al
movb %al, 0x32(%rsp)
movq 0x60(%rsp), %rdi
movq 0x118(%rsp), %r8
jmp 0x101920
movq %r11, 0x8(%rsp)
movq 0x58(%rsp), %rbp
movl 0x14(%rbp), %edi
movq 0xe0(%rsp), %r15
movq 0x88(%rsp), %r14
jmp 0x102412
movq $0x0, 0xb0(%rsp)
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
xorl %r15d, %r15d
movq $0x0, 0x78(%rsp)
movq $0x0, 0x70(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0xc8(%rsp)
jmp 0x102412
movq $0x0, 0x8(%rsp)
movq $0x0, 0xb0(%rsp)
xorl %r14d, %r14d
xorl %r15d, %r15d
movq $0x0, 0x78(%rsp)
movq $0x0, 0x70(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0xc8(%rsp)
movq 0x58(%rsp), %rbp
addl %edi, %edi
movl $0x1, %esi
callq 0x2120
movq %rax, 0x30(%rbp)
movq %rbp, %rdi
callq 0xa0a7d
xorl %ebx, %ebx
movq %rbp, %rdi
movq 0x208(%rsp), %rsi
xorl %edx, %edx
callq 0xa7e08
movl $0x0, 0x4(%rsp)
testq %r14, %r14
movq 0x8(%rsp), %r10
movq %r14, %r11
movq 0x18(%rsp), %r14
je 0x102566
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq (%rbx,%rbx,2), %rdx
movq (%r10,%rdx,8), %rcx
movq 0x20(%rbp), %rsi
movq %rcx, %rdi
shrq $0x21, %rdi
cmpl $0x0, (%rsi,%rdi,8)
js 0x102557
movl 0x8(%r10,%rdx,8), %edx
movl %edx, %edi
shrl %edi
cmpl $0x0, (%rsi,%rdi,8)
js 0x102557
shrq $0x20, %rcx
movq 0x30(%rbp), %rsi
cmpb $0x0, (%rsi,%rcx)
je 0x1024b0
movq %rdx, %rdi
xorq $0x1, %rdi
cmpb $0x0, (%rsi,%rdi)
jne 0x102557
movq 0x8(%rbp), %rsi
movq 0x28(%rbp), %rdi
movq (%rdi,%rcx,8), %r8
movq %r8, %r9
andq %rax, %r9
je 0x1024fd
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 0x1024ec
orb $-0x80, 0x3(%rsi,%r8)
addq $0x18, %r8
cmpq %r8, %rdi
jne 0x1024df
movq 0x8(%rbp), %rsi
movq 0x28(%rbp), %rdi
xorl $0x1, %edx
movq (%rdi,%rdx,8), %rdi
movq %rdi, %rdx
andq %rax, %rdx
je 0x102542
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 0x102539
orb $-0x80, 0x3(%rsi,%rdi)
addq $0x18, %rdi
cmpq %rdi, %rdx
jne 0x102526
movl 0x4(%rsp), %ecx
leaq (%rcx,%rcx,2), %rcx
orl $0x80000000, 0xc(%r15,%rcx,8) # imm = 0x80000000
movl 0x4(%rsp), %ebx
incl %ebx
movl %ebx, 0x4(%rsp)
cmpq %rbx, %r11
ja 0x102461
movq %r15, 0xe0(%rsp)
movq 0x30(%rbp), %rdi
callq 0x2220
movq $0x0, 0x30(%rbp)
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
andl 0x14(%r12), %ebp
movl $0x0, 0x4(%rsp)
movq 0x80(%rsp), %r9
testq %r9, %r9
je 0x102a39
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
xorl %eax, %eax
xorl %ebx, %ebx
xorl %edx, %edx
movq 0x50(%rsp), %r11
movq (%r11,%rax,8), %r8
movl %r8d, %ecx
movq 0x28(%r12), %rsi
movq (%rsi,%rcx,8), %rcx
movq %rcx, %rsi
andq %r15, %rsi
je 0x10263b
movq 0x8(%r12), %rdi
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdi,%rcx,8), %rcx
addq $0xc, %rcx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
xorl %r9d, %r9d
movl (%rcx,%rdi), %r10d
notl %r10d
shrl $0x1f, %r10d
addl %r10d, %r9d
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0x1025ed
testl %r9d, %r9d
je 0x102633
movq 0xc8(%rsp), %rcx
movq (%rcx,%rax,8), %r13
movl %r13d, %r15d
cmpq $0x2, %r15
movq 0x80(%rsp), %r9
jae 0x102655
movq 0x48(%rsp), %r13
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x10263b
movq 0x80(%rsp), %r9
movl 0x4(%rsp), %eax
incl %eax
movl %eax, 0x4(%rsp)
movl %eax, %edx
cmpq %rax, %r9
ja 0x1025b3
jmp 0x10297e
movq %r13, %rax
shrq $0x20, %rax
leaq (%rax,%rax,2), %rax
movq 0x78(%rsp), %rcx
leaq (%rcx,%rax,8), %r14
movq 0x192970(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
movl %r8d, %ecx
shrl %ecx
andl $0x1, %r8d
leaq 0x136808(%rip), %rsi    # 0x238e8b
xorl %eax, %eax
callq 0x22b0
movq %r12, %rdi
movq %r14, 0x58(%rsp)
movq %r14, %rsi
movl %r13d, %edx
callq 0x1010b5
testl %eax, %eax
je 0x10274c
movq 0x58(%rsp), %r13
movq (%r13), %r14
movl 0x14(%r12), %eax
leal -0x2(,%rax,2), %esi
movq 0x20(%r12), %rax
movq %r14, %rcx
shrq $0x21, %rcx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %r14, %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
andq %rdx, %rcx
orq %rax, %rcx
movq %rcx, 0x20(%rsp)
movl %esi, 0x28(%rsp)
movl $0x0, 0x2c(%rsp)
movb $0x0, 0x32(%rsp)
andb $0x3f, 0x31(%rsp)
movq 0xb0(%rsp), %rdx
cmpq %rdx, %rbx
jne 0x10276e
leaq (%rbx,%rbx), %r13
testq %rbx, %rbx
movl $0x2, %eax
cmoveq %rax, %r13
leaq (,%r13,8), %rax
movq %rsi, 0x98(%rsp)
leaq (%rax,%rax,2), %rsi
movq 0x8(%rsp), %rdi
callq 0x2370
movq 0x98(%rsp), %rsi
movq %r13, %rdx
movq 0x58(%rsp), %r13
movq %rax, %rdi
jmp 0x102773
movq 0x48(%rsp), %r13
movq 0x50(%rsp), %r11
movq 0x80(%rsp), %r9
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq 0x18(%rsp), %r14
jmp 0x10263b
movq 0x8(%rsp), %rdi
shrq $0x20, %r14
leaq 0x1(%rbx), %r8
leaq (%rbx,%rbx,2), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rdi,%rax,8)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rdi,%rax,8)
movl %esi, %eax
orl $0x1, %eax
xorl $0x1, %r14d
movq 0x20(%r12), %rcx
shrl %esi
movl (%rcx,%rsi,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
shlq $0x20, %rax
orq %rcx, %rax
movq %rax, 0x20(%rsp)
movl %r14d, 0x28(%rsp)
movl $0x0, 0x2c(%rsp)
movb $0x0, 0x32(%rsp)
andb $0x3f, 0x31(%rsp)
cmpq %rdx, %r8
jne 0x102804
leaq (%rdx,%rdx), %r14
testq %rdx, %rdx
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %rsi
movq %r8, 0x58(%rsp)
callq 0x2370
movq 0x58(%rsp), %r8
movq %rax, %rdi
movq %r14, %rdx
leaq 0x2(%rbx), %rsi
leaq (%r8,%r8,2), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rdi,%rax,8)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rdi,%rax,8)
movl 0x14(%r12), %eax
leal -0x2(%rax,%rax), %r14d
leaq (%r15,%r15,2), %rax
movl -0x10(%r13,%rax,8), %r15d
movq 0x20(%r12), %rax
movl %r14d, %ecx
shrl %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %r14, %rcx
shlq $0x20, %rcx
orq %rax, %rcx
movq %rcx, 0x20(%rsp)
movl %r15d, 0x28(%rsp)
movl $0x0, 0x2c(%rsp)
movb $0x0, 0x32(%rsp)
andb $0x3f, 0x31(%rsp)
cmpq %rdx, %rsi
jne 0x1028a0
leaq (%rdx,%rdx), %r13
testq %rdx, %rdx
movl $0x2, %eax
cmoveq %rax, %r13
leaq (,%r13,8), %rax
movq %rsi, 0x58(%rsp)
leaq (%rax,%rax,2), %rsi
callq 0x2370
movq 0x58(%rsp), %rsi
movq %rax, %rdi
movq %r13, %rdx
leaq 0x3(%rbx), %r13
leaq (%rsi,%rsi,2), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rdi,%rax,8)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rdi,%rax,8)
movl %r15d, %eax
xorl $0x1, %eax
orl $0x1, %r14d
movq 0x20(%r12), %rcx
shrl %r15d
movl (%rcx,%r15,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
shlq $0x20, %rax
orq %rcx, %rax
movq %rax, 0x20(%rsp)
movl %r14d, 0x28(%rsp)
movl $0x0, 0x2c(%rsp)
movb $0x0, 0x32(%rsp)
andb $0x3f, 0x31(%rsp)
cmpq %rdx, %r13
jne 0x10292d
leaq (%rdx,%rdx), %r14
testq %rdx, %rdx
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %rsi
callq 0x2370
movq %rax, %rdi
movq %r14, 0xb0(%rsp)
jmp 0x102935
movq %rdx, 0xb0(%rsp)
movq 0x18(%rsp), %r14
movq 0x50(%rsp), %r11
movq 0x80(%rsp), %r9
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
addq $0x4, %rbx
leaq (,%r13,2), %rax
addq %r13, %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rdi,%rax,8)
movaps 0x20(%rsp), %xmm0
movq %rdi, 0x8(%rsp)
movups %xmm0, (%rdi,%rax,8)
movq 0x48(%rsp), %r13
jmp 0x10263b
movl $0x0, 0x4(%rsp)
testq %rbx, %rbx
je 0x102a39
xorl %ecx, %ecx
movl $0x10, %r14d
movq 0x8(%rsp), %r8
movl 0x4(%r12), %esi
movl %esi, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmpl (%r12), %edx
jne 0x1029eb
leal (%rdx,%rdx), %eax
testl %edx, %edx
cmovel %r14d, %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 0x1029f0
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, %rbx
ja 0x10299c
movq 0x18(%rsp), %r14
movq 0x28(%r12), %rdi
callq 0x2220
movq $0x0, 0x28(%r12)
andb $0x7f, 0x7(%r12)
movq %r12, %rdi
callq 0xa0a7d
movl 0x14(%r12), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl %ebp, %eax
jbe 0x102b4b
movq (%r14), %rdi
shlq $0x2, %rax
leaq (%rax,%rax,2), %rsi
callq 0x2370
movq %rax, (%r14)
leaq 0x1937aa(%rip), %rbx    # 0x296230
movq 0x28(%rbx), %rdi
movl 0x14(%r12), %esi
movl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
andq %r14, %rsi
callq 0x2370
movq %rax, 0x28(%rbx)
movq 0x8(%r13), %rdi
movl 0x14(%r12), %esi
andq %r14, %rsi
shlq $0x2, %rsi
callq 0x2370
movq %rax, 0x8(%r13)
movl 0x14(%r12), %ecx
andq %r14, %rcx
movq %rcx, (%r13)
movl %ebp, 0x4(%rsp)
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl 0x14(%r12), %edx
andl %eax, %edx
cmpl %edx, %ebp
jae 0x102b4f
xorl %ecx, %ecx
movq 0x18(%rsp), %r8
movq 0x8(%r13), %rdx
movl %ebp, %esi
movl $0xffffffff, (%rdx,%rsi,4) # imm = 0xFFFFFFFF
movq 0x28(%rbx), %rdx
movl 0x4(%rsp), %esi
movb %cl, (%rdx,%rsi)
movq (%r8), %rdx
movl 0x4(%rsp), %esi
leaq (%rsi,%rsi,2), %rsi
andl %eax, (%rdx,%rsi,4)
movq (%r8), %rdx
movl 0x4(%rsp), %esi
leaq (%rsi,%rsi,2), %rsi
movb %cl, 0x8(%rdx,%rsi,4)
andl $0x80000000, (%rdx,%rsi,4) # imm = 0x80000000
movq 0x20(%r12), %rdx
movl 0x4(%rsp), %esi
movl (%rdx,%rsi,8), %edx
andl %eax, %edx
movq (%r8), %rdi
leaq (%rsi,%rsi,2), %rsi
movl %edx, 0x4(%rdi,%rsi,4)
movl 0x4(%rsp), %ebp
incl %ebp
movl %ebp, 0x4(%rsp)
movl 0x14(%r12), %edx
andl %eax, %edx
cmpl %edx, %ebp
jb 0x102ae1
movq (%r13), %rcx
testq %rcx, %rcx
movq 0xc8(%rsp), %rbx
movq 0xe0(%rsp), %r14
movq 0x78(%rsp), %r15
je 0x102b86
movq 0x8(%r13), %rax
xorl %edx, %edx
cmpl $-0x2, (%rax,%rdx,4)
jg 0x102b7c
movl $0xffffffff, (%rax,%rdx,4) # imm = 0xFFFFFFFF
incq %rdx
movl %edx, %esi
cmpq %rsi, %rcx
ja 0x102b6f
movq 0xa0(%rsp), %rdi
callq 0xa0761
movq 0x8(%rsp), %rdi
callq 0x2220
movq %r15, %rdi
callq 0x2220
movq %r14, %rdi
callq 0x2220
movq 0x70(%rsp), %rdi
callq 0x2220
movq 0x50(%rsp), %rdi
callq 0x2220
movq 0x190(%rsp), %rdi
callq 0x2220
movq 0x160(%rsp), %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x2220
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq