// File: /workspace/github_c_makefile_star2_O0/ToniWestbrook[P]paladin/bwamem.c
// Function: mem_chain2aln
void mem_chain2aln(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, int l_query, const uint8_t *query, const mem_chain_t *c, mem_alnreg_v *av)
{
	int i, k, rid, max_off[2], aw[2]; // aw: actual bandwidth used in extension
	int64_t l_pac = bns->l_pac, rmax[2], tmp, max = 0;
	const mem_seed_t *s;
	uint8_t *rseq = 0;
	uint64_t *srt;

	if (c->n == 0) return;
	// get the max possible span
	rmax[0] = l_pac<<1; rmax[1] = 0;
	for (i = 0; i < c->n; ++i) {
		int64_t b, e;
		const mem_seed_t *t = &c->seeds[i];
		b = t->rbeg - (t->qbeg + cal_max_gap(opt, t->qbeg));
		e = t->rbeg + t->len + ((l_query - t->qbeg - t->len) + cal_max_gap(opt, l_query - t->qbeg - t->len));
		rmax[0] = rmax[0] < b? rmax[0] : b;
		rmax[1] = rmax[1] > e? rmax[1] : e;
		if (t->len > max) max = t->len;
	}
	rmax[0] = rmax[0] > 0? rmax[0] : 0;
	rmax[1] = rmax[1] < l_pac<<1? rmax[1] : l_pac<<1;
	if (rmax[0] < l_pac && l_pac < rmax[1]) { // crossing the forward-reverse boundary; then choose one side
		if (c->seeds[0].rbeg < l_pac) rmax[1] = l_pac; // this works because all seeds are guaranteed to be on the same strand
		else rmax[0] = l_pac;
	}
	// retrieve the reference sequence
	rseq = bns_fetch_seq(bns, pac, &rmax[0], c->seeds[0].rbeg, &rmax[1], &rid);
	assert(c->rid == rid);

	srt = malloc(c->n * 8);
	for (i = 0; i < c->n; ++i)
		srt[i] = (uint64_t)c->seeds[i].score<<32 | i;
	ks_introsort_64(c->n, srt);

	for (k = c->n - 1; k >= 0; --k) {
		mem_alnreg_t *a;
		s = &c->seeds[(uint32_t)srt[k]];

		for (i = 0; i < av->n; ++i) { // test whether extension has been made before
			mem_alnreg_t *p = &av->a[i];
			int64_t rd;
			int qd, w, max_gap;
			if (s->rbeg < p->rb || s->rbeg + s->len > p->re || s->qbeg < p->qb || s->qbeg + s->len > p->qe) continue; // not fully contained
			if (s->len - p->seedlen0 > .1 * l_query) continue; // this seed may give a better alignment
			// qd: distance ahead of the seed on query; rd: on reference
			qd = s->qbeg - p->qb; rd = s->rbeg - p->rb;
			max_gap = cal_max_gap(opt, qd < rd? qd : rd); // the maximal gap allowed in regions ahead of the seed
			w = max_gap < p->w? max_gap : p->w; // bounded by the band width
			if (qd - rd < w && rd - qd < w) break; // the seed is "around" a previous hit
			// similar to the previous four lines, but this time we look at the region behind
			qd = p->qe - (s->qbeg + s->len); rd = p->re - (s->rbeg + s->len);
			max_gap = cal_max_gap(opt, qd < rd? qd : rd);
			w = max_gap < p->w? max_gap : p->w;
			if (qd - rd < w && rd - qd < w) break;
		}
		if (i < av->n) { // the seed is (almost) contained in an existing alignment; further testing is needed to confirm it is not leading to a different aln
			if (bwa_verbose >= 4)
				printf("** Seed(%d) [%ld;%ld,%ld] is almost contained in an existing alignment [%d,%d) <=> [%ld,%ld)\n",
					   k, (long)s->len, (long)s->qbeg, (long)s->rbeg, av->a[i].qb, av->a[i].qe, (long)av->a[i].rb, (long)av->a[i].re);
			for (i = k + 1; i < c->n; ++i) { // check overlapping seeds in the same chain
				const mem_seed_t *t;
				if (srt[i] == 0) continue;
				t = &c->seeds[(uint32_t)srt[i]];
				if (t->len < s->len * .95) continue; // only check overlapping if t is long enough; TODO: more efficient by early stopping
				if (s->qbeg <= t->qbeg && s->qbeg + s->len - t->qbeg >= s->len>>2 && t->qbeg - s->qbeg != t->rbeg - s->rbeg) break;
				if (t->qbeg <= s->qbeg && t->qbeg + t->len - s->qbeg >= s->len>>2 && s->qbeg - t->qbeg != s->rbeg - t->rbeg) break;
			}
			if (i == c->n) { // no overlapping seeds; then skip extension
				srt[k] = 0; // mark that seed extension has not been performed
				continue;
			}
			if (bwa_verbose >= 4)
				printf("** Seed(%d) might lead to a different alignment even though it is contained. Extension will be performed.\n", k);
		}

		a = kv_pushp(mem_alnreg_t, *av);
		memset(a, 0, sizeof(mem_alnreg_t));
		a->w = aw[0] = aw[1] = opt->w;
		a->score = a->truesc = -1;
		a->rid = c->rid;

		if (bwa_verbose >= 4) err_printf("** ---> Extending from seed(%d) [%ld;%ld,%ld] @ %s <---\n", k, (long)s->len, (long)s->qbeg, (long)s->rbeg, bns->anns[c->rid].name);
		if (s->qbeg) { // left extension
			uint8_t *rs, *qs;
			int qle, tle, gtle, gscore;
			qs = malloc(s->qbeg);
			for (i = 0; i < s->qbeg; ++i) qs[i] = query[s->qbeg - 1 - i];
			tmp = s->rbeg - rmax[0];
			rs = malloc(tmp);
			for (i = 0; i < tmp; ++i) rs[i] = rseq[tmp - 1 - i];
			for (i = 0; i < MAX_BAND_TRY; ++i) {
				int prev = a->score;
				aw[0] = opt->w << i;
				if (bwa_verbose >= 4) {
					int j;
					printf("*** Left ref:   "); for (j = 0; j < tmp; ++j) putchar("ACGTN"[(int)rs[j]]); putchar('\n');
					printf("*** Left query: "); for (j = 0; j < s->qbeg; ++j) putchar("ACGTN"[(int)qs[j]]); putchar('\n');
				}
				a->score = ksw_extend2(s->qbeg, qs, tmp, rs, VALUE_DEFINED, opt->mat, opt->o_del, opt->e_del, opt->o_ins, opt->e_ins, aw[0], opt->pen_clip5, opt->zdrop, s->len * opt->a, &qle, &tle, &gtle, &gscore, &max_off[0]);
				if (bwa_verbose >= 4) { printf("*** Left extension: prev_score=%d; score=%d; bandwidth=%d; max_off_diagonal_dist=%d\n", prev, a->score, aw[0], max_off[0]); fflush(stdout); }
				if (a->score == prev || max_off[0] < (aw[0]>>1) + (aw[0]>>2)) break;
			}
			// check whether we prefer to reach the end of the query
			if (gscore <= 0 || gscore <= a->score - opt->pen_clip5) { // local extension
				a->qb = s->qbeg - qle, a->rb = s->rbeg - tle;
				a->truesc = a->score;
			} else { // to-end extension
				a->qb = 0, a->rb = s->rbeg - gtle;
				a->truesc = gscore;
			}
			free(qs); free(rs);
		} else a->score = a->truesc = s->len * opt->a, a->qb = 0, a->rb = s->rbeg;

		if (s->qbeg + s->len != l_query) { // right extension
			int qle, tle, qe, re, gtle, gscore, sc0 = a->score;
			qe = s->qbeg + s->len;
			re = s->rbeg + s->len - rmax[0];
			assert(re >= 0);
			for (i = 0; i < MAX_BAND_TRY; ++i) {
				int prev = a->score;
				aw[1] = opt->w << i;
				if (bwa_verbose >= 4) {
					int j;
					printf("*** Right ref:   "); for (j = 0; j < rmax[1] - rmax[0] - re; ++j) putchar("ACGTN"[(int)rseq[re+j]]); putchar('\n');
					printf("*** Right query: "); for (j = 0; j < l_query - qe; ++j) putchar("ACGTN"[(int)query[qe+j]]); putchar('\n');
				}

				a->score = ksw_extend2(l_query - qe, query + qe, rmax[1] - rmax[0] - re, rseq + re, VALUE_DEFINED, opt->mat, opt->o_del, opt->e_del, opt->o_ins, opt->e_ins, aw[1], opt->pen_clip3, opt->zdrop, sc0, &qle, &tle, &gtle, &gscore, &max_off[1]);
				if (bwa_verbose >= 4) { printf("*** Right extension: prev_score=%d; score=%d; bandwidth=%d; max_off_diagonal_dist=%d\n", prev, a->score, aw[1], max_off[1]); fflush(stdout); }
				if (a->score == prev || max_off[1] < (aw[1]>>1) + (aw[1]>>2)) break;
			}
			// similar to the above
			if (gscore <= 0 || gscore <= a->score - opt->pen_clip3) { // local extension
				a->qe = qe + qle, a->re = rmax[0] + re + tle;
				a->truesc += a->score - sc0;
			} else { // to-end extension
				a->qe = l_query, a->re = rmax[0] + re + gtle;
				a->truesc += gscore - sc0;
			}
		} else a->qe = l_query, a->re = s->rbeg + s->len;
		if (bwa_verbose >= 4) printf("*** Added alignment region: [%d,%d) <=> [%ld,%ld); score=%d; {left,right}_bandwidth={%d,%d}\n", a->qb, a->qe, (long)a->rb, (long)a->re, a->score, aw[0], aw[1]);

		// compute seedcov
		for (i = 0, a->seedcov = 0; i < c->n; ++i) {
			const mem_seed_t *t = &c->seeds[i];
			if (t->qbeg >= a->qb && t->qbeg + t->len <= a->qe && t->rbeg >= a->rb && t->rbeg + t->len <= a->re) // seed fully contained
				a->seedcov += t->len; // this is not very accurate, but for approx. mapQ, this is good enough
		}
		a->w = aw[0] > aw[1]? aw[0] : aw[1];
		a->seedlen0 = s->len;

		a->frac_rep = c->frac_rep;
	}
	free(srt); free(rseq);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq 0x10(%rbp), %rax
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movl %ecx, -0x44(%rbp)
movq %r8, -0x50(%rbp)
movq %r9, -0x58(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq $0x0, -0xa0(%rbp)
movq $0x0, -0xb0(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x27dce
jmp 0x2934e
movq -0x80(%rbp), %rax
shlq %rax
movq %rax, -0x90(%rbp)
movq $0x0, -0x88(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x27f91
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x5c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x170(%rbp)
movq -0xd0(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x174(%rbp)
movq -0x30(%rbp), %rdi
movq -0xd0(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x29360
movl -0x174(%rbp), %ecx
movl %eax, %edx
movq -0x170(%rbp), %rax
addl %edx, %ecx
movslq %ecx, %rcx
subq %rcx, %rax
movq %rax, -0xc0(%rbp)
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movq -0xd0(%rbp), %rcx
movslq 0xc(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x160(%rbp)
movl -0x44(%rbp), %eax
movq -0xd0(%rbp), %rcx
subl 0x8(%rcx), %eax
movq -0xd0(%rbp), %rcx
subl 0xc(%rcx), %eax
movl %eax, -0x164(%rbp)
movq -0x30(%rbp), %rdi
movl -0x44(%rbp), %esi
movq -0xd0(%rbp), %rax
subl 0x8(%rax), %esi
movq -0xd0(%rbp), %rax
subl 0xc(%rax), %esi
callq 0x29360
movl -0x164(%rbp), %ecx
movl %eax, %edx
movq -0x160(%rbp), %rax
addl %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq -0x90(%rbp), %rax
cmpq -0xc0(%rbp), %rax
jge 0x27f03
movq -0x90(%rbp), %rax
movq %rax, -0x180(%rbp)
jmp 0x27f11
movq -0xc0(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x180(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jle 0x27f3f
movq -0x88(%rbp), %rax
movq %rax, -0x188(%rbp)
jmp 0x27f4d
movq -0xc8(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0xd0(%rbp), %rax
movslq 0xc(%rax), %rax
cmpq -0xa0(%rbp), %rax
jle 0x27f81
movq -0xd0(%rbp), %rax
movslq 0xc(%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0x27f83
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x27dee
cmpq $0x0, -0x90(%rbp)
jle 0x27fab
movq -0x90(%rbp), %rax
movq %rax, -0x190(%rbp)
jmp 0x27fb6
xorl %eax, %eax
movq %rax, -0x190(%rbp)
jmp 0x27fb6
movq -0x190(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rax
movq -0x80(%rbp), %rcx
shlq %rcx
cmpq %rcx, %rax
jge 0x27fe7
movq -0x88(%rbp), %rax
movq %rax, -0x198(%rbp)
jmp 0x27ff5
movq -0x80(%rbp), %rax
shlq %rax
movq %rax, -0x198(%rbp)
movq -0x198(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x90(%rbp), %rax
cmpq -0x80(%rbp), %rax
jge 0x28048
movq -0x80(%rbp), %rax
cmpq -0x88(%rbp), %rax
jge 0x28048
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq (%rax), %rax
cmpq -0x80(%rbp), %rax
jge 0x2803b
movq -0x80(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x28046
movq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x28048
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
leaq -0x90(%rbp), %rdx
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq (%rax), %rcx
leaq -0x90(%rbp), %r8
addq $0x8, %r8
leaq -0x64(%rbp), %r9
callq 0x17fd0
movq %rax, -0xb0(%rbp)
movq -0x58(%rbp), %rax
movl 0xc(%rax), %eax
cmpl -0x64(%rbp), %eax
jne 0x2808b
jmp 0x280aa
leaq 0x12946(%rip), %rdi     # 0x3a9d8
leaq 0x1261f(%rip), %rsi     # 0x3a6b8
movl $0x2e9, %edx            # imm = 0x2E9
leaq 0x12941(%rip), %rcx     # 0x3a9e6
callq 0x3190
movq -0x58(%rbp), %rax
movl (%rax), %eax
shll $0x3, %eax
movslq %eax, %rdi
leaq 0x125fb(%rip), %rsi     # 0x3a6b8
movl $0x2eb, %edx            # imm = 0x2EB
leaq 0x129a1(%rip), %rcx     # 0x3aa6a
callq 0x31ca0
movq %rax, -0xb8(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x28123
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x5c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x10(%rax), %rdx
shlq $0x20, %rdx
movslq -0x5c(%rbp), %rax
orq %rax, %rdx
movq -0xb8(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x280dc
movq -0x58(%rbp), %rax
movslq (%rax), %rdi
movq -0xb8(%rbp), %rsi
callq 0x11350
movq -0x58(%rbp), %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x60(%rbp)
cmpl $0x0, -0x60(%rbp)
jl 0x29336
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq -0xb8(%rbp), %rcx
movslq -0x60(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movl $0x0, -0x5c(%rbp)
movslq -0x5c(%rbp), %rax
movq 0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x2847c
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x5c(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
movq -0xa8(%rbp), %rax
movq (%rax), %rax
movq -0xe0(%rbp), %rcx
cmpq (%rcx), %rax
jl 0x28216
movq -0xa8(%rbp), %rax
movq (%rax), %rax
movq -0xa8(%rbp), %rcx
movslq 0xc(%rcx), %rcx
addq %rcx, %rax
movq -0xe0(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jg 0x28216
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xe0(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jl 0x28216
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xa8(%rbp), %rcx
addl 0xc(%rcx), %eax
movq -0xe0(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jle 0x2821b
jmp 0x2846e
movq -0xa8(%rbp), %rax
movl 0xc(%rax), %eax
movq -0xe0(%rbp), %rcx
subl 0x44(%rcx), %eax
cvtsi2sd %eax, %xmm0
cvtsi2sdl -0x44(%rbp), %xmm2
movsd 0xf560(%rip), %xmm1     # 0x377a0
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x2824f
jmp 0x2846e
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xe0(%rbp), %rcx
subl 0x10(%rcx), %eax
movl %eax, -0xec(%rbp)
movq -0xa8(%rbp), %rax
movq (%rax), %rax
movq -0xe0(%rbp), %rcx
subq (%rcx), %rax
movq %rax, -0xe8(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movslq -0xec(%rbp), %rax
cmpq -0xe8(%rbp), %rax
jge 0x282af
movslq -0xec(%rbp), %rax
movq %rax, -0x1a8(%rbp)
jmp 0x282bd
movq -0xe8(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x1a0(%rbp), %rdi
movq -0x1a8(%rbp), %rax
movl %eax, %esi
callq 0x29360
movl %eax, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movq -0xe0(%rbp), %rcx
cmpl 0x34(%rcx), %eax
jge 0x282f8
movl -0xf4(%rbp), %eax
movl %eax, -0x1ac(%rbp)
jmp 0x28308
movq -0xe0(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x1ac(%rbp)
movl -0x1ac(%rbp), %eax
movl %eax, -0xf0(%rbp)
movslq -0xec(%rbp), %rax
subq -0xe8(%rbp), %rax
movslq -0xf0(%rbp), %rcx
cmpq %rcx, %rax
jge 0x28350
movq -0xe8(%rbp), %rax
movslq -0xec(%rbp), %rcx
subq %rcx, %rax
movslq -0xf0(%rbp), %rcx
cmpq %rcx, %rax
jge 0x28350
jmp 0x2847c
movq -0xe0(%rbp), %rax
movl 0x14(%rax), %eax
movq -0xa8(%rbp), %rcx
movl 0x8(%rcx), %ecx
movq -0xa8(%rbp), %rdx
addl 0xc(%rdx), %ecx
subl %ecx, %eax
movl %eax, -0xec(%rbp)
movq -0xe0(%rbp), %rax
movq 0x8(%rax), %rax
movq -0xa8(%rbp), %rcx
movq (%rcx), %rcx
movq -0xa8(%rbp), %rdx
movslq 0xc(%rdx), %rdx
addq %rdx, %rcx
subq %rcx, %rax
movq %rax, -0xe8(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movslq -0xec(%rbp), %rax
cmpq -0xe8(%rbp), %rax
jge 0x283ce
movslq -0xec(%rbp), %rax
movq %rax, -0x1c0(%rbp)
jmp 0x283dc
movq -0xe8(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x1b8(%rbp), %rdi
movq -0x1c0(%rbp), %rax
movl %eax, %esi
callq 0x29360
movl %eax, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movq -0xe0(%rbp), %rcx
cmpl 0x34(%rcx), %eax
jge 0x28417
movl -0xf4(%rbp), %eax
movl %eax, -0x1c4(%rbp)
jmp 0x28427
movq -0xe0(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x1c4(%rbp)
movl -0x1c4(%rbp), %eax
movl %eax, -0xf0(%rbp)
movslq -0xec(%rbp), %rax
subq -0xe8(%rbp), %rax
movslq -0xf0(%rbp), %rcx
cmpq %rcx, %rax
jge 0x2846c
movq -0xe8(%rbp), %rax
movslq -0xec(%rbp), %rcx
subq %rcx, %rax
movslq -0xf0(%rbp), %rcx
cmpq %rcx, %rax
jge 0x2846c
jmp 0x2847c
jmp 0x2846e
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x2817a
movslq -0x5c(%rbp), %rax
movq 0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x286fd
leaq 0x1899c(%rip), %rax     # 0x40e30
cmpl $0x4, (%rax)
jl 0x28537
movl -0x60(%rbp), %esi
movq -0xa8(%rbp), %rax
movslq 0xc(%rax), %rdx
movq -0xa8(%rbp), %rax
movslq 0x8(%rax), %rcx
movq -0xa8(%rbp), %rax
movq (%rax), %r8
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x5c(%rbp), %rdi
imulq $0x60, %rdi, %rdi
addq %rdi, %rax
movl 0x10(%rax), %r9d
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x5c(%rbp), %rdi
imulq $0x60, %rdi, %rdi
addq %rdi, %rax
movl 0x14(%rax), %r11d
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x5c(%rbp), %rdi
imulq $0x60, %rdi, %rdi
addq %rdi, %rax
movq (%rax), %r10
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x5c(%rbp), %rdi
imulq $0x60, %rdi, %rdi
addq %rdi, %rax
movq 0x8(%rax), %rax
leaq 0x12556(%rip), %rdi     # 0x3aa78
movl %r11d, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x3060
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x286bb
movq -0xb8(%rbp), %rax
movslq -0x5c(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x28566
jmp 0x286ad
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq -0xb8(%rbp), %rcx
movslq -0x5c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
cvtsi2sdl 0xc(%rax), %xmm1
movq -0xa8(%rbp), %rax
cvtsi2sdl 0xc(%rax), %xmm0
movsd 0x120e3(%rip), %xmm2    # 0x3a690
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x285bc
jmp 0x286ad
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x100(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jg 0x28635
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xa8(%rbp), %rcx
addl 0xc(%rcx), %eax
movq -0x100(%rbp), %rcx
subl 0x8(%rcx), %eax
movq -0xa8(%rbp), %rcx
movl 0xc(%rcx), %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jl 0x28635
movq -0x100(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xa8(%rbp), %rcx
subl 0x8(%rcx), %eax
cltq
movq -0x100(%rbp), %rcx
movq (%rcx), %rcx
movq -0xa8(%rbp), %rdx
subq (%rdx), %rcx
cmpq %rcx, %rax
je 0x28635
jmp 0x286bb
movq -0x100(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xa8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jg 0x286ab
movq -0x100(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x100(%rbp), %rcx
addl 0xc(%rcx), %eax
movq -0xa8(%rbp), %rcx
subl 0x8(%rcx), %eax
movq -0xa8(%rbp), %rcx
movl 0xc(%rcx), %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jl 0x286ab
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x100(%rbp), %rcx
subl 0x8(%rcx), %eax
cltq
movq -0xa8(%rbp), %rcx
movq (%rcx), %rcx
movq -0x100(%rbp), %rdx
subq (%rdx), %rcx
cmpq %rcx, %rax
je 0x286ab
jmp 0x286bb
jmp 0x286ad
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x28540
movl -0x5c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x286de
movq -0xb8(%rbp), %rax
movslq -0x60(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
jmp 0x29328
leaq 0x1874b(%rip), %rax     # 0x40e30
cmpl $0x4, (%rax)
jl 0x286fb
movl -0x60(%rbp), %esi
leaq 0x123e2(%rip), %rdi     # 0x3aad6
movb $0x0, %al
callq 0x3060
jmp 0x286fd
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x28780
movq 0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2872d
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1d0(%rbp)
jmp 0x2873b
movl $0x2, %eax
movq %rax, -0x1d0(%rbp)
jmp 0x2873b
movq -0x1d0(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq 0x10(%rbp), %rax
imulq $0x60, 0x8(%rax), %rsi
leaq 0x11f56(%rip), %rdx     # 0x3a6b8
movl $0x319, %ecx            # imm = 0x319
leaq 0x122fc(%rip), %r8      # 0x3aa6a
callq 0x31d40
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x28782
jmp 0x28782
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rdi
xorl %esi, %esi
movl $0x60, %edx
callq 0x3130
movq -0x30(%rbp), %rax
movl 0x24(%rax), %ecx
movl %ecx, -0x70(%rbp)
movl %ecx, -0x74(%rbp)
movq -0xd8(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0xd8(%rbp), %rax
movl $0xffffffff, 0x20(%rax) # imm = 0xFFFFFFFF
movq -0xd8(%rbp), %rax
movl $0xffffffff, 0x1c(%rax) # imm = 0xFFFFFFFF
movq -0x58(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x18(%rax)
leaq 0x18629(%rip), %rax     # 0x40e30
cmpl $0x4, (%rax)
jl 0x28858
movl -0x60(%rbp), %esi
movq -0xa8(%rbp), %rax
movslq 0xc(%rax), %rdx
movq -0xa8(%rbp), %rax
movslq 0x8(%rax), %rcx
movq -0xa8(%rbp), %rax
movq (%rax), %r8
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rdi
movslq 0xc(%rdi), %rdi
imulq $0x28, %rdi, %rdi
addq %rdi, %rax
movq 0x18(%rax), %r9
leaq 0x122f0(%rip), %rdi     # 0x3ab41
movb $0x0, %al
callq 0x12e40
movq -0xa8(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x28cdb
movq -0xa8(%rbp), %rax
movslq 0x8(%rax), %rdi
leaq 0x11e3d(%rip), %rsi     # 0x3a6b8
movl $0x323, %edx            # imm = 0x323
leaq 0x121e3(%rip), %rcx     # 0x3aa6a
callq 0x31ca0
movq %rax, -0x110(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0xa8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x288dc
movq -0x50(%rbp), %rax
movq -0xa8(%rbp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
subl -0x5c(%rbp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x110(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x2889a
movq -0xa8(%rbp), %rax
movq (%rax), %rax
subq -0x90(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
leaq 0x11db6(%rip), %rsi     # 0x3a6b8
movl $0x326, %edx            # imm = 0x326
leaq 0x1215c(%rip), %rcx     # 0x3aa6a
callq 0x31ca0
movq %rax, -0x108(%rbp)
movl $0x0, -0x5c(%rbp)
movslq -0x5c(%rbp), %rax
cmpq -0x98(%rbp), %rax
jge 0x28963
movq -0xb0(%rbp), %rax
movq -0x98(%rbp), %rcx
subq $0x1, %rcx
movslq -0x5c(%rbp), %rdx
subq %rdx, %rcx
movb (%rax,%rcx), %dl
movq -0x108(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x28921
movl $0x0, -0x5c(%rbp)
cmpl $0x2, -0x5c(%rbp)
jge 0x28c13
movq -0xd8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x124(%rbp)
movq -0x30(%rbp), %rax
movl 0x24(%rax), %eax
movl -0x5c(%rbp), %ecx
shll %cl, %eax
movl %eax, -0x74(%rbp)
leaq 0x18496(%rip), %rax     # 0x40e30
cmpl $0x4, (%rax)
jl 0x28a75
leaq 0x121d0(%rip), %rdi     # 0x3ab7a
movb $0x0, %al
callq 0x3060
movl $0x0, -0x128(%rbp)
movslq -0x128(%rbp), %rax
cmpq -0x98(%rbp), %rax
jge 0x28a01
movq -0x108(%rbp), %rax
movslq -0x128(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x11a55(%rip), %rax     # 0x3a43c
movsbl (%rax,%rcx), %edi
callq 0x34a0
movl -0x128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x289bb
movl $0xa, %edi
callq 0x34a0
leaq 0x12179(%rip), %rdi     # 0x3ab8b
movb $0x0, %al
callq 0x3060
movl $0x0, -0x128(%rbp)
movl -0x128(%rbp), %eax
movq -0xa8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x28a6b
movq -0x110(%rbp), %rax
movslq -0x128(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x119eb(%rip), %rax     # 0x3a43c
movsbl (%rax,%rcx), %edi
callq 0x34a0
movl -0x128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x28a23
movl $0xa, %edi
callq 0x34a0
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x110(%rbp), %rsi
movq -0x98(%rbp), %rax
movl %eax, %edx
movq -0x108(%rbp), %rcx
movq -0x30(%rbp), %r9
addq $0xc4, %r9
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x30(%rbp), %r8
movl 0xc(%r8), %r8d
movl %r8d, -0x1e8(%rbp)
movq -0x30(%rbp), %r8
movl 0x10(%r8), %r8d
movl %r8d, -0x1e4(%rbp)
movq -0x30(%rbp), %r8
movl 0x14(%r8), %r8d
movl %r8d, -0x1e0(%rbp)
movl -0x74(%rbp), %r8d
movl %r8d, -0x1dc(%rbp)
movq -0x30(%rbp), %r8
movl 0x1c(%r8), %r13d
movq -0x30(%rbp), %r8
movl 0x28(%r8), %r12d
movq -0xa8(%rbp), %r8
movl 0xc(%r8), %r15d
movq -0x30(%rbp), %r8
imull (%r8), %r15d
leaq -0x6c(%rbp), %r8
movq %r8, -0x1d8(%rbp)
movl $0x16, %r8d
leaq -0x114(%rbp), %r14
leaq -0x118(%rbp), %rbx
leaq -0x11c(%rbp), %r11
leaq -0x120(%rbp), %r10
movl %eax, (%rsp)
movl -0x1e8(%rbp), %eax
movl %eax, 0x8(%rsp)
movl -0x1e4(%rbp), %eax
movl %eax, 0x10(%rsp)
movl -0x1e0(%rbp), %eax
movl %eax, 0x18(%rsp)
movl -0x1dc(%rbp), %eax
movl %eax, 0x20(%rsp)
movq -0x1d8(%rbp), %rax
movl %r13d, 0x28(%rsp)
movl %r12d, 0x30(%rsp)
movl %r15d, 0x38(%rsp)
movq %r14, 0x40(%rsp)
movq %rbx, 0x48(%rsp)
movq %r11, 0x50(%rsp)
movq %r10, 0x58(%rsp)
movq %rax, 0x60(%rsp)
callq 0x34c50
movl %eax, %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x1c(%rax)
leaq 0x1828e(%rip), %rax     # 0x40e30
cmpl $0x4, (%rax)
jl 0x28bdb
movl -0x124(%rbp), %esi
movq -0xd8(%rbp), %rax
movl 0x1c(%rax), %edx
movl -0x74(%rbp), %ecx
movl -0x6c(%rbp), %r8d
leaq 0x11fd7(%rip), %rdi     # 0x3ab9c
movb $0x0, %al
callq 0x3060
movq 0x173dd(%rip), %rax     # 0x3ffb0
movq (%rax), %rdi
callq 0x3360
movq -0xd8(%rbp), %rax
movl 0x1c(%rax), %eax
cmpl -0x124(%rbp), %eax
je 0x28c01
movl -0x6c(%rbp), %eax
movl -0x74(%rbp), %ecx
sarl %ecx
movl -0x74(%rbp), %edx
sarl $0x2, %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0x28c03
jmp 0x28c13
jmp 0x28c05
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x2896a
cmpl $0x0, -0x120(%rbp)
jle 0x28c37
movl -0x120(%rbp), %eax
movq -0xd8(%rbp), %rcx
movl 0x1c(%rcx), %ecx
movq -0x30(%rbp), %rdx
subl 0x1c(%rdx), %ecx
cmpl %ecx, %eax
jg 0x28c85
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %ecx
subl -0x114(%rbp), %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0xa8(%rbp), %rax
movq (%rax), %rcx
movslq -0x118(%rbp), %rax
subq %rax, %rcx
movq -0xd8(%rbp), %rax
movq %rcx, (%rax)
movq -0xd8(%rbp), %rax
movl 0x1c(%rax), %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x20(%rax)
jmp 0x28cc1
movq -0xd8(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0xa8(%rbp), %rax
movq (%rax), %rcx
movslq -0x11c(%rbp), %rax
subq %rax, %rcx
movq -0xd8(%rbp), %rax
movq %rcx, (%rax)
movl -0x120(%rbp), %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x110(%rbp), %rdi
callq 0x3380
movq -0x108(%rbp), %rdi
callq 0x3380
jmp 0x28d22
movq -0xa8(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x30(%rbp), %rax
imull (%rax), %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0xd8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0xd8(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0xa8(%rbp), %rax
movq (%rax), %rcx
movq -0xd8(%rbp), %rax
movq %rcx, (%rax)
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xa8(%rbp), %rcx
addl 0xc(%rcx), %eax
cmpl -0x44(%rbp), %eax
je 0x29170
movq -0xd8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x144(%rbp)
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xa8(%rbp), %rcx
addl 0xc(%rcx), %eax
movl %eax, -0x134(%rbp)
movq -0xa8(%rbp), %rax
movq (%rax), %rax
movq -0xa8(%rbp), %rcx
movslq 0xc(%rcx), %rcx
addq %rcx, %rax
subq -0x90(%rbp), %rax
movl %eax, -0x138(%rbp)
cmpl $0x0, -0x138(%rbp)
jl 0x28d99
jmp 0x28db8
leaq 0x11e51(%rip), %rdi     # 0x3abf1
leaq 0x11911(%rip), %rsi     # 0x3a6b8
movl $0x343, %edx            # imm = 0x343
leaq 0x11c33(%rip), %rcx     # 0x3a9e6
callq 0x3190
movl $0x0, -0x5c(%rbp)
cmpl $0x2, -0x5c(%rbp)
jge 0x290a3
movq -0xd8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x148(%rbp)
movq -0x30(%rbp), %rax
movl 0x24(%rax), %eax
movl -0x5c(%rbp), %ecx
shll %cl, %eax
movl %eax, -0x70(%rbp)
leaq 0x18041(%rip), %rax     # 0x40e30
cmpl $0x4, (%rax)
jl 0x28eec
leaq 0x11dfa(%rip), %rdi     # 0x3abf9
movb $0x0, %al
callq 0x3060
movl $0x0, -0x14c(%rbp)
movslq -0x14c(%rbp), %rax
movq -0x88(%rbp), %rcx
subq -0x90(%rbp), %rcx
movslq -0x138(%rbp), %rdx
subq %rdx, %rcx
cmpq %rcx, %rax
jge 0x28e72
movq -0xb0(%rbp), %rax
movl -0x138(%rbp), %ecx
addl -0x14c(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x115e4(%rip), %rax     # 0x3a43c
movsbl (%rax,%rcx), %edi
callq 0x34a0
movl -0x14c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14c(%rbp)
jmp 0x28e10
movl $0xa, %edi
callq 0x34a0
leaq 0x11d88(%rip), %rdi     # 0x3ac0b
movb $0x0, %al
callq 0x3060
movl $0x0, -0x14c(%rbp)
movl -0x14c(%rbp), %eax
movl -0x44(%rbp), %ecx
subl -0x134(%rbp), %ecx
cmpl %ecx, %eax
jge 0x28ee2
movq -0x50(%rbp), %rax
movl -0x134(%rbp), %ecx
addl -0x14c(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x11574(%rip), %rax     # 0x3a43c
movsbl (%rax,%rcx), %edi
callq 0x34a0
movl -0x14c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14c(%rbp)
jmp 0x28e94
movl $0xa, %edi
callq 0x34a0
movl -0x44(%rbp), %edi
subl -0x134(%rbp), %edi
movq -0x50(%rbp), %rsi
movslq -0x134(%rbp), %rax
addq %rax, %rsi
movq -0x88(%rbp), %rax
subq -0x90(%rbp), %rax
movslq -0x138(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edx
movq -0xb0(%rbp), %rcx
movslq -0x138(%rbp), %rax
addq %rax, %rcx
movq -0x30(%rbp), %r9
addq $0xc4, %r9
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x30(%rbp), %r8
movl 0xc(%r8), %r8d
movl %r8d, -0x200(%rbp)
movq -0x30(%rbp), %r8
movl 0x10(%r8), %r8d
movl %r8d, -0x1fc(%rbp)
movq -0x30(%rbp), %r8
movl 0x14(%r8), %r8d
movl %r8d, -0x1f8(%rbp)
movl -0x70(%rbp), %r8d
movl %r8d, -0x1f4(%rbp)
movq -0x30(%rbp), %r8
movl 0x20(%r8), %r13d
movq -0x30(%rbp), %r8
movl 0x28(%r8), %r12d
movl -0x144(%rbp), %r15d
leaq -0x6c(%rbp), %r8
addq $0x4, %r8
movq %r8, -0x1f0(%rbp)
movl $0x16, %r8d
leaq -0x12c(%rbp), %r14
leaq -0x130(%rbp), %rbx
leaq -0x13c(%rbp), %r11
leaq -0x140(%rbp), %r10
movl %eax, (%rsp)
movl -0x200(%rbp), %eax
movl %eax, 0x8(%rsp)
movl -0x1fc(%rbp), %eax
movl %eax, 0x10(%rsp)
movl -0x1f8(%rbp), %eax
movl %eax, 0x18(%rsp)
movl -0x1f4(%rbp), %eax
movl %eax, 0x20(%rsp)
movq -0x1f0(%rbp), %rax
movl %r13d, 0x28(%rsp)
movl %r12d, 0x30(%rsp)
movl %r15d, 0x38(%rsp)
movq %r14, 0x40(%rsp)
movq %rbx, 0x48(%rsp)
movq %r11, 0x50(%rsp)
movq %r10, 0x58(%rsp)
movq %rax, 0x60(%rsp)
callq 0x34c50
movl %eax, %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x1c(%rax)
leaq 0x17dfe(%rip), %rax     # 0x40e30
cmpl $0x4, (%rax)
jl 0x2906b
movl -0x148(%rbp), %esi
movq -0xd8(%rbp), %rax
movl 0x1c(%rax), %edx
movl -0x70(%rbp), %ecx
movl -0x68(%rbp), %r8d
leaq 0x11bc8(%rip), %rdi     # 0x3ac1d
movb $0x0, %al
callq 0x3060
movq 0x16f4d(%rip), %rax     # 0x3ffb0
movq (%rax), %rdi
callq 0x3360
movq -0xd8(%rbp), %rax
movl 0x1c(%rax), %eax
cmpl -0x148(%rbp), %eax
je 0x29091
movl -0x68(%rbp), %eax
movl -0x70(%rbp), %ecx
sarl %ecx
movl -0x70(%rbp), %edx
sarl $0x2, %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0x29093
jmp 0x290a3
jmp 0x29095
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x28dbf
cmpl $0x0, -0x140(%rbp)
jle 0x290c7
movl -0x140(%rbp), %eax
movq -0xd8(%rbp), %rcx
movl 0x1c(%rcx), %ecx
movq -0x30(%rbp), %rdx
subl 0x20(%rdx), %ecx
cmpl %ecx, %eax
jg 0x29122
movl -0x134(%rbp), %ecx
addl -0x12c(%rbp), %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x90(%rbp), %rcx
movslq -0x138(%rbp), %rax
addq %rax, %rcx
movslq -0x130(%rbp), %rax
addq %rax, %rcx
movq -0xd8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xd8(%rbp), %rax
movl 0x1c(%rax), %ecx
subl -0x144(%rbp), %ecx
movq -0xd8(%rbp), %rax
addl 0x20(%rax), %ecx
movl %ecx, 0x20(%rax)
jmp 0x2916e
movl -0x44(%rbp), %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x90(%rbp), %rcx
movslq -0x138(%rbp), %rax
addq %rax, %rcx
movslq -0x13c(%rbp), %rax
addq %rax, %rcx
movq -0xd8(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x140(%rbp), %ecx
subl -0x144(%rbp), %ecx
movq -0xd8(%rbp), %rax
addl 0x20(%rax), %ecx
movl %ecx, 0x20(%rax)
jmp 0x291a0
movl -0x44(%rbp), %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0xa8(%rbp), %rax
movq (%rax), %rcx
movq -0xa8(%rbp), %rax
movslq 0xc(%rax), %rax
addq %rax, %rcx
movq -0xd8(%rbp), %rax
movq %rcx, 0x8(%rax)
leaq 0x17c89(%rip), %rax     # 0x40e30
cmpl $0x4, (%rax)
jl 0x291fd
movq -0xd8(%rbp), %rax
movl 0x10(%rax), %esi
movq -0xd8(%rbp), %rax
movl 0x14(%rax), %edx
movq -0xd8(%rbp), %rax
movq (%rax), %rcx
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %r8
movq -0xd8(%rbp), %rax
movl 0x1c(%rax), %r9d
movl -0x74(%rbp), %r10d
movl -0x70(%rbp), %eax
leaq 0x11a85(%rip), %rdi     # 0x3ac73
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x3060
movl $0x0, -0x5c(%rbp)
movq -0xd8(%rbp), %rax
movl $0x0, 0x38(%rax)
movl -0x5c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x292d3
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x5c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xd8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jl 0x292c3
movq -0x158(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x158(%rbp), %rcx
addl 0xc(%rcx), %eax
movq -0xd8(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jg 0x292c3
movq -0x158(%rbp), %rax
movq (%rax), %rax
movq -0xd8(%rbp), %rcx
cmpq (%rcx), %rax
jl 0x292c3
movq -0x158(%rbp), %rax
movq (%rax), %rax
movq -0x158(%rbp), %rcx
movslq 0xc(%rcx), %rcx
addq %rcx, %rax
movq -0xd8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jg 0x292c3
movq -0x158(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0xd8(%rbp), %rax
addl 0x38(%rax), %ecx
movl %ecx, 0x38(%rax)
jmp 0x292c5
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x29212
movl -0x74(%rbp), %eax
cmpl -0x70(%rbp), %eax
jle 0x292e6
movl -0x74(%rbp), %eax
movl %eax, -0x204(%rbp)
jmp 0x292ef
movl -0x70(%rbp), %eax
movl %eax, -0x204(%rbp)
movl -0x204(%rbp), %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0xa8(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0x58(%rbp), %rax
movss 0x14(%rax), %xmm0
movq -0xd8(%rbp), %rax
movss %xmm0, 0x50(%rax)
movl -0x60(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x28142
movq -0xb8(%rbp), %rdi
callq 0x3380
movq -0xb0(%rbp), %rdi
callq 0x3380
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq