// File: /workspace/github_c_makefile_star2_O0/lh3[P]miniprot/align.c
// Function: mp_align
void mp_align(void *km, const mp_mapopt_t *opt, const mp_idx_t *mi, int32_t len, const char *aa, mp_reg1_t *r, int32_t extl0, int32_t extr0)
{
	int32_t i, i0 = 0, ne0 = 0, ae0 = 0, score = 0, extl, extr;
	int64_t as, ae, ctg_len, vs0, l_nt;
	uint8_t *nt, *ss = 0;
	ns_opt_t ns_opt0;
	mp_cigar_t cigar = {0,0,0};

	assert(r->cnt > 0);
	if (!(mp_dbg_flag & MP_DBG_MORE_DP)) {
		mp_filter_seed(r->cnt, r->a, 6, 3, opt->kmer2, opt->kmer2 + 1);
		for (i = 0; i < r->cnt; ++i)
			if (r->a[i]>>31&1) break;
		if (i == r->cnt) { // all filtered; FIXME: we need to filter it later; not implemented yet
			r->cnt = 0;
			return;
		}
		i0 = i;
	}

	extl = extr = opt->max_ext;
	if (r->qs >= 10) extl = opt->max_intron/2;
	if (len - r->qe >= 10) extr = opt->max_intron/2;
	if (extl0 > 0) extl = extl < extl0? extl : extl0;
	if (extr0 > 0) extr = extr < extr0? extr : extr0;
	ctg_len = mi->nt->ctg[r->vid>>1].len;
	as = r->vs > extl? r->vs - extl : 0;
	ae = r->ve + extr < ctg_len? r->ve + extr : ctg_len;
	nt = Kmalloc(km, uint8_t, ae - as);
	l_nt = mp_ntseq_get_by_v(mi->nt, r->vid, as, ae, nt);
	assert(l_nt == ae - as);
	if (mi->nt->spsc) {
		int32_t l_ss;
		ss = Kmalloc(km, uint8_t, ae - as);
		l_ss = mp_ntseq_spsc_get_by_v(mi->nt, r->vid, as, ae, ss);
		assert(l_ss = l_nt);
	}
	vs0 = r->vs;
	mp_map2ns_opt(opt, &ns_opt0);
	//fprintf(stderr, "X\t%s\t%c\t%ld\t%ld\n", mi->nt->ctg[r->vid>>1].name, "+-"[r->vid&1], (long)(r->vid&1? ctg_len - ae : as), (long)(r->vid&1? ctg_len - as : ae));

	{ // left extension
		int64_t vs1 = vs0 + (r->a[i0]>>32) + 1;
		int32_t as1 = ((int32_t)r->a[i0]<<1>>1) + 1;
		int32_t nt_len, aa_len;
		ns_opt_t ns_opt = ns_opt0;
		ns_rst_t rst;
		ns_opt.flag |= NS_F_EXT_LEFT;
		ns_rst_init(&rst);
		ns_global_gs16b(km, (const char*)nt, vs1 - as, aa, as1, &ns_opt, ss, &rst);
		nt_len = rst.nt_len, aa_len = rst.aa_len;
		if (rst.aa_len != as1 && rst.nt_len < opt->max_ext && opt->io > opt->io_end) { // special casing 5'-end exon
			int64_t as_alt = vs1 - as > opt->max_ext? vs1 - opt->max_ext : as;
			ns_opt.io = opt->io_end;
			ns_global_gs16b(km, (const char*)&nt[as_alt - as], vs1 - as_alt, aa, as1, &ns_opt, ss? &ss[as_alt - as] : 0, &rst);
			if (rst.aa_len == as1)
				nt_len = rst.nt_len, aa_len = rst.aa_len;
		}
		r->vs = vs1 - nt_len;
		r->qs = as1 - aa_len;
		ne0 = r->vs - vs0;
		ae0 = r->qs;
	}

	if (mp_dbg_flag & MP_DBG_MORE_DP) { // apply DP to the entire region; for debugging only
		score = mp_align_seq(km, opt, &ns_opt0, r->ve - r->vs, &nt[r->vs - as], r->qe - ae0, &aa[ae0], ss? &ss[r->vs - as] : 0, &cigar);
	} else { // patch gaps between anchors
		for (i = i0; i < r->cnt; ++i) {
			int32_t ne1, ae1;
			if (!(r->a[i]>>31&1)) continue;
			ne1 = (r->a[i]>>32) + 1, ae1 = ((int32_t)r->a[i]<<1>>1) + 1;
			score += mp_align_seq(km, opt, &ns_opt0, ne1 - ne0, &nt[ne0 + vs0 - as], ae1 - ae0, &aa[ae0], ss? &ss[ne0 + vs0 - as] : 0, &cigar);
			i0 = i, ne0 = ne1, ae0 = ae1;
		}
		r->ve = ne0 + vs0, r->qe = ae0;
	}

	if (r->qe < len && r->ve < ae) { // right extension
		ns_opt_t ns_opt = ns_opt0;
		ns_rst_t rst;
		int32_t nt_len, aa_len;
		ns_opt.flag |= NS_F_EXT_RIGHT;
		ns_rst_init(&rst);
		ns_global_gs16b(km, (const char*)&nt[r->ve - as], ae - r->ve, &aa[r->qe], len - r->qe, &ns_opt, ss? &ss[r->ve - as] : 0, &rst);
		nt_len = rst.nt_len, aa_len = rst.aa_len;
		if (aa_len < len - r->qe && nt_len < opt->max_ext && opt->io > opt->io_end) { // special casing 3'-end exon
			int32_t l_ext = ae - r->ve < opt->max_ext? ae - r->ve : opt->max_ext;
			ns_opt.io = opt->io_end;
			ns_global_gs16b(km, (const char*)&nt[r->ve - as], l_ext, &aa[r->qe], len - r->qe, &ns_opt, ss? &ss[r->ve - as] : 0, &rst);
			if (rst.aa_len == len - r->qe)
				nt_len = rst.nt_len, aa_len = rst.aa_len;
		}
		score += mp_align_seq(km, opt, &ns_opt0, nt_len, &nt[r->ve - as], aa_len, &aa[r->qe], ss? &ss[r->ve - as] : 0, &cigar);
		r->ve += nt_len, r->qe += aa_len;
	}

	//for (i = 0; i < cigar.n; ++i) printf("%d%c", cigar.c[i]>>4, NS_CIGAR_STR[cigar.c[i]&0xf]); putchar('\n');
	mp_extra_gen(km, r, &cigar, score);
	r->p->dist_stop  = mp_extra_stop(r, nt, as, ae);
	r->p->dist_start = mp_extra_start(r, nt, as, ae);
	mp_extra_cal(r, opt, &nt[r->vs - as], l_nt - (r->vs - as), &aa[r->qs], len, mi->nt->spsc != 0);
	if (ss) kfree(km, ss);
	kfree(km, nt);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3b0, %rsp            # imm = 0x3B0
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq $0x0, -0x88(%rbp)
leaq -0xf8(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2190
movq -0x30(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jle 0x83ce
jmp 0x83ed
leaq 0x19217(%rip), %rdi     # 0x215ec
leaq 0x1921b(%rip), %rsi     # 0x215f7
movl $0xf7, %edx
leaq 0x19217(%rip), %rcx     # 0x215ff
callq 0x2180
leaq 0x1e67c(%rip), %rax     # 0x26a70
movl (%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x8496
movq -0x30(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x60(%rax), %r8d
movq -0x10(%rbp), %rax
movl 0x60(%rax), %r9d
addl $0x1, %r9d
movl $0x6, %edx
movl $0x3, %ecx
callq 0x9100
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x8474
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x1f, %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x8467
jmp 0x8474
jmp 0x8469
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x843b
movl -0x34(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x8490
movq -0x30(%rbp), %rax
movl $0x0, 0x4(%rax)
jmp 0x90f4
movl -0x34(%rbp), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x4c(%rbp)
movl %eax, -0x48(%rbp)
movq -0x30(%rbp), %rax
cmpl $0xa, 0x34(%rax)
jl 0x84bf
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x48(%rbp)
movl -0x1c(%rbp), %eax
movq -0x30(%rbp), %rcx
subl 0x38(%rcx), %eax
cmpl $0xa, %eax
jl 0x84e0
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x4c(%rbp)
cmpl $0x0, 0x10(%rbp)
jle 0x850b
movl -0x48(%rbp), %eax
cmpl 0x10(%rbp), %eax
jge 0x84f9
movl -0x48(%rbp), %eax
movl %eax, -0x238(%rbp)
jmp 0x8502
movl 0x10(%rbp), %eax
movl %eax, -0x238(%rbp)
movl -0x238(%rbp), %eax
movl %eax, -0x48(%rbp)
cmpl $0x0, 0x18(%rbp)
jle 0x8536
movl -0x4c(%rbp), %eax
cmpl 0x18(%rbp), %eax
jge 0x8524
movl -0x4c(%rbp), %eax
movl %eax, -0x23c(%rbp)
jmp 0x852d
movl 0x18(%rbp), %eax
movl %eax, -0x23c(%rbp)
movl -0x23c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movq -0x30(%rbp), %rcx
movl 0x30(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x48(%rbp), %rcx
cmpq %rcx, %rax
jle 0x8585
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x48(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x248(%rbp)
jmp 0x8590
xorl %eax, %eax
movq %rax, -0x248(%rbp)
jmp 0x8590
movq -0x248(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x4c(%rbp), %rcx
addq %rcx, %rax
cmpq -0x68(%rbp), %rax
jge 0x85c8
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x4c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x250(%rbp)
jmp 0x85d3
movq -0x68(%rbp), %rax
movq %rax, -0x250(%rbp)
movq -0x250(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
subq -0x58(%rbp), %rsi
shlq $0x0, %rsi
callq 0xaeb0
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x30(%rax), %esi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x80(%rbp), %r8
callq 0x16750
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq -0x60(%rbp), %rcx
subq -0x58(%rbp), %rcx
cmpq %rcx, %rax
jne 0x862e
jmp 0x864d
leaq 0x1903d(%rip), %rdi     # 0x21672
leaq 0x18fbb(%rip), %rsi     # 0x215f7
movl $0x10d, %edx            # imm = 0x10D
leaq 0x18fb7(%rip), %rcx     # 0x215ff
callq 0x2180
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x40(%rax)
je 0x86d3
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
subq -0x58(%rbp), %rsi
shlq $0x0, %rsi
callq 0xaeb0
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x30(%rax), %esi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x88(%rbp), %r8
callq 0x16be0
movl %eax, -0xfc(%rbp)
movq -0x78(%rbp), %rax
movl %eax, -0xfc(%rbp)
cmpl $0x0, %eax
je 0x86b2
jmp 0x86d1
leaq 0x18fc9(%rip), %rdi     # 0x21682
leaq 0x18f37(%rip), %rsi     # 0x215f7
movl $0x112, %edx            # imm = 0x112
leaq 0x18f33(%rip), %rcx     # 0x215ff
callq 0x2180
jmp 0x86d3
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x92c0
movq -0x70(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x50(%rcx), %rcx
movslq -0x38(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
addq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x108(%rbp)
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shll %eax
sarl %eax
addl $0x1, %eax
movl %eax, -0x10c(%rbp)
leaq -0x178(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
movl $0x60, %edx
callq 0x2200
movl -0x178(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x178(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x93e0
movq -0x8(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x108(%rbp), %rax
subq -0x58(%rbp), %rax
movl %eax, %edx
movq -0x28(%rbp), %rcx
movl -0x10c(%rbp), %r8d
movq -0x88(%rbp), %r10
leaq -0x178(%rbp), %r9
leaq -0x198(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xbb40
movl -0x190(%rbp), %eax
movl %eax, -0x110(%rbp)
movl -0x18c(%rbp), %eax
movl %eax, -0x114(%rbp)
movl -0x18c(%rbp), %eax
cmpl -0x10c(%rbp), %eax
je 0x8941
movl -0x190(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0x8941
movq -0x10(%rbp), %rax
movl 0x6c(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x74(%rcx), %eax
jle 0x8941
movq -0x108(%rbp), %rax
subq -0x58(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x28(%rcx), %rcx
cmpq %rcx, %rax
jle 0x882c
movq -0x108(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x28(%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x258(%rbp)
jmp 0x8837
movq -0x58(%rbp), %rax
movq %rax, -0x258(%rbp)
movq -0x258(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x10(%rbp), %rax
movl 0x74(%rax), %eax
movl %eax, -0x16c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x280(%rbp)
movq -0x80(%rbp), %rax
movq -0x1a0(%rbp), %rcx
subq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x278(%rbp)
movq -0x108(%rbp), %rax
subq -0x1a0(%rbp), %rax
movl %eax, -0x26c(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x268(%rbp)
movl -0x10c(%rbp), %eax
movl %eax, -0x25c(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x88c9
movq -0x88(%rbp), %rax
movq -0x1a0(%rbp), %rcx
subq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x288(%rbp)
jmp 0x88d4
xorl %eax, %eax
movq %rax, -0x288(%rbp)
jmp 0x88d4
movl -0x25c(%rbp), %r8d
movq -0x268(%rbp), %rcx
movl -0x26c(%rbp), %edx
movq -0x278(%rbp), %rsi
movq -0x280(%rbp), %rdi
movq -0x288(%rbp), %r10
leaq -0x178(%rbp), %r9
leaq -0x198(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xbb40
movl -0x18c(%rbp), %eax
cmpl -0x10c(%rbp), %eax
jne 0x893f
movl -0x190(%rbp), %eax
movl %eax, -0x110(%rbp)
movl -0x18c(%rbp), %eax
movl %eax, -0x114(%rbp)
jmp 0x8941
movq -0x108(%rbp), %rcx
movslq -0x110(%rbp), %rax
subq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x40(%rax)
movl -0x10c(%rbp), %ecx
subl -0x114(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
subq -0x70(%rbp), %rax
movl %eax, -0x3c(%rbp)
movq -0x30(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x40(%rbp)
leaq 0x1e0e3(%rip), %rax     # 0x26a70
movl (%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x8a90
movq -0x8(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x2b0(%rbp)
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x30(%rbp), %rcx
subq 0x40(%rcx), %rax
movl %eax, -0x2a4(%rbp)
movq -0x80(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x40(%rcx), %rcx
subq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x2a0(%rbp)
movq -0x30(%rbp), %rax
movl 0x38(%rax), %eax
subl -0x40(%rbp), %eax
movl %eax, -0x294(%rbp)
movq -0x28(%rbp), %rax
movslq -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x290(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x8a2c
movq -0x88(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x40(%rcx), %rcx
subq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x2c0(%rbp)
jmp 0x8a37
xorl %eax, %eax
movq %rax, -0x2c0(%rbp)
jmp 0x8a37
movq -0x290(%rbp), %r11
movl -0x294(%rbp), %r9d
movq -0x2a0(%rbp), %r8
movl -0x2a4(%rbp), %ecx
movq -0x2b0(%rbp), %rsi
movq -0x2b8(%rbp), %rdi
movq -0x2c0(%rbp), %r10
leaq -0xe8(%rbp), %rdx
leaq -0xf8(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x9410
movl %eax, -0x44(%rbp)
jmp 0x8c2f
movl -0x38(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x8c15
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x1f, %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0x8ac9
jmp 0x8c07
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
addq $0x1, %rax
movl %eax, -0x1a4(%rbp)
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shll %eax
sarl %eax
addl $0x1, %eax
movl %eax, -0x1a8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x2e8(%rbp)
movl -0x1a4(%rbp), %eax
subl -0x3c(%rbp), %eax
movl %eax, -0x2dc(%rbp)
movq -0x80(%rbp), %rax
movslq -0x3c(%rbp), %rcx
addq -0x70(%rbp), %rcx
subq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x2d8(%rbp)
movl -0x1a8(%rbp), %eax
subl -0x40(%rbp), %eax
movl %eax, -0x2cc(%rbp)
movq -0x28(%rbp), %rax
movslq -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x2c8(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x8b8d
movq -0x88(%rbp), %rax
movslq -0x3c(%rbp), %rcx
addq -0x70(%rbp), %rcx
subq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x2f8(%rbp)
jmp 0x8b98
xorl %eax, %eax
movq %rax, -0x2f8(%rbp)
jmp 0x8b98
movq -0x2c8(%rbp), %r11
movl -0x2cc(%rbp), %r9d
movq -0x2d8(%rbp), %r8
movl -0x2dc(%rbp), %ecx
movq -0x2e8(%rbp), %rsi
movq -0x2f0(%rbp), %rdi
movq -0x2f8(%rbp), %r10
leaq -0xe8(%rbp), %rdx
leaq -0xf8(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x9410
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x1a4(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x1a8(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x8a96
movslq -0x3c(%rbp), %rcx
addq -0x70(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x48(%rax)
movl -0x40(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x30(%rbp), %rax
movl 0x38(%rax), %eax
cmpl -0x1c(%rbp), %eax
jge 0x9012
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
cmpq -0x60(%rbp), %rax
jge 0x9012
leaq -0x208(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
movl $0x60, %edx
callq 0x2200
movl -0x208(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x208(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x93e0
movq -0x8(%rbp), %rax
movq %rax, -0x320(%rbp)
movq -0x80(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x48(%rcx), %rcx
subq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x318(%rbp)
movq -0x60(%rbp), %rax
movq -0x30(%rbp), %rcx
subq 0x48(%rcx), %rax
movl %eax, -0x30c(%rbp)
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq 0x38(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x308(%rbp)
movl -0x1c(%rbp), %eax
movq -0x30(%rbp), %rcx
subl 0x38(%rcx), %eax
movl %eax, -0x2fc(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x8d0a
movq -0x88(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x48(%rcx), %rcx
subq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x328(%rbp)
jmp 0x8d15
xorl %eax, %eax
movq %rax, -0x328(%rbp)
jmp 0x8d15
movl -0x2fc(%rbp), %r8d
movq -0x308(%rbp), %rcx
movl -0x30c(%rbp), %edx
movq -0x318(%rbp), %rsi
movq -0x320(%rbp), %rdi
movq -0x328(%rbp), %r10
leaq -0x208(%rbp), %r9
leaq -0x228(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xbb40
movl -0x220(%rbp), %eax
movl %eax, -0x22c(%rbp)
movl -0x21c(%rbp), %eax
movl %eax, -0x230(%rbp)
movl -0x230(%rbp), %eax
movl -0x1c(%rbp), %ecx
movq -0x30(%rbp), %rdx
subl 0x38(%rdx), %ecx
cmpl %ecx, %eax
jge 0x8f06
movl -0x22c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0x8f06
movq -0x10(%rbp), %rax
movl 0x6c(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x74(%rcx), %eax
jle 0x8f06
movq -0x60(%rbp), %rax
movq -0x30(%rbp), %rcx
subq 0x48(%rcx), %rax
movq -0x10(%rbp), %rcx
movslq 0x28(%rcx), %rcx
cmpq %rcx, %rax
jge 0x8ddf
movq -0x60(%rbp), %rax
movq -0x30(%rbp), %rcx
subq 0x48(%rcx), %rax
movq %rax, -0x330(%rbp)
jmp 0x8dee
movq -0x10(%rbp), %rax
movslq 0x28(%rax), %rax
movq %rax, -0x330(%rbp)
movq -0x330(%rbp), %rax
movl %eax, -0x234(%rbp)
movq -0x10(%rbp), %rax
movl 0x74(%rax), %eax
movl %eax, -0x1fc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x358(%rbp)
movq -0x80(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x48(%rcx), %rcx
subq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x350(%rbp)
movl -0x234(%rbp), %eax
movl %eax, -0x344(%rbp)
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq 0x38(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x340(%rbp)
movl -0x1c(%rbp), %eax
movq -0x30(%rbp), %rcx
subl 0x38(%rcx), %eax
movl %eax, -0x334(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x8e88
movq -0x88(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x48(%rcx), %rcx
subq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x360(%rbp)
jmp 0x8e93
xorl %eax, %eax
movq %rax, -0x360(%rbp)
jmp 0x8e93
movl -0x334(%rbp), %r8d
movq -0x340(%rbp), %rcx
movl -0x344(%rbp), %edx
movq -0x350(%rbp), %rsi
movq -0x358(%rbp), %rdi
movq -0x360(%rbp), %r10
leaq -0x208(%rbp), %r9
leaq -0x228(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xbb40
movl -0x21c(%rbp), %eax
movl -0x1c(%rbp), %ecx
movq -0x30(%rbp), %rdx
subl 0x38(%rdx), %ecx
cmpl %ecx, %eax
jne 0x8f04
movl -0x220(%rbp), %eax
movl %eax, -0x22c(%rbp)
movl -0x21c(%rbp), %eax
movl %eax, -0x230(%rbp)
jmp 0x8f06
movq -0x8(%rbp), %rax
movq %rax, -0x390(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x388(%rbp)
movl -0x22c(%rbp), %eax
movl %eax, -0x37c(%rbp)
movq -0x80(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x48(%rcx), %rcx
subq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x378(%rbp)
movl -0x230(%rbp), %eax
movl %eax, -0x36c(%rbp)
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq 0x38(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x368(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x8f8d
movq -0x88(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x48(%rcx), %rcx
subq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x398(%rbp)
jmp 0x8f98
xorl %eax, %eax
movq %rax, -0x398(%rbp)
jmp 0x8f98
movq -0x368(%rbp), %r11
movl -0x36c(%rbp), %r9d
movq -0x378(%rbp), %r8
movl -0x37c(%rbp), %ecx
movq -0x388(%rbp), %rsi
movq -0x390(%rbp), %rdi
movq -0x398(%rbp), %r10
leaq -0xe8(%rbp), %rdx
leaq -0xf8(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x9410
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movslq -0x22c(%rbp), %rcx
movq -0x30(%rbp), %rax
addq 0x48(%rax), %rcx
movq %rcx, 0x48(%rax)
movl -0x230(%rbp), %ecx
movq -0x30(%rbp), %rax
addl 0x38(%rax), %ecx
movl %ecx, 0x38(%rax)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl -0x44(%rbp), %ecx
leaq -0xf8(%rbp), %rdx
callq 0x95b0
movq -0x30(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
callq 0x9660
movl %eax, %ecx
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movl %ecx, 0x20(%rax)
movq -0x30(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
callq 0x9780
movl %eax, %ecx
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movl %ecx, 0x24(%rax)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
subq -0x58(%rbp), %rax
addq %rax, %rdx
movq -0x78(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x40(%rcx), %rcx
subq -0x58(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %rax
movslq 0x34(%rax), %rax
addq %rax, %r8
movl -0x1c(%rbp), %r9d
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x40(%rax)
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, (%rsp)
callq 0x98c0
cmpq $0x0, -0x88(%rbp)
je 0x90e7
movq -0x8(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0xac90
movq -0x8(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0xac90
addq $0x3b0, %rsp            # imm = 0x3B0
popq %rbp
retq
nopl (%rax)