// File: /workspace/github_c_makefile_star2_O1/lh3[P]miniprot/map.c
// Function: mp_map
mp_reg1_t *mp_map(const mp_idx_t *mi, int qlen, const char *seq, int *n_reg, mp_tbuf_t *b, const mp_mapopt_t *opt, const char *qname)
{
	void *km = b->km;
	const mp_idxopt_t *io = &mi->opt;
	mp64_v sd = {0,0,0};
	mp_reg1_t *reg;
	int32_t i, n_u, max_occ, is_splice = !(opt->flag&MP_F_NO_SPLICE);
	int64_t k, n_a = 0, n_kmer;
	uint64_t *a, *u;

	*n_reg = 0;
	n_kmer = mp_n_bucket(&mi->opt);
	mp_sketch_prot(km, seq, qlen, io->kmer, io->mod_bit, &sd);
	radix_sort_mp64(sd.a, sd.a + sd.n);

	if (sd.n >= 8) {
		max_occ = mp_cal_max_occ(km, mi, sd.n, sd.a);
		if (max_occ > opt->max_occ) max_occ = opt->max_occ;
	} else max_occ = opt->max_occ;

	for (i = 0; i < sd.n; ++i) {
		int64_t en = (sd.a[i]>>32) + 1 < n_kmer? mi->ki[(sd.a[i]>>32) + 1] : mi->n_kb;
		int64_t n = en - mi->ki[sd.a[i]>>32];
		if (n <= max_occ) n_a += n;
	}
	a = Kmalloc(km, uint64_t, n_a);
	for (i = 0, k = 0; i < sd.n; ++i) {
		int64_t j, st = mi->ki[sd.a[i]>>32];
		int64_t en = (sd.a[i]>>32) + 1 < n_kmer? mi->ki[(sd.a[i]>>32) + 1] : mi->n_kb;
		if (en - st <= max_occ)
			for (j = st; j < en; ++j)
				a[k++] = (uint64_t)mi->kb[j] << 32 | (uint32_t)sd.a[i];
	}
	kfree(km, sd.a);
	radix_sort_mp64(a, a + n_a);

	if (mp_dbg_flag & MP_DBG_ANCHOR) {
		for (k = 0; k < n_a; ++k) {
			i = mp_idx_block2pos(mi, a[k]>>32);
			fprintf(stderr, "X\t%ld\t%s\t%c\t%ld\t%d\n", (long)(a[k]>>32), mi->nt->ctg[i>>1].name, "+-"[i&1], (long)((a[k]>>32) - mi->bo[i]) << mi->opt.bbit, (uint32_t)a[k]);
		}
	}

	if (!(opt->flag & MP_F_NO_PRE_CHAIN) && is_splice) {
		int32_t w = 1<<mi->opt.bbit;
		a = mp_chain(w, w, w, opt->max_chn_max_skip, opt->max_chn_iter, 2, 0, opt->chn_coef_log, is_splice, mi->opt.kmer, mi->opt.bbit, n_a, a, &n_u, &u, km);
		for (i = 0, n_a = 0; i < n_u; ++i) n_a += (uint32_t)u[i];
		kfree(km, u);
		radix_sort_mp64(a, a + n_a);
	}

	a = mp_chain(opt->max_intron, opt->max_gap, opt->bw, opt->max_chn_max_skip, opt->max_chn_iter, opt->min_chn_cnt, opt->min_chn_sc, opt->chn_coef_log,
				 is_splice, mi->opt.kmer, mi->opt.bbit, n_a, a, &n_u, &u, km);
	reg = mp_reg_gen_from_block(0, mi, n_u, u, a, n_reg);
	kfree(km, u);
	mp_sort_reg(km, n_reg, reg);
	mp_set_parent(km, opt->mask_level, opt->mask_len, *n_reg, reg, mi->opt.kmer, 0);
	mp_select_sub(km, opt->pri_ratio * opt->pri_ratio, mi->opt.kmer * 2, opt->best_n, n_reg, reg);

	if (mp_dbg_flag & MP_DBG_CHAIN)
		mp_dbg_chain(mi, *n_reg, reg, a, mi->opt.bbit, "Y1");

	if (!(mp_dbg_flag & MP_DBG_NO_REFINE)) {
		int32_t nr = 0;
		uint64_t *ext;
		ext = mp_cal_max_ext(km, 0, *n_reg, reg, a, 100, opt->max_ext);
		for (i = 0; i < *n_reg; ++i) {
			mp_refine_reg(km, mi, opt, seq, qlen, &reg[i], ext[i]>>32, (int32_t)ext[i]);
			if (reg[i].cnt > 0)
				reg[nr++] = reg[i];
		}
		*n_reg = nr;
		kfree(km, ext);
		kfree(km, a);
		a = mp_collate_a(km, *n_reg, reg);
		mp_sort_reg(km, n_reg, reg);
		//mp_dbg_chain(mi, *n_reg, reg, a, 0, "Y2");
		mp_set_parent(km, opt->mask_level, opt->mask_len, *n_reg, reg, mi->opt.kmer, 0);
		mp_select_sub(km, opt->pri_ratio * opt->pri_ratio, mi->opt.kmer * 2, opt->best_n, n_reg, reg);
	}
	if (!(opt->flag & MP_F_NO_ALIGN)) {
		int32_t k;
		uint64_t *ext = 0;
		ext = mp_cal_max_ext(km, mi->nt, *n_reg, reg, a, 100, opt->max_intron/2); // opt->max_intron/2 for consistency with mp_align()
		for (i = k = 0; i < *n_reg; ++i) {
			mp_align(km, opt, mi, qlen, seq, &reg[i], ext[i]>>32, (int32_t)ext[i]);
			if (reg[i].p) reg[k++] = reg[i];
		}
		*n_reg = k;
		if (ext) kfree(km, ext);
		mp_sort_reg(km, n_reg, reg);
		mp_select_multi_exon(*n_reg, reg, opt->io);
		mp_set_parent(km, opt->mask_level, opt->mask_len, *n_reg, reg, mi->opt.kmer, 0);
		mp_select_sub(km, opt->pri_ratio, mi->opt.kmer * 2, opt->best_n, n_reg, reg);
	}
	kfree(km, a);
	return reg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %r9, %r13
movl %esi, %r9d
movq %rdi, %r12
movq (%r8), %rbp
xorpd %xmm0, %xmm0
leaq 0x80(%rsp), %r14
movapd %xmm0, (%r14)
movl (%r13), %eax
movl %eax, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
movl $0x0, (%rcx)
movl 0x8(%rdi), %eax
movl 0xc(%rdi), %r8d
leal (,%rax,4), %ecx
subl %r8d, %ecx
movl $0x1, %ebx
shll %cl, %ebx
movq %rbp, %rdi
movq %rdx, 0xa8(%rsp)
movq %rdx, %rsi
movl %r9d, 0x48(%rsp)
movl %r9d, %edx
movl %eax, %ecx
movq %r14, %r9
callq 0xd1b0
movq 0x8(%r14), %rdi
movslq (%r14), %rax
leaq (%rdi,%rax,8), %rsi
callq 0x46b4
movslq (%r14), %r15
cmpq $0x8, %r15
movq %r13, 0x8(%rsp)
movq %r12, 0x18(%rsp)
jl 0x56de
movq 0x88(%rsp), %r13
leaq (,%r15,8), %rsi
movq %rbp, %rdi
callq 0x80a1
movq %rax, %r14
movl 0x8(%r12), %ecx
shll $0x2, %ecx
subl 0xc(%r12), %ecx
movl $0x1, %eax
shll %cl, %eax
cltq
leaq 0x20(%r12), %rcx
movq 0x28(%r12), %rdx
xorl %esi, %esi
movq (%r13,%rsi,8), %rdi
shrq $0x20, %rdi
leaq 0x1(%rdi), %r8
cmpq %rax, %r8
leaq 0x8(%rdx,%rdi,8), %rdi
movq %rcx, %r8
cmovbq %rdi, %r8
movq (%r8), %r8
subq -0x8(%rdi), %r8
movq %r8, (%r14,%rsi,8)
incq %rsi
cmpq %rsi, %r15
jne 0x55ee
leaq (%r14,%r15,8), %rsi
movq %r14, %rdi
callq 0x46b4
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movsd 0xe07f(%rip), %xmm1     # 0x136b8
mulsd %xmm0, %xmm1
movsd 0xc9db(%rip), %xmm2     # 0x12020
addsd %xmm2, %xmm1
cvttsd2si %xmm1, %rax
mulsd 0xe06a(%rip), %xmm0     # 0x136c0
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %rcx
movq (%r14,%rcx,8), %r15
movq %r15, %r12
subq (%r14,%rax,8), %r12
movq %rbp, %rdi
movq %r14, %rsi
callq 0x7fd6
movq %r15, %xmm0
movq 0xe05e(%rip), %xmm1     # 0x136e0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xe062(%rip), %xmm2     # 0x136f0
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq %r12, %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0xe009(%rip), %xmm1     # 0x136c8
addsd %xmm3, %xmm1
addsd 0xe005(%rip), %xmm1     # 0x136d0
cvttsd2si %xmm1, %ecx
movq 0x8(%rsp), %rax
movl 0x10(%rax), %eax
cmpl %ecx, %eax
cmovll %eax, %ecx
jmp 0x56e2
movl 0x10(%r13), %ecx
movslq 0x80(%rsp), %rax
movslq %ecx, %r12
testq %rax, %rax
movq 0x18(%rsp), %r15
jle 0x574c
movq 0x88(%rsp), %rcx
leaq 0x20(%r15), %rdx
movq 0x28(%r15), %rsi
xorl %edi, %edi
xorl %r14d, %r14d
movq (%rcx,%rdi,8), %r8
shrq $0x20, %r8
leaq 0x1(%r8), %r9
movq %rdx, %r10
cmpq %rbx, %r9
jae 0x572b
shlq $0x3, %r9
addq 0x28(%r15), %r9
movq %r9, %r10
movq (%r10), %r9
subq (%rsi,%r8,8), %r9
cmpq %r12, %r9
movl $0x0, %r8d
cmovleq %r9, %r8
addq %r8, %r14
incq %rdi
cmpq %rdi, %rax
jne 0x570c
jmp 0x574f
xorl %r14d, %r14d
leaq (,%r14,8), %rsi
movq %rbp, %rdi
callq 0x80a1
movq %rax, %r13
movslq 0x80(%rsp), %rax
testq %rax, %rax
movq %rbp, (%rsp)
jle 0x5837
movq 0x28(%r15), %rcx
movq 0x88(%rsp), %rdx
leaq 0x20(%r15), %rsi
xorl %edi, %edi
movq $0x0, 0x10(%rsp)
movq (%rdx,%rdi,8), %r10
shrq $0x20, %r10
leaq (%rcx,%r10,8), %r11
addq $0x8, %r11
movq -0x8(%r11), %r9
incq %r10
cmpq %rbx, %r10
cmovaeq %rsi, %r11
movq (%r11), %r11
movq %r11, %r10
subq %r9, %r10
cmpq %r12, %r10
jg 0x582b
cmpq %r9, %r11
jle 0x582b
movq %r12, %r8
movq %rsi, %r12
movq %rax, %rsi
movq %rcx, %rax
movq %rbx, %rcx
movq %r13, %rbx
movq 0x10(%rsp), %r11
leaq (,%r11,8), %r11
addq %r13, %r11
shlq $0x2, %r9
addq 0x38(%r15), %r9
xorl %r15d, %r15d
movl (%r9,%r15,4), %ebp
shlq $0x20, %rbp
movl (%rdx,%rdi,8), %r13d
orq %rbp, %r13
movq %r13, (%r11,%r15,8)
incq %r15
cmpq %r15, %r10
jne 0x57f0
addq %r15, 0x10(%rsp)
movq (%rsp), %rbp
movq 0x18(%rsp), %r15
movq %rbx, %r13
movq %rcx, %rbx
movq %rax, %rcx
movq %rsi, %rax
movq %r12, %rsi
movq %r8, %r12
incq %rdi
cmpq %rax, %rdi
jne 0x5792
movl 0x20(%rsp), %ebx
andl $0x1, %ebx
movq 0x88(%rsp), %rsi
movq %rbp, %rdi
callq 0x7fd6
leaq (,%r14,8), %rsi
addq %r13, %rsi
movq %r13, %rdi
callq 0x46b4
leaq 0x12f18(%rip), %rax     # 0x18780
testb $0x10, (%rax)
je 0x5876
testq %r14, %r14
jg 0x633b
movl %ebx, %r12d
xorl $0x1, %r12d
movq 0x8(%rsp), %rdx
movl (%rdx), %eax
andl $0x40, %eax
orl %ebx, %eax
movq %r12, 0x10(%rsp)
jne 0x5901
movl (%r15), %eax
movl $0x1, %edi
movl %eax, %ecx
shll %cl, %edi
movl 0x8(%r15), %r10d
movl 0x34(%rdx), %ecx
movl 0x38(%rdx), %r8d
movss 0x40(%rdx), %xmm0
subq $0x8, %rsp
leaq 0x70(%rsp), %r11
leaq 0x54(%rsp), %rbx
movl %edi, %esi
movl %edi, %edx
movl $0x2, %r9d
pushq %rbp
pushq %r11
pushq %rbx
pushq %r13
pushq %r14
pushq %rax
pushq %r10
pushq %r12
pushq $0x0
callq 0xdadc
addq $0x50, %rsp
movq %rax, %r15
movslq (%rbx), %rax
testq %rax, %rax
jle 0x5906
movq 0x68(%rsp), %rcx
xorl %edx, %edx
xorl %r14d, %r14d
movl (%rcx,%rdx,8), %esi
addq %rsi, %r14
incq %rdx
cmpq %rdx, %rax
jne 0x58f1
jmp 0x5909
movq %r13, %rbx
jmp 0x5925
xorl %r14d, %r14d
movq 0x68(%rsp), %rsi
movq %rbp, %rdi
callq 0x7fd6
leaq (%r15,%r14,8), %rsi
movq %r15, %rdi
callq 0x46b4
movq %r15, %rbx
movq 0x8(%rsp), %r13
movl 0x14(%r13), %esi
movl 0x18(%r13), %edi
movl 0x24(%r13), %edx
movl 0x34(%r13), %ecx
movl 0x38(%r13), %r8d
movl 0x30(%r13), %r9d
movl 0x3c(%r13), %eax
movq %rax, 0x20(%rsp)
movss 0x40(%r13), %xmm0
movq 0x18(%rsp), %r12
movl (%r12), %r10d
movl 0x8(%r12), %r11d
subq $0x8, %rsp
leaq 0x70(%rsp), %r15
leaq 0x54(%rsp), %rax
pushq %rbp
pushq %r15
pushq %rax
pushq %rbx
pushq %r14
pushq %r10
pushq %r11
pushq 0x50(%rsp)
pushq 0x68(%rsp)
callq 0xdadc
addq $0x50, %rsp
leaq 0x4c(%rsp), %rcx
movl (%rcx), %edx
movq (%r15), %rcx
movq %r15, %rbx
xorl %edi, %edi
movq %r12, %rsi
movq %rax, 0x20(%rsp)
movq %rax, %r8
movq 0x28(%rsp), %r14
movq %r14, %r9
callq 0xe638
movq %rax, %r15
movq (%rbx), %rsi
movq %rbp, %rdi
callq 0x7fd6
movq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xe9ed
movss 0x44(%r13), %xmm0
movl 0x48(%r13), %esi
movl (%r14), %edx
movl 0x8(%r12), %r8d
movq %rbp, %rdi
movq %r15, %rcx
xorl %r9d, %r9d
callq 0xebaf
movss 0x4c(%r13), %xmm0
mulss %xmm0, %xmm0
movl 0x8(%r12), %esi
addl %esi, %esi
movl 0x58(%r13), %edx
movq %r15, %r13
movq %rbp, %rdi
movq %r14, %rcx
movq %r15, %r8
callq 0xf068
leaq 0x12d67(%rip), %rax     # 0x18780
testb $0x20, (%rax)
movq %r15, 0x10(%rsp)
je 0x5b15
movq 0x28(%rsp), %rax
movslq (%rax), %rbp
testq %rbp, %rbp
jle 0x5b15
movq 0x18(%rsp), %rax
movl (%rax), %r14d
xorl %r12d, %r12d
imulq $0x68, %r12, %rbx
cmpl $0x0, 0x4(%r13,%rbx)
jle 0x5b04
addq 0x10(%rsp), %rbx
xorl %r13d, %r13d
movslq (%rbx), %rax
addq %r13, %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%rax,8), %r10
movq %r10, %r11
shrq $0x20, %r11
testl %r14d, %r14d
jle 0x5a90
movq 0x18(%rsp), %rdx
movq 0x30(%rdx), %rax
movl 0x30(%rbx), %ecx
movl (%rax,%rcx,4), %eax
subq %rax, %r11
movl %r14d, %ecx
shlq %cl, %r11
jmp 0x5a99
addq 0x40(%rbx), %r11
movq 0x18(%rsp), %rdx
movq 0x12550(%rip), %rax     # 0x17ff0
movq (%rax), %rdi
movq %r10, %r8
shrq $0x20, %r8
movq 0x18(%rdx), %rax
movq 0x28(%rax), %rax
movl 0x30(%rbx), %ecx
movl %ecx, %edx
shrl %edx
leaq (%rdx,%rdx,2), %rdx
movq 0x10(%rax,%rdx,8), %r9
andl $0x1, %ecx
leaq 0xdc48(%rip), %rax      # 0x13714
movsbl (%rcx,%rax), %r15d
subq $0x8, %rsp
leaq 0xdc4e(%rip), %rsi      # 0x1372a
leaq 0xdc34(%rip), %rdx      # 0x13717
movl %r12d, %ecx
xorl %eax, %eax
pushq %r10
pushq %r11
pushq %r15
callq 0x21d0
addq $0x20, %rsp
incq %r13
cmpl 0x4(%rbx), %r13d
jl 0x5a5b
incq %r12
cmpq %rbp, %r12
movq 0x10(%rsp), %r13
jne 0x5a43
leaq 0x12c64(%rip), %rax     # 0x18780
testb $0x4, (%rax)
jne 0x61ce
movq 0x28(%rsp), %rbx
movl (%rbx), %edx
movq 0x8(%rsp), %r12
movl 0x28(%r12), %eax
subq $0x8, %rsp
movq $0x0, 0x58(%rsp)
movq 0x8(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
movq %r13, %rcx
movq 0x28(%rsp), %r8
movl $0x64, %r9d
pushq %rax
callq 0xf373
addq $0x10, %rsp
movq %rax, 0xa0(%rsp)
cmpl $0x0, (%rbx)
jle 0x6135
xorl %ecx, %ecx
movq $0x0, 0x50(%rsp)
imulq $0x68, %rcx, %r14
movq 0xa0(%rsp), %rax
movq %rcx, 0xc0(%rsp)
movq (%rax,%rcx,8), %rax
movl (%r12), %ecx
movq %rcx, 0x58(%rsp)
movl 0x60(%r12), %ecx
movq %rcx, 0xb8(%rsp)
movq 0x18(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movq 0x10(%rsp), %rbx
movl 0x30(%rbx,%r14), %edx
shrl %edx
leaq (%rdx,%rdx,2), %rdx
movq 0x8(%rcx,%rdx,8), %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x90(%rsp)
movq 0x40(%rbx,%r14), %r13
movq %rax, %rcx
sarq $0x20, %rcx
subq %rcx, %r13
movl $0x0, %ecx
cmovleq %rcx, %r13
movslq %eax, %r15
addq 0x48(%rbx,%r14), %r15
cmpq %r12, %r15
cmovgeq %r12, %r15
movq %r15, %rsi
subq %r13, %rsi
movq %rbp, %rdi
callq 0x80a1
movq %rax, %rbp
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rdi
movq %r14, 0x60(%rsp)
movl 0x30(%rbx,%r14), %r8d
movl $0x2, %ebx
movl %r8d, %esi
shrl %esi
movq %r12, %rdx
subq %r15, %rdx
subq %r13, %r12
andl $0x1, %r8d
movq %r13, 0xb0(%rsp)
cmoveq %r13, %rdx
cmoveq %r15, %r12
movq %r12, %rcx
movq %rbp, %r9
callq 0xc337
movq 0x18(%rsp), %rcx
movl 0x4(%rcx), %ecx
subq $0x8, %rsp
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %rax, %rdx
movq 0xc0(%rsp), %r15
movl %r15d, %r8d
xorl %r9d, %r9d
leaq 0x38(%rsp), %rax
pushq %rax
pushq $0x0
pushq $0x0
callq 0xd4fc
addq $0x20, %rsp
movq (%rsp), %rdi
movq %rbp, %rsi
movq (%rsp), %r14
callq 0x7fd6
movq %r14, %rdi
movq 0xa8(%rsp), %rsi
movl 0x48(%rsp), %edx
movq %r15, %rbp
movl %r15d, %ecx
xorl %r8d, %r8d
leaq 0x90(%rsp), %r9
callq 0xd1b0
cmpl $0x0, 0x90(%rsp)
movl $0x80000000, %r12d      # imm = 0x80000000
jle 0x5d41
xorl %r15d, %r15d
movl 0x34(%rsp), %eax
cmpl %eax, 0x30(%rsp)
jne 0x5d0d
leal (%rax,%rax), %ecx
testl %eax, %eax
cmovel %ebx, %ecx
movl %ecx, 0x34(%rsp)
movq 0x38(%rsp), %rsi
movslq %ecx, %rdx
shlq $0x3, %rdx
movq %r14, %rdi
callq 0x81a4
movq %rax, 0x38(%rsp)
movq 0x98(%rsp), %rax
movq (%rax,%r15,8), %rax
orq %r12, %rax
movq 0x38(%rsp), %rcx
movslq 0x30(%rsp), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x30(%rsp)
movq %rax, (%rcx,%rdx,8)
incq %r15
movslq 0x90(%rsp), %rax
cmpq %rax, %r15
jl 0x5cde
movq 0x98(%rsp), %rsi
movq %r14, %rdi
callq 0x7fd6
movq 0x38(%rsp), %rdi
movslq 0x30(%rsp), %rax
leaq (%rdi,%rax,8), %rsi
callq 0x46b4
movslq 0x30(%rsp), %rax
testq %rax, %rax
movq 0x8(%rsp), %r15
movq 0x60(%rsp), %r13
jle 0x5dff
movq 0x38(%rsp), %rcx
leal 0x1(%rax), %edx
xorl %r8d, %r8d
movl $0x1, %edi
xorl %esi, %esi
movq %rbp, %rbx
movslq %r8d, %r9
cmpq %rax, %rdi
je 0x5da7
movq (%rcx,%rdi,8), %r10
xorq (%rcx,%r9,8), %r10
shrq $0x20, %r10
je 0x5df1
movl %r8d, %r10d
cmpq %r9, %rdi
jle 0x5dc5
testb $-0x80, 0x3(%rcx,%r9,8)
jne 0x5dc2
incq %r9
cmpq %r9, %rdi
jne 0x5daf
movq %rdi, %r9
movl %r9d, %r10d
movl %edi, %r9d
subl %r10d, %r9d
subl %r8d, %r10d
setle %r8b
testl %r9d, %r9d
setle %r11b
orb %r8b, %r11b
jne 0x5dee
imull %r9d, %r10d
cmpl 0x2c(%r15), %r10d
jg 0x5dee
movl %r10d, %r8d
addq %r8, %rsi
movl %edi, %r8d
incq %rdi
cmpq %rdx, %rdi
jne 0x5d91
shlq $0x3, %rsi
jmp 0x5e04
xorl %esi, %esi
movq %rbp, %rbx
movq %r14, %rdi
callq 0x80a1
movq %rax, %r12
movslq 0x30(%rsp), %rax
testq %rax, %rax
jle 0x5ef2
movq 0x38(%rsp), %rcx
leal 0x1(%rax), %edx
xorl %r8d, %r8d
movl $0x1, %esi
xorl %ebp, %ebp
movslq %r8d, %rdi
cmpq %rax, %rsi
je 0x5e49
movq (%rcx,%rsi,8), %r9
xorq (%rcx,%rdi,8), %r9
shrq $0x20, %r9
je 0x5ee4
movl %r8d, %r9d
cmpq %rdi, %rsi
jle 0x5e67
movq %rdi, %r9
testb $-0x80, 0x3(%rcx,%r9,8)
jne 0x5e67
incq %r9
cmpq %r9, %rsi
jne 0x5e54
movq %rsi, %r9
movl %esi, %r10d
subl %r9d, %r10d
movl %r9d, %r11d
subl %r8d, %r11d
setle %r15b
testl %r10d, %r10d
setle %r14b
orb %r15b, %r14b
jne 0x5ee1
imull %r10d, %r11d
movq 0x8(%rsp), %r10
cmpl 0x2c(%r10), %r11d
setle %r10b
cmpl %r8d, %r9d
setg %r8b
andb %r10b, %r8b
cmpb $0x1, %r8b
jne 0x5ee1
movslq %r9d, %r8
movq 0x38(%rsp), %r9
cmpq %r8, %rsi
jle 0x5ed9
movq %r8, %r10
movq (%r9,%rdi,8), %r11
shlq $0x20, %r11
movq (%r9,%r10,8), %r14
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
orq %r11, %r14
movq %r14, (%r12,%rbp,8)
incq %rbp
incq %r10
cmpq %r10, %rsi
jne 0x5eb4
incq %rdi
cmpq %r8, %rdi
jne 0x5eac
movl %esi, %r8d
incq %rsi
cmpq %rdx, %rsi
jne 0x5e2f
jmp 0x5ef4
xorl %ebp, %ebp
addq 0x10(%rsp), %r13
movq 0x58(%rsp), %r15
notl %r15d
andl $0x1, %r15d
movq 0x38(%rsp), %rsi
movq (%rsp), %r14
movq %r14, %rdi
callq 0x7fd6
leaq (%r12,%rbp,8), %rsi
movq %r12, %rdi
callq 0x46b4
movq 0x8(%rsp), %r10
movl 0x14(%r10), %esi
movl 0x18(%r10), %edi
movl 0x24(%r10), %edx
movl 0x34(%r10), %ecx
movl 0x38(%r10), %r8d
movl 0x30(%r10), %r9d
movl 0x3c(%r10), %eax
movss 0x40(%r10), %xmm0
subq $0x8, %rsp
pushq %r14
leaq 0x80(%rsp), %r10
pushq %r10
leaq 0x94(%rsp), %r10
pushq %r10
pushq %r12
pushq %rbp
pushq $0x0
pushq %rbx
pushq %r15
pushq %rax
callq 0xdadc
addq $0x50, %rsp
movl 0x7c(%rsp), %ecx
testq %rcx, %rcx
je 0x5fe6
movq %rax, %r12
movq 0x70(%rsp), %rax
xorl %edx, %edx
cmpl $0x2, %ecx
jl 0x5fb4
movl 0x4(%rax), %esi
xorl %edx, %edx
movl $0x1, %edi
movslq %esi, %rsi
movq (%rax,%rdi,8), %r8
shrq $0x20, %r8
cmpq %rsi, %r8
cmoval %edi, %edx
cmoval %r8d, %esi
incq %rdi
cmpq %rdi, %rcx
jne 0x5f97
testl %ecx, %ecx
jle 0x6000
movl $0x0, %esi
testl %edx, %edx
je 0x6002
movl %edx, %esi
xorl %edi, %edi
movl $0x1, %r8d
addl -0x8(%rax,%r8,8), %edi
cmpq %rcx, %r8
jae 0x5fe1
leaq 0x1(%r8), %r9
cmpq %r8, %rsi
movq %r9, %r8
jne 0x5fcb
movslq %edi, %rsi
jmp 0x6002
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, (%r13)
movq $0x0, 0x50(%r13)
movq (%rsp), %rbp
jmp 0x60ea
xorl %esi, %esi
movslq %ebx, %rcx
movq %rcx, 0x58(%rsp)
movslq %edx, %rbp
movq (%rax,%rbp,8), %rax
movq %rax, 0x60(%rsp)
movslq %eax, %r15
leaq (%r12,%rsi,8), %rsi
leaq (,%r15,8), %r14
movq %r12, %rdi
movq %r14, %rdx
callq 0x2250
movq (%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x8246
movq %rax, 0x50(%r13)
movq 0x70(%rsp), %rcx
movl 0x4(%rcx,%rbp,8), %ecx
movl %ecx, 0x24(%r13)
movl %r15d, 0x4(%r13)
movl $0x0, (%r13)
movq (%rax), %rcx
movl %ecx, %esi
movq %rbx, %rdx
subl %ebx, %esi
incl %esi
movl %esi, 0x34(%r13)
movl -0x8(%rax,%r15,8), %esi
incl %esi
movl %esi, 0x38(%r13)
shrq $0x20, %rcx
movq 0x58(%rsp), %rsi
leaq (%rsi,%rsi,2), %r8
movq 0xb0(%rsp), %rdi
movq %rdi, %rsi
subq %r8, %rsi
addq %rsi, %rcx
incq %rcx
movq %rcx, 0x40(%r13)
movl -0x4(%rax,%r15,8), %ecx
addq %rdi, %rcx
incq %rcx
movq %rcx, 0x48(%r13)
testq %r15, %r15
jle 0x60c8
xorl %ecx, %ecx
movl 0x4(%rax,%rcx,8), %esi
addl %edi, %esi
subl 0x40(%r13), %esi
movl %esi, 0x4(%rax,%rcx,8)
incq %rcx
cmpq %rcx, %r15
jne 0x60b2
movq 0x60(%rsp), %rdi
movq %rax, %rsi
callq 0xe5c0
movl %eax, 0x28(%r13)
movq 0x70(%rsp), %rsi
movq (%rsp), %rbp
movq %rbp, %rdi
callq 0x7fd6
movq 0x8(%rsp), %r12
cmpl $0x0, 0x4(%r13)
jle 0x6119
movq 0x50(%rsp), %rcx
movslq %ecx, %rax
incl %ecx
movq %rcx, 0x50(%rsp)
imulq $0x68, %rax, %rdi
addq 0x10(%rsp), %rdi
movl $0xd, %ecx
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0xc0(%rsp), %rcx
incq %rcx
movq 0x28(%rsp), %rax
movslq (%rax), %rax
cmpq %rax, %rcx
jl 0x5b81
movq 0x28(%rsp), %rbx
movq 0x50(%rsp), %rax
movl %eax, (%rbx)
movq %rbp, %rdi
movq 0xa0(%rsp), %rsi
callq 0x7fd6
movq %rbp, %rdi
movq 0x20(%rsp), %rsi
callq 0x7fd6
movl (%rbx), %esi
movq %rbp, %rdi
movq 0x10(%rsp), %r13
movq %r13, %rdx
callq 0xe948
movq %rax, 0x20(%rsp)
movq %rbp, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0xe9ed
movss 0x44(%r12), %xmm0
movl 0x48(%r12), %esi
movl (%rbx), %edx
movq 0x18(%rsp), %r15
movl 0x8(%r15), %r8d
movq %rbp, %rdi
movq %r13, %rcx
xorl %r9d, %r9d
callq 0xebaf
movss 0x4c(%r12), %xmm0
mulss %xmm0, %xmm0
movl 0x8(%r15), %esi
addl %esi, %esi
movl 0x58(%r12), %edx
movq %rbp, %rdi
movq %rbx, %rcx
movq %r13, %r8
callq 0xf068
jmp 0x61dc
movq (%rsp), %rbp
movq 0x8(%rsp), %r12
movq 0x18(%rsp), %r15
testb $0x2, (%r12)
jne 0x6319
movq 0x18(%r15), %rsi
movq 0x28(%rsp), %rbx
movl (%rbx), %edx
movl 0x18(%r12), %eax
movl %eax, %r10d
shrl $0x1f, %r10d
addl %eax, %r10d
sarl %r10d
subq $0x8, %rsp
movq %rbp, %rdi
movq %r13, %rcx
movq 0x28(%rsp), %r8
movl $0x64, %r9d
pushq %r10
callq 0xf373
addq $0x10, %rsp
movq %rax, %r14
cmpl $0x0, (%rbx)
jle 0x629a
xorl %ebx, %ebx
movq %r13, %r12
xorl %ebp, %ebp
movq (%r14,%rbx,8), %rax
movq %rax, %r10
shrq $0x20, %r10
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movl 0x48(%rsp), %ecx
movq 0xa8(%rsp), %r8
movq %r12, %r9
pushq %rax
pushq %r10
callq 0x683c
addq $0x10, %rsp
cmpq $0x0, 0x60(%r12)
je 0x6284
movslq %ebp, %rax
incl %ebp
imulq $0x68, %rax, %rdi
addq %r13, %rdi
movl $0xd, %ecx
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
incq %rbx
movq 0x28(%rsp), %rax
movslq (%rax), %rax
addq $0x68, %r12
cmpq %rax, %rbx
jl 0x6233
jmp 0x629c
xorl %ebp, %ebp
movq 0x28(%rsp), %rax
movl %ebp, (%rax)
testq %r14, %r14
movq (%rsp), %rbp
je 0x62b7
movq %rbp, %rdi
movq %r14, %rsi
callq 0x7fd6
movq %rbp, %rdi
movq 0x28(%rsp), %rbx
movq %rbx, %rsi
movq %r13, %rdx
callq 0xe9ed
movl (%rbx), %edi
movq 0x8(%rsp), %r14
movl 0x6c(%r14), %edx
movq %r13, %rsi
callq 0xf2e7
movss 0x44(%r14), %xmm0
movl 0x48(%r14), %esi
movl (%rbx), %edx
movl 0x8(%r15), %r8d
movq %rbp, %rdi
movq %r13, %rcx
xorl %r9d, %r9d
callq 0xebaf
movss 0x4c(%r14), %xmm0
movl 0x8(%r15), %esi
addl %esi, %esi
movl 0x58(%r14), %edx
movq %rbp, %rdi
movq %rbx, %rcx
movq %r13, %r8
callq 0xf068
movq %rbp, %rdi
movq 0x20(%rsp), %rsi
callq 0x7fd6
movq %r13, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x2ab3
jmp 0x5876