// File: /workspace/github_c_makefile_star2_O1/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 $0xf8, %rsp
movl %r9d, 0x30(%rsp)
movq %r8, 0xb0(%rsp)
movl %ecx, %r13d
movq %rdx, 0x18(%rsp)
movl %esi, %r12d
movq %rdi, %r15
movl 0x148(%rsp), %ebx
leal 0x1(%r13), %eax
movslq %eax, %r14
movl $0x1, %edx
movq %r14, %rsi
callq 0x1fbc8d
movq %rax, 0x48(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fbc8d
movq %rax, 0x40(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fbc8d
movq %rax, 0x70(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fbc8d
movq %rax, 0x50(%rsp)
movslq %r13d, %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x1fbb36
movq %rax, 0x78(%rsp)
movslq %r12d, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fbb36
movq %rax, %rdx
movq %r14, 0xe0(%rsp)
cmpl %r14d, %ebp
movl %r12d, %r9d
cmovgl %r13d, %r9d
testl %ebx, %ebx
cmovnsl %ebx, %r9d
leal 0x1(%r9), %edi
cmpl %ebp, %edi
cmovgel %r13d, %edi
cmpq $0x0, 0x150(%rsp)
setne %al
cmpq $0x0, 0x158(%rsp)
setne %cl
andb %al, %cl
cmpq $0x0, 0x160(%rsp)
setne %al
andb %cl, %al
movb %al, 0xf(%rsp)
cmpb $0x1, %al
movq %r15, 0x28(%rsp)
movl %edi, 0x10(%rsp)
movq %rdx, 0x88(%rsp)
movq %r9, 0x80(%rsp)
jne 0x2031f6
leal (%r12,%r13), %ebx
movl %edi, %eax
imull %ebx, %eax
movslq %eax, %rsi
movl $0x1, %edx
movq %r15, %rdi
callq 0x1fbc8d
movq %rax, 0x60(%rsp)
movslq %ebx, %rsi
shlq $0x2, %rsi
movq %r15, %rdi
callq 0x1fbb36
movq 0x80(%rsp), %r9
movq 0x88(%rsp), %rdx
movl 0x10(%rsp), %edi
movq %rax, 0x68(%rsp)
jmp 0x203208
movq $0x0, 0x60(%rsp)
movq $0x0, 0x68(%rsp)
movl %r12d, %eax
testl %r12d, %r12d
movq 0x18(%rsp), %rbp
jle 0x20322b
movq %rdx, %rcx
movq %rax, %rdx
movb -0x1(%rbp,%rdx), %sil
movb %sil, (%rcx)
incq %rcx
decq %rdx
jne 0x20321b
movq %r12, 0x58(%rsp)
leal (%r12,%r13), %edx
decl %edx
testl %edx, %edx
movq %r13, 0xc0(%rsp)
jle 0x20370c
movsbl 0x138(%rsp), %r8d
movsbl 0x140(%rsp), %ecx
addl %r8d, %ecx
movq %rcx, 0xa0(%rsp)
leal (%rcx,%rcx), %esi
leal -0x1(%r13), %ecx
movl %r8d, %r13d
movl %ecx, 0x9c(%rsp)
movl %r9d, %ecx
notl %ecx
movq %rcx, 0xc8(%rsp)
movsbq 0x30(%rsp), %r11
movslq %edi, %rcx
movq %rcx, 0xd8(%rsp)
movl %edx, %ecx
movq %rcx, 0xd0(%rsp)
xorl %r8d, %r8d
movq 0x60(%rsp), %rcx
movq %rcx, 0x90(%rsp)
xorl %r12d, %r12d
xorl %ebp, %ebp
xorl %edi, %edi
movq 0xb0(%rsp), %rcx
movl %r13d, 0x24(%rsp)
movl %esi, 0x3c(%rsp)
movq %r11, 0xa8(%rsp)
movl %ebp, %r15d
movq %r12, %rsi
subq 0xe0(%rsp), %rsi
leal 0x1(%rsi), %r14d
testq %rsi, %rsi
cmovsl %r8d, %r14d
movl 0x9c(%rsp), %edx
cmpl %r12d, %edx
movl %r12d, %esi
cmovll %edx, %esi
leal (%r9,%r12), %edx
movl %r12d, %ebx
subl %r9d, %ebx
incl %ebx
sarl %ebx
cmpl %ebx, %r14d
movl %ebx, %r10d
cmovgl %r14d, %r10d
sarl %edx
cmpl %edx, %esi
cmovll %esi, %edx
testl %r10d, %r10d
movq 0x88(%rsp), %r8
movq %rdx, 0x18(%rsp)
movq %r10, 0x30(%rsp)
movq %rdi, 0xe8(%rsp)
je 0x203366
movl %r13d, %ebp
leal (%r9,%r10,2), %esi
movslq %esi, %rsi
cmpq %rsi, %r12
movq 0x130(%rsp), %r13
jge 0x203381
leal -0x1(%r10), %esi
movq 0x70(%rsp), %rdx
movb (%rdx,%rsi), %r9b
movq 0x40(%rsp), %rdx
movb (%rdx,%rsi), %sil
movq 0x18(%rsp), %rdx
jmp 0x203386
xorl %r9d, %r9d
testq %r12, %r12
movl %r13d, %ebp
movzbl %r13b, %esi
cmovel %r9d, %esi
movq 0x130(%rsp), %r13
jmp 0x203386
xorl %esi, %esi
xorl %r9d, %r9d
movl %edx, %edi
cmpq %rdi, %r12
movq %rdx, %r10
movq %r12, 0xb8(%rsp)
jne 0x2033bf
movq 0x50(%rsp), %rdx
movb $0x0, (%rdx,%r12)
testq %r12, %r12
movzbl %bpl, %edi
movl $0x0, %edx
cmovel %edx, %edi
movq 0x48(%rsp), %rdx
movb %dil, (%rdx,%r12)
movl %r15d, %ebp
jmp 0x2033f3
movq 0xc8(%rsp), %rdx
leal (%rdx,%r10,2), %edi
movslq %edi, %rdi
cmpq %rdi, %r12
movl %r15d, %ebp
jge 0x2033f3
movslq %r10d, %rdi
movq 0x48(%rsp), %rdx
xorl %r10d, %r10d
movb %r10b, (%rdx,%rdi)
movq 0x50(%rsp), %rdx
movb %r10b, (%rdx,%rdi)
movq 0x18(%rsp), %r10
cmpl %r10d, 0x30(%rsp)
movq 0x78(%rsp), %rdx
jg 0x20343d
cmpl %ebx, %r14d
movl %ebx, %edi
cmovgl %r14d, %edi
movslq %edi, %rdi
movslq 0x18(%rsp), %r10
decq %rdi
movzbl 0x1(%rcx,%rdi), %r15d
imulq %r11, %r15
leal (%rax,%rdi), %r12d
movslq %r12d, %r12
movzbl (%r8,%r12), %r12d
addq %r13, %r15
movb (%r12,%r15), %r15b
movb %r15b, 0x1(%rdx,%rdi)
incq %rdi
cmpq %r10, %rdi
jl 0x203413
movl %ebp, 0x14(%rsp)
cmpb $0x0, 0xf(%rsp)
movq %rax, 0xf0(%rsp)
je 0x20356b
movq 0x68(%rsp), %rcx
movq 0xb8(%rsp), %rax
movq 0x30(%rsp), %rdx
movl %edx, (%rcx,%rax,4)
cmpl 0x18(%rsp), %edx
movl 0x24(%rsp), %ebp
movl 0x3c(%rsp), %eax
movl $0x0, %r11d
jg 0x20363e
cmpl %ebx, %r14d
cmovgl %r14d, %ebx
movslq %ebx, %rbx
movslq 0x18(%rsp), %r14
decq %rbx
movq 0x90(%rsp), %r12
movq 0x78(%rsp), %rcx
movb 0x1(%rcx,%rbx), %r10b
addb %al, %r10b
addb %sil, %r9b
movq 0x48(%rsp), %rdx
movb 0x1(%rdx,%rbx), %r15b
movq 0x50(%rsp), %r8
movb 0x1(%r8,%rbx), %r13b
addb %r15b, %r13b
xorl %edi, %edi
cmpb %r10b, %r9b
movzbl %r10b, %ecx
movzbl %r9b, %r9d
cmovgl %r9d, %ecx
setg %dil
cmpb %cl, %r13b
movl $0x2, %r10d
cmovgl %r10d, %edi
movzbl %r13b, %r10d
cmovgl %r10d, %ecx
movl %ecx, %r13d
subb %sil, %r13b
movb %r13b, 0x1(%rdx,%rbx)
movl %ecx, %r13d
subb %r15b, %r13b
subb %bpl, %cl
subb %cl, %r9b
subb %cl, %r10b
movq 0x40(%rsp), %rcx
movb 0x1(%rcx,%rbx), %sil
movb %r13b, 0x1(%rcx,%rbx)
testb %r9b, %r9b
setg %cl
movzbl %r9b, %r15d
cmovlel %r11d, %r15d
shlb $0x3, %cl
orb %dil, %cl
movq 0x70(%rsp), %rdx
movb 0x1(%rdx,%rbx), %r9b
movb %r15b, 0x1(%rdx,%rbx)
testb %r10b, %r10b
movzbl %r10b, %edi
cmovlel %r11d, %edi
movb %dil, 0x1(%r8,%rbx)
setg %dil
shlb $0x4, %dil
orb %cl, %dil
movb %dil, (%r12)
incq %rbx
incq %r12
cmpq %r14, %rbx
jl 0x20349b
jmp 0x20363e
movq 0x30(%rsp), %rax
cmpl 0x18(%rsp), %eax
movl 0x24(%rsp), %eax
movl 0x3c(%rsp), %r11d
jg 0x20363e
movslq %r14d, %rdi
movslq %ebx, %rbx
cmpq %rbx, %rdi
cmovgq %rdi, %rbx
movl 0x30(%rsp), %r14d
decq %rbx
movq 0x70(%rsp), %rcx
leaq (%rcx,%r14), %r12
movq 0x40(%rsp), %rcx
leaq (%rcx,%r14), %r15
movq 0x48(%rsp), %rcx
leaq (%rcx,%r14), %r13
movq 0x50(%rsp), %rcx
leaq (%rcx,%r14), %r10
addq 0x78(%rsp), %r14
xorl %edi, %edi
movb (%r14,%rdi), %cl
addb %r11b, %cl
addb %sil, %r9b
movb (%r13,%rdi), %dl
movb (%r10,%rdi), %r8b
addb %dl, %r8b
movzbl %cl, %ecx
movzbl %r9b, %ebp
cmpb %cl, %bpl
cmovgl %ebp, %ecx
movzbl %r8b, %r8d
cmpb %cl, %r8b
cmovgl %r8d, %ecx
movl %ecx, %r9d
subb %sil, %r9b
movb %r9b, (%r13,%rdi)
movl %ecx, %r9d
subb %dl, %r9b
xorl %edx, %edx
movb (%r15,%rdi), %sil
movb %r9b, (%r15,%rdi)
subb %al, %cl
subb %cl, %bpl
subb %cl, %r8b
movb (%r12,%rdi), %r9b
movzbl %bpl, %ecx
testb %cl, %cl
cmovlel %edx, %ecx
movb %cl, (%r12,%rdi)
movzbl %r8b, %ecx
testb %cl, %cl
cmovlel %edx, %ecx
movb %cl, (%r10,%rdi)
incq %rdi
leal (%rbx,%rdi), %ecx
cmpl %ecx, 0x18(%rsp)
jg 0x2035c3
movq 0xb8(%rsp), %r12
testq %r12, %r12
movq 0xf0(%rsp), %rax
je 0x20368f
movq 0xe8(%rsp), %rdi
cmpl 0x30(%rsp), %edi
movq 0x80(%rsp), %r9
movl 0x24(%rsp), %r13d
movq 0xa8(%rsp), %r11
movl $0x0, %r8d
jl 0x2036b9
cmpl 0x18(%rsp), %edi
jg 0x2036b9
movl %edi, %ecx
movq 0x40(%rsp), %rdx
movsbl (%rdx,%rcx), %ecx
jmp 0x2036c9
movq 0x40(%rsp), %rcx
movsbl (%rcx), %ebp
movl 0x3c(%rsp), %esi
subl %esi, %ebp
xorl %edi, %edi
movq 0x80(%rsp), %r9
movl 0x24(%rsp), %r13d
movq 0xa8(%rsp), %r11
xorl %r8d, %r8d
jmp 0x2036d6
movslq %edi, %rdi
movq 0x48(%rsp), %rcx
movsbl 0x1(%rcx,%rdi), %ecx
incq %rdi
movl 0x14(%rsp), %ebp
subl 0xa0(%rsp), %ebp
addl %ecx, %ebp
incq %r12
decq %rax
movq 0x90(%rsp), %rcx
addq 0xd8(%rsp), %rcx
movq %rcx, 0x90(%rsp)
cmpq 0xd0(%rsp), %r12
movq 0xb0(%rsp), %rcx
jne 0x2032cb
jmp 0x20370e
xorl %ebp, %ebp
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq 0x48(%rsp), %rsi
callq 0x1fb9e5
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
callq 0x1fb9e5
movq %rbx, %rdi
movq 0x70(%rsp), %rsi
callq 0x1fb9e5
movq %rbx, %rdi
movq 0x50(%rsp), %rsi
callq 0x1fb9e5
movq %rbx, %rdi
movq 0x78(%rsp), %rsi
callq 0x1fb9e5
movq %rbx, %rdi
movq 0x88(%rsp), %rsi
callq 0x1fb9e5
cmpb $0x0, 0xf(%rsp)
je 0x203ade
movl %ebp, 0x14(%rsp)
movq 0xc0(%rsp), %rsi
leal -0x1(%rsi), %r12d
movq 0x58(%rsp), %rdx
leal -0x1(%rdx), %r13d
movq 0x150(%rsp), %rax
movl (%rax), %r10d
movq 0x160(%rsp), %rax
movq (%rax), %rax
testl %esi, %esi
setg %cl
testl %edx, %edx
setg %bpl
movl %r12d, %edx
orl %r13d, %edx
js 0x20398d
xorl %ebx, %ebx
movl $0x2, %r15d
xorl %r14d, %r14d
movq 0x28(%rsp), %rdi
movl 0x10(%rsp), %r9d
leal (%r12,%r13), %ecx
movq 0x68(%rsp), %rdx
movl (%rdx,%rcx,4), %edx
movl $0x0, %esi
cmpl %edx, %r12d
jl 0x2037f5
imull %r9d, %ecx
addl %r12d, %ecx
subl %edx, %ecx
movslq %ecx, %rcx
movq 0x60(%rsp), %rsi
movzbl (%rsi,%rcx), %esi
movl %esi, %r8d
testl %ebx, %ebx
je 0x20380e
movl %ebx, %ecx
shrl %cl, %r8d
shll $0x1d, %r8d
sarl $0x1f, %r8d
andl %ebx, %r8d
jmp 0x203812
andl $0x7, %r8d
andl $0x7, %esi
testl %r8d, %r8d
cmovnel %r8d, %esi
cmpl %edx, %r12d
movl %esi, %ebx
cmovll %r15d, %ebx
cmpl $0x3, %ebx
je 0x203891
cmpl $0x1, %ebx
je 0x203891
testl %ebx, %ebx
jne 0x2038f5
testl %r14d, %r14d
je 0x20384c
movslq %r14d, %rcx
movl -0x4(%rax,%rcx,4), %edx
testb $0xf, %dl
je 0x20395b
cmpl %r10d, %r14d
jne 0x20387f
leal (%r10,%r10), %ebp
testl %r10d, %r10d
movl $0x4, %ecx
cmovel %ecx, %ebp
leal (,%rbp,4), %ecx
movslq %ecx, %rdx
movq %rax, %rsi
callq 0x1fbaa3
movl 0x10(%rsp), %r9d
movq 0x28(%rsp), %rdi
movl %ebp, %r10d
movslq %r14d, %rcx
incl %r14d
movl $0x10, (%rax,%rcx,4)
jmp 0x203962
testl %r14d, %r14d
je 0x2038b0
movslq %r14d, %rcx
movl -0x4(%rax,%rcx,4), %edx
movl %edx, %esi
andl $0xf, %esi
cmpl $0x2, %esi
jne 0x2038b0
addl $0x10, %edx
movl %edx, -0x4(%rax,%rcx,4)
jmp 0x2038f0
cmpl %r10d, %r14d
jne 0x2038e3
leal (%r10,%r10), %ebp
testl %r10d, %r10d
movl $0x4, %ecx
cmovel %ecx, %ebp
leal (,%rbp,4), %ecx
movslq %ecx, %rdx
movq %rax, %rsi
callq 0x1fbaa3
movl 0x10(%rsp), %r9d
movq 0x28(%rsp), %rdi
movl %ebp, %r10d
movslq %r14d, %rcx
incl %r14d
movl $0x12, (%rax,%rcx,4)
decl %r12d
jmp 0x203968
movslq %r14d, %rbp
testl %r14d, %r14d
je 0x203914
movl -0x4(%rax,%rbp,4), %ecx
movl %ecx, %edx
andl $0xf, %edx
cmpl $0x1, %edx
jne 0x203914
addl $0x10, %ecx
movl %ecx, -0x4(%rax,%rbp,4)
jmp 0x203965
cmpl %r10d, %r14d
jne 0x20394f
leal (%r10,%r10), %r15d
testl %r10d, %r10d
movl $0x4, %ecx
cmovel %ecx, %r15d
leal (,%r15,4), %ecx
movslq %ecx, %rdx
movq %rax, %rsi
callq 0x1fbaa3
movl 0x10(%rsp), %r9d
movq 0x28(%rsp), %rdi
movl %r15d, %r10d
movl $0x2, %r15d
incl %r14d
movl $0x11, (%rax,%rbp,4)
jmp 0x203965
addl $0x10, %edx
movl %edx, -0x4(%rax,%rcx,4)
decl %r12d
decl %r13d
testl %r13d, %r13d
setns %bpl
testl %r12d, %r12d
setns %cl
js 0x203980
testl %r13d, %r13d
jns 0x2037ca
incl %r12d
incl %r13d
movq %r13, 0x58(%rsp)
jmp 0x203998
movq %rsi, %r12
xorl %r14d, %r14d
movq 0x28(%rsp), %rdi
testb %cl, %cl
je 0x2039ff
movslq %r14d, %rbx
testl %r14d, %r14d
je 0x2039bf
movl -0x4(%rax,%rbx,4), %ecx
movl %ecx, %edx
andl $0xf, %edx
cmpl $0x2, %edx
jne 0x2039bf
shll $0x4, %r12d
addl %r12d, %ecx
movl %ecx, -0x4(%rax,%rbx,4)
jmp 0x2039ff
cmpl %r10d, %r14d
jne 0x2039f0
leal (%r10,%r10), %ecx
testl %r10d, %r10d
movl $0x4, %r15d
cmovnel %ecx, %r15d
leal (,%r15,4), %ecx
movslq %ecx, %rdx
movq %rax, %rsi
callq 0x1fbaa3
movq %r15, %r10
movq 0x28(%rsp), %rdi
shll $0x4, %r12d
orl $0x2, %r12d
incl %r14d
movl %r12d, (%rax,%rbx,4)
testb %bpl, %bpl
je 0x203a2e
movslq %r14d, %rbx
testl %r14d, %r14d
movl 0x14(%rsp), %ebp
je 0x203a34
movl -0x4(%rax,%rbx,4), %ecx
movl %ecx, %edx
andl $0xf, %edx
cmpl $0x1, %edx
jne 0x203a34
movq 0x58(%rsp), %rdx
shll $0x4, %edx
addl %edx, %ecx
movl %ecx, -0x4(%rax,%rbx,4)
jmp 0x203a75
movl 0x14(%rsp), %ebp
jmp 0x203a75
cmpl %r10d, %r14d
jne 0x203a65
leal (%r10,%r10), %ecx
testl %r10d, %r10d
movl $0x4, %r15d
cmovnel %ecx, %r15d
leal (,%r15,4), %ecx
movslq %ecx, %rdx
movq %rax, %rsi
callq 0x1fbaa3
movq %r15, %r10
movq 0x28(%rsp), %rdi
movq 0x58(%rsp), %rcx
shll $0x4, %ecx
incl %ecx
incl %r14d
movl %ecx, (%rax,%rbx,4)
movl %r14d, %ecx
sarl %ecx
testl %ecx, %ecx
jle 0x203aa3
movl %ecx, %ecx
leal -0x1(%r14), %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 0x203a86
movq 0x150(%rsp), %rcx
movl %r10d, (%rcx)
movq 0x158(%rsp), %rcx
movl %r14d, (%rcx)
movq 0x160(%rsp), %rcx
movq %rax, (%rcx)
movq 0x60(%rsp), %rsi
movq %rdi, %rbx
callq 0x1fb9e5
movq %rbx, %rdi
movq 0x68(%rsp), %rsi
callq 0x1fb9e5
movl %ebp, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop