// File: chhylp123[P]hifiasm/inter.cpp
// Function: gen_trans_aln(overlap_region_alloc*, All_reads*, ul_idx_t const*, ug_opt_t const*, long, double, long, unsigned long*, long, ul_ov_t*, long, unsigned long, unsigned long, long*, int*, int*, int*, int*, int*, long*, long*, long, long, long, bit_extz_t*, long, char*, UC_Read*, double, kv_rtrace_t*, unsigned int, ul_ov_t*, ul_ov_t*)
int64_t gen_trans_aln(overlap_region_alloc* ol, All_reads *ridx, const ul_idx_t *uref, 
const ug_opt_t *uopt, int64_t bw, double diff_ec_ul, int64_t qlen, uint64_t *id, int64_t idn, 
ul_ov_t *a, int64_t a_n, uint64_t qs, uint64_t qe, int64_t *vis, int32_t *f0, int32_t *c_n0, 
int32_t *c_sc0, int32_t *rch0, int32_t *ssc0, int64_t *p0, int64_t *t0, int64_t max_skip, 
int64_t max_iter, int64_t max_dis, bit_extz_t *exz, int64_t trans_sc, char* qstr, UC_Read *tu, 
double e_rate, kv_rtrace_t *trace, uint32_t rechain_w, ul_ov_t *res, ul_ov_t *rr)
{
	if(idn == 0) return 0;
	int64_t k, l, i, j, z, nv = 0, qo, is_c, nf; 
	ul_ov_t *li, *lj; uint32_t li_v, lj_v, update, tipl = 0, mm = ((uint32_t)(0x20000000U));
	// for (i = 0; i < idn; i++) {
	// 	li = &(a[id[i]]);
	// 	fprintf(stderr, "[i::%ld] (id::%u)%.*s\t%c\tq::[%u, %u)\tt::[%u, %u)\tc::%u\n", 
	// 			i, li->tn,
    //                 (int)Get_NAME_LENGTH(R_INF, li->tn), Get_NAME(R_INF, li->tn), 
	// 				"+-"[li->rev], li->qs, li->qe, li->ts, li->te, !li->el);
	// }
	for (i = nf = 0; i < idn; i++) {
		if(a[id[i]].el) break;
		if((a[id[i]].ts == 0) && (a[id[i]].te == Get_READ_LENGTH(R_INF, a[id[i]].tn))) nf++;
	}
	if(i < idn && nf > 0) {
		if((a[id[i]].qs > qs) && (qs <= rechain_w)) {
			tipl = qs; ///there are contained chains beforehand
		}
	}

	for (i = 0, k = l = -1; i < idn; i++) {
		k = id[i]; 
		if(k - l > 1) {
			if(l < 0) {
				for (l = k-1; l >= 0 && a[l].qe > qs; l--);
			}

			for (z = l + 1; z < k; z++) {
				li = &(a[z]); li_v = (li->tn<<1)|li->rev;
				if((!(li->el))||(vis[z]&1)) continue;
				if(!(((li->qs + tipl) >= qs) && (li->qe < qe))) continue;
				for (j = i-1, update = 1; j >= 0; --j) {
					lj = &(a[id[j]]); lj_v = (lj->tn<<1)|lj->rev;
            		if(lj->qe <= li->qs) break;
					qo = infer_rovlp(li, lj, NULL, NULL, ridx, NULL); ///overlap length in query (UL read)
            		if((li_v == lj_v) || (!get_ecov_contain_adv(uref, uopt, li_v^1, lj_v^1, 
																			bw, diff_ec_ul, qo, &is_c))) {
						update = 0; break;
					}
				}
				// if(li->tn == 6312) {
				// 	fprintf(stderr, "[z::%ld] (id::%u)%.*s\t%c\tq::[%u, %u)\tt::[%u, %u)\tc::%u\tnf::%ld\ttipl::%u\tl::%ld\tk::%ld\tupdate::%u\n", z, li->tn,
                //     (int)Get_NAME_LENGTH(R_INF, li->tn), Get_NAME(R_INF, li->tn), 
				// 	"+-"[li->rev], li->qs, li->qe, li->ts, li->te, !li->el, nf, tipl, l, k, update);
				// }
				if(update) {
					res[nv] = a[z]; res[nv].sec = (z<<1) + ((li->qs>=qs)?0:1); nv++;
				}
			}
		}
		l = k; 

		li = &(a[k]); li_v = (li->tn<<1)|li->rev;
		for (j = nv-1; j >= 0; --j) {
			lj = &(res[j]); lj_v = (lj->tn<<1)|lj->rev;
			if(lj->qe <= li->qs) break;
			if(lj->qn == (uint32_t)-1) continue;//deleted
			if((lj->sec&mm)) continue;//could not be deleted
			qo = infer_rovlp(li, lj, NULL, NULL, ridx, NULL); ///overlap length in query (UL read)
			if((li_v == lj_v) || (!get_ecov_contain_adv(uref, uopt, li_v^1, lj_v^1, 
																	bw, diff_ec_ul, qo, &is_c))) {
				// if(lj->tn == 6312) {
				// 	fprintf(stderr, "delete::(id::%u)%.*s\t%c\tq::[%u, %u)\tt::[%u, %u)\tc::%u\n", 
				// 	li->tn, (int)Get_NAME_LENGTH(R_INF, li->tn), Get_NAME(R_INF, li->tn), 
				// 	"+-"[li->rev], li->qs, li->qe, li->ts, li->te, !li->el);
				// }
				res[j].qn = res[j].tn = (uint32_t)-1;
			}
		}
		res[nv] = a[k]; res[nv].sec = k; res[nv].sec<<=1; res[nv].sec |= mm; nv++;
	}

	k = a_n; i = idn;
	if(k - l > 1) {
		for (z = l + 1; z < k; z++) {
			li = &(a[z]); li_v = (li->tn<<1)|li->rev;
			if((!(li->el))||(vis[z]&1)) continue;
			if(!(((li->qs + tipl) >= qs) && (li->qe < qe))) continue;
			for (j = i-1, update = 1; j >= 0; --j) {
				lj = &(a[id[j]]); lj_v = (lj->tn<<1)|lj->rev;
				if(lj->qe <= li->qs) break;
				qo = infer_rovlp(li, lj, NULL, NULL, ridx, NULL); ///overlap length in query (UL read)
				if((li_v == lj_v) || (!get_ecov_contain_adv(uref, uopt, li_v^1, lj_v^1, 
																		bw, diff_ec_ul, qo, &is_c))) {
					update = 0; break;
				}
			}
			if(update) {
				res[nv] = a[z]; res[nv].sec = (z<<1) + ((li->qs>=qs)?0:1); nv++;
			}
		}
	}
	// fprintf(stderr, "\n[M::%s::] old_n::%ld, new_n::%ld\n", __func__, idn, nv);
	for (i = k = 0; i < nv; i++) {
		if(res[i].qn == (uint32_t)-1) continue;
		res[k] = res[i]; 
		if(res[k].sec&mm) res[k].sec -= mm; k++;
		// res[k] = res[i]; 
		// id[k] = res[k].sec; 
		// if(id[k]&mm) id[k] -= mm; 
		// id[k] >>= 1;
		// if(res[k].sec&1) id[k] |= ((uint64_t)(0x100000000U));///low prority
		// // if(res[k].sec&mm) id[k] |= ((uint64_t)(0x200000000U));//orignal alignments
		// k++;

		// fprintf(stderr, "[k::%ld] (id::%u)%.*s\t%c\tq::[%u, %u)\tt::[%u, %u)\tc::%u\tnew::%u\n", k, 
		// 			res[k].tn,(int)Get_NAME_LENGTH(R_INF, res[k].tn), Get_NAME(R_INF, res[k].tn), 
		// 			"+-"[res[k].rev], res[k].qs, res[k].qe, res[k].ts, res[k].te, !res[k].el, 
		// 			(res[k].sec != SEC_MODE));
		// if(res[k].sec != SEC_MODE) vis[res[k].sec>>1] |= 1;
		// res[k].sec = SEC_MODE; k++;
	}
	nv = idn = k;
	nv = flat_contain_adv(ol, ridx, uref, uopt, bw, diff_ec_ul, qlen, max_skip, max_iter, max_dis, 
        exz, trans_sc, qstr, tu, e_rate, trace, res, nv, f0, c_n0, c_sc0, rch0, ssc0, p0, t0, a, id, 
		rechain_w, vis, rr);
		// f, ssc, p, t, &(res->a[k]));
	// for (k = 0; k < idn; k++) {
	// 	if(((uint32_t)id[k])&1) continue;
	// 	vis[((uint32_t)id[k])>>1] |= 1;
	// }
	return nv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq 0xd0(%rbp), %rax
movq 0xc8(%rbp), %rax
movl 0xc0(%rbp), %eax
movq 0xb8(%rbp), %rax
movq 0xb0(%rbp), %rax
movq 0xa8(%rbp), %rax
movq 0xa0(%rbp), %rax
movq 0x98(%rbp), %rax
movq 0x90(%rbp), %rax
movq 0x88(%rbp), %rax
movq 0x80(%rbp), %rax
movq 0x78(%rbp), %rax
movq 0x70(%rbp), %rax
movq 0x68(%rbp), %rax
movq 0x60(%rbp), %rax
movq 0x58(%rbp), %rax
movq 0x50(%rbp), %rax
movq 0x48(%rbp), %rax
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x38(%rbp)
movq %rsi, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
movq %rcx, -0x50(%rbp)
movq %r8, -0x58(%rbp)
movsd %xmm0, -0x60(%rbp)
movq %r9, -0x68(%rbp)
movsd %xmm1, -0x70(%rbp)
cmpq $0x0, 0x18(%rbp)
jne 0x2b752e
movq $0x0, -0x30(%rbp)
jmp 0x2b823e
movq $0x0, -0xa0(%rbp)
movl $0x0, -0xd8(%rbp)
movl $0x20000000, -0xdc(%rbp) # imm = 0x20000000
movq $0x0, -0xb8(%rbp)
movq $0x0, -0x88(%rbp)
movq -0x88(%rbp), %rax
cmpq 0x18(%rbp), %rax
jge 0x2b762b
movq 0x20(%rbp), %rax
movq 0x10(%rbp), %rcx
movq -0x88(%rbp), %rdx
imulq $0x1c, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
shrl $0x1e, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2b759e
jmp 0x2b762b
movq 0x20(%rbp), %rax
movq 0x10(%rbp), %rcx
movq -0x88(%rbp), %rdx
imulq $0x1c, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
cmpl $0x0, 0x10(%rax)
jne 0x2b7612
movq 0x20(%rbp), %rax
movq 0x10(%rbp), %rcx
movq -0x88(%rbp), %rdx
imulq $0x1c, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
leaq 0x10dcf4(%rip), %rcx    # 0x3c52d0
movq 0x18(%rcx), %rcx
movq 0x20(%rbp), %rdx
movq 0x10(%rbp), %rsi
movq -0x88(%rbp), %rdi
imulq $0x1c, (%rsi,%rdi,8), %rsi
addq %rsi, %rdx
movl 0xc(%rdx), %edx
cmpq (%rcx,%rdx,8), %rax
jne 0x2b7612
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb8(%rbp)
jmp 0x2b7614
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x2b7563
movq -0x88(%rbp), %rax
cmpq 0x18(%rbp), %rax
jge 0x2b767d
cmpq $0x0, -0xb8(%rbp)
jle 0x2b767d
movq 0x20(%rbp), %rax
movq 0x10(%rbp), %rcx
movq -0x88(%rbp), %rdx
imulq $0x1c, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
cmpq 0x30(%rbp), %rax
jbe 0x2b767b
movq 0x30(%rbp), %rax
movl 0xc0(%rbp), %ecx
cmpq %rcx, %rax
ja 0x2b767b
movq 0x30(%rbp), %rax
movl %eax, -0xd8(%rbp)
jmp 0x2b767d
movq $0x0, -0x88(%rbp)
movq $-0x1, -0x80(%rbp)
movq $-0x1, -0x78(%rbp)
movq -0x88(%rbp), %rax
cmpq 0x18(%rbp), %rax
jge 0x2b7c66
movq 0x10(%rbp), %rax
movq -0x88(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
subq -0x80(%rbp), %rax
cmpq $0x1, %rax
jle 0x2b79cd
cmpq $0x0, -0x80(%rbp)
jge 0x2b772a
movq -0x78(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x80(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x80(%rbp)
movb %al, -0xdd(%rbp)
jl 0x2b770c
movq 0x20(%rbp), %rax
imulq $0x1c, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpq 0x30(%rbp), %rax
seta %al
movb %al, -0xdd(%rbp)
movb -0xdd(%rbp), %al
testb $0x1, %al
jne 0x2b7718
jmp 0x2b7728
jmp 0x2b771a
movq -0x80(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x2b76e1
jmp 0x2b772a
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
cmpq -0x78(%rbp), %rax
jge 0x2b79cb
movq 0x20(%rbp), %rax
imulq $0x1c, -0x98(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movl 0xc(%rax), %eax
shll %eax
movq -0xc0(%rbp), %rcx
movl 0x18(%rcx), %ecx
shrl $0x1f, %ecx
orl %ecx, %eax
movl %eax, -0xcc(%rbp)
movq -0xc0(%rbp), %rax
movl 0x18(%rax), %eax
shrl $0x1e, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2b77af
movq 0x40(%rbp), %rax
movq -0x98(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x2b77b4
jmp 0x2b79b4
movq -0xc0(%rbp), %rax
movl 0x4(%rax), %eax
addl -0xd8(%rbp), %eax
movl %eax, %eax
cmpq 0x30(%rbp), %rax
jb 0x2b77dc
movq -0xc0(%rbp), %rax
movl 0x8(%rax), %eax
cmpq 0x38(%rbp), %rax
jb 0x2b77e1
jmp 0x2b79b4
movq -0x88(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x90(%rbp)
movl $0x1, -0xd4(%rbp)
cmpq $0x0, -0x90(%rbp)
jl 0x2b7901
movq 0x20(%rbp), %rax
movq 0x10(%rbp), %rcx
movq -0x90(%rbp), %rdx
imulq $0x1c, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movl 0xc(%rax), %eax
shll %eax
movq -0xc8(%rbp), %rcx
movl 0x18(%rcx), %ecx
shrl $0x1f, %ecx
orl %ecx, %eax
movl %eax, -0xd0(%rbp)
movq -0xc8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xc0(%rbp), %rcx
cmpl 0x4(%rcx), %eax
ja 0x2b7865
jmp 0x2b7901
movq -0xc0(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movq -0x40(%rbp), %r8
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %rdx
movq %r9, %rcx
callq 0x71a90
movq %rax, -0xa8(%rbp)
movl -0xcc(%rbp), %eax
cmpl -0xd0(%rbp), %eax
je 0x2b78dc
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0xcc(%rbp), %edx
xorl $0x1, %edx
movl -0xd0(%rbp), %ecx
xorl $0x1, %ecx
movq -0x58(%rbp), %r8
movsd -0x60(%rbp), %xmm0
movq -0xa8(%rbp), %r9
leaq -0xb0(%rbp), %rax
movq %rax, (%rsp)
callq 0x2b0c90
cmpq $0x0, %rax
jne 0x2b78e8
movl $0x0, -0xd4(%rbp)
jmp 0x2b7901
jmp 0x2b78ea
movq -0x90(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x2b77fd
cmpl $0x0, -0xd4(%rbp)
je 0x2b79b2
movq 0x20(%rbp), %rcx
imulq $0x1c, -0x98(%rbp), %rax
addq %rax, %rcx
movq 0xc8(%rbp), %rax
imulq $0x1c, -0xa0(%rbp), %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
movq -0x98(%rbp), %rax
shlq %rax
movq -0xc0(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, %esi
movq 0x30(%rbp), %rdi
movl $0x1, %ecx
xorl %edx, %edx
cmpq %rdi, %rsi
cmovael %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movl %eax, %edx
movq 0xc8(%rbp), %rax
imulq $0x1c, -0xa0(%rbp), %rcx
addq %rcx, %rax
movl 0x18(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x18(%rax)
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa0(%rbp)
jmp 0x2b79b4
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x2b7739
jmp 0x2b79cd
movq -0x78(%rbp), %rax
movq %rax, -0x80(%rbp)
movq 0x20(%rbp), %rax
imulq $0x1c, -0x78(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movl 0xc(%rax), %eax
shll %eax
movq -0xc0(%rbp), %rcx
movl 0x18(%rcx), %ecx
shrl $0x1f, %ecx
orl %ecx, %eax
movl %eax, -0xcc(%rbp)
movq -0xa0(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
jl 0x2b7b6f
movq 0xc8(%rbp), %rax
imulq $0x1c, -0x90(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movl 0xc(%rax), %eax
shll %eax
movq -0xc8(%rbp), %rcx
movl 0x18(%rcx), %ecx
shrl $0x1f, %ecx
orl %ecx, %eax
movl %eax, -0xd0(%rbp)
movq -0xc8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xc0(%rbp), %rcx
cmpl 0x4(%rcx), %eax
ja 0x2b7a7e
jmp 0x2b7b6f
movq -0xc8(%rbp), %rax
cmpl $-0x1, (%rax)
jne 0x2b7a8f
jmp 0x2b7b58
movq -0xc8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
andl -0xdc(%rbp), %eax
cmpl $0x0, %eax
je 0x2b7aae
jmp 0x2b7b58
movq -0xc0(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movq -0x40(%rbp), %r8
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %rdx
movq %r9, %rcx
callq 0x71a90
movq %rax, -0xa8(%rbp)
movl -0xcc(%rbp), %eax
cmpl -0xd0(%rbp), %eax
je 0x2b7b25
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0xcc(%rbp), %edx
xorl $0x1, %edx
movl -0xd0(%rbp), %ecx
xorl $0x1, %ecx
movq -0x58(%rbp), %r8
movsd -0x60(%rbp), %xmm0
movq -0xa8(%rbp), %r9
leaq -0xb0(%rbp), %rax
movq %rax, (%rsp)
callq 0x2b0c90
cmpq $0x0, %rax
jne 0x2b7b56
movq 0xc8(%rbp), %rax
imulq $0x1c, -0x90(%rbp), %rcx
addq %rcx, %rax
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
movq 0xc8(%rbp), %rax
imulq $0x1c, -0x90(%rbp), %rcx
addq %rcx, %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
jmp 0x2b7b58
movq -0x90(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x2b7a1b
movq 0x20(%rbp), %rcx
imulq $0x1c, -0x78(%rbp), %rax
addq %rax, %rcx
movq 0xc8(%rbp), %rax
imulq $0x1c, -0xa0(%rbp), %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
movq -0x78(%rbp), %rax
movl %eax, %edx
movq 0xc8(%rbp), %rax
imulq $0x1c, -0xa0(%rbp), %rcx
addq %rcx, %rax
movl 0x18(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x18(%rax)
movq 0xc8(%rbp), %rax
imulq $0x1c, -0xa0(%rbp), %rcx
addq %rcx, %rax
movl 0x18(%rax), %edx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
shll %edx
movl 0x18(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x18(%rax)
movl -0xdc(%rbp), %ecx
movq 0xc8(%rbp), %rax
imulq $0x1c, -0xa0(%rbp), %rdx
addq %rdx, %rax
movl 0x18(%rax), %edx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
orl %ecx, %edx
movl 0x18(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x18(%rax)
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa0(%rbp)
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x2b7698
movq 0x28(%rbp), %rax
movq %rax, -0x78(%rbp)
movq 0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x78(%rbp), %rax
subq -0x80(%rbp), %rax
cmpq $0x1, %rax
jle 0x2b7f2e
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
cmpq -0x78(%rbp), %rax
jge 0x2b7f2c
movq 0x20(%rbp), %rax
imulq $0x1c, -0x98(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movl 0xc(%rax), %eax
shll %eax
movq -0xc0(%rbp), %rcx
movl 0x18(%rcx), %ecx
shrl $0x1f, %ecx
orl %ecx, %eax
movl %eax, -0xcc(%rbp)
movq -0xc0(%rbp), %rax
movl 0x18(%rax), %eax
shrl $0x1e, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2b7d10
movq 0x40(%rbp), %rax
movq -0x98(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x2b7d15
jmp 0x2b7f15
movq -0xc0(%rbp), %rax
movl 0x4(%rax), %eax
addl -0xd8(%rbp), %eax
movl %eax, %eax
cmpq 0x30(%rbp), %rax
jb 0x2b7d3d
movq -0xc0(%rbp), %rax
movl 0x8(%rax), %eax
cmpq 0x38(%rbp), %rax
jb 0x2b7d42
jmp 0x2b7f15
movq -0x88(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x90(%rbp)
movl $0x1, -0xd4(%rbp)
cmpq $0x0, -0x90(%rbp)
jl 0x2b7e62
movq 0x20(%rbp), %rax
movq 0x10(%rbp), %rcx
movq -0x90(%rbp), %rdx
imulq $0x1c, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movl 0xc(%rax), %eax
shll %eax
movq -0xc8(%rbp), %rcx
movl 0x18(%rcx), %ecx
shrl $0x1f, %ecx
orl %ecx, %eax
movl %eax, -0xd0(%rbp)
movq -0xc8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xc0(%rbp), %rcx
cmpl 0x4(%rcx), %eax
ja 0x2b7dc6
jmp 0x2b7e62
movq -0xc0(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movq -0x40(%rbp), %r8
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %rdx
movq %r9, %rcx
callq 0x71a90
movq %rax, -0xa8(%rbp)
movl -0xcc(%rbp), %eax
cmpl -0xd0(%rbp), %eax
je 0x2b7e3d
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0xcc(%rbp), %edx
xorl $0x1, %edx
movl -0xd0(%rbp), %ecx
xorl $0x1, %ecx
movq -0x58(%rbp), %r8
movsd -0x60(%rbp), %xmm0
movq -0xa8(%rbp), %r9
leaq -0xb0(%rbp), %rax
movq %rax, (%rsp)
callq 0x2b0c90
cmpq $0x0, %rax
jne 0x2b7e49
movl $0x0, -0xd4(%rbp)
jmp 0x2b7e62
jmp 0x2b7e4b
movq -0x90(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x2b7d5e
cmpl $0x0, -0xd4(%rbp)
je 0x2b7f13
movq 0x20(%rbp), %rcx
imulq $0x1c, -0x98(%rbp), %rax
addq %rax, %rcx
movq 0xc8(%rbp), %rax
imulq $0x1c, -0xa0(%rbp), %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
movq -0x98(%rbp), %rax
shlq %rax
movq -0xc0(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, %esi
movq 0x30(%rbp), %rdi
movl $0x1, %ecx
xorl %edx, %edx
cmpq %rdi, %rsi
cmovael %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movl %eax, %edx
movq 0xc8(%rbp), %rax
imulq $0x1c, -0xa0(%rbp), %rcx
addq %rcx, %rax
movl 0x18(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x18(%rax)
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa0(%rbp)
jmp 0x2b7f15
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x2b7c9a
jmp 0x2b7f2e
movq $0x0, -0x78(%rbp)
movq $0x0, -0x88(%rbp)
movq -0x88(%rbp), %rax
cmpq -0xa0(%rbp), %rax
jge 0x2b8027
movq 0xc8(%rbp), %rax
imulq $0x1c, -0x88(%rbp), %rcx
addq %rcx, %rax
cmpl $-0x1, (%rax)
jne 0x2b7f71
jmp 0x2b8010
movq 0xc8(%rbp), %rcx
imulq $0x1c, -0x88(%rbp), %rax
addq %rax, %rcx
movq 0xc8(%rbp), %rax
imulq $0x1c, -0x78(%rbp), %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
movq 0xc8(%rbp), %rax
imulq $0x1c, -0x78(%rbp), %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
andl -0xdc(%rbp), %eax
cmpl $0x0, %eax
je 0x2b8004
movl -0xdc(%rbp), %ecx
movq 0xc8(%rbp), %rax
imulq $0x1c, -0x78(%rbp), %rdx
addq %rdx, %rax
movl 0x18(%rax), %edx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
subl %ecx, %edx
movl 0x18(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x18(%rax)
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x2b7f41
movq -0x78(%rbp), %rax
movq %rax, 0x18(%rbp)
movq %rax, -0xa0(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %r8
movsd -0x60(%rbp), %xmm0
movq -0x68(%rbp), %r9
movq 0x80(%rbp), %rax
movq %rax, -0x158(%rbp)
movq 0x88(%rbp), %rax
movq %rax, -0x150(%rbp)
movq 0x90(%rbp), %rax
movq %rax, -0x148(%rbp)
movq 0x98(%rbp), %rax
movq %rax, -0x140(%rbp)
movq 0xa0(%rbp), %rax
movq %rax, -0x138(%rbp)
movq 0xa8(%rbp), %rax
movq %rax, -0x130(%rbp)
movq 0xb0(%rbp), %rax
movq %rax, -0x128(%rbp)
movsd -0x70(%rbp), %xmm1
movq 0xb8(%rbp), %rax
movq %rax, -0x120(%rbp)
movq 0xc8(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x110(%rbp)
movq 0x48(%rbp), %rax
movq %rax, -0x108(%rbp)
movq 0x50(%rbp), %rax
movq %rax, -0x100(%rbp)
movq 0x58(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq 0x60(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq 0x68(%rbp), %r13
movq 0x70(%rbp), %r12
movq 0x78(%rbp), %r15
movq 0x20(%rbp), %r14
movq 0x10(%rbp), %rbx
movl 0xc0(%rbp), %eax
movl %eax, %r11d
movq 0x40(%rbp), %r10
movq 0xd0(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x158(%rbp), %rax
movq %rax, (%rsp)
movq -0x150(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x148(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0x140(%rbp), %rax
movq %rax, 0x18(%rsp)
movq -0x138(%rbp), %rax
movq %rax, 0x20(%rsp)
movq -0x130(%rbp), %rax
movq %rax, 0x28(%rsp)
movq -0x128(%rbp), %rax
movq %rax, 0x30(%rsp)
movq -0x120(%rbp), %rax
movq %rax, 0x38(%rsp)
movq -0x118(%rbp), %rax
movq %rax, 0x40(%rsp)
movq -0x110(%rbp), %rax
movq %rax, 0x48(%rsp)
movq -0x108(%rbp), %rax
movq %rax, 0x50(%rsp)
movq -0x100(%rbp), %rax
movq %rax, 0x58(%rsp)
movq -0xf8(%rbp), %rax
movq %rax, 0x60(%rsp)
movq -0xf0(%rbp), %rax
movq %rax, 0x68(%rsp)
movq -0xe8(%rbp), %rax
movq %r13, 0x70(%rsp)
movq %r12, 0x78(%rsp)
movq %r15, 0x80(%rsp)
movq %r14, 0x88(%rsp)
movq %rbx, 0x90(%rsp)
movq %r11, 0x98(%rsp)
movq %r10, 0xa0(%rsp)
movq %rax, 0xa8(%rsp)
callq 0x2b3d40
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)