// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/contrib/ssw/ssw.c
// Function: banded_sw
static cigar* banded_sw (const int8_t* ref,
				 const int8_t* read,
				 int32_t refLen,
				 int32_t readLen,
				 int32_t score,
				 const uint32_t weight_gapO,  /* will be used as - */
				 const uint32_t weight_gapE,  /* will be used as - */
				 int32_t band_width,
				 const int8_t* mat,	/* pointer to the weight matrix */
				 int32_t n) {

	uint32_t *c = (uint32_t*)malloc(16 * sizeof(uint32_t)), *c1;
	int32_t i, j, e, f, temp1, temp2, s = 16, s1 = 8, l, max = 0;
	int64_t s2 = 1024;
	char op, prev_op;
	int32_t width, width_d, *h_b, *e_b, *h_c;
	int8_t *direction, *direction_line;
	cigar* result = (cigar*)malloc(sizeof(cigar));
	h_b = (int32_t*)malloc(s1 * sizeof(int32_t));
	e_b = (int32_t*)malloc(s1 * sizeof(int32_t));
	h_c = (int32_t*)malloc(s1 * sizeof(int32_t));
	direction = (int8_t*)malloc(s2 * sizeof(int8_t));

	do {
		width = band_width * 2 + 3, width_d = band_width * 2 + 1;
		while (width >= s1) {
			++s1;
			kroundup32(s1);
			h_b = (int32_t*)realloc(h_b, s1 * sizeof(int32_t));
			e_b = (int32_t*)realloc(e_b, s1 * sizeof(int32_t));
			h_c = (int32_t*)realloc(h_c, s1 * sizeof(int32_t));
		}
		while (width_d * readLen * 3 >= s2) {
			++s2;
			kroundup32(s2);
			if (s2 < 0) {
				fprintf(stderr, "Alignment score and position are not consensus.\n");
				return NULL;
			}
			direction = (int8_t*)realloc(direction, s2 * sizeof(int8_t));
		}
		direction_line = direction;
		for (j = 1; LIKELY(j < width - 1); j ++) h_b[j] = 0;
		for (i = 0; LIKELY(i < readLen); i ++) {
			int32_t beg = 0, end = refLen - 1, u = 0, edge;
			j = i - band_width;	beg = beg > j ? beg : j; /* band start*/
			j = i + band_width; end = end < j ? end : j; /* band end*/
			edge = end + 1 < width - 1 ? end + 1 : width - 1;
			f = h_b[0] = e_b[0] = h_b[edge] = e_b[edge] = h_c[0] = 0;
			direction_line = direction + width_d * i * 3;

			for (j = beg; LIKELY(j <= end); j ++) {
				int32_t b, e1, f1, d, de, df, dh;
				set_u(u, band_width, i, j);	set_u(e, band_width, i - 1, j);
				set_u(b, band_width, i, j - 1); set_u(d, band_width, i - 1, j - 1);
				set_d(de, band_width, i, j, 0);
				set_d(df, band_width, i, j, 1);
				set_d(dh, band_width, i, j, 2);

				temp1 = i == 0 ? 0-weight_gapO : h_b[e] - weight_gapO;
				temp2 = i == 0 ? 0-weight_gapE : e_b[e] - weight_gapE;
				e_b[u] = temp1 > temp2 ? temp1 : temp2;
				direction_line[de] = temp1 > temp2 ? 3 : 2;

				temp1 = h_c[b] - weight_gapO;
				temp2 = f - weight_gapE;
				f = temp1 > temp2 ? temp1 : temp2;
				direction_line[df] = temp1 > temp2 ? 5 : 4;

				e1 = e_b[u] > 0 ? e_b[u] : 0;
				f1 = f > 0 ? f : 0;
				temp1 = e1 > f1 ? e1 : f1;
				temp2 = h_b[d] + mat[ref[j] * n + read[i]];
				h_c[u] = temp1 > temp2 ? temp1 : temp2;

				if (h_c[u] > max) max = h_c[u];

				if (temp1 <= temp2) direction_line[dh] = 1;
				else direction_line[dh] = e1 > f1 ? direction_line[de] : direction_line[df];
			}
			for (j = 1; j <= u; j ++) h_b[j] = h_c[j];
		}
		band_width *= 2;
	} while (LIKELY(max < score));
	band_width /= 2;

	/* trace back*/
	i = readLen - 1;
	j = refLen - 1;
	e = 0;	/* Count the number of M, D or I.*/
	l = 0;	/* record length of current cigar*/
	op = prev_op = 'M';
	temp2 = 2;	/* h*/
	while (LIKELY(i > 0)) {
		set_d(temp1, band_width, i, j, temp2);
		switch (direction_line[temp1]) {
			case 1:
				--i;
				--j;
				temp2 = 2;
				direction_line -= width_d * 3;
				op = 'M';
				break;
			case 2:
			 	--i;
				temp2 = 0;	/* e*/
				direction_line -= width_d * 3;
				op = 'I';
				break;
			case 3:
				--i;
				temp2 = 2;
				direction_line -= width_d * 3;
				op = 'I';
				break;
			case 4:
				--j;
				temp2 = 1;
				op = 'D';
				break;
			case 5:
				--j;
				temp2 = 2;
				op = 'D';
				break;
			default:
				fprintf(stderr, "Trace back error: %d.\n", direction_line[temp1 - 1]);
				free(direction);
				free(h_c);
				free(e_b);
				free(h_b);
				free(c);
				free(result);
				return 0;
		}
		if (op == prev_op) ++e;
		else {
			++l;
			while (l >= s) {
				++s;
				kroundup32(s);
				c = (uint32_t*)realloc(c, s * sizeof(uint32_t));
			}
			c[l - 1] = to_cigar_int(e, prev_op);
			prev_op = op;
			e = 1;
		}
	}
	if (op == 'M') {
		++l;
		while (l >= s) {
			++s;
			kroundup32(s);
			c = (uint32_t*)realloc(c, s * sizeof(uint32_t));
		}
		c[l - 1] = to_cigar_int(e + 1, op);
	}else {
		l += 2;
		while (l >= s) {
			++s;
			kroundup32(s);
			c = (uint32_t*)realloc(c, s * sizeof(uint32_t));
		}
		c[l - 2] = to_cigar_int(e, op);
		c[l - 1] = to_cigar_int(1, 'M');
	}

	/* reverse cigar*/
	c1 = (uint32_t*)malloc(l * sizeof(uint32_t));
	s = 0;
	e = l - 1;
	while (LIKELY(s <= e)) {
		c1[s] = c[e];
		c1[e] = c[s];
		++ s;
		-- e;
	}
	result->seq = c1;
	result->length = l;

	free(direction);
	free(h_c);
	free(e_b);
	free(h_b);
	free(c);
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movl 0x28(%rbp), %eax
movq 0x20(%rbp), %rax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movl $0x40, %edi
callq 0x29b180
movq %rax, -0x30(%rbp)
movl $0x10, -0x54(%rbp)
movl $0x8, -0x58(%rbp)
movl $0x0, -0x60(%rbp)
movq $0x400, -0x68(%rbp)     # imm = 0x400
movl $0x10, %edi
callq 0x29b180
movq %rax, -0xa8(%rbp)
movslq -0x58(%rbp), %rdi
shlq $0x2, %rdi
callq 0x29b180
movq %rax, -0x80(%rbp)
movslq -0x58(%rbp), %rdi
shlq $0x2, %rdi
callq 0x29b180
movq %rax, -0x88(%rbp)
movslq -0x58(%rbp), %rdi
shlq $0x2, %rdi
callq 0x29b180
movq %rax, -0x90(%rbp)
movq -0x68(%rbp), %rdi
shlq $0x0, %rdi
callq 0x29b180
movq %rax, -0x98(%rbp)
movl 0x18(%rbp), %eax
shll %eax
addl $0x3, %eax
movl %eax, -0x70(%rbp)
movl 0x18(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
movl -0x70(%rbp), %eax
cmpl -0x58(%rbp), %eax
jl 0x29f79f
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
sarl %eax
orl -0x58(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
sarl $0x2, %eax
orl -0x58(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
sarl $0x4, %eax
orl -0x58(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
sarl $0x8, %eax
orl -0x58(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
sarl $0x10, %eax
orl -0x58(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
movq -0x80(%rbp), %rdi
movslq -0x58(%rbp), %rsi
shlq $0x2, %rsi
callq 0x29b1e0
movq %rax, -0x80(%rbp)
movq -0x88(%rbp), %rdi
movslq -0x58(%rbp), %rsi
shlq $0x2, %rsi
callq 0x29b1e0
movq %rax, -0x88(%rbp)
movq -0x90(%rbp), %rdi
movslq -0x58(%rbp), %rsi
shlq $0x2, %rsi
callq 0x29b1e0
movq %rax, -0x90(%rbp)
jmp 0x29f6ed
jmp 0x29f7a1
movl -0x74(%rbp), %eax
imull -0x20(%rbp), %eax
imull $0x3, %eax, %eax
cltq
cmpq -0x68(%rbp), %rax
jl 0x29f876
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
sarq %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
sarq $0x2, %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
sarq $0x4, %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
sarq $0x8, %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
sarq $0x10, %rax
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
jge 0x29f856
movq 0xc8d7a8(%rip), %rax    # 0xf2cfe0
movq (%rax), %rdi
leaq 0xaccd04(%rip), %rsi    # 0xd6c546
movb $0x0, %al
callq 0x29b1b0
movq $0x0, -0x8(%rbp)
jmp 0x2a0514
movq -0x98(%rbp), %rdi
movq -0x68(%rbp), %rsi
shlq $0x0, %rsi
callq 0x29b1e0
movq %rax, -0x98(%rbp)
jmp 0x29f7a1
movq -0x98(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl $0x1, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl -0x70(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x29f8c0
movq -0x80(%rbp), %rax
movslq -0x40(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x29f88b
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x20(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x29ffa8
movl $0x0, -0xac(%rbp)
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xb0(%rbp)
movl $0x0, -0xb4(%rbp)
movl -0x3c(%rbp), %eax
subl 0x18(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0xac(%rbp), %eax
cmpl -0x40(%rbp), %eax
jle 0x29f923
movl -0xac(%rbp), %eax
movl %eax, -0xf8(%rbp)
jmp 0x29f92c
movl -0x40(%rbp), %eax
movl %eax, -0xf8(%rbp)
movl -0xf8(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0x3c(%rbp), %eax
addl 0x18(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0xb0(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x29f95a
movl -0xb0(%rbp), %eax
movl %eax, -0xfc(%rbp)
jmp 0x29f963
movl -0x40(%rbp), %eax
movl %eax, -0xfc(%rbp)
movl -0xfc(%rbp), %eax
movl %eax, -0xb0(%rbp)
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl -0x70(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x29f993
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x100(%rbp)
jmp 0x29f99f
movl -0x70(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x100(%rbp)
movl -0x100(%rbp), %eax
movl %eax, -0xb8(%rbp)
movq -0x90(%rbp), %rax
movl $0x0, (%rax)
movq -0x88(%rbp), %rax
movslq -0xb8(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x80(%rbp), %rax
movslq -0xb8(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x88(%rbp), %rax
movl $0x0, (%rax)
movq -0x80(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x48(%rbp)
movq -0x98(%rbp), %rax
movl -0x74(%rbp), %ecx
imull -0x3c(%rbp), %ecx
imull $0x3, %ecx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0xb0(%rbp), %eax
setle %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x29ff62
movl -0x3c(%rbp), %eax
subl 0x18(%rbp), %eax
movl %eax, -0xd8(%rbp)
cmpl $0x0, -0xd8(%rbp)
jle 0x29fa64
movl -0xd8(%rbp), %eax
movl %eax, -0x104(%rbp)
jmp 0x29fa6e
xorl %eax, %eax
movl %eax, -0x104(%rbp)
jmp 0x29fa6e
movl -0x104(%rbp), %eax
movl %eax, -0xd8(%rbp)
movl -0x40(%rbp), %eax
subl -0xd8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
movl -0x3c(%rbp), %eax
subl $0x1, %eax
subl 0x18(%rbp), %eax
movl %eax, -0xdc(%rbp)
cmpl $0x0, -0xdc(%rbp)
jle 0x29fab2
movl -0xdc(%rbp), %eax
movl %eax, -0x108(%rbp)
jmp 0x29fabc
xorl %eax, %eax
movl %eax, -0x108(%rbp)
jmp 0x29fabc
movl -0x108(%rbp), %eax
movl %eax, -0xdc(%rbp)
movl -0x40(%rbp), %eax
subl -0xdc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x3c(%rbp), %eax
subl 0x18(%rbp), %eax
movl %eax, -0xe0(%rbp)
cmpl $0x0, -0xe0(%rbp)
jle 0x29fafa
movl -0xe0(%rbp), %eax
movl %eax, -0x10c(%rbp)
jmp 0x29fb04
xorl %eax, %eax
movl %eax, -0x10c(%rbp)
jmp 0x29fb04
movl -0x10c(%rbp), %eax
movl %eax, -0xe0(%rbp)
movl -0x40(%rbp), %eax
subl $0x1, %eax
subl -0xe0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
movl -0x3c(%rbp), %eax
subl $0x1, %eax
subl 0x18(%rbp), %eax
movl %eax, -0xe4(%rbp)
cmpl $0x0, -0xe4(%rbp)
jle 0x29fb4b
movl -0xe4(%rbp), %eax
movl %eax, -0x110(%rbp)
jmp 0x29fb55
xorl %eax, %eax
movl %eax, -0x110(%rbp)
jmp 0x29fb55
movl -0x110(%rbp), %eax
movl %eax, -0xe4(%rbp)
movl -0x40(%rbp), %eax
subl $0x1, %eax
subl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
movl -0x3c(%rbp), %eax
subl 0x18(%rbp), %eax
movl %eax, -0xe8(%rbp)
cmpl $0x0, -0xe8(%rbp)
jle 0x29fb99
movl -0xe8(%rbp), %eax
movl %eax, -0x114(%rbp)
jmp 0x29fba3
xorl %eax, %eax
movl %eax, -0x114(%rbp)
jmp 0x29fba3
movl -0x114(%rbp), %eax
movl %eax, -0xe8(%rbp)
movl -0x40(%rbp), %eax
subl -0xe8(%rbp), %eax
movl %eax, -0xe8(%rbp)
imull $0x3, -0xe8(%rbp), %eax
addl $0x0, %eax
movl %eax, -0xcc(%rbp)
movl -0x3c(%rbp), %eax
subl 0x18(%rbp), %eax
movl %eax, -0xec(%rbp)
cmpl $0x0, -0xec(%rbp)
jle 0x29fbf1
movl -0xec(%rbp), %eax
movl %eax, -0x118(%rbp)
jmp 0x29fbfb
xorl %eax, %eax
movl %eax, -0x118(%rbp)
jmp 0x29fbfb
movl -0x118(%rbp), %eax
movl %eax, -0xec(%rbp)
movl -0x40(%rbp), %eax
subl -0xec(%rbp), %eax
movl %eax, -0xec(%rbp)
imull $0x3, -0xec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
movl -0x3c(%rbp), %eax
subl 0x18(%rbp), %eax
movl %eax, -0xf0(%rbp)
cmpl $0x0, -0xf0(%rbp)
jle 0x29fc49
movl -0xf0(%rbp), %eax
movl %eax, -0x11c(%rbp)
jmp 0x29fc53
xorl %eax, %eax
movl %eax, -0x11c(%rbp)
jmp 0x29fc53
movl -0x11c(%rbp), %eax
movl %eax, -0xf0(%rbp)
movl -0x40(%rbp), %eax
subl -0xf0(%rbp), %eax
movl %eax, -0xf0(%rbp)
imull $0x3, -0xf0(%rbp), %eax
addl $0x2, %eax
movl %eax, -0xd4(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x29fc91
xorl %eax, %eax
subl -0x28(%rbp), %eax
movl %eax, -0x120(%rbp)
jmp 0x29fca5
movq -0x80(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %eax
subl -0x28(%rbp), %eax
movl %eax, -0x120(%rbp)
movl -0x120(%rbp), %eax
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x29fcc1
xorl %eax, %eax
subl 0x10(%rbp), %eax
movl %eax, -0x124(%rbp)
jmp 0x29fcd8
movq -0x88(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %eax
subl 0x10(%rbp), %eax
movl %eax, -0x124(%rbp)
movl -0x124(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jle 0x29fcf4
movl -0x4c(%rbp), %eax
movl %eax, -0x128(%rbp)
jmp 0x29fcfd
movl -0x50(%rbp), %eax
movl %eax, -0x128(%rbp)
movl -0x128(%rbp), %edx
movq -0x88(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x4c(%rbp), %edx
movl -0x50(%rbp), %esi
movl $0x2, %eax
movl $0x3, %ecx
cmpl %esi, %edx
cmovgl %ecx, %eax
movb %al, %dl
movq -0xa0(%rbp), %rax
movslq -0xcc(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x90(%rbp), %rax
movslq -0xbc(%rbp), %rcx
movl (%rax,%rcx,4), %eax
subl -0x28(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x48(%rbp), %eax
subl 0x10(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jle 0x29fd6f
movl -0x4c(%rbp), %eax
movl %eax, -0x12c(%rbp)
jmp 0x29fd78
movl -0x50(%rbp), %eax
movl %eax, -0x12c(%rbp)
movl -0x12c(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x4c(%rbp), %edx
movl -0x50(%rbp), %esi
movl $0x4, %eax
movl $0x5, %ecx
cmpl %esi, %edx
cmovgl %ecx, %eax
movb %al, %dl
movq -0xa0(%rbp), %rax
movslq -0xd0(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x88(%rbp), %rax
movslq -0xb4(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0x29fdd6
movq -0x88(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x130(%rbp)
jmp 0x29fde0
xorl %eax, %eax
movl %eax, -0x130(%rbp)
jmp 0x29fde0
movl -0x130(%rbp), %eax
movl %eax, -0xc0(%rbp)
cmpl $0x0, -0x48(%rbp)
jle 0x29fdfd
movl -0x48(%rbp), %eax
movl %eax, -0x134(%rbp)
jmp 0x29fe07
xorl %eax, %eax
movl %eax, -0x134(%rbp)
jmp 0x29fe07
movl -0x134(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl -0xc0(%rbp), %eax
cmpl -0xc4(%rbp), %eax
jle 0x29fe2f
movl -0xc0(%rbp), %eax
movl %eax, -0x138(%rbp)
jmp 0x29fe3b
movl -0xc4(%rbp), %eax
movl %eax, -0x138(%rbp)
movl -0x138(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x80(%rbp), %rax
movslq -0xc8(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x20(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq -0x40(%rbp), %rsi
movsbl (%rdx,%rsi), %edx
imull 0x28(%rbp), %edx
movq -0x18(%rbp), %rsi
movslq -0x3c(%rbp), %rdi
movsbl (%rsi,%rdi), %esi
addl %esi, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jle 0x29fe93
movl -0x4c(%rbp), %eax
movl %eax, -0x13c(%rbp)
jmp 0x29fe9c
movl -0x50(%rbp), %eax
movl %eax, -0x13c(%rbp)
movl -0x13c(%rbp), %edx
movq -0x90(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x90(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x60(%rbp), %eax
jle 0x29fedd
movq -0x90(%rbp), %rax
movslq -0xb4(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x60(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jg 0x29fef9
movq -0xa0(%rbp), %rax
movslq -0xd4(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0x29ff52
movl -0xc0(%rbp), %eax
cmpl -0xc4(%rbp), %eax
jle 0x29ff21
movq -0xa0(%rbp), %rax
movslq -0xcc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x140(%rbp)
jmp 0x29ff39
movq -0xa0(%rbp), %rax
movslq -0xd0(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x140(%rbp)
movl -0x140(%rbp), %eax
movb %al, %dl
movq -0xa0(%rbp), %rax
movslq -0xd4(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x29ff54
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x29fa24
movl $0x1, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0xb4(%rbp), %eax
jg 0x29ff98
movq -0x90(%rbp), %rax
movslq -0x40(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x80(%rbp), %rax
movslq -0x40(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x29ff69
jmp 0x29ff9a
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x29f8c7
movl 0x18(%rbp), %eax
shll %eax
movl %eax, 0x18(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x24(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
jne 0x29f6d7
movl 0x18(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x18(%rbp)
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x5c(%rbp)
movb $0x4d, -0x6a(%rbp)
movb $0x4d, -0x69(%rbp)
movl $0x2, -0x50(%rbp)
cmpl $0x0, -0x3c(%rbp)
setg %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x2a02d3
movl -0x3c(%rbp), %eax
subl 0x18(%rbp), %eax
movl %eax, -0xf4(%rbp)
cmpl $0x0, -0xf4(%rbp)
jle 0x2a0042
movl -0xf4(%rbp), %eax
movl %eax, -0x144(%rbp)
jmp 0x2a004c
xorl %eax, %eax
movl %eax, -0x144(%rbp)
jmp 0x2a004c
movl -0x144(%rbp), %eax
movl %eax, -0xf4(%rbp)
movl -0x40(%rbp), %eax
movl -0xf4(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0xf4(%rbp)
movl -0xf4(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %eax
movl -0x50(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x4c(%rbp)
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x150(%rbp)
subl $0x4, %eax
ja 0x2a0190
movq -0x150(%rbp), %rax
leaq 0xacc2f3(%rip), %rcx    # 0xd6c3a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
movl $0x2, -0x50(%rbp)
imull $0x3, -0x74(%rbp), %ecx
movq -0xa0(%rbp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movb $0x4d, -0x69(%rbp)
jmp 0x2a020b
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x50(%rbp)
imull $0x3, -0x74(%rbp), %ecx
movq -0xa0(%rbp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movb $0x49, -0x69(%rbp)
jmp 0x2a020b
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
movl $0x2, -0x50(%rbp)
imull $0x3, -0x74(%rbp), %ecx
movq -0xa0(%rbp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movb $0x49, -0x69(%rbp)
jmp 0x2a020b
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
movl $0x1, -0x50(%rbp)
movb $0x44, -0x69(%rbp)
jmp 0x2a020b
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
movl $0x2, -0x50(%rbp)
movb $0x44, -0x69(%rbp)
jmp 0x2a020b
movq 0xc8ce49(%rip), %rax    # 0xf2cfe0
movq (%rax), %rdi
movq -0xa0(%rbp), %rax
movl -0x4c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %edx
leaq 0xacc3c2(%rip), %rsi    # 0xd6c577
movb $0x0, %al
callq 0x29b1b0
movq -0x98(%rbp), %rdi
callq 0x29b160
movq -0x90(%rbp), %rdi
callq 0x29b160
movq -0x88(%rbp), %rdi
callq 0x29b160
movq -0x80(%rbp), %rdi
callq 0x29b160
movq -0x30(%rbp), %rdi
callq 0x29b160
movq -0xa8(%rbp), %rdi
callq 0x29b160
movq $0x0, -0x8(%rbp)
jmp 0x2a0514
movsbl -0x69(%rbp), %eax
movsbl -0x6a(%rbp), %ecx
cmpl %ecx, %eax
jne 0x2a0225
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x2a02ce
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x54(%rbp), %eax
jl 0x2a02a3
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl $0x2, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl $0x4, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl $0x8, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl $0x10, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x54(%rbp), %rsi
shlq $0x2, %rsi
callq 0x29b1e0
movq %rax, -0x30(%rbp)
jmp 0x2a022e
movl -0x44(%rbp), %edi
movsbl -0x6a(%rbp), %esi
callq 0x2a0650
movl %eax, %edx
movq -0x30(%rbp), %rax
movl -0x5c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movb -0x69(%rbp), %al
movb %al, -0x6a(%rbp)
movl $0x1, -0x44(%rbp)
jmp 0x2a0007
movsbl -0x69(%rbp), %eax
cmpl $0x4d, %eax
jne 0x2a0384
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x54(%rbp), %eax
jl 0x2a035e
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl $0x2, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl $0x4, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl $0x8, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl $0x10, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x54(%rbp), %rsi
shlq $0x2, %rsi
callq 0x29b1e0
movq %rax, -0x30(%rbp)
jmp 0x2a02e9
movl -0x44(%rbp), %edi
addl $0x1, %edi
movsbl -0x69(%rbp), %esi
callq 0x2a0650
movl %eax, %edx
movq -0x30(%rbp), %rax
movl -0x5c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x2a0441
movl -0x5c(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x54(%rbp), %eax
jl 0x2a0402
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl $0x2, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl $0x4, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl $0x8, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
sarl $0x10, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x54(%rbp), %rsi
shlq $0x2, %rsi
callq 0x29b1e0
movq %rax, -0x30(%rbp)
jmp 0x2a038d
movl -0x44(%rbp), %edi
movsbl -0x69(%rbp), %esi
callq 0x2a0650
movl %eax, %edx
movq -0x30(%rbp), %rax
movl -0x5c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl $0x1, %edi
movl $0x4d, %esi
callq 0x2a0650
movl %eax, %edx
movq -0x30(%rbp), %rax
movl -0x5c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movslq -0x5c(%rbp), %rdi
shlq $0x2, %rdi
callq 0x29b180
movq %rax, -0x38(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x5c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x44(%rbp), %eax
setle %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x2a04b8
movq -0x30(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x38(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x30(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x2a0462
movq -0x38(%rbp), %rcx
movq -0xa8(%rbp), %rax
movq %rcx, (%rax)
movl -0x5c(%rbp), %ecx
movq -0xa8(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x98(%rbp), %rdi
callq 0x29b160
movq -0x90(%rbp), %rdi
callq 0x29b160
movq -0x88(%rbp), %rdi
callq 0x29b160
movq -0x80(%rbp), %rdi
callq 0x29b160
movq -0x30(%rbp), %rdi
callq 0x29b160
movq -0xa8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)