// File: /workspace/github_c_makefile_star2_O1/nh13[P]ksw/src/ksw2/ksw2_extz2_sse.c
// Function: ksw_extz2_sse
void ksw_extz2_sse(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t *target, int8_t m, const int8_t *mat, int8_t q, int8_t e, int w, int zdrop, int flag, ksw_extz_t *ez)
#endif // ~KSW_CPU_DISPATCH
{
#define __dp_code_block1 \
	z = _mm_add_epi8(_mm_load_si128(&s[t]), qe2_); \
	xt1 = _mm_load_si128(&x[t]);                     /* xt1 <- x[r-1][t..t+15] */ \
	tmp = _mm_srli_si128(xt1, 15);                   /* tmp <- x[r-1][t+15] */ \
	xt1 = _mm_or_si128(_mm_slli_si128(xt1, 1), x1_); /* xt1 <- x[r-1][t-1..t+14] */ \
	x1_ = tmp; \
	vt1 = _mm_load_si128(&v[t]);                     /* vt1 <- v[r-1][t..t+15] */ \
	tmp = _mm_srli_si128(vt1, 15);                   /* tmp <- v[r-1][t+15] */ \
	vt1 = _mm_or_si128(_mm_slli_si128(vt1, 1), v1_); /* vt1 <- v[r-1][t-1..t+14] */ \
	v1_ = tmp; \
	a = _mm_add_epi8(xt1, vt1);                      /* a <- x[r-1][t-1..t+14] + v[r-1][t-1..t+14] */ \
	ut = _mm_load_si128(&u[t]);                      /* ut <- u[t..t+15] */ \
	b = _mm_add_epi8(_mm_load_si128(&y[t]), ut);     /* b <- y[r-1][t..t+15] + u[r-1][t..t+15] */

#define __dp_code_block2 \
	z = _mm_max_epu8(z, b);                          /* z = max(z, b); this works because both are non-negative */ \
	z = _mm_min_epu8(z, max_sc_); \
	_mm_store_si128(&u[t], _mm_sub_epi8(z, vt1));    /* u[r][t..t+15] <- z - v[r-1][t-1..t+14] */ \
	_mm_store_si128(&v[t], _mm_sub_epi8(z, ut));     /* v[r][t..t+15] <- z - u[r-1][t..t+15] */ \
	z = _mm_sub_epi8(z, q_); \
	a = _mm_sub_epi8(a, z); \
	b = _mm_sub_epi8(b, z);

	int r, t, qe = q + e, n_col_, *off = 0, *off_end = 0, tlen_, qlen_, last_st, last_en, wl, wr, max_sc, min_sc;
	int with_cigar = !(flag&KSW_EZ_SCORE_ONLY), approx_max = !!(flag&KSW_EZ_APPROX_MAX);
	int32_t *H = 0, H0 = 0, last_H0_t = 0;
	uint8_t *qr, *sf, *mem, *mem2 = 0;
	__m128i q_, qe2_, zero_, flag1_, flag2_, flag8_, flag16_, sc_mch_, sc_mis_, m1_, max_sc_;
	__m128i *u, *v, *x, *y, *s, *p = 0;

	ksw_reset_extz(ez);
	if (m <= 0 || qlen <= 0 || tlen <= 0) return;

	zero_   = _mm_set1_epi8(0);
	q_      = _mm_set1_epi8(q);
	qe2_    = _mm_set1_epi8((q + e) * 2);
	flag1_  = _mm_set1_epi8(1);
	flag2_  = _mm_set1_epi8(2);
	flag8_  = _mm_set1_epi8(0x08);
	flag16_ = _mm_set1_epi8(0x10);
	sc_mch_ = _mm_set1_epi8(mat[0]);
	sc_mis_ = _mm_set1_epi8(mat[1]);
	m1_     = _mm_set1_epi8(m - 1); // wildcard
	max_sc_ = _mm_set1_epi8(mat[0] + (q + e) * 2);

	if (w < 0) w = tlen > qlen? tlen : qlen;
	wl = wr = w;
	tlen_ = (tlen + 15) / 16;
	n_col_ = qlen < tlen? qlen : tlen;
	n_col_ = ((n_col_ < w + 1? n_col_ : w + 1) + 15) / 16 + 1;
	qlen_ = (qlen + 15) / 16;
	for (t = 1, max_sc = mat[0], min_sc = mat[1]; t < m * m; ++t) {
		max_sc = max_sc > mat[t]? max_sc : mat[t];
		min_sc = min_sc < mat[t]? min_sc : mat[t];
	}
	if (-min_sc > 2 * (q + e)) return; // otherwise, we won't see any mismatches

	mem = (uint8_t*)kcalloc(km, tlen_ * 6 + qlen_ + 1, 16);
	u = (__m128i*)(((size_t)mem + 15) >> 4 << 4); // 16-byte aligned
	v = u + tlen_, x = v + tlen_, y = x + tlen_, s = y + tlen_, sf = (uint8_t*)(s + tlen_), qr = sf + tlen_ * 16;
	if (!approx_max) {
		H = (int32_t*)kmalloc(km, tlen_ * 16 * 4);
		for (t = 0; t < tlen_ * 16; ++t) H[t] = KSW_NEG_INF;
	}
	if (with_cigar) {
		mem2 = (uint8_t*)kmalloc(km, ((qlen + tlen - 1) * n_col_ + 1) * 16);
		p = (__m128i*)(((size_t)mem2 + 15) >> 4 << 4);
		off = (int*)kmalloc(km, (qlen + tlen - 1) * sizeof(int) * 2);
		off_end = off + qlen + tlen - 1;
	}

	for (t = 0; t < qlen; ++t) qr[t] = query[qlen - 1 - t];
	memcpy(sf, target, tlen);

	for (r = 0, last_st = last_en = -1; r < qlen + tlen - 1; ++r) {
		int st = 0, en = tlen - 1, st0, en0, st_, en_;
		int8_t x1, v1;
		uint8_t *qrr = qr + (qlen - 1 - r), *u8 = (uint8_t*)u, *v8 = (uint8_t*)v;
		__m128i x1_, v1_;
		// find the boundaries
		if (st < r - qlen + 1) st = r - qlen + 1;
		if (en > r) en = r;
		if (st < (r-wr+1)>>1) st = (r-wr+1)>>1; // take the ceil
		if (en > (r+wl)>>1) en = (r+wl)>>1; // take the floor
		if (st > en) {
			ez->zdropped = 1;
			break;
		}
		st0 = st, en0 = en;
		st = st / 16 * 16, en = (en + 16) / 16 * 16 - 1;
		// set boundary conditions
		if (st > 0) {
			if (st - 1 >= last_st && st - 1 <= last_en)
				x1 = ((uint8_t*)x)[st - 1], v1 = v8[st - 1]; // (r-1,s-1) calculated in the last round
			else x1 = v1 = 0; // not calculated; set to zeros
		} else x1 = 0, v1 = r? q : 0;
		if (en >= r) ((uint8_t*)y)[r] = 0, u8[r] = r? q : 0;
		// loop fission: set scores first
		if (!(flag & KSW_EZ_GENERIC_SC)) {
			for (t = st0; t <= en0; t += 16) {
				__m128i sq, st, tmp, mask;
				sq = _mm_loadu_si128((__m128i*)&sf[t]);
				st = _mm_loadu_si128((__m128i*)&qrr[t]);
				mask = _mm_or_si128(_mm_cmpeq_epi8(sq, m1_), _mm_cmpeq_epi8(st, m1_));
				tmp = _mm_cmpeq_epi8(sq, st);
#ifdef __SSE4_1__
				tmp = _mm_blendv_epi8(sc_mis_, sc_mch_, tmp);
#else
				tmp = _mm_or_si128(_mm_andnot_si128(tmp, sc_mis_), _mm_and_si128(tmp, sc_mch_));
#endif
				tmp = _mm_andnot_si128(mask, tmp);
				_mm_storeu_si128((__m128i*)((uint8_t*)s + t), tmp);
			}
		} else {
			for (t = st0; t <= en0; ++t)
				((uint8_t*)s)[t] = mat[sf[t] * m + qrr[t]];
		}
		// core loop
		x1_ = _mm_cvtsi32_si128(x1);
		v1_ = _mm_cvtsi32_si128(v1);
		st_ = st / 16, en_ = en / 16;
		assert(en_ - st_ + 1 <= n_col_);
		if (!with_cigar) { // score only
			for (t = st_; t <= en_; ++t) {
				__m128i z, a, b, xt1, vt1, ut, tmp;
				__dp_code_block1;
#ifdef __SSE4_1__
				z = _mm_max_epi8(z, a);                          // z = z > a? z : a (signed)
#else // we need to emulate SSE4.1 intrinsics _mm_max_epi8()
				z = _mm_and_si128(z, _mm_cmpgt_epi8(z, zero_));  // z = z > 0? z : 0;
				z = _mm_max_epu8(z, a);                          // z = max(z, a); this works because both are non-negative
#endif
				__dp_code_block2;
#ifdef __SSE4_1__
				_mm_store_si128(&x[t], _mm_max_epi8(a, zero_));
				_mm_store_si128(&y[t], _mm_max_epi8(b, zero_));
#else
				tmp = _mm_cmpgt_epi8(a, zero_);
				_mm_store_si128(&x[t], _mm_and_si128(a, tmp));
				tmp = _mm_cmpgt_epi8(b, zero_);
				_mm_store_si128(&y[t], _mm_and_si128(b, tmp));
#endif
			}
		} else if (!(flag&KSW_EZ_RIGHT)) { // gap left-alignment
			__m128i *pr = p + r * n_col_ - st_;
			off[r] = st, off_end[r] = en;
			for (t = st_; t <= en_; ++t) {
				__m128i d, z, a, b, xt1, vt1, ut, tmp;
				__dp_code_block1;
				d = _mm_and_si128(_mm_cmpgt_epi8(a, z), flag1_); // d = a > z? 1 : 0
#ifdef __SSE4_1__
				z = _mm_max_epi8(z, a);                          // z = z > a? z : a (signed)
				tmp = _mm_cmpgt_epi8(b, z);
				d = _mm_blendv_epi8(d, flag2_, tmp);             // d = b > z? 2 : d
#else // we need to emulate SSE4.1 intrinsics _mm_max_epi8() and _mm_blendv_epi8()
				z = _mm_and_si128(z, _mm_cmpgt_epi8(z, zero_));  // z = z > 0? z : 0;
				z = _mm_max_epu8(z, a);                          // z = max(z, a); this works because both are non-negative
				tmp = _mm_cmpgt_epi8(b, z);
				d = _mm_or_si128(_mm_andnot_si128(tmp, d), _mm_and_si128(tmp, flag2_)); // d = b > z? 2 : d; emulating blendv
#endif
				__dp_code_block2;
				tmp = _mm_cmpgt_epi8(a, zero_);
				_mm_store_si128(&x[t], _mm_and_si128(tmp, a));
				d = _mm_or_si128(d, _mm_and_si128(tmp, flag8_));  // d = a > 0? 0x08 : 0
				tmp = _mm_cmpgt_epi8(b, zero_);
				_mm_store_si128(&y[t], _mm_and_si128(tmp, b));
				d = _mm_or_si128(d, _mm_and_si128(tmp, flag16_)); // d = b > 0? 0x10 : 0
				_mm_store_si128(&pr[t], d);
			}
		} else { // gap right-alignment
			__m128i *pr = p + r * n_col_ - st_;
			off[r] = st, off_end[r] = en;
			for (t = st_; t <= en_; ++t) {
				__m128i d, z, a, b, xt1, vt1, ut, tmp;
				__dp_code_block1;
				d = _mm_andnot_si128(_mm_cmpgt_epi8(z, a), flag1_); // d = z > a? 0 : 1
#ifdef __SSE4_1__
				z = _mm_max_epi8(z, a);                          // z = z > a? z : a (signed)
				tmp = _mm_cmpgt_epi8(z, b);
				d = _mm_blendv_epi8(flag2_, d, tmp);             // d = z > b? d : 2
#else // we need to emulate SSE4.1 intrinsics _mm_max_epi8() and _mm_blendv_epi8()
				z = _mm_and_si128(z, _mm_cmpgt_epi8(z, zero_));  // z = z > 0? z : 0;
				z = _mm_max_epu8(z, a);                          // z = max(z, a); this works because both are non-negative
				tmp = _mm_cmpgt_epi8(z, b);
				d = _mm_or_si128(_mm_andnot_si128(tmp, flag2_), _mm_and_si128(tmp, d)); // d = z > b? d : 2; emulating blendv
#endif
				__dp_code_block2;
				tmp = _mm_cmpgt_epi8(zero_, a);
				_mm_store_si128(&x[t], _mm_andnot_si128(tmp, a));
				d = _mm_or_si128(d, _mm_andnot_si128(tmp, flag8_));  // d = 0 > a? 0 : 0x08
				tmp = _mm_cmpgt_epi8(zero_, b);
				_mm_store_si128(&y[t], _mm_andnot_si128(tmp, b));
				d = _mm_or_si128(d, _mm_andnot_si128(tmp, flag16_)); // d = 0 > b? 0 : 0x10
				_mm_store_si128(&pr[t], d);
			}
		}
		if (!approx_max) { // find the exact max with a 32-bit score array
			int32_t max_H, max_t;
			// compute H[], max_H and max_t
			if (r > 0) {
				int32_t HH[4], tt[4], en1 = st0 + (en0 - st0) / 4 * 4, i;
				__m128i max_H_, max_t_, qe_;
				max_H = H[en0] = en0 > 0? H[en0-1] + u8[en0] - qe : H[en0] + v8[en0] - qe; // special casing the last element
				max_t = en0;
				max_H_ = _mm_set1_epi32(max_H);
				max_t_ = _mm_set1_epi32(max_t);
				qe_    = _mm_set1_epi32(q + e);
				for (t = st0; t < en1; t += 4) { // this implements: H[t]+=v8[t]-qe; if(H[t]>max_H) max_H=H[t],max_t=t;
					__m128i H1, tmp, t_;
					H1 = _mm_loadu_si128((__m128i*)&H[t]);
					t_ = _mm_setr_epi32(v8[t], v8[t+1], v8[t+2], v8[t+3]);
					H1 = _mm_add_epi32(H1, t_);
					H1 = _mm_sub_epi32(H1, qe_);
					_mm_storeu_si128((__m128i*)&H[t], H1);
					t_ = _mm_set1_epi32(t);
					tmp = _mm_cmpgt_epi32(H1, max_H_);
#ifdef __SSE4_1__
					max_H_ = _mm_blendv_epi8(max_H_, H1, tmp);
					max_t_ = _mm_blendv_epi8(max_t_, t_, tmp);
#else
					max_H_ = _mm_or_si128(_mm_and_si128(tmp, H1), _mm_andnot_si128(tmp, max_H_));
					max_t_ = _mm_or_si128(_mm_and_si128(tmp, t_), _mm_andnot_si128(tmp, max_t_));
#endif
				}
				_mm_storeu_si128((__m128i*)HH, max_H_);
				_mm_storeu_si128((__m128i*)tt, max_t_);
				for (i = 0; i < 4; ++i)
					if (max_H < HH[i]) max_H = HH[i], max_t = tt[i] + i;
				for (; t < en0; ++t) { // for the rest of values that haven't been computed with SSE
					H[t] += (int32_t)v8[t] - qe;
					if (H[t] > max_H)
						max_H = H[t], max_t = t;
				}
			} else H[0] = v8[0] - qe - qe, max_H = H[0], max_t = 0; // special casing r==0
			// update ez
			if (en0 == tlen - 1 && H[en0] > ez->mte)
				ez->mte = H[en0], ez->mte_q = r - en;
			if (r - st0 == qlen - 1 && H[st0] > ez->mqe)
				ez->mqe = H[st0], ez->mqe_t = st0;
			if (ksw_apply_zdrop(ez, 1, max_H, r, max_t, zdrop, e)) break;
			if (r == qlen + tlen - 2 && en0 == tlen - 1)
				ez->score = H[tlen - 1];
		} else { // find approximate max; Z-drop might be inaccurate, too.
			if (r > 0) {
				if (last_H0_t >= st0 && last_H0_t <= en0 && last_H0_t + 1 >= st0 && last_H0_t + 1 <= en0) {
					int32_t d0 = v8[last_H0_t] - qe;
					int32_t d1 = u8[last_H0_t + 1] - qe;
					if (d0 > d1) H0 += d0;
					else H0 += d1, ++last_H0_t;
				} else if (last_H0_t >= st0 && last_H0_t <= en0) {
					H0 += v8[last_H0_t] - qe;
				} else {
					++last_H0_t, H0 += u8[last_H0_t] - qe;
				}
				if ((flag & KSW_EZ_APPROX_DROP) && ksw_apply_zdrop(ez, 1, H0, r, last_H0_t, zdrop, e)) break;
			} else H0 = v8[0] - qe - qe, last_H0_t = 0;
			if (r == qlen + tlen - 2 && en0 == tlen - 1)
				ez->score = H0;
		}
		last_st = st, last_en = en;
		//for (t = st0; t <= en0; ++t) printf("(%d,%d)\t(%d,%d,%d,%d)\t%d\n", r, t, ((int8_t*)u)[t], ((int8_t*)v)[t], ((int8_t*)x)[t], ((int8_t*)y)[t], H[t]); // for debugging
	}
	kfree(km, mem);
	if (!approx_max) kfree(km, H);
	if (with_cigar) { // backtrack
		int rev_cigar = !!(flag & KSW_EZ_REV_CIGAR);
		if (!ez->zdropped && !(flag&KSW_EZ_EXTZ_ONLY))
			ksw_backtrack(km, 1, rev_cigar, 0, (uint8_t*)p, off, off_end, n_col_*16, tlen-1, qlen-1, &ez->m_cigar, &ez->n_cigar, &ez->cigar);
		else if (ez->max_t >= 0 && ez->max_q >= 0)
			ksw_backtrack(km, 1, rev_cigar, 0, (uint8_t*)p, off, off_end, n_col_*16, ez->max_t, ez->max_q, &ez->m_cigar, &ez->n_cigar, &ez->cigar);
		kfree(km, mem2); kfree(km, off);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %r9, 0xc8(%rsp)
movq %r8, 0x18(%rsp)
movl %ecx, %r15d
movq %rdx, %rbp
movsbl 0x208(%rsp), %r14d
movq 0x230(%rsp), %r13
movl 0x228(%rsp), %r8d
movl 0x220(%rsp), %r9d
movl 0x218(%rsp), %eax
movq 0x200(%rsp), %r10
movsbl 0x210(%rsp), %edx
movabsq $-0x3fffffff00000001, %rcx # imm = 0xC0000000FFFFFFFF
movq %rcx, 0x18(%r13)
movq %rcx, 0x10(%r13)
movq %rcx, 0x8(%r13)
movl $0x0, 0x24(%r13)
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
movq %rcx, (%r13)
testl %r15d, %r15d
jle 0x2024de
testl %esi, %esi
jle 0x2024de
cmpb $0x0, 0xc8(%rsp)
jle 0x2024de
movq %rdi, %rbx
movq %rdx, 0x110(%rsp)
leal (%rdx,%r14), %r11d
leal (%r11,%r11), %ecx
movq %rcx, 0xb8(%rsp)
cmpl %esi, %r15d
movl %esi, %ecx
cmovgl %r15d, %ecx
movsbl 0x1(%r10), %edi
testl %eax, %eax
cmovnsl %eax, %ecx
cmpl %r15d, %esi
movl %r15d, %edx
cmovll %esi, %edx
movq %rcx, 0x180(%rsp)
leal 0x1(%rcx), %eax
cmpl %eax, %edx
cmovgel %eax, %edx
movq %rdx, %r12
movq 0xc8(%rsp), %rax
movl %eax, %ecx
imull %eax, %ecx
movl %edi, 0x78(%rsp)
movl %edi, %eax
cmpl $0x2, %ecx
jb 0x201402
movl %ecx, %ecx
movl $0x1, %edx
movl 0x78(%rsp), %eax
movsbl (%r10,%rdx), %edi
cmpl %edi, %eax
cmovgel %edi, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x2013f0
negl %eax
cmpl %eax, 0xb8(%rsp)
jl 0x2024de
movq %r14, 0x40(%rsp)
movq %r11, 0xc0(%rsp)
movl %r9d, 0x4c(%rsp)
movq %r10, 0x188(%rsp)
movzbl (%r10), %eax
movq %rax, 0x58(%rsp)
addl $0xf, %r12d
leal 0xf(%r15), %r14d
movq %r12, 0xe8(%rsp)
shrl $0x4, %r12d
movq %r12, 0x128(%rsp)
movq %rsi, 0x60(%rsp)
leal 0xf(%rsi), %eax
movl %r14d, %r12d
shrl $0x4, %r12d
shrl $0x4, %eax
leal (%r12,%r12,2), %ecx
leal (%rax,%rcx,2), %esi
incl %esi
movl $0x10, %edx
movq %rbx, %rdi
movl %r8d, 0xc(%rsp)
callq 0x1fbc8d
movq %r14, %r8
movl 0xc(%rsp), %ecx
movq %rax, 0x158(%rsp)
addq $0xf, %rax
andq $-0x10, %rax
movl %r12d, %edi
shll $0x4, %edi
movq %rax, 0x50(%rsp)
addq %rdi, %rax
movq %rax, 0x30(%rsp)
addq %rdi, %rax
movq %rax, 0x168(%rsp)
addq %rdi, %rax
movq %rax, 0x118(%rsp)
andl $0x7ffffff0, %r8d       # imm = 0x7FFFFFF0
testb $0x8, %cl
movq %r8, 0x38(%rsp)
movq %rdi, 0x88(%rsp)
jne 0x20151f
leal (,%r8,4), %esi
movq %rbx, %rdi
callq 0x1fbb36
movq 0x38(%rsp), %r8
movq %rax, 0x68(%rsp)
testq %r8, %r8
je 0x20152f
movl %r12d, %eax
andl $0x7ffffff, %eax        # imm = 0x7FFFFFF
shlq $0x6, %rax
xorl %ecx, %ecx
movq 0x60(%rsp), %rdx
movq 0x68(%rsp), %rdi
movl $0xc0000000, (%rdi,%rcx) # imm = 0xC0000000
addq $0x4, %rcx
cmpq %rcx, %rax
jne 0x20150d
jmp 0x201534
movq $0x0, 0x68(%rsp)
movq 0x60(%rsp), %rdx
jmp 0x201540
movq 0x60(%rsp), %rdx
movl 0xc(%rsp), %ecx
movq 0x88(%rsp), %rdi
movq %rbx, 0x108(%rsp)
movq 0x118(%rsp), %rax
addq %rdi, %rax
movq %rax, 0xf0(%rsp)
movq 0x128(%rsp), %rax
incl %eax
movl %edx, %r14d
movl %r15d, %r9d
testb $0x1, %cl
movq %r14, 0xe0(%rsp)
movq %r15, 0xd0(%rsp)
movl %eax, 0xa0(%rsp)
jne 0x201618
addl %edx, %r15d
decl %r15d
movl %r15d, %esi
imull %eax, %esi
shll $0x4, %esi
addl $0x10, %esi
movq 0x108(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %r14
movq %r9, %r12
callq 0x1fbb36
movq %rax, 0x100(%rsp)
addq $0xf, %rax
andq $-0x10, %rax
movq %rax, 0xa8(%rsp)
shlq $0x3, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1fbb36
movq %r12, %r9
movq %r14, %r12
movq 0x88(%rsp), %rdi
movq 0xe0(%rsp), %r14
movq 0x38(%rsp), %r8
movq 0x60(%rsp), %rdx
movq %rax, 0x90(%rsp)
leaq (%rax,%r14,4), %rax
leaq (%rax,%r9,4), %rax
addq $-0x4, %rax
movq %rax, 0xb0(%rsp)
jmp 0x201648
movq $0x0, 0xa8(%rsp)
movq $0x0, 0x100(%rsp)
movq $0x0, 0xb0(%rsp)
movq $0x0, 0x90(%rsp)
movq 0x30(%rsp), %rbx
movq 0x18(%rsp), %rsi
addq 0xf0(%rsp), %rdi
testl %edx, %edx
jle 0x201673
leaq (%rdi,%r8), %rax
movq %r14, %rcx
movb -0x1(%rbp,%rcx), %dl
movb %dl, (%rax)
incq %rax
decq %rcx
jne 0x201665
movq %rdi, 0x88(%rsp)
movq %r9, %rdx
callq 0x19e0c0
movq 0x38(%rsp), %r11
movq 0xd0(%rsp), %rax
movq 0x60(%rsp), %rcx
addl %ecx, %eax
cmpl $0x2, %eax
movl 0xc(%rsp), %r10d
jl 0x202440
movq %rax, %rsi
movq 0xc8(%rsp), %rax
decl %eax
movq 0xb8(%rsp), %rdx
movq 0x58(%rsp), %r8
leal (%r8,%rdx), %ecx
movzbl 0x40(%rsp), %edi
movzbl %al, %eax
movzbl %cl, %ecx
movl %edi, 0xa4(%rsp)
movd %edi, %xmm0
movd %edx, %xmm1
movd %r8d, %xmm2
movd 0x78(%rsp), %xmm3
movd %eax, %xmm4
movd %ecx, %xmm5
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklbw %xmm1, %xmm1    # xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklbw %xmm2, %xmm2    # xmm2 = xmm2[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklbw %xmm3, %xmm3    # xmm3 = xmm3[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklbw %xmm4, %xmm4    # xmm4 = xmm4[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklbw %xmm5, %xmm5    # xmm5 = xmm5[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshuflw $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0,4,5,6,7]
pshuflw $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0,4,5,6,7]
pshuflw $0x0, %xmm3, %xmm3      # xmm3 = xmm3[0,0,0,0,4,5,6,7]
pshuflw $0x0, %xmm4, %xmm4      # xmm4 = xmm4[0,0,0,0,4,5,6,7]
pshuflw $0x0, %xmm5, %xmm5      # xmm5 = xmm5[0,0,0,0,4,5,6,7]
movl %r12d, %ecx
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
pshufd $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
pshufd $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
pshufd $0x0, %xmm3, %xmm3      # xmm3 = xmm3[0,0,0,0]
pshufd $0x0, %xmm4, %xmm4      # xmm4 = xmm4[0,0,0,0]
pshufd $0x0, %xmm5, %xmm5      # xmm5 = xmm5[0,0,0,0]
movq 0xd0(%rsp), %rax
leal -0x1(%rax), %r8d
movq 0x60(%rsp), %rax
leal -0x1(%rax), %edx
leal -0x2(%rsi), %eax
movq %rax, 0x120(%rsp)
movq 0xc0(%rsp), %rax
negl %eax
movd %eax, %xmm6
pshufd $0x0, %xmm6, %xmm14     # xmm14 = xmm6[0,0,0,0]
movl %edx, 0xf8(%rsp)
movslq %edx, %rax
decl %esi
movq %rsi, 0x178(%rsp)
movq %rcx, %rsi
movl %esi, %r9d
shll $0x4, %r9d
leaq (%r9,%r9,4), %rdx
addq %rax, %r11
movq 0x50(%rsp), %rcx
addq %rcx, %rdx
movq %rdx, 0x160(%rsp)
leaq (%rdx,%r11), %rax
movq %rax, 0x138(%rsp)
leaq (%r9,%r9,2), %r15
movq %rsi, %rbp
shlq $0x5, %rbp
shlq $0x6, %rsi
movq 0xe8(%rsp), %rax
andl $-0x10, %eax
addq $0x10, %rax
movq %rax, 0xe8(%rsp)
leaq (%r9,%rcx), %rdi
addq $0x3, %rdi
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
pxor %xmm7, %xmm7
movq 0xa8(%rsp), %rax
movq %rax, 0x78(%rsp)
xorl %ecx, %ecx
movl $0xffffffff, 0x28(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x24(%rsp)
movq $0x0, 0x70(%rsp)
movdqa %xmm3, 0x140(%rsp)
movq %r13, 0x130(%rsp)
movq %rsi, 0xd8(%rsp)
movq %r8, 0x10(%rsp)
movdqa %xmm14, 0x190(%rsp)
movq %rdi, 0x150(%rsp)
movq %rcx, %rax
subq %r14, %rax
leal 0x1(%rax), %r12d
testq %rax, %rax
movl $0x0, %eax
cmovsl %eax, %r12d
cmpl %ecx, %r8d
movl %ecx, %edx
cmovll %r8d, %edx
movl %ecx, %edi
movq 0x180(%rsp), %rsi
subl %esi, %edi
incl %edi
sarl %edi
cmpl %edi, %r12d
movl %edi, %eax
cmovgl %r12d, %eax
addl %ecx, %esi
shrl %esi
cmpl %esi, %edx
cmovll %edx, %esi
movq %rsi, 0x18(%rsp)
subl %eax, %esi
jge 0x2018a6
orb $-0x80, 0x3(%r13)
movl $0xb, %edx
jmp 0x20240e
movq %rsi, 0x170(%rsp)
movl %eax, %edx
andl $-0x10, %edx
movl %eax, 0x40(%rsp)
movq %rdx, 0x98(%rsp)
jle 0x2018fc
xorl %r14d, %r14d
cmpl 0x2c(%rsp), %edx
jle 0x20191a
decl %edx
movl $0x0, 0x80(%rsp)
cmpl 0x28(%rsp), %edx
jg 0x201925
movl %edx, %edx
movq 0x168(%rsp), %rsi
movsbl (%rsi,%rdx), %eax
movl %eax, 0x80(%rsp)
movl 0x40(%rsp), %eax
movb (%rbx,%rdx), %r14b
jmp 0x201925
xorl %edx, %edx
testq %rcx, %rcx
movl 0xa4(%rsp), %r14d
movl $0x0, 0x80(%rsp)
cmovel %edx, %r14d
jmp 0x201925
movl $0x0, 0x80(%rsp)
movq 0x18(%rsp), %rdx
orl $0xf, %edx
movl %edx, 0x58(%rsp)
movslq %edx, %rdx
cmpq %rdx, %rcx
jg 0x201963
movq 0x118(%rsp), %rdx
movb $0x0, (%rdx,%rcx)
testq %rcx, %rcx
movl 0xa4(%rsp), %edx
movl $0x0, %esi
cmovel %esi, %edx
movq 0x50(%rsp), %rsi
movb %dl, (%rsi,%rcx)
movl 0x40(%rsp), %eax
movl %r14d, 0xfc(%rsp)
testb $0x4, %r10b
movq %r11, 0x38(%rsp)
jne 0x2019fe
movq 0x18(%rsp), %rdx
cmpl %eax, %edx
jl 0x201a77
movq %rdx, %rax
cmpl %edi, %r12d
movl %edi, %edx
cmovgl %r12d, %edx
movslq %edx, %rdx
movslq %eax, %rsi
movq 0x160(%rsp), %r8
addq %rdx, %r8
movdqu (%r8), %xmm9
movdqu (%r8,%r11), %xmm11
movdqa %xmm9, %xmm12
pcmpeqb %xmm4, %xmm12
pcmpeqb %xmm11, %xmm9
pcmpeqb %xmm4, %xmm11
por %xmm12, %xmm11
movdqa %xmm2, %xmm12
pand %xmm9, %xmm12
pandn %xmm3, %xmm9
por %xmm12, %xmm9
pandn %xmm9, %xmm11
movq 0xf0(%rsp), %r10
movdqu %xmm11, (%r10,%rdx)
addq $0x10, %rdx
addq $0x10, %r8
cmpq %rsi, %rdx
jle 0x2019a4
jmp 0x201a77
movq 0x18(%rsp), %rdx
cmpl %eax, %edx
jl 0x201a77
movq %rdx, %rax
cmpl %edi, %r12d
movl %edi, %edx
cmovgl %r12d, %edx
movslq %edx, %rdx
movslq %eax, %r14
movq $-0x1, %rbx
movq 0xf0(%rsp), %rsi
movq 0x138(%rsp), %r8
movq 0x88(%rsp), %r13
movzbl (%r13,%rdx), %r10d
imull 0xc8(%rsp), %r10d
movzbl (%r8,%rdx), %r11d
addq %r11, %r10
movq 0x188(%rsp), %r11
movb (%r11,%r10), %r10b
movb %r10b, (%rsi,%rdx)
leaq (%rdx,%rbx), %r10
incq %r10
incq %rbx
incq %r13
incq %r8
incq %rsi
cmpq %r14, %r10
jl 0x201a38
movl 0x40(%rsp), %eax
movl %eax, %r14d
movq 0x18(%rsp), %rax
shrl $0x4, %r14d
movl %eax, %edx
shrl $0x4, %edx
movl %edx, %esi
subl %r14d, %esi
cmpl 0x128(%rsp), %esi
jg 0x202577
movd 0x80(%rsp), %xmm13
movsbl 0xfc(%rsp), %esi
movd %esi, %xmm12
movl 0xc(%rsp), %r10d
testb $0x1, %r10b
movq 0x130(%rsp), %r13
movq 0x30(%rsp), %rbx
jne 0x201c5c
movl %r14d, %r11d
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %r8
movl %r8d, (%rsi,%rcx,4)
movq 0xb0(%rsp), %rsi
movl 0x58(%rsp), %r8d
movl %r8d, (%rsi,%rcx,4)
testb $0x2, %r10b
jne 0x201d71
cmpl %r14d, %edx
movq 0xd8(%rsp), %rsi
jb 0x201ed4
movl %edx, %r8d
leaq -0x1(%r11), %r14
shll $0x4, %r11d
addq 0x50(%rsp), %r11
movq 0x78(%rsp), %rdx
movdqa (%r11,%rsi), %xmm8
paddb %xmm1, %xmm8
movdqa (%r11,%rbp), %xmm11
movdqa %xmm11, %xmm14
pslldq $0x1, %xmm11            # xmm11 = zero,xmm11[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
por %xmm13, %xmm11
movdqa (%r11,%r9), %xmm9
movdqa %xmm9, %xmm15
pslldq $0x1, %xmm9             # xmm9 = zero,xmm9[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
por %xmm12, %xmm9
paddb %xmm9, %xmm11
movdqa (%r11), %xmm10
movdqa (%r11,%r15), %xmm12
paddb %xmm10, %xmm12
movdqa %xmm11, %xmm13
pcmpgtb %xmm8, %xmm13
movdqa %xmm8, %xmm6
pcmpgtb %xmm7, %xmm6
pand %xmm8, %xmm6
pmaxub %xmm11, %xmm6
movdqa %xmm12, %xmm8
pcmpgtb %xmm6, %xmm8
movdqa %xmm8, %xmm3
pandn %xmm13, %xmm3
pand 0x3945a1(%rip), %xmm8   # 0x596150
psubb %xmm3, %xmm8
pmaxub %xmm12, %xmm6
pminub %xmm5, %xmm6
movdqa %xmm6, %xmm3
psubb %xmm9, %xmm3
movdqa %xmm3, (%r11)
movdqa %xmm6, %xmm3
psubb %xmm10, %xmm3
movdqa %xmm3, (%r11,%r9)
psubb %xmm0, %xmm6
psubb %xmm6, %xmm11
psubb %xmm6, %xmm12
movdqa %xmm11, %xmm3
pcmpgtb %xmm7, %xmm3
pand %xmm3, %xmm11
movdqa %xmm11, (%r11,%rbp)
pand 0x39457c(%rip), %xmm3   # 0x596180
por %xmm8, %xmm3
movdqa %xmm12, %xmm6
pcmpgtb %xmm7, %xmm6
pand %xmm6, %xmm12
movdqa %xmm12, (%r11,%r15)
pand 0x39456b(%rip), %xmm6   # 0x596190
por %xmm3, %xmm6
movdqa %xmm6, (%rdx)
psrldq $0xf, %xmm14            # xmm14 = xmm14[15],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero
psrldq $0xf, %xmm15            # xmm15 = xmm15[15],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero
incq %r14
addq $0x10, %rdx
addq $0x10, %r11
movdqa %xmm14, %xmm13
movdqa %xmm15, %xmm12
cmpq %r8, %r14
jb 0x201b29
jmp 0x201ed4
cmpl %r14d, %edx
movq 0xd8(%rsp), %rsi
jb 0x201ed4
movl %edx, %edx
decq %r14
movl 0x40(%rsp), %eax
movl %eax, %r8d
movq 0x18(%rsp), %rax
andl $-0x10, %r8d
addq 0x50(%rsp), %r8
movdqa (%r8,%rsi), %xmm6
paddb %xmm1, %xmm6
movdqa (%r8,%rbp), %xmm15
movdqa %xmm15, %xmm14
psrldq $0xf, %xmm14            # xmm14 = xmm14[15],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero
pslldq $0x1, %xmm15            # xmm15 = zero,xmm15[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
por %xmm13, %xmm15
movdqa (%r8,%r9), %xmm13
movdqa %xmm13, %xmm11
psrldq $0xf, %xmm11            # xmm11 = xmm11[15],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero
pslldq $0x1, %xmm13            # xmm13 = zero,xmm13[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
por %xmm12, %xmm13
paddb %xmm13, %xmm15
movdqa (%r8), %xmm12
movdqa (%r8,%r15), %xmm9
paddb %xmm12, %xmm9
movdqa %xmm6, %xmm10
pcmpgtb %xmm7, %xmm10
pand %xmm6, %xmm10
pmaxub %xmm15, %xmm10
pmaxub %xmm9, %xmm10
pminub %xmm5, %xmm10
movdqa %xmm10, %xmm6
psubb %xmm13, %xmm6
movdqa %xmm6, (%r8)
movdqa %xmm10, %xmm6
psubb %xmm12, %xmm6
movdqa %xmm6, (%r8,%r9)
psubb %xmm0, %xmm10
psubb %xmm10, %xmm15
psubb %xmm10, %xmm9
movdqa %xmm15, %xmm6
pcmpgtb %xmm7, %xmm6
pand %xmm15, %xmm6
movdqa %xmm6, (%r8,%rbp)
movdqa %xmm9, %xmm6
pcmpgtb %xmm7, %xmm6
pand %xmm9, %xmm6
movdqa %xmm6, (%r8,%r15)
incq %r14
addq $0x10, %r8
movdqa %xmm14, %xmm13
movdqa %xmm11, %xmm12
cmpq %rdx, %r14
jb 0x201c87
jmp 0x201ed4
cmpl %r14d, %edx
movq 0xd8(%rsp), %rsi
jb 0x201ed4
movl %edx, %r8d
leaq -0x1(%r11), %r14
shll $0x4, %r11d
addq 0x50(%rsp), %r11
movq 0x78(%rsp), %rdx
movdqa (%r11,%rsi), %xmm9
paddb %xmm1, %xmm9
movdqa (%r11,%rbp), %xmm14
movdqa %xmm14, %xmm11
pslldq $0x1, %xmm14            # xmm14 = zero,xmm14[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
por %xmm13, %xmm14
movdqa (%r11,%r9), %xmm13
movdqa %xmm13, %xmm15
pslldq $0x1, %xmm13            # xmm13 = zero,xmm13[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
por %xmm12, %xmm13
paddb %xmm13, %xmm14
movdqa (%r11), %xmm3
movdqa (%r11,%r15), %xmm12
paddb %xmm3, %xmm12
movdqa %xmm9, %xmm6
pcmpgtb %xmm7, %xmm6
pand %xmm9, %xmm6
pcmpgtb %xmm14, %xmm9
pandn 0x394551(%rip), %xmm9   # 0x596350
pmaxub %xmm14, %xmm6
movdqa %xmm6, %xmm8
pcmpgtb %xmm12, %xmm8
movdqa 0x394339(%rip), %xmm10  # 0x596150
por %xmm10, %xmm9
pand %xmm8, %xmm9
pmaxub %xmm12, %xmm6
pminub %xmm5, %xmm6
movdqa %xmm6, %xmm8
psubb %xmm13, %xmm8
movdqa %xmm8, (%r11)
movdqa %xmm6, %xmm8
psubb %xmm3, %xmm8
movdqa %xmm8, (%r11,%r9)
psubb %xmm0, %xmm6
psubb %xmm6, %xmm14
psubb %xmm6, %xmm12
pxor %xmm3, %xmm3
pcmpgtb %xmm14, %xmm3
movdqa %xmm3, %xmm6
pandn %xmm14, %xmm6
movdqa %xmm6, (%r11,%rbp)
pandn 0x394309(%rip), %xmm3   # 0x596180
por %xmm9, %xmm3
pxor %xmm6, %xmm6
pcmpgtb %xmm12, %xmm6
movdqa %xmm6, %xmm8
pandn %xmm12, %xmm8
movdqa %xmm8, (%r11,%r15)
pandn 0x3942f3(%rip), %xmm6   # 0x596190
por %xmm3, %xmm6
pxor %xmm10, %xmm6
movdqa %xmm6, (%rdx)
psrldq $0xf, %xmm11            # xmm11 = xmm11[15],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero
psrldq $0xf, %xmm15            # xmm15 = xmm15[15],zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero
incq %r14
addq $0x10, %rdx
addq $0x10, %r11
movdqa %xmm11, %xmm13
movdqa %xmm15, %xmm12
cmpq %r8, %r14
jb 0x201d97
testb $0x8, %r10b
jne 0x20202b
movl %eax, %r11d
testq %rcx, %rcx
movdqa 0x190(%rsp), %xmm14
movq %r11, 0x80(%rsp)
je 0x202083
movq 0x170(%rsp), %r14
leal 0x3(%r14), %r8d
testl %r14d, %r14d
cmovnsl %r14d, %r8d
leal -0x1(%rax), %edx
movq 0x50(%rsp), %rsi
addq %r11, %rsi
testl %eax, %eax
movq 0x68(%rsp), %r10
leaq (%r10,%rdx,4), %rdx
cmovleq %rbx, %rsi
cmovleq %r10, %rdx
movq %r11, %rbx
movzbl (%rsi), %r11d
addl (%rdx), %r11d
subl 0xc0(%rsp), %r11d
movl %r11d, (%r10,%rbx,4)
movd %r11d, %xmm3
pshufd $0x0, %xmm3, %xmm13     # xmm13 = xmm3[0,0,0,0]
movd %eax, %xmm3
pshufd $0x0, %xmm3, %xmm12     # xmm12 = xmm3[0,0,0,0]
cmpl $0x4, %r14d
jl 0x2020cf
andl $-0x4, %r8d
addl 0x40(%rsp), %r8d
cmpl %edi, %r12d
cmovgl %r12d, %edi
movslq %edi, %rdx
movslq %r8d, %r8
movq 0x68(%rsp), %r12
movq 0x150(%rsp), %r13
movdqu (%r12,%rdx,4), %xmm3
paddd %xmm14, %xmm3
movzbl -0x3(%r13,%rdx), %esi
movzbl -0x2(%r13,%rdx), %r10d
movzbl -0x1(%r13,%rdx), %ebx
movzbl (%r13,%rdx), %r14d
movd %r14d, %xmm6
movd %ebx, %xmm8
punpckldq %xmm6, %xmm8    # xmm8 = xmm8[0],xmm6[0],xmm8[1],xmm6[1]
movd %r10d, %xmm6
movd %esi, %xmm10
punpckldq %xmm6, %xmm10   # xmm10 = xmm10[0],xmm6[0],xmm10[1],xmm6[1]
punpcklqdq %xmm8, %xmm10   # xmm10 = xmm10[0],xmm8[0]
paddd %xmm3, %xmm10
movdqu %xmm10, (%r12,%rdx,4)
movd %edi, %xmm3
pshufd $0x0, %xmm3, %xmm3      # xmm3 = xmm3[0,0,0,0]
movdqa %xmm10, %xmm11
pcmpgtd %xmm13, %xmm11
pand %xmm11, %xmm10
movdqa %xmm11, %xmm9
pandn %xmm13, %xmm9
por %xmm10, %xmm9
pand %xmm11, %xmm3
pandn %xmm12, %xmm11
por %xmm3, %xmm11
addq $0x4, %rdx
addl $0x4, %edi
movdqa %xmm11, %xmm12
movdqa %xmm9, %xmm13
cmpq %r8, %rdx
jl 0x201f85
jmp 0x2020e2
testq %rcx, %rcx
movq 0xe0(%rsp), %r14
movq 0x70(%rsp), %r12
je 0x2020a9
cmpl 0x40(%rsp), %r12d
setl %dl
cmpl %eax, %r12d
setg %al
orb %dl, %al
movq 0xc0(%rsp), %r8
movq 0x38(%rsp), %r11
movdqa 0x140(%rsp), %xmm3
je 0x202172
movslq %r12d, %r12
movq 0x50(%rsp), %rax
movb 0x1(%rax,%r12), %al
incq %r12
movq %r12, 0x70(%rsp)
jmp 0x2022f7
movzbl (%rbx), %r11d
subl 0xb8(%rsp), %r11d
movq 0x68(%rsp), %r12
movl %r11d, (%r12)
xorl %r14d, %r14d
movdqa 0x140(%rsp), %xmm3
jmp 0x2021b5
movzbl (%rbx), %eax
subl 0xb8(%rsp), %eax
movq $0x0, 0x70(%rsp)
movq 0x38(%rsp), %r11
movdqa 0x140(%rsp), %xmm3
jmp 0x2023da
movdqa %xmm13, %xmm9
movdqa %xmm12, %xmm11
movl 0x40(%rsp), %edi
movq 0x68(%rsp), %r12
movdqa %xmm9, 0x1b0(%rsp)
movdqa %xmm11, 0x1a0(%rsp)
xorl %edx, %edx
movl %eax, %r14d
movq 0xc0(%rsp), %r8
movdqa 0x140(%rsp), %xmm3
movq 0x130(%rsp), %r13
movl 0x1b0(%rsp,%rdx,4), %esi
cmpl %esi, %r11d
jge 0x20212e
movl 0x1a0(%rsp,%rdx,4), %r14d
addl %edx, %r14d
movl %esi, %r11d
incq %rdx
cmpq $0x4, %rdx
jne 0x202114
cmpl %eax, %edi
movq 0x30(%rsp), %rbx
jge 0x2021ab
movq %rax, %rdx
movslq %edi, %rax
movslq %edx, %rdx
movl 0xc(%rsp), %r10d
movzbl (%rbx,%rax), %esi
subl %r8d, %esi
addl (%r12,%rax,4), %esi
movl %esi, (%r12,%rax,4)
cmpl %r11d, %esi
cmovgl %esi, %r11d
cmovgl %eax, %r14d
incq %rax
cmpq %rdx, %rax
jl 0x20214e
jmp 0x2021b0
cmpl 0x18(%rsp), %r12d
jge 0x2022e9
movl %r12d, %eax
leaq 0x1(%rax), %rdx
movzbl (%rbx,%rax), %esi
movq 0x50(%rsp), %rbx
movzbl 0x1(%rbx,%rax), %eax
movq 0x30(%rsp), %rbx
cmpb %al, %sil
cmoval %r12d, %edx
cmoval %esi, %eax
movq %rdx, 0x70(%rsp)
jmp 0x2022f7
movl 0xc(%rsp), %r10d
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %r8
cmpl %r8d, %eax
movl 0x40(%rsp), %edx
jne 0x2021e3
movq 0x80(%rsp), %rax
movl (%r12,%rax,4), %eax
cmpl 0x14(%r13), %eax
jle 0x2021e3
movl %eax, 0x14(%r13)
movl %ecx, %eax
subl 0x58(%rsp), %eax
movl %eax, 0x18(%r13)
movl %ecx, %eax
subl %edx, %eax
cmpl 0xf8(%rsp), %eax
jne 0x202204
movl %edx, %eax
movl (%r12,%rax,4), %eax
cmpl 0xc(%r13), %eax
jle 0x202204
movl %eax, 0xc(%r13)
movl %edx, 0x10(%r13)
movl (%r13), %edx
movl %edx, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
subl %r11d, %esi
jge 0x20223a
andl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
andl $0x80000000, %edx       # imm = 0x80000000
orl %r11d, %edx
movl %edx, (%r13)
movl %r14d, 0x8(%r13)
movl %ecx, %eax
subl %r14d, %eax
movl %eax, 0x4(%r13)
movb $0x1, %al
jmp 0x20224a
movl 0x8(%r13), %r8d
movb $0x1, %al
cmpl %r14d, %r8d
jle 0x20228a
movq 0x10(%rsp), %r8
movl $0xb, %edx
testb %al, %al
movq 0x38(%rsp), %r11
movq 0xe0(%rsp), %r14
je 0x20227b
xorl %edx, %edx
cmpq 0x120(%rsp), %rcx
jne 0x20227b
cmpl %r8d, 0x18(%rsp)
jne 0x20227b
movl (%r12,%r8,4), %esi
movl %esi, 0x1c(%r13)
testb %al, %al
je 0x20240e
xorl %edx, %edx
jmp 0x2023fa
cmpl $0x0, 0x4c(%rsp)
js 0x202245
movl %ecx, %r11d
subl %r14d, %r11d
movl 0x4(%r13), %ebx
cmpl %ebx, %r11d
jl 0x2023c1
addl %r8d, %r11d
subl %r11d, %r14d
addl %ebx, %r14d
movl %r14d, %r8d
negl %r8d
cmovsl %r14d, %r8d
imull 0x110(%rsp), %r8d
addl 0x4c(%rsp), %r8d
cmpl %r8d, %esi
movq 0x30(%rsp), %rbx
movq 0x10(%rsp), %r8
jle 0x20224a
orl $0x80000000, %edx       # imm = 0x80000000
movl %edx, (%r13)
xorl %eax, %eax
jmp 0x20224a
testb %al, %al
jne 0x202069
movl %r12d, %eax
movb (%rbx,%rax), %al
movzbl %al, %eax
subl %r8d, %eax
addl 0x24(%rsp), %eax
testb $0x10, %r10b
je 0x2023da
movl (%r13), %edx
movl %edx, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
subl %eax, %esi
jge 0x202345
movl %eax, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl $0x80000000, %edx       # imm = 0x80000000
orl %esi, %edx
movl %edx, (%r13)
movq 0x70(%rsp), %rsi
movl %esi, 0x8(%r13)
movl %ecx, %edx
subl %esi, %edx
movl %edx, 0x4(%r13)
jmp 0x2023da
movl 0x8(%r13), %r8d
cmpl 0x70(%rsp), %r8d
jg 0x2023da
cmpl $0x0, 0x4c(%rsp)
js 0x2023da
movl %ecx, %r11d
movq 0x70(%rsp), %r12
subl %r12d, %r11d
movl 0x4(%r13), %ebx
cmpl %ebx, %r11d
jl 0x2023d0
addl %r8d, %r11d
movl %r12d, %r8d
subl %r11d, %r8d
addl %ebx, %r8d
movl %r8d, %r10d
negl %r10d
cmovsl %r8d, %r10d
imull 0x110(%rsp), %r10d
addl 0x4c(%rsp), %r10d
cmpl %r10d, %esi
jle 0x2023cb
orl $0x80000000, %edx       # imm = 0x80000000
movl %edx, (%r13)
movl $0xb, %edx
movl %eax, 0x24(%rsp)
movl 0xc(%rsp), %r10d
movq 0x38(%rsp), %r11
movq 0x30(%rsp), %rbx
movq 0x10(%rsp), %r8
jmp 0x20240e
movq 0x30(%rsp), %rbx
jmp 0x202245
movl 0xc(%rsp), %r10d
movq 0x38(%rsp), %r11
movq 0x30(%rsp), %rbx
movq 0x10(%rsp), %r8
xorl %edx, %edx
cmpq 0x120(%rsp), %rcx
jne 0x2023f6
cmpl %r8d, 0x18(%rsp)
jne 0x2023f6
movl %eax, 0x1c(%r13)
movl %eax, 0x24(%rsp)
movl 0x58(%rsp), %eax
movl %eax, 0x28(%rsp)
movq 0x98(%rsp), %rax
movl %eax, 0x2c(%rsp)
testl %edx, %edx
jne 0x202440
incq %rcx
decq 0x138(%rsp)
decq %r11
movq 0x78(%rsp), %rax
addq 0xe8(%rsp), %rax
movq %rax, 0x78(%rsp)
cmpq 0x178(%rsp), %rcx
jne 0x20184d
movq 0x108(%rsp), %r14
movq %r14, %rdi
movq 0x158(%rsp), %rsi
callq 0x1fb9e5
movl 0xc(%rsp), %ecx
testb $0x8, %cl
jne 0x202472
movq %r14, %rdi
movq 0x68(%rsp), %rsi
callq 0x1fb9e5
movl 0xc(%rsp), %ecx
testb $0x1, %cl
movq 0xd0(%rsp), %r11
movq 0x60(%rsp), %rbx
jne 0x2024de
leaq 0x24(%r13), %rax
movl %ecx, %esi
shrl $0x7, %esi
andl $0x1, %esi
testb $0x40, %cl
jne 0x2024f0
cmpl $0x0, (%r13)
js 0x2024f0
movl 0xa0(%rsp), %r9d
shll $0x4, %r9d
decl %r11d
decl %ebx
leaq 0x20(%r13), %r10
addq $0x28, %r13
subq $0x8, %rsp
movq %r14, %rdi
movq 0xb0(%rsp), %rdx
movq 0x98(%rsp), %rcx
movq 0xb8(%rsp), %r8
pushq %r13
pushq %rax
pushq %r10
pushq %rbx
pushq %r11
jmp 0x20253d
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%r13), %r10d
testl %r10d, %r10d
js 0x202546
movl 0x4(%r13), %r11d
testl %r11d, %r11d
js 0x202546
movl 0xa0(%rsp), %r9d
shll $0x4, %r9d
leaq 0x20(%r13), %rbx
addq $0x28, %r13
subq $0x8, %rsp
movq %r14, %rdi
movq 0xb0(%rsp), %rdx
movq 0x98(%rsp), %rcx
movq 0xb8(%rsp), %r8
pushq %r13
pushq %rax
pushq %rbx
pushq %r11
pushq %r10
callq 0x202596
addq $0x30, %rsp
movq %r14, %rdi
movq 0x100(%rsp), %rsi
callq 0x1fb9e5
movq %r14, %rdi
movq 0x90(%rsp), %rsi
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1fb9e5
leaq 0x393c42(%rip), %rdi    # 0x5961c0
leaq 0x393ddb(%rip), %rsi    # 0x596360
leaq 0x393de5(%rip), %rcx    # 0x596371
movl $0x93, %edx
callq 0x19e0a0