// File: /workspace/github_c_makefile_star2_O0/lh3[P]fermi-lite/ksw.c
// Function: ksw_i16
kswr_t ksw_i16(kswq_t *q, int tlen, const uint8_t *target, int _gapo, int _gape, int xtra) // the first gap costs -(_o+_e)
{
	int slen, i, m_b, n_b, te = -1, gmax = 0, minsc, endsc;
	uint64_t *b;
	__m128i zero, gapoe, gape, *H0, *H1, *E, *Hmax;
	kswr_t r;

#define __max_8(ret, xx) do { \
		(xx) = _mm_max_epi16((xx), _mm_srli_si128((xx), 8)); \
		(xx) = _mm_max_epi16((xx), _mm_srli_si128((xx), 4)); \
		(xx) = _mm_max_epi16((xx), _mm_srli_si128((xx), 2)); \
    	(ret) = _mm_extract_epi16((xx), 0); \
	} while (0)

	// initialization
	r = g_defr;
	minsc = (xtra&KSW_XSUBO)? xtra&0xffff : 0x10000;
	endsc = (xtra&KSW_XSTOP)? xtra&0xffff : 0x10000;
	m_b = n_b = 0; b = 0;
	zero = _mm_set1_epi32(0);
	gapoe = _mm_set1_epi16(_gapo + _gape);
	gape = _mm_set1_epi16(_gape);
	H0 = q->H0; H1 = q->H1; E = q->E; Hmax = q->Hmax;
	slen = q->slen;
	for (i = 0; i < slen; ++i) {
		_mm_store_si128(E + i, zero);
		_mm_store_si128(H0 + i, zero);
		_mm_store_si128(Hmax + i, zero);
	}
	// the core loop
	for (i = 0; i < tlen; ++i) {
		int j, k, imax;
		__m128i e, h, f = zero, max = zero, *S = q->qp + target[i] * slen; // s is the 1st score vector
		h = _mm_load_si128(H0 + slen - 1); // h={2,5,8,11,14,17,-1,-1} in the above example
		h = _mm_slli_si128(h, 2);
		for (j = 0; LIKELY(j < slen); ++j) {
			h = _mm_adds_epi16(h, *S++);
			e = _mm_load_si128(E + j);
			h = _mm_max_epi16(h, e);
			h = _mm_max_epi16(h, f);
			max = _mm_max_epi16(max, h);
			_mm_store_si128(H1 + j, h);
			h = _mm_subs_epu16(h, gapoe);
			e = _mm_subs_epu16(e, gape);
			e = _mm_max_epi16(e, h);
			_mm_store_si128(E + j, e);
			f = _mm_subs_epu16(f, gape);
			f = _mm_max_epi16(f, h);
			h = _mm_load_si128(H0 + j);
		}
		for (k = 0; LIKELY(k < 16); ++k) {
			f = _mm_slli_si128(f, 2);
			for (j = 0; LIKELY(j < slen); ++j) {
				h = _mm_load_si128(H1 + j);
				h = _mm_max_epi16(h, f);
				_mm_store_si128(H1 + j, h);
				h = _mm_subs_epu16(h, gapoe);
				f = _mm_subs_epu16(f, gape);
				if(UNLIKELY(!_mm_movemask_epi8(_mm_cmpgt_epi16(f, h)))) goto end_loop8;
			}
		}
end_loop8:
		__max_8(imax, max);
		if (imax >= minsc) {
			if (n_b == 0 || (int32_t)b[n_b-1] + 1 != i) {
				if (n_b == m_b) {
					m_b = m_b? m_b<<1 : 8;
					b = (uint64_t*)realloc(b, 8 * m_b);
				}
				b[n_b++] = (uint64_t)imax<<32 | i;
			} else if ((int)(b[n_b-1]>>32) < imax) b[n_b-1] = (uint64_t)imax<<32 | i; // modify the last
		}
		if (imax > gmax) {
			gmax = imax; te = i;
			for (j = 0; LIKELY(j < slen); ++j)
				_mm_store_si128(Hmax + j, _mm_load_si128(H1 + j));
			if (gmax >= endsc) break;
		}
		S = H1; H1 = H0; H0 = S;
	}
	r.score = gmax; r.te = te;
	{
		int max = -1, low, high, qlen = slen * 8;
		uint16_t *t = (uint16_t*)Hmax;
		for (i = 0, r.qe = -1; i < qlen; ++i, ++t)
			if ((int)*t > max) max = *t, r.qe = i / 8 + i % 8 * slen;
		if (b) {
			i = (r.score + q->max - 1) / q->max;
			low = te - i; high = te + i;
			for (i = 0; i < n_b; ++i) {
				int e = (int32_t)b[i];
				if ((e < low || e > high) && b[i]>>32 > (uint32_t)r.score2)
					r.score2 = b[i]>>32, r.te2 = e;
			}
		}
	}
	free(b);
	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4c0, %rsp            # imm = 0x4C0
movq %rdi, -0x4a8(%rbp)
movq %rdi, %rax
movq %rax, -0x4a0(%rbp)
movl 0x10(%rbp), %eax
movq %rsi, -0x390(%rbp)
movl %edx, -0x394(%rbp)
movq %rcx, -0x3a0(%rbp)
movl %r8d, -0x3a4(%rbp)
movl %r9d, -0x3a8(%rbp)
movl $0xffffffff, -0x3bc(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x3c0(%rbp)
movq 0x60e0(%rip), %rax      # 0x25dbc
movq %rax, (%rdi)
movq 0x60de(%rip), %rax      # 0x25dc4
movq %rax, 0x8(%rdi)
movq 0x60db(%rip), %rax      # 0x25dcc
movq %rax, 0x10(%rdi)
movl 0x60d9(%rip), %eax      # 0x25dd4
movl %eax, 0x18(%rdi)
movl 0x10(%rbp), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
je 0x1fd1b
movl 0x10(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x4ac(%rbp)
jmp 0x1fd28
movl $0x10000, %eax          # imm = 0x10000
movl %eax, -0x4ac(%rbp)
jmp 0x1fd28
movl -0x4ac(%rbp), %eax
movl %eax, -0x3c4(%rbp)
movl 0x10(%rbp), %eax
andl $0x20000, %eax          # imm = 0x20000
cmpl $0x0, %eax
je 0x1fd51
movl 0x10(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x4b0(%rbp)
jmp 0x1fd5e
movl $0x10000, %eax          # imm = 0x10000
movl %eax, -0x4b0(%rbp)
jmp 0x1fd5e
movl -0x4b0(%rbp), %eax
movl %eax, -0x3c8(%rbp)
movl $0x0, -0x3b8(%rbp)
movl $0x0, -0x3b4(%rbp)
movq $0x0, -0x3d0(%rbp)
movl $0x0, -0x384(%rbp)
movl -0x384(%rbp), %eax
movl %eax, -0x44(%rbp)
movl %eax, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
movl %eax, -0x50(%rbp)
movd -0x44(%rbp), %xmm0
movd -0x48(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd -0x4c(%rbp), %xmm2
movd -0x50(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movaps %xmm0, -0x60(%rbp)
movaps -0x60(%rbp), %xmm0
movaps %xmm0, -0x3e0(%rbp)
movl -0x3a4(%rbp), %eax
movl -0x3a8(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x262(%rbp)
movw -0x262(%rbp), %ax
movw %ax, -0x4b4(%rbp)
movw %ax, -0x22(%rbp)
movw %ax, -0x24(%rbp)
movw %ax, -0x26(%rbp)
movw %ax, -0x28(%rbp)
movw %ax, -0x2a(%rbp)
movw %ax, -0x2c(%rbp)
movw %ax, -0x2e(%rbp)
movw %ax, -0x30(%rbp)
movzwl -0x22(%rbp), %eax
movd %eax, %xmm1
movzwl -0x24(%rbp), %eax
movd %eax, %xmm0
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movzwl -0x26(%rbp), %eax
movd %eax, %xmm2
movzwl -0x28(%rbp), %eax
movd %eax, %xmm1
punpcklwd %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movzwl -0x2a(%rbp), %eax
movd %eax, %xmm0
movzwl -0x2c(%rbp), %eax
movd %eax, %xmm2
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
movzwl -0x2e(%rbp), %eax
movd %eax, %xmm3
movzwl -0x30(%rbp), %eax
movd %eax, %xmm0
punpcklwd %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1],xmm0[2],xmm3[2],xmm0[3],xmm3[3]
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movaps %xmm0, -0x40(%rbp)
movaps -0x40(%rbp), %xmm0
movaps %xmm0, -0x3f0(%rbp)
movw -0x3a8(%rbp), %ax
movw %ax, -0x264(%rbp)
movw -0x264(%rbp), %ax
movw %ax, -0x4b2(%rbp)
movw %ax, -0x2(%rbp)
movw %ax, -0x4(%rbp)
movw %ax, -0x6(%rbp)
movw %ax, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movw %ax, -0xc(%rbp)
movw %ax, -0xe(%rbp)
movw %ax, -0x10(%rbp)
movzwl -0x2(%rbp), %eax
movd %eax, %xmm1
movzwl -0x4(%rbp), %eax
movd %eax, %xmm0
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movzwl -0x6(%rbp), %eax
movd %eax, %xmm2
movzwl -0x8(%rbp), %eax
movd %eax, %xmm1
punpcklwd %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movzwl -0xa(%rbp), %eax
movd %eax, %xmm0
movzwl -0xc(%rbp), %eax
movd %eax, %xmm2
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
movzwl -0xe(%rbp), %eax
movd %eax, %xmm3
movzwl -0x10(%rbp), %eax
movd %eax, %xmm0
punpcklwd %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1],xmm0[2],xmm3[2],xmm0[3],xmm3[3]
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, -0x20(%rbp)
movdqa -0x20(%rbp), %xmm0
movdqa %xmm0, -0x400(%rbp)
movq -0x390(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x408(%rbp)
movq -0x390(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x410(%rbp)
movq -0x390(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x418(%rbp)
movq -0x390(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x420(%rbp)
movq -0x390(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x3ac(%rbp)
movl $0x0, -0x3b0(%rbp)
movl -0x3b0(%rbp), %eax
cmpl -0x3ac(%rbp), %eax
jge 0x20071
movq -0x418(%rbp), %rax
movslq -0x3b0(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa -0x3e0(%rbp), %xmm0
movq %rax, -0x2b0(%rbp)
movdqa %xmm0, -0x2c0(%rbp)
movdqa -0x2c0(%rbp), %xmm0
movq -0x2b0(%rbp), %rax
movdqa %xmm0, (%rax)
movq -0x408(%rbp), %rax
movslq -0x3b0(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa -0x3e0(%rbp), %xmm0
movq %rax, -0x2c8(%rbp)
movdqa %xmm0, -0x2e0(%rbp)
movdqa -0x2e0(%rbp), %xmm0
movq -0x2c8(%rbp), %rax
movdqa %xmm0, (%rax)
movq -0x420(%rbp), %rax
movslq -0x3b0(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa -0x3e0(%rbp), %xmm0
movq %rax, -0x2e8(%rbp)
movdqa %xmm0, -0x300(%rbp)
movdqa -0x300(%rbp), %xmm0
movq -0x2e8(%rbp), %rax
movdqa %xmm0, (%rax)
movl -0x3b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3b0(%rbp)
jmp 0x1ff8e
movl $0x0, -0x3b0(%rbp)
movl -0x3b0(%rbp), %eax
cmpl -0x394(%rbp), %eax
jge 0x2093d
movaps -0x3e0(%rbp), %xmm0
movaps %xmm0, -0x460(%rbp)
movaps -0x3e0(%rbp), %xmm0
movaps %xmm0, -0x470(%rbp)
movq -0x390(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x3a0(%rbp), %rcx
movslq -0x3b0(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movl -0x3ac(%rbp), %edx
imull %edx, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x478(%rbp)
movq -0x408(%rbp), %rax
movslq -0x3ac(%rbp), %rcx
shlq $0x4, %rcx
leaq -0x10(%rax,%rcx), %rax
movq %rax, -0x288(%rbp)
movq -0x288(%rbp), %rax
movaps (%rax), %xmm0
movaps %xmm0, -0x450(%rbp)
movaps -0x450(%rbp), %xmm0
pslldq $0x2, %xmm0             # xmm0 = zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
movdqa %xmm0, -0x450(%rbp)
movl $0x0, -0x424(%rbp)
movl -0x424(%rbp), %eax
cmpl -0x3ac(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x2046a
movdqa -0x450(%rbp), %xmm1
movq -0x478(%rbp), %rax
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, -0x478(%rbp)
movdqa (%rax), %xmm0
movdqa %xmm1, -0x250(%rbp)
movdqa %xmm0, -0x260(%rbp)
movdqa -0x250(%rbp), %xmm0
movdqa -0x260(%rbp), %xmm1
paddsw %xmm1, %xmm0
movdqa %xmm0, -0x450(%rbp)
movq -0x418(%rbp), %rax
movslq -0x424(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x290(%rbp)
movq -0x290(%rbp), %rax
movdqa (%rax), %xmm0
movdqa %xmm0, -0x440(%rbp)
movdqa -0x450(%rbp), %xmm1
movdqa -0x440(%rbp), %xmm0
movdqa %xmm1, -0x130(%rbp)
movdqa %xmm0, -0x140(%rbp)
movdqa -0x130(%rbp), %xmm0
movdqa -0x140(%rbp), %xmm1
pmaxsw %xmm1, %xmm0
movdqa %xmm0, -0x450(%rbp)
movdqa -0x450(%rbp), %xmm1
movdqa -0x460(%rbp), %xmm0
movdqa %xmm1, -0x150(%rbp)
movdqa %xmm0, -0x160(%rbp)
movdqa -0x150(%rbp), %xmm0
movdqa -0x160(%rbp), %xmm1
pmaxsw %xmm1, %xmm0
movdqa %xmm0, -0x450(%rbp)
movdqa -0x470(%rbp), %xmm1
movdqa -0x450(%rbp), %xmm0
movdqa %xmm1, -0x170(%rbp)
movdqa %xmm0, -0x180(%rbp)
movdqa -0x170(%rbp), %xmm0
movdqa -0x180(%rbp), %xmm1
pmaxsw %xmm1, %xmm0
movdqa %xmm0, -0x470(%rbp)
movq -0x410(%rbp), %rax
movslq -0x424(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa -0x450(%rbp), %xmm0
movq %rax, -0x308(%rbp)
movdqa %xmm0, -0x320(%rbp)
movdqa -0x320(%rbp), %xmm0
movq -0x308(%rbp), %rax
movdqa %xmm0, (%rax)
movdqa -0x450(%rbp), %xmm1
movdqa -0x3f0(%rbp), %xmm0
movdqa %xmm1, -0x90(%rbp)
movdqa %xmm0, -0xa0(%rbp)
movdqa -0x90(%rbp), %xmm0
movdqa -0xa0(%rbp), %xmm1
psubusw %xmm1, %xmm0
movdqa %xmm0, -0x450(%rbp)
movdqa -0x440(%rbp), %xmm1
movdqa -0x400(%rbp), %xmm0
movdqa %xmm1, -0xb0(%rbp)
movdqa %xmm0, -0xc0(%rbp)
movdqa -0xb0(%rbp), %xmm0
movdqa -0xc0(%rbp), %xmm1
psubusw %xmm1, %xmm0
movdqa %xmm0, -0x440(%rbp)
movdqa -0x440(%rbp), %xmm1
movdqa -0x450(%rbp), %xmm0
movdqa %xmm1, -0x190(%rbp)
movdqa %xmm0, -0x1a0(%rbp)
movdqa -0x190(%rbp), %xmm0
movdqa -0x1a0(%rbp), %xmm1
pmaxsw %xmm1, %xmm0
movdqa %xmm0, -0x440(%rbp)
movq -0x418(%rbp), %rax
movslq -0x424(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa -0x440(%rbp), %xmm0
movq %rax, -0x328(%rbp)
movdqa %xmm0, -0x340(%rbp)
movdqa -0x340(%rbp), %xmm0
movq -0x328(%rbp), %rax
movdqa %xmm0, (%rax)
movdqa -0x460(%rbp), %xmm1
movdqa -0x400(%rbp), %xmm0
movdqa %xmm1, -0xd0(%rbp)
movdqa %xmm0, -0xe0(%rbp)
movdqa -0xd0(%rbp), %xmm0
movdqa -0xe0(%rbp), %xmm1
psubusw %xmm1, %xmm0
movdqa %xmm0, -0x460(%rbp)
movdqa -0x460(%rbp), %xmm1
movdqa -0x450(%rbp), %xmm0
movdqa %xmm1, -0x1b0(%rbp)
movdqa %xmm0, -0x1c0(%rbp)
movdqa -0x1b0(%rbp), %xmm0
movdqa -0x1c0(%rbp), %xmm1
pmaxsw %xmm1, %xmm0
movdqa %xmm0, -0x460(%rbp)
movq -0x408(%rbp), %rax
movslq -0x424(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x298(%rbp)
movq -0x298(%rbp), %rax
movdqa (%rax), %xmm0
movdqa %xmm0, -0x450(%rbp)
movl -0x424(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x424(%rbp)
jmp 0x2012d
movl $0x0, -0x428(%rbp)
cmpl $0x10, -0x428(%rbp)
setl %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x2064d
movaps -0x460(%rbp), %xmm0
pslldq $0x2, %xmm0             # xmm0 = zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
movdqa %xmm0, -0x460(%rbp)
movl $0x0, -0x424(%rbp)
movl -0x424(%rbp), %eax
cmpl -0x3ac(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x20637
movq -0x410(%rbp), %rax
movslq -0x424(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x2a0(%rbp)
movq -0x2a0(%rbp), %rax
movaps (%rax), %xmm0
movaps %xmm0, -0x450(%rbp)
movaps -0x450(%rbp), %xmm1
movaps -0x460(%rbp), %xmm0
movaps %xmm1, -0x1d0(%rbp)
movaps %xmm0, -0x1e0(%rbp)
movaps -0x1d0(%rbp), %xmm0
movaps -0x1e0(%rbp), %xmm1
pmaxsw %xmm1, %xmm0
movaps %xmm0, -0x450(%rbp)
movq -0x410(%rbp), %rax
movslq -0x424(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movaps -0x450(%rbp), %xmm0
movq %rax, -0x348(%rbp)
movaps %xmm0, -0x360(%rbp)
movaps -0x360(%rbp), %xmm0
movq -0x348(%rbp), %rax
movaps %xmm0, (%rax)
movaps -0x450(%rbp), %xmm1
movaps -0x3f0(%rbp), %xmm0
movaps %xmm1, -0xf0(%rbp)
movaps %xmm0, -0x100(%rbp)
movaps -0xf0(%rbp), %xmm0
movaps -0x100(%rbp), %xmm1
psubusw %xmm1, %xmm0
movaps %xmm0, -0x450(%rbp)
movaps -0x460(%rbp), %xmm1
movaps -0x400(%rbp), %xmm0
movaps %xmm1, -0x110(%rbp)
movaps %xmm0, -0x120(%rbp)
movaps -0x110(%rbp), %xmm0
movaps -0x120(%rbp), %xmm1
psubusw %xmm1, %xmm0
movaps %xmm0, -0x460(%rbp)
movaps -0x460(%rbp), %xmm1
movaps -0x450(%rbp), %xmm0
movaps %xmm1, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps -0x70(%rbp), %xmm0
movaps -0x80(%rbp), %xmm1
pcmpgtw %xmm1, %xmm0
movdqa %xmm0, -0x280(%rbp)
movdqa -0x280(%rbp), %xmm0
pmovmskb %xmm0, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x20621
jmp 0x2064f
jmp 0x20623
movl -0x424(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x424(%rbp)
jmp 0x204ad
jmp 0x20639
movl -0x428(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x428(%rbp)
jmp 0x20474
jmp 0x2064f
jmp 0x20651
movaps -0x470(%rbp), %xmm1
movaps %xmm1, %xmm0
psrldq $0x8, %xmm0             # xmm0 = xmm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero
movaps %xmm1, -0x1f0(%rbp)
movaps %xmm0, -0x200(%rbp)
movaps -0x1f0(%rbp), %xmm0
movaps -0x200(%rbp), %xmm1
pmaxsw %xmm1, %xmm0
movaps %xmm0, -0x470(%rbp)
movaps -0x470(%rbp), %xmm1
movaps %xmm1, %xmm0
psrldq $0x4, %xmm0             # xmm0 = xmm0[4,5,6,7,8,9,10,11,12,13,14,15],zero,zero,zero,zero
movaps %xmm1, -0x210(%rbp)
movaps %xmm0, -0x220(%rbp)
movaps -0x210(%rbp), %xmm0
movaps -0x220(%rbp), %xmm1
pmaxsw %xmm1, %xmm0
movaps %xmm0, -0x470(%rbp)
movaps -0x470(%rbp), %xmm1
movaps %xmm1, %xmm0
psrldq $0x2, %xmm0             # xmm0 = xmm0[2,3,4,5,6,7,8,9,10,11,12,13,14,15],zero,zero
movaps %xmm1, -0x230(%rbp)
movaps %xmm0, -0x240(%rbp)
movaps -0x230(%rbp), %xmm0
movaps -0x240(%rbp), %xmm1
pmaxsw %xmm1, %xmm0
movaps %xmm0, -0x470(%rbp)
movl -0x470(%rbp), %eax
movzwl %ax, %eax
movl %eax, -0x42c(%rbp)
movl -0x42c(%rbp), %eax
cmpl -0x3c4(%rbp), %eax
jl 0x2082b
cmpl $0x0, -0x3b8(%rbp)
je 0x20743
movq -0x3d0(%rbp), %rax
movl -0x3b8(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
addl $0x1, %eax
cmpl -0x3b0(%rbp), %eax
je 0x207d8
movl -0x3b8(%rbp), %eax
cmpl -0x3b4(%rbp), %eax
jne 0x207a2
cmpl $0x0, -0x3b4(%rbp)
je 0x2076a
movl -0x3b4(%rbp), %eax
shll %eax
movl %eax, -0x4b8(%rbp)
jmp 0x20777
movl $0x8, %eax
movl %eax, -0x4b8(%rbp)
jmp 0x20777
movl -0x4b8(%rbp), %eax
movl %eax, -0x3b4(%rbp)
movq -0x3d0(%rbp), %rdi
movl -0x3b4(%rbp), %eax
shll $0x3, %eax
movslq %eax, %rsi
callq 0x21e0
movq %rax, -0x3d0(%rbp)
movslq -0x42c(%rbp), %rdx
shlq $0x20, %rdx
movslq -0x3b0(%rbp), %rax
orq %rax, %rdx
movq -0x3d0(%rbp), %rax
movl -0x3b8(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x3b8(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x20829
movq -0x3d0(%rbp), %rax
movl -0x3b8(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
cmpl -0x42c(%rbp), %eax
jge 0x20827
movslq -0x42c(%rbp), %rdx
shlq $0x20, %rdx
movslq -0x3b0(%rbp), %rax
orq %rax, %rdx
movq -0x3d0(%rbp), %rax
movl -0x3b8(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x20829
jmp 0x2082b
movl -0x42c(%rbp), %eax
cmpl -0x3c0(%rbp), %eax
jle 0x208ff
movl -0x42c(%rbp), %eax
movl %eax, -0x3c0(%rbp)
movl -0x3b0(%rbp), %eax
movl %eax, -0x3bc(%rbp)
movl $0x0, -0x424(%rbp)
movl -0x424(%rbp), %eax
cmpl -0x3ac(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x208ed
movq -0x420(%rbp), %rax
movslq -0x424(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x410(%rbp), %rcx
movslq -0x424(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq %rcx, -0x2a8(%rbp)
movq -0x2a8(%rbp), %rcx
movdqa (%rcx), %xmm0
movq %rax, -0x368(%rbp)
movdqa %xmm0, -0x380(%rbp)
movdqa -0x380(%rbp), %xmm0
movq -0x368(%rbp), %rax
movdqa %xmm0, (%rax)
movl -0x424(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x424(%rbp)
jmp 0x2085f
movl -0x3c0(%rbp), %eax
cmpl -0x3c8(%rbp), %eax
jl 0x208fd
jmp 0x2093d
jmp 0x208ff
movq -0x410(%rbp), %rax
movq %rax, -0x478(%rbp)
movq -0x408(%rbp), %rax
movq %rax, -0x410(%rbp)
movq -0x478(%rbp), %rax
movq %rax, -0x408(%rbp)
movl -0x3b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3b0(%rbp)
jmp 0x2007b
movq -0x4a8(%rbp), %rax
movl -0x3c0(%rbp), %ecx
movl %ecx, (%rax)
movl -0x3bc(%rbp), %ecx
movl %ecx, 0x4(%rax)
movl $0xffffffff, -0x47c(%rbp) # imm = 0xFFFFFFFF
movl -0x3ac(%rbp), %ecx
shll $0x3, %ecx
movl %ecx, -0x488(%rbp)
movq -0x420(%rbp), %rcx
movq %rcx, -0x490(%rbp)
movl $0x0, -0x3b0(%rbp)
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movl -0x3b0(%rbp), %eax
cmpl -0x488(%rbp), %eax
jge 0x20a16
movq -0x490(%rbp), %rax
movzwl (%rax), %eax
cmpl -0x47c(%rbp), %eax
jle 0x209ee
movq -0x490(%rbp), %rax
movzwl (%rax), %eax
movl %eax, -0x47c(%rbp)
movl -0x3b0(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x3b0(%rbp), %eax
movl $0x8, %esi
cltd
idivl %esi
movq -0x4a8(%rbp), %rax
imull -0x3ac(%rbp), %edx
addl %edx, %ecx
movl %ecx, 0x8(%rax)
jmp 0x209f0
movl -0x3b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3b0(%rbp)
movq -0x490(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x490(%rbp)
jmp 0x2098d
cmpq $0x0, -0x3d0(%rbp)
je 0x20b2b
movq -0x4a8(%rbp), %rax
movl (%rax), %eax
movq -0x390(%rbp), %rcx
movzbl 0xa(%rcx), %ecx
addl %ecx, %eax
subl $0x1, %eax
movq -0x390(%rbp), %rcx
movzbl 0xa(%rcx), %ecx
cltd
idivl %ecx
movl %eax, -0x3b0(%rbp)
movl -0x3bc(%rbp), %eax
subl -0x3b0(%rbp), %eax
movl %eax, -0x480(%rbp)
movl -0x3bc(%rbp), %eax
addl -0x3b0(%rbp), %eax
movl %eax, -0x484(%rbp)
movl $0x0, -0x3b0(%rbp)
movl -0x3b0(%rbp), %eax
cmpl -0x3b8(%rbp), %eax
jge 0x20b29
movq -0x3d0(%rbp), %rax
movslq -0x3b0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x494(%rbp)
movl -0x494(%rbp), %eax
cmpl -0x480(%rbp), %eax
jl 0x20ac5
movl -0x494(%rbp), %eax
cmpl -0x484(%rbp), %eax
jle 0x20b13
movq -0x4a8(%rbp), %rcx
movq -0x3d0(%rbp), %rax
movslq -0x3b0(%rbp), %rdx
movq (%rax,%rdx,8), %rax
shrq $0x20, %rax
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jbe 0x20b13
movq -0x4a8(%rbp), %rax
movq -0x3d0(%rbp), %rcx
movslq -0x3b0(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
movl %ecx, 0xc(%rax)
movl -0x494(%rbp), %ecx
movl %ecx, 0x10(%rax)
jmp 0x20b15
movl -0x3b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3b0(%rbp)
jmp 0x20a7f
jmp 0x20b2b
movq -0x3d0(%rbp), %rdi
callq 0x2040
movq -0x4a0(%rbp), %rax
addq $0x4c0, %rsp            # imm = 0x4C0
popq %rbp
retq
nopw (%rax,%rax)