// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi-lite/bfc.c
// Function: bfc_ec1dir
static int bfc_ec1dir(bfc_ec1buf_t *e, const ecseq_t *seq, ecseq_t *ec, int start, int end, int *max_heap)
{
	echeap1_t z;
	int i, l, rv = -1, path[BFC_MAX_PATHS], n_paths = 0, min_path = -1, min_path_pen = INT_MAX, n_failures = 0;
	assert(end <= seq->n && end - start >= e->opt->k);
	e->heap.n = e->stack.n = 0;
	*max_heap = 0;
	memset(&z, 0, sizeof(echeap1_t));
	kv_resize(ecbase_t, *ec, seq->n);
	ec->n = seq->n;
	for (z.i = start, l = 0; z.i < end; ++z.i) {
		int c = seq->a[z.i].b;
		if (c < 4) {
			if (++l == e->opt->k) break;
			bfc_kmer_append(e->opt->k, z.x.x, c);
		} else l = 0, z.x = bfc_kmer_null;
	}
	assert(z.i < end); // before calling this function, there must be at least one solid k-mer
	z.k = -1;
	for (i = 0; i < BFC_EC_HIST; ++i) z.ecpos[i] = -1;
	for (i = 0; i < BFC_EC_HIST_HIGH; ++i) z.ecpos_high[i] = -1;
	kv_push(echeap1_t, e->heap, z);
	for (i = 0; i < seq->n; ++i) ec->a[i].b = seq->a[i].b, ec->a[i].ob = seq->a[i].ob;
	// exhaustive error correction
	while (1) {
		int stop = 0;
		*max_heap = *max_heap > 255? 255 : *max_heap > e->heap.n? *max_heap : e->heap.n;
		if (e->heap.n == 0) { // may happen when there is an uncorrectable "N"
			rv = -2;
			break;
		}
		z = e->heap.a[0];
		e->heap.a[0] = kv_pop(e->heap);
		ks_heapdown_ec(0, e->heap.n, e->heap.a);
		if (min_path >= 0 && z.tot_pen > min_path_pen + e->opt->max_path_diff) break;
		if (z.i - end > e->opt->max_end_ext) stop = 1;
		if (!stop) {
			ecbase_t *c = z.i < seq->n? &seq->a[z.i] : 0;
			int b, os = -1, fixed = 0, other_ext = 0, n_added = 0, added_cnt[4];
			bfc_penalty_t added[4];
			// test if the read extension alone is enough
			if (z.i > end) fixed = 1;
			if (c && c->b < 4) { // A, C, G or T
				bfc_kmer_t x = z.x;
				bfc_kmer_append(e->opt->k, x.x, c->b);
				os = bfc_ch_kmer_occ(e->ch, &x);
				if (c->q && (os&0xff) >= e->opt->min_cov + 1 && c->lcov >= e->opt->min_cov + 1) fixed = 1;
				else if (c->hcov > e->opt->k * .75) fixed = 1;
			}
			// extension
			for (b = 0; b < 4; ++b) {
				bfc_penalty_t pen;
				if (fixed && c && b != c->b) continue;
				if (c == 0 || b != c->b) {
					int s;
					bfc_kmer_t x = z.x;
					pen.ec = 0, pen.ec_high = 0, pen.absent = 0, pen.absent_high = 0, pen.b = b;
					if (c) { // not over the end
						if (c->q && z.ecpos_high[BFC_EC_HIST_HIGH-1] >= 0 && z.i - z.ecpos_high[BFC_EC_HIST_HIGH-1] < e->opt->win_multi_ec) continue; // no close highQ corrections
						if (z.ecpos[BFC_EC_HIST-1] >= 0 && z.i - z.ecpos[BFC_EC_HIST-1] < e->opt->win_multi_ec) continue; // no clustered corrections
					}
					bfc_kmer_append(e->opt->k, x.x, b);
					s = bfc_ch_kmer_occ(e->ch, &x);
					if (s < 0 || (s&0xff) < e->opt->min_cov) continue; // not solid
					//if (os >= 0 && (s&0xff) - (os&0xff) < 2) continue; // not sufficiently better than the read path
					pen.ec = c && c->b < 4? 1 : 0;
					pen.ec_high = pen.ec? c->oq : 0;
					pen.absent = 0;
					pen.absent_high = ((s>>8&0xff) < e->opt->min_cov);
					pen.b = b;
					added_cnt[n_added] = s;
					added[n_added++] = pen;
					++other_ext;
				} else {
					pen.ec = pen.ec_high = 0;
					pen.absent = (os < 0 || (os&0xff) < e->opt->min_cov);
					pen.absent_high = (os < 0 || (os>>8&0xff) < e->opt->min_cov);
					pen.b = b;
					added_cnt[n_added] = os;
					added[n_added++] = pen;
				}
			} // ~for(b)
			if (fixed == 0 && other_ext == 0) ++n_failures;
			if (n_failures > seq->n * 2) {
				rv = -3;
				break;
			}
			if (c || n_added == 1) {
				if (n_added > 1 && e->heap.n > e->opt->max_heap) { // to prevent heap explosion
					int min_b = -1, min = INT_MAX;
					for (b = 0; b < n_added; ++b) {
						int t = weighted_penalty(e->opt, added[b]);
						if (min > t) min = t, min_b = b;
					}
					buf_update(e, &z, added[min_b], added_cnt[min_b]);
				} else {
					for (b = 0; b < n_added; ++b)
						buf_update(e, &z, added[b], added_cnt[b]);
				}
			} else {
				if (n_added == 0)
					e->stack.a[z.k].tot_pen += e->opt->w_absent * (e->opt->max_end_ext - (z.i - end));
				stop = 1;
			}
		} // ~if(!stop)
		if (stop) {
			if (e->stack.a[z.k].tot_pen < min_path_pen)
				min_path_pen = e->stack.a[z.k].tot_pen, min_path = n_paths;
			path[n_paths++] = z.k;
			if (n_paths == BFC_MAX_PATHS) break;
		}
	} // ~while(1)
	// backtrack
	if (n_paths == 0) return rv;
	assert(min_path >= 0 && min_path < n_paths && e->stack.a[path[min_path]].tot_pen == min_path_pen);
	rv = buf_backtrack(e->stack.a, path[min_path], seq, ec);
	for (i = 0; i < ec->n; ++i) // mask out uncorrected regions
		if (i < start + e->opt->k || i >= end) ec->a[i].b = 4;
	return rv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdx, %r15
movslq %r8d, %rdx
cmpq %rdx, (%rsi)
jb 0x5c1c
movq %rsi, %r12
movq %rdi, %r13
movl %r8d, %eax
subl %ecx, %eax
movq (%rdi), %rsi
cmpl 0x8(%rsi), %eax
jl 0x5c1c
andq $0x0, 0x28(%r13)
andq $0x0, 0x10(%r13)
andl $0x0, (%r9)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xa0(%rsp)
movapd %xmm0, 0x90(%rsp)
movapd %xmm0, 0x80(%rsp)
andq $0x0, 0xb0(%rsp)
movapd %xmm0, 0x70(%rsp)
movq (%r12), %rax
cmpq %rax, 0x8(%r15)
movq %r9, 0x38(%rsp)
movl %r8d, 0x4(%rsp)
movq %rdx, 0x60(%rsp)
movl %ecx, 0x24(%rsp)
jae 0x53b0
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x8(%r15)
movq 0x10(%r15), %rdi
leaq 0x8(,%rcx,8), %rsi
callq 0x21c0
movq %rax, 0x10(%r15)
movq (%r12), %rax
movq %rax, (%r15)
xorl %ebx, %ebx
movl 0x24(%rsp), %eax
movl %eax, 0x74(%rsp)
cmpl 0x4(%rsp), %eax
jge 0x5bfd
movq 0x10(%r12), %rcx
movslq %eax, %rdx
movzbl (%rcx,%rdx,8), %edx
andl $0x7, %edx
cmpb $0x3, %dl
ja 0x53fb
incl %ebx
movq (%r13), %rax
movl 0x8(%rax), %edi
cmpl %edi, %ebx
je 0x5420
leaq 0x98(%rsp), %rsi
callq 0x4077
movl 0x74(%rsp), %eax
jmp 0x541c
movups 0x15e8e(%rip), %xmm0    # 0x1b290
leaq 0x98(%rsp), %rcx
movups %xmm0, 0x10(%rcx)
movupd 0x15e6a(%rip), %xmm0    # 0x1b280
movupd %xmm0, (%rcx)
xorl %ebx, %ebx
incl %eax
jmp 0x53b9
orl $-0x1, 0x78(%rsp)
pushq $0x5
popq %rax
movq 0x38(%rsp), %rbx
cmpq $0xa, %rax
je 0x543d
orl $-0x1, 0x70(%rsp,%rax,4)
incq %rax
jmp 0x542d
orq $-0x1, 0x7c(%rsp)
movq 0x10(%r13), %rcx
cmpq 0x18(%r13), %rcx
jne 0x5476
leaq (%rcx,%rcx), %rax
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmovneq %rax, %rcx
movq %rcx, 0x18(%r13)
movq 0x20(%r13), %rdi
imulq $0x48, %rcx, %rsi
callq 0x21c0
movq %rax, 0x20(%r13)
movq 0x10(%r13), %rcx
jmp 0x547a
movq 0x20(%r13), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r13)
imulq $0x48, %rcx, %rdi
addq %rax, %rdi
pushq $0x9
popq %rcx
leaq 0x70(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
xorl %eax, %eax
cmpq %rax, (%r12)
jbe 0x54dd
movq 0x10(%r12), %rcx
movb (%rcx,%rax,8), %cl
andb $0x7, %cl
movq 0x10(%r15), %rdx
movb (%rdx,%rax,8), %sil
andb $-0x8, %sil
orb %cl, %sil
movb %sil, (%rdx,%rax,8)
movq 0x10(%r12), %rcx
movb (%rcx,%rax,8), %cl
andb $0x70, %cl
movq 0x10(%r15), %rdx
movb (%rdx,%rax,8), %sil
andb $-0x71, %sil
orb %cl, %sil
movb %sil, (%rdx,%rax,8)
incq %rax
jmp 0x5496
movl $0x7fffffff, 0x8(%rsp)  # imm = 0x7FFFFFFF
pushq $-0x1
popq %rax
movl $0x0, 0x20(%rsp)
movl %eax, 0xc(%rsp)
movl $0x0, 0x28(%rsp)
movq %r15, 0x68(%rsp)
movq %r13, 0x18(%rsp)
movq %r12, 0xe0(%rsp)
movslq (%rbx), %rcx
cmpq $0xff, %rcx
jle 0x5525
movq 0x10(%r13), %rdx
movl $0xff, %eax
jmp 0x5531
movq 0x10(%r13), %rdx
cmpq %rcx, %rdx
movl %edx, %eax
cmovbl %ecx, %eax
movl %eax, (%rbx)
testq %rdx, %rdx
je 0x5a67
movq 0x20(%r13), %rax
pushq $0x9
popq %r8
movq %r8, %rcx
leaq 0x70(%rsp), %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
decq %rdx
movq %rdx, 0x10(%r13)
imulq $0x48, %rdx, %rsi
addq %rax, %rsi
movq %r8, %rcx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq 0x10(%r13), %rsi
movq 0x20(%r13), %rdx
xorl %edi, %edi
callq 0x4524
movq (%r13), %rax
cmpl $0x0, 0xc(%rsp)
js 0x5594
movl 0x30(%rax), %ecx
addl 0x8(%rsp), %ecx
cmpl %ecx, 0x70(%rsp)
jg 0x5a7a
movslq 0x74(%rsp), %r14
movl %r14d, %ecx
subl 0x4(%rsp), %ecx
cmpl 0x14(%rax), %ecx
jg 0x5a1a
cmpq %r14, (%r12)
jbe 0x567b
movq 0x10(%r12), %rcx
xorl %ebp, %ebp
cmpl 0x4(%rsp), %r14d
setg %bpl
testq %rcx, %rcx
je 0x5686
leaq (%rcx,%r14,8), %r15
movb $0x1, %r8b
testb $0x4, (%r15)
jne 0x568c
leaq 0x98(%rsp), %rcx
movupd (%rcx), %xmm0
movupd 0x10(%rcx), %xmm1
movapd %xmm1, 0x100(%rsp)
movapd %xmm0, 0xf0(%rsp)
movl 0x8(%rax), %edi
movzbl (%r15), %edx
andl $0x7, %edx
leaq 0xf0(%rsp), %rbx
movq %rbx, %rsi
callq 0x4077
movq 0x8(%r13), %rdi
movq %rbx, %rsi
callq 0x12195
movl %eax, %r9d
testb $0x8, (%r15)
movq (%r13), %rax
je 0x564d
movzbl %r9b, %ecx
movl 0x10(%rax), %edx
cmpl %edx, %ecx
jle 0x564d
movzwl 0x2(%r15), %esi
andl $0x3f, %esi
pushq $0x1
popq %rcx
cmpl %esi, %edx
jl 0x5674
movzwl 0x2(%r15), %ecx
shrl $0x6, %ecx
andl $0x3f, %ecx
cvtsi2sd %ecx, %xmm0
cvtsi2sdl 0x8(%rax), %xmm1
mulsd 0xee37(%rip), %xmm1     # 0x144a0
ucomisd %xmm1, %xmm0
movl %ebp, %ecx
jbe 0x5674
pushq $0x1
popq %rcx
movl %ecx, %ebp
movb $0x1, %r8b
jmp 0x5690
xorl %ebp, %ebp
cmpl 0x4(%rsp), %r14d
setg %bpl
xorl %r8d, %r8d
xorl %r15d, %r15d
pushq $-0x1
popq %r9
movl %ebp, 0x44(%rsp)
movl %ebp, %edx
andb %r8b, %dl
movl 0x80(%rsp), %eax
movl 0x94(%rsp), %ecx
movl %r14d, %esi
movl %eax, 0x5c(%rsp)
subl %eax, %esi
movl %esi, 0x4c(%rsp)
movq %r14, 0xd8(%rsp)
movl %r14d, %eax
movl %ecx, 0x58(%rsp)
subl %ecx, %eax
movl %eax, 0x48(%rsp)
movl %r9d, %ecx
movl $0xff, %eax
andl %eax, %ecx
movl %ecx, 0x54(%rsp)
movl %r9d, %ecx
shrl $0x8, %ecx
andl %eax, %ecx
movl %ecx, 0x50(%rsp)
xorl %r14d, %r14d
xorl %r13d, %r13d
movl $0x0, 0x2c(%rsp)
xorl %ebx, %ebx
movl %r9d, 0x10(%rsp)
movb %dl, 0x3(%rsp)
cmpl $0x4, %r13d
je 0x58c6
movslq %ebx, %rsi
testb %dl, %dl
je 0x571e
movzbl (%r15), %eax
andl $0x7, %eax
cmpl %eax, %r13d
je 0x572a
jmp 0x58ba
testq %r15, %r15
je 0x575e
movzbl (%r15), %eax
andl $0x7, %eax
cmpl %eax, %r13d
jne 0x575e
testl %r9d, %r9d
js 0x57df
movq 0x18(%rsp), %rax
movq (%rax), %rax
movl 0x10(%rax), %eax
cmpl %eax, 0x54(%rsp)
setl %cl
shlb $0x2, %cl
cmpl %eax, 0x50(%rsp)
setl %al
shlb $0x3, %al
orb %cl, %al
jmp 0x57e1
leaq 0x98(%rsp), %rax
movupd (%rax), %xmm0
movupd 0x10(%rax), %xmm1
movapd %xmm1, 0x100(%rsp)
movapd %xmm0, 0xf0(%rsp)
testb %r8b, %r8b
je 0x57cf
cmpl $0x0, 0x5c(%rsp)
setns %al
movb (%r15), %cl
shrb $0x3, %cl
andb %al, %cl
movq 0x18(%rsp), %rax
movq (%rax), %rax
cmpb $0x1, %cl
jne 0x57b0
movl 0x4c(%rsp), %ecx
cmpl 0x18(%rax), %ecx
jl 0x58ba
movq %rbx, 0x30(%rsp)
cmpl $0x0, 0x58(%rsp)
js 0x57f8
movl 0x48(%rsp), %ecx
cmpl 0x18(%rax), %ecx
movq 0x18(%rsp), %rbp
jge 0x57fd
jmp 0x5873
movq %rbx, 0x30(%rsp)
movq 0x18(%rsp), %rbp
movq (%rbp), %rax
jmp 0x57fd
movb $0xc, %al
addb %r14b, %al
movl %r9d, 0xc0(%rsp,%rsi,4)
leal 0x1(%rsi), %ebx
movb %al, 0x14(%rsp,%rsi)
jmp 0x58ba
movq 0x18(%rsp), %rbp
movq %rsi, 0xe8(%rsp)
movq %r15, %rbx
movq %r8, %r15
movl 0x8(%rax), %edi
leaq 0xf0(%rsp), %r12
movq %r12, %rsi
movl %r13d, %edx
callq 0x4077
movq 0x8(%rbp), %rdi
movq %r12, %rsi
callq 0x12195
testl %eax, %eax
js 0x5864
movzbl %al, %edx
movq (%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpl %ecx, %edx
movq %r15, %r8
jl 0x5867
testb %r8b, %r8b
movq %rbx, %r15
je 0x587a
movb (%r15), %sil
testb $0x4, %sil
movl 0x10(%rsp), %r9d
jne 0x5885
shrb $0x6, %sil
andb $0x2, %sil
movb $0x1, %dl
jmp 0x5889
movq %r15, %r8
movq %rbx, %r15
movl 0x10(%rsp), %r9d
movb 0x3(%rsp), %dl
movq 0x30(%rsp), %rbx
jmp 0x58ba
xorl %edx, %edx
xorl %esi, %esi
movl 0x10(%rsp), %r9d
jmp 0x5889
xorl %edx, %edx
xorl %esi, %esi
movzbl %ah, %edi
cmpl %ecx, %edi
setl %cl
shlb $0x3, %cl
orb %sil, %cl
addb %r14b, %dl
addb %cl, %dl
movq 0xe8(%rsp), %rcx
movl %eax, 0xc0(%rsp,%rcx,4)
leal 0x1(%rcx), %ebx
movb %dl, 0x14(%rsp,%rcx)
incl 0x2c(%rsp)
movb 0x3(%rsp), %dl
incl %r13d
addb $0x10, %r14b
jmp 0x56fc
xorl %eax, %eax
movl 0x2c(%rsp), %ecx
orl %ecx, 0x44(%rsp)
sete %al
movl 0x28(%rsp), %edx
addl %eax, %edx
movslq %edx, %rax
movq 0xe0(%rsp), %r12
movq (%r12), %rcx
addq %rcx, %rcx
cmpq %rax, %rcx
jb 0x5a6b
movl %edx, 0x28(%rsp)
cmpl $0x1, %ebx
sete %al
orb %al, %r8b
cmpb $0x1, %r8b
movq 0x68(%rsp), %r15
movq 0x18(%rsp), %r13
jne 0x59ea
cmpl $0x2, %ebx
jl 0x5992
movq (%r13), %rdi
movslq 0x34(%rdi), %rax
cmpq %rax, 0x10(%r13)
jbe 0x5992
movl %ebx, %eax
movl 0x20(%rdi), %ecx
movl 0x24(%rdi), %edx
movl 0x28(%rdi), %esi
movl 0x2c(%rdi), %edi
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
xorl %r10d, %r10d
pushq $-0x1
popq %r9
cmpq %r10, %rax
je 0x59c4
movzbl 0x14(%rsp,%r10), %r11d
movl %r11d, %ebx
andl $0x1, %ebx
imull %ecx, %ebx
movl %r11d, %ebp
shrl %ebp
andl $0x1, %ebp
imull %edx, %ebp
addl %ebx, %ebp
movl %r11d, %ebx
shrl $0x2, %ebx
andl $0x1, %ebx
imull %esi, %ebx
shrl $0x3, %r11d
andl $0x1, %r11d
imull %edi, %r11d
addl %ebx, %r11d
addl %ebp, %r11d
cmpl %r11d, %r8d
cmovgl %r10d, %r9d
cmovgel %r11d, %r8d
incq %r10
jmp 0x5943
testl %ebx, %ebx
movl $0x0, %eax
cmovlel %eax, %ebx
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x59e0
movl 0xc0(%rsp,%r14,4), %ecx
movzbl 0x14(%rsp,%r14), %edx
movq %r13, %rdi
leaq 0x70(%rsp), %rsi
callq 0x62b6
incq %r14
jmp 0x599f
movslq %r9d, %rax
movl 0xc0(%rsp,%rax,4), %ecx
movzbl 0x14(%rsp,%rax), %edx
movq %r13, %rdi
leaq 0x70(%rsp), %rsi
callq 0x62b6
movq 0x38(%rsp), %rbx
jmp 0x550e
testl %ebx, %ebx
jne 0x5a15
movl 0x4(%rsp), %eax
subl 0xd8(%rsp), %eax
movq (%r13), %rcx
addl 0x14(%rcx), %eax
movq 0x38(%r13), %rdx
imull 0x28(%rcx), %eax
movslq 0x78(%rsp), %rcx
shlq $0x4, %rcx
addl %eax, 0x8(%rdx,%rcx)
movq 0x38(%rsp), %rbx
movq 0x38(%r13), %rax
movslq 0x78(%rsp), %rcx
movq %rcx, %rdx
shlq $0x4, %rdx
movl 0x8(%rax,%rdx), %eax
movl 0x8(%rsp), %edx
cmpl %edx, %eax
movl 0xc(%rsp), %esi
movl 0x20(%rsp), %edi
cmovll %edi, %esi
movl %esi, 0xc(%rsp)
cmovll %eax, %edx
movl %edx, 0x8(%rsp)
movl %edi, %eax
incl %edi
movl %ecx, 0x110(%rsp,%rax,4)
movl %edi, 0x20(%rsp)
cmpl $0x4, %edi
jne 0x550e
pushq $0x4
popq %rcx
jmp 0x5a89
pushq $-0x2
jmp 0x5a7c
pushq $-0x3
popq %rax
movq 0x68(%rsp), %r15
movq 0x18(%rsp), %r13
jmp 0x5a7d
pushq $-0x1
popq %rax
movl 0x20(%rsp), %ecx
testl %ecx, %ecx
je 0x5beb
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jae 0x5c3b
movq 0x38(%r13), %rbx
movl %eax, %eax
movslq 0x110(%rsp,%rax,4), %r14
movq %r14, %rax
shlq $0x4, %rax
movl 0x8(%rsp), %ecx
cmpl %ecx, 0x8(%rbx,%rax)
jne 0x5c3b
movq (%r12), %rax
cmpq %rax, 0x8(%r15)
jae 0x5b17
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x8(%r15)
movq 0x10(%r15), %rdi
leaq 0x8(,%rcx,8), %rsi
callq 0x21c0
movq %rax, 0x10(%r15)
movq (%r12), %rax
movq 0x60(%rsp), %r8
movq %rax, (%r15)
xorl %r9d, %r9d
testl %r14d, %r14d
js 0x5bae
movl %r14d, %ecx
shlq $0x4, %rcx
leaq (%rbx,%rcx), %rax
movslq 0x4(%rbx,%rcx), %rcx
cmpq %rcx, (%r12)
jbe 0x5ba6
movb 0xc(%rax), %dl
movq 0x10(%r15), %rsi
movb (%rsi,%rcx,8), %dil
andb $0x7, %dl
andb $-0x8, %dil
orb %dl, %dil
movb %dil, (%rsi,%rcx,8)
movzbl 0xd(%rax), %edx
movq 0x10(%r15), %rsi
movzwl 0x2(%rsi,%rcx,8), %edi
andl $0x1, %edx
shll $0xe, %edx
andl $0xffffbfff, %edi       # imm = 0xFFFFBFFF
orl %edx, %edi
movw %di, 0x2(%rsi,%rcx,8)
movzbl 0xd(%rax), %edx
movq 0x10(%r15), %rsi
movzwl 0x2(%rsi,%rcx,8), %edi
andl $-0x4, %edx
shll $0xd, %edx
andl $0x7fff, %edi           # imm = 0x7FFF
orl %edx, %edi
movw %di, 0x2(%rsi,%rcx,8)
movzbl 0xd(%rax), %ecx
btl $0x2, %ecx
adcl $0x0, %r9d
movl (%rax), %r14d
jmp 0x5b22
xorl %eax, %eax
movslq 0x24(%rsp), %rcx
cmpq %rax, (%r15)
jbe 0x5be8
cmpq %r8, %rax
jge 0x5bcf
movq (%r13), %rdx
movslq 0x8(%rdx), %rdx
addq %rcx, %rdx
cmpq %rdx, %rax
jge 0x5be3
movq 0x10(%r15), %rdx
movb (%rdx,%rax,8), %sil
andb $-0x8, %sil
orb $0x4, %sil
movb %sil, (%rdx,%rax,8)
incq %rax
jmp 0x5bb5
movl %r9d, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe929(%rip), %rdi      # 0x1452d
leaq 0xe8d0(%rip), %rsi      # 0x144db
leaq 0xe8cf(%rip), %rcx      # 0x144e1
movl $0x18f, %edx            # imm = 0x18F
callq 0x20e0
leaq 0xe88e(%rip), %rdi      # 0x144b1
leaq 0xe8b1(%rip), %rsi      # 0x144db
leaq 0xe8b0(%rip), %rcx      # 0x144e1
movl $0x182, %edx            # imm = 0x182
callq 0x20e0
leaq 0xe8f5(%rip), %rdi      # 0x14537
leaq 0xe892(%rip), %rsi      # 0x144db
leaq 0xe891(%rip), %rcx      # 0x144e1
movl $0x1f0, %edx            # imm = 0x1F0
callq 0x20e0