// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl $0xffffffff, -0x84(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xa4(%rbp)
movl $0xffffffff, -0xa8(%rbp) # imm = 0xFFFFFFFF
movl $0x7fffffff, -0xac(%rbp) # imm = 0x7FFFFFFF
movl $0x0, -0xb0(%rbp)
movslq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
ja 0x78a5
movl -0x28(%rbp), %eax
subl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x8(%rcx), %eax
jl 0x78a5
jmp 0x78c4
leaq 0x1db6d(%rip), %rdi     # 0x25419
leaq 0x1db90(%rip), %rsi     # 0x25443
movl $0x182, %edx            # imm = 0x182
leaq 0x1db8a(%rip), %rcx     # 0x25449
callq 0x20f0
movq -0x10(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x2110
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x79d5
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
shrq %rcx
movq -0x20(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x2, %rcx
movq -0x20(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x4, %rcx
movq -0x20(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x8, %rcx
movq -0x20(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x10, %rcx
movq -0x20(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x21e0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x79d7
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl -0x24(%rbp), %eax
movl %eax, -0x74(%rbp)
movl $0x0, -0x80(%rbp)
movl -0x74(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x7a9a
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x74(%rbp), %rcx
movb (%rax,%rcx,8), %al
andb $0x7, %al
movzbl %al, %eax
movl %eax, -0xb4(%rbp)
cmpl $0x4, -0xb4(%rbp)
jge 0x7a57
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x8(%rcx), %eax
jne 0x7a38
jmp 0x7a9a
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %edi
leaq -0x78(%rbp), %rsi
addq $0x28, %rsi
movl -0xb4(%rbp), %edx
callq 0x5550
jmp 0x7a8a
movl $0x0, -0x80(%rbp)
movq 0x2285b(%rip), %rax     # 0x2a2c0
movq %rax, -0x50(%rbp)
movq 0x22858(%rip), %rax     # 0x2a2c8
movq %rax, -0x48(%rbp)
movq 0x22855(%rip), %rax     # 0x2a2d0
movq %rax, -0x40(%rbp)
movq 0x22852(%rip), %rax     # 0x2a2d8
movq %rax, -0x38(%rbp)
jmp 0x7a8c
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x79f2
movl -0x74(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x7aa4
jmp 0x7ac3
leaq 0x1d9ea(%rip), %rdi     # 0x25495
leaq 0x1d991(%rip), %rsi     # 0x25443
movl $0x18f, %edx            # imm = 0x18F
leaq 0x1d98b(%rip), %rcx     # 0x25449
callq 0x20f0
movl $0xffffffff, -0x70(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x7c(%rbp)
cmpl $0x5, -0x7c(%rbp)
jge 0x7aee
movslq -0x7c(%rbp), %rax
movl $0xffffffff, -0x64(%rbp,%rax,4) # imm = 0xFFFFFFFF
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x7ad1
movl $0x0, -0x7c(%rbp)
cmpl $0x2, -0x7c(%rbp)
jge 0x7b12
movslq -0x7c(%rbp), %rax
movl $0xffffffff, -0x6c(%rbp,%rax,4) # imm = 0xFFFFFFFF
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x7af5
jmp 0x7b14
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jne 0x7b83
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x7b45
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shlq %rax
movq %rax, -0x158(%rbp)
jmp 0x7b53
movl $0x2, %eax
movq %rax, -0x158(%rbp)
jmp 0x7b53
movq -0x158(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rax
imulq $0x48, 0x18(%rax), %rsi
callq 0x21e0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x10(%rcx)
imulq $0x48, %rax, %rax
addq %rax, %rdi
leaq -0x78(%rbp), %rsi
movl $0x48, %edx
callq 0x2190
movl $0x0, -0x7c(%rbp)
movslq -0x7c(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x7c3a
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x7c(%rbp), %rcx
movb (%rax,%rcx,8), %sil
andb $0x7, %sil
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x7c(%rbp), %rcx
movb (%rax,%rcx,8), %dl
andb $0x7, %sil
andb $-0x8, %dl
orb %sil, %dl
movb %dl, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x7c(%rbp), %rcx
movb (%rax,%rcx,8), %sil
shrb $0x4, %sil
andb $0x7, %sil
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x7c(%rbp), %rcx
movb (%rax,%rcx,8), %dl
andb $0x7, %sil
shlb $0x4, %sil
andb $-0x71, %dl
orb %sil, %dl
movb %dl, (%rax,%rcx,8)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x7bba
jmp 0x7c3c
movl $0x0, -0xb8(%rbp)
movq -0x30(%rbp), %rax
cmpl $0xff, (%rax)
jle 0x7c60
movl $0xff, %eax
movq %rax, -0x160(%rbp)
jmp 0x7c9e
movq -0x30(%rbp), %rax
movslq (%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x7c81
movq -0x30(%rbp), %rax
movslq (%rax), %rax
movq %rax, -0x168(%rbp)
jmp 0x7c90
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x7cc7
movl $0xfffffffe, -0x84(%rbp) # imm = 0xFFFFFFFE
jmp 0x862e
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
leaq -0x78(%rbp), %rdi
movl $0x48, %edx
callq 0x2190
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rax
addq $-0x1, %rax
movq %rax, 0x10(%rcx)
imulq $0x48, %rax, %rax
addq %rax, %rsi
movl $0x48, %edx
callq 0x2190
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x5e00
cmpl $0x0, -0xa8(%rbp)
jl 0x7d4c
movl -0x78(%rbp), %eax
movl -0xac(%rbp), %ecx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
addl 0x30(%rdx), %ecx
cmpl %ecx, %eax
jle 0x7d4c
jmp 0x862e
movl -0x74(%rbp), %eax
subl -0x28(%rbp), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x14(%rcx), %eax
jle 0x7d68
movl $0x1, -0xb8(%rbp)
cmpl $0x0, -0xb8(%rbp)
jne 0x85b0
movslq -0x74(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x7d9e
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x74(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x170(%rbp)
jmp 0x7da9
xorl %eax, %eax
movq %rax, -0x170(%rbp)
jmp 0x7da9
movq -0x170(%rbp), %rax
movq %rax, -0xc0(%rbp)
movl $0xffffffff, -0xc8(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xcc(%rbp)
movl $0x0, -0xd0(%rbp)
movl $0x0, -0xd4(%rbp)
movl -0x74(%rbp), %eax
cmpl -0x28(%rbp), %eax
jle 0x7df1
movl $0x1, -0xcc(%rbp)
cmpq $0x0, -0xc0(%rbp)
je 0x7f27
movq -0xc0(%rbp), %rax
movb (%rax), %al
andb $0x7, %al
movzbl %al, %eax
cmpl $0x4, %eax
jge 0x7f27
movq -0x50(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %edi
leaq -0x118(%rbp), %rsi
movq -0xc0(%rbp), %rax
movb (%rax), %al
andb $0x7, %al
movzbl %al, %edx
callq 0x5550
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x118(%rbp), %rsi
callq 0x21b20
movl %eax, -0xc8(%rbp)
movq -0xc0(%rbp), %rax
movb (%rax), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x7ee1
movl -0xc8(%rbp), %eax
andl $0xff, %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movl 0x10(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jl 0x7ee1
movq -0xc0(%rbp), %rax
movw 0x2(%rax), %ax
andw $0x3f, %ax
movzwl %ax, %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movl 0x10(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jl 0x7ee1
movl $0x1, -0xcc(%rbp)
jmp 0x7f25
movq -0xc0(%rbp), %rax
movw 0x2(%rax), %ax
shrw $0x6, %ax
andw $0x3f, %ax
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
movq -0x10(%rbp), %rax
movq (%rax), %rax
cvtsi2sdl 0x8(%rax), %xmm1
movsd 0x1d4f9(%rip), %xmm2    # 0x25408
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x7f23
movl $0x1, -0xcc(%rbp)
jmp 0x7f25
jmp 0x7f27
movl $0x0, -0xc4(%rbp)
cmpl $0x4, -0xc4(%rbp)
jge 0x8356
cmpl $0x0, -0xcc(%rbp)
je 0x7f6f
cmpq $0x0, -0xc0(%rbp)
je 0x7f6f
movl -0xc4(%rbp), %eax
movq -0xc0(%rbp), %rcx
movb (%rcx), %cl
andb $0x7, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x7f6f
jmp 0x8342
cmpq $0x0, -0xc0(%rbp)
je 0x7f96
movl -0xc4(%rbp), %eax
movq -0xc0(%rbp), %rcx
movb (%rcx), %cl
andb $0x7, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x8227
movq -0x50(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x128(%rbp)
movb -0x119(%rbp), %al
andb $-0x2, %al
orb $0x0, %al
movb %al, -0x119(%rbp)
movb -0x119(%rbp), %al
andb $-0x3, %al
orb $0x0, %al
movb %al, -0x119(%rbp)
movb -0x119(%rbp), %al
andb $-0x5, %al
orb $0x0, %al
movb %al, -0x119(%rbp)
movb -0x119(%rbp), %al
andb $-0x9, %al
orb $0x0, %al
movb %al, -0x119(%rbp)
movl -0xc4(%rbp), %eax
movb %al, %cl
movb -0x119(%rbp), %al
andb $0xf, %cl
shlb $0x4, %cl
andb $0xf, %al
orb %cl, %al
movb %al, -0x119(%rbp)
cmpq $0x0, -0xc0(%rbp)
je 0x807c
movq -0xc0(%rbp), %rax
movb (%rax), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x805d
cmpl $0x0, -0x68(%rbp)
jl 0x805d
movl -0x74(%rbp), %eax
subl -0x68(%rbp), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x18(%rcx), %eax
jge 0x805d
jmp 0x8342
cmpl $0x0, -0x54(%rbp)
jl 0x807a
movl -0x74(%rbp), %eax
subl -0x54(%rbp), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x18(%rcx), %eax
jge 0x807a
jmp 0x8342
jmp 0x807c
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %edi
leaq -0x140(%rbp), %rsi
movl -0xc4(%rbp), %edx
callq 0x5550
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x140(%rbp), %rsi
callq 0x21b20
movl %eax, -0x120(%rbp)
cmpl $0x0, -0x120(%rbp)
jl 0x80d2
movl -0x120(%rbp), %eax
andl $0xff, %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x80d7
jmp 0x8342
xorl %eax, %eax
cmpq $0x0, -0xc0(%rbp)
movb %al, -0x171(%rbp)
je 0x8103
movq -0xc0(%rbp), %rax
movb (%rax), %al
andb $0x7, %al
movzbl %al, %eax
cmpl $0x4, %eax
setl %al
movb %al, -0x171(%rbp)
movb -0x171(%rbp), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movb %al, %cl
movb -0x119(%rbp), %al
andb $0x1, %cl
andb $-0x2, %al
orb %cl, %al
movb %al, -0x119(%rbp)
movb -0x119(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x8152
movq -0xc0(%rbp), %rax
movb (%rax), %al
shrb $0x7, %al
movzbl %al, %eax
movl %eax, -0x178(%rbp)
jmp 0x815c
xorl %eax, %eax
movl %eax, -0x178(%rbp)
jmp 0x815c
movl -0x178(%rbp), %eax
movb %al, %cl
movb -0x119(%rbp), %al
andb $0x1, %cl
shlb %cl
andb $-0x3, %al
orb %cl, %al
movb %al, -0x119(%rbp)
movb -0x119(%rbp), %al
andb $-0x5, %al
orb $0x0, %al
movb %al, -0x119(%rbp)
movl -0x120(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
movb %al, %cl
movb -0x119(%rbp), %al
andb $0x1, %cl
shlb $0x3, %cl
andb $-0x9, %al
orb %cl, %al
movb %al, -0x119(%rbp)
movl -0xc4(%rbp), %eax
movb %al, %cl
movb -0x119(%rbp), %al
andb $0xf, %cl
shlb $0x4, %cl
andb $0xf, %al
orb %cl, %al
movb %al, -0x119(%rbp)
movl -0x120(%rbp), %ecx
movslq -0xd4(%rbp), %rax
movl %ecx, -0xf0(%rbp,%rax,4)
movl -0xd4(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xd4(%rbp)
cltq
movb -0x119(%rbp), %cl
movb %cl, -0xf4(%rbp,%rax)
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x8340
movb -0x119(%rbp), %al
andb $-0x3, %al
orb $0x0, %al
movb %al, -0x119(%rbp)
movb -0x119(%rbp), %al
andb $-0x2, %al
orb $0x0, %al
movb %al, -0x119(%rbp)
movb $0x1, %al
cmpl $0x0, -0xc8(%rbp)
movb %al, -0x179(%rbp)
jl 0x8276
movl -0xc8(%rbp), %eax
andl $0xff, %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
setl %al
movb %al, -0x179(%rbp)
movb -0x179(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb %al, %cl
movb -0x119(%rbp), %al
andb $0x1, %cl
shlb $0x2, %cl
andb $-0x5, %al
orb %cl, %al
movb %al, -0x119(%rbp)
movb $0x1, %al
cmpl $0x0, -0xc8(%rbp)
movb %al, -0x17a(%rbp)
jl 0x82cb
movl -0xc8(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
setl %al
movb %al, -0x17a(%rbp)
movb -0x17a(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb %al, %cl
movb -0x119(%rbp), %al
andb $0x1, %cl
shlb $0x3, %cl
andb $-0x9, %al
orb %cl, %al
movb %al, -0x119(%rbp)
movl -0xc4(%rbp), %eax
movb %al, %cl
movb -0x119(%rbp), %al
andb $0xf, %cl
shlb $0x4, %cl
andb $0xf, %al
orb %cl, %al
movb %al, -0x119(%rbp)
movl -0xc8(%rbp), %ecx
movslq -0xd4(%rbp), %rax
movl %ecx, -0xf0(%rbp,%rax,4)
movl -0xd4(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xd4(%rbp)
cltq
movb -0x119(%rbp), %cl
movb %cl, -0xf4(%rbp,%rax)
jmp 0x8342
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x7f31
cmpl $0x0, -0xcc(%rbp)
jne 0x8377
cmpl $0x0, -0xd0(%rbp)
jne 0x8377
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb0(%rbp)
movslq -0xb0(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
shlq %rcx
cmpq %rcx, %rax
jbe 0x839c
movl $0xfffffffd, -0x84(%rbp) # imm = 0xFFFFFFFD
jmp 0x862e
cmpq $0x0, -0xc0(%rbp)
jne 0x83b3
cmpl $0x1, -0xd4(%rbp)
jne 0x8563
cmpl $0x1, -0xd4(%rbp)
jle 0x850c
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movslq 0x34(%rcx), %rcx
cmpq %rcx, %rax
jbe 0x850c
movl $0xffffffff, -0x144(%rbp) # imm = 0xFFFFFFFF
movl $0x7fffffff, -0x148(%rbp) # imm = 0x7FFFFFFF
movl $0x0, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
cmpl -0xd4(%rbp), %eax
jge 0x84e0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x20(%rax), %eax
movslq -0xc4(%rbp), %rcx
movb -0xf4(%rbp,%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
imull %ecx, %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movl 0x24(%rcx), %ecx
movslq -0xc4(%rbp), %rdx
movb -0xf4(%rbp,%rdx), %dl
shrb %dl
andb $0x1, %dl
movzbl %dl, %edx
imull %edx, %ecx
addl %ecx, %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movl 0x28(%rcx), %ecx
movslq -0xc4(%rbp), %rdx
movb -0xf4(%rbp,%rdx), %dl
shrb $0x2, %dl
andb $0x1, %dl
movzbl %dl, %edx
imull %edx, %ecx
addl %ecx, %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movl 0x2c(%rcx), %ecx
movslq -0xc4(%rbp), %rdx
movb -0xf4(%rbp,%rdx), %dl
shrb $0x3, %dl
andb $0x1, %dl
movzbl %dl, %edx
imull %edx, %ecx
addl %ecx, %eax
movl %eax, -0x14c(%rbp)
movl -0x148(%rbp), %eax
cmpl -0x14c(%rbp), %eax
jle 0x84ca
movl -0x14c(%rbp), %eax
movl %eax, -0x148(%rbp)
movl -0xc4(%rbp), %eax
movl %eax, -0x144(%rbp)
jmp 0x84cc
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x83fa
movq -0x10(%rbp), %rdi
movslq -0x144(%rbp), %rax
movslq -0x144(%rbp), %rcx
movl -0xf0(%rbp,%rcx,4), %ecx
leaq -0x78(%rbp), %rsi
movzbl -0xf4(%rbp,%rax), %edx
callq 0x93f0
jmp 0x8561
movl $0x0, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
cmpl -0xd4(%rbp), %eax
jge 0x855f
movq -0x10(%rbp), %rdi
movslq -0xc4(%rbp), %rax
movslq -0xc4(%rbp), %rcx
movl -0xf0(%rbp,%rcx,4), %ecx
leaq -0x78(%rbp), %rsi
movzbl -0xf4(%rbp,%rax), %edx
callq 0x93f0
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x8516
jmp 0x8561
jmp 0x85ae
cmpl $0x0, -0xd4(%rbp)
jne 0x85a4
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x28(%rax), %ecx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x14(%rax), %eax
movl -0x74(%rbp), %edx
subl -0x28(%rbp), %edx
subl %edx, %eax
imull %eax, %ecx
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x70(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
movl $0x1, -0xb8(%rbp)
jmp 0x85b0
cmpl $0x0, -0xb8(%rbp)
je 0x8629
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x70(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0xac(%rbp), %eax
jge 0x85ff
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x70(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0xac(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0xa8(%rbp)
movl -0x70(%rbp), %ecx
movl -0xa4(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0xa4(%rbp)
cltq
movl %ecx, -0xa0(%rbp,%rax,4)
cmpl $0x4, -0xa4(%rbp)
jne 0x8627
jmp 0x862e
jmp 0x8629
jmp 0x7c3c
cmpl $0x0, -0xa4(%rbp)
jne 0x8645
movl -0x84(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x872d
cmpl $0x0, -0xa8(%rbp)
jl 0x8687
movl -0xa8(%rbp), %eax
cmpl -0xa4(%rbp), %eax
jge 0x8687
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0xa8(%rbp), %rcx
movslq -0xa0(%rbp,%rcx,4), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0xac(%rbp), %eax
jne 0x8687
jmp 0x86a6
leaq 0x1ce11(%rip), %rdi     # 0x2549f
leaq 0x1cdae(%rip), %rsi     # 0x25443
movl $0x1f0, %edx            # imm = 0x1F0
leaq 0x1cda8(%rip), %rcx     # 0x25449
callq 0x20f0
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movslq -0xa8(%rbp), %rax
movl -0xa0(%rbp,%rax,4), %esi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x9720
movl %eax, -0x84(%rbp)
movl $0x0, -0x7c(%rbp)
movslq -0x7c(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x8724
movl -0x7c(%rbp), %eax
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
addl 0x8(%rdx), %ecx
cmpl %ecx, %eax
jl 0x86ff
movl -0x7c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jl 0x8717
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x7c(%rbp), %rcx
movb (%rax,%rcx,8), %dl
andb $-0x8, %dl
orb $0x4, %dl
movb %dl, (%rax,%rcx,8)
jmp 0x8719
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x86d6
movl -0x84(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopl (%rax)