// File: /workspace/github_c_makefile_star2_O3/nh13[P]ksw/src/ksw2/ksw2_gg2.c
// Function: ksw_gg2
int ksw_gg2(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 *m_cigar_, int *n_cigar_, uint32_t **cigar_)
{
	int qe = q + e, qe2 = qe + qe, r, t, n_col, *off = 0, H0 = 0, last_H0_t = 0;
	int8_t *u, *v, *x, *y, *s;
	uint8_t *p = 0, *qr;

	u = (int8_t*)kcalloc(km, tlen + 1, 1);
	v = (int8_t*)kcalloc(km, tlen + 1, 1);
	x = (int8_t*)kcalloc(km, tlen + 1, 1);
	y = (int8_t*)kcalloc(km, tlen + 1, 1);
	s = (int8_t*)kmalloc(km, tlen);
	qr = (uint8_t*)kmalloc(km, qlen);
	if (w < 0) w = tlen > qlen? tlen : qlen;
	n_col = w + 1 < tlen? w + 1 : tlen;
	if (m_cigar_ && n_cigar_ && cigar_) {
		p = (uint8_t*)kcalloc(km, (qlen + tlen) * n_col, 1);
		off = (int*)kmalloc(km, (qlen + tlen) * sizeof(int));
	}

	for (t = 0; t < qlen; ++t)
		qr[t] = query[qlen - 1 - t];

	for (r = 0; r < qlen + tlen - 1; ++r) {
		int st = 0, en = tlen - 1;
		int8_t x1, v1;
		// find the boundaries
		if (st < r - qlen + 1) st = r - qlen + 1;
		if (en > r) en = r;
		if (st < (r-w+1)>>1) st = (r-w+1)>>1; // take the ceil
		if (en > (r+w)>>1) en = (r+w)>>1; // take the floor
		// set boundary conditions
		if (st != 0) {
			if (r > st + st + w - 1) x1 = v1 = 0;
			else x1 = x[st-1], v1 = v[st-1]; // (r-1, st-1) in the band
		} else x1 = 0, v1 = r? q : 0;
		if (en != r) {
			if (r < en + en - w - 1) y[en] = u[en] = 0; // (r-1,en) out of the band; TODO: is this line necessary?
		} else y[r] = 0, u[r] = r? q : 0;
		// loop fission: set scores first
		for (t = st; t <= en; ++t)
			s[t] = mat[target[t] * m + qr[t + qlen - 1 - r]];
		// core loop
		if (m_cigar_ && n_cigar_ && cigar_) {
			uint8_t *pr = p + r * n_col;
			off[r] = st;
			for (t = st; t <= en; ++t) {
				/* At the beginning of the loop, v1=v(r-1,t-1), x1=x(r-1,t-1), u[t]=u(r-1,t), v[t]=v(r-1,t), x[t]=x(r-1,t), y[t]=y(r-1,t)
				   a      = x(r-1,t-1) + v(r-1,t-1)
				   b      = y(r-1,t)   + u(r-1,t)
				   z      = max{ S(t,r-t) + 2q + 2r, a, b }
				   u(r,t) = z - v(r-1,t-1)
				   v(r,t) = z - u(r-1,t)
				   x(r,t) = max{ 0, a - z + q }
				   y(r,t) = max{ 0, b - z + q }
				 */
				uint8_t d;
				int8_t u1;
				int8_t z = s[t] + qe2;
				int8_t a = x1   + v1;
				int8_t b = y[t] + u[t];
				d = a > z? 1 : 0; // d = z >= a? 0 : 1
				z = a > z? a : z;
				d = b > z? 2 : d;
				z = b > z? b : z;
				u1 = u[t];              // u1   = u(r-1,t) (temporary variable)
				u[t] = z - v1;          // u[t] = u(r,t)
				v1 = v[t];              // v1   = v(r-1,t) (set for the next iteration)
				v[t] = z - u1;          // v[t] = v(r,t)
				z -= q;
				a -= z;
				b -= z;
				x1 = x[t];              // x1   = x(r-1,t) (set for the next iteration)
				d   |= a > 0? 0x08 : 0;
				x[t] = a > 0? a    : 0; // x[t] = x(r,t)
				d   |= b > 0? 0x10 : 0;
				y[t] = b > 0? b    : 0; // y[t] = y(r,t)
				pr[t - st] = d;
			}
		} else {
			for (t = st; t <= en; ++t) {
				int8_t u1;
				int8_t z = s[t] + qe2;
				int8_t a = x1   + v1;
				int8_t b = y[t] + u[t];
				z = a > z? a : z;
				z = b > z? b : z;
				u1 = u[t];
				u[t] = z - v1;
				v1 = v[t];
				v[t] = z - u1;
				z -= q;
				a -= z;
				b -= z;
				x1 = x[t];
				x[t] = a > 0? a : 0;
				y[t] = b > 0? b : 0;
			}
		}
		if (r > 0) {
			if (last_H0_t >= st && last_H0_t <= en)
				H0 += v[last_H0_t] - qe;
			else ++last_H0_t, H0 += u[last_H0_t] - qe;
		} else H0 = v[0] - qe - qe, last_H0_t = 0;
	}
	kfree(km, u); kfree(km, v); kfree(km, x); kfree(km, y); kfree(km, s); kfree(km, qr);
	if (m_cigar_ && n_cigar_ && cigar_) {
		ksw_backtrack(km, 1, 0, 0, p, off, 0, n_col, tlen-1, qlen-1, m_cigar_, n_cigar_, cigar_);
		kfree(km, p); kfree(km, off);
	}
	return H0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %r9d, 0x28(%rsp)
movq %r8, 0xc8(%rsp)
movl %ecx, %r13d
movq %rdx, 0x48(%rsp)
movl %esi, %r12d
movq %rdi, %r15
movl 0x138(%rsp), %ebx
leal 0x1(%r13), %eax
movslq %eax, %r14
movl $0x1, %edx
movq %r14, %rsi
callq 0x1fbc89
movq %rax, 0x20(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fbc89
movq %rax, 0x18(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fbc89
movq %rax, 0x70(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fbc89
movq %rax, 0x40(%rsp)
movslq %r13d, %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x1fbb34
movq %rax, 0x78(%rsp)
movslq %r12d, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fbb34
movq %rax, 0x80(%rsp)
movq %r14, 0xa8(%rsp)
cmpl %r14d, %ebp
movl %r12d, %r14d
cmovgl %r13d, %r14d
testl %ebx, %ebx
cmovnsl %ebx, %r14d
leal 0x1(%r14), %edi
cmpl %ebp, %edi
cmovgel %r13d, %edi
cmpq $0x0, 0x140(%rsp)
setne %al
cmpq $0x0, 0x148(%rsp)
setne %cl
andb %al, %cl
cmpq $0x0, 0x150(%rsp)
setne %al
andb %cl, %al
movb %al, 0x6(%rsp)
cmpb $0x1, %al
movq %r15, 0x10(%rsp)
movq %r12, 0x90(%rsp)
movl %edi, 0x8(%rsp)
jne 0x20337f
leal (%r12,%r13), %ebx
movl %edi, %eax
imull %ebx, %eax
movslq %eax, %rsi
movl $0x1, %edx
movq %r15, %rdi
callq 0x1fbc89
movq %rax, 0x60(%rsp)
movslq %ebx, %rsi
shlq $0x2, %rsi
movq %r15, %rdi
callq 0x1fbb34
movl 0x8(%rsp), %edi
movq 0x90(%rsp), %r12
movq %rax, 0x30(%rsp)
jmp 0x203391
movq $0x0, 0x60(%rsp)
movq $0x0, 0x30(%rsp)
movl %r12d, %eax
testl %r12d, %r12d
setg %r8b
movq 0x80(%rsp), %r15
jle 0x2033cc
movq 0xa8(%rsp), %rcx
movq 0x48(%rsp), %rdx
addq %rdx, %rcx
decq %rcx
xorl %edx, %edx
movb (%rcx), %sil
movb %sil, (%r15,%rdx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0x2033ba
movb %r8b, 0x7(%rsp)
leal -0x1(%r13), %ecx
movq %rcx, 0x68(%rsp)
movq %r13, 0x58(%rsp)
leal (%r12,%r13), %ecx
decl %ecx
testl %ecx, %ecx
jle 0x203875
movsbl 0x128(%rsp), %edx
movsbl 0x130(%rsp), %esi
addl %edx, %esi
movq %rsi, 0x98(%rsp)
leal (%rsi,%rsi), %r9d
movl %r14d, %esi
notl %esi
movq %rsi, 0xc0(%rsp)
movsbq 0x28(%rsp), %rsi
movq %rsi, 0xb8(%rsp)
movslq %edi, %rsi
movq %rsi, 0xd8(%rsp)
movl %ecx, %ecx
movq %rcx, 0xd0(%rsp)
xorl %r8d, %r8d
movzbl %dl, %ecx
movl %ecx, 0x54(%rsp)
movq 0x60(%rsp), %rcx
movq %rcx, 0x88(%rsp)
xorl %r11d, %r11d
xorl %ebp, %ebp
xorl %esi, %esi
movq 0x68(%rsp), %r12
movq %r14, 0xa0(%rsp)
movl %edx, 0x50(%rsp)
movl %r9d, 0x48(%rsp)
movq %rsi, 0xe0(%rsp)
movq %r11, %rdx
subq 0xa8(%rsp), %rdx
leal 0x1(%rdx), %ecx
testq %rdx, %rdx
cmovsl %r8d, %ecx
cmpl %r11d, %r12d
movl %r11d, %edi
cmovll %r12d, %edi
leal (%r14,%r11), %r10d
movl %r11d, %esi
subl %r14d, %esi
incl %esi
sarl %esi
cmpl %esi, %ecx
movl %esi, %ebx
cmovgl %ecx, %ebx
sarl %r10d
cmpl %r10d, %edi
cmovll %edi, %r10d
testl %ebx, %ebx
je 0x2034dc
leal (%r14,%rbx,2), %edi
movslq %edi, %rdi
cmpq %rdi, %r11
jge 0x2034ed
leal -0x1(%rbx), %edi
movq 0x70(%rsp), %rdx
movb (%rdx,%rdi), %r13b
movq 0x18(%rsp), %rdx
movb (%rdx,%rdi), %r14b
jmp 0x2034f3
xorl %r13d, %r13d
testq %r11, %r11
movl 0x54(%rsp), %r14d
cmovel %r13d, %r14d
jmp 0x2034f3
xorl %r14d, %r14d
xorl %r13d, %r13d
movl %r10d, %edi
cmpq %rdi, %r11
jne 0x20351b
movq 0x40(%rsp), %rdx
movb $0x0, (%rdx,%r11)
testq %r11, %r11
movl 0x54(%rsp), %edi
cmovel %r8d, %edi
movq 0x20(%rsp), %rdx
movb %dil, (%rdx,%r11)
jmp 0x203544
movq 0xc0(%rsp), %rdx
leal (%rdx,%r10,2), %edi
movslq %edi, %rdi
cmpq %rdi, %r11
jge 0x203544
movslq %r10d, %rdi
movq 0x20(%rsp), %rdx
movb %r8b, (%rdx,%rdi)
movq 0x40(%rsp), %rdx
movb %r8b, (%rdx,%rdi)
movq %rbx, 0x38(%rsp)
cmpl %r10d, %ebx
movl %ebp, 0xc(%rsp)
movq %r10, 0x28(%rsp)
movq %r11, 0xb0(%rsp)
jle 0x203584
cmpb $0x0, 0x6(%rsp)
je 0x2037ba
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdx
movq 0xb0(%rsp), %rsi
movl %edx, (%rcx,%rsi,4)
jmp 0x2037ba
cmpl %esi, %ecx
cmovgl %ecx, %esi
movslq %esi, %rbx
movslq %r10d, %rcx
decq %rbx
movq %rbx, %rsi
movq 0xc8(%rsp), %rdx
movq 0x78(%rsp), %r9
movq 0x120(%rsp), %r10
movq 0xb8(%rsp), %r12
movzbl 0x1(%rdx,%rsi), %edi
imulq %r12, %rdi
leal (%rax,%rsi), %r8d
movslq %r8d, %r8
movzbl (%r15,%r8), %r8d
addq %r10, %rdi
movb (%r8,%rdi), %dil
movb %dil, 0x1(%r9,%rsi)
incq %rsi
cmpq %rcx, %rsi
jl 0x2035b2
cmpb $0x0, 0x6(%rsp)
movl 0x48(%rsp), %r9d
je 0x2036ef
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rsi
movl %esi, (%rdx,%r11,4)
cmpl 0x28(%rsp), %esi
movl 0x50(%rsp), %r15d
jg 0x2037ba
movq 0x88(%rsp), %rsi
movq 0x78(%rsp), %rdx
movb 0x1(%rdx,%rbx), %r8b
addb %r9b, %r8b
addb %r14b, %r13b
movq 0x20(%rsp), %rdx
movl %r15d, %r11d
movb 0x1(%rdx,%rbx), %r15b
movq 0x40(%rsp), %r9
movb 0x1(%r9,%rbx), %r12b
addb %r15b, %r12b
xorl %edi, %edi
cmpb %r8b, %r13b
movzbl %r8b, %ebp
movzbl %r13b, %r10d
cmovgl %r10d, %ebp
setg %dil
cmpb %bpl, %r12b
movl $0x2, %r8d
cmovgl %r8d, %edi
movzbl %r12b, %r8d
cmovgl %r8d, %ebp
movl %ebp, %r12d
subb %r14b, %r12b
movb %r12b, 0x1(%rdx,%rbx)
movl %ebp, %r12d
subb %r15b, %r12b
movl %r11d, %r15d
xorl %r11d, %r11d
subb %r15b, %bpl
subb %bpl, %r10b
subb %bpl, %r8b
movq 0x18(%rsp), %rdx
movb 0x1(%rdx,%rbx), %r14b
movb %r12b, 0x1(%rdx,%rbx)
testb %r10b, %r10b
setg %bpl
movzbl %r10b, %r10d
cmovlel %r11d, %r10d
shlb $0x3, %bpl
orb %dil, %bpl
movq 0x70(%rsp), %rdx
movb 0x1(%rdx,%rbx), %r13b
movb %r10b, 0x1(%rdx,%rbx)
testb %r8b, %r8b
movzbl %r8b, %edi
cmovlel %r11d, %edi
movb %dil, 0x1(%r9,%rbx)
movl 0x48(%rsp), %r9d
setg %dil
shlb $0x4, %dil
orb %bpl, %dil
movb %dil, (%rsi)
incq %rbx
incq %rsi
cmpq %rcx, %rbx
jl 0x203610
jmp 0x2037ba
movq 0x38(%rsp), %rcx
cmpl 0x28(%rsp), %ecx
movl 0x50(%rsp), %r11d
jg 0x2037ba
movl 0x38(%rsp), %ecx
movq 0x70(%rsp), %rdx
leaq (%rdx,%rcx), %rsi
movq 0x18(%rsp), %rdx
leaq (%rdx,%rcx), %rdi
movq 0x20(%rsp), %rdx
leaq (%rdx,%rcx), %r8
movq 0x40(%rsp), %rdx
leaq (%rdx,%rcx), %r10
addq 0x78(%rsp), %rcx
xorl %r15d, %r15d
movb (%rcx,%r15), %bpl
addb %r9b, %bpl
addb %r14b, %r13b
movb (%r8,%r15), %r12b
movb (%r10,%r15), %r9b
addb %r12b, %r9b
movzbl %bpl, %ebp
movzbl %r13b, %edx
cmpb %bpl, %dl
cmovgl %edx, %ebp
movzbl %r9b, %r9d
cmpb %bpl, %r9b
cmovgl %r9d, %ebp
movl %ebp, %r13d
subb %r14b, %r13b
movb %r13b, (%r8,%r15)
movl %ebp, %r13d
subb %r12b, %r13b
xorl %r12d, %r12d
movb (%rdi,%r15), %r14b
movb %r13b, (%rdi,%r15)
subb %r11b, %bpl
subb %bpl, %dl
subb %bpl, %r9b
movb (%rsi,%r15), %r13b
movzbl %dl, %edx
testb %dl, %dl
cmovlel %r12d, %edx
movb %dl, (%rsi,%r15)
movzbl %r9b, %edx
movl 0x48(%rsp), %r9d
testb %dl, %dl
cmovlel %r12d, %edx
movb %dl, (%r10,%r15)
incq %r15
leal (%r15,%rbx), %edx
cmpl %edx, 0x28(%rsp)
jg 0x203733
movq 0xb0(%rsp), %r11
testq %r11, %r11
je 0x203803
movq 0xe0(%rsp), %rsi
cmpl 0x38(%rsp), %esi
movq 0x68(%rsp), %r12
movq 0x80(%rsp), %r15
movq 0xa0(%rsp), %r14
movl $0x0, %r8d
jl 0x20382a
cmpl 0x28(%rsp), %esi
jg 0x20382a
movl %esi, %ecx
movq 0x18(%rsp), %rdx
movsbl (%rdx,%rcx), %ecx
jmp 0x20383a
movq 0x18(%rsp), %rcx
movsbl (%rcx), %ebp
subl %r9d, %ebp
xorl %esi, %esi
movq 0x68(%rsp), %r12
movq 0x80(%rsp), %r15
movq 0xa0(%rsp), %r14
xorl %r8d, %r8d
jmp 0x203847
movslq %esi, %rsi
movq 0x20(%rsp), %rcx
movsbl 0x1(%rcx,%rsi), %ecx
incq %rsi
movl 0xc(%rsp), %ebp
subl 0x98(%rsp), %ebp
addl %ecx, %ebp
incq %r11
decq %rax
movq 0x88(%rsp), %rcx
addq 0xd8(%rsp), %rcx
movq %rcx, 0x88(%rsp)
cmpq 0xd0(%rsp), %r11
jne 0x20346f
jmp 0x20387c
xorl %ebp, %ebp
movq 0x68(%rsp), %r12
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0x1fb9e0
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0x1fb9e0
movq %rbx, %rdi
movq 0x70(%rsp), %rsi
callq 0x1fb9e0
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
callq 0x1fb9e0
movq %rbx, %rdi
movq 0x78(%rsp), %rsi
callq 0x1fb9e0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1fb9e0
cmpb $0x0, 0x6(%rsp)
je 0x203c7b
movq 0x90(%rsp), %r9
decl %r9d
movq 0x140(%rsp), %rax
movl (%rax), %r14d
movq 0x150(%rsp), %rax
movq (%rax), %rax
movl %r12d, %ecx
orl %r9d, %ecx
js 0x203b21
movl %ebp, 0xc(%rsp)
xorl %ebx, %ebx
movl $0x2, %ebp
xorl %r15d, %r15d
movq 0x10(%rsp), %rdi
movl 0x8(%rsp), %r10d
leal (%r9,%r12), %ecx
movq 0x30(%rsp), %rdx
movl (%rdx,%rcx,4), %edx
movl $0x0, %esi
cmpl %edx, %r12d
jl 0x203948
imull %r10d, %ecx
addl %r12d, %ecx
subl %edx, %ecx
movslq %ecx, %rcx
movq 0x60(%rsp), %rsi
movzbl (%rsi,%rcx), %esi
testl %ebx, %ebx
je 0x203969
movl %esi, %r8d
movl %ebx, %ecx
shrl %cl, %r8d
shll $0x1d, %r8d
sarl $0x1f, %r8d
andl %ebx, %r8d
andl $0x7, %esi
movl %esi, %ebx
movl %r8d, %esi
jmp 0x20396e
andl $0x7, %esi
movl %esi, %ebx
testl %esi, %esi
cmovnel %esi, %ebx
cmpl %edx, %r12d
cmovll %ebp, %ebx
cmpl $0x3, %ebx
je 0x2039e9
cmpl $0x1, %ebx
je 0x2039e9
testl %ebx, %ebx
jne 0x203a51
testl %r15d, %r15d
je 0x2039a0
movslq %r15d, %rcx
movl -0x4(%rax,%rcx,4), %edx
testb $0xf, %dl
je 0x203ac1
cmpl %r14d, %r15d
jne 0x2039d7
addl %r14d, %r14d
testl %r15d, %r15d
movl $0x4, %ecx
cmovel %ecx, %r14d
leal (,%r14,4), %ecx
movslq %ecx, %rdx
movq %rax, %rsi
movq %r9, %r13
callq 0x1fbaa1
movl 0x8(%rsp), %r10d
movq %r13, %r9
movq 0x10(%rsp), %rdi
movslq %r15d, %rcx
incl %r15d
movl $0x10, (%rax,%rcx,4)
jmp 0x203ac8
testl %r15d, %r15d
je 0x203a08
movslq %r15d, %rcx
movl -0x4(%rax,%rcx,4), %edx
movl %edx, %esi
andl $0xf, %esi
cmpl $0x2, %esi
jne 0x203a08
addl $0x10, %edx
movl %edx, -0x4(%rax,%rcx,4)
jmp 0x203a4c
cmpl %r14d, %r15d
jne 0x203a3f
addl %r14d, %r14d
testl %r15d, %r15d
movl $0x4, %ecx
cmovel %ecx, %r14d
leal (,%r14,4), %ecx
movslq %ecx, %rdx
movq %rax, %rsi
movq %r9, %r13
callq 0x1fbaa1
movl 0x8(%rsp), %r10d
movq %r13, %r9
movq 0x10(%rsp), %rdi
movslq %r15d, %rcx
incl %r15d
movl $0x12, (%rax,%rcx,4)
decl %r12d
jmp 0x203ace
movslq %r15d, %r13
testl %r15d, %r15d
je 0x203a72
movl -0x4(%rax,%r13,4), %ecx
movl %ecx, %edx
andl $0xf, %edx
cmpl $0x1, %edx
jne 0x203a72
addl $0x10, %ecx
movl %ecx, -0x4(%rax,%r13,4)
jmp 0x203acb
cmpl %r14d, %r15d
jne 0x203ab4
addl %r14d, %r14d
testl %r15d, %r15d
movl $0x4, %ecx
cmovel %ecx, %r14d
leal (,%r14,4), %ecx
movslq %ecx, %rdx
movq %rax, %rsi
movq %r12, %rbp
movq %r9, %r12
callq 0x1fbaa1
movl 0x8(%rsp), %r10d
movq %r12, %r9
movq %rbp, %r12
movl $0x2, %ebp
movq 0x10(%rsp), %rdi
incl %r15d
movl $0x11, (%rax,%r13,4)
jmp 0x203acb
addl $0x10, %edx
movl %edx, -0x4(%rax,%rcx,4)
decl %r12d
decl %r9d
testl %r9d, %r9d
setns %r8b
testl %r12d, %r12d
js 0x203ae3
testl %r9d, %r9d
jns 0x20391d
testl %r12d, %r12d
js 0x203b39
incl %r12d
testl %r15d, %r15d
movl 0xc(%rsp), %ebp
je 0x203b3f
movslq %r15d, %rcx
movl -0x4(%rax,%rcx,4), %edx
movl %edx, %esi
andl $0xf, %esi
cmpl $0x2, %esi
jne 0x203b46
shll $0x4, %r12d
addl %r12d, %edx
movl %edx, -0x4(%rax,%rcx,4)
testl %r9d, %r9d
js 0x203c12
incl %r9d
jmp 0x203bae
xorl %r15d, %r15d
movb $0x1, %cl
cmpl $0x0, 0x58(%rsp)
movq 0x10(%rsp), %rdi
movb 0x7(%rsp), %r8b
jg 0x203b4d
jmp 0x203b9a
movl 0xc(%rsp), %ebp
jmp 0x203b9a
xorl %r15d, %r15d
movb $0x1, %cl
jmp 0x203b48
xorl %ecx, %ecx
movq %r12, 0x58(%rsp)
cmpl %r14d, %r15d
jne 0x203b86
leal (%r15,%r15), %edx
testb %cl, %cl
movl $0x4, %r14d
cmovel %edx, %r14d
leal (,%r14,4), %ecx
movslq %ecx, %rdx
movq %rax, %rsi
movq %r9, %rbx
movl %r8d, %r12d
callq 0x1fbaa1
movl %r12d, %r8d
movq %rbx, %r9
movq 0x10(%rsp), %rdi
movq 0x58(%rsp), %rdx
shll $0x4, %edx
orl $0x2, %edx
movslq %r15d, %rcx
incl %r15d
movl %edx, (%rax,%rcx,4)
testb %r8b, %r8b
je 0x203c12
incl %r9d
testl %r15d, %r15d
je 0x203bc9
movslq %r15d, %rcx
movl -0x4(%rax,%rcx,4), %edx
movl %edx, %esi
andl $0xf, %esi
cmpl $0x1, %esi
jne 0x203bc5
shll $0x4, %r9d
addl %r9d, %edx
movl %edx, -0x4(%rax,%rcx,4)
jmp 0x203c12
xorl %ecx, %ecx
jmp 0x203bce
xorl %r15d, %r15d
movb $0x1, %cl
cmpl %r14d, %r15d
jne 0x203c01
leal (%r15,%r15), %edx
testb %cl, %cl
movl $0x4, %r14d
cmovel %edx, %r14d
leal (,%r14,4), %ecx
movslq %ecx, %rdx
movq %rax, %rsi
movq %r9, %rbx
callq 0x1fbaa1
movq %rbx, %r9
movq 0x10(%rsp), %rdi
shll $0x4, %r9d
incl %r9d
movslq %r15d, %rcx
incl %r15d
movl %r9d, (%rax,%rcx,4)
movl %r15d, %ecx
sarl %ecx
testl %ecx, %ecx
jle 0x203c40
movl %ecx, %ecx
leal -0x1(%r15), %edx
xorl %esi, %esi
movl (%rax,%rsi,4), %r9d
movslq %edx, %rdx
movl (%rax,%rdx,4), %r8d
movl %r8d, (%rax,%rsi,4)
movl %r9d, (%rax,%rdx,4)
incq %rsi
decl %edx
cmpq %rsi, %rcx
jne 0x203c23
movq 0x140(%rsp), %rcx
movl %r14d, (%rcx)
movq 0x148(%rsp), %rcx
movl %r15d, (%rcx)
movq 0x150(%rsp), %rcx
movq %rax, (%rcx)
movq 0x60(%rsp), %rsi
movq %rdi, %rbx
callq 0x1fb9e0
movq %rbx, %rdi
movq 0x30(%rsp), %rsi
callq 0x1fb9e0
movl %ebp, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop