// File: /workspace/github_c_makefile_star2_O1/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
movslq %r8d, %r12
cmpq %r12, (%rsi)
jb 0x6af1
movq %r9, %r14
movl %r8d, %ebx
movl %ecx, %r13d
movq %rdi, %r9
movl %r8d, %eax
subl %ecx, %eax
movq (%rdi), %rcx
cmpl 0x8(%rcx), %eax
jl 0x6af1
movq %rdx, %r15
movq %rsi, %rbp
xorl %eax, %eax
movq %rax, 0x28(%r9)
movq %rax, 0x10(%r9)
movl $0x0, (%r14)
movq %rax, 0xa0(%rsp)
pxor %xmm0, %xmm0
movdqa %xmm0, 0x90(%rsp)
movdqa %xmm0, 0x80(%rsp)
movdqa %xmm0, 0x70(%rsp)
movdqa %xmm0, 0x60(%rsp)
movq (%rsi), %rax
cmpq %rax, 0x8(%rdx)
movq %r9, 0x20(%rsp)
jae 0x6060
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 0x21d0
movq 0x20(%rsp), %r9
movq %rax, 0x10(%r15)
movq (%rbp), %rax
movq %rax, (%r15)
cmpl %r13d, %ebx
setg %al
jle 0x617a
movq 0x10(%rbp), %rdx
movslq %r13d, %rcx
movq %rcx, 0xf0(%rsp)
leaq 0x1(%rcx), %rsi
xorl %edi, %edi
movl %ebx, 0x14(%rsp)
movzbl -0x8(%rdx,%rsi,8), %r8d
andl $0x7, %r8d
cmpb $0x3, %r8b
ja 0x60af
incl %edi
movq (%r9), %rcx
movl 0x8(%rcx), %ecx
cmpl %ecx, %edi
jne 0x60d5
xorl %ecx, %ecx
jmp 0x6161
movups 0x171da(%rip), %xmm0    # 0x1d290
leaq 0x88(%rsp), %rcx
movups %xmm0, 0x10(%rcx)
movdqu 0x171b6(%rip), %xmm0    # 0x1d280
movdqu %xmm0, (%rcx)
xorl %edi, %edi
jmp 0x615f
movq $-0x1, %r9
shlq %cl, %r9
notq %r9
movl %r8d, %r10d
andl $0x1, %r10d
movq 0x88(%rsp), %r11
movq 0x90(%rsp), %rbx
leaq (%r10,%r11,2), %r11
andq %r9, %r11
movq %r11, 0x88(%rsp)
shrl %r8d
leaq (%r8,%rbx,2), %r11
movl 0x14(%rsp), %ebx
andq %r9, %r11
movq %r11, 0x90(%rsp)
movq 0x98(%rsp), %r9
shrq %r9
xorq $0x1, %r10
decb %cl
shlq %cl, %r10
orq %r9, %r10
movq %r10, 0x98(%rsp)
movq 0xa0(%rsp), %r9
xorq $0x1, %r8
shlq %cl, %r8
shrq %r9
orq %r9, %r8
movq 0x20(%rsp), %r9
movq %r8, 0xa0(%rsp)
movb $0x1, %cl
testb %cl, %cl
je 0x619e
cmpq %r12, %rsi
setl %al
incl %r13d
incq %rsi
cmpl %r13d, %ebx
jne 0x608c
movl %r13d, 0x64(%rsp)
leaq 0x113ab(%rip), %rdi     # 0x17531
leaq 0x11352(%rip), %rsi     # 0x174df
leaq 0x11351(%rip), %rcx     # 0x174e5
movl $0x18f, %edx            # imm = 0x18F
callq 0x20e0
movl %r13d, 0x64(%rsp)
testb $0x1, %al
je 0x617f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x68(%rsp)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x74(%rsp)
movl %eax, 0x84(%rsp)
movq $-0x1, 0x6c(%rsp)
movq 0x18(%r9), %rax
cmpq %rax, 0x10(%r9)
jne 0x6202
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmovneq %rcx, %rax
movq %rax, 0x18(%r9)
movq 0x20(%r9), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,8), %rsi
callq 0x21d0
movq 0x20(%rsp), %r9
movq %rax, 0x20(%r9)
movq 0x10(%r9), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x10(%r9)
leaq (%rax,%rax,8), %rdi
shlq $0x3, %rdi
addq 0x20(%r9), %rdi
leaq 0x60(%rsp), %rsi
movl $0x9, %ecx
rep  movsq (%rsi), %es:(%rdi)
cmpq $0x0, (%rbp)
je 0x6273
xorl %eax, %eax
movq 0x10(%rbp), %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(%rbp), %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
cmpq %rax, (%rbp)
ja 0x6230
movl $0x7fffffff, 0x10(%rsp) # imm = 0x7FFFFFFF
movl $0xffffffff, 0x18(%rsp) # imm = 0xFFFFFFFF
movq $0x0, 0xb0(%rsp)
leaq 0x60(%rsp), %rdi
movl $0x0, 0x38(%rsp)
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movq %r15, 0x28(%rsp)
movq %r12, 0x108(%rsp)
movq %rbp, 0xd8(%rsp)
movq %r14, 0x100(%rsp)
movslq (%r14), %rax
movl $0xff, %ecx
cmpq $0xff, %rax
jg 0x62db
movq 0x10(%r9), %rcx
cmpq %rax, %rcx
cmovbl %eax, %ecx
movl %ecx, (%r14)
movq 0x10(%r9), %rdx
movl $0x13, %ebx
testq %rdx, %rdx
je 0x6370
movq 0x20(%r9), %rax
movl $0x9, %ecx
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
decq %rdx
movq %rdx, 0x10(%r9)
leaq (%rdx,%rdx,8), %rcx
leaq (%rax,%rcx,8), %rsi
movl $0x9, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq 0x10(%r9), %rsi
movq 0x20(%r9), %rdx
xorl %edi, %edi
callq 0x509a
movq 0x20(%rsp), %r9
cmpl $0x0, 0x18(%rsp)
js 0x634e
movq (%r9), %rax
movl 0x30(%rax), %eax
addl 0x10(%rsp), %eax
cmpl %eax, 0x60(%rsp)
jle 0x634e
leaq 0x60(%rsp), %rdi
jmp 0x6946
movslq 0x64(%rsp), %rsi
movl %esi, %edx
subl 0x14(%rsp), %edx
movq (%r9), %rcx
movl $0x1, %eax
cmpl 0x14(%rcx), %edx
jle 0x637d
leaq 0x60(%rsp), %rdi
jmp 0x68e3
movl $0xfffffffe, 0xc(%rsp)  # imm = 0xFFFFFFFE
jmp 0x6946
cmpq %rsi, (%rbp)
movq %rsi, %r14
jbe 0x6394
leaq (,%r14,8), %rbx
addq 0x10(%rbp), %rbx
jmp 0x6396
xorl %ebx, %ebx
xorl %ebp, %ebp
cmpl 0x14(%rsp), %r14d
setg %bpl
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %rbx, %rbx
je 0x64b3
testb $0x4, (%rbx)
jne 0x64b3
leaq 0x88(%rsp), %rax
movupd (%rax), %xmm0
movupd 0x10(%rax), %xmm1
movapd %xmm1, 0x50(%rsp)
movapd %xmm0, 0x40(%rsp)
movb 0x8(%rcx), %cl
movzbl (%rbx), %edx
movl %edx, %eax
andl $0x6, %eax
movq $-0x1, %rsi
shlq %cl, %rsi
notq %rsi
andl $0x1, %edx
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %r8
leaq (%rdx,%rdi,2), %rdi
andq %rsi, %rdi
movq %rdi, 0x40(%rsp)
addq %r8, %r8
shrl %eax
orq %rax, %r8
andq %rsi, %r8
movq %r8, 0x48(%rsp)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdi
xorq $0x1, %rdx
decb %cl
shlq %cl, %rdx
shrq %rsi
orq %rsi, %rdx
movq %rdx, 0x50(%rsp)
xorq $0x1, %rax
shlq %cl, %rax
shrq %rdi
orq %rdi, %rax
movq %rax, 0x58(%rsp)
movq 0x8(%r9), %rdi
leaq 0x40(%rsp), %rsi
callq 0x1461d
movq 0x20(%rsp), %r9
movl %eax, %r15d
testb $0x8, (%rbx)
je 0x6480
movzbl %r15b, %eax
movq (%r9), %rcx
movl 0x10(%rcx), %ecx
cmpl %ecx, %eax
jle 0x6480
movzwl 0x2(%rbx), %edx
andl $0x3f, %edx
movl $0x1, %eax
cmpl %edx, %ecx
jl 0x64b1
movzwl 0x2(%rbx), %eax
shrl $0x6, %eax
andl $0x3f, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq (%r9), %rax
xorps %xmm1, %xmm1
cvtsi2sdl 0x8(%rax), %xmm1
mulsd 0x10ffc(%rip), %xmm1    # 0x174a0
ucomisd %xmm1, %xmm0
movl %ebp, %eax
jbe 0x64b1
movl $0x1, %eax
movl %eax, %ebp
testq %rbx, %rbx
setne %al
movl %ebp, 0xbc(%rsp)
movl %ebp, %edx
andb %al, %dl
movl %r15d, %ecx
movl $0xff, %eax
andl %eax, %ecx
movl %ecx, 0xc4(%rsp)
movl %r15d, %ecx
shrl $0x8, %ecx
andl %eax, %ecx
movl %ecx, 0xc0(%rsp)
movl 0x70(%rsp), %eax
movl 0x84(%rsp), %ecx
movl %r14d, %edi
movl %eax, 0xd4(%rsp)
subl %eax, %edi
movl %edi, 0xcc(%rsp)
movq %r14, 0xf8(%rsp)
movl %r14d, %eax
movl %ecx, 0xd0(%rsp)
subl %ecx, %eax
movl %eax, 0xc8(%rsp)
xorl %ebp, %ebp
xorl %r8d, %r8d
movl $0x0, 0x3c(%rsp)
xorl %r14d, %r14d
movb %dl, 0x30(%rsp)
testb %dl, %dl
je 0x6544
movzbl (%rbx), %eax
andl $0x7, %eax
cmpl %eax, %r14d
jne 0x670c
testq %rbx, %rbx
je 0x6575
movzbl (%rbx), %eax
andl $0x7, %eax
cmpl %eax, %r14d
jne 0x6575
testl %r15d, %r15d
js 0x6693
movq (%r9), %rax
movl 0xc4(%rsp), %ecx
cmpl 0x10(%rax), %ecx
setl %al
shlb $0x2, %al
jmp 0x6695
leaq 0x88(%rsp), %rax
movupd (%rax), %xmm0
movupd 0x10(%rax), %xmm1
movapd %xmm1, 0x50(%rsp)
movapd %xmm0, 0x40(%rsp)
testq %rbx, %rbx
je 0x65de
cmpl $0x0, 0xd4(%rsp)
setns %al
movb (%rbx), %cl
shrb $0x3, %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x65c1
movq (%r9), %rax
movl 0xcc(%rsp), %ecx
cmpl 0x18(%rax), %ecx
jl 0x670c
cmpl $0x0, 0xd0(%rsp)
js 0x65de
movq (%r9), %rax
movl 0xc8(%rsp), %ecx
cmpl 0x18(%rax), %ecx
jl 0x670c
movl %r8d, %r12d
movq (%r9), %rax
movb 0x8(%rax), %cl
movq $-0x1, %rdx
shlq %cl, %rdx
notq %rdx
movl %r14d, %esi
andl $0x1, %esi
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdi
leaq (%rsi,%rax,2), %rax
andq %rdx, %rax
movq %rax, 0x40(%rsp)
movl %r14d, %eax
shrl %eax
leaq (%rax,%rdi,2), %rdi
andq %rdx, %rdi
movq %rdi, 0x48(%rsp)
movq 0x50(%rsp), %rdx
shrq %rdx
xorq $0x1, %rsi
decb %cl
shlq %cl, %rsi
orq %rdx, %rsi
movq %rsi, 0x50(%rsp)
movq 0x58(%rsp), %rdx
xorq $0x1, %rax
shlq %cl, %rax
shrq %rdx
orq %rdx, %rax
movq %rax, 0x58(%rsp)
movq 0x8(%r9), %rdi
leaq 0x40(%rsp), %rsi
movq %r9, %r13
callq 0x1461d
testl %eax, %eax
js 0x668b
movzbl %al, %ecx
movq (%r13), %rdx
movl 0x10(%rdx), %edx
cmpl %edx, %ecx
movq %r13, %r9
movl %r12d, %r8d
jl 0x6708
testq %rbx, %rbx
je 0x66cb
testb $0x4, (%rbx)
sete %cl
jmp 0x66cd
movq %r13, %r9
movl %r12d, %r8d
jmp 0x6708
movb $0x4, %al
testl %r15d, %r15d
js 0x66af
movq (%r9), %rcx
movl 0xc0(%rsp), %edi
cmpl 0x10(%rcx), %edi
setl %cl
shlb $0x3, %cl
jmp 0x66b1
movb $0x8, %cl
addb %cl, %al
addb %bpl, %al
movslq %r8d, %rcx
movl %r15d, 0xe0(%rsp,%rcx,4)
leal 0x1(%rcx), %r8d
movb %al, 0x1c(%rsp,%rcx)
jmp 0x670c
xorl %ecx, %ecx
testb %cl, %cl
je 0x66de
movb (%rbx), %sil
shrb $0x6, %sil
andb $0x2, %sil
jmp 0x66e0
xorl %esi, %esi
movzbl %ah, %edi
cmpl %edx, %edi
setl %dl
shlb $0x3, %dl
orb %sil, %dl
addb %bpl, %cl
addb %dl, %cl
movslq %r8d, %rdx
movl %eax, 0xe0(%rsp,%rdx,4)
incl %r8d
movb %cl, 0x1c(%rsp,%rdx)
incl 0x3c(%rsp)
movb 0x30(%rsp), %dl
incl %r14d
addb $0x10, %bpl
cmpl $0x4, %r14d
jne 0x6531
xorl %eax, %eax
movl 0x3c(%rsp), %ecx
orl %ecx, 0xbc(%rsp)
sete %al
movl 0x38(%rsp), %ecx
addl %eax, %ecx
movl %ecx, 0x38(%rsp)
movslq %ecx, %r13
movq 0xd8(%rsp), %rbp
movq (%rbp), %r12
addq %r12, %r12
cmpq %r13, %r12
jae 0x6762
xorl %eax, %eax
movl $0x13, %ebx
movl $0xfffffffd, 0xc(%rsp)  # imm = 0xFFFFFFFD
jmp 0x68c4
testq %rbx, %rbx
setne %al
cmpl $0x1, %r8d
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x6840
cmpl $0x2, %r8d
jl 0x6874
movq (%r9), %rsi
movslq 0x34(%rsi), %rax
cmpq %rax, 0x10(%r9)
jbe 0x6874
movl 0x20(%rsi), %eax
movl 0x24(%rsi), %ecx
movl 0x28(%rsi), %edx
movl 0x2c(%rsi), %esi
movl %r8d, %edi
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
xorl %r10d, %r10d
movzbl 0x1c(%rsp,%r10), %r11d
movl %r11d, %ebx
andl $0x1, %ebx
imull %eax, %ebx
movl %r11d, %ebp
shrl %ebp
andl $0x1, %ebp
imull %ecx, %ebp
addl %ebx, %ebp
movl %r11d, %ebx
shrl $0x2, %ebx
andl $0x1, %ebx
imull %edx, %ebx
shrl $0x3, %r11d
andl $0x1, %r11d
imull %esi, %r11d
addl %ebx, %r11d
addl %ebp, %r11d
cmpl %r11d, %r9d
cmovgl %r10d, %r8d
cmovgel %r11d, %r9d
incq %r10
cmpq %r10, %rdi
jne 0x67b3
movslq %r8d, %rax
movl 0xe0(%rsp,%rax,4), %ecx
movzbl 0x1c(%rsp,%rax), %edx
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0x60(%rsp), %r14
movq %r14, %rsi
callq 0x7336
movq %r14, %rdi
movq %rbx, %r9
xorl %ebx, %ebx
xorl %eax, %eax
movq 0x28(%rsp), %r15
movq 0xd8(%rsp), %rbp
jmp 0x68ce
movl $0x1, %eax
xorl %ebx, %ebx
testl %r8d, %r8d
jne 0x68c4
movl 0x14(%rsp), %ecx
subl 0xf8(%rsp), %ecx
movq (%r9), %rdx
addl 0x14(%rdx), %ecx
movq 0x38(%r9), %rsi
imull 0x28(%rdx), %ecx
movslq 0x68(%rsp), %rdx
shlq $0x4, %rdx
addl %ecx, 0x8(%rsi,%rdx)
jmp 0x68c4
xorl %ebx, %ebx
testl %r8d, %r8d
jle 0x68c2
movq %r13, 0x30(%rsp)
movl %r8d, %r15d
xorl %r13d, %r13d
leaq 0x60(%rsp), %r14
movl 0xe0(%rsp,%r13,4), %ecx
movzbl 0x1c(%rsp,%r13), %edx
movq %r9, %rdi
movq %r14, %rsi
callq 0x7336
movq 0x20(%rsp), %r9
incq %r13
cmpq %r13, %r15
jne 0x688b
xorl %eax, %eax
movq 0x28(%rsp), %r15
movq %r14, %rdi
movq 0x30(%rsp), %r13
jmp 0x68ce
xorl %eax, %eax
movq 0x28(%rsp), %r15
leaq 0x60(%rsp), %rdi
cmpq %r13, %r12
movq 0x108(%rsp), %r12
movq 0x100(%rsp), %r14
jb 0x6946
testl %eax, %eax
je 0x6944
movq 0x38(%r9), %rax
movslq 0x68(%rsp), %rcx
movq %rcx, %rdx
shlq $0x4, %rdx
movl 0x8(%rax,%rdx), %eax
movl 0x10(%rsp), %edx
cmpl %edx, %eax
movl 0x18(%rsp), %esi
movq 0xb0(%rsp), %r8
cmovll %r8d, %esi
movl %esi, 0x18(%rsp)
cmovll %eax, %edx
movl %edx, 0x10(%rsp)
movslq %r8d, %rax
incl %r8d
movl %ecx, 0x110(%rsp,%rax,4)
movq %r8, 0xb0(%rsp)
cmpl $0x4, %r8d
movl $0x0, %ebx
movl $0x13, %eax
cmovel %eax, %ebx
jmp 0x6946
xorl %ebx, %ebx
testl %ebx, %ebx
je 0x62c1
movq 0xb0(%rsp), %rcx
testl %ecx, %ecx
je 0x6adb
movl 0x18(%rsp), %eax
testl %eax, %eax
js 0x6b10
cmpl %ecx, %eax
jge 0x6b10
movq 0x38(%r9), %rbx
movl %eax, %eax
movslq 0x110(%rsp,%rax,4), %r14
movq %r14, %rax
shlq $0x4, %rax
movl 0x10(%rsp), %ecx
cmpl %ecx, 0x8(%rbx,%rax)
jne 0x6b10
movq (%rbp), %rax
cmpq %rax, 0x8(%r15)
jae 0x69f5
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 0x21d0
movq 0x20(%rsp), %r9
movq %rax, 0x10(%r15)
movq (%rbp), %rax
movq %rax, (%r15)
testl %r14d, %r14d
js 0x6a97
movl $0x0, 0xc(%rsp)
movl %r14d, %ecx
shlq $0x4, %rcx
leaq (%rbx,%rcx), %rax
movslq 0x4(%rbx,%rcx), %rcx
cmpq %rcx, (%rbp)
jbe 0x6a89
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, 0xc(%rsp)
movl (%rax), %r14d
testl %r14d, %r14d
jns 0x6a0d
jmp 0x6a9f
movl $0x0, 0xc(%rsp)
cmpq $0x0, (%r15)
je 0x6adb
xorl %eax, %eax
movq 0xf0(%rsp), %rsi
cmpq %r12, %rax
jge 0x6ac3
movq (%r9), %rcx
movslq 0x8(%rcx), %rcx
addq %rsi, %rcx
cmpq %rcx, %rax
jge 0x6ad3
movq 0x10(%r15), %rcx
movb (%rcx,%rax,8), %dl
andb $-0x8, %dl
orb $0x4, %dl
movb %dl, (%rcx,%rax,8)
incq %rax
cmpq %rax, (%r15)
ja 0x6aaf
movl 0xc(%rsp), %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x109bd(%rip), %rdi     # 0x174b5
leaq 0x109e0(%rip), %rsi     # 0x174df
leaq 0x109df(%rip), %rcx     # 0x174e5
movl $0x182, %edx            # imm = 0x182
callq 0x20e0
leaq 0x10a24(%rip), %rdi     # 0x1753b
leaq 0x109c1(%rip), %rsi     # 0x174df
leaq 0x109c0(%rip), %rcx     # 0x174e5
movl $0x1f0, %edx            # imm = 0x1F0
callq 0x20e0