// File: /workspace/github_c_makefile_star2_O1/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 $0xb8, %rsp
movq %rsi, 0x60(%rsp)
movq %rdi, (%rsp)
cmpq $0x10000, (%rdx)        # imm = 0x10000
jae 0x9eaf
movq %rdx, %rbx
xorl %r15d, %r15d
movq %r15, 0x90(%rdx)
movq %r15, 0x78(%rdx)
movq %r15, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq 0x48(%rdx), %rax
testq %rax, %rax
je 0x9479
leaq 0x30(%rsp), %rcx
movq (%rcx), %r14
movq 0x8(%rcx), %r13
movl $0x1, %r12d
xorl %ebp, %ebp
movq 0x58(%rbx), %rcx
movzwl (%rcx,%rbp), %edx
andl $0xf, %edx
cmpw $0x4, %dx
jb 0x93e1
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
xorl %r13d, %r13d
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x942a
incl %r15d
movq (%rsp), %rcx
movb (%rcx), %cl
addb %cl, %cl
shlq $0x2, %r14
movq $-0x1, %rsi
shlq %cl, %rsi
notq %rsi
andq %r14, %rsi
orq %rdx, %rsi
movq %rsi, 0x30(%rsp)
movzwl %dx, %edx
movl $0x3, %edi
subl %edx, %edi
movslq %edi, %rdx
addb $-0x2, %cl
shlq %cl, %rdx
shrq $0x2, %r13
orq %rdx, %r13
movq %r13, 0x38(%rsp)
movq %rsi, %r14
movl %r12d, 0x48(%rsp)
cmpq %rax, %r12
je 0x9479
movq (%rsp), %rax
movq (%rax), %rsi
movswl %si, %edi
cmpl %edi, %r15d
jl 0x9460
sarl $0x10, %esi
movq 0xa8(%rbx), %r8
leaq 0x30(%rsp), %rdx
movq 0x60(%rsp), %rcx
callq 0xa96d
testl %eax, %eax
jns 0x9479
movq 0x48(%rbx), %rax
addq $0xc, %rbp
leaq 0x1(%r12), %rcx
cmpq %r12, %rax
movq %rcx, %r12
ja 0x93bd
movslq 0x48(%rsp), %rax
cmpq %rax, 0x48(%rbx)
jne 0x948e
xorl %edx, %edx
xorl %r14d, %r14d
jmp 0x9d70
andl $0x7, 0x4c(%rsp)
movq $0x0, 0x50(%rsp)
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
movq 0x80(%rbx), %rax
cmpq %rax, 0x78(%rbx)
jne 0x94e3
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmovneq %rcx, %rax
movq %rax, 0x80(%rbx)
movq 0x88(%rbx), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,4), %rsi
callq 0x2260
movq %rax, 0x88(%rbx)
leaq 0x90(%rbx), %rax
movq %rax, 0x88(%rsp)
leaq 0x48(%rbx), %r12
movq 0x78(%rbx), %rax
movq 0x88(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x78(%rbx)
leaq (%rax,%rax,4), %rax
leaq 0x40(%rsp), %rsi
movq 0x10(%rsi), %rdx
movq %rdx, 0x20(%rcx,%rax,8)
movaps -0x10(%rsi), %xmm0
movaps (%rsi), %xmm1
movups %xmm1, 0x10(%rcx,%rax,8)
movups %xmm0, (%rcx,%rax,8)
movq 0x1aac6(%rip), %r15     # 0x23ff8
movl $0x0, 0x2c(%rsp)
movq $0x0, 0x20(%rsp)
xorl %r14d, %r14d
movq $0x0, 0x78(%rsp)
movq %r12, 0x10(%rsp)
movq 0x78(%rbx), %rax
testq %rax, %rax
je 0x9baf
movq 0x88(%rbx), %rcx
movq 0x20(%rcx), %rdx
movq %rdx, 0x50(%rsp)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%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 0x80ea
testl %r14d, %r14d
je 0x95e7
movq 0xa0(%rbx), %rax
movslq 0x90(%rsp), %rcx
shlq $0x4, %rcx
movq (%rsp), %rdx
movl 0x40(%rdx), %edx
addl 0x8(%rax,%rcx), %edx
movb $0x1, %al
cmpl %edx, 0x40(%rsp)
jg 0x9b9e
movslq 0x48(%rsp), %rbp
movl 0x1abde(%rip), %eax     # 0x241d0
cmpq %rbp, (%r12)
jne 0x961e
cmpl $0x6, %eax
jge 0x9936
movl 0x44(%rsp), %eax
movslq %r14d, %rcx
incl %r14d
movl %eax, 0x90(%rsp,%rcx,4)
cmpl $0x8, %r14d
sete %al
jmp 0x9b9e
movq %r14, 0x8(%rsp)
leaq (,%rbp,2), %r15
addq %rbp, %r15
cmpl $0x6, %eax
jge 0x9945
shlq $0x2, %r15
addq 0x58(%rbx), %r15
movq 0x20(%rsp), %rax
cmpl %ebp, %eax
cmovlel %ebp, %eax
movq %rax, 0x20(%rsp)
movq 0x78(%rbx), %r13
movq 0xa8(%rbx), %r8
movq (%rsp), %rax
movl (%rax), %esi
movswl %si, %edi
sarl $0x10, %esi
leaq 0x30(%rsp), %rdx
movq 0x60(%rsp), %rcx
callq 0xa96d
testl %eax, %eax
js 0x9690
movl %eax, %r12d
movl %eax, %r14d
shrl $0x5, %r14d
andl $0x1f, %r14d
cmpl $0x1f, %r14d
jne 0x972b
movq (%rsp), %rax
movswl (%rax), %ebp
movb (%r15), %al
andb $0xf, %al
cmpb $0x3, %al
ja 0x96a5
movzbl %al, %ecx
jmp 0x96b0
callq 0x2240
movq %rax, %rcx
andl $0x4, %ecx
movq 0x8(%rsp), %r14
movq 0x1a93c(%rip), %r15     # 0x23ff8
movq 0x10(%rsp), %r12
movl %ebp, %edi
movq %rbx, %rsi
leaq 0x30(%rsp), %rdx
xorl %r8d, %r8d
movl $0x3f, %r9d
xorl %r13d, %r13d
pushq %r13
pushq %r13
callq 0xad45
addq $0x10, %rsp
cmpl $0x1, %r14d
movq 0x78(%rsp), %rax
adcl %r13d, %eax
movq %rax, 0x78(%rsp)
movl 0x2c(%rsp), %eax
incl %eax
movl %eax, 0x2c(%rsp)
cltq
cmpq %rax, 0x48(%rbx)
jae 0x9b93
cmpq $0x2, 0x78(%rbx)
jb 0x9b93
movq $0x1, 0x78(%rbx)
movl $0x0, 0x2c(%rsp)
jmp 0x9b93
movl %r12d, %edx
andl $0x1f, %edx
movl %r12d, %ecx
shrl $0xa, %ecx
andl $0x3, %ecx
cmpl $0x1f, %edx
movl $0x4, %eax
cmovel %eax, %ecx
movl %ecx, 0x1c(%rsp)
movq (%rsp), %rax
movl 0x34(%rax), %eax
testl %eax, %eax
jle 0x9761
movzbl 0x2(%r15), %ecx
cmpl %ecx, %eax
setle %sil
jmp 0x9763
xorl %esi, %esi
movq 0x20(%rsp), %rcx
leal (%rcx,%rcx,2), %r8d
shrl $0xc, %r12d
andl $0x3, %r12d
leal (%r14,%r14), %r11d
movzbl %sil, %r10d
movzwl (%r15), %ecx
andl $0xf, %ecx
cmpl %ecx, %r12d
jne 0x982f
movl %esi, %ebp
movq %r8, 0x68(%rsp)
movq %r11, 0x80(%rsp)
movq (%rsp), %rax
movswl (%rax), %edi
movq %rdx, %r12
movq %rbx, %rsi
leaq 0x30(%rsp), %rdx
movl $0x1, %r8d
xorl %r9d, %r9d
pushq %r10
pushq $0x0
callq 0xad45
addq $0x10, %rsp
cmpl $0x1f, %r12d
je 0x9b82
cmpl $0x9, %r14d
movq 0x10(%rsp), %r12
ja 0x981e
testb %bpl, %bpl
jne 0x981e
cmpq 0x68(%rsp), %r13
jae 0x981e
movq (%rsp), %rax
movswl (%rax), %edi
movzbl 0x3(%r15), %r9d
movq 0x80(%rsp), %rbp
cmpl %r9d, %ebp
cmoval %ebp, %r9d
movq %rbx, %rsi
leaq 0x30(%rsp), %rdx
movl 0x1c(%rsp), %ecx
movl $0x1, %r8d
pushq $0x0
pushq $0x1
callq 0xad45
addq $0x10, %rsp
movq 0x8(%rsp), %r14
movq 0x1a7ce(%rip), %r15     # 0x23ff8
jmp 0x9b93
movq %rdx, 0x70(%rsp)
cmpw $0x4, %cx
jb 0x98cc
movq %r8, %rbp
movq %r11, 0x80(%rsp)
movq (%rsp), %rax
movswl (%rax), %edi
movq %rbx, %rsi
leaq 0x30(%rsp), %rdx
movl %r12d, %ecx
movl $0x1, %r8d
movl $0x3, %r9d
xorl %eax, %eax
pushq %rax
pushq %rax
callq 0xad45
addq $0x10, %rsp
cmpl $0x1f, 0x70(%rsp)
movq 0x8(%rsp), %r14
movq 0x1a773(%rip), %r15     # 0x23ff8
je 0x9b8e
cmpq %rbp, %r13
movq 0x10(%rsp), %r12
jae 0x9b93
movq (%rsp), %rax
movswl (%rax), %edi
movq %rbx, %rsi
leaq 0x30(%rsp), %rdx
movl 0x1c(%rsp), %ecx
movl $0x1, %r8d
movq 0x80(%rsp), %r9
xorl %eax, %eax
pushq %rax
pushq %rax
callq 0xad45
addq $0x10, %rsp
jmp 0x9b93
testl %r10d, %r10d
je 0x98eb
movq (%rsp), %rdx
movswl (%rdx), %edi
cmpl $0x19, %r14d
jb 0x9915
movl 0x4c(%rsp), %edx
shrl $0x3, %edx
addl %edi, %edx
cmpl %edx, %ebp
jl 0x9915
movq 0x50(%rsp), %rdx
shrq $0x30, %rdx
je 0x9a13
movq (%rsp), %rsi
movslq 0x48(%rsi), %rsi
addq %rsi, %rdx
cmpq %rbp, %rdx
jbe 0x9a13
movq (%rsp), %rdx
movswl (%rdx), %edi
xorl %r10d, %r10d
cmpl %eax, %r11d
setge %r10b
movq %rbx, %rsi
leaq 0x30(%rsp), %rdx
xorl %r8d, %r8d
movl %r11d, %r9d
pushq %r10
pushq $0x0
jmp 0x9b79
leaq 0x40(%rsp), %rdi
callq 0x2894
jmp 0x9601
movslq 0x44(%rsp), %rdx
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
testq %rdx, %rdx
js 0x9969
movq 0xa0(%rbx), %rax
movq %rdx, %rcx
shlq $0x4, %rcx
movzbl 0xc(%rax,%rcx), %r10d
movq 0x1a688(%rip), %rax     # 0x23ff8
movq (%rax), %rdi
movq 0x58(%rbx), %rax
movzwl (%rax,%r15,4), %ecx
andl $0xf, %ecx
leaq 0x12a2f(%rip), %rsi     # 0x1c3b5
movsbl (%rcx,%rsi), %r8d
movzbl 0x2(%rax,%r15,4), %r9d
movl 0x40(%rsp), %r11d
subq $0x8, %rsp
leaq 0x13188(%rip), %rsi     # 0x1cb29
movl %ebp, %ecx
xorl %eax, %eax
pushq %r10
pushq %r11
pushq 0x78(%rbx)
callq 0x21c0
addq $0x20, %rsp
movl $0x3, %r14d
movl $0x30, %r12d
movq 0x50(%rsp), %r13
movq %r13, %rdi
movl %r12d, %ecx
shrq %cl, %rdi
andq $0xffff, %rdi           # imm = 0xFFFF
jne 0x99e4
addq $-0x10, %r12
addq $-0x1, %r14
jb 0x99c6
jmp 0x99ee
movq %r14, %rsi
callq 0x2834
jmp 0x99d8
movq 0x1a603(%rip), %rax     # 0x23ff8
movq (%rax), %rcx
movl $0x2, %esi
movl $0x1, %edx
leaq 0x130a6(%rip), %rdi     # 0x1caaf
callq 0x2310
jmp 0x9637
movq 0x70(%rsp), %rsi
cmpl $0x1f, %esi
je 0x9aff
cmpl %ecx, 0x1c(%rsp)
je 0x9aff
addl %esi, %esi
cmpq %r8, %r13
jb 0x9a3f
leal (%r11,%rsi), %eax
movzbl 0x2(%r15), %edx
cmpl %edx, %eax
ja 0x9a88
movq (%rsp), %rax
movswl (%rax), %edi
leal (%r11,%rsi), %r9d
movq %rsi, 0x70(%rsp)
movq %rbx, %rsi
leaq 0x30(%rsp), %rdx
movq %r8, 0x68(%rsp)
movl $0x1, %r8d
xorl %eax, %eax
pushq %rax
pushq %rax
movq %r11, %r14
movq %r10, %rbp
callq 0xad45
movq 0x80(%rsp), %rsi
movq %rbp, %r10
movq 0x78(%rsp), %r8
movq %r14, %r11
addq $0x10, %rsp
cmpq %r8, %r13
jb 0x9a99
addl %r11d, %esi
movzbl 0x2(%r15), %eax
cmpl %eax, %esi
jb 0x9ad5
movq (%rsp), %rax
movswl (%rax), %edi
movzbl 0x2(%r15), %r9d
movq %rbx, %rsi
leaq 0x30(%rsp), %rdx
movl %r12d, %ecx
movq %r8, %r12
movl $0x1, %r8d
pushq %r10
pushq $0x1
movq %r11, %r14
movq %r10, %rbp
callq 0xad45
movq %rbp, %r10
movq %r12, %r8
movq %r14, %r11
addq $0x10, %rsp
cmpq %r8, %r13
jae 0x9b82
movq (%rsp), %rax
movswl (%rax), %edi
movzbl 0x2(%r15), %r9d
cmpl %r9d, %r11d
cmoval %r11d, %r9d
movq %rbx, %rsi
leaq 0x30(%rsp), %rdx
movl 0x1c(%rsp), %ecx
jmp 0x9b6f
cmpq %r8, %r13
jb 0x9b0e
movzbl 0x2(%r15), %eax
cmpl %eax, %r11d
ja 0x9b49
movq (%rsp), %rax
movswl (%rax), %edi
movq %rbx, %rsi
leaq 0x30(%rsp), %rdx
movq %r8, 0x68(%rsp)
movl $0x1, %r8d
movl %r11d, %r9d
xorl %eax, %eax
pushq %rax
pushq %rax
movq %r11, %r14
movq %r10, %rbp
callq 0xad45
movq %rbp, %r10
movq 0x78(%rsp), %r8
movq %r14, %r11
addq $0x10, %rsp
cmpq %r8, %r13
jb 0x9b58
movzbl 0x2(%r15), %eax
cmpl %eax, %r11d
jb 0x9b82
movq (%rsp), %rax
movswl (%rax), %edi
movzbl 0x2(%r15), %r9d
movq %rbx, %rsi
leaq 0x30(%rsp), %rdx
movl %r12d, %ecx
movl $0x1, %r8d
pushq %r10
pushq $0x1
callq 0xad45
addq $0x10, %rsp
movq 0x8(%rsp), %r14
movq 0x1a46a(%rip), %r15     # 0x23ff8
movq 0x10(%rsp), %r12
cmpl $0x6, 0x1a636(%rip)     # 0x241d0
jge 0x9ba8
xorl %eax, %eax
testb %al, %al
je 0x9554
jmp 0x9baf
callq 0x2878
jmp 0x9b9c
testl %r14d, %r14d
je 0x9d62
cmpl $0x6, 0x1a611(%rip)     # 0x241d0
movq %r14, 0x8(%rsp)
jge 0x9d85
movq 0xa0(%rbx), %rax
movl 0x90(%rsp), %ecx
movslq %ecx, %rsi
movq %rsi, %rbp
shlq $0x4, %rbp
movl 0x8(%rax,%rbp), %eax
movq %rax, 0x60(%rsp)
leaq 0x18(%rbx), %rcx
movq 0x88(%rsp), %rdi
movq %r12, %r13
movq %r12, %rdx
movq %rcx, 0x20(%rsp)
callq 0xafae
cmpl $0x2, %r14d
jl 0x9d44
leaq 0x30(%rbx), %r15
movl 0x8(%rsp), %eax
movq %rax, (%rsp)
movl $0x1, %r14d
movslq 0x90(%rsp,%r14,4), %r12
movq 0x88(%rsp), %rdi
movl %r12d, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0xafae
movq 0x18(%rbx), %rax
movq 0xa0(%rbx), %rdx
shlq $0x4, %r12
movl 0x8(%rdx,%r12), %ecx
subl 0x8(%rdx,%rbp), %ecx
testq %rax, %rax
je 0x9d09
movq (%r15), %rsi
xorl %r8d, %r8d
xorl %edx, %edx
xorl %edi, %edi
movslq %edi, %r10
cmpq %r10, %rsi
jbe 0x9d04
leaq (%r8,%r8,2), %r9
movq 0x28(%rbx), %r11
movq 0x40(%rbx), %r8
leaq (%r11,%r9,4), %r9
leaq (%r10,%r10,2), %r10
movzwl (%r8,%r10,4), %r11d
xorw (%r9), %r11w
testb $0xf, %r11b
je 0x9caf
movzbl 0x4(%r9), %r11d
cmpl %r11d, %ecx
movzbl %cl, %r12d
cmovgl %r11d, %r12d
movb %r12b, 0x4(%r9)
leaq (%r8,%r10,4), %r8
movzwl (%r9), %r9d
andl $0xf0, %r9d
cmpw $0x20, %r9w
jne 0x9cd7
movzwl (%r8), %r10d
andl $0xf0, %r10d
cmpw $0x20, %r10w
jne 0x9cf6
cmpw $0x20, %r9w
je 0x9cf0
movzwl (%r8), %r8d
andl $0xf0, %r8d
cmpw $0x20, %r8w
je 0x9cf2
incl %edx
incl %edi
jmp 0x9cf8
incl %edx
movslq %edx, %r8
cmpq %r8, %rax
ja 0x9c6c
movslq %edx, %rdx
jmp 0x9d0b
xorl %edx, %edx
subq %rdx, %rax
jbe 0x9d37
movq 0x28(%rbx), %rsi
leaq (%rdx,%rdx,2), %rdx
leaq (%rsi,%rdx,4), %rdx
addq $0x4, %rdx
movzbl %cl, %esi
movzbl (%rdx), %edi
cmpl %edi, %ecx
cmovlel %esi, %edi
movb %dil, (%rdx)
addq $0xc, %rdx
decq %rax
jne 0x9d23
incq %r14
cmpq (%rsp), %r14
jne 0x9c23
movq %r13, %rdi
movq 0x20(%rsp), %rsi
callq 0x7b60
movq 0x78(%rsp), %rdx
movq 0x8(%rsp), %r14
movq 0x60(%rsp), %rax
jmp 0x9d69
xorl %eax, %eax
movq 0x78(%rsp), %rdx
shlq $0x20, %r14
orq %rax, %r14
movq %r14, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %r14d, %r14d
jle 0x9e87
leaq 0x18(%rbx), %r14
movslq 0x90(%rsp), %rcx
movl 0x8(%rsp), %eax
movq %rax, 0x60(%rsp)
shlq $0x4, %rcx
movq %rcx, 0x20(%rsp)
leaq 0x12939(%rip), %r12     # 0x1c6ec
xorl %ebp, %ebp
movq (%r15), %rdi
leaq 0x12dae(%rip), %rsi     # 0x1cb6d
movl %ebp, %edx
xorl %eax, %eax
callq 0x21c0
movq %rbp, (%rsp)
movl 0x90(%rsp,%rbp,4), %esi
movq 0x88(%rsp), %rdi
movl %esi, %r13d
movq 0x10(%rsp), %rdx
movq %r14, %rcx
callq 0xafae
cmpq $0x0, (%r14)
je 0x9e42
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x28(%rbx), %rax
movzwl (%rax,%r15), %eax
movl %eax, %edx
shrl $0x4, %edx
andl $0xf, %edx
movq %r12, %rcx
cmpl $0x2, %edx
je 0x9e20
movl $0x2d, %edi
cmpl $0x3, %edx
je 0x9e27
leaq 0x12595(%rip), %rcx     # 0x1c3b5
andl $0xf, %eax
movsbl (%rcx,%rax), %edi
movq 0x1a1ca(%rip), %rax     # 0x23ff8
movq (%rax), %rsi
callq 0x2170
incq %rbp
addq $0xc, %r15
cmpq %rbp, (%r14)
ja 0x9df6
movslq %r13d, %rax
movq 0x1a1ac(%rip), %r15     # 0x23ff8
movq (%r15), %rdi
movq 0xa0(%rbx), %rcx
shlq $0x4, %rax
movl 0x8(%rcx,%rax), %edx
movq 0x20(%rsp), %rax
subl 0x8(%rcx,%rax), %edx
leaq 0x14335(%rip), %rsi     # 0x1e1a3
xorl %eax, %eax
callq 0x21c0
movq (%rsp), %rbp
incq %rbp
cmpq 0x60(%rsp), %rbp
jne 0x9db5
movq (%r15), %rcx
leaq 0x12cd8(%rip), %rdi     # 0x1cb69
movl $0x3, %esi
movl $0x1, %edx
callq 0x2310
movq 0x8(%rsp), %r14
movq 0x10(%rsp), %r12
jmp 0x9bca
leaq 0x12c01(%rip), %rdi     # 0x1cab7
leaq 0x12696(%rip), %rsi     # 0x1c553
leaq 0x12c06(%rip), %rcx     # 0x1caca
movl $0x2e6, %edx            # imm = 0x2E6
callq 0x2120