// File: /workspace/github_c_makefile_star2_O0/ToniWestbrook[P]paladin/bwamem_pair.c
// Function: mem_sam_pe
int mem_sam_pe(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, const mem_pestat_t pes[4], uint64_t id, bseq1_t s[2], mem_alnreg_v a[2])
{
	extern int mem_mark_primary_se(const mem_opt_t *opt, int n, mem_alnreg_t *a, int64_t id);
	extern int mem_approx_mapq_se(const mem_opt_t *opt, const mem_alnreg_t *a);
	extern void mem_reg2sam(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, bseq1_t *s, mem_alnreg_v *a, int extra_flag, const mem_aln_t *m);
	extern char **mem_gen_alt(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, const mem_alnreg_v *a, int l_query, const char *query);

	int n = 0, i, j, z[2], o, subo, n_sub, extra_flag = 1, n_pri[2], n_aa[2];
	kstring_t str;
	mem_aln_t h[2], g[2], aa[2][2];

	str.l = str.m = 0; str.s = 0;
	memset(h, 0, sizeof(mem_aln_t) * 2);
	memset(g, 0, sizeof(mem_aln_t) * 2);
	n_aa[0] = n_aa[1] = 0;
	if (!(opt->flag & MEM_F_NO_RESCUE)) { // then perform SW for the best alignment
		mem_alnreg_v b[2];
		kv_init(b[0]); kv_init(b[1]);
		for (i = 0; i < 2; ++i)
			for (j = 0; j < a[i].n; ++j)
				if (a[i].a[j].score >= a[i].a[0].score  - opt->pen_unpaired)
					kv_push(mem_alnreg_t, b[i], a[i].a[j]);
		for (i = 0; i < 2; ++i)
			for (j = 0; j < b[i].n && j < opt->max_matesw; ++j)
				n += mem_matesw(opt, bns, pac, pes, &b[i].a[j], s[!i].l_seq, (uint8_t*)s[!i].seq, &a[!i]);
		free(b[0].a); free(b[1].a);
	}
	n_pri[0] = mem_mark_primary_se(opt, a[0].n, a[0].a, id<<1|0);
	n_pri[1] = mem_mark_primary_se(opt, a[1].n, a[1].a, id<<1|1);
	if (opt->flag&MEM_F_NOPAIRING) goto no_pairing;
	// pairing single-end hits
	if (n_pri[0] && n_pri[1] && (o = mem_pair(opt, bns, pac, pes, s, a, id, &subo, &n_sub, z, n_pri)) > 0) {
		int is_multi[2], q_pe, score_un, q_se[2];
		char **XA[2];
		// check if an end has multiple hits even after mate-SW
		for (i = 0; i < 2; ++i) {
			for (j = 1; j < n_pri[i]; ++j)
				if (a[i].a[j].secondary < 0 && a[i].a[j].score >= opt->T) break;
			is_multi[i] = j < n_pri[i]? 1 : 0;
		}
		if (is_multi[0] || is_multi[1]) goto no_pairing; // TODO: in rare cases, the true hit may be long but with low score
		// compute mapQ for the best SE hit
		score_un = a[0].a[0].score + a[1].a[0].score - opt->pen_unpaired;
		//q_pe = o && subo < o? (int)(MEM_MAPQ_COEF * (1. - (double)subo / o) * log(a[0].a[z[0]].seedcov + a[1].a[z[1]].seedcov) + .499) : 0;
		subo = subo > score_un? subo : score_un;
		q_pe = raw_mapq(o - subo, opt->a);
		if (n_sub > 0) q_pe -= (int)(4.343 * log(n_sub+1) + .499);
		if (q_pe < 0) q_pe = 0;
		if (q_pe > 60) q_pe = 60;
		q_pe = (int)(q_pe * (1. - .5 * (a[0].a[0].frac_rep + a[1].a[0].frac_rep)) + .499);
		// the following assumes no split hits
		if (o > score_un) { // paired alignment is preferred
			mem_alnreg_t *c[2];
			c[0] = &a[0].a[z[0]]; c[1] = &a[1].a[z[1]];
			for (i = 0; i < 2; ++i) {
				if (c[i]->secondary >= 0)
					c[i]->sub = a[i].a[c[i]->secondary].score, c[i]->secondary = -2;
				q_se[i] = mem_approx_mapq_se(opt, c[i]);
			}
			q_se[0] = q_se[0] > q_pe? q_se[0] : q_pe < q_se[0] + 40? q_pe : q_se[0] + 40;
			q_se[1] = q_se[1] > q_pe? q_se[1] : q_pe < q_se[1] + 40? q_pe : q_se[1] + 40;
			extra_flag |= 2;
			// cap at the tandem repeat score
			q_se[0] = q_se[0] < raw_mapq(c[0]->score - c[0]->csub, opt->a)? q_se[0] : raw_mapq(c[0]->score - c[0]->csub, opt->a);
			q_se[1] = q_se[1] < raw_mapq(c[1]->score - c[1]->csub, opt->a)? q_se[1] : raw_mapq(c[1]->score - c[1]->csub, opt->a);
		} else { // the unpaired alignment is preferred
			z[0] = z[1] = 0;
			q_se[0] = mem_approx_mapq_se(opt, &a[0].a[0]);
			q_se[1] = mem_approx_mapq_se(opt, &a[1].a[0]);
		}
		for (i = 0; i < 2; ++i) {
			int k = a[i].a[z[i]].secondary_all;
			if (k >= 0 && k < n_pri[i]) { // switch secondary and primary if both of them are non-ALT
				assert(a[i].a[k].secondary_all < 0);
				for (j = 0; j < a[i].n; ++j)
					if (a[i].a[j].secondary_all == k || j == k)
						a[i].a[j].secondary_all = z[i];
				a[i].a[z[i]].secondary_all = -1;
			}
		}
		if (!(opt->flag & MEM_F_ALL)) {
			for (i = 0; i < 2; ++i)
				XA[i] = mem_gen_alt(opt, bns, pac, &a[i], s[i].l_seq, s[i].seq);
		} else XA[0] = XA[1] = 0;
		// write SAM
		for (i = 0; i < 2; ++i) {
			h[i] = mem_reg2aln(opt, bns, pac, s[i].l_seq, s[i].seq, &a[i].a[z[i]]);
			h[i].mapq = q_se[i];
			h[i].flag |= 0x40<<i | extra_flag;
			h[i].XA = XA[i]? XA[i][z[i]] : 0;
			aa[i][n_aa[i]++] = h[i];
			if (n_pri[i] < a[i].n) { // the read has ALT hits
				mem_alnreg_t *p = &a[i].a[n_pri[i]];
				if (p->score < opt->T || p->secondary >= 0 || !p->is_alt) continue;
				g[i] = mem_reg2aln(opt, bns, pac, s[i].l_seq, s[i].seq, p);
				g[i].flag |= 0x800 | 0x40<<i | extra_flag;
				g[i].XA = XA[i]? XA[i][n_pri[i]] : 0;
				aa[i][n_aa[i]++] = g[i];
			}
		}
		for (i = 0; i < n_aa[0]; ++i)
			mem_aln2sam(opt, bns, &str, &s[0], n_aa[0], aa[0], i, &h[1]); // write read1 hits
		s[0].sam = strdup(str.s); str.l = 0;
		for (i = 0; i < n_aa[1]; ++i)
			mem_aln2sam(opt, bns, &str, &s[1], n_aa[1], aa[1], i, &h[0]); // write read2 hits
		s[1].sam = str.s;
		if (strcmp(s[0].name, s[1].name) != 0) err_fatal(__func__, "paired reads have different names: \"%s\", \"%s\"\n", s[0].name, s[1].name);
		// free
		for (i = 0; i < 2; ++i) {
			free(h[i].cigar); free(g[i].cigar);
			if (XA[i] == 0) continue;
			for (j = 0; j < a[i].n; ++j) free(XA[i][j]);
			free(XA[i]);
		}
	} else goto no_pairing;
	return n;

no_pairing:
	for (i = 0; i < 2; ++i) {
		int which = -1;
		if (a[i].n) {
			if (a[i].a[0].score >= opt->T) which = 0;
			else if (n_pri[i] < a[i].n && a[i].a[n_pri[i]].score >= opt->T)
				which = n_pri[i];
		}
		if (which >= 0) h[i] = mem_reg2aln(opt, bns, pac, s[i].l_seq, s[i].seq, &a[i].a[which]);
		else h[i] = mem_reg2aln(opt, bns, pac, s[i].l_seq, s[i].seq, 0);
	}
	if (!(opt->flag & MEM_F_NOPAIRING) && h[0].rid == h[1].rid && h[0].rid >= 0) { // if the top hits from the two ends constitute a proper pair, flag it.
		int64_t dist;
		int d;
		d = mem_infer_dir(bns->l_pac, a[0].a[0].rb, a[1].a[0].rb, &dist);
		if (!pes[d].failed && dist >= pes[d].low && dist <= pes[d].high) extra_flag |= 2;
	}
	mem_reg2sam(opt, bns, pac, &s[0], &a[0], 0x41|extra_flag, &h[1]);
	mem_reg2sam(opt, bns, pac, &s[1], &a[1], 0x81|extra_flag, &h[0]);
	if (strcmp(s[0].name, s[1].name) != 0) err_fatal(__func__, "paired reads have different names: \"%s\", \"%s\"\n", s[0].name, s[1].name);
	free(h[0].cigar); free(h[1].cigar);
	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x460, %rsp            # imm = 0x460
movq 0x10(%rbp), %rax
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq %rdx, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
movq %r8, -0x40(%rbp)
movq %r9, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x1, -0x6c(%rbp)
movq $0x0, -0x90(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0x88(%rbp)
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x70, %edx
callq 0x3130
leaq -0x180(%rbp), %rdi
xorl %esi, %esi
movl $0x70, %edx
callq 0x3130
movl $0x0, -0x78(%rbp)
movl $0x0, -0x7c(%rbp)
movq -0x20(%rbp), %rax
movl 0x48(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x2f721
movq $0x0, -0x298(%rbp)
movq $0x0, -0x2a0(%rbp)
movq $0x0, -0x288(%rbp)
movq $0x0, -0x278(%rbp)
movq $0x0, -0x280(%rbp)
movq $0x0, -0x268(%rbp)
movl $0x0, -0x50(%rbp)
cmpl $0x2, -0x50(%rbp)
jge 0x2f5d9
movl $0x0, -0x54(%rbp)
movslq -0x54(%rbp), %rax
movq 0x10(%rbp), %rcx
movslq -0x50(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x2f5c9
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x54(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movq 0x10(%rbp), %rcx
movslq -0x50(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq 0x18(%rcx), %rcx
movl 0x1c(%rcx), %ecx
movq -0x20(%rbp), %rdx
subl 0x18(%rdx), %ecx
cmpl %ecx, %eax
jl 0x2f5b9
jmp 0x2f45e
movslq -0x50(%rbp), %rcx
leaq -0x2a0(%rbp), %rax
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x50(%rbp), %rdx
leaq -0x2a0(%rbp), %rcx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jne 0x2f553
movslq -0x50(%rbp), %rcx
leaq -0x2a0(%rbp), %rax
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0x2f4ca
movslq -0x50(%rbp), %rcx
leaq -0x2a0(%rbp), %rax
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x3f0(%rbp)
jmp 0x2f4d8
movl $0x2, %eax
movq %rax, -0x3f0(%rbp)
jmp 0x2f4d8
movq -0x3f0(%rbp), %rcx
movslq -0x50(%rbp), %rdx
leaq -0x2a0(%rbp), %rax
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movslq -0x50(%rbp), %rcx
leaq -0x2a0(%rbp), %rax
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rdi
movslq -0x50(%rbp), %rcx
leaq -0x2a0(%rbp), %rax
shlq $0x5, %rcx
addq %rcx, %rax
imulq $0x60, 0x8(%rax), %rsi
leaq 0xbc00(%rip), %rdx      # 0x3b129
movl $0x10f, %ecx            # imm = 0x10F
leaq 0xbdee(%rip), %r8       # 0x3b323
callq 0x31d40
movq %rax, %rcx
movslq -0x50(%rbp), %rdx
leaq -0x2a0(%rbp), %rax
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movslq -0x50(%rbp), %rcx
leaq -0x2a0(%rbp), %rax
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rdi
movslq -0x50(%rbp), %rax
leaq -0x2a0(%rbp), %rcx
shlq $0x5, %rax
addq %rax, %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
imulq $0x60, %rax, %rax
addq %rax, %rdi
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rsi
movslq -0x54(%rbp), %rax
imulq $0x60, %rax, %rax
addq %rax, %rsi
movl $0x60, %edx
callq 0x3250
jmp 0x2f5b9
jmp 0x2f5bb
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x2f3fa
jmp 0x2f5cb
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x2f3e9
movl $0x0, -0x50(%rbp)
cmpl $0x2, -0x50(%rbp)
jge 0x2f709
movl $0x0, -0x54(%rbp)
movslq -0x54(%rbp), %rcx
movslq -0x50(%rbp), %rax
leaq -0x2a0(%rbp), %rdx
shlq $0x5, %rax
addq %rax, %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x3f1(%rbp)
jae 0x2f62a
movl -0x54(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0xb8(%rcx), %eax
setl %al
movb %al, -0x3f1(%rbp)
movb -0x3f1(%rbp), %al
testb $0x1, %al
jne 0x2f639
jmp 0x2f6f9
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movslq -0x50(%rbp), %r8
leaq -0x2a0(%rbp), %rax
shlq $0x5, %r8
addq %r8, %rax
movq 0x18(%rax), %r8
movslq -0x54(%rbp), %rax
imulq $0x60, %rax, %rax
addq %rax, %r8
movq -0x48(%rbp), %rax
cmpl $0x0, -0x50(%rbp)
setne %r9b
xorb $-0x1, %r9b
andb $0x1, %r9b
movzbl %r9b, %r9d
movslq %r9d, %r9
imulq $0x30, %r9, %r9
addq %r9, %rax
movl (%rax), %r9d
movq -0x48(%rbp), %rax
cmpl $0x0, -0x50(%rbp)
setne %r10b
xorb $-0x1, %r10b
andb $0x1, %r10b
movzbl %r10b, %r10d
movslq %r10d, %r10
imulq $0x30, %r10, %r10
addq %r10, %rax
movq 0x18(%rax), %r10
movq 0x10(%rbp), %rax
cmpl $0x0, -0x50(%rbp)
setne %r11b
xorb $-0x1, %r11b
andb $0x1, %r11b
movzbl %r11b, %r11d
movslq %r11d, %r11
shlq $0x5, %r11
addq %r11, %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2e030
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x2f5f1
jmp 0x2f6fb
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x2f5e0
movq -0x288(%rbp), %rdi
callq 0x3380
movq -0x268(%rbp), %rdi
callq 0x3380
movq -0x20(%rbp), %rdi
movq 0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, %esi
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x40(%rbp), %rcx
shlq %rcx
orq $0x0, %rcx
callq 0x26fb0
movl %eax, -0x74(%rbp)
movq -0x20(%rbp), %rdi
movq 0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %esi
movq 0x10(%rbp), %rax
movq 0x38(%rax), %rdx
movq -0x40(%rbp), %rcx
shlq %rcx
orq $0x1, %rcx
callq 0x26fb0
movl %eax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movl 0x48(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x2f786
jmp 0x304ba
cmpl $0x0, -0x74(%rbp)
je 0x304ad
cmpl $0x0, -0x70(%rbp)
je 0x304ad
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %r8
movq 0x10(%rbp), %r9
movq -0x40(%rbp), %rax
movl %eax, %r14d
leaq -0x5c(%rbp), %r10
leaq -0x74(%rbp), %rax
leaq -0x64(%rbp), %rbx
leaq -0x68(%rbp), %r11
movl %r14d, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x2e9f0
movl %eax, -0x60(%rbp)
cmpl $0x0, %eax
jle 0x304ad
movl $0x0, -0x50(%rbp)
cmpl $0x2, -0x50(%rbp)
jge 0x2f8a4
movl $0x1, -0x54(%rbp)
movl -0x54(%rbp), %eax
movslq -0x50(%rbp), %rcx
cmpl -0x74(%rbp,%rcx,4), %eax
jge 0x2f874
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x54(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x3c(%rax)
jge 0x2f867
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x54(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jl 0x2f867
jmp 0x2f874
jmp 0x2f869
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x2f80a
movl -0x54(%rbp), %edx
movslq -0x50(%rbp), %rax
movl -0x74(%rbp,%rax,4), %esi
xorl %ecx, %ecx
movl $0x1, %eax
cmpl %esi, %edx
cmovll %eax, %ecx
movslq -0x50(%rbp), %rax
movl %ecx, -0x2a8(%rbp,%rax,4)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x2f7f9
cmpl $0x0, -0x2a8(%rbp)
jne 0x2f8b6
cmpl $0x0, -0x2a4(%rbp)
je 0x2f8bb
jmp 0x304ba
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x1c(%rax), %eax
movq 0x10(%rbp), %rcx
movq 0x38(%rcx), %rcx
addl 0x1c(%rcx), %eax
movq -0x20(%rbp), %rcx
subl 0x18(%rcx), %eax
movl %eax, -0x2b0(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x2b0(%rbp), %eax
jle 0x2f8f4
movl -0x64(%rbp), %eax
movl %eax, -0x3f8(%rbp)
jmp 0x2f900
movl -0x2b0(%rbp), %eax
movl %eax, -0x3f8(%rbp)
movl -0x3f8(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x60(%rbp), %eax
subl -0x64(%rbp), %eax
cvtsi2sd %eax, %xmm1
movsd 0xb7dd(%rip), %xmm0     # 0x3b0f8
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
cvtsi2sdl (%rax), %xmm1
divsd %xmm1, %xmm0
movsd 0x7e75(%rip), %xmm1     # 0x377a8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x2ac(%rbp)
cmpl $0x0, -0x68(%rbp)
jle 0x2f980
movl -0x68(%rbp), %eax
addl $0x1, %eax
cvtsi2sd %eax, %xmm0
callq 0x3240
movsd 0xad4a(%rip), %xmm1     # 0x3a6a8
mulsd %xmm1, %xmm0
movsd 0x7e3e(%rip), %xmm1     # 0x377a8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movl -0x2ac(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x2ac(%rbp)
cmpl $0x0, -0x2ac(%rbp)
jge 0x2f993
movl $0x0, -0x2ac(%rbp)
cmpl $0x3c, -0x2ac(%rbp)
jle 0x2f9a6
movl $0x3c, -0x2ac(%rbp)
cvtsi2sdl -0x2ac(%rbp), %xmm0
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rax
movss 0x50(%rax), %xmm1
movq 0x10(%rbp), %rax
movq 0x38(%rax), %rax
addss 0x50(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0xb72c(%rip), %xmm2     # 0x3b100
mulsd %xmm2, %xmm1
movsd 0xa9a8(%rip), %xmm2     # 0x3a388
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd 0x7db8(%rip), %xmm1     # 0x377a8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x2ac(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x2b0(%rbp), %eax
jle 0x2fd0a
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x5c(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x2e0(%rbp)
movq 0x10(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x58(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x2d8(%rbp)
movl $0x0, -0x50(%rbp)
cmpl $0x2, -0x50(%rbp)
jge 0x2fae3
movslq -0x50(%rbp), %rax
movq -0x2e0(%rbp,%rax,8), %rax
cmpl $0x0, 0x3c(%rax)
jl 0x2fab3
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x50(%rbp), %rcx
movq -0x2e0(%rbp,%rcx,8), %rcx
movslq 0x3c(%rcx), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %ecx
movslq -0x50(%rbp), %rax
movq -0x2e0(%rbp,%rax,8), %rax
movl %ecx, 0x24(%rax)
movslq -0x50(%rbp), %rax
movq -0x2e0(%rbp,%rax,8), %rax
movl $0xfffffffe, 0x3c(%rax) # imm = 0xFFFFFFFE
movq -0x20(%rbp), %rdi
movslq -0x50(%rbp), %rax
movq -0x2e0(%rbp,%rax,8), %rsi
callq 0x2ad90
movl %eax, %ecx
movslq -0x50(%rbp), %rax
movl %ecx, -0x2b8(%rbp,%rax,4)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x2fa48
movl -0x2b8(%rbp), %eax
cmpl -0x2ac(%rbp), %eax
jle 0x2faff
movl -0x2b8(%rbp), %eax
movl %eax, -0x3fc(%rbp)
jmp 0x2fb3b
movl -0x2ac(%rbp), %eax
movl -0x2b8(%rbp), %ecx
addl $0x28, %ecx
cmpl %ecx, %eax
jge 0x2fb20
movl -0x2ac(%rbp), %eax
movl %eax, -0x400(%rbp)
jmp 0x2fb2f
movl -0x2b8(%rbp), %eax
addl $0x28, %eax
movl %eax, -0x400(%rbp)
movl -0x400(%rbp), %eax
movl %eax, -0x3fc(%rbp)
movl -0x3fc(%rbp), %eax
movl %eax, -0x2b8(%rbp)
movl -0x2b4(%rbp), %eax
cmpl -0x2ac(%rbp), %eax
jle 0x2fb63
movl -0x2b4(%rbp), %eax
movl %eax, -0x404(%rbp)
jmp 0x2fb9f
movl -0x2ac(%rbp), %eax
movl -0x2b4(%rbp), %ecx
addl $0x28, %ecx
cmpl %ecx, %eax
jge 0x2fb84
movl -0x2ac(%rbp), %eax
movl %eax, -0x408(%rbp)
jmp 0x2fb93
movl -0x2b4(%rbp), %eax
addl $0x28, %eax
movl %eax, -0x408(%rbp)
movl -0x408(%rbp), %eax
movl %eax, -0x404(%rbp)
movl -0x404(%rbp), %eax
movl %eax, -0x2b4(%rbp)
movl -0x6c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x6c(%rbp)
movl -0x2b8(%rbp), %eax
movq -0x2e0(%rbp), %rcx
movl 0x1c(%rcx), %ecx
movq -0x2e0(%rbp), %rdx
subl 0x2c(%rdx), %ecx
cvtsi2sd %ecx, %xmm1
movsd 0xb51e(%rip), %xmm0     # 0x3b0f8
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rcx
cvtsi2sdl (%rcx), %xmm1
divsd %xmm1, %xmm0
movsd 0x7bb6(%rip), %xmm1     # 0x377a8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
cmpl %ecx, %eax
jge 0x2fc0c
movl -0x2b8(%rbp), %eax
movl %eax, -0x40c(%rbp)
jmp 0x2fc52
movq -0x2e0(%rbp), %rax
movl 0x1c(%rax), %eax
movq -0x2e0(%rbp), %rcx
subl 0x2c(%rcx), %eax
cvtsi2sd %eax, %xmm1
movsd 0xb4cc(%rip), %xmm0     # 0x3b0f8
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
cvtsi2sdl (%rax), %xmm1
divsd %xmm1, %xmm0
movsd 0x7b64(%rip), %xmm1     # 0x377a8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x40c(%rbp)
movl -0x40c(%rbp), %eax
movl %eax, -0x2b8(%rbp)
movl -0x2b4(%rbp), %eax
movq -0x2d8(%rbp), %rcx
movl 0x1c(%rcx), %ecx
movq -0x2d8(%rbp), %rdx
subl 0x2c(%rdx), %ecx
cvtsi2sd %ecx, %xmm1
movsd 0xb474(%rip), %xmm0     # 0x3b0f8
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rcx
cvtsi2sdl (%rcx), %xmm1
divsd %xmm1, %xmm0
movsd 0x7b0c(%rip), %xmm1     # 0x377a8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
cmpl %ecx, %eax
jge 0x2fcb6
movl -0x2b4(%rbp), %eax
movl %eax, -0x410(%rbp)
jmp 0x2fcfc
movq -0x2d8(%rbp), %rax
movl 0x1c(%rax), %eax
movq -0x2d8(%rbp), %rcx
subl 0x2c(%rcx), %eax
cvtsi2sd %eax, %xmm1
movsd 0xb422(%rip), %xmm0     # 0x3b0f8
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
cvtsi2sdl (%rax), %xmm1
divsd %xmm1, %xmm0
movsd 0x7aba(%rip), %xmm1     # 0x377a8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x410(%rbp)
movl -0x410(%rbp), %eax
movl %eax, -0x2b4(%rbp)
jmp 0x2fd46
movl $0x0, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movq -0x20(%rbp), %rdi
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x2ad90
movl %eax, -0x2b8(%rbp)
movq -0x20(%rbp), %rdi
movq 0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x2ad90
movl %eax, -0x2b4(%rbp)
movl $0x0, -0x50(%rbp)
cmpl $0x2, -0x50(%rbp)
jge 0x2feb2
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x50(%rbp), %rcx
movslq -0x5c(%rbp,%rcx,4), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x40(%rax), %eax
movl %eax, -0x2e4(%rbp)
cmpl $0x0, -0x2e4(%rbp)
jl 0x2fea2
movl -0x2e4(%rbp), %eax
movslq -0x50(%rbp), %rcx
cmpl -0x74(%rbp,%rcx,4), %eax
jge 0x2fea2
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x2e4(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x40(%rax)
jge 0x2fdcd
jmp 0x2fdec
leaq 0xb55a(%rip), %rdi      # 0x3b32e
leaq 0xb34e(%rip), %rsi      # 0x3b129
movl $0x143, %edx            # imm = 0x143
leaq 0xb563(%rip), %rcx      # 0x3b34a
callq 0x3190
movl $0x0, -0x54(%rbp)
movslq -0x54(%rbp), %rax
movq 0x10(%rbp), %rcx
movslq -0x50(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x2fe78
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x54(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x40(%rax), %eax
cmpl -0x2e4(%rbp), %eax
je 0x2fe3f
movl -0x54(%rbp), %eax
cmpl -0x2e4(%rbp), %eax
jne 0x2fe68
movslq -0x50(%rbp), %rax
movl -0x5c(%rbp,%rax,4), %ecx
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq 0x18(%rax), %rax
movslq -0x54(%rbp), %rdx
imulq $0x60, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x40(%rax)
jmp 0x2fe6a
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x2fdf3
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x50(%rbp), %rcx
movslq -0x5c(%rbp,%rcx,4), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x40(%rax) # imm = 0xFFFFFFFF
jmp 0x2fea4
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x2fd4d
movq -0x20(%rbp), %rax
movl 0x48(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x2ff2f
movl $0x0, -0x50(%rbp)
cmpl $0x2, -0x50(%rbp)
jge 0x2ff2d
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0x10(%rbp), %rcx
movslq -0x50(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rcx
movq -0x48(%rbp), %rax
movslq -0x50(%rbp), %r8
imulq $0x30, %r8, %r8
addq %r8, %rax
movl (%rax), %r8d
movq -0x48(%rbp), %rax
movslq -0x50(%rbp), %r9
imulq $0x30, %r9, %r9
addq %r9, %rax
movq 0x18(%rax), %r9
callq 0x313e0
movq %rax, %rcx
movslq -0x50(%rbp), %rax
movq %rcx, -0x2d0(%rbp,%rax,8)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x2fec8
jmp 0x2ff45
movq $0x0, -0x2c8(%rbp)
movq $0x0, -0x2d0(%rbp)
movl $0x0, -0x50(%rbp)
cmpl $0x2, -0x50(%rbp)
jge 0x302c0
movslq -0x50(%rbp), %rcx
leaq -0x110(%rbp), %rax
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x418(%rbp)
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x48(%rbp), %rax
movslq -0x50(%rbp), %rdi
imulq $0x30, %rdi, %rdi
addq %rdi, %rax
movl (%rax), %r8d
movq -0x48(%rbp), %rax
movslq -0x50(%rbp), %rdi
imulq $0x30, %rdi, %rdi
addq %rdi, %rax
movq 0x18(%rax), %r9
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rdi
shlq $0x5, %rdi
addq %rdi, %rax
movq 0x18(%rax), %rax
movslq -0x50(%rbp), %rdi
movslq -0x5c(%rbp,%rdi,4), %rdi
imulq $0x60, %rdi, %rdi
addq %rdi, %rax
leaq -0x320(%rbp), %rdi
movq %rax, (%rsp)
callq 0x2b620
movq -0x418(%rbp), %rdi
leaq -0x320(%rbp), %rsi
movl $0x38, %edx
callq 0x3250
movslq -0x50(%rbp), %rax
movl -0x2b8(%rbp,%rax,4), %edx
movslq -0x50(%rbp), %rcx
leaq -0x110(%rbp), %rax
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
andl $0xff, %edx
shll $0x2, %edx
andl $0xfffffc03, %ecx       # imm = 0xFFFFFC03
orl %edx, %ecx
movl %ecx, 0x10(%rax)
movl -0x50(%rbp), %ecx
movl $0x40, %eax
shll %cl, %eax
movl %eax, %ecx
orl -0x6c(%rbp), %ecx
movslq -0x50(%rbp), %rdx
leaq -0x110(%rbp), %rax
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movslq -0x50(%rbp), %rax
cmpq $0x0, -0x2d0(%rbp,%rax,8)
je 0x30077
movslq -0x50(%rbp), %rax
movq -0x2d0(%rbp,%rax,8), %rax
movslq -0x50(%rbp), %rcx
movslq -0x5c(%rbp,%rcx,4), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x420(%rbp)
jmp 0x30082
xorl %eax, %eax
movq %rax, -0x420(%rbp)
jmp 0x30082
movq -0x420(%rbp), %rcx
movslq -0x50(%rbp), %rdx
leaq -0x110(%rbp), %rax
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x20(%rax)
movslq -0x50(%rbp), %rax
leaq -0x260(%rbp), %rdi
imulq $0x70, %rax, %rax
addq %rax, %rdi
movslq -0x50(%rbp), %rcx
movl -0x7c(%rbp,%rcx,4), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x7c(%rbp,%rcx,4)
cltq
imulq $0x38, %rax, %rax
addq %rax, %rdi
movslq -0x50(%rbp), %rax
leaq -0x110(%rbp), %rsi
imulq $0x38, %rax, %rax
addq %rax, %rsi
movl $0x38, %edx
callq 0x3250
movslq -0x50(%rbp), %rax
movslq -0x74(%rbp,%rax,4), %rax
movq 0x10(%rbp), %rcx
movslq -0x50(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x302b0
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x50(%rbp), %rcx
movslq -0x74(%rbp,%rcx,4), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x328(%rbp)
movq -0x328(%rbp), %rax
movl 0x1c(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jl 0x30164
movq -0x328(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
jge 0x30164
movq -0x328(%rbp), %rax
movl 0x48(%rax), %eax
sarl $0x1e, %eax
cmpl $0x0, %eax
jne 0x30169
jmp 0x302b2
movslq -0x50(%rbp), %rcx
leaq -0x180(%rbp), %rax
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x428(%rbp)
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x48(%rbp), %rax
movslq -0x50(%rbp), %rdi
imulq $0x30, %rdi, %rdi
addq %rdi, %rax
movl (%rax), %r8d
movq -0x48(%rbp), %rax
movslq -0x50(%rbp), %rdi
imulq $0x30, %rdi, %rdi
addq %rdi, %rax
movq 0x18(%rax), %r9
movq -0x328(%rbp), %rax
leaq -0x360(%rbp), %rdi
movq %rax, (%rsp)
callq 0x2b620
movq -0x428(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movl $0x38, %edx
callq 0x3250
movl -0x50(%rbp), %ecx
movl $0x40, %eax
shll %cl, %eax
movl %eax, %ecx
orl $0x800, %ecx            # imm = 0x800
orl -0x6c(%rbp), %ecx
movslq -0x50(%rbp), %rdx
leaq -0x180(%rbp), %rax
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movslq -0x50(%rbp), %rax
cmpq $0x0, -0x2d0(%rbp,%rax,8)
je 0x30240
movslq -0x50(%rbp), %rax
movq -0x2d0(%rbp,%rax,8), %rax
movslq -0x50(%rbp), %rcx
movslq -0x74(%rbp,%rcx,4), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x430(%rbp)
jmp 0x3024b
xorl %eax, %eax
movq %rax, -0x430(%rbp)
jmp 0x3024b
movq -0x430(%rbp), %rcx
movslq -0x50(%rbp), %rdx
leaq -0x180(%rbp), %rax
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x20(%rax)
movslq -0x50(%rbp), %rax
leaq -0x260(%rbp), %rdi
imulq $0x70, %rax, %rax
addq %rax, %rdi
movslq -0x50(%rbp), %rcx
movl -0x7c(%rbp,%rcx,4), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x7c(%rbp,%rcx,4)
cltq
imulq $0x38, %rax, %rax
addq %rax, %rdi
movslq -0x50(%rbp), %rax
leaq -0x180(%rbp), %rsi
imulq $0x38, %rax, %rax
addq %rax, %rsi
movl $0x38, %edx
callq 0x3250
jmp 0x302b2
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x2ff4c
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jge 0x30315
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x48(%rbp), %rcx
movl -0x7c(%rbp), %r8d
leaq -0x260(%rbp), %r9
movl -0x50(%rbp), %r10d
leaq -0x110(%rbp), %rax
addq $0x38, %rax
leaq -0x98(%rbp), %rdx
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x29440
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x302c7
movq -0x88(%rbp), %rdi
leaq 0xae06(%rip), %rsi      # 0x3b129
movl $0x160, %edx            # imm = 0x160
leaq 0xaff4(%rip), %rcx      # 0x3b323
callq 0x31df0
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x28(%rax)
movq $0x0, -0x98(%rbp)
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x78(%rbp), %eax
jge 0x303a3
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x48(%rbp), %rcx
addq $0x30, %rcx
movl -0x78(%rbp), %r8d
leaq -0x260(%rbp), %r9
addq $0x70, %r9
movl -0x50(%rbp), %r10d
leaq -0x110(%rbp), %rax
leaq -0x98(%rbp), %rdx
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x29440
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x30351
movq -0x88(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x48(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x34b0
cmpl $0x0, %eax
je 0x303f1
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x48(%rbp), %rax
movq 0x38(%rax), %rcx
leaq 0xaf40(%rip), %rdi      # 0x3b323
leaq 0xafe0(%rip), %rsi      # 0x3b3ca
movb $0x0, %al
callq 0x12840
movl $0x0, -0x50(%rbp)
cmpl $0x2, -0x50(%rbp)
jge 0x304ab
movslq -0x50(%rbp), %rcx
leaq -0x110(%rbp), %rax
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rdi
callq 0x3380
movslq -0x50(%rbp), %rcx
leaq -0x180(%rbp), %rax
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rdi
callq 0x3380
movslq -0x50(%rbp), %rax
cmpq $0x0, -0x2d0(%rbp,%rax,8)
jne 0x30449
jmp 0x3049d
movl $0x0, -0x54(%rbp)
movslq -0x54(%rbp), %rax
movq 0x10(%rbp), %rcx
movslq -0x50(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x3048c
movslq -0x50(%rbp), %rax
movq -0x2d0(%rbp,%rax,8), %rax
movslq -0x54(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x3380
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x30450
movslq -0x50(%rbp), %rax
movq -0x2d0(%rbp,%rax,8), %rdi
callq 0x3380
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x303f8
jmp 0x304af
jmp 0x304ba
movl -0x4c(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x3082c
movl $0x0, -0x50(%rbp)
cmpl $0x2, -0x50(%rbp)
jge 0x306a1
movl $0xffffffff, -0x364(%rbp) # imm = 0xFFFFFFFF
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x30577
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movl 0x1c(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jl 0x30519
movl $0x0, -0x364(%rbp)
jmp 0x30575
movslq -0x50(%rbp), %rax
movslq -0x74(%rbp,%rax,4), %rax
movq 0x10(%rbp), %rcx
movslq -0x50(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x30573
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x50(%rbp), %rcx
movslq -0x74(%rbp,%rcx,4), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jl 0x30573
movslq -0x50(%rbp), %rax
movl -0x74(%rbp,%rax,4), %eax
movl %eax, -0x364(%rbp)
jmp 0x30575
jmp 0x30577
cmpl $0x0, -0x364(%rbp)
jl 0x30619
movslq -0x50(%rbp), %rcx
leaq -0x110(%rbp), %rax
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x438(%rbp)
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x48(%rbp), %rax
movslq -0x50(%rbp), %rdi
imulq $0x30, %rdi, %rdi
addq %rdi, %rax
movl (%rax), %r8d
movq -0x48(%rbp), %rax
movslq -0x50(%rbp), %rdi
imulq $0x30, %rdi, %rdi
addq %rdi, %rax
movq 0x18(%rax), %r9
movq 0x10(%rbp), %rax
movslq -0x50(%rbp), %rdi
shlq $0x5, %rdi
addq %rdi, %rax
movq 0x18(%rax), %rax
movslq -0x364(%rbp), %rdi
imulq $0x60, %rdi, %rdi
addq %rdi, %rax
leaq -0x3a0(%rbp), %rdi
movq %rax, (%rsp)
callq 0x2b620
movq -0x438(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
movl $0x38, %edx
callq 0x3250
jmp 0x30691
movslq -0x50(%rbp), %rcx
leaq -0x110(%rbp), %rax
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x440(%rbp)
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x48(%rbp), %rax
movslq -0x50(%rbp), %rdi
imulq $0x30, %rdi, %rdi
addq %rdi, %rax
movl (%rax), %r8d
movq -0x48(%rbp), %rax
movslq -0x50(%rbp), %rdi
imulq $0x30, %rdi, %rdi
addq %rdi, %rax
movq 0x18(%rax), %r9
leaq -0x3d8(%rbp), %rdi
xorl %eax, %eax
movq $0x0, (%rsp)
callq 0x2b620
movq -0x440(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
movl $0x38, %edx
callq 0x3250
jmp 0x30693
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x304c1
movq -0x20(%rbp), %rax
movl 0x48(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x30768
movl -0x108(%rbp), %eax
cmpl -0xd0(%rbp), %eax
jne 0x30768
cmpl $0x0, -0x108(%rbp)
jl 0x30768
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rsi
movq 0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rdx
leaq -0x3e0(%rbp), %rcx
callq 0x2df60
movl %eax, -0x3e4(%rbp)
movq -0x38(%rbp), %rax
movslq -0x3e4(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x0, 0x8(%rax)
jne 0x30766
movq -0x3e0(%rbp), %rax
movq -0x38(%rbp), %rcx
movslq -0x3e4(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jl 0x30766
movq -0x3e0(%rbp), %rax
movq -0x38(%rbp), %rcx
movslq -0x3e4(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq 0x4(%rcx), %rcx
cmpq %rcx, %rax
jg 0x30766
movl -0x6c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x6c(%rbp)
jmp 0x30768
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq 0x10(%rbp), %r8
movl -0x6c(%rbp), %r9d
orl $0x41, %r9d
leaq -0x110(%rbp), %rax
addq $0x38, %rax
movq %rax, (%rsp)
callq 0x2b0d0
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x48(%rbp), %rcx
addq $0x30, %rcx
movq 0x10(%rbp), %r8
addq $0x20, %r8
movl -0x6c(%rbp), %r9d
orl $0x81, %r9d
leaq -0x110(%rbp), %rax
movq %rax, (%rsp)
callq 0x2b0d0
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x48(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x34b0
cmpl $0x0, %eax
je 0x3080e
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x48(%rbp), %rax
movq 0x38(%rax), %rcx
leaq 0xab23(%rip), %rdi      # 0x3b323
leaq 0xabc3(%rip), %rsi      # 0x3b3ca
movb $0x0, %al
callq 0x12840
movq -0xf8(%rbp), %rdi
callq 0x3380
movq -0xc0(%rbp), %rdi
callq 0x3380
movl -0x4c(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x460, %rsp            # imm = 0x460
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax,%rax)