// File: 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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movq 0x28(%rbp), %rax
movl 0x20(%rbp), %eax
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movq %r8, -0x50(%rbp)
movl %r9d, -0x54(%rbp)
movq $0x0, -0xb0(%rbp)
movq $0x0, -0xb8(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0xd0(%rbp)
movl $0xffffffff, -0xc8(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0xe8(%rbp)
movl $0xffffffff, -0xe0(%rbp) # imm = 0xFFFFFFFF
movq $0x0, -0x108(%rbp)
movq $0x0, -0x110(%rbp)
movq $0x0, -0x118(%rbp)
movq $0x0, -0x120(%rbp)
movq $0x0, -0x128(%rbp)
movq $0x0, -0x130(%rbp)
movq $0x0, -0x148(%rbp)
movq $0x0, -0x150(%rbp)
movq $0x0, -0x140(%rbp)
movq $0x0, -0x160(%rbp)
movq $0x0, -0x168(%rbp)
movq $0x0, -0x158(%rbp)
movq $0x0, -0x178(%rbp)
movq $0x0, -0x180(%rbp)
movq $0x0, -0x170(%rbp)
movq $0x0, -0x190(%rbp)
movq $0x0, -0x198(%rbp)
movq $0x0, -0x188(%rbp)
movq $0x0, -0x1b0(%rbp)
movq $0x0, -0x1b8(%rbp)
movq $0x0, -0x1a8(%rbp)
movq $0x0, -0x1d0(%rbp)
movq $0x0, -0x1d8(%rbp)
movq $0x0, -0x1c8(%rbp)
movq $0x0, -0x1f0(%rbp)
movq $0x0, -0x1f8(%rbp)
movq $0x0, -0x1e8(%rbp)
movq $0x0, -0x210(%rbp)
movq $0x0, -0x218(%rbp)
movq $0x0, -0x208(%rbp)
movq -0x30(%rbp), %rdi
callq 0xe5910
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xb0(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0xb0(%rbp), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x1600b0
movl -0x5c(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x120(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x6c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x16000e
jmp 0x1600a2
movq -0xb0(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x5c(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x160029
jmp 0x1600a2
movq -0xb0(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x5c(%rbp), %ecx
movb $0x0, 0x4(%rax,%rcx,8)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq -0xb8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x1600a0
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x60(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movl %eax, -0x70(%rbp)
movq -0x50(%rbp), %rdi
movl -0x70(%rbp), %esi
movl -0x6c(%rbp), %edx
movq -0x30(%rbp), %rax
movq 0x20(%rax), %r8
movl -0x70(%rbp), %eax
shlq $0x3, %rax
addq %rax, %r8
addq $0x4, %r8
movl $0x1, %ecx
callq 0xd0e20
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x160043
jmp 0x1600a2
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x15ffbf
movq -0xb0(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movl %eax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x58(%rbp), %eax
jae 0x160fda
movl -0x5c(%rbp), %eax
shrl %eax
movl %eax, -0x6c(%rbp)
movq -0xb0(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x6c(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1600fd
jmp 0x160fcc
movq -0x120(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x6c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x16012b
jmp 0x160fcc
movq -0xb8(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x160156
movq -0xb8(%rbp), %rax
cmpl $-0x1, 0x4(%rax)
je 0x160156
movq -0xb8(%rbp), %rax
cmpl $-0x1, 0x8(%rax)
jne 0x16015b
jmp 0x160fcc
movq -0xb0(%rbp), %rdi
movl -0x5c(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x0, %eax
je 0x160178
jmp 0x160fcc
movl -0x5c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x160195
movq -0xb8(%rbp), %rax
movl 0x4(%rax), %eax
xorl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x1601a5
movq -0xb8(%rbp), %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, -0x74(%rbp)
movq -0x38(%rbp), %rax
movl -0x74(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x118(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq -0x118(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x160305
movq -0x118(%rbp), %rax
movq (%rax), %rax
movl -0x60(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x108(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq -0x108(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
movl %ecx, %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x128(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq -0x108(%rbp), %rcx
movl 0xc(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x130(%rbp)
movq -0x128(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x16026d
movq -0x130(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x16026d
movq -0x108(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x3f, %rax
cmpl $0x0, %eax
je 0x160272
jmp 0x1602f7
movq -0x108(%rbp), %rdi
movq -0x128(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x128(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %esi
movq -0x130(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x130(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %edx
movl -0x54(%rbp), %ecx
leaq 0x264541(%rip), %rax    # 0x3c47f8
movss 0x158(%rax), %xmm0
movl 0x10(%rbp), %r8d
leaq -0xd0(%rbp), %r9
callq 0xd0300
movl %eax, -0x134(%rbp)
cmpl $0x0, -0x134(%rbp)
jge 0x1602e0
jmp 0x1602f7
movq -0xd0(%rbp), %rax
shrq $0x20, %rax
movl -0x74(%rbp), %ecx
cmpq %rcx, %rax
je 0x1602f5
jmp 0x1602f7
jmp 0x160305
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x1601c5
movl -0x60(%rbp), %eax
movq -0x118(%rbp), %rcx
cmpl 0xc(%rcx), %eax
je 0x160319
jmp 0x160fcc
movq -0x40(%rbp), %rax
movl -0x74(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x118(%rbp)
movl $0x0, -0x7c(%rbp)
movl $0x0, -0x80(%rbp)
movl $0xffffffff, -0x84(%rbp) # imm = 0xFFFFFFFF
movq $0x0, -0x110(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq -0x118(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x1604f8
movq -0x118(%rbp), %rax
movq (%rax), %rax
movl -0x60(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rax
movq (%rax), %rcx
movq -0x50(%rbp), %r8
movq -0x120(%rbp), %r9
movq -0x30(%rbp), %rax
movl -0x54(%rbp), %r10d
movl %r10d, -0x240(%rbp)
movl 0x10(%rbp), %r13d
movl -0x74(%rbp), %r12d
movl -0x6c(%rbp), %r15d
movl 0x20(%rbp), %r10d
movl %r10d, -0x23c(%rbp)
leaq -0x1f8(%rbp), %r14
xorl %r10d, %r10d
leaq -0x88(%rbp), %rbx
leaq -0x90(%rbp), %r11
leaq -0x8c(%rbp), %r10
movq %rax, (%rsp)
movl -0x240(%rbp), %eax
movl %eax, 0x8(%rsp)
movl -0x23c(%rbp), %eax
movl %r13d, 0x10(%rsp)
movl %r12d, 0x18(%rsp)
movl %r15d, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movq %rbx, 0x38(%rsp)
movq %r11, 0x40(%rsp)
movq %r10, 0x48(%rsp)
movl %eax, 0x50(%rsp)
callq 0x15e9e0
cmpl $0x0, %eax
je 0x1604e8
movl $0x0, -0x94(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jae 0x160466
movl $0x1, -0x94(%rbp)
jmp 0x1604b1
movl -0x8c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jne 0x1604af
movl -0x88(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jbe 0x16048b
movl $0x1, -0x94(%rbp)
jmp 0x1604ad
movl -0x88(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jne 0x1604ab
movl -0x90(%rbp), %eax
cmpl -0x80(%rbp), %eax
jbe 0x1604ab
movl $0x1, -0x94(%rbp)
jmp 0x1604ad
jmp 0x1604af
jmp 0x1604b1
cmpl $0x0, -0x94(%rbp)
je 0x1604e6
movl -0x8c(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x88(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x90(%rbp), %eax
movl %eax, -0x80(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0x110(%rbp)
jmp 0x1604e8
jmp 0x1604ea
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x16035c
cmpl $0x0, -0x7c(%rbp)
jbe 0x160fca
movq -0x110(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rax
movq (%rax), %rcx
movq -0x50(%rbp), %r8
movq -0x120(%rbp), %r9
movq -0x30(%rbp), %rax
movl -0x54(%rbp), %r10d
movl %r10d, -0x24c(%rbp)
movl 0x10(%rbp), %r10d
movl %r10d, -0x248(%rbp)
movl -0x74(%rbp), %r13d
movl -0x6c(%rbp), %r12d
movl 0x20(%rbp), %r10d
movl %r10d, -0x244(%rbp)
leaq -0x1f8(%rbp), %r15
leaq -0x218(%rbp), %r14
leaq -0x88(%rbp), %rbx
leaq -0x90(%rbp), %r11
leaq -0x8c(%rbp), %r10
movq %rax, (%rsp)
movl -0x24c(%rbp), %eax
movl %eax, 0x8(%rsp)
movl -0x248(%rbp), %eax
movl %eax, 0x10(%rsp)
movl -0x244(%rbp), %eax
movl %r13d, 0x18(%rsp)
movl %r12d, 0x20(%rsp)
movq %r15, 0x28(%rsp)
movq %r14, 0x30(%rsp)
movq %rbx, 0x38(%rsp)
movq %r11, 0x40(%rsp)
movq %r10, 0x48(%rsp)
movl %eax, 0x50(%rsp)
callq 0x15e9e0
cmpq $0x1, -0x218(%rbp)
jae 0x1605cc
jmp 0x160fcc
movq -0x208(%rbp), %rax
movq -0x218(%rbp), %rcx
subq $0x1, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xe8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xe0(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0xd8(%rbp)
movl $0x0, -0x60(%rbp)
movq $0x0, -0x198(%rbp)
movq -0x120(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rax
movq (%rax), %rcx
movq -0x50(%rbp), %r8
movl -0x54(%rbp), %r9d
movl 0x10(%rbp), %r15d
movl -0xe0(%rbp), %r14d
movq -0x1e8(%rbp), %rbx
movq -0x1f8(%rbp), %rax
movl %eax, %r11d
leaq -0x60(%rbp), %r10
leaq -0x100(%rbp), %rax
movl %r15d, (%rsp)
movl %r14d, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movl %r11d, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movl $0x1, 0x30(%rsp)
callq 0x169940
cmpl $0x0, %eax
je 0x16073d
jmp 0x160691
movq -0x198(%rbp), %rax
cmpq -0x190(%rbp), %rax
jne 0x1606f5
cmpq $0x0, -0x190(%rbp)
je 0x1606be
movq -0x190(%rbp), %rax
shlq %rax
movq %rax, -0x258(%rbp)
jmp 0x1606cc
movl $0x2, %eax
movq %rax, -0x258(%rbp)
jmp 0x1606cc
movq -0x258(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x188(%rbp), %rdi
imulq $0x18, -0x190(%rbp), %rsi
callq 0x2360
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rax
movq -0x198(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x198(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x100(%rbp), %rcx
movq %rcx, (%rax)
movq -0xf8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xf0(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x160617
movq -0x120(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x188(%rbp), %rdx
movq -0x198(%rbp), %rax
movl %eax, %ecx
callq 0x1516a0
movl $0x0, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
movl -0x60(%rbp), %eax
cmpq -0x198(%rbp), %rax
jae 0x1607cc
movq -0x188(%rbp), %rax
movl -0x60(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0xc0(%rbp)
movl -0xc4(%rbp), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1607b8
jmp 0x1607c1
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x16076b
cmpl $0x1, -0x64(%rbp)
je 0x1607d7
jmp 0x160fcc
movq -0x180(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpq -0x218(%rbp), %rax
jae 0x1608bc
jmp 0x1607fe
movq -0x180(%rbp), %rax
cmpq -0x178(%rbp), %rax
jne 0x160862
cmpq $0x0, -0x178(%rbp)
je 0x16082b
movq -0x178(%rbp), %rax
shlq %rax
movq %rax, -0x260(%rbp)
jmp 0x160839
movl $0x2, %eax
movq %rax, -0x260(%rbp)
jmp 0x160839
movq -0x260(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x170(%rbp), %rdi
imulq $0x18, -0x178(%rbp), %rsi
callq 0x2360
movq %rax, -0x170(%rbp)
movq -0x208(%rbp), %rcx
movl -0x60(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq -0x170(%rbp), %rax
movq -0x180(%rbp), %rdx
movq %rdx, %rsi
addq $0x1, %rsi
movq %rsi, -0x180(%rbp)
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
jmp 0x1608ae
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x1607ec
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpq -0x198(%rbp), %rax
jae 0x1609d0
movq -0x188(%rbp), %rax
movl -0x60(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0xc0(%rbp)
movl -0xc4(%rbp), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x160917
jmp 0x1609c2
jmp 0x160919
movq -0x180(%rbp), %rax
cmpq -0x178(%rbp), %rax
jne 0x16097d
cmpq $0x0, -0x178(%rbp)
je 0x160946
movq -0x178(%rbp), %rax
shlq %rax
movq %rax, -0x268(%rbp)
jmp 0x160954
movl $0x2, %eax
movq %rax, -0x268(%rbp)
jmp 0x160954
movq -0x268(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x170(%rbp), %rdi
imulq $0x18, -0x178(%rbp), %rsi
callq 0x2360
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
movq -0x180(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x180(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x1609c2
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x1608c3
movq -0x30(%rbp), %rdi
movq -0x170(%rbp), %rsi
imulq $0x18, -0xa0(%rbp), %rax
addq %rax, %rsi
movq -0x180(%rbp), %rax
subq -0xa0(%rbp), %rax
movl %eax, %edx
callq 0x15f7d0
cmpl $0x0, %eax
jne 0x160a13
movq -0xa0(%rbp), %rax
movq %rax, -0x180(%rbp)
jmp 0x160fcc
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpq -0x198(%rbp), %rax
jae 0x160e70
movq -0x188(%rbp), %rax
movl -0x60(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0xc0(%rbp)
movl -0xc4(%rbp), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x160a6e
jmp 0x160e62
movq -0x120(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0xc8(%rbp), %edx
callq 0x1515e0
movl %eax, -0x78(%rbp)
cmpl $-0x1, -0x78(%rbp)
jne 0x160a92
jmp 0x160e62
jmp 0x160a94
movq -0x168(%rbp), %rax
cmpq -0x160(%rbp), %rax
jne 0x160af8
cmpq $0x0, -0x160(%rbp)
je 0x160ac1
movq -0x160(%rbp), %rax
shlq %rax
movq %rax, -0x270(%rbp)
jmp 0x160acf
movl $0x2, %eax
movq %rax, -0x270(%rbp)
jmp 0x160acf
movq -0x270(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x158(%rbp), %rdi
imulq $0x18, -0x160(%rbp), %rsi
callq 0x2360
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
movq -0x168(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x168(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rax
movq (%rax), %rsi
movq -0x50(%rbp), %rdx
movl -0x54(%rbp), %ecx
movl 0x10(%rbp), %r8d
movl -0xc8(%rbp), %r9d
xorl $0x1, %r9d
movq -0xd0(%rbp), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %r10d
leaq -0xd0(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xe9560
movq -0x168(%rbp), %rax
cmpq -0x160(%rbp), %rax
jne 0x160be7
cmpq $0x0, -0x160(%rbp)
je 0x160bb0
movq -0x160(%rbp), %rax
shlq %rax
movq %rax, -0x278(%rbp)
jmp 0x160bbe
movl $0x2, %eax
movq %rax, -0x278(%rbp)
jmp 0x160bbe
movq -0x278(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x158(%rbp), %rdi
imulq $0x18, -0x160(%rbp), %rsi
callq 0x2360
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
movq -0x168(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x168(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0xb0(%rbp), %rdi
movl -0x5c(%rbp), %esi
movq -0x120(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x5c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl -0x78(%rbp), %ecx
xorl %r9d, %r9d
movl %r9d, %r8d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x141be0
movq -0xb0(%rbp), %rdi
movl -0x78(%rbp), %esi
xorl $0x1, %esi
movq -0x120(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x78(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl -0x5c(%rbp), %ecx
xorl $0x1, %ecx
xorl %r9d, %r9d
movl %r9d, %r8d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x141be0
movl -0x5c(%rbp), %eax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0xd0(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0xc8(%rbp)
movq -0x150(%rbp), %rax
cmpq -0x148(%rbp), %rax
jne 0x160d49
cmpq $0x0, -0x148(%rbp)
je 0x160d12
movq -0x148(%rbp), %rax
shlq %rax
movq %rax, -0x280(%rbp)
jmp 0x160d20
movl $0x2, %eax
movq %rax, -0x280(%rbp)
jmp 0x160d20
movq -0x280(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x140(%rbp), %rdi
imulq $0x18, -0x148(%rbp), %rsi
callq 0x2360
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movq -0x150(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x150(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl -0x78(%rbp), %eax
xorl $0x1, %eax
movl %eax, %eax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0xd0(%rbp)
movl -0x5c(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0xc8(%rbp)
movq -0x150(%rbp), %rax
cmpq -0x148(%rbp), %rax
jne 0x160e1d
cmpq $0x0, -0x148(%rbp)
je 0x160de6
movq -0x148(%rbp), %rax
shlq %rax
movq %rax, -0x288(%rbp)
jmp 0x160df4
movl $0x2, %eax
movq %rax, -0x288(%rbp)
jmp 0x160df4
movq -0x288(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x140(%rbp), %rdi
imulq $0x18, -0x148(%rbp), %rsi
callq 0x2360
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movq -0x150(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x150(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x160e62
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x160a1a
jmp 0x160e72
movq -0x1b8(%rbp), %rax
cmpq -0x1b0(%rbp), %rax
jne 0x160ed9
cmpq $0x0, -0x1b0(%rbp)
je 0x160e9f
movq -0x1b0(%rbp), %rax
shlq %rax
movq %rax, -0x290(%rbp)
jmp 0x160ead
movl $0x2, %eax
movq %rax, -0x290(%rbp)
jmp 0x160ead
movq -0x290(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x1a8(%rbp), %rdi
movq -0x1b0(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x1a8(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, %edx
movq -0x1a8(%rbp), %rax
movq -0x1b8(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x1b8(%rbp)
movq %rdx, (%rax,%rcx,8)
movq -0x180(%rbp), %rax
subq -0xa0(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa0(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
orq -0xa8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x1d8(%rbp), %rax
cmpq -0x1d0(%rbp), %rax
jne 0x160fa1
cmpq $0x0, -0x1d0(%rbp)
je 0x160f67
movq -0x1d0(%rbp), %rax
shlq %rax
movq %rax, -0x298(%rbp)
jmp 0x160f75
movl $0x2, %eax
movq %rax, -0x298(%rbp)
jmp 0x160f75
movq -0x298(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq -0x1c8(%rbp), %rdi
movq -0x1d0(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x1c8(%rbp)
movq -0xa0(%rbp), %rdx
movq -0x1c8(%rbp), %rax
movq -0x1d8(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x1d8(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x160fca
jmp 0x160fcc
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x1600cb
movq -0xb0(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x2140
movq %rax, %rcx
movq -0xb0(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0xb0(%rbp), %rdi
movq 0x28(%rbp), %rsi
callq 0x151020
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpq -0x150(%rbp), %rax
jae 0x16113d
movq -0x140(%rbp), %rax
movl -0x60(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, -0x5c(%rbp)
movq -0x140(%rbp), %rax
movl -0x60(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x78(%rbp)
movq -0xb0(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x5c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x161081
jmp 0x16112f
movq -0xb0(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x78(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1610a3
jmp 0x16112f
movq -0xb0(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x5c(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1610d8
movq -0xb0(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x78(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1610d8
jmp 0x16112f
movq -0xb0(%rbp), %rdi
movl -0x5c(%rbp), %esi
movl -0x78(%rbp), %edx
movl $0x1, %ecx
callq 0xd6530
movq -0xb0(%rbp), %rdi
movl -0x78(%rbp), %esi
xorl $0x1, %esi
movl -0x5c(%rbp), %edx
xorl $0x1, %edx
movl $0x1, %ecx
callq 0xd6530
movq -0x158(%rbp), %rax
movl -0x60(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x16101d
movq -0xb0(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2210
movq -0xb0(%rbp), %rax
movq $0x0, 0x30(%rax)
movq $0x0, -0x150(%rbp)
movq $0x0, -0x220(%rbp)
movq -0x30(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x22c(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpq -0x1b8(%rbp), %rax
jae 0x161673
movq -0x1a8(%rbp), %rax
movl -0x60(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x78(%rbp)
movq -0x30(%rbp), %rdi
movl -0x78(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x0, %eax
jne 0x1611c6
jmp 0x161665
movq -0x1c8(%rbp), %rax
movl -0x60(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq %rax, -0xa0(%rbp)
movq -0x1c8(%rbp), %rcx
movl -0x60(%rbp), %eax
movl %eax, %edx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq (%rcx,%rdx,8), %rax
movq %rax, -0xa8(%rbp)
movq -0x170(%rbp), %rax
imulq $0x18, -0xa0(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x220(%rbp)
cmpq $0x2, -0xa8(%rbp)
jae 0x161228
jmp 0x161665
movq 0x262db1(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x60(%rbp), %edx
movl -0x78(%rbp), %ecx
shrl %ecx
movl -0x78(%rbp), %r8d
andl $0x1, %r8d
leaq 0x22886d(%rip), %rsi    # 0x389ab6
movb $0x0, %al
callq 0x22a0
movq -0x30(%rbp), %rdi
movq -0x220(%rbp), %rsi
movq -0xa8(%rbp), %rax
movl %eax, %edx
callq 0x15f9c0
cmpl $0x0, %eax
jne 0x161273
jmp 0x161665
movq -0x220(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, -0x228(%rbp)
movq -0x30(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl $0x1, %eax
shll %eax
movl %eax, -0x224(%rbp)
movq -0x30(%rbp), %rdi
movl -0x228(%rbp), %esi
movl -0x224(%rbp), %edx
xorl %r9d, %r9d
leaq -0xd0(%rbp), %rax
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x169ef0
movq -0x150(%rbp), %rax
cmpq -0x148(%rbp), %rax
jne 0x16133b
cmpq $0x0, -0x148(%rbp)
je 0x161304
movq -0x148(%rbp), %rax
shlq %rax
movq %rax, -0x2a0(%rbp)
jmp 0x161312
movl $0x2, %eax
movq %rax, -0x2a0(%rbp)
jmp 0x161312
movq -0x2a0(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x140(%rbp), %rdi
imulq $0x18, -0x148(%rbp), %rsi
callq 0x2360
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movq -0x150(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x150(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rdi
movl -0x224(%rbp), %esi
xorl $0x1, %esi
movl -0x228(%rbp), %edx
xorl $0x1, %edx
xorl %r9d, %r9d
leaq -0xd0(%rbp), %rax
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x169ef0
movq -0x150(%rbp), %rax
cmpq -0x148(%rbp), %rax
jne 0x161421
cmpq $0x0, -0x148(%rbp)
je 0x1613ea
movq -0x148(%rbp), %rax
shlq %rax
movq %rax, -0x2a8(%rbp)
jmp 0x1613f8
movl $0x2, %eax
movq %rax, -0x2a8(%rbp)
jmp 0x1613f8
movq -0x2a8(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x140(%rbp), %rdi
imulq $0x18, -0x148(%rbp), %rsi
callq 0x2360
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movq -0x150(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x150(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl $0x1, %eax
shll %eax
movl %eax, -0x228(%rbp)
movq -0x220(%rbp), %rax
movq -0xa8(%rbp), %rcx
subq $0x1, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x224(%rbp)
movq -0x30(%rbp), %rdi
movl -0x228(%rbp), %esi
movl -0x224(%rbp), %edx
xorl %r9d, %r9d
leaq -0xd0(%rbp), %rax
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x169ef0
movq -0x150(%rbp), %rax
cmpq -0x148(%rbp), %rax
jne 0x16153a
cmpq $0x0, -0x148(%rbp)
je 0x161503
movq -0x148(%rbp), %rax
shlq %rax
movq %rax, -0x2b0(%rbp)
jmp 0x161511
movl $0x2, %eax
movq %rax, -0x2b0(%rbp)
jmp 0x161511
movq -0x2b0(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x140(%rbp), %rdi
imulq $0x18, -0x148(%rbp), %rsi
callq 0x2360
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movq -0x150(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x150(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rdi
movl -0x224(%rbp), %esi
xorl $0x1, %esi
movl -0x228(%rbp), %edx
xorl $0x1, %edx
xorl %r9d, %r9d
leaq -0xd0(%rbp), %rax
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x169ef0
movq -0x150(%rbp), %rax
cmpq -0x148(%rbp), %rax
jne 0x161620
cmpq $0x0, -0x148(%rbp)
je 0x1615e9
movq -0x148(%rbp), %rax
shlq %rax
movq %rax, -0x2b8(%rbp)
jmp 0x1615f7
movl $0x2, %eax
movq %rax, -0x2b8(%rbp)
jmp 0x1615f7
movq -0x2b8(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x140(%rbp), %rdi
imulq $0x18, -0x148(%rbp), %rsi
callq 0x2360
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movq -0x150(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x150(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x161665
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x16118b
movq $0x0, -0x238(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpq -0x150(%rbp), %rax
jae 0x1616da
movq -0x30(%rbp), %rdi
callq 0xd4050
movq %rax, -0x238(%rbp)
movq -0x140(%rbp), %rcx
movl -0x60(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq -0x238(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x161685
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2210
movq -0x30(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rdi
callq 0xcdd10
movq -0x30(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl -0x22c(%rbp), %eax
jbe 0x161892
movq -0x48(%rbp), %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
imulq $0xc, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
leaq 0x263b7a(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %esi
shlq $0x0, %rsi
callq 0x2360
movq %rax, %rcx
leaq 0x263b53(%rip), %rax    # 0x3c52d0
movq %rcx, 0x28(%rax)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %esi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %ecx
movq -0x50(%rbp), %rax
movq %rcx, (%rax)
movl -0x22c(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq -0x30(%rbp), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x161890
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x60(%rbp), %ecx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
leaq 0x263ad2(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movl -0x60(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movl -0x60(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movl -0x60(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x8(%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rax
movl -0x60(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
andl $0x80000000, %ecx       # imm = 0x80000000
orl $0x0, %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x60(%rbp), %ecx
movl (%rax,%rcx,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x48(%rbp), %rax
movq (%rax), %rax
movl -0x60(%rbp), %edx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x1617cd
jmp 0x161892
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x1618de
movq -0x50(%rbp), %rdi
movl -0x5c(%rbp), %esi
leaq -0x6c(%rbp), %rdx
leaq -0x68(%rbp), %rcx
callq 0xd3d50
cmpl $0x1, -0x68(%rbp)
jne 0x1618d1
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x5c(%rbp), %ecx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
jmp 0x1618d3
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x161899
movq -0x120(%rbp), %rdi
callq 0xcd6f0
movq -0x140(%rbp), %rdi
callq 0x2210
movq -0x170(%rbp), %rdi
callq 0x2210
movq -0x158(%rbp), %rdi
callq 0x2210
movq -0x188(%rbp), %rdi
callq 0x2210
movq -0x1a8(%rbp), %rdi
callq 0x2210
movq -0x1e8(%rbp), %rdi
callq 0x2210
movq -0x208(%rbp), %rdi
callq 0x2210
movq -0x1c8(%rbp), %rdi
callq 0x2210
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)