// File: /workspace/github_c_makefile_star2_O3/lh3[P]fermi2/correct.c
// Function: fmc_correct1_aux
static correct1_stat_t fmc_correct1_aux(const fmc_opt_t *opt, fmc_hash_t **h, fmc_aux_t *a)
{
	echeap1_t z;
	int l, path_end[FMC_MAX_PATHS], n_paths = 0, max_i = 0, n_failures = 0;
	correct1_stat_t s;

	assert(a->ori.n < 0x10000);
	a->heap.n = a->stack.n = 0;
	s.penalty = s.n_paths = s.n_failures = 0;
	// find the first k-mer
	memset(&z, 0, sizeof(echeap1_t));
	for (z.i = 0, l = 0; z.i < a->seq.n;) {
		if (a->seq.a[z.i].b > 3) l = 0, z.kmer[0] = z.kmer[1] = 0;
		else ++l, append_to_kmer(opt->c.k, z.kmer, a->seq.a[z.i].b);
		if (++z.i == a->seq.n) break;
		if (l >= opt->c.k && kmer_lookup(opt->c.k, opt->c.suf_len, z.kmer, h, a->cache) >= 0) break;
	}
	if (z.i == a->seq.n) return s;
	z.last_solid = 0; z.ec_pos4 = 0; z.k = -1; // the first k-mer is not on the stack
	kv_push(echeap1_t, a->heap, z);
	// search for the best path
	while (a->heap.n) {
		ecbase_t *c;
		int val, is_excessive;
		z = a->heap.a[0];
		a->heap.a[0] = kv_pop(a->heap);
		ks_heapdown_ec(0, a->heap.n, a->heap.a);
		if (n_paths && z.penalty > a->stack.a[path_end[0]].penalty + opt->max_penalty_diff) break;
		if (z.i == a->seq.n) { // end of sequence
			if (fmc_verbose >= 6) fprintf(stderr, "** penalty=%d\n", z.penalty);
			path_end[n_paths++] = z.k;
			if (n_paths == FMC_MAX_PATHS) break;
			continue;
		}
		if (fmc_verbose >= 6) {
			int i;
			fprintf(stderr, "<- [%d] (%d,%c%d), size=%ld, penalty=%d, state=%d, ec_pos4=[", z.k, z.i, "ACGTN"[a->seq.a[z.i].b], a->seq.a[z.i].q,
					a->heap.n, z.penalty, z.k>=0? a->stack.a[z.k].state : -1);
			for (i = 3; i >= 0; --i)
				if (z.ec_pos4>>(i*16)&0xffff) {
					fprintf(stderr, "%d", (int)(z.ec_pos4>>(i*16)&0xffff) - 1);
					if (i) fputc(',', stderr);
				}
			fprintf(stderr, "]\n");
		}
		c = &a->seq.a[z.i];
		max_i = max_i > z.i? max_i : z.i;
		is_excessive = (a->heap.n >= max_i * 3);
		val = kmer_lookup(opt->c.k, opt->c.suf_len, z.kmer, h, a->cache);
		if (val >= 0 && fmc_cell_has_b1(val)) { // present in the hash table
			int b1 = fmc_cell_get_b1(val);
			int b2 = fmc_cell_has_b2(val)? fmc_cell_get_b2(val) : 4;
			int q1 = fmc_cell_get_q1(val);
			int q2 = fmc_cell_get_q2(val);
			int is_solid = (opt->ecQ > 0 && c->q >= opt->ecQ);
			if (b1 == c->b) { // read base matching the consensus
				update_aux(opt->c.k, a, &z, c->b, STATE_M, 0, 0, is_solid);
				if (b2 != 4 && q1 < 20 && !is_solid && !is_excessive) update_aux(opt->c.k, a, &z, b2, STATE_M, q1 > c->oq? q1 : c->oq, 1, 0);
			} else if (c->b > 3) { // read base is "N"
				update_aux(opt->c.k, a, &z, b1, STATE_M, 3, 0, 0); // "N" is not counted as a diff
				if (b2 < 4 && !is_excessive) update_aux(opt->c.k, a, &z, b2, STATE_M, q1, 0, 0);
			} else if (is_solid && (z.i < z.last_solid + opt->c.k || q1>>1 < FMC_Q_1)) { // base is solid and the evidence is weak; reject
				update_aux(opt->c.k, a, &z, c->b, STATE_N, q1, 0, q1 >= opt->ecQ? 1 : 0); // TODO: should we set is_solid???
			} else if (z.ec_pos4>>48 && z.i < (z.ec_pos4>>48) + opt->max_dist4) {
				update_aux(opt->c.k, a, &z, c->b, STATE_N, q1, 0, q1 >= opt->ecQ? 1 : 0); // TODO: should we set is_solid???
			} else if (b2 >= 4 || b2 == c->b) { // no second base or the second base is the read base; two branches
				if (!is_excessive || q1 <= c->q)
					update_aux(opt->c.k, a, &z, c->b, STATE_M, q1,   0, 0);
				if (!is_excessive || q1 >= c->q)
					update_aux(opt->c.k, a, &z, b1,   STATE_M, c->q, 1, is_solid);
			} else { // we are looking at three different bases
				if (!is_excessive || q1 + q2 <= c->q)
					update_aux(opt->c.k, a, &z, c->b, STATE_M, q1 + q2, 0, 0);
				if (!is_excessive || q1 + q2 >= c->q)
					update_aux(opt->c.k, a, &z, b1,   STATE_M, c->q,    1, is_solid);
				if (!is_excessive)
					update_aux(opt->c.k, a, &z, b2,   STATE_M, c->q > q1? c->q : q1, 1, is_solid);
			}
		} else {
			update_aux(opt->c.k, a, &z, c->b < 4? c->b : lrand48()&4, STATE_N, FMC_NOHIT_PEN, 0, 0); // not present in the hash table
			if (n_paths == 0) ++s.n_failures;
			if (++n_failures > a->seq.n && a->heap.n > 1) a->heap.n = 1, n_failures = 0;
		}
		if (fmc_verbose >= 6) fprintf(stderr, "//\n");
	}
	// backtrack
	s.n_paths = n_paths;
	if (n_paths) {
		int j;
		if (fmc_verbose >= 6) { // duplicated computation, but this is for debugging only
			for (j = 0; j < n_paths; ++j) {
				int i;
				fprintf(stderr, "%.2d ", j);
				path_backtrack(&a->stack, path_end[j], &a->seq, &a->tmp[0]);
				for (i = 0; i < a->tmp[0].n; ++i) {
					int s = a->tmp[0].a[i].state;
					fputc(s == STATE_D? '-' : s == STATE_I? "acgtn"[a->tmp[0].a[i].b] : "ACGTN"[a->tmp[0].a[i].b], stderr);
				}
				fprintf(stderr, "\t%d\n", a->stack.a[path_end[j]].penalty - a->stack.a[path_end[0]].penalty);
			}
			fprintf(stderr, "//\n");
		}
		s.penalty = a->stack.a[path_end[0]].penalty;
		path_backtrack(&a->stack, path_end[0], &a->seq, &a->tmp[0]);
		for (j = 1; j < n_paths; ++j) {
			path_backtrack(&a->stack, path_end[j], &a->seq, &a->tmp[1]);
			path_adjustq(a->stack.a[path_end[j]].penalty - a->stack.a[path_end[0]].penalty, &a->tmp[0], &a->tmp[1]);
		}
		fmc_seq_cpy_no_del(&a->seq, &a->tmp[0]);
	}
	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, 0x48(%rsp)
cmpq $0x10000, (%rdx)        # imm = 0x10000
jae 0xa287
movq %rdx, %rbx
xorl %r14d, %r14d
movq %r14, 0x90(%rdx)
movq %r14, 0x78(%rdx)
movq %r14, 0x90(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rsp)
movq 0x48(%rdx), %rdx
movl $0x0, %r12d
testq %rdx, %rdx
je 0xa13c
movq %rdi, %r9
leaq 0x90(%rbx), %rax
movq %rax, 0xa0(%rsp)
leaq 0x48(%rbx), %rax
movq %rax, 0x60(%rsp)
xorl %r14d, %r14d
movl $0x1, %r13d
movabsq $0x100000000, %r12      # imm = 0x100000000
movq %r12, %rax
xorl %r15d, %r15d
xorl %ebp, %ebp
xorl %r8d, %r8d
movq %rdi, 0x8(%rsp)
movq %rax, %r11
movq 0x58(%rbx), %rax
movzwl (%rax,%r14), %eax
andl $0xf, %eax
cmpw $0x3, %ax
jbe 0x971e
xorl %r15d, %r15d
xorl %r8d, %r8d
xorl %ebp, %ebp
jmp 0x9763
movswq (%r9), %rcx
addq %rcx, %rcx
movq $-0x1, %rsi
shlq %cl, %rsi
shlq $0x2, %r8
notq %rsi
andq %r8, %rsi
movzwl %ax, %edi
movl $0x3, %r8d
subl %edi, %r8d
incl %ebp
movslq %r8d, %rdi
addl %r12d, %ecx
addb $-0x2, %cl
andb $-0x2, %cl
shlq %cl, %rdi
orq %rax, %rsi
shrq $0x2, %r15
orq %rdi, %r15
movq %rsi, %r8
movq %r15, 0x78(%rsp)
movq %r8, 0x70(%rsp)
movl %r13d, 0x88(%rsp)
cmpq %rdx, %r13
je 0x97e6
movq (%r9), %rsi
movswl %si, %edi
cmpl %edi, %ebp
jl 0x97ce
sarl $0x10, %esi
movq %r8, 0x30(%rsp)
movq 0xa8(%rbx), %r8
leaq 0x70(%rsp), %rdx
movq 0x48(%rsp), %rcx
movl %ebp, 0x38(%rsp)
movq %rbx, %rbp
movq %r15, %rbx
movq %r11, %r15
callq 0xae40
movq 0x30(%rsp), %r8
movq %r15, %r11
movq %rbx, %r15
movq %rbp, %rbx
movl 0x38(%rsp), %ebp
movq 0x8(%rsp), %r9
movq 0x48(%rbx), %rdx
testl %eax, %eax
jns 0x97e6
addq $0xc, %r14
leaq (%r11,%r12), %rax
leaq 0x1(%r13), %rcx
cmpq %r13, %rdx
movq %rcx, %r13
ja 0x96ff
sarq $0x20, %r11
cmpq %r11, %rdx
jne 0x97fa
xorl %r14d, %r14d
xorl %r12d, %r12d
jmp 0xa13c
movl $0x0, 0x8c(%rsp)
movq $0x0, 0x90(%rsp)
movl $0xffffffff, 0x84(%rsp) # imm = 0xFFFFFFFF
movq 0x78(%rbx), %rcx
cmpq 0x80(%rbx), %rcx
jne 0x9861
leaq (%rcx,%rcx), %rax
testq %rcx, %rcx
movl $0x2, %ecx
cmovneq %rax, %rcx
movq %rcx, 0x80(%rbx)
movq 0x88(%rbx), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rsi
callq 0x2260
movq %rax, 0x88(%rbx)
movq 0x78(%rbx), %rcx
jmp 0x9868
movq 0x88(%rbx), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, 0x78(%rbx)
leaq (%rcx,%rcx,4), %rcx
leaq 0x80(%rsp), %rsi
movq 0x10(%rsi), %rdx
movq %rdx, 0x20(%rax,%rcx,8)
movups -0x10(%rsi), %xmm0
movups (%rsi), %xmm1
movups %xmm1, 0x10(%rax,%rcx,8)
movups %xmm0, (%rax,%rcx,8)
movq 0x1b75c(%rip), %rbp     # 0x24ff8
movl $0x0, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
xorl %r13d, %r13d
xorl %r14d, %r14d
movslq %r13d, %rax
leaq (%rsp,%rax,4), %r12
addq $0xb0, %r12
movq 0x78(%rbx), %rax
testq %rax, %rax
je 0x9f73
movq 0x88(%rbx), %rcx
movq 0x20(%rcx), %rdx
movq %rdx, 0x90(%rsp)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movaps %xmm1, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
decq %rax
movq %rax, 0x78(%rbx)
leaq (%rax,%rax,4), %rax
movq 0x20(%rcx,%rax,8), %rdx
movq %rdx, 0x20(%rcx)
movups (%rcx,%rax,8), %xmm0
movups 0x10(%rcx,%rax,8), %xmm1
movups %xmm1, 0x10(%rcx)
movups %xmm0, (%rcx)
movq 0x78(%rbx), %rsi
movq 0x88(%rbx), %rdx
xorl %edi, %edi
callq 0x7e7a
movq 0x8(%rsp), %rsi
testl %r13d, %r13d
je 0x995c
movq 0xa0(%rbx), %rax
movslq 0xb0(%rsp), %rcx
shlq $0x4, %rcx
movl 0x40(%rsi), %edx
addl 0x8(%rax,%rcx), %edx
cmpl %edx, 0x80(%rsp)
jg 0x9f83
movslq 0x88(%rsp), %r15
movl 0x1b866(%rip), %eax     # 0x251d0
movq 0x60(%rsp), %rcx
cmpq %r15, (%rcx)
jne 0x99a9
cmpl $0x6, %eax
jge 0x999a
movl 0x84(%rsp), %eax
incl %r13d
movl %eax, (%r12)
addq $0x4, %r12
cmpl $0x8, %r13d
jne 0x98c1
jmp 0x9f7d
leaq 0x80(%rsp), %rdi
callq 0x28af
jmp 0x9979
movl %r13d, 0x10(%rsp)
movq %r14, 0x18(%rsp)
leaq (%r15,%r15,2), %r9
cmpl $0x6, %eax
jge 0x9cda
shlq $0x2, %r9
addq 0x58(%rbx), %r9
movq %r9, 0x20(%rsp)
movq 0x38(%rsp), %r14
cmpl %r15d, %r14d
cmovlel %r15d, %r14d
movq 0x78(%rbx), %rax
movq %rax, 0x58(%rsp)
movq 0xa8(%rbx), %r8
movl (%rsi), %esi
movswl %si, %edi
sarl $0x10, %esi
leaq 0x70(%rsp), %r12
movq %r12, %rdx
movq 0x48(%rsp), %rcx
callq 0xae40
testl %eax, %eax
movq %r14, 0x38(%rsp)
js 0x9a21
movl %eax, %r13d
shrl $0x5, %r13d
andl $0x1f, %r13d
cmpl $0x1f, %r13d
jne 0x9ab0
movq 0x8(%rsp), %rax
movswl (%rax), %r15d
movq 0x20(%rsp), %rax
movb (%rax), %al
andb $0xf, %al
cmpb $0x3, %al
ja 0x9a3c
movzbl %al, %ecx
jmp 0x9a47
callq 0x2240
movq %rax, %rcx
andl $0x4, %ecx
movq 0x18(%rsp), %r14
movl 0x10(%rsp), %r13d
movl %r15d, %edi
movq %rbx, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
movl $0x3f, %r9d
xorl %r15d, %r15d
pushq %r15
pushq %r15
callq 0xb1fc
addq $0x10, %rsp
cmpl $0x1, %r13d
adcl %r15d, %r14d
movl 0x30(%rsp), %eax
incl %eax
movl %eax, 0x30(%rsp)
cltq
cmpq %rax, 0x48(%rbx)
jae 0x9cc3
cmpq $0x2, 0x78(%rbx)
jb 0x9cc3
movq $0x1, 0x78(%rbx)
movl $0x0, 0x30(%rsp)
jmp 0x9cc3
movq 0x8(%rsp), %r10
movl 0x34(%r10), %r8d
testl %r8d, %r8d
jle 0x9ad1
movq 0x20(%rsp), %r11
movzbl 0x2(%r11), %ecx
cmpl %ecx, %r8d
setbe %dil
jmp 0x9ad8
xorl %edi, %edi
movq 0x20(%rsp), %r11
leal (%r14,%r14,2), %ecx
movq %rcx, 0x50(%rsp)
movl %eax, %esi
shrl $0xc, %esi
movl %eax, %r12d
andl $0x1f, %r12d
shrl $0xa, %eax
andl $0x3, %eax
leal (,%r13,2), %r9d
movzbl %dil, %edx
movzwl (%r11), %ecx
andl $0xf, %ecx
cmpl %ecx, %esi
jne 0x9bb0
movl %edi, %r15d
movl %eax, 0x40(%rsp)
movl %r9d, 0x2c(%rsp)
movl %esi, %ecx
movswl (%r10), %edi
movq %rbx, %rsi
movq %rdx, %rax
leaq 0x70(%rsp), %rdx
movl $0x1, %r8d
xorl %r9d, %r9d
pushq %rax
pushq $0x0
callq 0xb1fc
addq $0x10, %rsp
cmpl $0x1f, %r12d
je 0x9cb9
cmpl $0x9, %r13d
ja 0x9cb9
testb %r15b, %r15b
movq 0x18(%rsp), %r14
movl 0x10(%rsp), %r13d
jne 0x9cc3
movq 0x50(%rsp), %rax
cmpq %rax, 0x58(%rsp)
leaq 0x70(%rsp), %rdx
jae 0x9cc3
movq 0x8(%rsp), %rax
movswl (%rax), %edi
movq 0x20(%rsp), %rax
movzbl 0x3(%rax), %r9d
movl 0x2c(%rsp), %r15d
cmpl %r9d, %r15d
cmoval %r15d, %r9d
movq %rbx, %rsi
movl 0x40(%rsp), %ecx
movl $0x1, %r8d
pushq $0x0
pushq $0x1
jmp 0x9c3c
movl %r12d, 0x6c(%rsp)
movl %esi, 0x44(%rsp)
cmpw $0x4, %cx
jb 0x9c47
movl %eax, %r12d
movl %r9d, 0x2c(%rsp)
movswl (%r10), %edi
movq %rbx, %rsi
leaq 0x70(%rsp), %r15
movq %r15, %rdx
movl 0x44(%rsp), %ecx
movl $0x1, %r8d
movl $0x3, %r9d
xorl %eax, %eax
pushq %rax
pushq %rax
callq 0xb1fc
addq $0x10, %rsp
cmpl $0x1f, 0x6c(%rsp)
movq 0x18(%rsp), %r14
movl 0x10(%rsp), %r13d
je 0x9cc3
movq 0x50(%rsp), %rax
cmpq %rax, 0x58(%rsp)
jae 0x9cc3
movq 0x8(%rsp), %rax
movswl (%rax), %edi
movq %rbx, %rsi
movq %r15, %rdx
movl %r12d, %ecx
movl $0x1, %r8d
movl 0x2c(%rsp), %r9d
xorl %eax, %eax
pushq %rax
pushq %rax
callq 0xb1fc
addq $0x10, %rsp
jmp 0x9cc3
movq %rdx, 0xa8(%rsp)
testl %edx, %edx
leaq 0x70(%rsp), %r12
je 0x9c73
movswl (%r10), %edi
cmpl $0x19, %r13d
jb 0x9c99
movl 0x8c(%rsp), %edx
shrl $0x3, %edx
addl %edi, %edx
cmpl %edx, %r15d
jl 0x9c99
movq 0x90(%rsp), %rdx
shrq $0x30, %rdx
je 0x9db7
movslq 0x48(%r10), %rsi
addq %rsi, %rdx
cmpq %r15, %rdx
jbe 0x9db7
movswl (%r10), %edi
xorl %r10d, %r10d
cmpl %r8d, %r9d
setge %r10b
movq %rbx, %rsi
movq %r12, %rdx
xorl %r8d, %r8d
pushq %r10
pushq $0x0
callq 0xb1fc
addq $0x10, %rsp
movq 0x18(%rsp), %r14
movl 0x10(%rsp), %r13d
cmpl $0x6, 0x1b506(%rip)     # 0x251d0
jl 0x98b3
callq 0x2893
jmp 0x98b3
movslq 0x84(%rsp), %rdx
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
testq %rdx, %rdx
js 0x9d01
movq 0xa0(%rbx), %rax
movq %rdx, %rcx
shlq $0x4, %rcx
movzbl 0xc(%rax,%rcx), %r10d
movq (%rbp), %rdi
movq 0x58(%rbx), %rax
movzwl (%rax,%r9,4), %ecx
andl $0xf, %ecx
leaq 0x136d5(%rip), %rsi     # 0x1d3ed
movsbl (%rcx,%rsi), %r8d
movq %r9, 0x20(%rsp)
movzbl 0x2(%rax,%r9,4), %r9d
movl 0x80(%rsp), %r11d
subq $0x8, %rsp
leaq 0x13f66(%rip), %rsi     # 0x1dca1
movl %r15d, %ecx
xorl %eax, %eax
pushq %r10
pushq %r11
pushq 0x78(%rbx)
callq 0x21c0
addq $0x20, %rsp
movl $0x3, %r12d
movl $0x30, %r13d
movq 0x90(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
shrq %cl, %rdi
andq $0xffff, %rdi           # imm = 0xFFFF
jne 0x9d82
addq $-0x10, %r13
addq $-0x1, %r12
jb 0x9d64
jmp 0x9d8e
movq %r12, %rsi
callq 0x2851
testb $0x1, %al
je 0x9d76
movq (%rbp), %rcx
movl $0x2, %esi
movl $0x1, %edx
leaq 0x13e84(%rip), %rdi     # 0x1dc27
callq 0x2310
movq 0x8(%rsp), %rsi
movq 0x20(%rsp), %r9
jmp 0x99c0
movl 0x6c(%rsp), %r15d
cmpl $0x1f, %r15d
movq 0x18(%rsp), %r14
movl 0x10(%rsp), %r13d
je 0x9e36
cmpl %ecx, %eax
je 0x9e36
movl %eax, 0x40(%rsp)
addl %r15d, %r15d
movq 0x50(%rsp), %rax
cmpq %rax, 0x58(%rsp)
movl %r9d, 0x2c(%rsp)
jb 0x9ed3
addl %r9d, %r15d
movzbl 0x2(%r11), %r9d
cmpl %r9d, %r15d
ja 0x9e28
movswl (%r10), %edi
movq %rbx, %rsi
movq %r12, %rdx
movl $0x1, %r8d
movl %r15d, %r9d
xorl %eax, %eax
pushq %rax
pushq %rax
callq 0xb1fc
movq 0x18(%rsp), %r10
addq $0x10, %rsp
movq 0x20(%rsp), %rax
movzbl 0x2(%rax), %r9d
cmpl %r9d, %r15d
jb 0x9cc3
jmp 0x9f05
movq 0x50(%rsp), %rax
cmpq %rax, 0x58(%rsp)
jb 0x9e89
movl %r9d, %r15d
movzbl 0x2(%r11), %r9d
cmpl %r9d, %r15d
ja 0x9e7e
movswl (%r10), %edi
movq %rbx, %rsi
movq %r12, %rdx
movl $0x1, %r8d
movl %r15d, %r9d
xorl %eax, %eax
pushq %rax
pushq %rax
callq 0xb1fc
movq 0x18(%rsp), %r10
addq $0x10, %rsp
movq 0x20(%rsp), %rax
movzbl 0x2(%rax), %r9d
cmpl %r9d, %r15d
jb 0x9cc3
jmp 0x9eb3
movswl (%r10), %edi
movq %rbx, %rsi
movq %r12, %rdx
movl $0x1, %r8d
xorl %eax, %eax
pushq %rax
pushq %rax
movq %r11, %r15
callq 0xb1fc
movq 0x18(%rsp), %r10
addq $0x10, %rsp
movzbl 0x2(%r15), %r9d
movswl (%r10), %edi
movq %rbx, %rsi
movq %r12, %rdx
movl 0x44(%rsp), %ecx
movl $0x1, %r8d
pushq 0xa8(%rsp)
jmp 0x9ba9
movswl (%r10), %edi
addl %r9d, %r15d
movq %rbx, %rsi
movq %r12, %rdx
movl $0x1, %r8d
movl %r15d, %r9d
xorl %eax, %eax
pushq %rax
pushq %rax
callq 0xb1fc
movq 0x18(%rsp), %r10
addq $0x10, %rsp
movq 0x20(%rsp), %rax
movzbl 0x2(%rax), %r9d
movswl (%r10), %edi
movq %rbx, %rsi
movq %r12, %rdx
movl 0x44(%rsp), %ecx
movl $0x1, %r8d
movq 0xa8(%rsp), %r12
pushq %r12
pushq $0x1
movq %r10, %r15
callq 0xb1fc
addq $0x10, %rsp
movq 0x50(%rsp), %rax
cmpq %rax, 0x58(%rsp)
jae 0x9cc3
movswl (%r15), %edi
movq 0x20(%rsp), %rax
movzbl 0x2(%rax), %r9d
movl 0x2c(%rsp), %eax
cmpl %r9d, %eax
cmoval %eax, %r9d
movq %rbx, %rsi
leaq 0x70(%rsp), %rdx
movl 0x40(%rsp), %ecx
movl $0x1, %r8d
pushq %r12
jmp 0x9ba9
testl %r13d, %r13d
jne 0x9f83
jmp 0x97f2
movl $0x8, %r13d
cmpl $0x6, 0x1b246(%rip)     # 0x251d0
jge 0xa154
movq 0xa0(%rbx), %rax
movl 0xb0(%rsp), %ecx
movslq %ecx, %rsi
movq %rsi, %rcx
shlq $0x4, %rcx
movq %rcx, 0x48(%rsp)
movl 0x8(%rax,%rcx), %r15d
leaq 0x18(%rbx), %rcx
movq 0xa0(%rsp), %rdi
movq 0x60(%rsp), %rdx
movq %rcx, 0x10(%rsp)
callq 0xb474
cmpl $0x1, %r13d
jle 0xa123
movq %r15, 0x20(%rsp)
movq %r14, 0x18(%rsp)
leaq 0x30(%rbx), %rax
movq %rax, 0x38(%rsp)
movl %r13d, %r12d
movl $0x1, %eax
movl $0xf0, %r13d
movq %r12, 0x30(%rsp)
movq %rax, 0x8(%rsp)
movslq 0xb0(%rsp,%rax,4), %r12
movq 0xa0(%rsp), %rdi
movl %r12d, %esi
movq 0x60(%rsp), %rdx
movq 0x38(%rsp), %rcx
callq 0xb474
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0xa101
movq 0xa0(%rbx), %rdx
shlq $0x4, %r12
movl 0x8(%rdx,%r12), %ecx
movq 0x48(%rsp), %rsi
subl 0x8(%rdx,%rsi), %ecx
movq 0x38(%rsp), %rdx
movq (%rdx), %rsi
xorl %r9d, %r9d
xorl %edi, %edi
xorl %r8d, %r8d
movslq %r8d, %r10
movzbl %cl, %edx
cmpq %r10, %rsi
jbe 0xa0d5
leaq (%r9,%r9,2), %r11
movq 0x28(%rbx), %r12
movq %rbx, %r14
movq 0x40(%rbx), %r15
leaq (%r10,%r10,2), %rbp
movl (%r12,%r11,4), %r9d
movl (%r15,%rbp,4), %ebx
movl %ebx, %r10d
xorl %r9d, %r10d
testb $0xf, %r10b
je 0xa0a6
leaq (%r12,%r11,4), %r10
leaq (%r15,%rbp,4), %r11
movzbl 0x4(%r10), %ebx
cmpl %ebx, %ecx
cmovlel %edx, %ebx
movb %bl, 0x4(%r10)
movzwl (%r11), %ebx
andl %r13d, %r9d
andl %r13d, %ebx
cmpw $0x20, %r9w
jne 0xa0bd
cmpw $0x20, %bx
je 0xa0c3
incl %edi
jmp 0xa0c8
cmpw $0x20, %bx
je 0xa0c5
incl %edi
incl %r8d
movq %r14, %rbx
movslq %edi, %r9
cmpq %r9, %rax
ja 0xa05a
jmp 0xa0d8
movslq %edi, %r9
subq %r9, %rax
jbe 0xa101
movq 0x28(%rbx), %rsi
leaq (%r9,%r9,2), %rdi
leaq (%rsi,%rdi,4), %rsi
addq $0x4, %rsi
movzbl (%rsi), %edi
cmpl %edi, %ecx
cmovlel %edx, %edi
movb %dil, (%rsi)
addq $0xc, %rsi
decq %rax
jne 0xa0ed
movq 0x8(%rsp), %rax
incq %rax
movq 0x30(%rsp), %r12
cmpq %r12, %rax
jne 0x9ffd
movq 0x18(%rsp), %r14
movq 0x20(%rsp), %r15
jmp 0xa126
movl %r13d, %r12d
movq 0x60(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x78e5
shlq $0x20, %r12
orq %r15, %r12
movq %r12, %rax
movl %r14d, %edx
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, 0x18(%rsp)
movl %r13d, 0x10(%rsp)
testl %r13d, %r13d
jle 0xa25e
leaq 0x18(%rbx), %r15
movslq 0xb0(%rsp), %rax
movl 0x10(%rsp), %ecx
movq %rcx, 0x48(%rsp)
shlq $0x4, %rax
movq %rax, 0x30(%rsp)
leaq 0x136d8(%rip), %r12     # 0x1d864
xorl %r14d, %r14d
movq (%rbp), %rdi
leaq 0x13b4b(%rip), %rsi     # 0x1dce5
movl %r14d, %edx
xorl %eax, %eax
callq 0x21c0
movq %r14, 0x8(%rsp)
movl 0xb0(%rsp,%r14,4), %esi
movq 0xa0(%rsp), %rdi
movl %esi, 0x38(%rsp)
movq 0x60(%rsp), %rdx
movq %r15, %rcx
callq 0xb474
cmpq $0x0, (%r15)
je 0xa21c
xorl %r13d, %r13d
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movzwl (%rax,%r13), %eax
movl %eax, %edx
shrl $0x4, %edx
andl $0xf, %edx
movq %r12, %rcx
cmpl $0x2, %edx
je 0xa200
movl $0x2d, %edi
cmpl $0x3, %edx
je 0xa207
leaq 0x131ed(%rip), %rcx     # 0x1d3ed
andl $0xf, %eax
movsbl (%rcx,%rax), %edi
movq (%rbp), %rsi
callq 0x2170
incq %r14
addq $0xc, %r13
cmpq %r14, (%r15)
ja 0xa1d6
movslq 0x38(%rsp), %rax
movq (%rbp), %rdi
movq 0xa0(%rbx), %rcx
shlq $0x4, %rax
movl 0x8(%rcx,%rax), %edx
movq 0x30(%rsp), %rax
subl 0x8(%rcx,%rax), %edx
leaq 0x15167(%rip), %rsi     # 0x1f3ab
xorl %eax, %eax
callq 0x21c0
movq 0x8(%rsp), %r14
incq %r14
cmpq 0x48(%rsp), %r14
jne 0xa18f
movq (%rbp), %rcx
leaq 0x13a78(%rip), %rdi     # 0x1dce1
movl $0x3, %esi
movl $0x1, %edx
callq 0x2310
movq 0x18(%rsp), %r14
movl 0x10(%rsp), %r13d
jmp 0x9f90
leaq 0x139a1(%rip), %rdi     # 0x1dc2f
leaq 0x13436(%rip), %rsi     # 0x1d6cb
leaq 0x139a6(%rip), %rcx     # 0x1dc42
movl $0x2e6, %edx            # imm = 0x2E6
callq 0x2120