// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: rescue_missing_overlaps_backward(ma_ug_t*, asg_t*, ma_hit_t_alloc*, ma_sub_t*, R_to_U*, int, int, unsigned int, unsigned int, unsigned int, bub_label_t*)
void rescue_missing_overlaps_backward(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 backward_steps, uint32_t is_bubble_check, uint32_t is_primary_check, bub_label_t* b_mask_t)
{
    uint32_t v, vId, dir, k, cur_backward_steps, round, is_Unitig, uId, rId, endRid, oLen, w, max_oLen, max_oLen_i, mode, nv;
    uint64_t tmp;
    long long init, step = 0;
    asg_t* nsg = NULL;
    ma_utg_t* nsu = NULL;
    ma_ug_t *ug = NULL;
    asg_arc_t *av = NULL;
    asg_arc_t t, r_edge;
    kvec_t(asg_arc_t) new_edges;
    kv_init(new_edges);

    kvec_asg_arc_t_warp recover_edges;
    kv_init(recover_edges.a);

    kvec_t(asg_arc_t) rbub_edges;
    kv_init(rbub_edges);

    kvec_t_u64_warp u_vecs;
    kv_init(u_vecs.a);

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

        for (k = 0; k < nsu->n; k++)
        {
            rId = nsu->a[k]>>33;
            set_R_to_U(ruIndex, rId, uId, 1, &(r_g->seq[rId].c));
        }
    }



    for (vId = 0; vId < nsg->n_seq; vId++)
    {
        rbub_edges.n = round = 0;
        for (dir = 0; dir < 2; dir++)
        {
            if(rbub_edges.n > 0)
            {
                cur_backward_steps = nsu->n - round - 1;
                if(cur_backward_steps > backward_steps)
                {
                    cur_backward_steps = backward_steps;
                }
            }
            else
            {
                cur_backward_steps = backward_steps;
            }
            
            

            v = vId; v = v<<1; v = v | dir;
            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(get_real_length(nsg, v^1, NULL) == 0) continue;
            ///that means this unitig has been changed
            if(nsu->start!=((uint64_t)(nsu->a[0])>>32)) continue;
            if((nsu->end^1)!=((uint64_t)(nsu->a[nsu->n-1])>>32)) continue;
            
            if(v&1)
            {
                init = 0;
                step = 1;
                mode = 1;
                //endRid = nsu->start^1;
            }
            else
            {
                init = nsu->n - 1;
                step = -1;
                mode = 0;
                ///endRid = nsu->end^1;
            }


            rbub_edges.n = 0;
            for (round = 0; round < cur_backward_steps && init >= 0 && init < (long long)nsu->n; 
                                                                    init = init + step, round++)
            {
                endRid = ((uint64_t)(nsu->a[init]))>>32;
                endRid = endRid^mode;

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

            if(rbub_edges.n > 0)
            {
                if(mode == 1) nsu->start = endRid^1;
                if(mode == 0) nsu->end = endRid^1;
                //save for revert
                tmp = mode; tmp = tmp <<31; tmp = tmp | (uint64_t)(init); tmp = tmp << 32; tmp = tmp | uId;
                kv_push(uint64_t, u_vecs.a, tmp);



                ///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
                {
                    ///modify read graph
                    for (init = init - step; init >= 0 && init < (long long)nsu->n; init = init - step)
                    {
                        w = ((uint64_t)(nsu->a[init]))>>32;
                        nv = asg_arc_n(r_g, w);
                        av = asg_arc_a(r_g, w);
                        for (k = 0; k < nv; k++)
                        {
                            if(av[k].del) continue;
                            kv_push(asg_arc_t, recover_edges.a, av[k]);
                            if(asg_get_arc(r_g, av[k].v^1, av[k].ul>>32^1, &t)==0)
                            {
                                fprintf(stderr, "error\n");
                            } 
                            kv_push(asg_arc_t, recover_edges.a, t);
                        }
                        

                        nv = asg_arc_n(r_g, w^1);
                        av = asg_arc_a(r_g, w^1);
                        for (k = 0; k < nv; k++)
                        {
                            if(av[k].del) continue;
                            kv_push(asg_arc_t, recover_edges.a, av[k]);
                            if(asg_get_arc(r_g, av[k].v^1, av[k].ul>>32^1, &t)==0)
                            {
                                fprintf(stderr, "error\n");
                            } 
                            kv_push(asg_arc_t, recover_edges.a, t);
                        }

                        ///w = ((uint64_t)(nsu->a[init]))>>32;
                        asg_seq_del(r_g, w>>1);
                    }


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

            }
        }
    }
    
    
    if(is_bubble_check)
    {
        asg_arc_t* p = NULL;
        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);
        

        for (k = 0; k < recover_edges.a.n; k++)
        {
            recover_edges.a.a[k].del = 1;
        }

        for (k = 0; k < u_vecs.a.n; k++)
        {
            mode = (uint64_t)u_vecs.a.a[k]>>63;
            if(mode == 1) step = 1;
            if(mode == 0) step = -1;
            init = (uint64_t)((uint64_t)u_vecs.a.a[k]>>32)&((uint64_t)(0x7fffffff));
            uId = (uint32_t)u_vecs.a.a[k];
            nsu = &(ug->u.a[uId]);

            endRid = ((uint64_t)(nsu->a[init]))>>32;
            endRid = endRid^mode;
            /********************for debug**********************/
            // fprintf(stderr, "n: %u, k: %u, mode: %u, init: %lld, step: %lld, uId: %u, endRid: %u\n", 
            // (uint32_t)u_vecs.a.n, k, mode, init, step, uId, endRid);
            // fprintf(stderr, "nsu->start: %u, nsu->end: %u\n", 
            // nsu->start, nsu->end);
            // if(mode == 1 && nsu->start != (endRid^1)) fprintf(stderr, "ERROR\n");
            // if(mode == 0 && nsu->end != (endRid^1)) fprintf(stderr, "ERROR\n");
            // update_unitig(step, init, nsu, r_g, &recover_edges, 0);
            /********************for debug**********************/
            if(get_real_length(r_g, endRid, NULL) > 0)
            {
                update_unitig(step, init, nsu, r_g, &recover_edges, 1);
                // fprintf(stderr, "endRid: %u, %.*s, uId: %u\n", 
                // endRid>>1, (int)Get_NAME_LENGTH((R_INF), v>>1), Get_NAME((R_INF), v>>1), uId);
            }
            else
            {
                update_unitig(step, init, nsu, r_g, &recover_edges, 0);
            }
        }

        uint64_t recov_occ = 0;
        for (k = 0; k < recover_edges.a.n; k++)
        {
            if(recover_edges.a.a[k].del) continue;
            p = asg_arc_pushp(r_g);
            *p = recover_edges.a.a[k];
            recov_occ++;
        }

        if(recov_occ != 0)
        {
            free(r_g->idx);
            r_g->idx = 0;
            r_g->is_srt = 0;
        }

        asg_cleanup(r_g);
    }

    if(is_primary_check)
    {
        for (k = 0; k < u_vecs.a.n; k++)
        {
            mode = (uint64_t)u_vecs.a.a[k]>>63;
            if(mode == 1) step = 1;
            if(mode == 0) step = -1;
            init = (uint64_t)((uint64_t)u_vecs.a.a[k]>>32)&((uint64_t)(0x7fffffff));
            uId = (uint32_t)u_vecs.a.a[k];
            nsu = &(ug->u.a[uId]);

            endRid = ((uint64_t)(nsu->a[init]))>>32;
            endRid = endRid^mode;

            update_unitig(step, init, nsu, r_g, &recover_edges, 1);
        }
    }


    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(recover_edges.a);
    kv_destroy(rbub_edges);
    kv_destroy(u_vecs.a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x1f0, %rsp            # imm = 0x1F0
movq 0x30(%rbp), %rax
movl 0x28(%rbp), %eax
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq %r8, -0x38(%rbp)
movl %r9d, -0x3c(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
movq $0x0, -0xa8(%rbp)
movq $0x0, -0xb0(%rbp)
movq $0x0, -0xb8(%rbp)
movq $0x0, -0xf8(%rbp)
movq $0x0, -0x100(%rbp)
movq $0x0, -0xf0(%rbp)
movq $0x0, -0x118(%rbp)
movq $0x0, -0x120(%rbp)
movq $0x0, -0x110(%rbp)
movq $0x0, -0x130(%rbp)
movq $0x0, -0x138(%rbp)
movq $0x0, -0x128(%rbp)
movq $0x0, -0x150(%rbp)
movq $0x0, -0x158(%rbp)
movq $0x0, -0x148(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x15c115
movq -0x18(%rbp), %rax
movq %rax, -0xb0(%rbp)
jmp 0x15c16b
movq -0x20(%rbp), %rdi
callq 0xe5910
movq %rax, -0xb0(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
movq -0xb0(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x15c169
movq -0xb0(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl -0x40(%rbp), %ecx
movb $0x0, 0x4(%rax,%rcx,8)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x15c12c
jmp 0x15c16b
movq -0xb0(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xa0(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
movq -0xa0(%rbp), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x15c285
movl -0x40(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x15c1d3
jmp 0x15c277
movq -0xa0(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x40(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x15c1f1
jmp 0x15c277
cmpl $0x0, 0x28(%rbp)
je 0x15c211
movq -0xa0(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x40(%rbp), %ecx
movzbl 0x4(%rax,%rcx,8), %eax
cmpl $0x1, %eax
jne 0x15c211
jmp 0x15c277
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0xa8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x15c275
movq -0xa8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x4c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movl %eax, -0x60(%rbp)
movq -0x38(%rbp), %rdi
movl -0x60(%rbp), %esi
movl -0x5c(%rbp), %edx
movq -0x20(%rbp), %rax
movq 0x20(%rax), %r8
movl -0x60(%rbp), %eax
shlq $0x3, %rax
addq %rax, %r8
addq $0x4, %r8
movl $0x1, %ecx
callq 0xd0e20
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x15c218
jmp 0x15c277
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x15c184
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0xa0(%rbp), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0x15d3b6
movl $0x0, -0x54(%rbp)
movq $0x0, -0x138(%rbp)
movl $0x0, -0x48(%rbp)
cmpl $0x2, -0x48(%rbp)
jae 0x15d3a6
cmpq $0x0, -0x138(%rbp)
jbe 0x15c2f7
movq -0xa8(%rbp), %rax
movl 0x10(%rax), %eax
subl -0x54(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl 0x18(%rbp), %eax
jbe 0x15c2f5
movl 0x18(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x15c2fd
movl 0x18(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
shll %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
orl -0x48(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
shrl %eax
movl %eax, -0x5c(%rbp)
movq -0xa0(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x5c(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x15c33a
jmp 0x15d398
cmpl $0x0, 0x28(%rbp)
je 0x15c35d
movq -0xa0(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x5c(%rbp), %ecx
movzbl 0x4(%rax,%rcx,8), %eax
cmpl $0x1, %eax
jne 0x15c35d
jmp 0x15d398
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x15c38b
jmp 0x15d398
movq -0xa8(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x15c3b6
movq -0xa8(%rbp), %rax
cmpl $-0x1, 0x4(%rax)
je 0x15c3b6
movq -0xa8(%rbp), %rax
cmpl $-0x1, 0x8(%rax)
jne 0x15c3bb
jmp 0x15d398
movq -0xa0(%rbp), %rdi
movl -0x40(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x0, %eax
je 0x15c3d8
jmp 0x15d398
movq -0xa8(%rbp), %rax
movl 0x4(%rax), %eax
movq -0xa8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
je 0x15c3fe
jmp 0x15d398
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, %eax
movq -0xa8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0xa8(%rbp), %rdx
movl 0x10(%rdx), %edx
subl $0x1, %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
je 0x15c439
jmp 0x15d398
movl -0x40(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x15c463
movq $0x0, -0x90(%rbp)
movq $0x1, -0x98(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0x15c48b
movq -0xa8(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x1, %eax
movl %eax, %eax
movq %rax, -0x90(%rbp)
movq $-0x1, -0x98(%rbp)
movl $0x0, -0x78(%rbp)
movq $0x0, -0x138(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %ecx
xorl %eax, %eax
cmpl -0x50(%rbp), %ecx
movb %al, -0x169(%rbp)
jae 0x15c4dc
xorl %eax, %eax
cmpq $0x0, -0x90(%rbp)
movb %al, -0x169(%rbp)
jl 0x15c4dc
movq -0x90(%rbp), %rax
movq -0xa8(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
setl %al
movb %al, -0x169(%rbp)
movb -0x169(%rbp), %al
testb $0x1, %al
jne 0x15c4eb
jmp 0x15c668
movq -0xa8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
xorl -0x78(%rbp), %eax
movl %eax, -0x64(%rbp)
movl $0x0, -0x4c(%rbp)
movq $0x0, -0x138(%rbp)
movq -0xb0(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %r8
movl -0x3c(%rbp), %r9d
movl 0x10(%rbp), %r14d
movl -0x64(%rbp), %ebx
leaq -0x5c(%rbp), %r11
leaq -0x4c(%rbp), %r10
leaq -0xe8(%rbp), %rax
movl %r14d, (%rsp)
movl %ebx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movl $0x1, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movl $0x1, 0x30(%rsp)
callq 0x169940
cmpl $0x0, %eax
je 0x15c637
jmp 0x15c58b
movq -0x138(%rbp), %rax
cmpq -0x130(%rbp), %rax
jne 0x15c5ef
cmpq $0x0, -0x130(%rbp)
je 0x15c5b8
movq -0x130(%rbp), %rax
shlq %rax
movq %rax, -0x178(%rbp)
jmp 0x15c5c6
movl $0x2, %eax
movq %rax, -0x178(%rbp)
jmp 0x15c5c6
movq -0x178(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x128(%rbp), %rdi
imulq $0x18, -0x130(%rbp), %rsi
callq 0x2360
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq -0x138(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x138(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0xe8(%rbp), %rcx
movq %rcx, (%rax)
movq -0xe0(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xd8(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x15c523
cmpq $0x0, -0x138(%rbp)
jbe 0x15c643
jmp 0x15c668
jmp 0x15c645
movq -0x90(%rbp), %rax
addq -0x98(%rbp), %rax
movq %rax, -0x90(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x15c49d
cmpq $0x0, -0x138(%rbp)
jbe 0x15d396
cmpl $0x1, -0x78(%rbp)
jne 0x15c68c
movl -0x64(%rbp), %ecx
xorl $0x1, %ecx
movq -0xa8(%rbp), %rax
movl %ecx, 0x4(%rax)
cmpl $0x0, -0x78(%rbp)
jne 0x15c6a2
movl -0x64(%rbp), %ecx
xorl $0x1, %ecx
movq -0xa8(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x78(%rbp), %eax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
shlq $0x1f, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
orq -0x90(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movl -0x5c(%rbp), %ecx
orq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x158(%rbp), %rax
cmpq -0x150(%rbp), %rax
jne 0x15c760
cmpq $0x0, -0x150(%rbp)
je 0x15c726
movq -0x150(%rbp), %rax
shlq %rax
movq %rax, -0x180(%rbp)
jmp 0x15c734
movl $0x2, %eax
movq %rax, -0x180(%rbp)
jmp 0x15c734
movq -0x180(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x148(%rbp), %rdi
movq -0x150(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x148(%rbp)
movq -0x88(%rbp), %rdx
movq -0x148(%rbp), %rax
movq -0x158(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x158(%rbp)
movq %rdx, (%rax,%rcx,8)
movq -0xb0(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x128(%rbp), %rdx
movq -0x138(%rbp), %rax
movl %eax, %ecx
callq 0x1516a0
cmpl $0x0, 0x28(%rbp)
je 0x15cb5c
movl $0x0, -0x70(%rbp)
movl $0xffffffff, -0x74(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpq -0x138(%rbp), %rax
jae 0x15c844
movq -0x128(%rbp), %rax
movl -0x4c(%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 0x15c813
jmp 0x15c839
movl -0xc4(%rbp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl -0x70(%rbp), %eax
jbe 0x15c837
movl -0xc4(%rbp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x70(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0x74(%rbp)
jmp 0x15c839
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x15c7c6
cmpl $-0x1, -0x74(%rbp)
jne 0x15c84f
jmp 0x15d398
movq -0x128(%rbp), %rax
movl -0x74(%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)
movq -0xb0(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0xc8(%rbp), %edx
callq 0x1515e0
movl %eax, -0x6c(%rbp)
cmpl $-0x1, -0x6c(%rbp)
jne 0x15c8a4
jmp 0x15d398
movq -0xa0(%rbp), %rdi
movl -0x6c(%rbp), %esi
xorl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x0, %eax
je 0x15c8c4
jmp 0x15d398
jmp 0x15c8c6
movq -0x100(%rbp), %rax
cmpq -0xf8(%rbp), %rax
jne 0x15c92a
cmpq $0x0, -0xf8(%rbp)
je 0x15c8f3
movq -0xf8(%rbp), %rax
shlq %rax
movq %rax, -0x188(%rbp)
jmp 0x15c901
movl $0x2, %eax
movq %rax, -0x188(%rbp)
jmp 0x15c901
movq -0x188(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xf0(%rbp), %rdi
imulq $0x18, -0xf8(%rbp), %rsi
callq 0x2360
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq -0x100(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x100(%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 -0xc4(%rbp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x68(%rbp)
movq -0xa0(%rbp), %rdi
movl -0x40(%rbp), %esi
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl -0x6c(%rbp), %ecx
movl -0x68(%rbp), %r8d
movw -0xc0(%rbp), %ax
shrw $0xe, %ax
andw $0x1, %ax
movb %al, %r9b
movb -0xbe(%rbp), %r10b
movw -0xc0(%rbp), %ax
shrw $0xf, %ax
movzbl %r9b, %r9d
movzbl %r10b, %r10d
movl %r10d, (%rsp)
movzbl %al, %eax
movl %eax, 0x8(%rsp)
callq 0x141be0
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movl -0x3c(%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 -0x100(%rbp), %rax
cmpq -0xf8(%rbp), %rax
jne 0x15ca92
cmpq $0x0, -0xf8(%rbp)
je 0x15ca5b
movq -0xf8(%rbp), %rax
shlq %rax
movq %rax, -0x190(%rbp)
jmp 0x15ca69
movl $0x2, %eax
movq %rax, -0x190(%rbp)
jmp 0x15ca69
movq -0x190(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xf0(%rbp), %rdi
imulq $0x18, -0xf8(%rbp), %rsi
callq 0x2360
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq -0x100(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x100(%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 -0xc4(%rbp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x68(%rbp)
movq -0xa0(%rbp), %rdi
movl -0x6c(%rbp), %esi
xorl $0x1, %esi
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x6c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl -0x40(%rbp), %ecx
xorl $0x1, %ecx
movl -0x68(%rbp), %r8d
movw -0xc0(%rbp), %ax
shrw $0xe, %ax
andw $0x1, %ax
movb %al, %r9b
movb -0xbe(%rbp), %r10b
movw -0xc0(%rbp), %ax
shrw $0xf, %ax
movzbl %r9b, %r9d
movzbl %r10b, %r10d
movl %r10d, (%rsp)
movzbl %al, %eax
movl %eax, 0x8(%rsp)
callq 0x141be0
jmp 0x15d394
movq -0x90(%rbp), %rax
subq -0x98(%rbp), %rax
movq %rax, -0x90(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x90(%rbp)
movb %al, -0x191(%rbp)
jl 0x15cba0
movq -0x90(%rbp), %rax
movq -0xa8(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
setl %al
movb %al, -0x191(%rbp)
movb -0x191(%rbp), %al
testb $0x1, %al
jne 0x15cbaf
jmp 0x15d072
movq -0xa8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x6c(%rbp)
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x6c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x7c(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x6c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jae 0x15ce06
movq -0xb8(%rbp), %rax
movl -0x4c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x15cc3b
jmp 0x15cdf8
jmp 0x15cc3d
movq -0x120(%rbp), %rax
cmpq -0x118(%rbp), %rax
jne 0x15cca1
cmpq $0x0, -0x118(%rbp)
je 0x15cc6a
movq -0x118(%rbp), %rax
shlq %rax
movq %rax, -0x1a0(%rbp)
jmp 0x15cc78
movl $0x2, %eax
movq %rax, -0x1a0(%rbp)
jmp 0x15cc78
movq -0x1a0(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rdi
imulq $0x18, -0x118(%rbp), %rsi
callq 0x2360
movq %rax, -0x110(%rbp)
movq -0xb8(%rbp), %rcx
movl -0x4c(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq -0x110(%rbp), %rax
movq -0x120(%rbp), %rdx
movq %rdx, %rsi
addq $0x1, %rsi
movq %rsi, -0x120(%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)
movq -0x20(%rbp), %rdi
movq -0xb8(%rbp), %rax
movl -0x4c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %esi
xorl $0x1, %esi
movq -0xb8(%rbp), %rax
movl -0x4c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %edx
leaq -0xd0(%rbp), %rcx
callq 0x15a550
cmpl $0x0, %eax
jne 0x15cd4d
movq 0x2672a4(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x22589f(%rip), %rsi    # 0x3825e5
movb $0x0, %al
callq 0x22a0
jmp 0x15cd4f
movq -0x120(%rbp), %rax
cmpq -0x118(%rbp), %rax
jne 0x15cdb3
cmpq $0x0, -0x118(%rbp)
je 0x15cd7c
movq -0x118(%rbp), %rax
shlq %rax
movq %rax, -0x1a8(%rbp)
jmp 0x15cd8a
movl $0x2, %eax
movq %rax, -0x1a8(%rbp)
jmp 0x15cd8a
movq -0x1a8(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rdi
imulq $0x18, -0x118(%rbp), %rsi
callq 0x2360
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rax
movq -0x120(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x120(%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 0x15cdf8
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x15cc0e
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x6c(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x7c(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x6c(%rbp), %edx
xorl $0x1, %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jae 0x15d04a
movq -0xb8(%rbp), %rax
movl -0x4c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x15ce7f
jmp 0x15d03c
jmp 0x15ce81
movq -0x120(%rbp), %rax
cmpq -0x118(%rbp), %rax
jne 0x15cee5
cmpq $0x0, -0x118(%rbp)
je 0x15ceae
movq -0x118(%rbp), %rax
shlq %rax
movq %rax, -0x1b0(%rbp)
jmp 0x15cebc
movl $0x2, %eax
movq %rax, -0x1b0(%rbp)
jmp 0x15cebc
movq -0x1b0(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rdi
imulq $0x18, -0x118(%rbp), %rsi
callq 0x2360
movq %rax, -0x110(%rbp)
movq -0xb8(%rbp), %rcx
movl -0x4c(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq -0x110(%rbp), %rax
movq -0x120(%rbp), %rdx
movq %rdx, %rsi
addq $0x1, %rsi
movq %rsi, -0x120(%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)
movq -0x20(%rbp), %rdi
movq -0xb8(%rbp), %rax
movl -0x4c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %esi
xorl $0x1, %esi
movq -0xb8(%rbp), %rax
movl -0x4c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %edx
leaq -0xd0(%rbp), %rcx
callq 0x15a550
cmpl $0x0, %eax
jne 0x15cf91
movq 0x267060(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x22565b(%rip), %rsi    # 0x3825e5
movb $0x0, %al
callq 0x22a0
jmp 0x15cf93
movq -0x120(%rbp), %rax
cmpq -0x118(%rbp), %rax
jne 0x15cff7
cmpq $0x0, -0x118(%rbp)
je 0x15cfc0
movq -0x118(%rbp), %rax
shlq %rax
movq %rax, -0x1b8(%rbp)
jmp 0x15cfce
movl $0x2, %eax
movq %rax, -0x1b8(%rbp)
jmp 0x15cfce
movq -0x1b8(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rdi
imulq $0x18, -0x118(%rbp), %rsi
callq 0x2360
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rax
movq -0x120(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x120(%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 0x15d03c
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x15ce52
movq -0x20(%rbp), %rdi
movl -0x6c(%rbp), %esi
shrl %esi
callq 0xd9510
movq -0x90(%rbp), %rax
subq -0x98(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x15cb71
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpq -0x138(%rbp), %rax
jae 0x15d392
movq -0x128(%rbp), %rax
movl -0x4c(%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 0x15d0cd
jmp 0x15d384
movq -0xb0(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0xc8(%rbp), %edx
callq 0x1515e0
movl %eax, -0x6c(%rbp)
cmpl $-0x1, -0x6c(%rbp)
jne 0x15d0f1
jmp 0x15d384
jmp 0x15d0f3
movq -0x100(%rbp), %rax
cmpq -0xf8(%rbp), %rax
jne 0x15d157
cmpq $0x0, -0xf8(%rbp)
je 0x15d120
movq -0xf8(%rbp), %rax
shlq %rax
movq %rax, -0x1c0(%rbp)
jmp 0x15d12e
movl $0x2, %eax
movq %rax, -0x1c0(%rbp)
jmp 0x15d12e
movq -0x1c0(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xf0(%rbp), %rdi
imulq $0x18, -0xf8(%rbp), %rsi
callq 0x2360
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq -0x100(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x100(%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 -0xc4(%rbp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x68(%rbp)
movq -0xa0(%rbp), %rdi
movl -0x40(%rbp), %esi
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl -0x6c(%rbp), %ecx
movl -0x68(%rbp), %r8d
movw -0xc0(%rbp), %ax
shrw $0xe, %ax
andw $0x1, %ax
movb %al, %r9b
movb -0xbe(%rbp), %r10b
movw -0xc0(%rbp), %ax
shrw $0xf, %ax
movzbl %r9b, %r9d
movzbl %r10b, %r10d
movl %r10d, (%rsp)
movzbl %al, %eax
movl %eax, 0x8(%rsp)
callq 0x141be0
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movl -0x3c(%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 -0x100(%rbp), %rax
cmpq -0xf8(%rbp), %rax
jne 0x15d2bf
cmpq $0x0, -0xf8(%rbp)
je 0x15d288
movq -0xf8(%rbp), %rax
shlq %rax
movq %rax, -0x1c8(%rbp)
jmp 0x15d296
movl $0x2, %eax
movq %rax, -0x1c8(%rbp)
jmp 0x15d296
movq -0x1c8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xf0(%rbp), %rdi
imulq $0x18, -0xf8(%rbp), %rsi
callq 0x2360
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq -0x100(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x100(%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 -0xc4(%rbp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x68(%rbp)
movq -0xa0(%rbp), %rdi
movl -0x6c(%rbp), %esi
xorl $0x1, %esi
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x6c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl -0x40(%rbp), %ecx
xorl $0x1, %ecx
movl -0x68(%rbp), %r8d
movw -0xc0(%rbp), %ax
shrw $0xe, %ax
andw $0x1, %ax
movb %al, %r9b
movb -0xbe(%rbp), %r10b
movw -0xc0(%rbp), %ax
shrw $0xf, %ax
movzbl %r9b, %r9d
movzbl %r10b, %r10d
movl %r10d, (%rsp)
movzbl %al, %eax
movl %eax, 0x8(%rsp)
callq 0x141be0
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x15d079
jmp 0x15d394
jmp 0x15d396
jmp 0x15d398
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x15c2c0
jmp 0x15d3a8
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x15c28c
cmpl $0x0, 0x20(%rbp)
je 0x15d7cf
movq $0x0, -0x160(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpq -0x100(%rbp), %rax
jae 0x15d427
movq -0x20(%rbp), %rdi
callq 0xd4050
movq %rax, -0x160(%rbp)
movq -0xf0(%rbp), %rcx
movl -0x4c(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq -0x160(%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 -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x15d3d2
cmpq $0x0, -0x100(%rbp)
je 0x15d466
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2210
movq -0x20(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rdi
callq 0xcdd10
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x20(%rbp), %rdx
xorl %ecx, %ecx
callq 0x150830
movq -0x20(%rbp), %rdi
movq 0x30(%rbp), %rsi
callq 0x151020
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpq -0x100(%rbp), %rax
jae 0x15d572
movq -0xf0(%rbp), %rax
movl -0x4c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, -0x40(%rbp)
movq -0xf0(%rbp), %rax
movl -0x4c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x15d4eb
jmp 0x15d564
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x6c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x15d507
jmp 0x15d564
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x40(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x15d536
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x6c(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x15d536
jmp 0x15d564
movq -0x20(%rbp), %rdi
movl -0x40(%rbp), %esi
movl -0x6c(%rbp), %edx
movl $0x1, %ecx
callq 0xd6530
movq -0x20(%rbp), %rdi
movl -0x6c(%rbp), %esi
xorl $0x1, %esi
movl -0x40(%rbp), %edx
xorl $0x1, %edx
movl $0x1, %ecx
callq 0xd6530
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x15d48d
movq -0x20(%rbp), %rdi
callq 0xcdd10
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpq -0x120(%rbp), %rax
jae 0x15d5bc
movq -0x110(%rbp), %rax
movl -0x4c(%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 -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x15d582
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpq -0x158(%rbp), %rax
jae 0x15d6f6
movq -0x148(%rbp), %rax
movl -0x4c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x3f, %rax
movl %eax, -0x78(%rbp)
cmpl $0x1, -0x78(%rbp)
jne 0x15d5f9
movq $0x1, -0x98(%rbp)
cmpl $0x0, -0x78(%rbp)
jne 0x15d60a
movq $-0x1, -0x98(%rbp)
movq -0x148(%rbp), %rax
movl -0x4c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movq %rax, -0x90(%rbp)
movq -0x148(%rbp), %rax
movl -0x4c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x5c(%rbp)
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
xorl -0x78(%rbp), %eax
movl %eax, -0x64(%rbp)
movq -0x20(%rbp), %rdi
movl -0x64(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x0, %eax
jle 0x15d6be
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x120(%rbp), %r8
movl $0x1, %r9d
callq 0x15a630
jmp 0x15d6e6
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x120(%rbp), %r8
xorl %r9d, %r9d
callq 0x15a630
jmp 0x15d6e8
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x15d5c3
movq $0x0, -0x168(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpq -0x120(%rbp), %rax
jae 0x15d790
movq -0x110(%rbp), %rax
movl -0x4c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x15d732
jmp 0x15d782
movq -0x20(%rbp), %rdi
callq 0xd4050
movq %rax, -0x160(%rbp)
movq -0x110(%rbp), %rcx
movl -0x4c(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq -0x160(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq -0x168(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x168(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x15d708
cmpq $0x0, -0x168(%rbp)
je 0x15d7c6
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2210
movq -0x20(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rdi
callq 0xcdd10
cmpl $0x0, 0x28(%rbp)
je 0x15d8d4
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpq -0x158(%rbp), %rax
jae 0x15d8d2
movq -0x148(%rbp), %rax
movl -0x4c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x3f, %rax
movl %eax, -0x78(%rbp)
cmpl $0x1, -0x78(%rbp)
jne 0x15d816
movq $0x1, -0x98(%rbp)
cmpl $0x0, -0x78(%rbp)
jne 0x15d827
movq $-0x1, -0x98(%rbp)
movq -0x148(%rbp), %rax
movl -0x4c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movq %rax, -0x90(%rbp)
movq -0x148(%rbp), %rax
movl -0x4c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x5c(%rbp)
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x90(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
xorl -0x78(%rbp), %eax
movl %eax, -0x64(%rbp)
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x120(%rbp), %r8
movl $0x1, %r9d
callq 0x15a630
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x15d7e0
jmp 0x15d8d4
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x15d920
movq -0x38(%rbp), %rdi
movl -0x40(%rbp), %esi
leaq -0x5c(%rbp), %rdx
leaq -0x58(%rbp), %rcx
callq 0xd3d50
cmpl $0x1, -0x58(%rbp)
jne 0x15d913
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x40(%rbp), %ecx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
jmp 0x15d915
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x15d8db
cmpq $0x0, -0x18(%rbp)
jne 0x15d933
movq -0xb0(%rbp), %rdi
callq 0xcd6f0
movq -0xf0(%rbp), %rdi
callq 0x2210
movq -0x110(%rbp), %rdi
callq 0x2210
movq -0x128(%rbp), %rdi
callq 0x2210
movq -0x148(%rbp), %rdi
callq 0x2210
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbx
popq %r14
popq %rbp
retq
nop