// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/ggsimple.c
// Function: mg_ggsimple
void mg_ggsimple(void *km, const mg_ggopt_t *opt, gfa_t *g, int32_t n_seq, const mg_bseq1_t *seq, mg_gchains_t *const* gcs)
{
	int32_t t, i, j, *soff, *qoff, max_acnt, *sc, m_ovlp = 0, *ovlp = 0, n_ins, m_ins, n_inv;
	int32_t l_pseq, m_pseq;
	uint64_t *meta;
	mg_intv_t *sintv, *qintv;
	double a_dens;
	gfa_ins_t *ins;
	char *pseq;

	max_acnt = mg_gc_index(km, opt->min_mapq, opt->min_map_len, opt->min_depth_len, g, n_seq, gcs, &a_dens, &soff, &qoff, &sintv, &qintv);
	if (max_acnt == 0) return;

	// extract poorly regions
	m_pseq = l_pseq = 0, pseq = 0;
	m_ins = n_ins = 0, ins = 0;
	n_inv = 0;
	KMALLOC(km, sc, max_acnt);
	KMALLOC(km, meta, max_acnt);
	for (t = 0; t < n_seq; ++t) {
		const mg_gchains_t *gt = gcs[t];
		for (i = 0; i < gt->n_gc; ++i) {
			const mg_gchain_t *gc = &gt->gc[i];
			int32_t off_a, off_l, n_ss, far_q;
			mg_msseg_t *ss;
			if (gc->id != gc->parent) continue;
			if (gc->blen < opt->min_map_len || gc->mapq < opt->min_mapq) continue;
			assert(gc->cnt > 0);

			// fill sc[]. This part achieves a similar goal to the one in mg_gchain_extra(). It makes more assumptions, but is logically simpler.
			off_l = gc->off;
			off_a = gt->lc[off_l].off + 1;
			far_q = 0;
			for (j = 1; j < gc->n_anchor; ++j, ++off_a) {
				const mg128_t *q = &gt->a[off_a - 1], *p = &gt->a[off_a];
				const mg_llchain_t *lc = &gt->lc[off_l];
				int32_t s, ed = -1, off_l0 = off_l, pd, qd = (int32_t)p->y - (int32_t)q->y, c = (int32_t)(p->x>>32) - (int32_t)(q->x>>32) - 1;
				if ((int32_t)q->y > far_q) far_q = (int32_t)q->y; // far_q keeps the rightmost query position seen so far
				if (off_a == lc->off + lc->cnt) { // we are at the end of the current lchain
					pd = g->seg[lc->v>>1].len - (int32_t)q->x - 1;
					for (++off_l; off_l < gc->off + gc->cnt && gt->lc[off_l].cnt == 0; ++off_l)
						pd += g->seg[gt->lc[off_l].v>>1].len;
					assert(off_l < gc->off + gc->cnt);
					if (gt->lc[off_l].ed >= 0) ed = gt->lc[off_l].ed;
					pd += (int32_t)p->x + 1;
				} else pd = (int32_t)p->x - (int32_t)q->x;
				if ((opt->flag&MG_G_NO_QOVLP) && (int32_t)p->y < far_q) s = 1; // query overlap
				else if (pd == qd && c == 0) s = -opt->match_pen;
				else if (ed >= 0) {
					int32_t min_d = pd < qd? pd : qd;
					double t = 1. / (1.01 - opt->ggs_max_iden);
					if (t > 10.) t = 10.;
					s = (int32_t)(ed * t - min_d);
				} else if (pd > qd) {
					double x = qd * a_dens;
					x = x > c? x : c;
					s = (int32_t)(x + (pd - qd) * a_dens + .499);
				} else {
					s = (int32_t)(qd * a_dens + .499);
					s = s > c? s : c;
				}
				sc[j - 1] = s;
				meta[j-1] = (uint64_t)pd<<32 | off_l0;
			}

			// get regions to insert
			ss = mg_mss_all(0, gc->n_anchor - 1, sc, 10, 0, &n_ss);
			off_a = gt->lc[gc->off].off;
			for (j = 0; j < n_ss; ++j) {
				const mg128_t *p, *q;
				int32_t st, en, ls, le, span, pd, k, n_ovlp, min_len, is_inv = 0;
				gfa_ins_t I;

				// find the initial positions
				min_len = opt->ggs_min_end_cnt > 0? opt->ggs_min_end_cnt : 0;
				if (min_len < ss[j].sc * opt->ggs_min_end_frac) min_len = ss[j].sc * opt->ggs_min_end_frac;
				if (ss[j].st <= min_len || ss[j].en >= gc->n_anchor - 1 - min_len) continue; // too close to ends
				st = ss[j].st, en = ss[j].en;
				q = &gt->a[off_a + st];
				p = &gt->a[off_a + en];
				span = p->y>>32&0xff;
				I.ctg = t;
				ls = (int32_t)meta[st], le = (int32_t)meta[en]; // first and last lchain; CLOSED interval
				assert(ls <= le);
				I.v[0] = gt->lc[ls].v;
				I.v[1] = gt->lc[le].v;
				I.voff[0] = (int32_t)q->x + 1 - span;
				I.voff[1] = (int32_t)p->x + 1;
				I.coff[0] = (int32_t)q->y + 1 - span;
				I.coff[1] = (int32_t)p->y + 1;
				assert(I.voff[0] <= g->seg[I.v[0]>>1].len);
				assert(I.voff[1] <= g->seg[I.v[1]>>1].len);
				for (k = st, pd = span; k < en; ++k)
					pd += meta[k]>>32;

				if (I.coff[0] > I.coff[1]) {
					if (mg_verbose >= 2 && pd + (I.coff[0] - I.coff[1]) >= opt->min_var_len)
						fprintf(stderr, "[W::%s] query overlap on gchain %d: [%c%s:%d,%c%s:%d|%d] <=> %s:[%d,%d|%d]\n", __func__, t, "><"[I.v[0]&1], g->seg[I.v[0]>>1].name, I.voff[0], "><"[I.v[1]&1], g->seg[I.v[1]>>1].name, I.voff[1], pd, seq[t].name, I.coff[0], I.coff[1], I.coff[1] - I.coff[0]);
					continue; // such overlap can't be properly resolved
				}
				pd -= gfa_ins_adj(g, opt->ggs_shrink_pen, &I, seq[t].seq);

				min_len = pd > I.coff[1] - I.coff[0]? pd : I.coff[1] - I.coff[0];
				if (I.coff[0] <= min_len || I.coff[1] >= seq[t].l_seq - min_len) continue; // test if the event is close to ends again

				// filtering
				if (I.coff[1] - I.coff[0] < opt->min_var_len && pd < opt->min_var_len)
					continue;
				for (k = I.coff[0]; k < I.coff[1]; ++k) { // test ambiguous bases
					int c = seq[t].seq[k];
					if (c == 'n' || c == 'N') break;
				}
				if (k != I.coff[1]) continue; // no ambiguous bases on the insert
				n_ovlp = mg_intv_overlap(km, qoff[t+1] - qoff[t], &qintv[qoff[t]], I.coff[0], I.coff[1], &ovlp, &m_ovlp); // test overlapping on the query
				if (n_ovlp == 0) fprintf(stderr, "[W::%s] query interval %s:%d-%d is not covered\n", __func__, seq[t].name, I.coff[0], I.coff[1]);
				if (n_ovlp != 1) continue;
				for (k = ls; k <= le; ++k) { // find other mappings overlapping with the insert on the graph
					uint32_t v = gt->lc[k].v, len = g->seg[v>>1].len;
					int32_t s = 0, e = len, tmp;
					if (k == ls) s = (int32_t)gt->a[off_a+st].x + 1 - (int32_t)(gt->a[off_a+st].y>>32&0xff);
					if (k == le) e = (int32_t)gt->a[off_a+en].x + 1;
					if (v&1) tmp = s, s = len - e, e = len - tmp;
					n_ovlp = mg_intv_overlap(km, soff[(v>>1)+1] - soff[v>>1], &sintv[soff[v>>1]], s, e, &ovlp, &m_ovlp);
					if (n_ovlp == 0) fprintf(stderr, "[W::%s] graph interval %s:%d-%d is not covered by %s:%d-%d\n", __func__, g->seg[v>>1].name, s, e, seq[t].name, I.coff[0], I.coff[1]); // this should be an assert()
					if (n_ovlp != 1) break;
				}
				if (k <= le) continue;
				if (pd - (I.coff[1] - I.coff[0]) < opt->min_var_len && (I.coff[1] - I.coff[0]) - pd < opt->min_var_len) { // if length difference > min_var_len, just insert
					int32_t qd = I.coff[1] - I.coff[0], mlen, blen, score;
					l_pseq = mg_path2seq(km, g, gt, ls, le, I.voff, &pseq, &m_pseq);
					score = mg_wfa_cmp(km, l_pseq, pseq, qd, &seq[t].seq[I.coff[0]], 5000, &mlen, &blen);
					if (score > 0) {
						if (mlen > blen * opt->ggs_max_iden) continue; // make sure k-mer identity is small enough
						if (blen - mlen < opt->min_var_len * opt->ggs_max_iden) continue;
					} else if (!(opt->flag & MG_G_NO_INV)) {
						mg_revcomp_seq(l_pseq, pseq);
						score = mg_wfa_cmp(km, l_pseq, pseq, qd, &seq[t].seq[I.coff[0]], 5000, &mlen, &blen);
						if (score > 0 && mlen > blen * opt->ggs_min_inv_iden) is_inv = 1;
					}
				}
				if (mg_dbg_flag & MG_DBG_INSERT) {
					int32_t mlen, blen, score, qd = I.coff[1] - I.coff[0];
					l_pseq = mg_path2seq(km, g, gt, ls, le, I.voff, &pseq, &m_pseq);
					fprintf(stderr, "IN\t[%c%s:%d,%c%s:%d|%d] <=> %s:[%d,%d|%d] inv:%d\n", "><"[I.v[0]&1], g->seg[I.v[0]>>1].name, I.voff[0], "><"[I.v[1]&1], g->seg[I.v[1]>>1].name, I.voff[1], pd, seq[t].name, I.coff[0], I.coff[1], I.coff[1] - I.coff[0], is_inv);
					fprintf(stderr, "IP\t%s\nIQ\t", pseq);
					fwrite(&seq[t].seq[I.coff[0]], 1, qd, stderr);
					if (pd - qd < opt->min_var_len && qd - pd < opt->min_var_len) {
						score = mg_wfa_cmp(km, l_pseq, pseq, qd, &seq[t].seq[I.coff[0]], 5000, &mlen, &blen);
					} else score = -1, mlen = 0, blen = pd > qd? pd : qd;
					fprintf(stderr, "\nIS\t%d==%d\tnwcmp:%d\tmlen:%d\tblen:%d\n", pd, l_pseq, score, mlen, blen);
				}
				if (is_inv) { // turn one inversion to two events
					gfa_ins_t I_inv[2];
					I_inv[0].ctg = I_inv[1].ctg = I.ctg;
					// the first event
					I_inv[0].coff[0] = I_inv[0].coff[1] = I.coff[0];
					I_inv[0].v[0] = I.v[0];
					I_inv[0].voff[0] = I.voff[0];
					I_inv[0].v[1] = I.v[1]^1;
					I_inv[0].voff[1] = g->seg[I.v[1]>>1].len - I.voff[1];
					// the second event
					I_inv[1].coff[0] = I_inv[1].coff[1] = I.coff[1];
					I_inv[1].v[0] = I.v[0]^1;
					I_inv[1].voff[0] = g->seg[I.v[0]>>1].len - I.voff[0];
					I_inv[1].v[1] = I.v[1];
					I_inv[1].voff[1] = I.voff[1];
					// insert
					if (n_ins == m_ins) KEXPAND(km, ins, m_ins);
					ins[n_ins++] = I_inv[0];
					if (n_ins == m_ins) KEXPAND(km, ins, m_ins);
					ins[n_ins++] = I_inv[1];
					++n_inv;
				} else {
					if (n_ins == m_ins) KEXPAND(km, ins, m_ins);
					ins[n_ins++] = I;
				}
			}
			kfree(0, ss);
		}
	}
	kfree(km, pseq);
	kfree(km, ovlp);
	kfree(km, sc);
	kfree(km, meta);
	kfree(km, soff); kfree(km, qoff);
	kfree(km, sintv); kfree(km, qintv);

	if (n_ins > 0) {
		char **names, **seqs;
		KMALLOC(km, names, n_seq);
		KMALLOC(km, seqs, n_seq);
		for (i = 0; i < n_seq; ++i)
			names[i] = seq[i].name, seqs[i] = seq[i].seq;
		n_ins = gfa_ins_filter(g, n_ins, ins);
		gfa_augment(g, n_ins, ins, n_seq, (const char*const*)names, (const char*const*)seqs);
		kfree(km, ins);
		kfree(km, names);
		kfree(km, seqs);
	}
	if (mg_verbose >= 3)
		fprintf(stderr, "[M::%s::%.3f*%.2f] inserted %d events, including %d inversions\n", __func__,
				realtime() - mg_realtime0, cputime() / (realtime() - mg_realtime0), n_ins, n_inv);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movl %ecx, -0x44(%rbp)
movq %r8, -0x50(%rbp)
movq %r9, -0x58(%rbp)
movl $0x0, -0x8c(%rbp)
movq $0x0, -0x98(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0xc(%rax), %esi
movq -0x38(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x38(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x40(%rbp), %r8
movl -0x44(%rbp), %r9d
movq -0x58(%rbp), %r15
leaq -0xd0(%rbp), %r14
leaq -0x70(%rbp), %rbx
leaq -0x78(%rbp), %r11
leaq -0xc0(%rbp), %r10
leaq -0xc8(%rbp), %rax
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x339d0
movl %eax, -0x7c(%rbp)
cmpl $0x0, -0x7c(%rbp)
jne 0x344a2
jmp 0x35f99
movl $0x0, -0xa8(%rbp)
movl $0x0, -0xac(%rbp)
movq $0x0, -0xe0(%rbp)
movl $0x0, -0x9c(%rbp)
movl $0x0, -0xa0(%rbp)
movq $0x0, -0xd8(%rbp)
movl $0x0, -0xa4(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x7c(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2890
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x7c(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2890
movq %rax, -0xb8(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x35d7b
movq -0x58(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xe8(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq -0xe8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x35d6b
movq -0xe8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x60(%rbp), %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movl (%rax), %eax
movq -0xf0(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0x34591
jmp 0x35d5d
movq -0xf0(%rbp), %rax
movl 0x2c(%rax), %eax
movq -0x38(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jl 0x345bc
movq -0xf0(%rbp), %rax
movl 0x44(%rax), %eax
andl $0xff, %eax
movq -0x38(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x345c1
jmp 0x35d5d
movq -0xf0(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jle 0x345d0
jmp 0x345ef
leaq 0x9445(%rip), %rdi      # 0x3da1c
leaq 0x99fe(%rip), %rsi      # 0x3dfdc
movl $0x86, %edx
leaq 0x9ad3(%rip), %rcx      # 0x3e0bd
callq 0x2170
movq -0xf0(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0xf8(%rbp)
movq -0xe8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0xf8(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
movl $0x0, -0x100(%rbp)
movl $0x1, -0x64(%rbp)
movl -0x64(%rbp), %eax
movq -0xf0(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x34b9c
movq -0xe8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0xf4(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x110(%rbp)
movq -0xe8(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0xf4(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x118(%rbp)
movq -0xe8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0xf8(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x120(%rbp)
movl $0xffffffff, -0x128(%rbp) # imm = 0xFFFFFFFF
movl -0xf8(%rbp), %eax
movl %eax, -0x12c(%rbp)
movq -0x118(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x110(%rbp), %rcx
movq 0x8(%rcx), %rcx
subl %ecx, %eax
movl %eax, -0x134(%rbp)
movq -0x118(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
movq -0x110(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
subl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x138(%rbp)
movq -0x110(%rbp), %rax
movq 0x8(%rax), %rax
cmpl -0x100(%rbp), %eax
jle 0x3472b
movq -0x110(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, -0x100(%rbp)
movl -0xf4(%rbp), %eax
movq -0x120(%rbp), %rcx
movl (%rcx), %ecx
movq -0x120(%rbp), %rdx
addl 0x4(%rdx), %ecx
cmpl %ecx, %eax
jne 0x348d3
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x120(%rbp), %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x110(%rbp), %rcx
movq (%rcx), %rcx
subl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x130(%rbp)
movl -0xf8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf8(%rbp)
movl -0xf8(%rbp), %ecx
movq -0xf0(%rbp), %rax
movl 0x8(%rax), %edx
movq -0xf0(%rbp), %rax
addl 0xc(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x231(%rbp)
jge 0x347db
movq -0xe8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0xf8(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x4(%rax)
sete %al
movb %al, -0x231(%rbp)
movb -0x231(%rbp), %al
testb $0x1, %al
jne 0x347e7
jmp 0x34838
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xe8(%rbp), %rcx
movq 0x20(%rcx), %rcx
movslq -0xf8(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %eax
addl -0x130(%rbp), %eax
movl %eax, -0x130(%rbp)
movl -0xf8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf8(%rbp)
jmp 0x3478f
movl -0xf8(%rbp), %eax
movq -0xf0(%rbp), %rcx
movl 0x8(%rcx), %ecx
movq -0xf0(%rbp), %rdx
addl 0xc(%rdx), %ecx
cmpl %ecx, %eax
jge 0x34858
jmp 0x34877
leaq 0x98c8(%rip), %rdi      # 0x3e127
leaq 0x9776(%rip), %rsi      # 0x3dfdc
movl $0x95, %edx
leaq 0x984b(%rip), %rcx      # 0x3e0bd
callq 0x2170
movq -0xe8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0xf8(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x10(%rax)
jl 0x348b8
movq -0xe8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0xf8(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x128(%rbp)
movq -0x118(%rbp), %rax
movq (%rax), %rax
addl $0x1, %eax
addl -0x130(%rbp), %eax
movl %eax, -0x130(%rbp)
jmp 0x348ef
movq -0x118(%rbp), %rax
movq (%rax), %rax
movq -0x110(%rbp), %rcx
movq (%rcx), %rcx
subl %ecx, %eax
movl %eax, -0x130(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x34922
movq -0x118(%rbp), %rax
movq 0x8(%rax), %rax
cmpl -0x100(%rbp), %eax
jge 0x34922
movl $0x1, -0x124(%rbp)
jmp 0x34b3d
movl -0x130(%rbp), %eax
cmpl -0x134(%rbp), %eax
jne 0x3494d
cmpl $0x0, -0x138(%rbp)
jne 0x3494d
movq -0x38(%rbp), %rcx
xorl %eax, %eax
subl 0x1c(%rcx), %eax
movl %eax, -0x124(%rbp)
jmp 0x34b3b
cmpl $0x0, -0x128(%rbp)
jl 0x34a27
movl -0x130(%rbp), %eax
cmpl -0x134(%rbp), %eax
jge 0x34976
movl -0x130(%rbp), %eax
movl %eax, -0x238(%rbp)
jmp 0x34982
movl -0x134(%rbp), %eax
movl %eax, -0x238(%rbp)
movl -0x238(%rbp), %eax
movl %eax, -0x13c(%rbp)
movq -0x38(%rbp), %rax
movss 0x2c(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x95f5(%rip), %xmm1     # 0x3df98
subsd %xmm0, %xmm1
movsd 0x8669(%rip), %xmm0     # 0x3d018
divsd %xmm1, %xmm0
movsd %xmm0, -0x148(%rbp)
movsd -0x148(%rbp), %xmm0
movsd 0x95c5(%rip), %xmm1     # 0x3df90
ucomisd %xmm1, %xmm0
jbe 0x349e1
movsd 0x95b7(%rip), %xmm0     # 0x3df90
movsd %xmm0, -0x148(%rbp)
cvtsi2sdl -0x128(%rbp), %xmm0
movsd -0x148(%rbp), %xmm2
cvtsi2sdl -0x13c(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x124(%rbp)
jmp 0x34b39
movl -0x130(%rbp), %eax
cmpl -0x134(%rbp), %eax
jle 0x34ad9
cvtsi2sdl -0x134(%rbp), %xmm0
mulsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0x150(%rbp)
movsd -0x150(%rbp), %xmm0
cvtsi2sdl -0x138(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x34a79
movsd -0x150(%rbp), %xmm0
movsd %xmm0, -0x240(%rbp)
jmp 0x34a89
cvtsi2sdl -0x138(%rbp), %xmm0
movsd %xmm0, -0x240(%rbp)
movsd -0x240(%rbp), %xmm0
movsd %xmm0, -0x150(%rbp)
movsd -0x150(%rbp), %xmm1
movl -0x130(%rbp), %eax
subl -0x134(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd -0xd0(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x88df(%rip), %xmm1     # 0x3d3a8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x124(%rbp)
jmp 0x34b37
cvtsi2sdl -0x134(%rbp), %xmm0
movsd -0xd0(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x88b3(%rip), %xmm1     # 0x3d3a8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x124(%rbp)
movl -0x124(%rbp), %eax
cmpl -0x138(%rbp), %eax
jle 0x34b1f
movl -0x124(%rbp), %eax
movl %eax, -0x244(%rbp)
jmp 0x34b2b
movl -0x138(%rbp), %eax
movl %eax, -0x244(%rbp)
movl -0x244(%rbp), %eax
movl %eax, -0x124(%rbp)
jmp 0x34b39
jmp 0x34b3b
jmp 0x34b3d
movl -0x124(%rbp), %edx
movq -0x88(%rbp), %rax
movl -0x64(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movslq -0x130(%rbp), %rdx
shlq $0x20, %rdx
movslq -0x12c(%rbp), %rax
orq %rax, %rdx
movq -0xb8(%rbp), %rax
movl -0x64(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x34634
movq -0xf0(%rbp), %rax
movl 0x10(%rax), %esi
subl $0x1, %esi
movq -0x88(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
movl $0xa, %ecx
xorl %r8d, %r8d
leaq -0xfc(%rbp), %r9
callq 0x3520
movq %rax, -0x108(%rbp)
movq -0xe8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0xf0(%rbp), %rcx
movslq 0x8(%rcx), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0xf4(%rbp)
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0xfc(%rbp), %eax
jge 0x35d4d
movl $0x0, -0x188(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jle 0x34c2d
movq -0x38(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x248(%rbp)
jmp 0x34c37
xorl %eax, %eax
movl %eax, -0x248(%rbp)
jmp 0x34c37
movl -0x248(%rbp), %eax
movl %eax, -0x184(%rbp)
cvtsi2ssl -0x184(%rbp), %xmm1
movq -0x108(%rbp), %rax
movslq -0x64(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
cvtsi2ssl 0x8(%rax), %xmm0
movq -0x38(%rbp), %rax
mulss 0x28(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x34c9a
movq -0x108(%rbp), %rax
movslq -0x64(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
cvtsi2ssl 0x8(%rax), %xmm0
movq -0x38(%rbp), %rax
mulss 0x28(%rax), %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x184(%rbp)
movq -0x108(%rbp), %rax
movslq -0x64(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x184(%rbp), %eax
jle 0x34ce2
movq -0x108(%rbp), %rax
movslq -0x64(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0xf0(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
subl -0x184(%rbp), %ecx
cmpl %ecx, %eax
jl 0x34ce7
jmp 0x35d3f
movq -0x108(%rbp), %rax
movslq -0x64(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x164(%rbp)
movq -0x108(%rbp), %rax
movslq -0x64(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x168(%rbp)
movq -0xe8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0xf4(%rbp), %ecx
addl -0x164(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x160(%rbp)
movq -0xe8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0xf4(%rbp), %ecx
addl -0x168(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
movl %eax, -0x174(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x18c(%rbp)
movq -0xb8(%rbp), %rax
movslq -0x164(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x16c(%rbp)
movq -0xb8(%rbp), %rax
movslq -0x168(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x170(%rbp)
movl -0x16c(%rbp), %eax
cmpl -0x170(%rbp), %eax
jg 0x34dd0
jmp 0x34def
leaq 0x936a(%rip), %rdi      # 0x3e141
leaq 0x91fe(%rip), %rsi      # 0x3dfdc
movl $0xbe, %edx
leaq 0x92d3(%rip), %rcx      # 0x3e0bd
callq 0x2170
movq -0xe8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x16c(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x1a4(%rbp)
movq -0xe8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x170(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x1a0(%rbp)
movq -0x160(%rbp), %rax
movq (%rax), %rax
addl $0x1, %eax
subl -0x174(%rbp), %eax
movl %eax, -0x19c(%rbp)
movq -0x158(%rbp), %rax
movq (%rax), %rax
addl $0x1, %eax
movl %eax, -0x198(%rbp)
movq -0x160(%rbp), %rax
movq 0x8(%rax), %rax
addl $0x1, %eax
subl -0x174(%rbp), %eax
movl %eax, -0x194(%rbp)
movq -0x158(%rbp), %rax
movq 0x8(%rax), %rax
addl $0x1, %eax
movl %eax, -0x190(%rbp)
movl -0x19c(%rbp), %eax
movq -0x40(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x1a4(%rbp), %edx
shrl %edx
movl %edx, %edx
shlq $0x6, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jg 0x34eb2
jmp 0x34ed1
leaq 0x9291(%rip), %rdi      # 0x3e14a
leaq 0x911c(%rip), %rsi      # 0x3dfdc
movl $0xc5, %edx
leaq 0x91f1(%rip), %rcx      # 0x3e0bd
callq 0x2170
movl -0x198(%rbp), %eax
movq -0x40(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x1a0(%rbp), %edx
shrl %edx
movl %edx, %edx
shlq $0x6, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jg 0x34ef6
jmp 0x34f15
leaq 0x9270(%rip), %rdi      # 0x3e16d
leaq 0x90d8(%rip), %rsi      # 0x3dfdc
movl $0xc6, %edx
leaq 0x91ad(%rip), %rcx      # 0x3e0bd
callq 0x2170
movl -0x164(%rbp), %eax
movl %eax, -0x17c(%rbp)
movl -0x174(%rbp), %eax
movl %eax, -0x178(%rbp)
movl -0x17c(%rbp), %eax
cmpl -0x168(%rbp), %eax
jge 0x34f72
movq -0xb8(%rbp), %rax
movslq -0x17c(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
shrq $0x20, %rcx
movslq -0x178(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x178(%rbp)
movl -0x17c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x17c(%rbp)
jmp 0x34f2d
movl -0x194(%rbp), %eax
cmpl -0x190(%rbp), %eax
jle 0x350bf
leaq 0x10465(%rip), %rax     # 0x453f0
cmpl $0x2, (%rax)
jl 0x350ba
movl -0x178(%rbp), %eax
movl -0x194(%rbp), %ecx
subl -0x190(%rbp), %ecx
addl %ecx, %eax
movq -0x38(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jl 0x350ba
movq 0x1003c(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movl -0x5c(%rbp), %ecx
movl -0x1a4(%rbp), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x76b6(%rip), %rax      # 0x3c68c
movsbl (%rax,%rdx), %r8d
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1a4(%rbp), %edx
shrl %edx
movl %edx, %edx
shlq $0x6, %rdx
addq %rdx, %rax
movq 0x18(%rax), %r9
movl -0x19c(%rbp), %eax
movl -0x1a0(%rbp), %edx
andl $0x1, %edx
movl %edx, %edx
movl %edx, %esi
leaq 0x767a(%rip), %rdx      # 0x3c68c
movsbl (%rdx,%rsi), %r13d
movq -0x40(%rbp), %rdx
movq 0x10(%rdx), %rdx
movl -0x1a0(%rbp), %esi
shrl %esi
movl %esi, %esi
shlq $0x6, %rsi
addq %rsi, %rdx
movq 0x18(%rdx), %r12
movl -0x198(%rbp), %r15d
movl -0x178(%rbp), %r14d
movq -0x50(%rbp), %rdx
movslq -0x5c(%rbp), %rsi
imulq $0x28, %rsi, %rsi
addq %rsi, %rdx
movq 0x8(%rdx), %rbx
movl -0x194(%rbp), %r11d
movl -0x190(%rbp), %r10d
movl -0x190(%rbp), %edx
subl -0x194(%rbp), %edx
movl %edx, -0x24c(%rbp)
leaq 0x9114(%rip), %rsi      # 0x3e190
leaq 0x9159(%rip), %rdx      # 0x3e1dc
movl %eax, (%rsp)
movl -0x24c(%rbp), %eax
movl %r13d, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movl %r15d, 0x18(%rsp)
movl %r14d, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movl %r11d, 0x30(%rsp)
movl %r10d, 0x38(%rsp)
movl %eax, 0x40(%rsp)
movb $0x0, %al
callq 0x2210
jmp 0x35d3f
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0x20(%rax), %esi
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
leaq -0x1a4(%rbp), %rdx
callq 0xc9c0
movl %eax, %ecx
movl -0x178(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x178(%rbp)
movl -0x178(%rbp), %eax
movl -0x190(%rbp), %ecx
subl -0x194(%rbp), %ecx
cmpl %ecx, %eax
jle 0x3511d
movl -0x178(%rbp), %eax
movl %eax, -0x250(%rbp)
jmp 0x3512f
movl -0x190(%rbp), %eax
subl -0x194(%rbp), %eax
movl %eax, -0x250(%rbp)
movl -0x250(%rbp), %eax
movl %eax, -0x184(%rbp)
movl -0x194(%rbp), %eax
cmpl -0x184(%rbp), %eax
jle 0x3516a
movl -0x190(%rbp), %eax
movq -0x50(%rbp), %rcx
movslq -0x5c(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
subl -0x184(%rbp), %ecx
cmpl %ecx, %eax
jl 0x3516f
jmp 0x35d3f
movl -0x190(%rbp), %eax
subl -0x194(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x35198
movl -0x178(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x35198
jmp 0x35d3f
movl -0x194(%rbp), %eax
movl %eax, -0x17c(%rbp)
movl -0x17c(%rbp), %eax
cmpl -0x190(%rbp), %eax
jge 0x351fd
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq -0x17c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x1a8(%rbp)
cmpl $0x6e, -0x1a8(%rbp)
je 0x351e8
cmpl $0x4e, -0x1a8(%rbp)
jne 0x351ea
jmp 0x351fd
jmp 0x351ec
movl -0x17c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x17c(%rbp)
jmp 0x351a4
movl -0x17c(%rbp), %eax
cmpl -0x190(%rbp), %eax
je 0x35210
jmp 0x35d3f
movq -0x30(%rbp), %rdi
movq -0x78(%rbp), %rax
movl -0x5c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
movq -0x78(%rbp), %rax
movslq -0x5c(%rbp), %rcx
subl (%rax,%rcx,4), %esi
movq -0xc8(%rbp), %rdx
movq -0x78(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
shlq $0x4, %rax
addq %rax, %rdx
movl -0x194(%rbp), %ecx
movl -0x190(%rbp), %r8d
leaq -0x98(%rbp), %r9
leaq -0x8c(%rbp), %rax
movq %rax, (%rsp)
callq 0x4220
movl %eax, -0x180(%rbp)
cmpl $0x0, -0x180(%rbp)
jne 0x352bc
movq 0xfd75(%rip), %rax      # 0x44ff8
movq (%rax), %rdi
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
movl -0x194(%rbp), %r8d
movl -0x190(%rbp), %r9d
leaq 0x8f3a(%rip), %rsi      # 0x3e1e8
leaq 0x8f27(%rip), %rdx      # 0x3e1dc
movb $0x0, %al
callq 0x2210
cmpl $0x1, -0x180(%rbp)
je 0x352ca
jmp 0x35d3f
movl -0x16c(%rbp), %eax
movl %eax, -0x17c(%rbp)
movl -0x17c(%rbp), %eax
cmpl -0x170(%rbp), %eax
jg 0x3553b
movq -0xe8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x17c(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x1ac(%rbp)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1ac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x1b0(%rbp)
movl $0x0, -0x1b4(%rbp)
movl -0x1b0(%rbp), %eax
movl %eax, -0x1b8(%rbp)
movl -0x17c(%rbp), %eax
cmpl -0x16c(%rbp), %eax
jne 0x353ae
movq -0xe8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0xf4(%rbp), %ecx
addl -0x164(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
addl $0x1, %eax
movq -0xe8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0xf4(%rbp), %edx
addl -0x164(%rbp), %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
shrq $0x20, %rcx
andq $0xff, %rcx
subl %ecx, %eax
movl %eax, -0x1b4(%rbp)
movl -0x17c(%rbp), %eax
cmpl -0x170(%rbp), %eax
jne 0x353e9
movq -0xe8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0xf4(%rbp), %ecx
addl -0x168(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
addl $0x1, %eax
movl %eax, -0x1b8(%rbp)
movl -0x1ac(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x35427
movl -0x1b4(%rbp), %eax
movl %eax, -0x1bc(%rbp)
movl -0x1b0(%rbp), %eax
subl -0x1b8(%rbp), %eax
movl %eax, -0x1b4(%rbp)
movl -0x1b0(%rbp), %eax
subl -0x1bc(%rbp), %eax
movl %eax, -0x1b8(%rbp)
movq -0x30(%rbp), %rdi
movq -0x70(%rbp), %rax
movl -0x1ac(%rbp), %ecx
shrl %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %esi
movq -0x70(%rbp), %rax
movl -0x1ac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
subl (%rax,%rcx,4), %esi
movq -0xc0(%rbp), %rdx
movq -0x70(%rbp), %rax
movl -0x1ac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movslq (%rax,%rcx,4), %rax
shlq $0x4, %rax
addq %rax, %rdx
movl -0x1b4(%rbp), %ecx
movl -0x1b8(%rbp), %r8d
leaq -0x98(%rbp), %r9
leaq -0x8c(%rbp), %rax
movq %rax, (%rsp)
callq 0x4220
movl %eax, -0x180(%rbp)
cmpl $0x0, -0x180(%rbp)
jne 0x3551a
movq 0xfb4e(%rip), %rax      # 0x44ff8
movq (%rax), %rdi
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1ac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
movl -0x1b4(%rbp), %r8d
movl -0x1b8(%rbp), %r9d
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq 0x8(%rax), %r11
movl -0x194(%rbp), %r10d
movl -0x190(%rbp), %eax
leaq 0x8d19(%rip), %rsi      # 0x3e218
leaq 0x8cd6(%rip), %rdx      # 0x3e1dc
movq %r11, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x2210
cmpl $0x1, -0x180(%rbp)
je 0x35525
jmp 0x3553b
jmp 0x35527
movl -0x17c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x17c(%rbp)
jmp 0x352d6
movl -0x17c(%rbp), %eax
cmpl -0x170(%rbp), %eax
jg 0x3554e
jmp 0x35d3f
movl -0x178(%rbp), %eax
movl -0x190(%rbp), %ecx
subl -0x194(%rbp), %ecx
subl %ecx, %eax
movq -0x38(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x3575c
movl -0x190(%rbp), %eax
subl -0x194(%rbp), %eax
subl -0x178(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x3575c
movl -0x190(%rbp), %eax
subl -0x194(%rbp), %eax
movl %eax, -0x1c0(%rbp)
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movl -0x16c(%rbp), %ecx
movl -0x170(%rbp), %r8d
leaq -0x1a4(%rbp), %r9
addq $0x8, %r9
leaq -0xe0(%rbp), %r10
leaq -0xac(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x38640
movl %eax, -0xa8(%rbp)
movq -0x30(%rbp), %rdi
movl -0xa8(%rbp), %esi
movq -0xe0(%rbp), %rdx
movl -0x1c0(%rbp), %ecx
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %r8
imulq $0x28, %r8, %r8
addq %r8, %rax
movq 0x10(%rax), %r8
movslq -0x194(%rbp), %rax
addq %rax, %r8
movl $0x1388, %r9d           # imm = 0x1388
leaq -0x1c4(%rbp), %r10
leaq -0x1c8(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x4710
movl %eax, -0x1cc(%rbp)
cmpl $0x0, -0x1cc(%rbp)
jle 0x356a2
cvtsi2ssl -0x1c4(%rbp), %xmm0
cvtsi2ssl -0x1c8(%rbp), %xmm1
movq -0x38(%rbp), %rax
mulss 0x2c(%rax), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x35671
jmp 0x35d3f
movl -0x1c8(%rbp), %eax
subl -0x1c4(%rbp), %eax
cvtsi2ss %eax, %xmm1
movq -0x38(%rbp), %rax
cvtsi2ssl 0x18(%rax), %xmm0
movq -0x38(%rbp), %rax
mulss 0x2c(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x3569d
jmp 0x35d3f
jmp 0x3575a
movq -0x38(%rbp), %rax
movq (%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
jne 0x35758
movl -0xa8(%rbp), %edi
movq -0xe0(%rbp), %rsi
callq 0x35fb0
movq -0x30(%rbp), %rdi
movl -0xa8(%rbp), %esi
movq -0xe0(%rbp), %rdx
movl -0x1c0(%rbp), %ecx
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %r8
imulq $0x28, %r8, %r8
addq %r8, %rax
movq 0x10(%rax), %r8
movslq -0x194(%rbp), %rax
addq %rax, %r8
movl $0x1388, %r9d           # imm = 0x1388
leaq -0x1c4(%rbp), %r10
leaq -0x1c8(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x4710
movl %eax, -0x1cc(%rbp)
cmpl $0x0, -0x1cc(%rbp)
jle 0x35756
cvtsi2ssl -0x1c4(%rbp), %xmm0
cvtsi2ssl -0x1c8(%rbp), %xmm1
movq -0x38(%rbp), %rax
mulss 0x30(%rax), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x35756
movl $0x1, -0x188(%rbp)
jmp 0x35758
jmp 0x3575a
jmp 0x3575c
leaq 0xff25(%rip), %rax      # 0x45688
movl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x35a1f
movl -0x190(%rbp), %eax
subl -0x194(%rbp), %eax
movl %eax, -0x1dc(%rbp)
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movl -0x16c(%rbp), %ecx
movl -0x170(%rbp), %r8d
leaq -0x1a4(%rbp), %r9
addq $0x8, %r9
leaq -0xe0(%rbp), %r10
leaq -0xac(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x38640
movl %eax, -0xa8(%rbp)
movq 0xf825(%rip), %rax      # 0x44ff8
movq (%rax), %rdi
movl -0x1a4(%rbp), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x6ea2(%rip), %rax      # 0x3c68c
movsbl (%rax,%rcx), %edx
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1a4(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
movl -0x19c(%rbp), %r8d
movl -0x1a0(%rbp), %eax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x6e66(%rip), %rax      # 0x3c68c
movsbl (%rax,%rsi), %r9d
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1a0(%rbp), %esi
shrl %esi
movl %esi, %esi
shlq $0x6, %rsi
addq %rsi, %rax
movq 0x18(%rax), %r13
movl -0x198(%rbp), %r12d
movl -0x178(%rbp), %r15d
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %rsi
imulq $0x28, %rsi, %rsi
addq %rsi, %rax
movq 0x8(%rax), %r14
movl -0x194(%rbp), %ebx
movl -0x190(%rbp), %r11d
movl -0x190(%rbp), %r10d
subl -0x194(%rbp), %r10d
movl -0x188(%rbp), %eax
leaq 0x89c3(%rip), %rsi      # 0x3e254
movq %r13, (%rsp)
movl %r12d, 0x8(%rsp)
movl %r15d, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movl %ebx, 0x20(%rsp)
movl %r11d, 0x28(%rsp)
movl %r10d, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movb $0x0, %al
callq 0x2210
movq 0xf734(%rip), %rax      # 0x44ff8
movq (%rax), %rdi
movq -0xe0(%rbp), %rdx
leaq 0x89b1(%rip), %rsi      # 0x3e286
movb $0x0, %al
callq 0x2210
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movslq -0x194(%rbp), %rax
addq %rax, %rdi
movslq -0x1dc(%rbp), %rdx
movq 0xf6f1(%rip), %rax      # 0x44ff8
movq (%rax), %rcx
movl $0x1, %esi
callq 0x2340
movl -0x178(%rbp), %eax
subl -0x1dc(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x3599c
movl -0x1dc(%rbp), %eax
subl -0x178(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x3599c
movq -0x30(%rbp), %rdi
movl -0xa8(%rbp), %esi
movq -0xe0(%rbp), %rdx
movl -0x1dc(%rbp), %ecx
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %r8
imulq $0x28, %r8, %r8
addq %r8, %rax
movq 0x10(%rax), %r8
movslq -0x194(%rbp), %rax
addq %rax, %r8
movl $0x1388, %r9d           # imm = 0x1388
leaq -0x1d0(%rbp), %r10
leaq -0x1d4(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x4710
movl %eax, -0x1d8(%rbp)
jmp 0x359e4
movl $0xffffffff, -0x1d8(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x1d0(%rbp)
movl -0x178(%rbp), %eax
cmpl -0x1dc(%rbp), %eax
jle 0x359cc
movl -0x178(%rbp), %eax
movl %eax, -0x254(%rbp)
jmp 0x359d8
movl -0x1dc(%rbp), %eax
movl %eax, -0x254(%rbp)
movl -0x254(%rbp), %eax
movl %eax, -0x1d4(%rbp)
movq 0xf60d(%rip), %rax      # 0x44ff8
movq (%rax), %rdi
movl -0x178(%rbp), %edx
movl -0xa8(%rbp), %ecx
movl -0x1d8(%rbp), %r8d
movl -0x1d0(%rbp), %r9d
movl -0x1d4(%rbp), %eax
leaq 0x887b(%rip), %rsi      # 0x3e290
movl %eax, (%rsp)
movb $0x0, %al
callq 0x2210
cmpl $0x0, -0x188(%rbp)
je 0x35c84
movl -0x18c(%rbp), %eax
movl %eax, -0x1ec(%rbp)
movl %eax, -0x208(%rbp)
movl -0x194(%rbp), %eax
movl %eax, -0x20c(%rbp)
movl %eax, -0x210(%rbp)
movl -0x1a4(%rbp), %eax
movl %eax, -0x220(%rbp)
movl -0x19c(%rbp), %eax
movl %eax, -0x218(%rbp)
movl -0x1a0(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0x21c(%rbp)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1a0(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %eax
subl -0x198(%rbp), %eax
movl %eax, -0x214(%rbp)
movl -0x190(%rbp), %eax
movl %eax, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
movl -0x1a4(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0x204(%rbp)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1a4(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %eax
subl -0x19c(%rbp), %eax
movl %eax, -0x1fc(%rbp)
movl -0x1a0(%rbp), %eax
movl %eax, -0x200(%rbp)
movl -0x198(%rbp), %eax
movl %eax, -0x1f8(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jne 0x35b6c
jmp 0x35b0e
cmpl $0x4, -0xa0(%rbp)
jl 0x35b2f
movl -0xa0(%rbp), %eax
movl -0xa0(%rbp), %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, -0x258(%rbp)
jmp 0x35b3c
movl $0x10, %eax
movl %eax, -0x258(%rbp)
jmp 0x35b3c
movl -0x258(%rbp), %eax
movl %eax, -0xa0(%rbp)
movq -0x30(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movslq -0xa0(%rbp), %rax
imulq $0x1c, %rax, %rdx
callq 0x2ae0
movq %rax, -0xd8(%rbp)
jmp 0x35b6c
movq -0xd8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq -0x220(%rbp), %rcx
movq %rcx, (%rax)
movq -0x218(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x210(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl -0x208(%rbp), %ecx
movl %ecx, 0x18(%rax)
movl -0x9c(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jne 0x35c25
jmp 0x35bc7
cmpl $0x4, -0xa0(%rbp)
jl 0x35be8
movl -0xa0(%rbp), %eax
movl -0xa0(%rbp), %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, -0x25c(%rbp)
jmp 0x35bf5
movl $0x10, %eax
movl %eax, -0x25c(%rbp)
jmp 0x35bf5
movl -0x25c(%rbp), %eax
movl %eax, -0xa0(%rbp)
movq -0x30(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movslq -0xa0(%rbp), %rax
imulq $0x1c, %rax, %rdx
callq 0x2ae0
movq %rax, -0xd8(%rbp)
jmp 0x35c25
movq -0xd8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq -0x204(%rbp), %rcx
movq %rcx, (%rax)
movq -0x1fc(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x1f4(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl -0x1ec(%rbp), %ecx
movl %ecx, 0x18(%rax)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x35d3d
movl -0x9c(%rbp), %eax
cmpl -0xa0(%rbp), %eax
jne 0x35cf2
jmp 0x35c94
cmpl $0x4, -0xa0(%rbp)
jl 0x35cb5
movl -0xa0(%rbp), %eax
movl -0xa0(%rbp), %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, -0x260(%rbp)
jmp 0x35cc2
movl $0x10, %eax
movl %eax, -0x260(%rbp)
jmp 0x35cc2
movl -0x260(%rbp), %eax
movl %eax, -0xa0(%rbp)
movq -0x30(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movslq -0xa0(%rbp), %rax
imulq $0x1c, %rax, %rdx
callq 0x2ae0
movq %rax, -0xd8(%rbp)
jmp 0x35cf2
movq -0xd8(%rbp), %rax
movl -0x9c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x9c(%rbp)
movslq %ecx, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq -0x1a4(%rbp), %rcx
movq %rcx, (%rax)
movq -0x19c(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x194(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl -0x18c(%rbp), %ecx
movl %ecx, 0x18(%rax)
jmp 0x35d3f
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x34bfb
movq -0x108(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x2670
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x34547
jmp 0x35d6d
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x34521
movq -0x30(%rbp), %rdi
movq -0xe0(%rbp), %rsi
callq 0x2670
movq -0x30(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0x2670
movq -0x30(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x2670
movq -0x30(%rbp), %rdi
movq -0xb8(%rbp), %rsi
callq 0x2670
movq -0x30(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x2670
movq -0x30(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x2670
movq -0x30(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x2670
movq -0x30(%rbp), %rdi
movq -0xc8(%rbp), %rsi
callq 0x2670
cmpl $0x0, -0x9c(%rbp)
jle 0x35f03
movq -0x30(%rbp), %rdi
movslq -0x44(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2890
movq %rax, -0x228(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x44(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2890
movq %rax, -0x230(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x35e90
movq -0x50(%rbp), %rax
movslq -0x60(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
movq -0x228(%rbp), %rax
movslq -0x60(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x50(%rbp), %rax
movslq -0x60(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdx
movq -0x230(%rbp), %rax
movslq -0x60(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x35e39
movq -0x40(%rbp), %rdi
movl -0x9c(%rbp), %esi
movq -0xd8(%rbp), %rdx
callq 0xccc0
movl %eax, -0x9c(%rbp)
movq -0x40(%rbp), %rdi
movl -0x9c(%rbp), %esi
movq -0xd8(%rbp), %rdx
movl -0x44(%rbp), %ecx
movq -0x228(%rbp), %r8
movq -0x230(%rbp), %r9
callq 0xb990
movq -0x30(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x2670
movq -0x30(%rbp), %rdi
movq -0x228(%rbp), %rsi
callq 0x2670
movq -0x30(%rbp), %rdi
movq -0x230(%rbp), %rsi
callq 0x2670
leaq 0xf4e6(%rip), %rax      # 0x453f0
cmpl $0x3, (%rax)
jl 0x35f99
movq 0xf0de(%rip), %rax      # 0x44ff8
movq (%rax), %rax
movq %rax, -0x270(%rbp)
callq 0x48e0
leaq 0xf760(%rip), %rax      # 0x45690
subsd (%rax), %xmm0
movsd %xmm0, -0x268(%rbp)
callq 0x4850
movsd %xmm0, -0x278(%rbp)
callq 0x48e0
movsd -0x278(%rbp), %xmm1
movq -0x270(%rbp), %rdi
movaps %xmm0, %xmm2
movsd -0x268(%rbp), %xmm0
leaq 0xf721(%rip), %rax      # 0x45690
subsd (%rax), %xmm2
divsd %xmm2, %xmm1
movl -0x9c(%rbp), %ecx
movl -0xa4(%rbp), %r8d
leaq 0x832a(%rip), %rsi      # 0x3e2b5
leaq 0x824a(%rip), %rdx      # 0x3e1dc
movb $0x2, %al
callq 0x2210
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax,%rax)