// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x420, %rsp            # imm = 0x420
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movl %edi, -0x1c(%rbp)
movl %esi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
movl %ecx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl %r9d, -0x30(%rbp)
movss %xmm0, -0x34(%rbp)
movss %xmm1, -0x38(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x64(%rbp)
movq $0x0, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movq $0x0, -0xa0(%rbp)
movq $0x0, -0xa8(%rbp)
movq $0x0, -0xb0(%rbp)
cmpq $0x0, 0x30(%rbp)
je 0x215ca
movq 0x30(%rbp), %rax
movq $0x0, (%rax)
movq 0x28(%rbp), %rax
movl $0x0, (%rax)
cmpq $0x0, 0x18(%rbp)
je 0x215d8
cmpq $0x0, 0x20(%rbp)
jne 0x215f2
movq 0x38(%rbp), %rdi
movq 0x20(%rbp), %rsi
callq 0x1a8c0
movq $0x0, -0x18(%rbp)
jmp 0x221c0
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x21600
movl -0x24(%rbp), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x20(%rbp)
jge 0x2160d
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jle 0x2161b
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
movq 0x38(%rbp), %rdi
movq 0x18(%rbp), %rsi
shlq $0x3, %rsi
callq 0x1aae0
movq %rax, -0x70(%rbp)
movq 0x38(%rbp), %rdi
movq 0x18(%rbp), %rsi
shlq $0x2, %rsi
callq 0x1aae0
movq %rax, -0x40(%rbp)
movq 0x38(%rbp), %rdi
movq 0x18(%rbp), %rsi
movl $0x4, %edx
callq 0x1a790
movq %rax, -0x48(%rbp)
movq 0x38(%rbp), %rdi
movq 0x18(%rbp), %rsi
shlq $0x2, %rsi
callq 0x1aae0
movq %rax, -0x50(%rbp)
movq 0x38(%rbp), %rdi
movl $0x10000, %esi          # imm = 0x10000
callq 0x1a6f0
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x221d0
movq %rax, -0xb8(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq 0x18(%rbp), %rax
jge 0x220dc
movq $-0x1, -0xc0(%rbp)
movq 0x20(%rbp), %rax
movq -0x78(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
movl %eax, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
movl %eax, -0xc8(%rbp)
movq -0x80(%rbp), %rax
cmpq -0x78(%rbp), %rax
jge 0x2188b
movq 0x20(%rbp), %rax
movq -0x80(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq 0x20(%rbp), %rcx
movq -0x78(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
je 0x2188b
movq -0x80(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rax
cmpq -0x78(%rbp), %rax
jge 0x21883
movq -0xb8(%rbp), %rdi
callq 0x22210
movq %rax, -0x108(%rbp)
movq 0x20(%rbp), %rax
movq -0x188(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl %eax, %ecx
movq -0x108(%rbp), %rax
movl %ecx, (%rax)
movq -0x188(%rbp), %rcx
movq -0x108(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq -0x188(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
movss -0x34(%rbp), %xmm0
cvtss2sd %xmm0, %xmm2
movsd 0x3554d(%rip), %xmm0    # 0x56cf8
mulsd %xmm2, %xmm0
movq 0x20(%rbp), %rax
movq -0x188(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq 0x20(%rbp), %rcx
movq -0x188(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
addl %ecx, %eax
cvtsi2sd %eax, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x108(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movq -0x108(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x20180
cmpl $0x0, -0x20(%rbp)
jle 0x2186a
movq -0xb8(%rbp), %rdi
callq 0x22210
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rdi
movq -0x108(%rbp), %rsi
movl $0x38, %edx
callq 0x2290
movq -0x110(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x20180
jmp 0x2186c
movq -0x188(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x188(%rbp)
jmp 0x21733
movq -0x78(%rbp), %rax
movq %rax, -0x80(%rbp)
jmp 0x2188d
movq -0x88(%rbp), %rcx
xorl %eax, %eax
cmpq -0x78(%rbp), %rcx
movb %al, -0x3c9(%rbp)
jge 0x21961
movq 0x20(%rbp), %rax
movq -0x78(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
shrq $0x20, %rcx
movq 0x20(%rbp), %rax
movq -0x88(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rax), %rdx
shrq $0x20, %rdx
movb $0x1, %al
cmpq %rdx, %rcx
movb %al, -0x3ca(%rbp)
jne 0x21955
movq 0x20(%rbp), %rax
movq -0x78(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq 0x20(%rbp), %rax
movq -0x88(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rax), %rdx
movslq -0x1c(%rbp), %rax
addq %rax, %rdx
movb $0x1, %al
cmpq %rdx, %rcx
movb %al, -0x3ca(%rbp)
ja 0x21955
cmpq $0x0, -0xa0(%rbp)
je 0x21939
movq -0xa0(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x3d0(%rbp)
jmp 0x21943
xorl %eax, %eax
movl %eax, -0x3d0(%rbp)
jmp 0x21943
movl -0x3d0(%rbp), %eax
cmpl -0x2c(%rbp), %eax
seta %al
movb %al, -0x3ca(%rbp)
movb -0x3ca(%rbp), %al
movb %al, -0x3c9(%rbp)
movb -0x3c9(%rbp), %al
testb $0x1, %al
jne 0x21970
jmp 0x21a06
movq 0x20(%rbp), %rax
movq -0x88(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl %eax, -0x100(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xa0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x1fa20
movq %rax, -0x108(%rbp)
cmpq $0x0, %rax
je 0x219ef
movq -0x108(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x20a80
movq %rax, -0x108(%rbp)
movq -0xb8(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x22280
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x2188d
cmpl $0x0, -0x20(%rbp)
jle 0x21b8d
jmp 0x21a12
movq -0x90(%rbp), %rcx
xorl %eax, %eax
cmpq -0x78(%rbp), %rcx
movb %al, -0x3d1(%rbp)
jge 0x21ae6
movq 0x20(%rbp), %rax
movq -0x78(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
shrq $0x20, %rcx
movq 0x20(%rbp), %rax
movq -0x90(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rax), %rdx
shrq $0x20, %rdx
movb $0x1, %al
cmpq %rdx, %rcx
movb %al, -0x3d2(%rbp)
jne 0x21ada
movq 0x20(%rbp), %rax
movq -0x78(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq 0x20(%rbp), %rax
movq -0x90(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rax), %rdx
movslq -0x20(%rbp), %rax
addq %rax, %rdx
movb $0x1, %al
cmpq %rdx, %rcx
movb %al, -0x3d2(%rbp)
ja 0x21ada
cmpq $0x0, -0xa8(%rbp)
je 0x21abe
movq -0xa8(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x3d8(%rbp)
jmp 0x21ac8
xorl %eax, %eax
movl %eax, -0x3d8(%rbp)
jmp 0x21ac8
movl -0x3d8(%rbp), %eax
cmpl -0x2c(%rbp), %eax
seta %al
movb %al, -0x3d2(%rbp)
movb -0x3d2(%rbp), %al
movb %al, -0x3d1(%rbp)
movb -0x3d1(%rbp), %al
testb $0x1, %al
jne 0x21af5
jmp 0x21b8b
movq 0x20(%rbp), %rax
movq -0x90(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl %eax, -0x100(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xa8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x1fa20
movq %rax, -0x108(%rbp)
cmpq $0x0, %rax
je 0x21b74
movq -0x108(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x20a80
movq %rax, -0x108(%rbp)
movq -0xb8(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x22280
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x21a12
jmp 0x21b8d
movq $0x7fffffff, -0x140(%rbp) # imm = 0x7FFFFFFF
movq 0x20(%rbp), %rax
movq -0x78(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
subl -0x1c(%rbp), %eax
movl %eax, -0x148(%rbp)
movq $0x0, -0x178(%rbp)
movq 0x20(%rbp), %rax
movq -0x78(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl %eax, -0x180(%rbp)
movq -0xa0(%rbp), %rdi
leaq -0x148(%rbp), %rsi
leaq -0x180(%rbp), %rdx
callq 0x1fc60
movq %rax, -0x108(%rbp)
cmpq $0x0, %rax
je 0x21f4f
movl $0x0, -0x198(%rbp)
movq -0x108(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x1a0(%rbp)
movq -0x108(%rbp), %rax
movl (%rax), %eax
cmpl -0x148(%rbp), %eax
jl 0x21c43
movq -0x108(%rbp), %rax
movl (%rax), %eax
cmpl -0x180(%rbp), %eax
jg 0x21c43
jmp 0x21c62
leaq 0x3644e(%rip), %rdi     # 0x58098
leaq 0x363a7(%rip), %rsi     # 0x57ff8
movl $0x140, %edx            # imm = 0x140
leaq 0x36458(%rip), %rcx     # 0x580b5
callq 0x21a0
movq -0x40(%rbp), %rax
movq -0x1a0(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3dc(%rbp)
movq 0x20(%rbp), %rdi
movq -0x78(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq 0x20(%rbp), %rsi
movq -0x1a0(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movss -0x34(%rbp), %xmm0
movss -0x38(%rbp), %xmm1
leaq -0x190(%rbp), %rdx
leaq -0x194(%rbp), %rcx
callq 0x22350
movl %eax, %ecx
movl -0x3dc(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x18c(%rbp)
movl -0x194(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x21cf7
movl -0x18c(%rbp), %eax
cmpl -0xc8(%rbp), %eax
jle 0x21cf7
movl -0x18c(%rbp), %eax
movl %eax, -0xc8(%rbp)
movq -0x1a0(%rbp), %rax
movq %rax, -0xc0(%rbp)
cmpl $0x0, -0x190(%rbp)
jne 0x21f4d
cmpq $0x0, -0xa8(%rbp)
je 0x21f4d
movq 0x20(%rbp), %rax
movq -0x78(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
cmpl $0x0, %eax
jle 0x21f4d
movq 0x20(%rbp), %rax
movq -0x78(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
subl $0x1, %eax
movl %eax, -0x100(%rbp)
movq 0x18(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xa8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x1a8(%rbp), %rdx
leaq -0x1b0(%rbp), %rcx
callq 0x1fb40
cmpq $0x0, -0x1a8(%rbp)
je 0x21f4b
movq -0xa8(%rbp), %rdi
movq -0x1a8(%rbp), %rsi
leaq -0x3c8(%rbp), %rdx
callq 0x212d0
movq -0x1c8(%rbp), %rax
leaq -0x3c8(%rbp), %rcx
cmpq %rcx, %rax
jae 0x21dbc
xorl %eax, %eax
movq %rax, -0x3e8(%rbp)
jmp 0x21dcd
movq -0x1c8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x3e8(%rbp)
movq -0x3e8(%rbp), %rax
movq %rax, -0x1b8(%rbp)
cmpq $0x0, %rax
je 0x21f49
movq -0x1b8(%rbp), %rax
movl (%rax), %eax
movq 0x20(%rbp), %rcx
movq -0x78(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
subl -0x20(%rbp), %ecx
cmpl %ecx, %eax
jge 0x21e0d
jmp 0x21f49
movq -0x1b8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x1a0(%rbp)
movq -0x40(%rbp), %rax
movq -0x1a0(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3ec(%rbp)
movq 0x20(%rbp), %rdi
movq -0x78(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq 0x20(%rbp), %rsi
movq -0x1a0(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movss -0x34(%rbp), %xmm0
movss -0x38(%rbp), %xmm1
xorl %eax, %eax
movl %eax, %edx
leaq -0x1bc(%rbp), %rcx
callq 0x22350
movl %eax, %ecx
movl -0x3ec(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x18c(%rbp)
movl -0x1bc(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x21f2f
movl -0x18c(%rbp), %eax
cmpl -0xc8(%rbp), %eax
jle 0x21ecf
movl -0x18c(%rbp), %eax
movl %eax, -0xc8(%rbp)
movq -0x1a0(%rbp), %rax
movq %rax, -0xc0(%rbp)
cmpl $0x0, -0x198(%rbp)
jle 0x21ecd
movl -0x198(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x198(%rbp)
jmp 0x21eff
movq -0x48(%rbp), %rax
movq -0x1a0(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x78(%rbp), %rcx
cmpl %ecx, %eax
jne 0x21efd
movl -0x198(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x198(%rbp)
cmpl -0x28(%rbp), %eax
jle 0x21efb
jmp 0x21f49
jmp 0x21efd
jmp 0x21eff
movq -0x70(%rbp), %rax
movq -0x1a0(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jl 0x21f2d
movq -0x78(%rbp), %rax
movl %eax, %edx
movq -0x48(%rbp), %rax
movq -0x70(%rbp), %rcx
movq -0x1a0(%rbp), %rsi
movq (%rcx,%rsi,8), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x21f2f
leaq -0x3c8(%rbp), %rdi
xorl %esi, %esi
callq 0x213e0
cmpl $0x0, %eax
jne 0x21f44
jmp 0x21f49
jmp 0x21d9e
jmp 0x21f4b
jmp 0x21f4d
jmp 0x21f4f
cmpq $0x0, -0xc0(%rbp)
jl 0x21faf
movq 0x20(%rbp), %rax
movq -0xc0(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq 0x20(%rbp), %rcx
movq -0x78(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x21fb1
movq 0x20(%rbp), %rax
movq -0xc0(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq 0x20(%rbp), %rcx
movq -0x78(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
cmpl %ecx, %eax
jge 0x21fb1
jmp 0x21fd0
leaq 0x36175(%rip), %rdi     # 0x5812d
leaq 0x36039(%rip), %rsi     # 0x57ff8
movl $0x160, %edx            # imm = 0x160
leaq 0x360ea(%rip), %rcx     # 0x580b5
callq 0x21a0
movl -0xc8(%rbp), %edx
movq -0x40(%rbp), %rax
movq -0x78(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0xc0(%rbp), %rdx
movq -0x70(%rbp), %rax
movq -0x78(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
cmpq $0x0, -0xc0(%rbp)
jl 0x2202a
movq -0x50(%rbp), %rax
movq -0xc0(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0xc8(%rbp), %eax
jle 0x2202a
movq -0x50(%rbp), %rax
movq -0xc0(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3f0(%rbp)
jmp 0x22036
movl -0xc8(%rbp), %eax
movl %eax, -0x3f0(%rbp)
movl -0x3f0(%rbp), %edx
movq -0x50(%rbp), %rax
movq -0x78(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x5c(%rbp), %eax
cmpl -0xc8(%rbp), %eax
jge 0x2205b
movl -0xc8(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x3f4(%rbp)
cmpq $0x0, -0xa0(%rbp)
je 0x22080
movq -0xa0(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x3f8(%rbp)
jmp 0x2208a
xorl %eax, %eax
movl %eax, -0x3f8(%rbp)
jmp 0x2208a
movl -0x3f4(%rbp), %eax
movl -0x3f8(%rbp), %ecx
cmpl %ecx, %eax
jae 0x220c9
cmpq $0x0, -0xa0(%rbp)
je 0x220b6
movq -0xa0(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x3fc(%rbp)
jmp 0x220c0
xorl %eax, %eax
movl %eax, -0x3fc(%rbp)
jmp 0x220c0
movl -0x3fc(%rbp), %eax
movl %eax, -0x60(%rbp)
jmp 0x220cb
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x216a8
movq -0xb0(%rbp), %rdi
callq 0x1a840
movq 0x38(%rbp), %rdi
movq 0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x70(%rbp), %rcx
movq -0x50(%rbp), %r8
movq -0x48(%rbp), %r9
movl -0x30(%rbp), %r14d
movl 0x10(%rbp), %ebx
movl -0x64(%rbp), %r11d
leaq -0x54(%rbp), %r10
leaq -0x58(%rbp), %rax
movl %r14d, (%rsp)
movl %ebx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x1e730
movq %rax, -0x98(%rbp)
movl -0x54(%rbp), %ecx
movq 0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x98(%rbp), %rcx
movq 0x30(%rbp), %rax
movq %rcx, (%rax)
movq 0x38(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x1a8c0
movq 0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1a8c0
movq 0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x1a8c0
cmpl $0x0, -0x54(%rbp)
jne 0x2219e
movq 0x38(%rbp), %rdi
movq 0x20(%rbp), %rsi
callq 0x1a8c0
movq 0x38(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x1a8c0
movq $0x0, -0x18(%rbp)
jmp 0x221c0
movq 0x38(%rbp), %rdi
movl -0x54(%rbp), %esi
movq -0x98(%rbp), %rdx
movl -0x58(%rbp), %ecx
movq -0x50(%rbp), %r8
movq 0x20(%rbp), %r9
callq 0x1f740
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x420, %rsp            # imm = 0x420
popq %rbx
popq %r14
popq %rbp
retq