// File: chhylp123[P]hifiasm/inter.cpp
// Function: gl_rchain_lin_contain_adv(overlap_region_alloc*, kv_ul_ov_t*, ul_ov_t*, kv_rtrace_t*, ul_idx_t const*, ug_opt_t const*, long, double, long, long, long, long, Chain_Data*, bit_extz_t*, unsigned long*, long, All_reads*, char*, UC_Read*, long, double, long)
int64_t gl_rchain_lin_contain_adv(overlap_region_alloc* ol, kv_ul_ov_t *res, ul_ov_t *ex, kv_rtrace_t *trace, const ul_idx_t *uref, const ug_opt_t *uopt, int64_t bw, 
double diff_ec_ul, int64_t qlen, int64_t max_skip, int64_t max_iter, int64_t max_dis, Chain_Data* dp, bit_extz_t *exz, uint64_t *id,
int64_t trans_sc, All_reads *ridx, char* qstr, UC_Read *tu, int64_t rid, double e_rate, int64_t need_srt)
{
	if(res->n == 0) return 0;
    uint32_t li_v, rev_n, is_fc, cc, idn, mqs, mqe; int32_t *f, *c_n, *c_sc, *rch, *ssc; int64_t *p, *t, res_n = res->n, st, max_ii, max, max_n; 
    int64_t mm_ovlp, x, i, j, k, sc, csc, mm_sc, mm_idx, mm_n, sn, n_skip, end_j, plus; ul_ov_t *li, *lj, rr, mrr; rtrace_iter tc; uint64_t ovlp;
    resize_Chain_Data(dp, res_n<<1, NULL);///res_n<<1
    t = dp->tmp; f = dp->score; p = dp->pre; c_n = dp->occ; 
	c_sc = rch = dp->self_length; ssc = dp->indels;
	if(need_srt) {
        radix_sort_ul_ov_srt_qe(res->a, res->a + res_n);
        for (i = 1, j = 0; i <= res_n; i++) {
			res->a[i-1].qs = ((uint32_t)-1)-res->a[i-1].qs;
            if (i == res_n || res->a[i].qe != res->a[j].qe) {
                if(i - j > 1) radix_sort_ul_ov_srt_qs(res->a+j, res->a+i);
                j = i;
            }
        }
    }

	memset(t, 0, (res_n*sizeof((*t)))); 
	for (i = st = plus = 0, max_ii = -1; i < res_n; ++i) {
        li = &(res->a[i]); li_v = (li->tn<<1)|li->rev; li->qs = ((uint32_t)-1)-li->qs;
		rch[i] = INT32_MAX; ssc[i] = INT32_MIN; 
        mm_ovlp = max_ovlp_src_contain(uopt, li_v^1);        
        x = (li->qs + mm_ovlp)*diff_ec_ul; 
        if(x < bw) x = bw; 
        x += li->qs + mm_ovlp;
        if (x > qlen+1) x = qlen+1;
		// if(li->tn == 20171 || li->tn == 20209 || li->tn == 20204) {
		// 	fprintf(stderr, "\n[i::%ld] (id::%u)%.*s\t%c\tq::[%u, %u)\tt::[%u, %u)\tc::%u\tmax_d::%ld\n", i, li->tn,
        //             (int)Get_NAME_LENGTH(R_INF, res->a[i].tn), Get_NAME(R_INF, res->a[i].tn), 
		// 			"+-"[res->a[i].rev], res->a[i].qs, res->a[i].qe, res->a[i].ts, res->a[i].te,
		// 			!res->a[i].el, x+G_CHAIN_INDEL);
		// }
        x = find_ul_ov_max(i, res->a, x+G_CHAIN_INDEL); 
		// if(li->tn == 6312) {
		// 	fprintf(stderr, "[i::%ld] (id::%u)%.*s\t%c\tq::[%u, %u)\tt::[%u, %u)\tc::%u\tmax_j::%ld\n", i, li->tn,
        //             (int)Get_NAME_LENGTH(R_INF, res->a[i].tn), Get_NAME(R_INF, res->a[i].tn), 
		// 			"+-"[res->a[i].rev], res->a[i].qs, res->a[i].qe, res->a[i].ts, res->a[i].te,
		// 			!res->a[i].el, x);
		// }
        csc = li->qe - li->qs; csc -= (((int64_t)li->sec)*trans_sc);
        // mm_sc = csc; mm_idx = -1; mm_n = 1;
		mm_sc = INT32_MIN; mm_idx = -1; mm_n = 0; is_fc = 0;
        n_skip = 0; end_j = -1; tc.k = INT32_MAX;
        if ((x-st) > max_iter) st = x-max_iter;
        for (j = x; j >= st; --j) { // collect potential destination vertices
            lj = &(res->a[j]); 
			if(lj->qe <= li->qs) break;//even this pair has a overlap, its length will be very small; just ignore
			sc = connect_detect(res->a, res->n, i, j, ridx, rch, uref, uopt, bw, diff_ec_ul, p, f, &tc,
																trace, qstr, tu, ol, exz, e_rate, trans_sc, &cc);
			if(sc == INT32_MIN) continue;
			sn = c_n[j] + 1;
			// if(li->tn == 6312) {
			// 	fprintf(stderr, "(id::%u)%.*s\t%c\t(id::%u)%.*s\t%c\tsc::%ld\tsn::%ld\tc_n[j]::%d\tmsc::%ld\ti::%ld\tj::%ld\tm_idx::%ld\n", 
			// 		li->tn,	(int)Get_NAME_LENGTH(R_INF, li->tn), Get_NAME(R_INF, li->tn), "+-"[li->rev],
			// 		lj->tn,	(int)Get_NAME_LENGTH(R_INF, lj->tn), Get_NAME(R_INF, lj->tn), "+-"[lj->rev], 
			// 		sc, sn, c_n[j], mm_sc, i, j, mm_idx);
			// }
			// if(li->tn == 20209) {
			// 	fprintf(stderr, "[i::%ld] (id::%u)%.*s\t%c\tj::%ld\tsc::%ld\tsn::%ld\n", i, li->tn,
            //         (int)Get_NAME_LENGTH(R_INF, res->a[i].tn), Get_NAME(R_INF, res->a[i].tn), 
			// 		"+-"[res->a[i].rev], j, sc, sn);
			// }
			if((sc > mm_sc) || ((sc == mm_sc) && (sn > mm_n))) {
				mm_sc = sc, mm_idx = j; mm_n = sn; is_fc = cc;
				if (n_skip > 0) --n_skip;
			} else if (t[j] == i) {
				if (++n_skip > max_skip)
					break;
			}
			if (p[j] >= 0) t[p[j]] = i;
        }

        end_j = j;
        if (max_ii < 0 || (res->a[i].qe>(res->a[max_ii].qe+max_dis))) {//too long
            max = INT32_MIN; max_n = INT32_MIN; max_ii = -1;
            for (j = i - 1; (j >= st) && (res->a[i].qe<=(max_dis+res->a[j].qe)); --j) {
                if ((max < f[j]) || ((max == f[j]) && (max_n < c_n[j]))) {
                    max = f[j]; max_n = c_n[j]; max_ii = j;
                }
            }
        }

        if (max_ii >= 0 && max_ii < end_j) {///just have a try with a[i]<->a[max_ii]
            lj = &(res->a[max_ii]); 
            if(lj->qe > li->qs/** && lj->qs < li->qs**/) {
				///as max_ii < end_j, get_rid_backward_cigar_err still works
				sc = connect_detect(res->a, res->n, i, max_ii, ridx, rch, uref, uopt, bw, diff_ec_ul, p, f, &tc,
																trace, qstr, tu, ol, exz, e_rate, trans_sc, &cc);
				if(sc != INT32_MIN) {
					sn = c_n[max_ii] + 1;
					// if(li->tn == 6312 || li->tn == 6322 || li->tn == 6317 || li->tn == 6319/** && lj->tn == 6329**/) {
					// 	fprintf(stderr, "(id::%u)%.*s\t%c\t(id::%u)%.*s\t%c\tsc::%ld\tsn::%ld\tc_n[j]::%d\tmsc::%ld\ti::%ld\tmax_ii::%ld\tm_idx::%ld\n", 
					// 		li->tn,	(int)Get_NAME_LENGTH(R_INF, li->tn), Get_NAME(R_INF, li->tn), "+-"[li->rev],
					// 		lj->tn,	(int)Get_NAME_LENGTH(R_INF, lj->tn), Get_NAME(R_INF, lj->tn), "+-"[lj->rev], 
					// 		sc, sn, c_n[j], mm_sc, i, max_ii, mm_idx);
					// }
					if((sc > mm_sc) || ((sc == mm_sc) && (sn > mm_n))) {
                        mm_sc = sc; mm_idx = max_ii; mm_n = sn; is_fc = cc;
                    }
				}
            }
        }

		sc = csc; sn = 1;///for i itself
		if((sc > mm_sc) || ((sc == mm_sc) && (sn > mm_n))) {
			mm_sc = sc, mm_idx = -1; mm_n = sn; is_fc = 0;
		}

        if(mm_sc < 0) {
            mm_sc = csc; mm_idx = -1; mm_n = 1;
        }

		// if(li->tn == 6317) {
		// 	fprintf(stderr, "+(id::%u)%.*s\t%c\tmm_idx::%ld\tmm_sc::%ld\tmm_n::%ld\n", 
		// 		li->tn,	(int)Get_NAME_LENGTH(R_INF, li->tn), Get_NAME(R_INF, li->tn), "+-"[li->rev], mm_idx, mm_sc, mm_n);
		// }

		if(mm_idx >= 0) {
			///mo meed to update mm_sc and is_fc
			propagate_transitive_reduction(uref, uopt, ridx, bw, diff_ec_ul, res->a, x+1, i, rch, f, p, c_n, t, &mm_sc, &mm_idx, &mm_n);
		}
		// if(li->tn == 6317) {
		// 	fprintf(stderr, "-(id::%u)%.*s\t%c\tmm_idx::%ld\tmm_sc::%ld\tmm_n::%ld\n", 
		// 		li->tn,	(int)Get_NAME_LENGTH(R_INF, li->tn), Get_NAME(R_INF, li->tn), "+-"[li->rev], mm_idx, mm_sc, mm_n);
		// }
		// collapse_contain(res->a, res_n, i, &mm_idx, &mm_sc, p, c_sc, end_j);

        f[i] = mm_sc; p[i] = mm_idx; c_n[i] = mm_n; 
		if(mm_idx < 0 || ((ssc[mm_idx] < mm_sc) && (is_fc == 0))) ssc[i] = mm_sc;
		else ssc[i] = ssc[mm_idx];

        if ((max_ii < 0) || ((res->a[i].qe<=max_dis+res->a[max_ii].qe) && (f[max_ii]<f[i]))) {
            max_ii = i;
        }
        if(ssc[i] < plus) plus = ssc[i];//minmun negative
		// if(li->tn == 20171 || li->tn == 20209 || li->tn == 20204) {
		// 	fprintf(stderr, "[i::%ld]\tf::%d\tp::%ld\n", i, f[i], p[i]);
		// }
        
    }

	for (i = 0; i < res_n; ++i) {///make all f[] positive
        ssc[i] -= plus; t[i] = ((uint64_t)ssc[i])<<32; t[i] += (i<<1);
    }

	int64_t n_v, n_u, n_v0; mrr.qn = (uint32_t)-1; mrr.qe = mrr.qs = 0;
	int32_t *f0, *c_n0, *c_sc0, *rch0, *ssc0; int64_t *p0, *t0;
	f0 = f + res_n; c_n0 = c_n + res_n; c_sc0 = c_sc + res_n;
	rch0 = rch + res_n; ssc0 = ssc + res_n; p0 = p + res_n; t0 = t + res_n;
    radix_sort_gfa64i(t, t + res_n); plus = 0; mqs = UINT32_MAX; mqe = 0;
    for (k = res_n-1, n_v = n_u = 0; k >= 0; --k) {
        n_v0 = n_v; idn = 0;
        for (i = ((uint32_t)t[k])>>1; i >= 0 && (t[i]&1) == 0; ) {
			if(res->a[i].qs < mqs) mqs = res->a[i].qs;
			if(res->a[i].qe > mqe) mqe = res->a[i].qe;
            // ex[n_v] = res->a[i]; ex[n_v].sec = i;
			id[idn++] = i; t[i] |= 1; i = p[i]; n_v++;
        }
        if(n_v0 == n_v) continue;
        sc = (i<0?(t[k]>>32):((t[k]>>32)-f[i]));


		if((mrr.qn != (uint32_t)-1) && (sc < (c_sc[mrr.qn]*0.98))) {
			ovlp = ((MIN(mrr.qe, mqe) > MAX(mrr.qs, mqs))? (MIN(mrr.qe, mqe) - MAX(mrr.qs, mqs)):0);
			if(ovlp >= ((mqe-mqs)*0.95)) {
				n_v = n_v0; continue;
			}
		}

		rev_n = idn>>1;
		for (i = 0; i < rev_n; i++) {
			st = id[i]; id[i] = id[idn-i-1]; id[idn-i-1] = st;
		}
		n_v = n_v0 + gen_trans_aln(ol, ridx, uref, uopt, bw, diff_ec_ul, qlen, id, idn, res->a, res_n, mqs, mqe, t, 
		f0, c_n0, c_sc0, rch0, ssc0, p0, t0, max_skip, max_iter, max_dis, exz, trans_sc, qstr, tu, e_rate, trace, 1000, ex + n_v0, &rr);
		assert(n_v > n_v0);
        c_n[n_u] = n_v-n_v0; c_sc[n_u] = sc; n_u++; if(sc < plus) plus = sc;
		if((mrr.qn == (uint32_t)-1) || (sc > c_sc[mrr.qn]) || 
						((sc == c_sc[mrr.qn]) && ((rr.qe - rr.qs) > (mrr.qe - mrr.qs)))) {
			mrr = rr; mrr.qn = n_u - 1;
		}
    }

    // fprintf(stderr, "---[M::%s] n_u:%ld, n_v:%ld\n", __func__, n_u, n_v);
    for (k = 0, n_v = n_v0 = 0; k < n_u; k++) {
        n_v0 = n_v; n_v += c_n[k];
        res->a[k].qn = c_sc[k]-plus;//score
        res->a[k].ts = n_v0; res->a[k].te = n_v;///idx
		res->a[k].qs = ex[n_v0].qs; res->a[k].qe = ex[n_v-1].qe;
        // fprintf(stderr, "[M::%s] k:%ld, c_sc:%d\n", __func__, k, c_sc[k]);
		// res->a[k].te = res->a[k].ts + flat_contain(ridx, uref, uopt, bw, diff_ec_ul, qlen, max_skip, max_iter, max_dis, 
		// ex + res->a[k].ts, res->a[k].te - res->a[k].ts, f, ssc, p, t, &(res->a[k]));
    }
    res->n = n_u; 
    radix_sort_ul_ov_srt_qn(res->a, res->a + res->n);//sort by score

	// if(res->n > 0) {
	// 	fprintf(stderr, "[M::%s::rid->%ld] qlen::%ld, q::[%u, %u), sc::%u\n", 
	// 	__func__, rid, qlen, res->a[res->n-1].qs, res->a[res->n-1].qe, res->a[res->n-1].qn);
	// }
    return n_v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x478, %rsp            # imm = 0x478
movq 0x78(%rbp), %rax
movq 0x70(%rbp), %rax
movq 0x68(%rbp), %rax
movq 0x60(%rbp), %rax
movq 0x58(%rbp), %rax
movq 0x50(%rbp), %rax
movq 0x48(%rbp), %rax
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
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)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x2b82e6
movq $0x0, -0x30(%rbp)
jmp 0x2b9b1c
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xd0(%rbp)
movq 0x38(%rbp), %rdi
movq -0xd0(%rbp), %rsi
shlq %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x226f0
movq 0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0xc8(%rbp)
movq 0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movq 0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xc0(%rbp)
movq 0x38(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0xa0(%rbp)
movq 0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xb0(%rbp)
movq %rax, -0xa8(%rbp)
movq 0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xb8(%rbp)
cmpq $0x0, 0x78(%rbp)
je 0x2b849e
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rax
movq (%rax), %rsi
imulq $0x1c, -0xd0(%rbp), %rax
addq %rax, %rsi
callq 0x27b350
movq $0x1, -0x108(%rbp)
movq $0x0, -0x110(%rbp)
movq -0x108(%rbp), %rax
cmpq -0xd0(%rbp), %rax
jg 0x2b849c
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq -0x108(%rbp), %rcx
subq $0x1, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
subl 0x4(%rax), %ecx
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq -0x108(%rbp), %rdx
subq $0x1, %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x108(%rbp), %rax
cmpq -0xd0(%rbp), %rax
je 0x2b8438
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x108(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x40(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0x110(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
je 0x2b8483
movq -0x108(%rbp), %rax
subq -0x110(%rbp), %rax
cmpq $0x1, %rax
jle 0x2b8475
movq -0x40(%rbp), %rax
movq (%rax), %rdi
imulq $0x1c, -0x110(%rbp), %rax
addq %rax, %rdi
movq -0x40(%rbp), %rax
movq (%rax), %rsi
imulq $0x1c, -0x108(%rbp), %rax
addq %rax, %rsi
callq 0x27b890
movq -0x108(%rbp), %rax
movq %rax, -0x110(%rbp)
jmp 0x2b8485
movq -0x108(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x108(%rbp)
jmp 0x2b83ab
jmp 0x2b849e
movq -0xc8(%rbp), %rdi
movq -0xd0(%rbp), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2100
movq $0x0, -0x160(%rbp)
movq $0x0, -0xd8(%rbp)
movq $0x0, -0x108(%rbp)
movq $-0x1, -0xe0(%rbp)
movq -0x108(%rbp), %rax
cmpq -0xd0(%rbp), %rax
jge 0x2b8ff4
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x108(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rax
movl 0xc(%rax), %eax
shll %eax
movq -0x168(%rbp), %rcx
movl 0x18(%rcx), %ecx
shrl $0x1f, %ecx
orl %ecx, %eax
movl %eax, -0x74(%rbp)
movq -0x168(%rbp), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
subl 0x4(%rax), %ecx
movq -0x168(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0xb0(%rbp), %rax
movq -0x108(%rbp), %rcx
movl $0x7fffffff, (%rax,%rcx,4) # imm = 0x7FFFFFFF
movq -0xb8(%rbp), %rax
movq -0x108(%rbp), %rcx
movl $0x80000000, (%rax,%rcx,4) # imm = 0x80000000
movq -0x60(%rbp), %rdi
movl -0x74(%rbp), %esi
xorl $0x1, %esi
callq 0x2b2850
movq %rax, -0xf8(%rbp)
movq -0x168(%rbp), %rax
movl 0x4(%rax), %eax
addq -0xf8(%rbp), %rax
cvtsi2sd %rax, %xmm0
mulsd -0x68(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
cmpq 0x10(%rbp), %rax
jge 0x2b85c6
movq 0x10(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x168(%rbp), %rax
movl 0x4(%rax), %eax
addq -0xf8(%rbp), %rax
addq -0x100(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movq 0x18(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jle 0x2b8608
movq 0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x100(%rbp)
movq -0x108(%rbp), %rax
movl %eax, %edi
movq -0x40(%rbp), %rax
movq (%rax), %rsi
movq -0x100(%rbp), %rax
addq $0x80, %rax
movl %eax, %edx
callq 0x28cf00
cltq
movq %rax, -0x100(%rbp)
movq -0x168(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x168(%rbp), %rcx
subl 0x4(%rcx), %eax
movl %eax, %eax
movq %rax, -0x128(%rbp)
movq -0x168(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movl %eax, %eax
movl %eax, %ecx
imulq 0x50(%rbp), %rcx
movq -0x128(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x128(%rbp)
movq $-0x80000000, -0x130(%rbp) # imm = 0x80000000
movq $-0x1, -0x138(%rbp)
movq $0x0, -0x140(%rbp)
movl $0x0, -0x7c(%rbp)
movq $0x0, -0x150(%rbp)
movq $-0x1, -0x158(%rbp)
movq $0x7fffffff, -0x240(%rbp) # imm = 0x7FFFFFFF
movq -0x100(%rbp), %rax
subq -0xd8(%rbp), %rax
cmpq 0x28(%rbp), %rax
jle 0x2b86ea
movq -0x100(%rbp), %rax
subq 0x28(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x100(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jl 0x2b8987
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x110(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x168(%rbp), %rcx
cmpl 0x4(%rcx), %eax
ja 0x2b8740
jmp 0x2b8987
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x108(%rbp), %rdx
movq -0x110(%rbp), %rcx
movq 0x58(%rbp), %r8
movq -0xb0(%rbp), %r9
movq -0x58(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movsd -0x68(%rbp), %xmm0
movq -0xc0(%rbp), %rax
movq %rax, -0x2b0(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movq -0x50(%rbp), %r12
movq 0x60(%rbp), %r15
movq 0x68(%rbp), %r14
movq -0x38(%rbp), %rbx
movq 0x40(%rbp), %r11
movsd -0x70(%rbp), %xmm1
movq 0x50(%rbp), %r10
leaq -0x240(%rbp), %r13
leaq -0x80(%rbp), %rax
movq %rax, -0x2a0(%rbp)
movq -0x2c8(%rbp), %rax
movq %rax, (%rsp)
movq -0x2c0(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x2b8(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0x2b0(%rbp), %rax
movq %rax, 0x18(%rsp)
movq -0x2a8(%rbp), %rax
movq %rax, 0x20(%rsp)
movq -0x2a0(%rbp), %rax
movq %r13, 0x28(%rsp)
movq %r12, 0x30(%rsp)
movq %r15, 0x38(%rsp)
movq %r14, 0x40(%rsp)
movq %rbx, 0x48(%rsp)
movq %r11, 0x50(%rsp)
movq %r10, 0x58(%rsp)
movq %rax, 0x60(%rsp)
callq 0x2b2210
movq %rax, -0x120(%rbp)
cmpq $-0x80000000, -0x120(%rbp) # imm = 0x80000000
jne 0x2b8861
jmp 0x2b8970
movq -0xa0(%rbp), %rax
movq -0x110(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl $0x1, %eax
cltq
movq %rax, -0x148(%rbp)
movq -0x120(%rbp), %rax
cmpq -0x130(%rbp), %rax
jg 0x2b88ae
movq -0x120(%rbp), %rax
cmpq -0x130(%rbp), %rax
jne 0x2b88fc
movq -0x148(%rbp), %rax
cmpq -0x140(%rbp), %rax
jle 0x2b88fc
movq -0x120(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x140(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x7c(%rbp)
cmpq $0x0, -0x150(%rbp)
jle 0x2b88fa
movq -0x150(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x150(%rbp)
jmp 0x2b8935
movq -0xc8(%rbp), %rax
movq -0x110(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x108(%rbp), %rax
jne 0x2b8933
movq -0x150(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x150(%rbp)
cmpq 0x20(%rbp), %rax
jle 0x2b8931
jmp 0x2b8987
jmp 0x2b8933
jmp 0x2b8935
movq -0xc0(%rbp), %rax
movq -0x110(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jl 0x2b896e
movq -0x108(%rbp), %rdx
movq -0xc8(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq -0x110(%rbp), %rsi
movq (%rcx,%rsi,8), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x2b8970
movq -0x110(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x110(%rbp)
jmp 0x2b86f8
movq -0x110(%rbp), %rax
movq %rax, -0x158(%rbp)
cmpq $0x0, -0xe0(%rbp)
jl 0x2b89d6
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x108(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x40(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x1c, -0xe0(%rbp), %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
addq 0x30(%rbp), %rcx
cmpq %rcx, %rax
jle 0x2b8b22
movq $-0x80000000, -0xe8(%rbp) # imm = 0x80000000
movq $-0x80000000, -0xf0(%rbp) # imm = 0x80000000
movq $-0x1, -0xe0(%rbp)
movq -0x108(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rcx
xorl %eax, %eax
cmpq -0xd8(%rbp), %rcx
movb %al, -0x2c9(%rbp)
jl 0x2b8a5e
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x108(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0x30(%rbp), %rcx
movq -0x40(%rbp), %rdx
movq (%rdx), %rdx
imulq $0x1c, -0x110(%rbp), %rsi
addq %rsi, %rdx
movl 0x8(%rdx), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
setle %al
movb %al, -0x2c9(%rbp)
movb -0x2c9(%rbp), %al
testb $0x1, %al
jne 0x2b8a6d
jmp 0x2b8b20
movq -0xe8(%rbp), %rax
movq -0x98(%rbp), %rcx
movq -0x110(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpq %rcx, %rax
jl 0x2b8ac7
movq -0xe8(%rbp), %rax
movq -0x98(%rbp), %rcx
movq -0x110(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpq %rcx, %rax
jne 0x2b8b07
movq -0xf0(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq -0x110(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpq %rcx, %rax
jge 0x2b8b07
movq -0x98(%rbp), %rax
movq -0x110(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq %rax, -0xe8(%rbp)
movq -0xa0(%rbp), %rax
movq -0x110(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq %rax, -0xf0(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0xe0(%rbp)
jmp 0x2b8b09
movq -0x110(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x110(%rbp)
jmp 0x2b8a09
jmp 0x2b8b22
cmpq $0x0, -0xe0(%rbp)
jl 0x2b8d16
movq -0xe0(%rbp), %rax
cmpq -0x158(%rbp), %rax
jge 0x2b8d16
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0xe0(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x168(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jbe 0x2b8d14
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x108(%rbp), %rdx
movq -0xe0(%rbp), %rcx
movq 0x58(%rbp), %r8
movq -0xb0(%rbp), %r9
movq -0x58(%rbp), %rax
movq %rax, -0x300(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x2f8(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movsd -0x68(%rbp), %xmm0
movq -0xc0(%rbp), %rax
movq %rax, -0x2e8(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x2e0(%rbp)
movq -0x50(%rbp), %r12
movq 0x60(%rbp), %r15
movq 0x68(%rbp), %r14
movq -0x38(%rbp), %rbx
movq 0x40(%rbp), %r11
movsd -0x70(%rbp), %xmm1
movq 0x50(%rbp), %r10
leaq -0x240(%rbp), %r13
leaq -0x80(%rbp), %rax
movq %rax, -0x2d8(%rbp)
movq -0x300(%rbp), %rax
movq %rax, (%rsp)
movq -0x2f8(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x2f0(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0x2e8(%rbp), %rax
movq %rax, 0x18(%rsp)
movq -0x2e0(%rbp), %rax
movq %rax, 0x20(%rsp)
movq -0x2d8(%rbp), %rax
movq %r13, 0x28(%rsp)
movq %r12, 0x30(%rsp)
movq %r15, 0x38(%rsp)
movq %r14, 0x40(%rsp)
movq %rbx, 0x48(%rsp)
movq %r11, 0x50(%rsp)
movq %r10, 0x58(%rsp)
movq %rax, 0x60(%rsp)
callq 0x2b2210
movq %rax, -0x120(%rbp)
cmpq $-0x80000000, -0x120(%rbp) # imm = 0x80000000
je 0x2b8d12
movq -0xa0(%rbp), %rax
movq -0xe0(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl $0x1, %eax
cltq
movq %rax, -0x148(%rbp)
movq -0x120(%rbp), %rax
cmpq -0x130(%rbp), %rax
jg 0x2b8ce0
movq -0x120(%rbp), %rax
cmpq -0x130(%rbp), %rax
jne 0x2b8d10
movq -0x148(%rbp), %rax
cmpq -0x140(%rbp), %rax
jle 0x2b8d10
movq -0x120(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x140(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x2b8d12
jmp 0x2b8d14
jmp 0x2b8d16
movq -0x128(%rbp), %rax
movq %rax, -0x120(%rbp)
movq $0x1, -0x148(%rbp)
movq -0x120(%rbp), %rax
cmpq -0x130(%rbp), %rax
jg 0x2b8d5f
movq -0x120(%rbp), %rax
cmpq -0x130(%rbp), %rax
jne 0x2b8d8d
movq -0x148(%rbp), %rax
cmpq -0x140(%rbp), %rax
jle 0x2b8d8d
movq -0x120(%rbp), %rax
movq %rax, -0x130(%rbp)
movq $-0x1, -0x138(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x140(%rbp)
movl $0x0, -0x7c(%rbp)
cmpq $0x0, -0x130(%rbp)
jge 0x2b8dbb
movq -0x128(%rbp), %rax
movq %rax, -0x130(%rbp)
movq $-0x1, -0x138(%rbp)
movq $0x1, -0x140(%rbp)
cmpq $0x0, -0x138(%rbp)
jl 0x2b8e7f
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq 0x58(%rbp), %rdx
movq 0x10(%rbp), %rcx
movsd -0x68(%rbp), %xmm0
movq -0x40(%rbp), %rax
movq (%rax), %r8
movq -0x100(%rbp), %rax
addq $0x1, %rax
movl %eax, %r9d
movq -0x108(%rbp), %rax
movq %rax, -0x310(%rbp)
movq -0xb0(%rbp), %r13
movq -0x98(%rbp), %r12
movq -0xc0(%rbp), %r15
movq -0xa0(%rbp), %r14
movq -0xc8(%rbp), %rbx
leaq -0x130(%rbp), %r11
leaq -0x138(%rbp), %r10
leaq -0x140(%rbp), %rax
movq %rax, -0x308(%rbp)
movq -0x310(%rbp), %rax
movq %rax, (%rsp)
movq -0x308(%rbp), %rax
movq %r13, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq %r15, 0x18(%rsp)
movq %r14, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movq %r11, 0x30(%rsp)
movq %r10, 0x38(%rsp)
movq %rax, 0x40(%rsp)
callq 0x2b5cc0
movq -0x130(%rbp), %rax
movl %eax, %edx
movq -0x98(%rbp), %rax
movq -0x108(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x138(%rbp), %rdx
movq -0xc0(%rbp), %rax
movq -0x108(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x140(%rbp), %rax
movl %eax, %edx
movq -0xa0(%rbp), %rax
movq -0x108(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
cmpq $0x0, -0x138(%rbp)
jl 0x2b8ef7
movq -0xb8(%rbp), %rax
movq -0x138(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
cmpq -0x130(%rbp), %rax
jge 0x2b8f13
cmpl $0x0, -0x7c(%rbp)
jne 0x2b8f13
movq -0x130(%rbp), %rax
movl %eax, %edx
movq -0xb8(%rbp), %rax
movq -0x108(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x2b8f35
movq -0xb8(%rbp), %rax
movq -0x138(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0xb8(%rbp), %rax
movq -0x108(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
cmpq $0x0, -0xe0(%rbp)
jl 0x2b8f99
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x108(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0x30(%rbp), %rcx
movq -0x40(%rbp), %rdx
movq (%rdx), %rdx
imulq $0x1c, -0xe0(%rbp), %rsi
addq %rsi, %rdx
movl 0x8(%rdx), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jg 0x2b8fa7
movq -0x98(%rbp), %rax
movq -0xe0(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x98(%rbp), %rcx
movq -0x108(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2b8fa7
movq -0x108(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xb8(%rbp), %rax
movq -0x108(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
cmpq -0x160(%rbp), %rax
jge 0x2b8fdb
movq -0xb8(%rbp), %rax
movq -0x108(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq %rax, -0x160(%rbp)
jmp 0x2b8fdd
movq -0x108(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x108(%rbp)
jmp 0x2b84e3
movq $0x0, -0x108(%rbp)
movq -0x108(%rbp), %rax
cmpq -0xd0(%rbp), %rax
jge 0x2b908d
movq -0x160(%rbp), %rsi
movq -0xb8(%rbp), %rax
movq -0x108(%rbp), %rcx
movslq (%rax,%rcx,4), %rdx
subq %rsi, %rdx
movl %edx, (%rax,%rcx,4)
movq -0xb8(%rbp), %rax
movq -0x108(%rbp), %rcx
movslq (%rax,%rcx,4), %rdx
shlq $0x20, %rdx
movq -0xc8(%rbp), %rax
movq -0x108(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x108(%rbp), %rdx
shlq %rdx
movq -0xc8(%rbp), %rax
movq -0x108(%rbp), %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x108(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x108(%rbp)
jmp 0x2b8fff
movl $0xffffffff, -0x1a8(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x1a4(%rbp)
movl $0x0, -0x1a0(%rbp)
movq -0x98(%rbp), %rax
movq -0xd0(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x268(%rbp)
movq -0xa0(%rbp), %rax
movq -0xd0(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x270(%rbp)
movq -0xa8(%rbp), %rax
movq -0xd0(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x278(%rbp)
movq -0xb0(%rbp), %rax
movq -0xd0(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x280(%rbp)
movq -0xb8(%rbp), %rax
movq -0xd0(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x288(%rbp)
movq -0xc0(%rbp), %rax
movq -0xd0(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x290(%rbp)
movq -0xc8(%rbp), %rax
movq -0xd0(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x298(%rbp)
movq -0xc8(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movq -0xd0(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x27ae10
movq $0x0, -0x160(%rbp)
movl $0xffffffff, -0x88(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x8c(%rbp)
movq -0xd0(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x118(%rbp)
movq $0x0, -0x258(%rbp)
movq $0x0, -0x250(%rbp)
cmpq $0x0, -0x118(%rbp)
jl 0x2b99a9
movq -0x250(%rbp), %rax
movq %rax, -0x260(%rbp)
movl $0x0, -0x84(%rbp)
movq -0xc8(%rbp), %rax
movq -0x118(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrl %eax
movl %eax, %eax
movq %rax, -0x108(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x108(%rbp)
movb %al, -0x311(%rbp)
jl 0x2b924f
movq -0xc8(%rbp), %rax
movq -0x108(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
cmpq $0x0, %rax
sete %al
movb %al, -0x311(%rbp)
movb -0x311(%rbp), %al
testb $0x1, %al
jne 0x2b925e
jmp 0x2b933a
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x108(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
cmpl -0x88(%rbp), %eax
jae 0x2b9296
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x108(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x88(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x108(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x8c(%rbp), %eax
jbe 0x2b92ce
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x108(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x8c(%rbp)
movq -0x108(%rbp), %rdx
movq 0x48(%rbp), %rax
movl -0x84(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x84(%rbp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq -0xc8(%rbp), %rax
movq -0x108(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
orq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0xc0(%rbp), %rax
movq -0x108(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x108(%rbp)
movq -0x250(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x250(%rbp)
jmp 0x2b921a
movq -0x260(%rbp), %rax
cmpq -0x250(%rbp), %rax
jne 0x2b934f
jmp 0x2b9992
cmpq $0x0, -0x108(%rbp)
jge 0x2b9378
movq -0xc8(%rbp), %rax
movq -0x118(%rbp), %rcx
movq (%rax,%rcx,8), %rax
sarq $0x20, %rax
movq %rax, -0x320(%rbp)
jmp 0x2b93aa
movq -0xc8(%rbp), %rax
movq -0x118(%rbp), %rcx
movq (%rax,%rcx,8), %rax
sarq $0x20, %rax
movq -0x98(%rbp), %rcx
movq -0x108(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
subq %rcx, %rax
movq %rax, -0x320(%rbp)
movq -0x320(%rbp), %rax
movq %rax, -0x120(%rbp)
cmpl $-0x1, -0x1a8(%rbp)
je 0x2b9551
cvtsi2sdq -0x120(%rbp), %xmm1
movq -0xa8(%rbp), %rax
movl -0x1a8(%rbp), %ecx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movsd 0xd7350(%rip), %xmm2    # 0x390738
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2b9551
movl -0x1a0(%rbp), %eax
cmpl -0x8c(%rbp), %eax
ja 0x2b9412
movl -0x1a0(%rbp), %eax
movl %eax, -0x324(%rbp)
jmp 0x2b941e
movl -0x8c(%rbp), %eax
movl %eax, -0x324(%rbp)
movl -0x324(%rbp), %eax
movl %eax, -0x328(%rbp)
movl -0x1a4(%rbp), %eax
cmpl -0x88(%rbp), %eax
jb 0x2b9446
movl -0x1a4(%rbp), %eax
movl %eax, -0x32c(%rbp)
jmp 0x2b9452
movl -0x88(%rbp), %eax
movl %eax, -0x32c(%rbp)
movl -0x328(%rbp), %eax
movl -0x32c(%rbp), %ecx
cmpl %ecx, %eax
jbe 0x2b94d4
movl -0x1a0(%rbp), %eax
cmpl -0x8c(%rbp), %eax
ja 0x2b947e
movl -0x1a0(%rbp), %eax
movl %eax, -0x330(%rbp)
jmp 0x2b948a
movl -0x8c(%rbp), %eax
movl %eax, -0x330(%rbp)
movl -0x330(%rbp), %eax
movl %eax, -0x334(%rbp)
movl -0x1a4(%rbp), %eax
cmpl -0x88(%rbp), %eax
jb 0x2b94b2
movl -0x1a4(%rbp), %eax
movl %eax, -0x338(%rbp)
jmp 0x2b94be
movl -0x88(%rbp), %eax
movl %eax, -0x338(%rbp)
movl -0x334(%rbp), %eax
movl -0x338(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x33c(%rbp)
jmp 0x2b94de
xorl %eax, %eax
movl %eax, -0x33c(%rbp)
jmp 0x2b94de
movl -0x33c(%rbp), %eax
movl %eax, %eax
movq %rax, -0x248(%rbp)
movaps 0xc8b1c(%rip), %xmm1    # 0x382010
movq -0x248(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xc8b18(%rip), %xmm1    # 0x382020
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movl -0x8c(%rbp), %eax
movl -0x88(%rbp), %ecx
subl %ecx, %eax
cvtsi2sd %rax, %xmm1
movsd 0xc8cee(%rip), %xmm2    # 0x382220
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x2b954f
movq -0x260(%rbp), %rax
movq %rax, -0x250(%rbp)
jmp 0x2b9992
jmp 0x2b9551
movl -0x84(%rbp), %eax
shrl %eax
movl %eax, -0x78(%rbp)
movq $0x0, -0x108(%rbp)
movq -0x108(%rbp), %rax
movl -0x78(%rbp), %ecx
cmpq %rcx, %rax
jge 0x2b95eb
movq 0x48(%rbp), %rax
movq -0x108(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xd8(%rbp)
movq 0x48(%rbp), %rax
movl -0x84(%rbp), %ecx
subq -0x108(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
movq 0x48(%rbp), %rax
movq -0x108(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0xd8(%rbp), %rdx
movq 0x48(%rbp), %rax
movl -0x84(%rbp), %ecx
subq -0x108(%rbp), %rcx
subq $0x1, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x108(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x108(%rbp)
jmp 0x2b9567
movq -0x260(%rbp), %rax
movq %rax, -0x348(%rbp)
movq -0x38(%rbp), %rdi
movq 0x58(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq 0x10(%rbp), %r8
movsd -0x68(%rbp), %xmm0
movq 0x18(%rbp), %r9
movq 0x48(%rbp), %rax
movq %rax, -0x3d0(%rbp)
movl -0x84(%rbp), %eax
movq %rax, -0x3c8(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x3c0(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x3b8(%rbp)
movl -0x88(%rbp), %eax
movq %rax, -0x3b0(%rbp)
movl -0x8c(%rbp), %eax
movq %rax, -0x3a8(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x3a0(%rbp)
movq -0x268(%rbp), %rax
movq %rax, -0x398(%rbp)
movq -0x270(%rbp), %rax
movq %rax, -0x390(%rbp)
movq -0x278(%rbp), %rax
movq %rax, -0x388(%rbp)
movq -0x280(%rbp), %rax
movq %rax, -0x380(%rbp)
movq -0x288(%rbp), %rax
movq %rax, -0x378(%rbp)
movq -0x290(%rbp), %rax
movq %rax, -0x370(%rbp)
movq -0x298(%rbp), %rax
movq %rax, -0x368(%rbp)
movq 0x20(%rbp), %rax
movq %rax, -0x360(%rbp)
movq 0x28(%rbp), %rax
movq %rax, -0x358(%rbp)
movq 0x30(%rbp), %r13
movq 0x40(%rbp), %r12
movq 0x50(%rbp), %r15
movq 0x60(%rbp), %r14
movq 0x68(%rbp), %rbx
movsd -0x70(%rbp), %xmm1
movq -0x50(%rbp), %r11
movq -0x48(%rbp), %r10
imulq $0x1c, -0x260(%rbp), %rax
addq %rax, %r10
leaq -0x18c(%rbp), %rax
movq %rax, -0x350(%rbp)
movq -0x3d0(%rbp), %rax
movq %rax, (%rsp)
movq -0x3c8(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x3c0(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0x3b8(%rbp), %rax
movq %rax, 0x18(%rsp)
movq -0x3b0(%rbp), %rax
movq %rax, 0x20(%rsp)
movq -0x3a8(%rbp), %rax
movq %rax, 0x28(%rsp)
movq -0x3a0(%rbp), %rax
movq %rax, 0x30(%rsp)
movq -0x398(%rbp), %rax
movq %rax, 0x38(%rsp)
movq -0x390(%rbp), %rax
movq %rax, 0x40(%rsp)
movq -0x388(%rbp), %rax
movq %rax, 0x48(%rsp)
movq -0x380(%rbp), %rax
movq %rax, 0x50(%rsp)
movq -0x378(%rbp), %rax
movq %rax, 0x58(%rsp)
movq -0x370(%rbp), %rax
movq %rax, 0x60(%rsp)
movq -0x368(%rbp), %rax
movq %rax, 0x68(%rsp)
movq -0x360(%rbp), %rax
movq %rax, 0x70(%rsp)
movq -0x358(%rbp), %rax
movq %rax, 0x78(%rsp)
movq -0x350(%rbp), %rax
movq %r13, 0x80(%rsp)
movq %r12, 0x88(%rsp)
movq %r15, 0x90(%rsp)
movq %r14, 0x98(%rsp)
movq %rbx, 0xa0(%rsp)
movq %r11, 0xa8(%rsp)
movl $0x3e8, 0xb0(%rsp) # imm = 0x3E8
movq %r10, 0xb8(%rsp)
movq %rax, 0xc0(%rsp)
callq 0x2b7460
movq %rax, %rcx
movq -0x348(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x250(%rbp)
movq -0x250(%rbp), %rax
cmpq -0x260(%rbp), %rax
jle 0x2b9860
jmp 0x2b987f
leaq 0xd8deb(%rip), %rdi     # 0x392652
leaq 0xd6fc1(%rip), %rsi     # 0x39082f
movl $0x2343, %edx           # imm = 0x2343
leaq 0xd8de3(%rip), %rcx     # 0x39265d
callq 0x2130
movq -0x250(%rbp), %rax
subq -0x260(%rbp), %rax
movl %eax, %edx
movq -0xa0(%rbp), %rax
movq -0x258(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x120(%rbp), %rax
movl %eax, %edx
movq -0xa8(%rbp), %rax
movq -0x258(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x258(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x258(%rbp)
movq -0x120(%rbp), %rax
cmpq -0x160(%rbp), %rax
jge 0x2b98ea
movq -0x120(%rbp), %rax
movq %rax, -0x160(%rbp)
cmpl $-0x1, -0x1a8(%rbp)
je 0x2b9949
movq -0x120(%rbp), %rax
movq -0xa8(%rbp), %rcx
movl -0x1a8(%rbp), %edx
movslq (%rcx,%rdx,4), %rcx
cmpq %rcx, %rax
jg 0x2b9949
movq -0x120(%rbp), %rax
movq -0xa8(%rbp), %rcx
movl -0x1a8(%rbp), %edx
movslq (%rcx,%rdx,4), %rcx
cmpq %rcx, %rax
jne 0x2b9990
movl -0x184(%rbp), %eax
subl -0x188(%rbp), %eax
movl -0x1a0(%rbp), %ecx
subl -0x1a4(%rbp), %ecx
cmpl %ecx, %eax
jbe 0x2b9990
movq -0x18c(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x184(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x17c(%rbp), %rax
movq %rax, -0x198(%rbp)
movl -0x174(%rbp), %eax
movl %eax, -0x190(%rbp)
movq -0x258(%rbp), %rax
subq $0x1, %rax
movl %eax, -0x1a8(%rbp)
jmp 0x2b9992
movq -0x118(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x118(%rbp)
jmp 0x2b91d7
movq $0x0, -0x118(%rbp)
movq $0x0, -0x260(%rbp)
movq $0x0, -0x250(%rbp)
movq -0x118(%rbp), %rax
cmpq -0x258(%rbp), %rax
jge 0x2b9ae3
movq -0x250(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0xa0(%rbp), %rax
movq -0x118(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
addq -0x250(%rbp), %rax
movq %rax, -0x250(%rbp)
movq -0xa8(%rbp), %rax
movq -0x118(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
subq -0x160(%rbp), %rax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x118(%rbp), %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x260(%rbp), %rax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x118(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movq -0x250(%rbp), %rax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x118(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x14(%rax)
movq -0x48(%rbp), %rax
imulq $0x1c, -0x260(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x118(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x48(%rbp), %rax
movq -0x250(%rbp), %rcx
subq $0x1, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x40(%rbp), %rax
movq (%rax), %rax
imulq $0x1c, -0x118(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x118(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x118(%rbp)
jmp 0x2b99ca
movq -0x258(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rax
movq (%rax), %rsi
movq -0x40(%rbp), %rax
imulq $0x1c, 0x8(%rax), %rax
addq %rax, %rsi
callq 0x27c310
movq -0x250(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x478, %rsp            # imm = 0x478
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)