// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/bwamem.c
// Function: mem_chain
mem_chain_v mem_chain(const mem_opt_t *opt, const bwt_t *bwt, const bntseq_t *bns, int len, const uint8_t *seq, void *buf)
{
	int i, b, e, l_rep;
	int64_t l_pac = bns->l_pac;
	mem_chain_v chain;
	kbtree_t(chn) *tree;
	smem_aux_t *aux;

	kv_init(chain);
	if (len < opt->min_seed_len) return chain; // if the query is shorter than the seed length, no match
	tree = kb_init(chn, KB_DEFAULT_SIZE);

	aux = buf? (smem_aux_t*)buf : smem_aux_init();

	mem_collect_intv(opt, bwt, len, seq, aux);

	for (i = 0, b = e = l_rep = 0; i < aux->mem.n; ++i) { // compute frac_rep
		bwtintv_t *p = &aux->mem.a[i];
		int sb = (p->info>>32), se = (uint32_t)p->info;
		if (p->x[2] <= opt->max_occ) continue;
		if (sb > e) l_rep += e - b, b = sb, e = se;
		else e = e > se? e : se;
	}
	l_rep += e - b;
	for (i = 0; i < aux->mem.n; ++i) {
		bwtintv_t *p = &aux->mem.a[i];
		int step, count, slen = (uint32_t)p->info - (p->info>>32); // seed length
		int64_t k;
		step = p->x[2] > opt->max_occ? p->x[2] / opt->max_occ : 1;
		for (k = count = 0; k < p->x[2] && count < opt->max_occ; k += step, ++count) {
			mem_chain_t tmp, *lower, *upper;
			mem_seed_t s;
			int rid, to_add = 0;
			s.rbeg = tmp.pos = bwt_sa(bwt, p->x[0] + k); // this is the base coordinate in the forward-reverse reference
			s.qbeg = p->info>>32;
			s.score= s.len = slen;
			rid = bns_intv2rid(bns, s.rbeg, s.rbeg + s.len);
			if (rid < 0) continue; // bridging multiple reference sequences or the forward-reverse boundary; TODO: split the seed; don't discard it!!!
			if (kb_size(tree)) {
				kb_intervalp(chn, tree, &tmp, &lower, &upper); // find the closest chain
				if (!lower || !test_and_merge(opt, l_pac, lower, &s, rid)) to_add = 1;
			} else to_add = 1;
			if (to_add) { // add the seed as a new chain
				tmp.n = 1; tmp.m = 4;
				tmp.seeds = calloc(tmp.m, sizeof(mem_seed_t));
				tmp.seeds[0] = s;
				tmp.rid = rid;
				tmp.is_alt = !!bns->anns[rid].is_alt;
				kb_putp(chn, tree, &tmp);
			}
		}
	}
	if (buf == 0) smem_aux_destroy(aux);

	kv_resize(mem_chain_t, chain, kb_size(tree));

	#define traverse_func(p_) (chain.a[chain.n++] = *(p_))
	__kb_traverse(mem_chain_t, tree, traverse_func);
	#undef traverse_func

	for (i = 0; i < chain.n; ++i) chain.a[i].frac_rep = (float)l_rep / len;
	logMessage(__func__, LOG_LEVEL_DEBUG, "* fraction of repetitive seeds: %.3f\n", (float)l_rep / len);

	kb_destroy(chn, tree);
	return chain;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, 0x58(%rsp)
movq %rdi, %rax
movq %rcx, 0x80(%rsp)
movq (%rcx), %rcx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rsi, 0x8(%rsp)
cmpl %r8d, 0x78(%rsi)
jg 0x13363
movq %r9, 0x20(%rsp)
movq %rcx, 0x78(%rsp)
movl %r8d, 0x14(%rsp)
movq %rax, 0x40(%rsp)
movq 0x100(%rsp), %rbx
movl $0x200, %edi            # imm = 0x200
callq 0x124ec
movq %rax, %r14
movq %rbx, %r9
testq %rbx, %rbx
jne 0x127ba
callq 0x1b1f0
movq %rax, %r9
movq 0x8(%rsp), %rcx
movl 0x48(%rcx), %eax
andl $0x40, %eax
cmpl $0x1, %eax
pushq $0x2
popq %rax
cvtsi2ssl 0x78(%rcx), %xmm0
sbbl $0x0, %eax
movl %eax, 0x18(%rsp)
mulss 0x84(%rcx), %xmm0
andq $0x0, (%r9)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x60(%rsp)
leaq 0x18(%r9), %r15
leaq 0x30(%r9), %rax
movq %rax, 0x38(%rsp)
xorl %r12d, %r12d
movl 0x14(%rsp), %esi
movq %r9, 0x28(%rsp)
movq 0x20(%rsp), %rbx
cmpl %esi, %r12d
jge 0x128f3
movslq %r12d, %rax
cmpb $0x15, (%rbx,%rax)
jbe 0x12822
incl %r12d
jmp 0x1280b
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
movq 0x58(%rsp), %rdi
movq %rbx, %rdx
movl %r12d, %ecx
movl 0x18(%rsp), %r8d
movq %r15, %r9
callq 0xe3ec
movq 0x28(%rsp), %r9
movl %eax, %r12d
xorl %ebx, %ebx
xorl %r13d, %r13d
cmpq %r13, (%r15)
jbe 0x128ea
movq 0x28(%r9), %rbp
movq 0x18(%rbp,%rbx), %rax
movq %rax, %rcx
shrq $0x20, %rcx
subl %ecx, %eax
movq 0x8(%rsp), %rcx
cmpl %eax, 0x78(%rcx)
jg 0x128de
movq (%r9), %rcx
movq 0x10(%r9), %rax
cmpq 0x8(%r9), %rcx
jne 0x128bf
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r9)
shlq $0x5, %rsi
movq %rax, %rdi
leaq 0x10fae(%rip), %rdx     # 0x23850
movl $0xc9, %ecx
leaq 0x11874(%rip), %r8      # 0x24122
callq 0x1e0b4
movq 0x28(%rsp), %r9
movq %rax, 0x10(%r9)
movq (%r9), %rcx
addq %rbx, %rbp
leaq 0x1(%rcx), %rdx
movq %rdx, (%r9)
shlq $0x5, %rcx
movups (%rbp), %xmm0
movups 0x10(%rbp), %xmm1
movups %xmm1, 0x10(%rax,%rcx)
movups %xmm0, (%rax,%rcx)
incq %r13
addq $0x20, %rbx
jmp 0x12850
movl 0x14(%rsp), %esi
jmp 0x12806
movsd 0x60(%rsp), %xmm0
addsd 0xde9f(%rip), %xmm0     # 0x207a0
cvttsd2si %xmm0, %eax
movl %eax, 0x18(%rsp)
movl (%r9), %eax
xorl %r13d, %r13d
testl %eax, %eax
cmovlel %r13d, %eax
movq %rax, 0x20(%rsp)
cmpq 0x20(%rsp), %r13
je 0x12a2f
movq 0x10(%r9), %rdx
movq %r13, %rsi
shlq $0x5, %rsi
movq 0x18(%rdx,%rsi), %rax
movq %rax, %rcx
shrq $0x20, %rcx
movl %eax, %edi
subl %ecx, %edi
cmpl 0x18(%rsp), %edi
jl 0x1295e
addq %rsi, %rdx
movq 0x10(%rdx), %r8
movq 0x8(%rsp), %rdx
movslq 0x88(%rdx), %rdx
cmpq %rdx, %r8
jbe 0x12963
incq %r13
jmp 0x1291a
addl %eax, %ecx
sarl %ecx
incl %r8d
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
movq 0x58(%rsp), %rdi
movl 0x14(%rsp), %esi
movq %rbx, %rdx
movq %r15, %r9
callq 0xe3ec
movq 0x28(%rsp), %r9
xorl %ebp, %ebp
xorl %r12d, %r12d
cmpq %r12, (%r15)
jbe 0x1295e
movq 0x28(%r9), %rcx
movq 0x18(%rcx,%rbp), %rax
movl %eax, %edx
shrq $0x20, %rax
subq %rax, %rdx
movq 0x8(%rsp), %rax
movslq 0x78(%rax), %rax
cmpq %rax, %rdx
jb 0x12a23
movq (%r9), %rdx
movq 0x10(%r9), %rax
cmpq 0x8(%r9), %rdx
jne 0x12a04
leaq (%rdx,%rdx), %rsi
testq %rdx, %rdx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r9)
shlq $0x5, %rsi
movq %rax, %rdi
leaq 0x10e6d(%rip), %rdx     # 0x23850
movl $0xd8, %ecx
leaq 0x11733(%rip), %r8      # 0x24122
callq 0x1e0b4
movq 0x28(%rsp), %r9
movq %rax, 0x10(%r9)
movq (%r9), %rdx
movq 0x28(%r9), %rcx
leaq 0x1(%rdx), %rsi
movq %rsi, (%r9)
shlq $0x5, %rdx
movupd (%rcx,%rbp), %xmm0
movups 0x10(%rcx,%rbp), %xmm1
movups %xmm1, 0x10(%rax,%rdx)
movupd %xmm0, (%rax,%rdx)
incq %r12
addq $0x20, %rbp
jmp 0x12991
movq 0x8(%rsp), %rax
cmpq $0x0, 0x30(%rax)
movl 0x14(%rsp), %esi
je 0x12b1a
xorl %ebp, %ebp
leaq 0x88(%rsp), %r13
leaq 0x10dfc(%rip), %r15     # 0x23850
leaq 0x116c7(%rip), %r12     # 0x24122
cmpl %esi, %ebp
jge 0x12b1a
movslq %ebp, %rax
cmpb $0x15, (%rbx,%rax)
ja 0x12b13
movq 0x8(%rsp), %rax
movl 0x30(%rax), %r9d
movl 0x78(%rax), %r8d
movq %r13, (%rsp)
movq 0x58(%rsp), %rdi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0xe401
movq 0x28(%rsp), %r9
movl %eax, %ebp
cmpq $0x0, 0x98(%rsp)
je 0x12b0a
movq (%r9), %rcx
movq 0x10(%r9), %rax
cmpq 0x8(%r9), %rcx
jne 0x12ae4
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r9)
shlq $0x5, %rsi
movq %rax, %rdi
movq %r15, %rdx
movl $0xe3, %ecx
movq %r12, %r8
callq 0x1e0b4
movq 0x28(%rsp), %r9
movq %rax, 0x10(%r9)
movq (%r9), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r9)
shlq $0x5, %rcx
movupd 0x88(%rsp), %xmm0
movups 0x98(%rsp), %xmm1
movups %xmm1, 0x10(%rax,%rcx)
movupd %xmm0, (%rax,%rcx)
movl 0x14(%rsp), %esi
jmp 0x12a5b
incl %ebp
jmp 0x12a5b
movq (%r9), %rdi
movq 0x10(%r9), %rsi
callq 0x1201c
movq 0x28(%rsp), %rdi
movq (%rdi), %rax
movl $0x0, 0x34(%rsp)
pushq $0x18
popq %rcx
movq %rax, %rdx
xorl %ebx, %ebx
xorl %esi, %esi
subq $0x1, %rdx
jb 0x12b94
movq 0x10(%rdi), %r9
movq 0x8(%rsp), %r8
movslq 0x8c(%r8), %r8
cmpq %r8, -0x8(%r9,%rcx)
jbe 0x12b79
movq (%r9,%rcx), %r9
movq %r9, %r8
shrq $0x20, %r8
cmpl %r8d, %ebx
jge 0x12b7e
addl 0x34(%rsp), %ebx
subl %esi, %ebx
movl %ebx, 0x34(%rsp)
jmp 0x12b88
movl %ebx, %r9d
jmp 0x12b85
cmpl %r9d, %ebx
cmovgl %ebx, %r9d
movl %esi, %r8d
addq $0x20, %rcx
movl %r9d, %ebx
movl %r8d, %esi
jmp 0x12b40
subl %esi, %ebx
xorl %esi, %esi
movl %ebx, 0x74(%rsp)
cmpq %rsi, %rax
jbe 0x1305f
movq 0x10(%rdi), %rbx
movq %rsi, 0xb0(%rsp)
shlq $0x5, %rsi
movq 0x10(%rbx,%rsi), %rcx
movq 0x18(%rbx,%rsi), %r9
movq 0x8(%rsp), %rax
movslq 0x8c(%rax), %r8
pushq $0x1
popq %rax
movq %rax, 0x60(%rsp)
cmpq %r8, %rcx
jbe 0x12be7
movq %rcx, %rax
xorl %edx, %edx
divq %r8
cltq
movq %rax, 0x60(%rsp)
addq %rsi, %rbx
movq %r9, %rdx
movq %r9, %rax
shrq $0x20, %rax
subq %rax, %rdx
movq %rdx, 0x68(%rsp)
movslq %edx, %rax
movq %rax, 0xc0(%rsp)
xorl %ebp, %ebp
xorl %edx, %edx
movq %rbx, 0x48(%rsp)
cmpq %rcx, %rdx
jae 0x13048
movq 0x8(%rsp), %rax
cmpl 0x8c(%rax), %ebp
jge 0x13048
movq (%rbx), %rsi
movq %rdx, 0x20(%rsp)
addq %rdx, %rsi
movq 0x58(%rsp), %rdi
callq 0xd7c6
movq %rax, %r15
movq %rax, 0xa0(%rsp)
movl 0x1c(%rbx), %eax
movq %rax, 0x18(%rsp)
movq 0xc0(%rsp), %rax
leaq (%r15,%rax), %rdx
movq 0x80(%rsp), %rdi
movq %r15, %rsi
movq %rdx, 0xb8(%rsp)
callq 0xf980
testl %eax, %eax
js 0x1302e
movl %eax, %r13d
cmpl $0x0, 0x20(%r14)
movq %rbp, 0x38(%rsp)
je 0x12e58
andl $0x0, 0x54(%rsp)
xorl %ebp, %ebp
movq %r14, %rax
movq (%rax), %rbx
testq %rbx, %rbx
je 0x12cef
movq %rbx, %rdi
leaq 0x88(%rsp), %rsi
leaq 0x54(%rsp), %rdx
callq 0x1b26b
movl %eax, %ecx
imulq $0x28, %rcx, %rcx
leaq (%rbx,%rcx), %r12
addq $0x4, %r12
testl %eax, %eax
js 0x12cd1
cmpl $0x0, 0x54(%rsp)
je 0x12d06
testl %eax, %eax
cmovnsq %r12, %rbp
testb $0x1, (%rbx)
je 0x12cef
movslq 0xc(%r14), %rcx
addq %rcx, %rbx
cltq
leaq (%rbx,%rax,8), %rax
addq $0x8, %rax
jmp 0x12c9b
movq 0x48(%rsp), %rbx
movq %rbp, %r12
testq %rbp, %rbp
movq 0x38(%rsp), %rbp
jne 0x12d10
jmp 0x12e58
movq 0x48(%rsp), %rbx
movq 0x38(%rsp), %rbp
cmpl %r13d, 0xc(%r12)
jne 0x12e58
movq 0x20(%r12), %rax
movl (%r12), %ecx
movslq %ecx, %rdx
imulq $0x18, %rdx, %r8
movl -0x10(%rax,%r8), %edi
movslq -0xc(%rax,%r8), %rsi
movq -0x18(%rax,%r8), %r8
movq 0x18(%rsp), %r9
cmpl %r9d, 0x8(%rax)
jg 0x12d72
leal (%rsi,%rdi), %r9d
movq 0x68(%rsp), %r10
movq 0x18(%rsp), %r11
addl %r11d, %r10d
cmpl %r9d, %r10d
jg 0x12d72
cmpq (%rax), %r15
jl 0x12d72
leaq (%r8,%rsi), %r9
cmpq %r9, 0xb8(%rsp)
jle 0x1302e
movq 0x78(%rsp), %r9
cmpq %r9, %r8
jge 0x12d86
cmpq %r9, %r15
jl 0x12d99
jmp 0x12e58
cmpq %r9, %r15
jl 0x12d99
movq 0x78(%rsp), %r9
cmpq %r9, (%rax)
jl 0x12e58
movq %r15, %r9
subq %r8, %r9
js 0x12e58
movq 0x18(%rsp), %r8
subl %edi, %r8d
movslq %r8d, %rdi
movq %rdi, %r10
subq %r9, %r10
movq 0x8(%rsp), %r8
movslq 0x24(%r8), %r8
cmpq %r8, %r10
jg 0x12e58
movq %r9, %r10
subq %rdi, %r10
cmpq %r8, %r10
jg 0x12e58
subq %rsi, %rdi
movq 0x8(%rsp), %r8
movslq 0x90(%r8), %r8
cmpq %r8, %rdi
jge 0x12e58
subq %rsi, %r9
cmpq %r8, %r9
jge 0x12e58
cmpl 0x4(%r12), %ecx
jne 0x12e2f
addl %ecx, %ecx
movl %ecx, 0x4(%r12)
movslq %ecx, %rcx
imulq $0x18, %rcx, %rsi
movq %rax, %rdi
leaq 0x10a3e(%rip), %rdx     # 0x23850
movl $0x11a, %ecx            # imm = 0x11A
leaq 0x11315(%rip), %r8      # 0x24133
callq 0x1e0b4
movq %rax, 0x20(%r12)
movl (%r12), %ecx
movslq %ecx, %rdx
incl %ecx
movl %ecx, (%r12)
imulq $0x18, %rdx, %rcx
movq %r15, (%rax,%rcx)
movq 0x18(%rsp), %rdx
movl %edx, 0x8(%rax,%rcx)
movq 0x68(%rsp), %rdx
movl %edx, 0xc(%rax,%rcx)
movl %edx, 0x10(%rax,%rcx)
jmp 0x1302e
movabsq $0x400000001, %rax      # imm = 0x400000001
movq %rax, 0x88(%rsp)
pushq $0x4
popq %rdi
pushq $0x18
popq %rsi
leaq 0x109d9(%rip), %rbx     # 0x23850
movq %rbx, %rdx
movl $0x174, %ecx            # imm = 0x174
leaq 0x10a5a(%rip), %r8      # 0x238e0
callq 0x1dfd0
movq %rax, 0xa8(%rsp)
movq %r15, (%rax)
movq 0x18(%rsp), %rcx
movl %ecx, 0x8(%rax)
movq 0x68(%rsp), %rcx
movl %ecx, 0xc(%rax)
movl %ecx, 0x10(%rax)
movl %r13d, 0x94(%rsp)
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rax
movl %r13d, %ecx
imulq $0x28, %rcx, %rcx
xorl %edx, %edx
cmpl $0x0, 0x14(%rax,%rcx)
setne %dl
shll $0x1f, %edx
movl 0x98(%rsp), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
orl %edx, %eax
movl %eax, 0x98(%rsp)
incl 0x20(%r14)
movq (%r14), %r13
movl (%r13), %eax
sarl %eax
movl 0x1c(%r14), %ecx
leal -0x1(,%rcx,2), %ecx
cmpl %ecx, %eax
jne 0x12fa2
incl 0x24(%r14)
movslq 0x10(%r14), %rsi
pushq $0x1
popq %rdi
movq %rbx, %rdx
movl $0x108, %ecx            # imm = 0x108
leaq 0x11220(%rip), %r8      # 0x24142
callq 0x1dfd0
movq %rax, %rbx
movq %rax, (%r14)
movl $0x1, (%rax)
movslq 0xc(%r14), %rax
movq %r13, (%rbx,%rax)
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0x1b2ed
movq %rbx, %r13
jmp 0x12fa2
movslq 0xc(%r14), %rax
addq %r12, %rax
movq 0x8(%rax,%rbp,8), %r13
movl (%r13), %eax
sarl %eax
movl 0x1c(%r14), %ecx
leal -0x1(,%rcx,2), %ecx
cmpl %ecx, %eax
jne 0x12fa2
leaq 0x1(%rbp), %rbx
movq %r14, %rdi
movq %r12, %rsi
movl %ebx, %edx
movq %r13, %rcx
callq 0x1b2ed
imulq $0x28, %rbx, %rax
addl $0x2, %ebp
cmpq %r15, 0x1c(%r12,%rax)
cmovgel %ebx, %ebp
movslq 0xc(%r14), %rax
movslq %ebp, %rcx
addq %r12, %rax
movq (%rax,%rcx,8), %r13
movq %r13, %r12
movl (%r13), %ebx
movq %r13, %rdi
leaq 0x88(%rsp), %rsi
xorl %edx, %edx
callq 0x1b26b
movslq %eax, %rbp
testb $0x1, %bl
jne 0x12f50
sarl %ebx
leal -0x1(%rbx), %ecx
cmpl %ecx, %eax
je 0x12ff0
imulq $0x28, %rbp, %rcx
leaq (%r12,%rcx), %rdi
addq $0x54, %rdi
leaq (%r12,%rcx), %rsi
addq $0x2c, %rsi
notl %eax
addl %eax, %ebx
movslq %ebx, %rax
imulq $0x28, %rax, %rdx
callq 0x3600
movq 0x48(%rsp), %rbx
imulq $0x28, %rbp, %rax
movq 0xa8(%rsp), %rcx
movq %rcx, 0x4c(%r12,%rax)
movupd 0x88(%rsp), %xmm0
movups 0x98(%rsp), %xmm1
movups %xmm1, 0x3c(%r12,%rax)
movupd %xmm0, 0x2c(%r12,%rax)
addl $0x2, (%r12)
movq 0x38(%rsp), %rbp
movq 0x20(%rsp), %rdx
addq 0x60(%rsp), %rdx
incl %ebp
movq 0x10(%rbx), %rcx
movq 0x28(%rsp), %rdi
jmp 0x12c10
movq 0xb0(%rsp), %rsi
incq %rsi
movq (%rdi), %rax
movl 0x74(%rsp), %ebx
jmp 0x12b9c
cmpq $0x0, 0x100(%rsp)
jne 0x1306f
callq 0x13375
addl 0x34(%rsp), %ebx
movslq 0x20(%r14), %rax
movq 0x40(%rsp), %r13
movq %rax, 0x8(%r13)
movq 0x10(%r13), %rdi
imulq $0x28, %rax, %rsi
leaq 0x107c1(%rip), %r12     # 0x23850
leaq 0x1084a(%rip), %r15     # 0x238e0
movq %r12, %rdx
movl $0x17e, %ecx            # imm = 0x17E
movq %r15, %r8
callq 0x1e0b4
movq %rax, 0x10(%r13)
pushq $0x8
popq %rdi
pushq $0x10
popq %rsi
movq %r12, %rdx
movl $0x181, %ecx            # imm = 0x181
movq %r15, %r8
callq 0x1dfd0
movq (%r14), %rcx
movq %rcx, (%rax)
andl $0x0, 0x8(%rax)
pushq $0x8
popq %r12
movq %rax, %rdx
movq (%r13), %r8
movq 0x10(%r13), %rdi
leaq -0x10(%rdx), %rsi
subq %rax, %rdx
movl %ebx, %ebp
testq %rcx, %rcx
je 0x130f3
movl (%rcx), %r9d
sarl %r9d
cmpl %r9d, 0x18(%rsi)
jle 0x1315d
cmpq %rax, %rsi
jb 0x131e0
movq (%rsi), %rcx
testq %rcx, %rcx
je 0x1314e
movslq 0x8(%rsi), %r9
movl (%rcx), %r10d
sarl %r10d
cmpl %r10d, %r9d
jge 0x13150
imulq $0x28, %r8, %r10
incq %r8
movq 0x40(%rsp), %r11
movq %r8, (%r11)
imulq $0x28, %r9, %r9
movq 0x24(%rcx,%r9), %r11
movq %r11, 0x20(%rdi,%r10)
movupd 0x4(%rcx,%r9), %xmm0
movups 0x14(%rcx,%r9), %xmm1
movups %xmm1, 0x10(%rdi,%r10)
movupd %xmm0, (%rdi,%r10)
movq (%rsi), %rcx
jmp 0x13150
xorl %ecx, %ecx
incl 0x8(%rsi)
addq $-0x10, %rsi
addq $-0x10, %rdx
jmp 0x130e2
sarq $0x4, %rdx
leal -0x1(%r12), %edi
movslq %edi, %rdi
cmpq %rdi, %rdx
jne 0x131ac
leal (%r12,%r12), %ebp
movslq %ebp, %rsi
shlq $0x4, %rsi
movq %rax, %rdi
leaq 0x106cd(%rip), %rdx     # 0x23850
movl $0x181, %ecx            # imm = 0x181
movq %r15, %r8
callq 0x1e0b4
shlq $0x21, %r12
sarq $0x21, %r12
shlq $0x4, %r12
leaq (%rax,%r12), %rdx
addq $-0x10, %rdx
movq (%rdx), %rcx
movl %ebp, %r12d
jmp 0x131b3
addq $0x10, %rsi
movq %rsi, %rdx
andl $0x0, 0x18(%rdx)
testb $0x1, (%rcx)
jne 0x131c0
xorl %ecx, %ecx
jmp 0x131cf
movslq 0xc(%r14), %rsi
addq %rsi, %rcx
movslq 0x8(%rdx), %rsi
movq (%rcx,%rsi,8), %rcx
addq $0x10, %rdx
movq %rcx, (%rdx)
movq 0x40(%rsp), %r13
jmp 0x130d1
movq %rax, %rdi
callq 0x3390
cvtsi2ss %ebp, %xmm0
cvtsi2ssl 0x14(%rsp), %xmm1
movq 0x40(%rsp), %rcx
movq (%rcx), %rax
movq 0x10(%rcx), %rcx
divss %xmm1, %xmm0
addq $0x14, %rcx
subq $0x1, %rax
jb 0x13216
movss %xmm0, (%rcx)
addq $0x28, %rcx
jmp 0x13206
cvtss2sd %xmm0, %xmm0
leaq 0x106bf(%rip), %rbx     # 0x238e0
leaq 0x106c2(%rip), %rdx     # 0x238ea
pushq $0x4
popq %rsi
movq %rbx, %rdi
movb $0x1, %al
callq 0xc78e
leaq 0x10614(%rip), %rdx     # 0x23850
pushq $0x8
popq %rdi
movq %rdi, %rsi
movl $0x187, %ecx            # imm = 0x187
movq %rbx, %r8
callq 0x1dfd0
movq %rax, %r12
movq (%r14), %rax
movq %rax, (%r12)
movq %r12, 0x8(%rsp)
addq $0x8, %r12
pushq $0x8
popq %rbx
addq $-0x8, %r12
leaq 0x8(%r12), %rax
cmpq 0x8(%rsp), %rax
je 0x1334c
movq (%r12), %r13
testq %r13, %r13
je 0x1328a
movl (%r13), %eax
testb $0x1, %al
jne 0x13294
movq %r13, %rdi
callq 0x3390
jmp 0x13265
movq %rbx, 0x20(%rsp)
movq %r13, %rbx
xorl %ebp, %ebp
movl %eax, %ecx
sarl %ecx
movslq %ecx, %rcx
cmpq %rcx, %rbp
jg 0x1333a
movslq 0xc(%r14), %rcx
movq (%rbx,%rcx), %rcx
testq %rcx, %rcx
je 0x1332e
movq %r12, %rax
subq 0x8(%rsp), %rax
sarq $0x3, %rax
movq 0x20(%rsp), %r15
movslq %r15d, %rdx
cmpq %rdx, %rax
jne 0x13322
leal (%r15,%r15), %eax
movl %eax, 0x18(%rsp)
movslq %eax, %rsi
shlq $0x3, %rsi
movq 0x8(%rsp), %rdi
leaq 0x10561(%rip), %rdx     # 0x23850
movl $0x187, %ecx            # imm = 0x187
leaq 0x105e5(%rip), %r8      # 0x238e0
callq 0x1e0b4
movq %rax, 0x8(%rsp)
shlq $0x21, %r15
sarq $0x21, %r15
leaq (%rax,%r15,8), %r12
movslq 0xc(%r14), %rcx
movq (%rbx,%rcx), %rcx
movl 0x18(%rsp), %eax
movq %rax, 0x20(%rsp)
movq %rcx, (%r12)
addq $0x8, %r12
movl (%r13), %eax
incq %rbp
addq $0x8, %rbx
jmp 0x1329e
movq %r13, %rdi
callq 0x3390
movq 0x20(%rsp), %rbx
jmp 0x13265
movq %r14, %rdi
callq 0x3390
movq 0x8(%rsp), %rdi
callq 0x3390
movq 0x40(%rsp), %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq