// File: chhylp123[P]hifiasm/Hash_Table.cpp
// Function: lchain_qdp_mcopy_fast(Candidates_list*, long, long, long, Chain_Data*, overlap_region_alloc*, long, long, long, double, double, double, unsigned int, long, long, long, unsigned int, long, long, double, long, long)
uint64_t lchain_qdp_mcopy_fast(Candidates_list *cl, int64_t a_idx, int64_t a_n, int64_t des_idx, 
              Chain_Data* dp, overlap_region_alloc* res, int64_t max_skip, int64_t max_iter, 
              int64_t max_dis, double chn_pen_gap, double chn_pen_skip, double bw_rate, 
              uint32_t xid, int64_t xl, int64_t yl, int64_t quick_check, uint32_t apend_be, 
              int64_t gen_cigar, int64_t mcopy_num, double mcopy_rate, int64_t mcopy_khit_cutoff, 
              int64_t khit_n)
{
    if(a_n <= 0) return 0;
    int64_t *p, *t, max_f, n_skip, st, max_j, end_j, sc, msc, msc_i, max_ii, ovl, movl, plus = 0, min_sc, ch_n, si, ei; 
    int32_t *f, max, tmp, *ii; int64_t i, k, j, cL = 0; k_mer_hit* a; k_mer_hit* des; k_mer_hit *swap; overlap_region *z;
    resize_Chain_Data(dp, a_n, NULL); ch_n = 1; // int64_t bw; bw = ((xl < yl)?xl:yl); bw *= bw_rate;
    t = dp->tmp; f = dp->score; p = dp->pre; ii = dp->occ;
    
    a = cl->list + a_idx; des = cl->list + des_idx;
    // if(a_n && a[0].readID == 0) {
    //     fprintf(stderr, "---[M::%s::utg%.6dl::%c]\n", 
    //                     __func__, (int32_t)a[0].readID+1, "+-"[a[0].strand]);
    // }
    if(quick_check) {
        quick_ck_lchain(a, a_n, xl, yl, chn_pen_gap, chn_pen_skip, bw_rate, p, t, f, ii, &plus, &msc, &msc_i, &movl, &si, &ei);
    } else {
        msc = msc_i = INT32_MIN; movl = INT32_MAX; plus = 0; si = 0; ei = a_n;
        memset(t, 0, (a_n*sizeof((*t))));
    }   
    // if(a_n && a[0].readID == 4412344) {
    //     fprintf(stderr, "[M::%s::] si::%ld, ei::%ld, a_n::%ld\n", __func__, si, ei, a_n);
    // }
    for (i = st = si, max_ii = -1; i < ei; ++i) {
        max_f = a[i].cnt&(0xffu); 
        n_skip = 0; max_j = end_j = -1;
        if ((i-st) > max_iter) st = i-max_iter;
        while (a[i].strand != a[st].strand) ++st;

        for (j = i - 1; j >= st; --j) {
            sc = comput_sc_ch_ec(&a[i], &a[j], bw_rate, chn_pen_gap, chn_pen_skip, xl, yl);
            if (sc == INT32_MIN) continue;
            sc += f[j];
            if (sc > max_f) {
                max_f = sc, max_j = j;
                if (n_skip > 0) --n_skip;
            } else if (t[j] == (int32_t)i) {
                if (++n_skip > max_skip)
                    break;
            }
            if (p[j] >= 0) t[p[j]] = i;
        }
        end_j = j;

        if ((max_ii<0) || (a[i].self_offset>a[max_ii].self_offset+max_dis) || (a[i].strand!=a[max_ii].strand)) {
            max = INT32_MIN; max_ii = -1;
            for (j=i-1; (j>=st) && (a[i].self_offset<=max_dis+a[j].self_offset)&&(a[i].strand==a[j].strand); --j) {
                if (max < f[j]) {
                    max = f[j], max_ii = j;
                }
            }
        }

        if ((max_ii >= 0) && (max_ii < end_j) && (a[i].strand == a[max_ii].strand)) {///just have a try with a[i]<->a[max_ii]
            tmp = comput_sc_ch_ec(&a[i], &a[max_ii], bw_rate, chn_pen_gap, chn_pen_skip, xl, yl);
            if (tmp != INT32_MIN && max_f < tmp + f[max_ii])
                max_f = tmp + f[max_ii], max_j = max_ii;
        }
        f[i] = max_f; p[i] = max_j;
        if ((max_ii < 0) || ((a[i].self_offset<=max_dis+a[max_ii].self_offset)&&(a[i].strand==a[max_ii].strand)&&(f[max_ii]<f[i]))) {
            max_ii = i;
        }
        if(f[i] >= msc) {
            ovl = get_chainLen(a[i].self_offset, a[i].self_offset, xl, a[i].offset, a[i].offset, yl);
            if(f[i] > msc || ovl < movl) {
                msc = f[i]; msc_i = i; movl = ovl;
            }
        }
        if(f[i] < plus) plus = f[i];
        ii[i] = 0;///for mcopy, not here
        // if(a_n && a[0].readID == 4412344) {
        //     fprintf(stderr, "i::%ld[M::%s::%c] q::%u, t::%u, st::%ld, max_ii::%ld, f[i]::%d, p[i]::%ld, msc_i::%ld, msc::%ld, movl::%ld\n", 
        //                     i, __func__, "+-"[a[i].strand], 
        //                     a[i].self_offset, a[i].offset, st, max_ii, f[i], p[i], msc_i, msc, movl);
        // }
    }

    for (i = msc_i, cL = 0; i >= 0; i = p[i]) { ii[i] = 1; t[cL++] = i;}///label the best chain

    if(mcopy_num > 1) {
        // if(a[0].readID == 4412344) {
        //     fprintf(stderr, "[M::%s::] msc::%ld, cL::%ld\n", __func__, msc, cL);
        // }
        if(cL >= mcopy_khit_cutoff) {///if there are too few k-mers, disable mcopy
            msc -= plus; min_sc = msc*mcopy_rate/**0.2**/; ii[msc_i] = 0;
            for (i = ch_n = 0; i < a_n; ++i) {///make all f[] positive
                f[i] -= plus; if(i >= ch_n) t[i] = 0;
                if((!(ii[i])) && (f[i] >= min_sc)) {///!(ii[i]): skip the best chain
                    t[ch_n] = ((uint64_t)f[i])<<32; t[ch_n] += (i<<1); ch_n++;
                }
            }
            // if(a[0].readID == 4412344) {
            //     fprintf(stderr, "[M::%s::] msc::%ld, min_sc::%ld, cL::%ld, ch_n::%ld, mcopy_num::%ld\n", __func__, msc, min_sc, cL, ch_n, mcopy_num);
            // }
            if(ch_n > 1) {
                int64_t n_v, n_v0, ni, n_u, n_u0 = res->length; 
                radix_sort_hc64i(t, t + ch_n);
                for (k = ch_n-1, n_v = n_u = 0; k >= 0 && n_u < mcopy_num; --k) {
                    n_v0 = n_v;
                    for (i = ((uint32_t)t[k])>>1; i >= 0 && (t[i]&1) == 0; ) {
                        ii[n_v++] = i; t[i] |= 1; i = p[i];
                    }
                    if(n_v0 == n_v) continue;
                    sc = (i<0?(t[k]>>32):((t[k]>>32)-f[i]));
                    // if(a[0].readID == 4412344) {
                    //     fprintf(stderr, "+[M::%s::] sc::%ld, n_a::%ld\n", __func__, sc, n_v-n_v0);
                    // }
                    if(sc >= min_sc) {
                        kv_pushp_ol(overlap_region, (*res), &z);
                        push_ovlp_chain_qgen(z, xid, xl, yl, sc+plus, &(a[ii[n_v-1]]), &(a[ii[n_v0]]));
                        // if(a[0].readID == 4412344) {
                        //     fprintf(stderr, "-[M::%s::] sc::%ld, n_a::%ld, q::[%u,%u), t::[%u,%u), %c\n", __func__, sc, n_v-n_v0, z->x_pos_s, z->x_pos_e + 1, z->y_pos_s, z->y_pos_e + 1, "+-"[z->y_pos_strand]);
                        // }
                        ///mcopy_khit_cutoff <= 1: disable the mcopy_khit_cutoff filtering, for the realignment
                        // if((mcopy_khit_cutoff <= 1) || ((z->x_pos_e+1-z->x_pos_s) <= (movl<<2))) {
                        if((!n_u) || (n_v - n_v0 > 1)) {
                            z->align_length = n_v-n_v0; z->x_id = n_v0;
                            n_u++;
                        } else {///non-best is tiny
                            res->length--; n_v = n_v0;
                        }
                    } else {
                        n_v = n_v0;
                    }
                }

                // if(n_u > 1) ks_introsort_or_sss(n_u, res->list + n_u0); 
                // res->length = n_u0 + filter_non_ovlp_xchains(res->list + n_u0, n_u, &n_v);
                n_u = res->length;
                if(n_u > n_u0 + 1) {
                    kv_resize_cl(k_mer_hit, (*cl), (n_v+cl->length));
                    a = cl->list + a_idx; des = cl->list + des_idx; swap = cl->list + cl->length; 
                    for (k = n_u0, i = n_v0 = n_v = 0; k < n_u; k++) {
                        z = &(res->list[k]);
                        z->non_homopolymer_errors = des_idx + i;
                        n_v0 = z->x_id; ni = z->align_length;
                        for (j = 0; j < ni; j++, i++) {
                            ///k0 + (ni - j - 1)
                            swap[i] = a[ii[n_v0 + (ni- j - 1)]]; 
                            swap[i].readID = k; 
                        }
                        z->x_id = xid; 
                        if(gen_cigar) gen_fake_cigar(&(z->f_cigar), z, apend_be, swap+i-ni, ni);
                        if(!khit_n) z->align_length = 0; 
                    }
                    memcpy(des, swap, i*sizeof((*swap))); //assert(i == ch_n);
                    
                    // fprintf(stderr, "[M::%s::msc->%ld] msc_k_hits::%u, cL::%ld, min_sc::%ld, best_sc::%ld, n_u0_sc::%d, mcopy_rate::%f, # chains::%ld\n", 
                    // __func__, msc, res->list[n_u0].align_length, cL, min_sc, msc+plus, res->list[n_u0].shared_seed,
                    // mcopy_rate, n_u-n_u0);
                } else if(n_u == n_u0 + 1) {
                    z = &(res->list[n_u0]); k = n_u0; i = 0;
                    z->non_homopolymer_errors = des_idx + i;
                    n_v0 = z->x_id; ni = z->align_length;
                    for (j = 0; j < ni; j++, i++) {
                        ///k0 + (ni - j - 1)
                        des[i] = a[ii[n_v0 + (ni- j - 1)]]; 
                        des[i].readID = k; 
                    }
                    z->x_id = xid; 
                    if(gen_cigar) gen_fake_cigar(&(z->f_cigar), z, apend_be, des+i-ni, ni);
                    if(!khit_n) z->align_length = 0; 
                }
                return i;
            } else {
                msc += plus; i = msc_i; cL = 0; 
                while (i >= 0) {t[cL++] = i; i = p[i];}
            }
        }
    }



    ///a[] has been sorted by self_offset
    // i = msc_i; cL = 0; 
    // while (i >= 0) {t[cL++] = i; i = p[i];}
    kv_pushp_ol(overlap_region, (*res), &z);
    push_ovlp_chain_qgen(z, xid, xl, yl, msc, &(a[t[cL-1]]), &(a[t[0]]));
    for (i = 0; i < cL; i++) {des[i] = a[t[cL-i-1]]; des[i].readID = res->length-1;}
    z->non_homopolymer_errors = des_idx;
    if(gen_cigar) gen_fake_cigar(&(z->f_cigar), z, apend_be, des, cL);
    if(khit_n) z->align_length = cL;
    return cL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq 0x68(%rbp), %rax
movq 0x60(%rbp), %rax
movq 0x58(%rbp), %rax
movq 0x50(%rbp), %rax
movl 0x48(%rbp), %eax
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movl 0x28(%rbp), %eax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x38(%rbp)
movq %rsi, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
movq %rcx, -0x50(%rbp)
movq %r8, -0x58(%rbp)
movq %r9, -0x60(%rbp)
movsd %xmm0, -0x68(%rbp)
movsd %xmm1, -0x70(%rbp)
movsd %xmm2, -0x78(%rbp)
movsd %xmm3, -0x80(%rbp)
cmpq $0x0, -0x48(%rbp)
jg 0x27672
movq $0x0, -0x30(%rbp)
jmp 0x28e6d
movq $0x0, -0xf0(%rbp)
movq $0x0, -0x148(%rbp)
movq -0x58(%rbp), %rdi
movq -0x48(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x226f0
movq $0x1, -0x100(%rbp)
movq -0x58(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x118(%rbp)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x128(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x150(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x158(%rbp)
cmpq $0x0, 0x40(%rbp)
je 0x277b2
movq -0x150(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq 0x30(%rbp), %rdx
movq 0x38(%rbp), %rcx
movsd -0x68(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
movsd -0x78(%rbp), %xmm2
movq -0x88(%rbp), %r8
movq -0x90(%rbp), %r9
movq -0x118(%rbp), %r13
movq -0x128(%rbp), %r12
leaq -0xf0(%rbp), %r15
leaq -0xc8(%rbp), %r14
leaq -0xd0(%rbp), %rbx
leaq -0xe8(%rbp), %r11
leaq -0x108(%rbp), %r10
leaq -0x110(%rbp), %rax
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq %rax, 0x38(%rsp)
callq 0x26d10
jmp 0x2780a
movq $-0x80000000, -0xd0(%rbp) # imm = 0x80000000
movq $-0x80000000, -0xc8(%rbp) # imm = 0x80000000
movq $0x7fffffff, -0xe8(%rbp) # imm = 0x7FFFFFFF
movq $0x0, -0xf0(%rbp)
movq $0x0, -0x108(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x90(%rbp), %rdi
movq -0x48(%rbp), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2100
movq -0x108(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq %rax, -0x130(%rbp)
movq $-0x1, -0xd8(%rbp)
movq -0x130(%rbp), %rax
cmpq -0x110(%rbp), %rax
jge 0x27f86
movq -0x150(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
andl $0xff, %eax
movl %eax, %eax
movq %rax, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
movq $-0x1, -0xb8(%rbp)
movq $-0x1, -0xb0(%rbp)
movq -0x130(%rbp), %rax
subq -0xa8(%rbp), %rax
cmpq 0x18(%rbp), %rax
jle 0x278ab
movq -0x130(%rbp), %rax
subq 0x18(%rbp), %rax
movq %rax, -0xa8(%rbp)
jmp 0x278ad
movq -0x150(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movq -0x150(%rbp), %rcx
movq -0xa8(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
shrl $0x1f, %ecx
cmpl %ecx, %eax
je 0x278f9
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x278ad
movq -0x130(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
cmpq -0xa8(%rbp), %rax
jl 0x27a7b
movq -0x150(%rbp), %rdi
movq -0x130(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq -0x150(%rbp), %rsi
movq -0x140(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movsd -0x78(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
movsd -0x70(%rbp), %xmm2
movq 0x30(%rbp), %rdx
movq 0x38(%rbp), %rcx
callq 0x2b3c0
cltq
movq %rax, -0xc0(%rbp)
cmpq $-0x80000000, -0xc0(%rbp) # imm = 0x80000000
jne 0x27980
jmp 0x27a64
movq -0x118(%rbp), %rax
movq -0x140(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
addq -0xc0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
cmpq -0x98(%rbp), %rax
jle 0x279ea
movq -0xc0(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xa0(%rbp)
jle 0x279e8
movq -0xa0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xa0(%rbp)
jmp 0x27a29
movq -0x90(%rbp), %rax
movq -0x140(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x130(%rbp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jne 0x27a27
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa0(%rbp)
cmpq 0x10(%rbp), %rax
jle 0x27a25
jmp 0x27a7b
jmp 0x27a27
jmp 0x27a29
movq -0x88(%rbp), %rax
movq -0x140(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jl 0x27a62
movq -0x130(%rbp), %rdx
movq -0x90(%rbp), %rax
movq -0x88(%rbp), %rcx
movq -0x140(%rbp), %rsi
movq (%rcx,%rsi,8), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x27a64
movq -0x140(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x140(%rbp)
jmp 0x2790b
movq -0x140(%rbp), %rax
movq %rax, -0xb8(%rbp)
cmpq $0x0, -0xd8(%rbp)
jl 0x27b08
movq -0x150(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x150(%rbp), %rcx
movq -0xd8(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
addq 0x20(%rbp), %rcx
cmpq %rcx, %rax
jg 0x27b08
movq -0x150(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movq -0x150(%rbp), %rcx
movq -0xd8(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
shrl $0x1f, %ecx
cmpl %ecx, %eax
je 0x27c35
movl $0x80000000, -0x11c(%rbp) # imm = 0x80000000
movq $-0x1, -0xd8(%rbp)
movq -0x130(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rcx
xorl %eax, %eax
cmpq -0xa8(%rbp), %rcx
movb %al, -0x191(%rbp)
jl 0x27bd0
movq -0x150(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
movq 0x20(%rbp), %rdx
movq -0x150(%rbp), %rax
movq -0x140(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movl 0x8(%rax), %eax
addq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x191(%rbp)
jg 0x27bd0
movq -0x150(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movq -0x150(%rbp), %rcx
movq -0x140(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
shrl $0x1f, %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x191(%rbp)
movb -0x191(%rbp), %al
testb $0x1, %al
jne 0x27bdc
jmp 0x27c33
movl -0x11c(%rbp), %eax
movq -0x118(%rbp), %rcx
movq -0x140(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x27c1a
movq -0x118(%rbp), %rax
movq -0x140(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x11c(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0xd8(%rbp)
jmp 0x27c1c
movq -0x140(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x140(%rbp)
jmp 0x27b2f
jmp 0x27c35
cmpq $0x0, -0xd8(%rbp)
jl 0x27d41
movq -0xd8(%rbp), %rax
cmpq -0xb8(%rbp), %rax
jge 0x27d41
movq -0x150(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movq -0x150(%rbp), %rcx
movq -0xd8(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
shrl $0x1f, %ecx
cmpl %ecx, %eax
jne 0x27d41
movq -0x150(%rbp), %rdi
movq -0x130(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq -0x150(%rbp), %rsi
movq -0xd8(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movsd -0x78(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
movsd -0x70(%rbp), %xmm2
movq 0x30(%rbp), %rdx
movq 0x38(%rbp), %rcx
callq 0x2b3c0
movl %eax, -0x120(%rbp)
cmpl $0x80000000, -0x120(%rbp) # imm = 0x80000000
je 0x27d3f
movq -0x98(%rbp), %rax
movl -0x120(%rbp), %ecx
movq -0x118(%rbp), %rdx
movq -0xd8(%rbp), %rsi
addl (%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x27d3f
movl -0x120(%rbp), %eax
movq -0x118(%rbp), %rcx
movq -0xd8(%rbp), %rdx
addl (%rcx,%rdx,4), %eax
cltq
movq %rax, -0x98(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0xb0(%rbp)
jmp 0x27d41
movq -0x98(%rbp), %rax
movl %eax, %edx
movq -0x118(%rbp), %rax
movq -0x130(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0xb0(%rbp), %rdx
movq -0x88(%rbp), %rax
movq -0x130(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
cmpq $0x0, -0xd8(%rbp)
jl 0x27e1a
movq -0x150(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0x20(%rbp), %rcx
movq -0x150(%rbp), %rdx
movq -0xd8(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rdx
movl 0x8(%rdx), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jg 0x27e28
movq -0x150(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movq -0x150(%rbp), %rcx
movq -0xd8(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
shrl $0x1f, %ecx
cmpl %ecx, %eax
jne 0x27e28
movq -0x118(%rbp), %rax
movq -0xd8(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x118(%rbp), %rcx
movq -0x130(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x27e28
movq -0x130(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x118(%rbp), %rax
movq -0x130(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
cmpq -0xc8(%rbp), %rax
jl 0x27f26
movq -0x150(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %edi
movq -0x150(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %esi
movq 0x30(%rbp), %rdx
movq -0x150(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, %ecx
movq -0x150(%rbp), %rax
movq -0x130(%rbp), %r8
shlq $0x4, %r8
addq %r8, %rax
movl 0x4(%rax), %eax
movl %eax, %r8d
movq 0x38(%rbp), %r9
callq 0x21580
movq %rax, -0xe0(%rbp)
movq -0x118(%rbp), %rax
movq -0x130(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
cmpq -0xc8(%rbp), %rax
jg 0x27eef
movq -0xe0(%rbp), %rax
cmpq -0xe8(%rbp), %rax
jge 0x27f24
movq -0x118(%rbp), %rax
movq -0x130(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq %rax, -0xc8(%rbp)
movq -0x130(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0xe8(%rbp)
jmp 0x27f26
movq -0x118(%rbp), %rax
movq -0x130(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
cmpq -0xf0(%rbp), %rax
jge 0x27f5a
movq -0x118(%rbp), %rax
movq -0x130(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq %rax, -0xf0(%rbp)
movq -0x128(%rbp), %rax
movq -0x130(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x130(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x130(%rbp)
jmp 0x2782a
movq -0xd0(%rbp), %rax
movq %rax, -0x130(%rbp)
movq $0x0, -0x148(%rbp)
cmpq $0x0, -0x130(%rbp)
jl 0x28000
movq -0x128(%rbp), %rax
movq -0x130(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x130(%rbp), %rdx
movq -0x90(%rbp), %rax
movq -0x148(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x148(%rbp)
movq %rdx, (%rax,%rcx,8)
movq -0x88(%rbp), %rax
movq -0x130(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x130(%rbp)
jmp 0x27f9f
cmpq $0x1, 0x58(%rbp)
jle 0x28ba4
movq -0x148(%rbp), %rax
cmpq 0x60(%rbp), %rax
jl 0x28ba2
movq -0xf0(%rbp), %rcx
movq -0xc8(%rbp), %rax
subq %rcx, %rax
movq %rax, -0xc8(%rbp)
cvtsi2sdq -0xc8(%rbp), %xmm0
mulsd -0x80(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0xf8(%rbp)
movq -0x128(%rbp), %rax
movq -0xd0(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq $0x0, -0x100(%rbp)
movq $0x0, -0x130(%rbp)
movq -0x130(%rbp), %rax
cmpq -0x48(%rbp), %rax
jge 0x28171
movq -0xf0(%rbp), %rsi
movq -0x118(%rbp), %rax
movq -0x130(%rbp), %rcx
movslq (%rax,%rcx,4), %rdx
subq %rsi, %rdx
movl %edx, (%rax,%rcx,4)
movq -0x130(%rbp), %rax
cmpq -0x100(%rbp), %rax
jl 0x280cf
movq -0x90(%rbp), %rax
movq -0x130(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x128(%rbp), %rax
movq -0x130(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x28158
movq -0x118(%rbp), %rax
movq -0x130(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
cmpq -0xf8(%rbp), %rax
jl 0x28158
movq -0x118(%rbp), %rax
movq -0x130(%rbp), %rcx
movslq (%rax,%rcx,4), %rdx
shlq $0x20, %rdx
movq -0x90(%rbp), %rax
movq -0x100(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x130(%rbp), %rdx
shlq %rdx
movq -0x90(%rbp), %rax
movq -0x100(%rbp), %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x100(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x100(%rbp)
jmp 0x2815a
movq -0x130(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x130(%rbp)
jmp 0x28079
cmpq $0x1, -0x100(%rbp)
jle 0x28b24
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x190(%rbp)
movq -0x90(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x100(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x1d3c0
movq -0x100(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x138(%rbp)
movq $0x0, -0x188(%rbp)
movq $0x0, -0x170(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x138(%rbp)
movb %al, -0x192(%rbp)
jl 0x281fd
movq -0x188(%rbp), %rax
cmpq 0x58(%rbp), %rax
setl %al
movb %al, -0x192(%rbp)
movb -0x192(%rbp), %al
testb $0x1, %al
jne 0x2820c
jmp 0x285c8
movq -0x170(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x90(%rbp), %rax
movq -0x138(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrl %eax
movl %eax, %eax
movq %rax, -0x130(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x130(%rbp)
movb %al, -0x193(%rbp)
jl 0x2826c
movq -0x90(%rbp), %rax
movq -0x130(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
cmpq $0x0, %rax
sete %al
movb %al, -0x193(%rbp)
movb -0x193(%rbp), %al
testb $0x1, %al
jne 0x28278
jmp 0x282d8
movq -0x130(%rbp), %rax
movl %eax, %edx
movq -0x128(%rbp), %rax
movq -0x170(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x170(%rbp)
movl %edx, (%rax,%rcx,4)
movq -0x90(%rbp), %rax
movq -0x130(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
orq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x88(%rbp), %rax
movq -0x130(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x130(%rbp)
jmp 0x28237
movq -0x178(%rbp), %rax
cmpq -0x170(%rbp), %rax
jne 0x282ed
jmp 0x285b1
cmpq $0x0, -0x130(%rbp)
jge 0x28316
movq -0x90(%rbp), %rax
movq -0x138(%rbp), %rcx
movq (%rax,%rcx,8), %rax
sarq $0x20, %rax
movq %rax, -0x1a0(%rbp)
jmp 0x28348
movq -0x90(%rbp), %rax
movq -0x138(%rbp), %rcx
movq (%rax,%rcx,8), %rax
sarq $0x20, %rax
movq -0x118(%rbp), %rcx
movq -0x130(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
subq %rcx, %rax
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
cmpq -0xf8(%rbp), %rax
jl 0x285a1
jmp 0x2836c
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x60(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2848b
movq -0x60(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1a8(%rbp)
movq -0x60(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x283af
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1b0(%rbp)
jmp 0x283bd
movl $0x2, %eax
movq %rax, -0x1b0(%rbp)
jmp 0x283bd
movq -0x1a8(%rbp), %rdi
movq -0x1b0(%rbp), %rax
imulq $0xa8, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, (%rax)
movq -0x60(%rbp), %rax
movq (%rax), %rax
movq -0x60(%rbp), %rcx
imulq $0xa8, 0x8(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x1b8(%rbp)
movq -0x60(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2841d
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1c0(%rbp)
jmp 0x2842b
movl $0x2, %eax
movq %rax, -0x1c0(%rbp)
jmp 0x2842b
movq -0x1b8(%rbp), %rdi
movq -0x1c0(%rbp), %rax
movq -0x60(%rbp), %rcx
subq 0x8(%rcx), %rax
imulq $0xa8, %rax, %rdx
xorl %esi, %esi
callq 0x2100
movq -0x60(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2846e
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1c8(%rbp)
jmp 0x2847c
movl $0x2, %eax
movq %rax, -0x1c8(%rbp)
jmp 0x2847c
movq -0x1c8(%rbp), %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x60(%rbp), %rax
movq (%rax), %rax
movq -0x60(%rbp), %rdx
movq 0x10(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x10(%rdx)
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rdi
movl 0x28(%rbp), %esi
movq 0x30(%rbp), %rdx
movq 0x38(%rbp), %rcx
movq -0xc0(%rbp), %r8
addq -0xf0(%rbp), %r8
movq -0x150(%rbp), %r9
movq -0x128(%rbp), %rax
movq -0x170(%rbp), %r10
subq $0x1, %r10
movslq (%rax,%r10,4), %rax
shlq $0x4, %rax
addq %rax, %r9
movq -0x150(%rbp), %rax
movq -0x128(%rbp), %r10
movq -0x178(%rbp), %r11
movslq (%r10,%r11,4), %r10
shlq $0x4, %r10
addq %r10, %rax
movq %rax, (%rsp)
callq 0x24dc0
cmpq $0x0, -0x188(%rbp)
je 0x28541
movq -0x170(%rbp), %rax
subq -0x178(%rbp), %rax
cmpq $0x1, %rax
jle 0x28581
movq -0x170(%rbp), %rax
subq -0x178(%rbp), %rax
movl %eax, %ecx
movq -0x168(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x178(%rbp), %rax
movl %eax, %ecx
movq -0x168(%rbp), %rax
movl %ecx, (%rax)
movq -0x188(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x188(%rbp)
jmp 0x2859f
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x178(%rbp), %rax
movq %rax, -0x170(%rbp)
jmp 0x285af
movq -0x178(%rbp), %rax
movq %rax, -0x170(%rbp)
jmp 0x285b1
movq -0x138(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x138(%rbp)
jmp 0x281d7
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rax
movq -0x190(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jle 0x28948
jmp 0x285f4
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x170(%rbp), %rcx
movq -0x38(%rbp), %rdx
addq 0x8(%rdx), %rcx
cmpq %rcx, %rax
jge 0x286e4
movq -0x170(%rbp), %rcx
movq -0x38(%rbp), %rax
addq 0x8(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
sarq %rcx
movq -0x38(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
sarq $0x2, %rcx
movq -0x38(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
sarq $0x4, %rcx
movq -0x38(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
sarq $0x8, %rcx
movq -0x38(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
sarq $0x10, %rcx
movq -0x38(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rsi
shlq $0x4, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
jmp 0x286e6
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x150(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x158(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x160(%rbp)
movq -0x190(%rbp), %rax
movq %rax, -0x138(%rbp)
movq $0x0, -0x170(%rbp)
movq $0x0, -0x178(%rbp)
movq $0x0, -0x130(%rbp)
movq -0x138(%rbp), %rax
cmpq -0x188(%rbp), %rax
jge 0x28925
movq -0x60(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x138(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x168(%rbp)
movq -0x50(%rbp), %rax
addq -0x130(%rbp), %rax
movl %eax, %ecx
movq -0x168(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x168(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x178(%rbp)
movq -0x168(%rbp), %rax
movl 0x28(%rax), %eax
movq %rax, -0x180(%rbp)
movq $0x0, -0x140(%rbp)
movq -0x140(%rbp), %rax
cmpq -0x180(%rbp), %rax
jge 0x2889c
movq -0x150(%rbp), %rcx
movq -0x128(%rbp), %rax
movq -0x178(%rbp), %rdx
movq -0x180(%rbp), %rsi
subq -0x140(%rbp), %rsi
subq $0x1, %rsi
addq %rsi, %rdx
movslq (%rax,%rdx,4), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x160(%rbp), %rax
movq -0x130(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x138(%rbp), %rax
movl %eax, %edx
movq -0x160(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x140(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x140(%rbp)
movq -0x130(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x130(%rbp)
jmp 0x287d7
movl 0x28(%rbp), %ecx
movq -0x168(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, 0x50(%rbp)
je 0x288f7
movq -0x168(%rbp), %rdi
addq $0x38, %rdi
movq -0x168(%rbp), %rsi
movl 0x48(%rbp), %eax
movl %eax, %edx
movq -0x160(%rbp), %rcx
movq -0x130(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
xorl %eax, %eax
subq -0x180(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x180(%rbp), %r8
callq 0x1e3a0
cmpq $0x0, 0x68(%rbp)
jne 0x2890c
movq -0x168(%rbp), %rax
movl $0x0, 0x28(%rax)
jmp 0x2890e
movq -0x138(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x138(%rbp)
jmp 0x28764
movq -0x158(%rbp), %rdi
movq -0x160(%rbp), %rsi
movq -0x130(%rbp), %rdx
shlq $0x4, %rdx
callq 0x2180
jmp 0x28b14
movq -0x188(%rbp), %rax
movq -0x190(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x28b12
movq -0x60(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x190(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x168(%rbp)
movq -0x190(%rbp), %rax
movq %rax, -0x138(%rbp)
movq $0x0, -0x130(%rbp)
movq -0x50(%rbp), %rax
addq -0x130(%rbp), %rax
movl %eax, %ecx
movq -0x168(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x168(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x178(%rbp)
movq -0x168(%rbp), %rax
movl 0x28(%rax), %eax
movq %rax, -0x180(%rbp)
movq $0x0, -0x140(%rbp)
movq -0x140(%rbp), %rax
cmpq -0x180(%rbp), %rax
jge 0x28aa0
movq -0x150(%rbp), %rcx
movq -0x128(%rbp), %rax
movq -0x178(%rbp), %rdx
movq -0x180(%rbp), %rsi
subq -0x140(%rbp), %rsi
subq $0x1, %rsi
addq %rsi, %rdx
movslq (%rax,%rdx,4), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x158(%rbp), %rax
movq -0x130(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x138(%rbp), %rax
movl %eax, %edx
movq -0x158(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x140(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x140(%rbp)
movq -0x130(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x130(%rbp)
jmp 0x289db
movl 0x28(%rbp), %ecx
movq -0x168(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, 0x50(%rbp)
je 0x28afb
movq -0x168(%rbp), %rdi
addq $0x38, %rdi
movq -0x168(%rbp), %rsi
movl 0x48(%rbp), %eax
movl %eax, %edx
movq -0x158(%rbp), %rcx
movq -0x130(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
xorl %eax, %eax
subq -0x180(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x180(%rbp), %r8
callq 0x1e3a0
cmpq $0x0, 0x68(%rbp)
jne 0x28b10
movq -0x168(%rbp), %rax
movl $0x0, 0x28(%rax)
jmp 0x28b12
jmp 0x28b14
movq -0x130(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x28e6d
movq -0xf0(%rbp), %rax
addq -0xc8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x130(%rbp)
movq $0x0, -0x148(%rbp)
cmpq $0x0, -0x130(%rbp)
jl 0x28b9e
movq -0x130(%rbp), %rdx
movq -0x90(%rbp), %rax
movq -0x148(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x148(%rbp)
movq %rdx, (%rax,%rcx,8)
movq -0x88(%rbp), %rax
movq -0x130(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x130(%rbp)
jmp 0x28b52
jmp 0x28ba0
jmp 0x28ba2
jmp 0x28ba4
jmp 0x28ba6
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x60(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x28cc5
movq -0x60(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1d0(%rbp)
movq -0x60(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x28be9
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1d8(%rbp)
jmp 0x28bf7
movl $0x2, %eax
movq %rax, -0x1d8(%rbp)
jmp 0x28bf7
movq -0x1d0(%rbp), %rdi
movq -0x1d8(%rbp), %rax
imulq $0xa8, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, (%rax)
movq -0x60(%rbp), %rax
movq (%rax), %rax
movq -0x60(%rbp), %rcx
imulq $0xa8, 0x8(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x1e0(%rbp)
movq -0x60(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x28c57
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1e8(%rbp)
jmp 0x28c65
movl $0x2, %eax
movq %rax, -0x1e8(%rbp)
jmp 0x28c65
movq -0x1e0(%rbp), %rdi
movq -0x1e8(%rbp), %rax
movq -0x60(%rbp), %rcx
subq 0x8(%rcx), %rax
imulq $0xa8, %rax, %rdx
xorl %esi, %esi
callq 0x2100
movq -0x60(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x28ca8
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1f0(%rbp)
jmp 0x28cb6
movl $0x2, %eax
movq %rax, -0x1f0(%rbp)
jmp 0x28cb6
movq -0x1f0(%rbp), %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x60(%rbp), %rax
movq (%rax), %rax
movq -0x60(%rbp), %rdx
movq 0x10(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x10(%rdx)
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rdi
movl 0x28(%rbp), %esi
movq 0x30(%rbp), %rdx
movq 0x38(%rbp), %rcx
movq -0xc8(%rbp), %r8
movq -0x150(%rbp), %r9
movq -0x90(%rbp), %rax
movq -0x148(%rbp), %r10
subq $0x1, %r10
movq (%rax,%r10,8), %rax
shlq $0x4, %rax
addq %rax, %r9
movq -0x150(%rbp), %rax
movq -0x90(%rbp), %r10
movq (%r10), %r10
shlq $0x4, %r10
addq %r10, %rax
movq %rax, (%rsp)
callq 0x24dc0
movq $0x0, -0x130(%rbp)
movq -0x130(%rbp), %rax
cmpq -0x148(%rbp), %rax
jge 0x28e07
movq -0x150(%rbp), %rcx
movq -0x90(%rbp), %rax
movq -0x148(%rbp), %rdx
subq -0x130(%rbp), %rdx
subq $0x1, %rdx
movq (%rax,%rdx,8), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x158(%rbp), %rax
movq -0x130(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
subq $0x1, %rax
movl %eax, %edx
movq -0x158(%rbp), %rax
movq -0x130(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x130(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x130(%rbp)
jmp 0x28d59
movq -0x50(%rbp), %rax
movl %eax, %ecx
movq -0x168(%rbp), %rax
movl %ecx, 0x30(%rax)
cmpq $0x0, 0x50(%rbp)
je 0x28e48
movq -0x168(%rbp), %rdi
addq $0x38, %rdi
movq -0x168(%rbp), %rsi
movl 0x48(%rbp), %eax
movl %eax, %edx
movq -0x158(%rbp), %rcx
movq -0x148(%rbp), %r8
callq 0x1e3a0
cmpq $0x0, 0x68(%rbp)
je 0x28e62
movq -0x148(%rbp), %rax
movl %eax, %ecx
movq -0x168(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x148(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)