// File: chhylp123[P]hifiasm/inter.cpp
// Function: filter_by_reliable_ovlp_adv(unsigned int, kv_u_trans_t*, st_mt_t*, overlap_region_alloc*, ul_idx_t const*, double, unsigned long, unsigned long, unsigned long*)
void filter_by_reliable_ovlp_adv(uint32_t id, kv_u_trans_t *idx, st_mt_t *sp, overlap_region_alloc* ol, const ul_idx_t *udb, double sec_rate, uint64_t avoid_dup_aln, 
uint64_t dedup_by_reliable_ovlp, uint64_t *occ1)
{
	(*occ1) = 0;
	u_trans_t *a; uint64_t n, k, l, s, e, s0, e0, z, ov, rr, r1, spn; overlap_region *m, t;
	a = u_trans_a(*idx, id); n = u_trans_n(*idx, id);
	if(avoid_dup_aln) {
		kv_resize(uint64_t, *sp, (ol->length)+n);
		for (k = sp->n = 0; k < n; k++) {
			if(a[k].del) continue;
			// if(id == 160) {
			// 	fprintf(stderr, "[rid::%u]\tutg%.6u%c\t%u\t%u\t%u\t%c\tutg%.6u%c\t%u\t%u\t%u\tnw::%f\tf::%u\n", id, 
			// 		a[k].qn+1, "lc"[udb->ug->u.a[a[k].qn].circ], udb->ug->u.a[a[k].qn].len, a[k].qs, a[k].qe, "+-"[a[k].rev],
			// 		a[k].tn+1, "lc"[udb->ug->u.a[a[k].tn].circ], udb->ug->u.a[a[k].tn].len, a[k].ts, a[k].te, a[k].nw, a[k].f);
			// }
			if(a[k].f == RC_0 || a[k].f == RC_1) {
				z = a[k].tn; z <<= 1; z |= a[k].rev; z <<= 32; 
				kv_push(uint64_t, *sp, z);
			}
		}
		if(sp->n > 0) {
			for (k = 0; k < ol->length; k++) {
				z = ol->list[k].y_id; z <<= 1; z |= ol->list[k].y_pos_strand; 
				z <<= 32; z |= k; z |= ((uint64_t)0x80000000);
				kv_push(uint64_t, *sp, z);
			}

			radix_sort_gfa64(sp->a, sp->a + sp->n); 
			for (k = 1, l = 0, rr = 0; k <= sp->n; k++) {
				if(k == sp->n || (sp->a[l]>>32)!=(sp->a[k]>>32)) {
					if((k - l > 1) && (!(sp->a[l]&((uint64_t)0x80000000)))) {///overlap within bck
						for (z = l; z < k; z++) {
							if(sp->a[z]&((uint64_t)0x80000000)) {
								ol->list[(uint32_t)(sp->a[z]-((uint64_t)0x80000000))].y_id = ((uint32_t)-1);
								rr++;
							}
						}
					}
					l = k;
				}
			}

			if(rr > 0) {
				for (k = rr = 0; k < ol->length; k++) {
					if(ol->list[k].y_id == ((uint32_t)-1)) continue;
					if(rr != k) {
						t = ol->list[rr];
						ol->list[rr] = ol->list[k];
						ol->list[k] = t;
					}
					rr++;
				}
				ol->length = rr;
			}
		}
	}

	sp->n = 0;
	if(dedup_by_reliable_ovlp) {
		for (k = sp->n = 0; k < n; k++) {
			if(a[k].del) continue;
			if(a[k].f == RC_0 || a[k].f == RC_1) {
				kv_push(uint64_t, *sp, (((uint64_t)a[k].qs)<<32)|((uint64_t)a[k].qe));
			}
		}
		if(sp->n > 1) {
			radix_sort_gfa64(sp->a, sp->a + sp->n);
			for (k = z = 0; k < sp->n; k++) {
				s = sp->a[k]>>32; e = (uint32_t)sp->a[k];
				if(z > 0 && s <= ((uint32_t)sp->a[z-1])) {
					if(e > ((uint32_t)sp->a[z-1])) {
						sp->a[z-1] >>= 32; sp->a[z-1] <<= 32; sp->a[z-1] |= e;
					}
				} else {
					sp->a[z++] = sp->a[k];
				}
			}
			sp->n = z;
		}
	}

	for (k = rr = r1 = 0, spn = sp->n; k < ol->length; k++) {
		m = &(ol->list[k]);
		// if(id == 160) {
		// 	fprintf(stderr, "[M::%s] utg%.6u%c\t%u\t%u\t%u\t%c\tutg%.6u%c\t%u\t%u\t%u\txstr::%u\n", __func__, 
		// 		ol->list[k].x_id+1, "lc"[udb->ug->u.a[ol->list[k].x_id].circ], udb->ug->u.a[ol->list[k].x_id].len, 
		// 		ol->list[k].x_pos_s, ol->list[k].x_pos_e+1, "+-"[ol->list[k].y_pos_strand],
		// 		ol->list[k].y_id+1, "lc"[udb->ug->u.a[ol->list[k].y_id].circ], udb->ug->u.a[ol->list[k].y_id].len, 
		// 		ol->list[k].y_pos_s, ol->list[k].y_pos_e+1, ol->list[k].x_pos_strand);
		// }
		if((dedup_by_reliable_ovlp) && (m->x_pos_strand == 0)) {
			s = m->x_pos_s; e = m->x_pos_e + 1; l = 0; 
			for (z = 0; z < spn; z++) {
				s0 = sp->a[z]>>32; e0 = (uint32_t)sp->a[z];
				ov = ((MIN(e, e0) > MAX(s, s0))? (MIN(e, e0) - MAX(s, s0)):0);
				l += ov;
				if((l) && (l > ((e-s)*sec_rate))) break;
			}
			///filter by the overlaps of id/m->x_id
			if(z < spn) continue;
			///filter by the overlaps of m->y_id
			if(filter_by_reliable_ovlp0(u_trans_a(*idx, m->y_id), u_trans_n(*idx, m->y_id), 
			m->y_pos_strand?udb->ug->u.a[m->y_id].len-m->y_pos_e-1:m->y_pos_s, 
			m->y_pos_strand?udb->ug->u.a[m->y_id].len-m->y_pos_s:m->y_pos_e+1, sec_rate)) {
				continue;
			}
		} 
		// else {
		// 	if(id == 7) {
		// 		fprintf(stderr, "[M::%s] utg%.6u%c\t%u\t%u\t%u\t%c\tutg%.6u%c\t%u\t%u\t%u\n", __func__, 
		// 		ol->list[k].x_id+1, "lc"[udb->ug->u.a[ol->list[k].x_id].circ], udb->ug->u.a[ol->list[k].x_id].len, 
		// 		ol->list[k].x_pos_s, ol->list[k].x_pos_e+1, "+-"[ol->list[k].y_pos_strand],
		// 		ol->list[k].y_id+1, "lc"[udb->ug->u.a[ol->list[k].y_id].circ], udb->ug->u.a[ol->list[k].y_id].len, 
		// 		ol->list[k].y_pos_s, ol->list[k].y_pos_e+1);
		// 	}
		// }
		if(rr != k) {
			t = ol->list[k];
            ol->list[k] = ol->list[rr];
            ol->list[rr] = t;
		}
		if(ol->list[rr].x_pos_strand) {
			ol->list[rr].x_pos_strand = 0;
			if(r1 != rr) {
				t = ol->list[r1];
            	ol->list[r1] = ol->list[rr];
            	ol->list[rr] = t;
			}
			r1++;
		}
		// fprintf(stderr, ">>>utg%.6u%c\t%u\t%u\t%u\t%c\tutg%.6u%c\t%u\t%u\t%u\n", 
		// 		ol->list[rr].x_id+1, "lc"[udb->ug->u.a[ol->list[rr].x_id].circ], udb->ug->u.a[ol->list[rr].x_id].len, 
		// 		ol->list[rr].x_pos_s, ol->list[rr].x_pos_e+1, "+-"[ol->list[rr].y_pos_strand],
		// 		ol->list[rr].y_id+1, "lc"[udb->ug->u.a[ol->list[rr].y_id].circ], udb->ug->u.a[ol->list[rr].y_id].len, 
		// 		ol->list[rr].y_pos_s, ol->list[rr].y_pos_e+1);
		rr++;
	}
	// if(id == 1576) {
		// fprintf(stderr, "[M::%s] utg%.6ul, ol->length0::%lu, ol->length::%lu\n", __func__, id+1, ol->length, rr);
	// }
	ol->length = rr; (*occ1) = r1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movsd %xmm0, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq 0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x4(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x4(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x2bd5f5
jmp 0x2bcff2
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
addq -0x48(%rbp), %rcx
cmpq %rcx, %rax
jae 0x2bd0de
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
addq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
shrq %rcx
movq -0x18(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x2, %rcx
movq -0x18(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x4, %rcx
movq -0x18(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x8, %rcx
movq -0x18(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x10, %rcx
movq -0x18(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x2bd0e0
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x2bd242
movq -0x40(%rbp), %rax
imulq $0x30, -0x50(%rbp), %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x2bd11c
jmp 0x2bd231
movq -0x40(%rbp), %rax
imulq $0x30, -0x50(%rbp), %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x2bd152
movq -0x40(%rbp), %rax
imulq $0x30, -0x50(%rbp), %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x2bd22f
movq -0x40(%rbp), %rax
imulq $0x30, -0x50(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
shlq %rax
movq %rax, -0x80(%rbp)
movq -0x40(%rbp), %rax
imulq $0x30, -0x50(%rbp), %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x6, %al
andb $0x1, %al
movzbl %al, %eax
orq -0x80(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2bd20c
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2bd1cb
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x158(%rbp)
jmp 0x2bd1d9
movl $0x2, %eax
movq %rax, -0x158(%rbp)
jmp 0x2bd1d9
movq -0x158(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x80(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x2bd22f
jmp 0x2bd231
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2bd0f3
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jbe 0x2bd5f3
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x2bd37a
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
shlq %rax
movq %rax, -0x80(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
orq -0x80(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x80(%rbp)
movq -0x50(%rbp), %rax
orq -0x80(%rbp), %rax
movq %rax, -0x80(%rbp)
movabsq $0x80000000, %rax       # imm = 0x80000000
orq -0x80(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2bd346
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2bd305
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x160(%rbp)
jmp 0x2bd313
movl $0x2, %eax
movq %rax, -0x160(%rbp)
jmp 0x2bd313
movq -0x160(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x80(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x2bd369
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2bd258
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x27a9b0
movq $0x1, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x90(%rbp)
movq -0x50(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
ja 0x2bd4e8
movq -0x50(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
je 0x2bd407
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x50(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
je 0x2bd4d5
movq -0x50(%rbp), %rax
subq -0x58(%rbp), %rax
cmpq $0x1, %rax
jbe 0x2bd4cd
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x58(%rbp), %rdx
movabsq $0x80000000, %rax       # imm = 0x80000000
andq (%rcx,%rdx,8), %rax
cmpq $0x0, %rax
jne 0x2bd4cd
movq -0x58(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
cmpq -0x50(%rbp), %rax
jae 0x2bd4cb
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x80(%rbp), %rdx
movabsq $0x80000000, %rax       # imm = 0x80000000
andq (%rcx,%rdx,8), %rax
cmpq $0x0, %rax
je 0x2bd4b8
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x80(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movabsq $0x80000000, %rdx       # imm = 0x80000000
subq %rdx, %rcx
movl %ecx, %ecx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x2bd4ba
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x2bd445
jmp 0x2bd4cd
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x2bd4d7
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2bd3b8
cmpq $0x0, -0x90(%rbp)
jbe 0x2bd5f1
movq $0x0, -0x90(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x2bd5e2
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
cmpl $-0x1, 0x10(%rax)
jne 0x2bd538
jmp 0x2bd5d1
movq -0x90(%rbp), %rax
cmpq -0x50(%rbp), %rax
je 0x2bd5bf
movq -0x20(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rsi
leaq -0x150(%rbp), %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x20(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x50(%rbp), %rax
addq %rax, %rsi
movq -0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x50(%rbp), %rax
addq %rax, %rdi
leaq -0x150(%rbp), %rsi
movl $0xa8, %edx
callq 0x2180
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2bd509
movq -0x90(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x2bd5f3
jmp 0x2bd5f5
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
cmpq $0x0, 0x10(%rbp)
je 0x2bd8b2
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x2bd748
movq -0x40(%rbp), %rax
imulq $0x30, -0x50(%rbp), %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x2bd647
jmp 0x2bd737
movq -0x40(%rbp), %rax
imulq $0x30, -0x50(%rbp), %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x2bd67d
movq -0x40(%rbp), %rax
imulq $0x30, -0x50(%rbp), %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x2bd735
jmp 0x2bd67f
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2bd6f0
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2bd6af
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x168(%rbp)
jmp 0x2bd6bd
movl $0x2, %eax
movq %rax, -0x168(%rbp)
jmp 0x2bd6bd
movq -0x168(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rax
imulq $0x30, -0x50(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, %edx
shlq $0x20, %rdx
movq -0x40(%rbp), %rax
imulq $0x30, -0x50(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
orq %rax, %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x2bd735
jmp 0x2bd737
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2bd61e
movq -0x18(%rbp), %rax
cmpq $0x1, (%rax)
jbe 0x2bd8b0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x27a9b0
movq $0x0, -0x80(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x2bd8a5
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x80(%rbp)
jbe 0x2bd867
movq -0x60(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x80(%rbp), %rdx
subq $0x1, %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
cmpq %rcx, %rax
ja 0x2bd867
movq -0x68(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x80(%rbp), %rdx
subq $0x1, %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
cmpq %rcx, %rax
jbe 0x2bd865
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x80(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
shrq $0x20, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x80(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
shlq $0x20, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x68(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x80(%rbp), %rcx
subq $0x1, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x2bd892
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x80(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x80(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x2bd894
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2bd789
movq -0x80(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2bd8b2
movq $0x0, -0x98(%rbp)
movq $0x0, -0x90(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x50(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x2bddda
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
cmpq $0x0, 0x10(%rbp)
je 0x2bdc4f
movq -0xa8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x2bdc4f
movq -0xa8(%rbp), %rax
movl 0x4(%rax), %eax
movq %rax, -0x60(%rbp)
movq -0xa8(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0x68(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x80(%rbp), %rax
cmpq -0xa0(%rbp), %rax
jae 0x2bdaff
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x78(%rbp), %rax
ja 0x2bd9ac
movq -0x68(%rbp), %rax
movq %rax, -0x170(%rbp)
jmp 0x2bd9b7
movq -0x78(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x70(%rbp), %rax
jb 0x2bd9dc
movq -0x60(%rbp), %rax
movq %rax, -0x180(%rbp)
jmp 0x2bd9e7
movq -0x70(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x178(%rbp), %rax
movq -0x180(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x2bda66
movq -0x68(%rbp), %rax
cmpq -0x78(%rbp), %rax
ja 0x2bda11
movq -0x68(%rbp), %rax
movq %rax, -0x188(%rbp)
jmp 0x2bda1c
movq -0x78(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x70(%rbp), %rax
jb 0x2bda41
movq -0x60(%rbp), %rax
movq %rax, -0x198(%rbp)
jmp 0x2bda4c
movq -0x70(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x190(%rbp), %rax
movq -0x198(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x1a0(%rbp)
jmp 0x2bda71
xorl %eax, %eax
movq %rax, -0x1a0(%rbp)
jmp 0x2bda71
movq -0x1a0(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x2bdaec
movq -0x58(%rbp), %xmm0
movaps 0xc456f(%rip), %xmm3    # 0x382010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0xc4573(%rip), %xmm2    # 0x382020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x68(%rbp), %rax
movq -0x60(%rbp), %rcx
subq %rcx, %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
mulsd -0x30(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x2bdaec
jmp 0x2bdaff
jmp 0x2bdaee
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x2bd956
movq -0x80(%rbp), %rax
cmpq -0xa0(%rbp), %rax
jae 0x2bdb11
jmp 0x2bddc9
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0xa8(%rbp), %rdx
movl 0x10(%rdx), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x1b0(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xa8(%rbp), %rcx
movl 0x10(%rcx), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x1a8(%rbp)
movq -0xa8(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0x2bdba5
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq -0xa8(%rbp), %rcx
movl 0x10(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0xa8(%rbp), %rcx
subl 0x18(%rcx), %eax
subl $0x1, %eax
movl %eax, -0x1b4(%rbp)
jmp 0x2bdbb5
movq -0xa8(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x1b4(%rbp)
movl -0x1b4(%rbp), %eax
movl %eax, %eax
movq %rax, -0x1c0(%rbp)
movq -0xa8(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0x2bdc06
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq -0xa8(%rbp), %rcx
movl 0x10(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0xa8(%rbp), %rcx
subl 0x14(%rcx), %eax
movl %eax, -0x1c4(%rbp)
jmp 0x2bdc19
movq -0xa8(%rbp), %rax
movl 0x18(%rax), %eax
addl $0x1, %eax
movl %eax, -0x1c4(%rbp)
movq -0x1c0(%rbp), %rdx
movq -0x1a8(%rbp), %rsi
movq -0x1b0(%rbp), %rdi
movl -0x1c4(%rbp), %eax
movl %eax, %eax
movl %eax, %ecx
movsd -0x30(%rbp), %xmm0
callq 0x2bc1c0
cmpq $0x0, %rax
je 0x2bdc4d
jmp 0x2bddc9
jmp 0x2bdc4f
movq -0x90(%rbp), %rax
cmpq -0x50(%rbp), %rax
je 0x2bdcd6
movq -0x20(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x50(%rbp), %rax
addq %rax, %rsi
leaq -0x150(%rbp), %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x20(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rsi
movq -0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x50(%rbp), %rax
addq %rax, %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rdi
leaq -0x150(%rbp), %rsi
movl $0xa8, %edx
callq 0x2180
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x90(%rbp), %rcx
addq %rcx, %rax
cmpl $0x0, 0xc(%rax)
je 0x2bddb7
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x90(%rbp), %rcx
addq %rcx, %rax
movl $0x0, 0xc(%rax)
movq -0x98(%rbp), %rax
cmpq -0x90(%rbp), %rax
je 0x2bdda5
movq -0x20(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x98(%rbp), %rax
addq %rax, %rsi
leaq -0x150(%rbp), %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x20(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rsi
movq -0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x98(%rbp), %rax
addq %rax, %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rdi
leaq -0x150(%rbp), %rsi
movl $0xa8, %edx
callq 0x2180
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2bd8de
movq -0x90(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x98(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, (%rax)
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq