// File: /workspace/github_c_makefile_star2_O1/lh3[P]minimap2/lchain.c
// Function: mg_lchain_rmq
mm128_t *mg_lchain_rmq(int max_dist, int max_dist_inner, int bw, int max_chn_skip, int cap_rmq_size, int min_cnt, int min_sc, float chn_pen_gap, float chn_pen_skip,
					   int64_t n, mm128_t *a, int *n_u_, uint64_t **_u, void *km)
{
	int32_t *f,*t, *v, n_u, n_v, mmax_f = 0, max_rmq_size = 0, max_drop = bw;
	int64_t *p, i, i0, st = 0, st_inner = 0;
	uint64_t *u;
	lc_elem_t *root = 0, *root_inner = 0;
	void *mem_mp = 0;
	kmp_rmq_t *mp;

	if (_u) *_u = 0, *n_u_ = 0;
	if (n == 0 || a == 0) {
		kfree(km, a);
		return 0;
	}
	if (max_dist < bw) max_dist = bw;
	if (max_dist_inner < 0) max_dist_inner = 0;
	if (max_dist_inner > max_dist) max_dist_inner = max_dist;
	p = Kmalloc(km, int64_t, n);
	f = Kmalloc(km, int32_t, n);
	t = Kcalloc(km, int32_t, n);
	v = Kmalloc(km, int32_t, n);
	mem_mp = km_init2(km, 0x10000);
	mp = kmp_init_rmq(mem_mp);

	// fill the score and backtrack arrays
	for (i = i0 = 0; i < n; ++i) {
		int64_t max_j = -1;
		int32_t q_span = a[i].y>>32&0xff, max_f = q_span;
		lc_elem_t s, *q, *r, lo, hi;
		// add in-range anchors
		if (i0 < i && a[i0].x != a[i].x) {
			int64_t j;
			for (j = i0; j < i; ++j) {
				q = kmp_alloc_rmq(mp);
				q->y = (int32_t)a[j].y, q->i = j, q->pri = -(f[j] + 0.5 * chn_pen_gap * ((int32_t)a[j].x + (int32_t)a[j].y));
				krmq_insert(lc_elem, &root, q, 0);
				if (max_dist_inner > 0) {
					r = kmp_alloc_rmq(mp);
					*r = *q;
					krmq_insert(lc_elem, &root_inner, r, 0);
				}
			}
			i0 = i;
		}
		// get rid of active chains out of range
		while (st < i && (a[i].x>>32 != a[st].x>>32 || a[i].x > a[st].x + max_dist || krmq_size(head, root) > cap_rmq_size)) {
			s.y = (int32_t)a[st].y, s.i = st;
			if ((q = krmq_find(lc_elem, root, &s, 0)) != 0) {
				q = krmq_erase(lc_elem, &root, q, 0);
				kmp_free_rmq(mp, q);
			}
			++st;
		}
		if (max_dist_inner > 0)  { // similar to the block above, but applied to the inner tree
			while (st_inner < i && (a[i].x>>32 != a[st_inner].x>>32 || a[i].x > a[st_inner].x + max_dist_inner || krmq_size(head, root_inner) > cap_rmq_size)) {
				s.y = (int32_t)a[st_inner].y, s.i = st_inner;
				if ((q = krmq_find(lc_elem, root_inner, &s, 0)) != 0) {
					q = krmq_erase(lc_elem, &root_inner, q, 0);
					kmp_free_rmq(mp, q);
				}
				++st_inner;
			}
		}
		// RMQ
		lo.i = INT32_MAX, lo.y = (int32_t)a[i].y - max_dist;
		hi.i = 0, hi.y = (int32_t)a[i].y;
		if ((q = krmq_rmq(lc_elem, root, &lo, &hi)) != 0) {
			int32_t sc, exact, width, n_skip = 0;
			int64_t j = q->i;
			assert(q->y >= lo.y && q->y <= hi.y);
			sc = f[j] + comput_sc_simple(&a[i], &a[j], chn_pen_gap, chn_pen_skip, &exact, &width);
			if (width <= bw && sc > max_f) max_f = sc, max_j = j;
			if (!exact && root_inner && (int32_t)a[i].y > 0) {
				lc_elem_t *lo, *hi;
				s.y = (int32_t)a[i].y - 1, s.i = n;
				krmq_interval(lc_elem, root_inner, &s, &lo, &hi);
				if (lo) {
					const lc_elem_t *q;
					int32_t width;
					krmq_itr_t(lc_elem) itr;
					krmq_itr_find(lc_elem, root_inner, lo, &itr);
					while ((q = krmq_at(&itr)) != 0) {
						if (q->y < (int32_t)a[i].y - max_dist_inner) break;
						j = q->i;
						sc = f[j] + comput_sc_simple(&a[i], &a[j], chn_pen_gap, chn_pen_skip, 0, &width);
						if (width <= bw) {
							if (sc > max_f) {
								max_f = sc, max_j = j;
								if (n_skip > 0) --n_skip;
							} else if (t[j] == (int32_t)i) {
								if (++n_skip > max_chn_skip)
									break;
							}
							if (p[j] >= 0) t[p[j]] = i;
						}
						if (!krmq_itr_prev(lc_elem, &itr)) break;
					}
				}
			}
		}
		// set max
		assert(max_j < 0 || (a[max_j].x < a[i].x && (int32_t)a[max_j].y < (int32_t)a[i].y));
		f[i] = max_f, p[i] = max_j;
		v[i] = max_j >= 0 && v[max_j] > max_f? v[max_j] : max_f; // v[] keeps the peak score up to i; f[] is the score ending at i, not always the peak
		if (mmax_f < max_f) mmax_f = max_f;
		if (max_rmq_size < krmq_size(head, root)) max_rmq_size = krmq_size(head, root);
	}
	km_destroy(mem_mp);

	u = mg_chain_backtrack(km, n, f, p, v, t, min_cnt, min_sc, max_drop, &n_u, &n_v);
	*n_u_ = n_u, *_u = u; // NB: note that u[] may not be sorted by score here
	kfree(km, p); kfree(km, f); kfree(km, t);
	if (n_u == 0) {
		kfree(km, a); kfree(km, v);
		return 0;
	}
	return compact_a(km, n_u, u, n_v, v, a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
movss %xmm1, 0x50(%rsp)
movss %xmm0, 0x1c(%rsp)
movl %r8d, 0x54(%rsp)
movl %ecx, 0x8c(%rsp)
movq %rdx, 0x58(%rsp)
movq 0x3c0(%rsp), %rcx
movq 0x3b8(%rsp), %rdx
movq 0x3b0(%rsp), %r8
movq 0x3a8(%rsp), %r12
xorl %eax, %eax
movq %rax, 0x40(%rsp)
movq %rax, 0x38(%rsp)
testq %rcx, %rcx
je 0x16659
movq $0x0, (%rcx)
movl $0x0, (%rdx)
movq 0x3c8(%rsp), %r15
testq %r12, %r12
setne %al
testq %r8, %r8
setne %cl
testb %cl, %al
jne 0x1667c
movq %r15, %rdi
movq %r8, %rsi
jmp 0x170b9
movq %r9, 0x98(%rsp)
movq 0x58(%rsp), %rax
cmpl %eax, %edi
cmovlel %eax, %edi
xorl %ecx, %ecx
testl %esi, %esi
movl $0x0, %eax
movq %rax, 0x70(%rsp)
cmovlel %ecx, %esi
cmpl %edi, %esi
movl %edi, 0x4c(%rsp)
cmovgel %edi, %esi
movl %esi, 0x4(%rsp)
leaq (,%r12,8), %rsi
movq %r15, %rdi
movq %r8, %r14
callq 0x126e9
movq %rax, 0x78(%rsp)
leaq (,%r12,4), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x126e9
movq %rax, 0x30(%rsp)
movl $0x4, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x1257c
movq %rax, 0x60(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x126e9
movq %rax, 0x28(%rsp)
movl $0x10000, %esi          # imm = 0x10000
movq %r15, %rdi
callq 0x12534
movq %rax, %rbx
movl $0x1, %esi
movl $0x28, %edx
movq %rax, %rdi
callq 0x1257c
movq %rbx, 0x90(%rsp)
movq %rbx, 0x20(%rax)
testq %r12, %r12
jle 0x16fcc
movq %r14, %r11
movq %rax, %r13
cvtss2sd 0x1c(%rsp), %xmm0
mulsd 0x15954(%rip), %xmm0    # 0x2c0a0
movsd %xmm0, 0xa0(%rsp)
movslq 0x4c(%rsp), %rax
movq %rax, 0xb0(%rsp)
movl 0x4(%rsp), %eax
movq %rax, 0xa8(%rsp)
leaq 0x8(%r14), %rax
movq %rax, 0x68(%rsp)
xorl %r15d, %r15d
xorl %ebp, %ebp
xorl %ebx, %ebx
xorl %r12d, %r12d
movq %r12, %rax
shlq $0x4, %rax
leaq (%r11,%rax), %rcx
movzbl 0xc(%r11,%rax), %eax
movl %eax, (%rsp)
cmpq %r12, %rbx
movq %r12, 0x20(%rsp)
movq %rcx, 0x8(%rsp)
jge 0x168d0
movq %rbx, %r14
shlq $0x4, %r14
movq (%r11,%r14), %rax
cmpq (%rcx), %rax
je 0x168d0
addq 0x68(%rsp), %r14
incq (%r13)
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x167e1
movq 0x18(%r13), %rcx
leaq -0x1(%rax), %rdx
movq %rdx, 0x8(%r13)
movq -0x8(%rcx,%rax,8), %r12
jmp 0x167f7
movq 0x20(%r13), %rdi
movl $0x1, %esi
movl $0x38, %edx
callq 0x1257c
movq %rax, %r12
movl (%r14), %eax
movl %eax, (%r12)
movq %rbx, 0x8(%r12)
movq 0x30(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2sdl (%rcx,%rbx,4), %xmm0
addl -0x8(%r14), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd 0xa0(%rsp), %xmm1
addsd %xmm0, %xmm1
xorpd 0x16ba0(%rip), %xmm1    # 0x2d3d0
movlpd %xmm1, 0x10(%r12)
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x15bdc
cmpl $0x0, 0x4(%rsp)
jle 0x168b8
incq (%r13)
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x1686d
movq 0x18(%r13), %rcx
leaq -0x1(%rax), %rdx
movq %rdx, 0x8(%r13)
movq -0x8(%rcx,%rax,8), %rsi
jmp 0x16883
movq 0x20(%r13), %rdi
movl $0x1, %esi
movl $0x38, %edx
callq 0x1257c
movq %rax, %rsi
movq 0x30(%r12), %rax
movq %rax, 0x30(%rsi)
movupd (%r12), %xmm0
movupd 0x10(%r12), %xmm1
movups 0x20(%r12), %xmm2
movups %xmm2, 0x20(%rsi)
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
leaq 0x38(%rsp), %rdi
xorl %edx, %edx
callq 0x15bdc
incq %rbx
addq $0x10, %r14
movq 0x20(%rsp), %r12
cmpq %r12, %rbx
jl 0x167c1
movq %r12, %rbx
cmpq %r12, %rbp
jge 0x169c8
movq %rbp, %r14
shlq $0x4, %r14
addq 0x68(%rsp), %r14
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq -0x8(%r14), %rcx
movq %rcx, %rdx
xorq %rax, %rdx
shrq $0x20, %rdx
jne 0x16925
addq 0xb0(%rsp), %rcx
cmpq %rcx, %rax
ja 0x16925
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x16919
movl 0x34(%rax), %eax
jmp 0x1691b
xorl %eax, %eax
cmpl 0x54(%rsp), %eax
jbe 0x169c8
movl (%r14), %eax
movl %eax, 0xb8(%rsp)
movq %rbp, 0xc0(%rsp)
movq 0x40(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
xorl %edx, %edx
callq 0x158ab
testq %rax, %rax
je 0x169b8
leaq 0x40(%rsp), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x1600e
decq (%r13)
movq %rax, %r12
movq 0x10(%r13), %rax
cmpq %rax, 0x8(%r13)
jne 0x1699f
movq %rax, %rdx
shrq %rdx
addq %rax, %rdx
cmpq $0x4, %rax
movl $0x10, %eax
cmovbq %rax, %rdx
movq %rdx, 0x10(%r13)
movq 0x18(%r13), %rsi
movq 0x20(%r13), %rdi
shlq $0x3, %rdx
callq 0x127ec
movq %rax, 0x18(%r13)
movq 0x8(%r13), %rax
movq 0x18(%r13), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%r13)
movq %r12, (%rcx,%rax,8)
movq 0x20(%rsp), %r12
incq %rbp
addq $0x10, %r14
cmpq %r12, %rbp
jl 0x168e5
cmpl $0x0, 0x4(%rsp)
setg %al
cmpq %r12, %r15
setl %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x16ad0
movq %r15, %r14
shlq $0x4, %r14
addq 0x68(%rsp), %r14
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq -0x8(%r14), %rcx
movq %rcx, %rdx
xorq %rax, %rdx
shrq $0x20, %rdx
jne 0x16a2d
addq 0xa8(%rsp), %rcx
cmpq %rcx, %rax
ja 0x16a2d
movq 0x38(%rsp), %rax
testq %rax, %rax
je 0x16a21
movl 0x34(%rax), %eax
jmp 0x16a23
xorl %eax, %eax
cmpl 0x54(%rsp), %eax
jbe 0x16ad0
movl (%r14), %eax
movl %eax, 0xb8(%rsp)
movq %r15, 0xc0(%rsp)
movq 0x38(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
xorl %edx, %edx
callq 0x158ab
testq %rax, %rax
je 0x16ac0
leaq 0x38(%rsp), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x1600e
decq (%r13)
movq %rax, %r12
movq 0x10(%r13), %rax
cmpq %rax, 0x8(%r13)
jne 0x16aa7
movq %rax, %rdx
shrq %rdx
addq %rax, %rdx
cmpq $0x4, %rax
movl $0x10, %eax
cmovbq %rax, %rdx
movq %rdx, 0x10(%r13)
movq 0x18(%r13), %rsi
movq 0x20(%r13), %rdi
shlq $0x3, %rdx
callq 0x127ec
movq %rax, 0x18(%r13)
movq 0x8(%r13), %rax
movq 0x18(%r13), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%r13)
movq %r12, (%rcx,%rax,8)
movq 0x20(%rsp), %r12
incq %r15
addq $0x10, %r14
cmpq %r12, %r15
jl 0x169ed
movq $0x7fffffff, 0x130(%rsp) # imm = 0x7FFFFFFF
movq 0x8(%rsp), %rax
movl 0x8(%rax), %r12d
movl %r12d, %r14d
subl 0x4c(%rsp), %r14d
movl %r14d, 0x128(%rsp)
movq $0x0, 0xf8(%rsp)
movl %r12d, 0xf0(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x80(%rsp)
leaq 0x128(%rsp), %rsi
leaq 0xf0(%rsp), %rdx
callq 0x159ad
testq %rax, %rax
je 0x16edf
movl (%rax), %ecx
cmpl %r14d, %ecx
jl 0x170f1
cmpl %r12d, %ecx
jg 0x170f1
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
shlq $0x4, %rax
movq 0x3b0(%rsp), %r11
movq 0x8(%r11,%rax), %rdx
movl %r12d, %edi
subl %edx, %edi
movq 0x8(%rsp), %rcx
movl (%rcx), %r8d
subl (%r11,%rax), %r8d
movl %edi, %r9d
subl %r8d, %r9d
movl %r8d, %esi
cmovll %edi, %esi
setne %al
movl %r9d, %ecx
negl %ecx
cmovsl %r9d, %ecx
shrq $0x20, %rdx
movzbl %dl, %r9d
cmpl %esi, %r9d
movl %esi, %r14d
cmovll %r9d, %r14d
setl %dl
cmpl %r8d, %edi
movq 0x80(%rsp), %r10
jne 0x16bb6
cmpl %r9d, %edi
jle 0x16c42
xorpd %xmm0, %xmm0
cmpl %r8d, %edi
je 0x16c11
leal 0x1(%rcx), %edi
xorps %xmm0, %xmm0
cvtsi2ss %edi, %xmm0
movd %xmm0, %edi
movl %edi, %r8d
shrl $0x17, %r8d
addl $-0x80, %r8d
cvtsi2ss %r8, %xmm1
andl $0x7fffff, %edi         # imm = 0x7FFFFF
orl $0x3f800000, %edi       # imm = 0x3F800000
movd %edi, %xmm2
movdqa %xmm2, %xmm0
mulss 0x167c3(%rip), %xmm0    # 0x2d3bc
addss 0x167bf(%rip), %xmm0    # 0x2d3c0
mulss %xmm2, %xmm0
addss 0x167b7(%rip), %xmm0    # 0x2d3c4
addss %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
xorps %xmm2, %xmm2
cvtsi2ss %esi, %xmm2
mulss 0x50(%rsp), %xmm2
mulss 0x1c(%rsp), %xmm1
addss %xmm2, %xmm1
mulss 0x16791(%rip), %xmm0    # 0x2d3c8
addss %xmm1, %xmm0
cvttss2si %xmm0, %esi
subl %esi, %r14d
orb %dl, %al
movq 0x30(%rsp), %rdx
movq 0x10(%rsp), %rdi
addl (%rdx,%rdi,4), %r14d
cmpl 0x58(%rsp), %ecx
setle %cl
movl (%rsp), %esi
cmpl %esi, %r14d
setg %dl
testb %dl, %cl
movq $-0x1, %rcx
cmoveq %rcx, %rdi
movq %rdi, 0x10(%rsp)
cmovel %esi, %r14d
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
setne %cl
testl %r12d, %r12d
setg %dl
andb %cl, %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x16ef8
leal -0x1(%r12), %eax
movl %eax, 0xb8(%rsp)
movq 0x3a8(%rsp), %rcx
movq %rcx, 0xc0(%rsp)
xorl %esi, %esi
movq %rdi, %rcx
testq %rcx, %rcx
je 0x16d12
movl (%rcx), %r8d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl %r12d, %r8d
jge 0x16cee
movl $0x1, %edx
cmpl %r8d, %eax
jg 0x16cee
xorl %edx, %edx
xorl %r8d, %r8d
movq 0x3a8(%rsp), %r9
cmpq %r9, 0x8(%rcx)
setl %dl
setg %r8b
subl %r8d, %edx
testl %edx, %edx
js 0x16d03
movl $0x20, %edx
movq %rcx, %rsi
jne 0x16d08
xorl %edx, %edx
movq %rcx, %rsi
jmp 0x16d0e
movl $0x18, %edx
movq (%rcx,%rdx), %rcx
movb $0x1, %dl
testb %dl, %dl
jne 0x16cb7
testq %rsi, %rsi
je 0x16f0e
leaq 0x160(%rsp), %r12
movq %r12, %rdx
callq 0x164ef
movl $0x0, (%rsp)
movq 0x3b0(%rsp), %r11
movq 0x360(%rsp), %rax
cmpq %r12, %rax
jae 0x16d4b
xorl %eax, %eax
jmp 0x16d4e
movq (%rax), %rax
movq 0x20(%rsp), %r10
movq 0x8(%rsp), %rdx
testq %rax, %rax
je 0x16efe
movl 0x8(%rdx), %esi
movl %esi, %ecx
subl 0x4(%rsp), %ecx
cmpl %ecx, (%rax)
jl 0x16efe
movq 0x8(%rax), %rax
movq %rax, %rcx
shlq $0x4, %rcx
movq 0x8(%r11,%rcx), %r8
subl %r8d, %esi
movl (%rdx), %edi
subl (%r11,%rcx), %edi
movl %esi, %r9d
subl %edi, %r9d
movl %edi, %edx
cmovll %esi, %edx
movl %r9d, %ecx
negl %ecx
cmovsl %r9d, %ecx
shrq $0x20, %r8
movzbl %r8b, %r8d
cmpl %edx, %r8d
movl %edx, %r9d
cmovll %r8d, %r9d
cmpl %edi, %esi
jne 0x16dbe
cmpl %r8d, %esi
jle 0x16e48
xorps %xmm0, %xmm0
cmpl %edi, %esi
je 0x16e17
leal 0x1(%rcx), %esi
xorps %xmm0, %xmm0
cvtsi2ss %esi, %xmm0
movd %xmm0, %esi
movl %esi, %edi
shrl $0x17, %edi
addl $-0x80, %edi
xorps %xmm1, %xmm1
cvtsi2ss %rdi, %xmm1
andl $0x7fffff, %esi         # imm = 0x7FFFFF
orl $0x3f800000, %esi       # imm = 0x3F800000
movd %esi, %xmm2
movdqa %xmm2, %xmm0
mulss 0x165bd(%rip), %xmm0    # 0x2d3bc
addss 0x165b9(%rip), %xmm0    # 0x2d3c0
mulss %xmm2, %xmm0
addss 0x165b1(%rip), %xmm0    # 0x2d3c4
addss %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
xorps %xmm2, %xmm2
cvtsi2ss %edx, %xmm2
mulss 0x50(%rsp), %xmm2
mulss 0x1c(%rsp), %xmm1
addss %xmm2, %xmm1
mulss 0x1658b(%rip), %xmm0    # 0x2d3c8
addss %xmm1, %xmm0
cvttss2si %xmm0, %edx
subl %edx, %r9d
cmpl 0x58(%rsp), %ecx
jg 0x16eb8
movq 0x30(%rsp), %rcx
addl (%rcx,%rax,4), %r9d
cmpl %r14d, %r9d
movq 0x10(%rsp), %rdx
jle 0x16e72
xorl %ecx, %ecx
movl (%rsp), %esi
testl %esi, %esi
setg %cl
subl %ecx, %esi
movq %rax, %rdx
jmp 0x16e96
movq 0x60(%rsp), %rcx
cmpl %r10d, (%rcx,%rax,4)
jne 0x16e90
movl (%rsp), %esi
cmpl 0x8c(%rsp), %esi
jge 0x16efe
incl %esi
movl %r14d, %r9d
jmp 0x16e96
movl %r14d, %r9d
movl (%rsp), %esi
movl %esi, (%rsp)
movq %rdx, 0x10(%rsp)
movq 0x78(%rsp), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
js 0x16eb5
movq 0x60(%rsp), %rcx
movl %r10d, (%rcx,%rax,4)
movl %r9d, %r14d
leaq 0x160(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x16569
movl %r14d, %ecx
testl %eax, %eax
movq 0x3b0(%rsp), %r11
jne 0x16d3a
jmp 0x16f01
movq $-0x1, %rdx
movq 0x3b0(%rsp), %r11
movq 0x80(%rsp), %r10
jmp 0x16f1f
movl %r14d, (%rsp)
jmp 0x16f1a
movl %r14d, %ecx
movl %ecx, (%rsp)
movq 0x80(%rsp), %r10
jmp 0x16f1a
movl %r14d, (%rsp)
movq 0x3b0(%rsp), %r11
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
movq 0x20(%rsp), %r12
js 0x16f5c
movq %rdx, %rax
shlq $0x4, %rax
movq (%r11,%rax), %rcx
movq %rdx, %rsi
movq 0x8(%rsp), %rdx
cmpq (%rdx), %rcx
jae 0x170d2
movq %rsi, %rdx
addq %r11, %rax
movl 0x8(%rax), %eax
movq 0x8(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x170d2
movq 0x30(%rsp), %rax
movl (%rsp), %ecx
movl %ecx, (%rax,%r12,4)
movq 0x78(%rsp), %rax
movq %rdx, (%rax,%r12,8)
testq %rdx, %rdx
js 0x16f82
movq 0x28(%rsp), %rax
movl (%rax,%rdx,4), %eax
cmpl %ecx, %eax
jg 0x16f84
movl %ecx, %eax
movq 0x28(%rsp), %rcx
movl %eax, (%rcx,%r12,4)
testq %r10, %r10
je 0x16f98
movl 0x34(%r10), %ecx
jmp 0x16f9a
xorl %ecx, %ecx
movq 0x70(%rsp), %rdx
cmpl %ecx, %edx
movl $0x0, %eax
cmovael %edx, %eax
testq %r10, %r10
je 0x16fb6
cmpl %ecx, %edx
jae 0x16fb6
movl 0x34(%r10), %eax
incq %r12
movq %rax, 0x70(%rsp)
cmpq 0x3a8(%rsp), %r12
jne 0x16781
movl 0x3a0(%rsp), %ebx
movq 0x90(%rsp), %rdi
callq 0x125e0
subq $0x8, %rsp
leaq 0xc0(%rsp), %rax
leaq 0x168(%rsp), %rbp
movq 0x3d0(%rsp), %r15
movq %r15, %rdi
movq 0x3b0(%rsp), %rsi
movq 0x38(%rsp), %r14
movq %r14, %rdx
movq 0x80(%rsp), %r13
movq %r13, %rcx
movq 0x30(%rsp), %r8
movq 0x68(%rsp), %r12
movq %r12, %r9
pushq %rax
pushq %rbp
pushq 0x70(%rsp)
pushq %rbx
pushq 0xc0(%rsp)
callq 0x14a8c
addq $0x30, %rsp
movq %rax, %rbx
movl (%rbp), %ebp
movq 0x3b8(%rsp), %rax
movl %ebp, (%rax)
movq 0x3c0(%rsp), %rax
movq %rbx, (%rax)
movq %r15, %rdi
movq %r13, %rsi
callq 0x1261e
movq %r15, %rdi
movq %r14, %rsi
callq 0x1261e
movq %r15, %rdi
movq %r12, %rsi
callq 0x1261e
testl %ebp, %ebp
je 0x170a1
movl 0xb8(%rsp), %ecx
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movq 0x28(%rsp), %r8
movq 0x3b0(%rsp), %r9
callq 0x156ab
jmp 0x170c0
movq %r15, %rdi
movq 0x3b0(%rsp), %rsi
callq 0x1261e
movq %r15, %rdi
movq 0x28(%rsp), %rsi
callq 0x1261e
xorl %eax, %eax
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1644c(%rip), %rdi     # 0x2d525
leaq 0x16310(%rip), %rsi     # 0x2d3f0
leaq 0x163c6(%rip), %rcx     # 0x2d4ad
movl $0x160, %edx            # imm = 0x160
callq 0x21a0
leaq 0x16398(%rip), %rdi     # 0x2d490
leaq 0x162f1(%rip), %rsi     # 0x2d3f0
leaq 0x163a7(%rip), %rcx     # 0x2d4ad
movl $0x140, %edx            # imm = 0x140
callq 0x21a0