// File: /workspace/github_c_makefile_star2_O1/lh3[P]minigraph/lchain.c
// Function: mg_lchain_rmq
mg128_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, mg128_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, n_iter = 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 >= max_dist) max_dist_inner = 0;
	KMALLOC(km, p, n);
	KMALLOC(km, f, n);
	KCALLOC(km, t, n);
	KMALLOC(km, v, 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 - 1;
		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, n_rmq_iter = 0;
					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;
						++n_rmq_iter;
						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;
					}
					n_iter += n_rmq_iter;
				}
			}
		}
		// 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);
	}
	if (mg_dbg_flag & MG_DBG_LC_PROF) fprintf(stderr, "LP\tn_iter=%ld\tmmax_f=%d\trmq_size=%d\tmp_max=%ld\n", (long)n_iter, mmax_f, max_rmq_size, mp->max);
	km_destroy(mem_mp);

	u = mg_chain_backtrack(km, n, f, p, v, t, min_cnt, min_sc, max_drop, 0, &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 $0x378, %rsp            # imm = 0x378
movss %xmm1, 0x50(%rsp)
movss %xmm0, 0x24(%rsp)
movl %r8d, 0x54(%rsp)
movl %ecx, 0x8c(%rsp)
movq %rdx, 0x60(%rsp)
movl %edi, %r13d
movq 0x3d0(%rsp), %rcx
movq 0x3c8(%rsp), %rdi
movq 0x3c0(%rsp), %rdx
movq 0x3b8(%rsp), %r12
xorl %eax, %eax
movq %rax, 0x48(%rsp)
movq %rax, 0x40(%rsp)
testq %rcx, %rcx
je 0x179ac
movq $0x0, (%rcx)
movl $0x0, (%rdi)
movq 0x3d8(%rsp), %r14
testq %r12, %r12
setne %al
testq %rdx, %rdx
setne %cl
testb %cl, %al
jne 0x179cf
movq %r14, %rdi
movq %rdx, %rsi
jmp 0x18498
movq %r9, 0xa0(%rsp)
movq 0x60(%rsp), %rax
cmpl %eax, %r13d
cmovlel %eax, %r13d
xorl %r15d, %r15d
testl %esi, %esi
movl $0x0, %eax
cmovgl %esi, %eax
cmpl %esi, %r13d
cmovlel %r15d, %eax
movl %eax, 0x14(%rsp)
leaq (,%r12,8), %rsi
movq %r14, %rdi
callq 0x31c1
movq %rax, 0x80(%rsp)
leaq (,%r12,4), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x31c1
movq %rax, 0x38(%rsp)
movl $0x4, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3054
movq %rax, 0x70(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x31c1
movq %rax, 0x58(%rsp)
movl $0x10000, %esi          # imm = 0x10000
movq %r14, %rdi
callq 0x300c
movq %rax, %rbx
movl $0x1, %esi
movl $0x28, %edx
movq %rax, %rdi
callq 0x3054
movq %rax, %rbp
movq %rbx, 0x98(%rsp)
movq %rbx, 0x20(%rax)
testq %r12, %r12
jle 0x18392
cvtss2sd 0x24(%rsp), %xmm0
mulsd 0x11750(%rip), %xmm0    # 0x291e8
movsd %xmm0, 0xb0(%rsp)
movl %r13d, 0x90(%rsp)
movslq %r13d, %rax
movq %rax, 0xc0(%rsp)
movl 0x14(%rsp), %esi
movl %esi, %eax
movq %rax, 0xb8(%rsp)
movq 0x3c0(%rsp), %rbx
leaq 0x8(%rbx), %rax
movq %rax, 0x78(%rsp)
xorl %edi, %edi
xorl %edx, %edx
movq $0x0, 0x68(%rsp)
xorl %r13d, %r13d
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %ecx, %ecx
movl %edi, 0x94(%rsp)
movq %rcx, %rax
shlq $0x4, %rax
leaq (%rbx,%rax), %rsi
movzbl 0xc(%rbx,%rax), %edi
cmpq %rcx, %r12
movq %rcx, %r15
movq %rcx, 0x18(%rsp)
movq %rsi, 0x8(%rsp)
movl %edx, 0x10(%rsp)
movq %rdi, 0x30(%rsp)
jge 0x17c44
movq %rbx, %rax
movq %r12, %rbx
shlq $0x4, %rbx
movq (%rax,%rbx), %rax
cmpq (%rsi), %rax
je 0x17c44
addq 0x78(%rsp), %rbx
incq (%rbp)
movq 0x8(%rbp), %rax
testq %rax, %rax
je 0x17b5d
movq 0x18(%rbp), %rcx
leaq -0x1(%rax), %rdx
movq %rdx, 0x8(%rbp)
movq -0x8(%rcx,%rax,8), %r15
jmp 0x17b73
movq 0x20(%rbp), %rdi
movl $0x1, %esi
movl $0x38, %edx
callq 0x3054
movq %rax, %r15
movl (%rbx), %eax
movl %eax, (%r15)
movq %r12, 0x8(%r15)
movq 0x38(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2sdl (%rcx,%r12,4), %xmm0
addl -0x8(%rbx), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd 0xb0(%rsp), %xmm1
addsd %xmm0, %xmm1
xorpd 0x11647(%rip), %xmm1    # 0x291f0
movlpd %xmm1, 0x10(%r15)
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x16f2c
cmpl $0x0, 0x14(%rsp)
je 0x17c2c
incq (%rbp)
movq 0x8(%rbp), %rax
testq %rax, %rax
je 0x17be5
movq 0x18(%rbp), %rcx
leaq -0x1(%rax), %rdx
movq %rdx, 0x8(%rbp)
movq -0x8(%rcx,%rax,8), %rsi
jmp 0x17bfb
movq 0x20(%rbp), %rdi
movl $0x1, %esi
movl $0x38, %edx
callq 0x3054
movq %rax, %rsi
movq 0x30(%r15), %rax
movq %rax, 0x30(%rsi)
movupd (%r15), %xmm0
movupd 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsi)
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
leaq 0x40(%rsp), %rdi
xorl %edx, %edx
callq 0x16f2c
incq %r12
addq $0x10, %rbx
movq 0x18(%rsp), %r15
cmpq %r15, %r12
jl 0x17b3d
movq %r15, %r12
cmpq %r15, %r14
jge 0x17d3b
movq %r14, %rbx
shlq $0x4, %rbx
addq 0x78(%rsp), %rbx
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq -0x8(%rbx), %rcx
movq %rcx, %rdx
xorq %rax, %rdx
shrq $0x20, %rdx
jne 0x17c99
addq 0xc0(%rsp), %rcx
cmpq %rcx, %rax
ja 0x17c99
movq 0x48(%rsp), %rax
testq %rax, %rax
je 0x17c8d
movl 0x34(%rax), %eax
jmp 0x17c8f
xorl %eax, %eax
cmpl 0x54(%rsp), %eax
jbe 0x17d3b
movl (%rbx), %eax
movl %eax, 0xc8(%rsp)
movq %r14, 0xd0(%rsp)
movq 0x48(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
xorl %edx, %edx
callq 0x16bfb
testq %rax, %rax
je 0x17d2b
leaq 0x48(%rsp), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x1735e
decq (%rbp)
movq %rax, %r15
movq 0x10(%rbp), %rax
cmpq %rax, 0x8(%rbp)
jne 0x17d12
movq %rax, %rdx
shrq %rdx
addq %rax, %rdx
cmpq $0x4, %rax
movl $0x10, %eax
cmovbq %rax, %rdx
movq %rdx, 0x10(%rbp)
movq 0x18(%rbp), %rsi
movq 0x20(%rbp), %rdi
shlq $0x3, %rdx
callq 0x32c4
movq %rax, 0x18(%rbp)
movq 0x8(%rbp), %rax
movq 0x18(%rbp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%rbp)
movq %r15, (%rcx,%rax,8)
movq 0x18(%rsp), %r15
incq %r14
addq $0x10, %rbx
cmpq %r15, %r14
jl 0x17c59
cmpl $0x0, 0x14(%rsp)
setne %al
cmpq %r15, %r13
setl %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x17e42
movq %r13, %rbx
shlq $0x4, %rbx
addq 0x78(%rsp), %rbx
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq -0x8(%rbx), %rcx
movq %rcx, %rdx
xorq %rax, %rdx
shrq $0x20, %rdx
jne 0x17da0
addq 0xb8(%rsp), %rcx
cmpq %rcx, %rax
ja 0x17da0
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x17d94
movl 0x34(%rax), %eax
jmp 0x17d96
xorl %eax, %eax
cmpl 0x54(%rsp), %eax
jbe 0x17e42
movl (%rbx), %eax
movl %eax, 0xc8(%rsp)
movq %r13, 0xd0(%rsp)
movq 0x40(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
xorl %edx, %edx
callq 0x16bfb
testq %rax, %rax
je 0x17e32
leaq 0x40(%rsp), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x1735e
decq (%rbp)
movq %rax, %r15
movq 0x10(%rbp), %rax
cmpq %rax, 0x8(%rbp)
jne 0x17e19
movq %rax, %rdx
shrq %rdx
addq %rax, %rdx
cmpq $0x4, %rax
movl $0x10, %eax
cmovbq %rax, %rdx
movq %rdx, 0x10(%rbp)
movq 0x18(%rbp), %rsi
movq 0x20(%rbp), %rdi
shlq $0x3, %rdx
callq 0x32c4
movq %rax, 0x18(%rbp)
movq 0x8(%rbp), %rax
movq 0x18(%rbp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%rbp)
movq %r15, (%rcx,%rax,8)
movq 0x18(%rsp), %r15
incq %r13
addq $0x10, %rbx
cmpq %r15, %r13
jl 0x17d60
movq $0x7fffffff, 0x140(%rsp) # imm = 0x7FFFFFFF
movq 0x8(%rsp), %rax
movl 0x8(%rax), %r15d
movl %r15d, %ebx
subl 0x90(%rsp), %ebx
movl %ebx, 0x138(%rsp)
movq $0x0, 0x108(%rsp)
leal -0x1(%r15), %eax
movl %eax, 0x4(%rsp)
movl %eax, 0x100(%rsp)
movq 0x48(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
leaq 0x138(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0x16cfd
testq %rax, %rax
je 0x17f35
movl (%rax), %ecx
cmpl %ebx, %ecx
jl 0x184fc
cmpl %r15d, %ecx
jge 0x184fc
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
shlq $0x4, %rax
movq 0x3c0(%rsp), %rbx
movq 0x8(%rbx,%rax), %rdx
movl %r15d, %edi
subl %edx, %edi
movq 0x8(%rsp), %rcx
movl (%rcx), %r8d
subl (%rbx,%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, %edx
cmovll %r9d, %edx
setl %r10b
cmpl %r8d, %edi
jne 0x17f58
cmpl %r9d, %edi
jg 0x17f58
movl 0x10(%rsp), %r9d
movq 0x30(%rsp), %r11
movl %edx, %r8d
jmp 0x17ff1
movq $-0x1, %r8
movq 0x3c0(%rsp), %rbx
movl 0x10(%rsp), %r9d
movq 0x8(%rsp), %r10
movq 0x30(%rsp), %rdi
jmp 0x182e3
xorpd %xmm0, %xmm0
cmpl %r8d, %edi
movl 0x10(%rsp), %r9d
movq 0x30(%rsp), %r11
je 0x17fbd
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 0x1122f(%rip), %xmm0    # 0x291d4
addss 0x1122b(%rip), %xmm0    # 0x291d8
mulss %xmm2, %xmm0
addss 0x11223(%rip), %xmm0    # 0x291dc
addss %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
xorps %xmm2, %xmm2
cvtsi2ss %esi, %xmm2
mulss 0x50(%rsp), %xmm2
mulss 0x24(%rsp), %xmm1
addss %xmm2, %xmm1
mulss 0x111fd(%rip), %xmm0    # 0x291e0
addss %xmm1, %xmm0
cvttss2si %xmm0, %esi
movl %edx, %r8d
subl %esi, %r8d
orb %r10b, %al
movq 0x38(%rsp), %rdx
movq 0x28(%rsp), %rsi
addl (%rdx,%rsi,4), %r8d
cmpl 0x60(%rsp), %ecx
setle %cl
cmpl %r11d, %r8d
setg %dl
testb %dl, %cl
movq $-0x1, %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x28(%rsp)
cmovel %r11d, %r8d
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
setne %cl
testl %r15d, %r15d
setg %dl
andb %cl, %dl
andb %al, %dl
cmpb $0x1, %dl
movl %r8d, %r11d
jne 0x1829f
movl 0x4(%rsp), %r10d
movl %r10d, 0xc8(%rsp)
movq 0x3b8(%rsp), %rax
movq %rax, 0xd0(%rsp)
xorl %esi, %esi
movq %rdi, %rax
testq %rax, %rax
je 0x180bf
movl (%rax), %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl %r15d, %edx
jge 0x1809b
movl $0x1, %ecx
cmpl %edx, %r10d
jg 0x1809b
xorl %ecx, %ecx
xorl %edx, %edx
movq 0x3b8(%rsp), %r8
cmpq %r8, 0x8(%rax)
setl %cl
setg %dl
subl %edx, %ecx
testl %ecx, %ecx
js 0x180b0
movl $0x20, %ecx
movq %rax, %rsi
jne 0x180b5
xorl %ecx, %ecx
movq %rax, %rsi
jmp 0x180bb
movl $0x18, %ecx
movq (%rax,%rcx), %rax
movb $0x1, %cl
testb %cl, %cl
jne 0x18068
testq %rsi, %rsi
je 0x182a4
leaq 0x170(%rsp), %rbx
movq %rbx, %rdx
movl %r11d, %r15d
callq 0x1783f
movl %r15d, %r10d
movl $0x0, 0x4(%rsp)
xorl %r11d, %r11d
movq 0x370(%rsp), %rax
cmpq %rbx, %rax
jae 0x180fa
xorl %eax, %eax
jmp 0x180fd
movq (%rax), %rax
movq 0x8(%rsp), %rdx
testq %rax, %rax
movq 0x3c0(%rsp), %r9
je 0x182be
movl 0x8(%rdx), %esi
movl %esi, %ecx
subl 0x14(%rsp), %ecx
cmpl %ecx, (%rax)
jl 0x182be
movq 0x8(%rax), %rax
movq %rax, %rcx
shlq $0x4, %rcx
movq 0x8(%r9,%rcx), %r8
subl %r8d, %esi
movl (%rdx), %edi
subl (%r9,%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, %r15d
cmovll %r8d, %r15d
cmpl %edi, %esi
jne 0x18170
cmpl %r8d, %esi
jle 0x181fa
xorps %xmm0, %xmm0
cmpl %edi, %esi
je 0x181c9
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 0x11023(%rip), %xmm0    # 0x291d4
addss 0x1101f(%rip), %xmm0    # 0x291d8
mulss %xmm2, %xmm0
addss 0x11017(%rip), %xmm0    # 0x291dc
addss %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
xorps %xmm2, %xmm2
cvtsi2ss %edx, %xmm2
mulss 0x50(%rsp), %xmm2
mulss 0x24(%rsp), %xmm1
addss %xmm2, %xmm1
mulss 0x10ff1(%rip), %xmm0    # 0x291e0
addss %xmm1, %xmm0
cvttss2si %xmm0, %edx
subl %edx, %r15d
cmpl 0x60(%rsp), %ecx
movl %r11d, 0x30(%rsp)
jle 0x1820a
movl %r10d, %r15d
jmp 0x18278
movq 0x38(%rsp), %rcx
addl (%rcx,%rax,4), %r15d
cmpl %r10d, %r15d
jle 0x1822c
xorl %ecx, %ecx
movl 0x4(%rsp), %edx
testl %edx, %edx
setg %cl
subl %ecx, %edx
movq %rax, 0x28(%rsp)
jmp 0x18256
movq 0x70(%rsp), %rcx
movq 0x18(%rsp), %rdx
cmpl %edx, (%rcx,%rax,4)
jne 0x1824f
movl 0x4(%rsp), %edx
cmpl 0x8c(%rsp), %edx
jge 0x182bb
incl %edx
movl %r10d, %r15d
jmp 0x18256
movl %r10d, %r15d
movl 0x4(%rsp), %edx
movl %edx, 0x4(%rsp)
movq 0x80(%rsp), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
js 0x18278
movq 0x70(%rsp), %rcx
movq 0x18(%rsp), %rdx
movl %edx, (%rcx,%rax,4)
leaq 0x170(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x178b9
movl 0x30(%rsp), %r11d
incl %r11d
movl %r15d, %r10d
testl %eax, %eax
jne 0x180e9
jmp 0x182c1
movl %r11d, %edi
jmp 0x182af
movl %r11d, %edi
movq 0x3c0(%rsp), %rbx
movq 0x28(%rsp), %r8
movq 0x8(%rsp), %r10
jmp 0x182e3
incl %r11d
movl %r10d, %r15d
movslq %r11d, %rax
addq %rax, 0x68(%rsp)
movl 0x10(%rsp), %r9d
movq 0x8(%rsp), %r10
movq %r15, %rdi
movq 0x3c0(%rsp), %rbx
movq 0x28(%rsp), %r8
testq %r8, %r8
movq 0x58(%rsp), %rdx
movq 0x18(%rsp), %rsi
js 0x18316
movq %r8, %rax
shlq $0x4, %rax
movq (%rbx,%rax), %rcx
cmpq (%r10), %rcx
jae 0x184dd
addq %rbx, %rax
movl 0x8(%rax), %eax
cmpl 0x8(%r10), %eax
jge 0x184dd
movq 0x38(%rsp), %rax
movl %edi, (%rax,%rsi,4)
movq 0x80(%rsp), %rax
movq %r8, (%rax,%rsi,8)
testq %r8, %r8
js 0x18337
movl (%rdx,%r8,4), %eax
cmpl %edi, %eax
jg 0x18339
movl %edi, %eax
movl %eax, (%rdx,%rsi,4)
movl 0x94(%rsp), %eax
cmpl %edi, %eax
cmovgl %eax, %edi
movq 0xa8(%rsp), %rcx
testq %rcx, %rcx
je 0x1835a
movl 0x34(%rcx), %eax
jmp 0x1835c
xorl %eax, %eax
cmpl %eax, %r9d
movl $0x0, %r15d
cmovael %r9d, %r15d
testq %rcx, %rcx
je 0x18377
cmpl %eax, %r9d
jae 0x18377
movl 0x34(%rcx), %r15d
movq 0x18(%rsp), %rcx
incq %rcx
movl %r15d, %edx
cmpq 0x3b8(%rsp), %rcx
jne 0x17aeb
jmp 0x1839d
movq $0x0, 0x68(%rsp)
xorl %edi, %edi
movl 0x3b0(%rsp), %ebx
leaq 0x1a2cd(%rip), %rax     # 0x32678
testb $-0x80, (%rax)
jne 0x184b1
movq 0x98(%rsp), %rdi
callq 0x30b8
leaq 0xc8(%rsp), %rax
leaq 0x170(%rsp), %rbp
movq 0x3d8(%rsp), %r15
movq %r15, %rdi
movq 0x3b8(%rsp), %rsi
movq 0x38(%rsp), %r14
movq %r14, %rdx
movq 0x80(%rsp), %r13
movq %r13, %rcx
movq 0x58(%rsp), %r8
movq 0x70(%rsp), %r12
movq %r12, %r9
pushq %rax
pushq %rbp
pushq $0x0
pushq 0x78(%rsp)
pushq %rbx
pushq 0xc8(%rsp)
callq 0x15cbc
addq $0x30, %rsp
movq %rax, %rbx
movl (%rbp), %ebp
movq 0x3c8(%rsp), %rax
movl %ebp, (%rax)
movq 0x3d0(%rsp), %rax
movq %rbx, (%rax)
movq %r15, %rdi
movq %r13, %rsi
callq 0x30f6
movq %r15, %rdi
movq %r14, %rsi
callq 0x30f6
movq %r15, %rdi
movq %r12, %rsi
callq 0x30f6
testl %ebp, %ebp
je 0x18480
movl 0xc8(%rsp), %ecx
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movq 0x58(%rsp), %r8
movq 0x3c0(%rsp), %r9
callq 0x169fb
jmp 0x1849f
movq %r15, %rdi
movq 0x3c0(%rsp), %rsi
callq 0x30f6
movq %r15, %rdi
movq 0x58(%rsp), %rsi
callq 0x30f6
xorl %eax, %eax
addq $0x378, %rsp            # imm = 0x378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rcx
movq 0x19b3d(%rip), %rax     # 0x31ff8
movq (%rax), %rdi
movq 0x10(%rbp), %r9
leaq 0x10eea(%rip), %rsi     # 0x293b3
movq 0x68(%rsp), %rdx
movl %r15d, %r8d
xorl %eax, %eax
callq 0x2210
jmp 0x183b4
leaq 0x10e83(%rip), %rdi     # 0x29367
leaq 0x10d25(%rip), %rsi     # 0x29210
leaq 0x10dfd(%rip), %rcx     # 0x292ef
movl $0x163, %edx            # imm = 0x163
callq 0x2160
leaq 0x10dcf(%rip), %rdi     # 0x292d2
leaq 0x10d06(%rip), %rsi     # 0x29210
leaq 0x10dde(%rip), %rcx     # 0x292ef
movl $0x141, %edx            # imm = 0x141
callq 0x2160