// File: readmapping[P]alfalfa/src/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) && (int)(b[i]>>32) > r.score2)
					r.score2 = b[i]>>32, r.te2 = e;
			}
		}
	}
	free(b);
	return r;
}

// Assembly:
subq $0x4c8, %rsp            # imm = 0x4C8
movq %rdi, 0x18(%rsp)
movq %rdi, %rax
movq %rax, 0x20(%rsp)
movl 0x4d0(%rsp), %eax
movq %rsi, 0x130(%rsp)
movl %edx, 0x12c(%rsp)
movq %rcx, 0x120(%rsp)
movl %r8d, 0x11c(%rsp)
movl %r9d, 0x118(%rsp)
movl $0xffffffff, 0x104(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x100(%rsp)
movq 0xb6c5(%rip), %rax      # 0x80994
movq %rax, (%rdi)
movq 0xb6c3(%rip), %rax      # 0x8099c
movq %rax, 0x8(%rdi)
movq 0xb6c0(%rip), %rax      # 0x809a4
movq %rax, 0x10(%rdi)
movl 0xb6be(%rip), %eax      # 0x809ac
movl %eax, 0x18(%rdi)
movl 0x4d0(%rsp), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
je 0x75314
movl 0x4d0(%rsp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, 0x14(%rsp)
jmp 0x7531f
movl $0x10000, %eax          # imm = 0x10000
movl %eax, 0x14(%rsp)
jmp 0x7531f
movl 0x14(%rsp), %eax
movl %eax, 0xfc(%rsp)
movl 0x4d0(%rsp), %eax
andl $0x20000, %eax          # imm = 0x20000
cmpl $0x0, %eax
je 0x7534d
movl 0x4d0(%rsp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, 0x10(%rsp)
jmp 0x75358
movl $0x10000, %eax          # imm = 0x10000
movl %eax, 0x10(%rsp)
jmp 0x75358
movl 0x10(%rsp), %eax
movl %eax, 0xf8(%rsp)
movl $0x0, 0x108(%rsp)
movl $0x0, 0x10c(%rsp)
movq $0x0, 0xf0(%rsp)
movl $0x0, 0x13c(%rsp)
movl 0x13c(%rsp), %eax
movl %eax, 0x47c(%rsp)
movl %eax, 0x478(%rsp)
movl %eax, 0x474(%rsp)
movl %eax, 0x470(%rsp)
movd 0x47c(%rsp), %xmm0
movd 0x478(%rsp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd 0x474(%rsp), %xmm2
movd 0x470(%rsp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movaps %xmm0, 0x460(%rsp)
movaps 0x460(%rsp), %xmm0
movaps %xmm0, 0xe0(%rsp)
movl 0x11c(%rsp), %eax
movl 0x118(%rsp), %ecx
addl %ecx, %eax
movw %ax, 0x25e(%rsp)
movw 0x25e(%rsp), %ax
movw %ax, 0xc(%rsp)
movw %ax, 0x49e(%rsp)
movw %ax, 0x49c(%rsp)
movw %ax, 0x49a(%rsp)
movw %ax, 0x498(%rsp)
movw %ax, 0x496(%rsp)
movw %ax, 0x494(%rsp)
movw %ax, 0x492(%rsp)
movw %ax, 0x490(%rsp)
movzwl 0x49e(%rsp), %eax
movd %eax, %xmm1
movzwl 0x49c(%rsp), %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 0x49a(%rsp), %eax
movd %eax, %xmm2
movzwl 0x498(%rsp), %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 0x496(%rsp), %eax
movd %eax, %xmm0
movzwl 0x494(%rsp), %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 0x492(%rsp), %eax
movd %eax, %xmm3
movzwl 0x490(%rsp), %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, 0x480(%rsp)
movaps 0x480(%rsp), %xmm0
movaps %xmm0, 0xd0(%rsp)
movw 0x118(%rsp), %ax
movw %ax, 0x25c(%rsp)
movw 0x25c(%rsp), %ax
movw %ax, 0xe(%rsp)
movw %ax, 0x4c6(%rsp)
movw %ax, 0x4c4(%rsp)
movw %ax, 0x4c2(%rsp)
movw %ax, 0x4c0(%rsp)
movw %ax, 0x4be(%rsp)
movw %ax, 0x4bc(%rsp)
movw %ax, 0x4ba(%rsp)
movw %ax, 0x4b8(%rsp)
movzwl 0x4c6(%rsp), %eax
movd %eax, %xmm1
movzwl 0x4c4(%rsp), %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 0x4c2(%rsp), %eax
movd %eax, %xmm2
movzwl 0x4c0(%rsp), %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 0x4be(%rsp), %eax
movd %eax, %xmm0
movzwl 0x4bc(%rsp), %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 0x4ba(%rsp), %eax
movd %eax, %xmm3
movzwl 0x4b8(%rsp), %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, 0x4a0(%rsp)
movdqa 0x4a0(%rsp), %xmm0
movdqa %xmm0, 0xc0(%rsp)
movq 0x130(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0xb8(%rsp)
movq 0x130(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0xb0(%rsp)
movq 0x130(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0xa8(%rsp)
movq 0x130(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0xa0(%rsp)
movq 0x130(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x114(%rsp)
movl $0x0, 0x110(%rsp)
movl 0x110(%rsp), %eax
cmpl 0x114(%rsp), %eax
jge 0x75751
movq 0xa8(%rsp), %rax
movslq 0x110(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa 0xe0(%rsp), %xmm0
movq %rax, 0x210(%rsp)
movdqa %xmm0, 0x200(%rsp)
movdqa 0x200(%rsp), %xmm0
movq 0x210(%rsp), %rax
movdqa %xmm0, (%rax)
movq 0xb8(%rsp), %rax
movslq 0x110(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa 0xe0(%rsp), %xmm0
movq %rax, 0x1f8(%rsp)
movdqa %xmm0, 0x1e0(%rsp)
movdqa 0x1e0(%rsp), %xmm0
movq 0x1f8(%rsp), %rax
movdqa %xmm0, (%rax)
movq 0xa0(%rsp), %rax
movslq 0x110(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa 0xe0(%rsp), %xmm0
movq %rax, 0x1d8(%rsp)
movdqa %xmm0, 0x1c0(%rsp)
movdqa 0x1c0(%rsp), %xmm0
movq 0x1d8(%rsp), %rax
movdqa %xmm0, (%rax)
movl 0x110(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x110(%rsp)
jmp 0x75655
movl $0x0, 0x110(%rsp)
movl 0x110(%rsp), %eax
cmpl 0x12c(%rsp), %eax
jge 0x7607e
movaps 0xe0(%rsp), %xmm0
movaps %xmm0, 0x60(%rsp)
movaps 0xe0(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x130(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x120(%rsp), %rcx
movslq 0x110(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
movl 0x114(%rsp), %edx
imull %edx, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x48(%rsp)
movq 0xb8(%rsp), %rax
movslq 0x114(%rsp), %rcx
shlq $0x4, %rcx
leaq -0x10(%rax,%rcx), %rax
movq %rax, 0x238(%rsp)
movq 0x238(%rsp), %rax
movaps (%rax), %xmm0
movaps %xmm0, 0x70(%rsp)
movaps 0x70(%rsp), %xmm0
pslldq $0x2, %xmm0             # xmm0 = zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
movdqa %xmm0, 0x70(%rsp)
movl $0x0, 0x9c(%rsp)
movl 0x9c(%rsp), %eax
cmpl 0x114(%rsp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x75b66
movdqa 0x70(%rsp), %xmm1
movq 0x48(%rsp), %rax
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x48(%rsp)
movdqa (%rax), %xmm0
movdqa %xmm1, 0x270(%rsp)
movdqa %xmm0, 0x260(%rsp)
movdqa 0x270(%rsp), %xmm0
movdqa 0x260(%rsp), %xmm1
paddsw %xmm1, %xmm0
movdqa %xmm0, 0x70(%rsp)
movq 0xa8(%rsp), %rax
movslq 0x9c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x230(%rsp)
movq 0x230(%rsp), %rax
movdqa (%rax), %xmm0
movdqa %xmm0, 0x80(%rsp)
movdqa 0x70(%rsp), %xmm1
movdqa 0x80(%rsp), %xmm0
movdqa %xmm1, 0x390(%rsp)
movdqa %xmm0, 0x380(%rsp)
movdqa 0x390(%rsp), %xmm0
movdqa 0x380(%rsp), %xmm1
pmaxsw %xmm1, %xmm0
movdqa %xmm0, 0x70(%rsp)
movdqa 0x70(%rsp), %xmm1
movdqa 0x60(%rsp), %xmm0
movdqa %xmm1, 0x370(%rsp)
movdqa %xmm0, 0x360(%rsp)
movdqa 0x370(%rsp), %xmm0
movdqa 0x360(%rsp), %xmm1
pmaxsw %xmm1, %xmm0
movdqa %xmm0, 0x70(%rsp)
movdqa 0x50(%rsp), %xmm1
movdqa 0x70(%rsp), %xmm0
movdqa %xmm1, 0x350(%rsp)
movdqa %xmm0, 0x340(%rsp)
movdqa 0x350(%rsp), %xmm0
movdqa 0x340(%rsp), %xmm1
pmaxsw %xmm1, %xmm0
movdqa %xmm0, 0x50(%rsp)
movq 0xb0(%rsp), %rax
movslq 0x9c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa 0x70(%rsp), %xmm0
movq %rax, 0x1b8(%rsp)
movdqa %xmm0, 0x1a0(%rsp)
movdqa 0x1a0(%rsp), %xmm0
movq 0x1b8(%rsp), %rax
movdqa %xmm0, (%rax)
movdqa 0x70(%rsp), %xmm1
movdqa 0xd0(%rsp), %xmm0
movdqa %xmm1, 0x430(%rsp)
movdqa %xmm0, 0x420(%rsp)
movdqa 0x430(%rsp), %xmm0
movdqa 0x420(%rsp), %xmm1
psubusw %xmm1, %xmm0
movdqa %xmm0, 0x70(%rsp)
movdqa 0x80(%rsp), %xmm1
movdqa 0xc0(%rsp), %xmm0
movdqa %xmm1, 0x410(%rsp)
movdqa %xmm0, 0x400(%rsp)
movdqa 0x410(%rsp), %xmm0
movdqa 0x400(%rsp), %xmm1
psubusw %xmm1, %xmm0
movdqa %xmm0, 0x80(%rsp)
movdqa 0x80(%rsp), %xmm1
movdqa 0x70(%rsp), %xmm0
movdqa %xmm1, 0x330(%rsp)
movdqa %xmm0, 0x320(%rsp)
movdqa 0x330(%rsp), %xmm0
movdqa 0x320(%rsp), %xmm1
pmaxsw %xmm1, %xmm0
movdqa %xmm0, 0x80(%rsp)
movq 0xa8(%rsp), %rax
movslq 0x9c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movdqa 0x80(%rsp), %xmm0
movq %rax, 0x198(%rsp)
movdqa %xmm0, 0x180(%rsp)
movdqa 0x180(%rsp), %xmm0
movq 0x198(%rsp), %rax
movdqa %xmm0, (%rax)
movdqa 0x60(%rsp), %xmm1
movdqa 0xc0(%rsp), %xmm0
movdqa %xmm1, 0x3f0(%rsp)
movdqa %xmm0, 0x3e0(%rsp)
movdqa 0x3f0(%rsp), %xmm0
movdqa 0x3e0(%rsp), %xmm1
psubusw %xmm1, %xmm0
movdqa %xmm0, 0x60(%rsp)
movdqa 0x60(%rsp), %xmm1
movdqa 0x70(%rsp), %xmm0
movdqa %xmm1, 0x310(%rsp)
movdqa %xmm0, 0x300(%rsp)
movdqa 0x310(%rsp), %xmm0
movdqa 0x300(%rsp), %xmm1
pmaxsw %xmm1, %xmm0
movdqa %xmm0, 0x60(%rsp)
movq 0xb8(%rsp), %rax
movslq 0x9c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x228(%rsp)
movq 0x228(%rsp), %rax
movdqa (%rax), %xmm0
movdqa %xmm0, 0x70(%rsp)
movl 0x9c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9c(%rsp)
jmp 0x7580f
movl $0x0, 0x98(%rsp)
cmpl $0x10, 0x98(%rsp)
setl %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x75d62
movaps 0x60(%rsp), %xmm0
pslldq $0x2, %xmm0             # xmm0 = zero,zero,xmm0[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
movdqa %xmm0, 0x60(%rsp)
movl $0x0, 0x9c(%rsp)
movl 0x9c(%rsp), %eax
cmpl 0x114(%rsp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x75d4a
movq 0xb0(%rsp), %rax
movslq 0x9c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x220(%rsp)
movq 0x220(%rsp), %rax
movaps (%rax), %xmm0
movaps %xmm0, 0x70(%rsp)
movaps 0x70(%rsp), %xmm1
movaps 0x60(%rsp), %xmm0
movaps %xmm1, 0x2f0(%rsp)
movaps %xmm0, 0x2e0(%rsp)
movaps 0x2f0(%rsp), %xmm0
movaps 0x2e0(%rsp), %xmm1
pmaxsw %xmm1, %xmm0
movaps %xmm0, 0x70(%rsp)
movq 0xb0(%rsp), %rax
movslq 0x9c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movaps 0x70(%rsp), %xmm0
movq %rax, 0x178(%rsp)
movaps %xmm0, 0x160(%rsp)
movaps 0x160(%rsp), %xmm0
movq 0x178(%rsp), %rax
movaps %xmm0, (%rax)
movaps 0x70(%rsp), %xmm1
movaps 0xd0(%rsp), %xmm0
movaps %xmm1, 0x3d0(%rsp)
movaps %xmm0, 0x3c0(%rsp)
movaps 0x3d0(%rsp), %xmm0
movaps 0x3c0(%rsp), %xmm1
psubusw %xmm1, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps 0x60(%rsp), %xmm1
movaps 0xc0(%rsp), %xmm0
movaps %xmm1, 0x3b0(%rsp)
movaps %xmm0, 0x3a0(%rsp)
movaps 0x3b0(%rsp), %xmm0
movaps 0x3a0(%rsp), %xmm1
psubusw %xmm1, %xmm0
movaps %xmm0, 0x60(%rsp)
movaps 0x60(%rsp), %xmm1
movaps 0x70(%rsp), %xmm0
movaps %xmm1, 0x450(%rsp)
movaps %xmm0, 0x440(%rsp)
movaps 0x450(%rsp), %xmm0
movaps 0x440(%rsp), %xmm1
pcmpgtw %xmm1, %xmm0
movdqa %xmm0, 0x240(%rsp)
movdqa 0x240(%rsp), %xmm0
pmovmskb %xmm0, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x75d32
jmp 0x75d64
jmp 0x75d34
movl 0x9c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9c(%rsp)
jmp 0x75ba8
jmp 0x75d4c
movl 0x98(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x98(%rsp)
jmp 0x75b71
jmp 0x75d64
jmp 0x75d66
movaps 0x50(%rsp), %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, 0x2d0(%rsp)
movaps %xmm0, 0x2c0(%rsp)
movaps 0x2d0(%rsp), %xmm0
movaps 0x2c0(%rsp), %xmm1
pmaxsw %xmm1, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps 0x50(%rsp), %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, 0x2b0(%rsp)
movaps %xmm0, 0x2a0(%rsp)
movaps 0x2b0(%rsp), %xmm0
movaps 0x2a0(%rsp), %xmm1
pmaxsw %xmm1, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps 0x50(%rsp), %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, 0x290(%rsp)
movaps %xmm0, 0x280(%rsp)
movaps 0x290(%rsp), %xmm0
movaps 0x280(%rsp), %xmm1
pmaxsw %xmm1, %xmm0
movaps %xmm0, 0x50(%rsp)
movl 0x50(%rsp), %eax
movzwl %ax, %eax
movl %eax, 0x94(%rsp)
movl 0x94(%rsp), %eax
cmpl 0xfc(%rsp), %eax
jl 0x75f53
cmpl $0x0, 0x108(%rsp)
je 0x75e5d
movq 0xf0(%rsp), %rax
movl 0x108(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
addl $0x1, %eax
cmpl 0x110(%rsp), %eax
je 0x75ef9
movl 0x108(%rsp), %eax
cmpl 0x10c(%rsp), %eax
jne 0x75ebe
cmpl $0x0, 0x10c(%rsp)
je 0x75e86
movl 0x10c(%rsp), %eax
shll %eax
movl %eax, 0x8(%rsp)
jmp 0x75e91
movl $0x8, %eax
movl %eax, 0x8(%rsp)
jmp 0x75e91
movl 0x8(%rsp), %eax
movl %eax, 0x10c(%rsp)
movq 0xf0(%rsp), %rdi
movl 0x10c(%rsp), %eax
shll $0x3, %eax
movslq %eax, %rsi
callq 0x86d0
movq %rax, 0xf0(%rsp)
movslq 0x94(%rsp), %rdx
shlq $0x20, %rdx
movslq 0x110(%rsp), %rax
orq %rax, %rdx
movq 0xf0(%rsp), %rax
movl 0x108(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x108(%rsp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x75f51
movq 0xf0(%rsp), %rax
movl 0x108(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
cmpl 0x94(%rsp), %eax
jge 0x75f4f
movslq 0x94(%rsp), %rdx
shlq $0x20, %rdx
movslq 0x110(%rsp), %rax
orq %rax, %rdx
movq 0xf0(%rsp), %rax
movl 0x108(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x75f51
jmp 0x75f53
movl 0x94(%rsp), %eax
cmpl 0x100(%rsp), %eax
jle 0x7603e
movl 0x94(%rsp), %eax
movl %eax, 0x100(%rsp)
movl 0x110(%rsp), %eax
movl %eax, 0x104(%rsp)
movl $0x0, 0x9c(%rsp)
movl 0x9c(%rsp), %eax
cmpl 0x114(%rsp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x7602a
movq 0xa0(%rsp), %rax
movslq 0x9c(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0xb0(%rsp), %rcx
movslq 0x9c(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq %rcx, 0x218(%rsp)
movq 0x218(%rsp), %rcx
movdqa (%rcx), %xmm0
movq %rax, 0x158(%rsp)
movdqa %xmm0, 0x140(%rsp)
movdqa 0x140(%rsp), %xmm0
movq 0x158(%rsp), %rax
movdqa %xmm0, (%rax)
movl 0x9c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9c(%rsp)
jmp 0x75f8e
movl 0x100(%rsp), %eax
cmpl 0xf8(%rsp), %eax
jl 0x7603c
jmp 0x7607e
jmp 0x7603e
movq 0xb0(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0xb8(%rsp)
movl 0x110(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x110(%rsp)
jmp 0x7575c
movq 0x18(%rsp), %rax
movl 0x100(%rsp), %ecx
movl %ecx, (%rax)
movl 0x104(%rsp), %ecx
movl %ecx, 0x4(%rax)
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
movl 0x114(%rsp), %ecx
shll $0x3, %ecx
movl %ecx, 0x38(%rsp)
movq 0xa0(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movl $0x0, 0x110(%rsp)
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movl 0x110(%rsp), %eax
cmpl 0x38(%rsp), %eax
jge 0x76147
movq 0x30(%rsp), %rax
movzwl (%rax), %eax
cmpl 0x44(%rsp), %eax
jle 0x76124
movq 0x30(%rsp), %rax
movzwl (%rax), %eax
movl %eax, 0x44(%rsp)
movl 0x110(%rsp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl 0x110(%rsp), %eax
movl $0x8, %esi
cltd
idivl %esi
movq 0x18(%rsp), %rax
imull 0x114(%rsp), %edx
addl %edx, %ecx
movl %ecx, 0x8(%rax)
jmp 0x76126
movl 0x110(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x110(%rsp)
movq 0x30(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x30(%rsp)
jmp 0x760cb
cmpq $0x0, 0xf0(%rsp)
je 0x76256
movq 0x18(%rsp), %rax
movl (%rax), %eax
movq 0x130(%rsp), %rcx
movzbl 0xa(%rcx), %ecx
addl %ecx, %eax
subl $0x1, %eax
movq 0x130(%rsp), %rcx
movzbl 0xa(%rcx), %ecx
cltd
idivl %ecx
movl %eax, 0x110(%rsp)
movl 0x104(%rsp), %eax
subl 0x110(%rsp), %eax
movl %eax, 0x40(%rsp)
movl 0x104(%rsp), %eax
addl 0x110(%rsp), %eax
movl %eax, 0x3c(%rsp)
movl $0x0, 0x110(%rsp)
movl 0x110(%rsp), %eax
cmpl 0x108(%rsp), %eax
jge 0x76254
movq 0xf0(%rsp), %rax
movslq 0x110(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
cmpl 0x40(%rsp), %eax
jl 0x761f3
movl 0x2c(%rsp), %eax
cmpl 0x3c(%rsp), %eax
jle 0x7623c
movq 0x18(%rsp), %rcx
movq 0xf0(%rsp), %rax
movslq 0x110(%rsp), %rdx
movq (%rax,%rdx,8), %rax
shrq $0x20, %rax
cmpl 0xc(%rcx), %eax
jle 0x7623c
movq 0x18(%rsp), %rax
movq 0xf0(%rsp), %rcx
movslq 0x110(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
movl %ecx, 0xc(%rax)
movl 0x2c(%rsp), %ecx
movl %ecx, 0x10(%rax)
jmp 0x7623e
movl 0x110(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x110(%rsp)
jmp 0x761b3
jmp 0x76256
movq 0xf0(%rsp), %rdi
callq 0x8470
movq 0x20(%rsp), %rax
addq $0x4c8, %rsp            # imm = 0x4C8
retq