// File: chhylp123[P]hifiasm/anchor.cpp
// Function: lchain_qgen_mcopy(Candidates_list*, overlap_region_alloc*, unsigned int, unsigned long, All_reads*, ul_idx_t const*, unsigned int, unsigned long, long, long, long, double, double, double, long, unsigned int, double, unsigned int, unsigned int, st_mt_t*)
void lchain_qgen_mcopy(Candidates_list* cl, overlap_region_alloc* ol, uint32_t rid, uint64_t rl, All_reads* rdb, 
				const ul_idx_t *udb, uint32_t apend_be, uint64_t max_n_chain, int64_t max_skip, int64_t max_iter, 
				int64_t max_dis, double chn_pen_gap, double chn_pen_skip, double bw_rate, int64_t quick_check, 
				uint32_t gen_off, double mcopy_rate, uint32_t chain_cutoff, uint32_t mcopy_khit_cut, st_mt_t *sp)
{
	// fprintf(stderr, "+[M::%s]\n", __func__);
	uint64_t i, k, l, m, cn = cl->length, yid, ol0, lch; overlap_region *r, t; ///srt = 0
	clear_overlap_region_alloc(ol);

	for (l = 0, k = 1, m = 0, lch = 0; k <= cn; k++) {
		if((k == cn) || (cl->list[k].readID != cl->list[l].readID)) {
			if(cl->list[l].readID != rid) {
				yid = cl->list[l].readID; ol0 = ol->length;
				m += lchain_qdp_mcopy(cl, l, k-l, m, &(cl->chainDP), ol, max_skip, max_iter, max_dis, chn_pen_gap, chn_pen_skip, bw_rate, 
				rid, rl, rdb?Get_READ_LENGTH((*rdb), yid):udb->ug->u.a[yid].len, quick_check, apend_be, gen_off, 1, mcopy_rate, mcopy_khit_cut, 1);
				if((chain_cutoff >= 2) && (!lch)) {
					for (i = ol0; (i<ol->length) && (!lch); i++) {
						if(ol->list[i].align_length < chain_cutoff) lch = 1;
					}
				}
			}
			l = k;
		}
	}
	cl->length = m;

	// for (k = 0; k < ol->length; k++) {
	// 	fprintf(stderr, "---[M::%s::utg%.6dl] q[%d, %d), t[%d, %d), khit_off::%u\n", __func__, 
    //     (int32_t)ol->list[k].y_id+1, ol->list[k].x_pos_s, ol->list[k].x_pos_e+1,
	// 	ol->list[k].y_pos_s, ol->list[k].y_pos_e+1, ol->list[k].non_homopolymer_errors);
	// }

	k = ol->length;
	if (ol->length > max_n_chain) {
		int32_t w, n[4], s[4]; 
		n[0] = n[1] = n[2] = n[3] = 0, s[0] = s[1] = s[2] = s[3] = 0; 
		ks_introsort_or_ss(ol->length, ol->list); 
		for (i = 0; i < ol->length; ++i) {
			r = &(ol->list[i]);
			w = ha_ov_type(r, rl);
			++n[w];
			if (((uint64_t)n[w]) == max_n_chain) s[w] = r->shared_seed;
		}
		if (s[0] > 0 || s[1] > 0 || s[2] > 0 || s[3] > 0) {
			// n[0] = n[1] = n[2] = n[3] = 0;
			for (i = 0, k = 0, lch = 0; i < ol->length; ++i) {
				r = &(ol->list[i]);
				w = ha_ov_type(r, rl);
				// ++n[w];
				// if (((int)n[w] <= max_n_chain) || (r->shared_seed >= s[w] && s[w] >= (asm_opt.k_mer_length<<1))) {
				if (r->shared_seed >= s[w]) {
					if (k != i) {
						t = ol->list[k];
						ol->list[k] = ol->list[i];
						ol->list[i] = t;
					}
					if(ol->list[k].align_length < chain_cutoff) lch = 1;
					++k;
				}
			}
			ol->length = k;
		}
	} 
	
	ks_introsort_or_xs(ol->length, ol->list);
	if(lch) {
		//@brief r485
		uint64_t zs, ze, rs, re, ob, os, oe, ocn, pp, kn, ms, me; int64_t osc;
		for (i = l = 0, cn = cl->length; i < ol->length; ++i) {
			if(ol->list[i].align_length < chain_cutoff) {
				zs = ol->list[i].x_pos_s; ze = ol->list[i].x_pos_e + 1;
				ob = (ze - zs)*OFL; if(ob < 16) ob = 16;
				osc = ol->list[i].shared_seed*CH_SC;
				ocn = ol->list[i].align_length<<CH_OCC;
				for (k = 0; (k < ol->length) && (ze > ol->list[k].x_pos_s); k++) {
					if(ol->list[k].align_length < chain_cutoff) continue;
					if(ol->list[k].align_length < ocn) continue;
					if(ol->list[k].shared_seed < osc) continue;
					rs = ol->list[k].x_pos_s; re = ol->list[k].x_pos_e + 1;
					os = ((rs>=zs)?rs:zs); oe = ((re<=ze)?re:ze);
					if((oe > os) && (oe - os) >= ob) {
						m = ol->list[k].non_homopolymer_errors;
						pp = cl->list[m].readID; kn = 0;
						for (; (m < cn) && (cl->list[m].readID == pp) && (kn < ocn); m++) {
							me = cl->list[m].self_offset; ms = me - (cl->list[m].cnt&(0xffu)); 
							if((ms >= os) && (me <= oe)) kn++;
						}
						if(kn >= ocn) break;
					}
				}
				if((k < ol->length) && (ze > ol->list[k].x_pos_s)) continue;
			}
			if (l != i) {
				t = ol->list[l];
				ol->list[l] = ol->list[i];
				ol->list[i] = t;
			}
			l++;
		}
		// fprintf(stderr, "+[M::%s] rid::%u, ol->length0::%lu, ol->length1::%lu\n", __func__, rid, ol->length, l);
		ol->length = l;


		/**
		//@brief r484
		for (i = sp->n = 0; i < ol->length; ++i) {
			if(ol->list[i].align_length < chain_cutoff) continue;
			os = ol->list[i].x_pos_s; oe = ol->list[i].x_pos_e + 1;
			if((sp->n) && (((uint32_t)sp->a[sp->n-1]) >= os)) {
				if(oe > ((uint32_t)sp->a[sp->n-1])) {
					oe = oe - ((uint32_t)sp->a[sp->n-1]);
					sp->a[sp->n-1] += oe; 
				}
			} else {
				os = (os<<32)|oe; kv_push(uint64_t, *sp, os);
			}
		}

		for (i = k = 0; i < ol->length; ++i) {
			if(ol->list[i].align_length < chain_cutoff) {///ol has been sorted by x_pos_s
				r = &(ol->list[i]); rs = r->x_pos_s; re = r->x_pos_e + 1;
				rl = re - rs; ovl = 0;
				for (m = 0; (m < sp->n) && (re > (sp->a[m]>>32)); m++) {
					os = ((rs>=(sp->a[m]>>32))? rs:(sp->a[m]>>32));
            		oe = ((re<=((uint32_t)sp->a[m]))? re:((uint32_t)sp->a[m]));
					if(oe > os) {
						ovl += (oe - os); if(ovl >= (rl*0.95)) break;
					}
				}
				if(ovl >= (rl*0.95)) continue;
			}
			if (k != i) {
				t = ol->list[k];
				ol->list[k] = ol->list[i];
				ol->list[i] = t;
			}
			ol->list[k++].align_length = 0;
		}
		// fprintf(stderr, "+[M::%s] ol->length0::%lu, ol->length1::%lu\n", __func__, ol->length, k);
		ol->length = k;
		**/
	} 
	/**else {
		for (i = 0; i < ol->length; ++i) ol->list[i].align_length = 0;
	}
	**/
	for (i = 0; i < ol->length; ++i) ol->list[i].align_length = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
movq 0x58(%rbp), %rax
movl 0x50(%rbp), %eax
movl 0x48(%rbp), %eax
movl 0x40(%rbp), %eax
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
movq %rcx, -0x48(%rbp)
movq %r8, -0x50(%rbp)
movq %r9, -0x58(%rbp)
movsd %xmm0, -0x60(%rbp)
movsd %xmm1, -0x68(%rbp)
movsd %xmm2, -0x70(%rbp)
movsd %xmm3, -0x78(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x38(%rbp), %rdi
callq 0x1e120
movq $0x0, -0x90(%rbp)
movq $0x1, -0x88(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0xb8(%rbp)
movq -0x88(%rbp), %rax
cmpq -0xa0(%rbp), %rax
ja 0x1aa28c
movq -0x88(%rbp), %rax
cmpq -0xa0(%rbp), %rax
je 0x1a9fac
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x88(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
movq -0x90(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
je 0x1aa273
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x90(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl -0x3c(%rbp), %eax
je 0x1aa265
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x90(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0xa8(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x268(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0x88(%rbp), %rax
subq -0x90(%rbp), %rax
movq %rax, -0x258(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x250(%rbp)
movq -0x30(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x248(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x240(%rbp)
movq 0x20(%rbp), %rax
movq %rax, -0x238(%rbp)
movq 0x28(%rbp), %rax
movq %rax, -0x230(%rbp)
movq 0x30(%rbp), %rax
movq %rax, -0x228(%rbp)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x220(%rbp)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x218(%rbp)
movsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x210(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x204(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x200(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x1aa0da
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq -0xa8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x270(%rbp)
jmp 0x1aa100
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0xa8(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0x270(%rbp)
movl -0x204(%rbp), %r12d
movsd -0x210(%rbp), %xmm2
movsd -0x218(%rbp), %xmm1
movsd -0x220(%rbp), %xmm0
movq -0x228(%rbp), %r13
movq -0x238(%rbp), %r15
movq -0x240(%rbp), %r9
movq -0x248(%rbp), %r8
movq -0x250(%rbp), %rcx
movq -0x258(%rbp), %rdx
movq -0x260(%rbp), %rsi
movq -0x268(%rbp), %rdi
movq -0x270(%rbp), %r14
movq 0x38(%rbp), %rbx
movl 0x10(%rbp), %r11d
movl 0x40(%rbp), %eax
movl %eax, %r10d
movsd -0x78(%rbp), %xmm3
movl 0x50(%rbp), %eax
movq %r15, (%rsp)
movq -0x230(%rbp), %r15
movq %r15, 0x8(%rsp)
movq -0x200(%rbp), %r15
movq %r13, 0x10(%rsp)
movl %r12d, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
movl %r11d, 0x38(%rsp)
movq %r10, 0x40(%rsp)
movq $0x1, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq $0x1, 0x58(%rsp)
callq 0x25550
addq -0x98(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpl $0x2, 0x48(%rbp)
jb 0x1aa263
cmpq $0x0, -0xb8(%rbp)
jne 0x1aa263
movq -0xb0(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rcx
movq -0x38(%rbp), %rdx
xorl %eax, %eax
cmpq 0x10(%rdx), %rcx
movb %al, -0x271(%rbp)
jae 0x1aa220
cmpq $0x0, -0xb8(%rbp)
setne %al
xorb $-0x1, %al
movb %al, -0x271(%rbp)
movb -0x271(%rbp), %al
testb $0x1, %al
jne 0x1aa22c
jmp 0x1aa261
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x28(%rax), %eax
cmpl 0x48(%rbp), %eax
jae 0x1aa251
movq $0x1, -0xb8(%rbp)
jmp 0x1aa253
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x1aa1f7
jmp 0x1aa263
jmp 0x1aa265
movq -0x88(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x1aa275
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x1a9f47
movq -0x98(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
cmpq 0x18(%rbp), %rax
jbe 0x1aa54f
movl $0x0, -0x174(%rbp)
movl $0x0, -0x178(%rbp)
movl $0x0, -0x17c(%rbp)
movl $0x0, -0x180(%rbp)
movl $0x0, -0x184(%rbp)
movl $0x0, -0x188(%rbp)
movl $0x0, -0x18c(%rbp)
movl $0x0, -0x190(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rsi
callq 0x19e350
movq $0x0, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1aa3c3
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x80(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rdi
movq -0x48(%rbp), %rax
movl %eax, %esi
callq 0x1a08b0
movl %eax, -0x16c(%rbp)
movslq -0x16c(%rbp), %rax
movl -0x180(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x180(%rbp,%rax,4)
movslq -0x16c(%rbp), %rax
movslq -0x180(%rbp,%rax,4), %rax
cmpq 0x18(%rbp), %rax
jne 0x1aa3b0
movq -0xc0(%rbp), %rax
movl 0x24(%rax), %ecx
movslq -0x16c(%rbp), %rax
movl %ecx, -0x190(%rbp,%rax,4)
jmp 0x1aa3b2
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x1aa328
cmpl $0x0, -0x190(%rbp)
jg 0x1aa3eb
cmpl $0x0, -0x18c(%rbp)
jg 0x1aa3eb
cmpl $0x0, -0x188(%rbp)
jg 0x1aa3eb
cmpl $0x0, -0x184(%rbp)
jle 0x1aa54d
movq $0x0, -0x80(%rbp)
movq $0x0, -0x88(%rbp)
movq $0x0, -0xb8(%rbp)
movq -0x80(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1aa53e
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x80(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rdi
movq -0x48(%rbp), %rax
movl %eax, %esi
callq 0x1a08b0
movl %eax, -0x16c(%rbp)
movq -0xc0(%rbp), %rax
movl 0x24(%rax), %eax
movslq -0x16c(%rbp), %rcx
cmpl -0x190(%rbp,%rcx,4), %eax
jl 0x1aa52b
movq -0x88(%rbp), %rax
cmpq -0x80(%rbp), %rax
je 0x1aa4f1
movq -0x38(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x88(%rbp), %rax
addq %rax, %rsi
leaq -0x168(%rbp), %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x38(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x80(%rbp), %rax
addq %rax, %rsi
movq -0x38(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x88(%rbp), %rax
addq %rax, %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x38(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x80(%rbp), %rax
addq %rax, %rdi
leaq -0x168(%rbp), %rsi
movl $0xa8, %edx
callq 0x2180
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x28(%rax), %eax
cmpl 0x48(%rbp), %eax
jae 0x1aa519
movq $0x1, -0xb8(%rbp)
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x1aa52d
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x1aa409
movq -0x88(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x1aa54f
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rsi
callq 0x19d6c0
cmpq $0x0, -0xb8(%rbp)
je 0x1aaaf9
movq $0x0, -0x90(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x80(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1aaaea
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x28(%rax), %eax
cmpl 0x48(%rbp), %eax
jae 0x1aaa40
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x80(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
movl 0x4(%rax,%rcx), %eax
movq %rax, -0x198(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x80(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
movl 0x8(%rax,%rcx), %eax
incl %eax
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rax
movq -0x198(%rbp), %rcx
subq %rcx, %rax
movq %rax, %xmm0
movaps 0x1d79f4(%rip), %xmm1   # 0x382010
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x1d79f8(%rip), %xmm1   # 0x382020
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x1d7be1(%rip), %xmm1   # 0x382220
mulsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x1d799e(%rip), %xmm1   # 0x381ff8
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x1b8(%rbp)
cmpq $0x10, -0x1b8(%rbp)
jae 0x1aa685
movq $0x10, -0x1b8(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x24(%rax), %eax
shll $0x4, %eax
cltq
movq %rax, -0x1f8(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x28(%rax), %eax
shll $0x4, %eax
movl %eax, %eax
movq %rax, -0x1d0(%rbp)
movq $0x0, -0x88(%rbp)
movq -0x88(%rbp), %rcx
movq -0x38(%rbp), %rdx
xorl %eax, %eax
cmpq 0x10(%rdx), %rcx
movb %al, -0x272(%rbp)
jae 0x1aa716
movq -0x1a0(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x88(%rbp), %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
seta %al
movb %al, -0x272(%rbp)
movb -0x272(%rbp), %al
testb $0x1, %al
jne 0x1aa725
jmp 0x1aaa04
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x28(%rax), %eax
cmpl 0x48(%rbp), %eax
jae 0x1aa747
jmp 0x1aa9ed
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x28(%rax), %eax
cmpq -0x1d0(%rbp), %rax
jae 0x1aa76d
jmp 0x1aa9ed
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x88(%rbp), %rcx
addq %rcx, %rax
movslq 0x24(%rax), %rax
cmpq -0x1f8(%rbp), %rax
jge 0x1aa794
jmp 0x1aa9ed
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq %rax, -0x1a8(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0x1b0(%rbp)
movq -0x1a8(%rbp), %rax
cmpq -0x198(%rbp), %rax
jb 0x1aa7f7
movq -0x1a8(%rbp), %rax
movq %rax, -0x280(%rbp)
jmp 0x1aa805
movq -0x198(%rbp), %rax
movq %rax, -0x280(%rbp)
movq -0x280(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x1b0(%rbp), %rax
cmpq -0x1a0(%rbp), %rax
ja 0x1aa833
movq -0x1b0(%rbp), %rax
movq %rax, -0x288(%rbp)
jmp 0x1aa841
movq -0x1a0(%rbp), %rax
movq %rax, -0x288(%rbp)
movq -0x288(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
cmpq -0x1c0(%rbp), %rax
jbe 0x1aa9eb
movq -0x1c8(%rbp), %rax
subq -0x1c0(%rbp), %rax
cmpq -0x1b8(%rbp), %rax
jb 0x1aa9eb
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x30(%rax), %eax
movq %rax, -0x98(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0x1d8(%rbp)
movq $0x0, -0x1e0(%rbp)
movq -0x98(%rbp), %rcx
xorl %eax, %eax
cmpq -0xa0(%rbp), %rcx
movb %al, -0x289(%rbp)
jae 0x1aa92d
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x1d8(%rbp), %rcx
movb %al, -0x289(%rbp)
jne 0x1aa92d
movq -0x1e0(%rbp), %rax
cmpq -0x1d0(%rbp), %rax
setb %al
movb %al, -0x289(%rbp)
movb -0x289(%rbp), %al
testb $0x1, %al
jne 0x1aa93c
jmp 0x1aa9d7
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x1f0(%rbp)
movq -0x1f0(%rbp), %rax
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
movq -0x98(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
subq %rcx, %rax
movq %rax, -0x1e8(%rbp)
movq -0x1e8(%rbp), %rax
cmpq -0x1c0(%rbp), %rax
jb 0x1aa9be
movq -0x1f0(%rbp), %rax
cmpq -0x1c8(%rbp), %rax
ja 0x1aa9be
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x1aa9c0
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x1aa8cd
movq -0x1e0(%rbp), %rax
cmpq -0x1d0(%rbp), %rax
jb 0x1aa9e9
jmp 0x1aaa04
jmp 0x1aa9eb
jmp 0x1aa9ed
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x1aa6d2
movq -0x88(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1aaa3e
movq -0x1a0(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x88(%rbp), %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
jbe 0x1aaa3e
jmp 0x1aaad9
jmp 0x1aaa40
movq -0x90(%rbp), %rax
cmpq -0x80(%rbp), %rax
je 0x1aaac7
movq -0x38(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rsi
leaq -0x168(%rbp), %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x38(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x80(%rbp), %rax
addq %rax, %rsi
movq -0x38(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x38(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x80(%rbp), %rax
addq %rax, %rdi
leaq -0x168(%rbp), %rsi
movl $0xa8, %edx
callq 0x2180
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x1aa593
movq -0x90(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq $0x0, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1aab36
movq -0x38(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x80(%rbp), %rcx
addq %rcx, %rax
movl $0x0, 0x28(%rax)
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x1aab01
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax,%rax)