// File: chhylp123[P]hifiasm/inter.cpp
// Function: push_graph_bin_back(overlap_region_alloc*, ul_idx_t const*, hpc_re_t*, double, unsigned long, unsigned long, unsigned long, asg64_v*, asg64_v*, mask_ul_ov_t*)
void push_graph_bin_back(overlap_region_alloc* ol, const ul_idx_t *udb, hpc_re_t *hre, 
double erate, uint64_t maxe, uint64_t minov, uint64_t rid, asg64_v *b0, asg64_v *b1, mask_ul_ov_t *mk)
{
	uint64_t k, i, m, si, sn, skip_n, zt, re; overlap_region t, *z; ul_ov_t p, *sa; int64_t npc;
	uint64_t q0l, t0l, e0l, q1l, t1l, e1l, mm, occ[3];
	b0->n = b1->n = 0; 
	
	mk->srt.n = mk->idx.n = 0;
	gen_src_shared_interval_adv(rid, udb->ug, &(mk->srt));
	kv_resize(uint64_t, mk->idx, ol->length);
	for (k = 0; k < ol->length; k++) {
		kv_push(uint64_t, mk->idx, (((uint64_t)ol->list[k].y_id)<<32)|((uint64_t)k));
	}
	radix_sort_gfa64(mk->idx.a, mk->idx.a+mk->idx.n);
	for (i = si = b0->n = 0, occ[0] = occ[1] = occ[2] = 0; i < mk->idx.n; i++) {
		k = (uint32_t)mk->idx.a[i];
		z = &(ol->list[k]);
		overlap_region2ul_ov_t(z, &p, udb->ug->u.a[z->y_id].len);
		if(((p.qe-p.qs) >= minov) && ((p.te-p.ts) >= minov)) {
			if(!trans_ovlp_connect(&p, udb->ug)) continue;//could be eaisly detected
			if(p.sec == 0) {///no error
				zt = ((uint32_t)-1); zt <<= 32; zt |= (i<<1); occ[2]++;
				kv_push(uint64_t, *b0, zt); continue;
			}
			sa = get_mask_interval(&p, &(mk->srt), &si, udb->ug->u.a[p.qn].len, udb->ug->u.a[p.tn].len, &sn, &skip_n);
			re = cal_exact_batch(z, sa, sn, udb->ug->u.a[p.tn].len, &q0l, &t0l, &e0l, &q1l, &t1l, &e1l, udb->ug);
			if(!re) {//no unmask errors
				zt = ((uint32_t)-1); zt <<= 32; zt |= (i<<1); occ[2]++;
				kv_push(uint64_t, *b0, zt); continue;
			}

			mm = ((re <= maxe)?((uint64_t)(0x8000000000000000)):(0));
			///left end
			if(q0l >= minov && t0l >= minov) {
				zt = MIN(q0l, t0l); zt <<= 32; zt |= (i<<1); zt |= mm; occ[!!mm]++;
				kv_push(uint64_t, *b0, zt);
			}

			///right end
			if(q1l >= minov && t1l >= minov) {
				zt = MIN(q1l, t1l); zt <<= 32; zt |= (i<<1); zt += 1; zt |= mm; occ[!!mm]++;
				kv_push(uint64_t, *b0, zt);
			}
		}
	}

	// radix_sort_gfa64(b0->a, b0->a+b0->n);
	// uint64_t *a0, *a1, *a2, a0n, a1n, a2n;
	// a2 = b0->a; a2n = occ[0];
	// a1 = a2 + a2n; a1n = occ[1];
	// a0 = a1 + a1n; a0n = occ[2];
	

	fprintf(stderr, "\n[M::%s]\tutg%.6lu%c\t#s::%u\n", __func__, rid+1, "lc"[udb->ug->u.a[rid].circ], (uint32_t)mk->srt.n);
	for (k = 0; k < mk->srt.n; k++) {
		fprintf(stderr, "[M::%s]\tutg%.6u%c\tq::[%u,\t%u)\t%c\tutg%.6u%c\tt::[%u,\t%u)\n", __func__, 
		mk->srt.a[k].qn+1, "lc"[udb->ug->u.a[mk->srt.a[k].qn].circ], mk->srt.a[k].qs, mk->srt.a[k].qe, "+-"[mk->srt.a[k].rev],
		mk->srt.a[k].tn+1, "lc"[udb->ug->u.a[mk->srt.a[k].tn].circ], mk->srt.a[k].ts, mk->srt.a[k].te);
	}



	for (k = m = 0; k < ol->length; k++) {
		z = &(ol->list[k]); 
		if(z->non_homopolymer_errors == 0) continue;
		p.qn = rid; p.tn = ol->list[k].y_id; p.el = 1; 
        p.sec = ol->list[k].non_homopolymer_errors; 
        p.rev = ol->list[k].y_pos_strand;
        p.qs = ol->list[k].x_pos_s; p.qe = ol->list[k].x_pos_e+1;
		if(p.rev) {
			p.ts = udb->ug->u.a[p.tn].len - (ol->list[k].y_pos_e+1); 
			p.te = udb->ug->u.a[p.tn].len - ol->list[k].y_pos_s;
		} else {
			p.ts = ol->list[k].y_pos_s; 
			p.te = ol->list[k].y_pos_e+1;
		}
		// gen_shared_interval(&p, udb->ug, bl);
		// gen_shared_interval_adv(&p, udb->ug, bl);
		// if(!trans_ovlp_connect(&p, udb->ug)) continue;
		// assert(z->x_id == rid);
		// if(!get_high_simi(z, erate, maxe, minov, &e0, &e1)) continue;
		npc = cal_npc_err(z, p.qs, p.qe, hre, udb->ug->u.a[p.tn].len);
		if(npc == INT32_MAX || npc < 0) continue;
		if(((uint64_t)npc <= maxe) && ((uint64_t)npc <= ((p.qe - p.qs)*erate)) && ((uint64_t)npc <= ((p.te - p.ts)*erate))) {
			;
		} else if(((uint64_t)npc > maxe) && ((p.qe - p.qs) > minov) && ((p.te - p.ts) > minov)) {
			;
		}
		
		// if((z->x_id == 44 && z->y_id == 45) || (z->x_id == 45 && z->y_id == 44)) 
		// if(npc <= 4)
		{
			// int64_t nnpc;
			// nnpc = cal_npc_err(z, p.qs, p.qe, NULL, udb->ug->u.a[p.tn].len);
			// fprintf(stderr, "[M::%s]\tutg%.6u%c->utg%.6u%c\terr::%u\tnpc::%ld\t#s::%u\n", __func__, p.qn+1, "lc"[udb->ug->u.a[p.qn].circ], 
			// 	p.tn+1, "lc"[udb->ug->u.a[p.tn].circ], ol->list[k].non_homopolymer_errors, npc, (uint32_t)bl->n);
			// uint64_t t;
			// for (t = 0; t < bl->n; t++) {
			// 	fprintf(stderr, "[M::%s]\tutg%.6u%c\tq::[%u,\t%u)\t%c\tutg%.6u%c\tt::[%u,\t%u)\n", __func__, 
			// 	bl->a[t].qn+1, "lc"[udb->ug->u.a[bl->a[t].qn].circ], bl->a[t].qs, bl->a[t].qe, "+-"[bl->a[t].rev],
			// 	bl->a[t].tn+1, "lc"[udb->ug->u.a[bl->a[t].tn].circ], bl->a[t].ts, bl->a[t].te);
			// }
		}
		
		if(k != m) {
			t = ol->list[k];
			ol->list[k] = ol->list[m];
			ol->list[m] = t;
		}
		m++;
	}
	ol->length = m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq %rdx, -0x30(%rbp)
movsd %xmm0, -0x38(%rbp)
movq %rcx, -0x40(%rbp)
movq %r8, -0x48(%rbp)
movq %r9, -0x50(%rbp)
movq 0x18(%rbp), %rax
movq $0x0, (%rax)
movq 0x10(%rbp), %rax
movq $0x0, (%rax)
movq 0x20(%rbp), %rax
movq $0x0, (%rax)
movq 0x20(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x50(%rbp), %rax
movl %eax, %edi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
movq 0x20(%rbp), %rdx
addq $0x18, %rdx
callq 0x2c60e0
movq 0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x2ca431
movq -0x20(%rbp), %rax
movq 0x10(%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 0x2360
movq %rax, %rcx
movq 0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x2ca433
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x2ca50f
jmp 0x2ca44f
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2ca4c0
movq 0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2ca47f
movq 0x20(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1c8(%rbp)
jmp 0x2ca48d
movl $0x2, %eax
movq %rax, -0x1c8(%rbp)
jmp 0x2ca48d
movq -0x1c8(%rbp), %rcx
movq 0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x20(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, %edx
shlq $0x20, %rdx
orq -0x58(%rbp), %rdx
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x2ca4fe
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x2ca43b
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movq 0x20(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x27a9b0
movq 0x10(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x1b0(%rbp)
movq $0x0, -0x1b8(%rbp)
movq $0x0, -0x1c0(%rbp)
movq -0x60(%rbp), %rax
movq 0x20(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x2cac0f
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq -0x140(%rbp), %rcx
movl 0x10(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edx
leaq -0x15c(%rbp), %rsi
callq 0x30d310
movl -0x154(%rbp), %eax
subl -0x158(%rbp), %eax
movl %eax, %eax
cmpq -0x48(%rbp), %rax
jb 0x2cabfc
movl -0x148(%rbp), %eax
subl -0x14c(%rbp), %eax
movl %eax, %eax
cmpq -0x48(%rbp), %rax
jb 0x2cabfc
movq -0x28(%rbp), %rax
movq (%rax), %rsi
leaq -0x15c(%rbp), %rdi
callq 0x2bbdc0
cmpl $0x0, %eax
jne 0x2ca635
jmp 0x2cabfe
movl -0x144(%rbp), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
cmpl $0x0, %eax
jne 0x2ca728
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x88(%rbp)
movq -0x60(%rbp), %rax
shlq %rax
orq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x1b0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1b0(%rbp)
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2ca6ff
movq 0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2ca6be
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1d0(%rbp)
jmp 0x2ca6cc
movl $0x2, %eax
movq %rax, -0x1d0(%rbp)
jmp 0x2ca6cc
movq -0x1d0(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x88(%rbp), %rdx
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x2cabfe
movq 0x20(%rbp), %rsi
addq $0x18, %rsi
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl -0x15c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl -0x150(%rbp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %r8d
leaq -0x15c(%rbp), %rdi
leaq -0x70(%rbp), %rdx
leaq -0x78(%rbp), %r9
leaq -0x80(%rbp), %rax
movq %rax, (%rsp)
callq 0x2c8ce0
movq %rax, -0x168(%rbp)
movq -0x140(%rbp), %rdi
movq -0x168(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl -0x150(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movq (%rax), %rax
leaq -0x178(%rbp), %r8
leaq -0x180(%rbp), %r9
leaq -0x188(%rbp), %r14
leaq -0x190(%rbp), %rbx
leaq -0x198(%rbp), %r11
leaq -0x1a0(%rbp), %r10
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x2c9500
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0x2ca911
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x88(%rbp)
movq -0x60(%rbp), %rax
shlq %rax
orq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x1b0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1b0(%rbp)
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2ca8e8
movq 0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2ca8a7
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1d8(%rbp)
jmp 0x2ca8b5
movl $0x2, %eax
movq %rax, -0x1d8(%rbp)
jmp 0x2ca8b5
movq -0x1d8(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x88(%rbp), %rdx
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x2cabfe
movq -0x90(%rbp), %rdx
movq -0x40(%rbp), %rsi
xorl %eax, %eax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
cmpq %rsi, %rdx
cmovbeq %rcx, %rax
movq %rax, -0x1a8(%rbp)
movq -0x178(%rbp), %rax
cmpq -0x48(%rbp), %rax
jb 0x2caa8f
movq -0x180(%rbp), %rax
cmpq -0x48(%rbp), %rax
jb 0x2caa8f
movq -0x178(%rbp), %rax
cmpq -0x180(%rbp), %rax
ja 0x2ca978
movq -0x178(%rbp), %rax
movq %rax, -0x1e0(%rbp)
jmp 0x2ca986
movq -0x180(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x88(%rbp)
movq -0x60(%rbp), %rax
shlq %rax
orq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x1a8(%rbp), %rax
orq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x1a8(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movq -0x1c0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0x1c0(%rbp,%rax,8)
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2caa69
movq 0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2caa28
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1e8(%rbp)
jmp 0x2caa36
movl $0x2, %eax
movq %rax, -0x1e8(%rbp)
jmp 0x2caa36
movq -0x1e8(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x88(%rbp), %rdx
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x2caa8f
movq -0x190(%rbp), %rax
cmpq -0x48(%rbp), %rax
jb 0x2cabfa
movq -0x198(%rbp), %rax
cmpq -0x48(%rbp), %rax
jb 0x2cabfa
movq -0x190(%rbp), %rax
cmpq -0x198(%rbp), %rax
ja 0x2caad1
movq -0x190(%rbp), %rax
movq %rax, -0x1f0(%rbp)
jmp 0x2caadf
movq -0x198(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movq -0x1f0(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x88(%rbp)
movq -0x60(%rbp), %rax
shlq %rax
orq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
movq -0x1a8(%rbp), %rax
orq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x1a8(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movq -0x1c0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0x1c0(%rbp,%rax,8)
movq 0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2cabd4
movq 0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2cab93
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1f8(%rbp)
jmp 0x2caba1
movl $0x2, %eax
movq %rax, -0x1f8(%rbp)
jmp 0x2caba1
movq -0x1f8(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x10(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x88(%rbp), %rdx
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x2cabfa
jmp 0x2cabfc
jmp 0x2cabfe
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x2ca56e
movq 0xf93ca(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movq -0x50(%rbp), %rcx
addq $0x1, %rcx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x50(%rbp), %rdx
addq %rdx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0xba6bf(%rip), %rax     # 0x385303
movsbl (%rax,%rdx), %r8d
movq 0x20(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %r9d
leaq 0xc7e42(%rip), %rsi     # 0x392a9d
leaq 0xc7e57(%rip), %rdx     # 0x392ab9
movb $0x0, %al
callq 0x22a0
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq 0x20(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x2cade1
movq 0xf9356(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
imulq $0x1c, -0x58(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x20(%rbp), %rdx
movq 0x18(%rdx), %rdx
imulq $0x1c, -0x58(%rbp), %rsi
addq %rsi, %rdx
movl (%rdx), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0xba62d(%rip), %rax     # 0x385303
movsbl (%rax,%rdx), %r8d
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
imulq $0x1c, -0x58(%rbp), %rdx
addq %rdx, %rax
movl 0x4(%rax), %r9d
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
imulq $0x1c, -0x58(%rbp), %rdx
addq %rdx, %rax
movl 0x8(%rax), %r15d
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
imulq $0x1c, -0x58(%rbp), %rdx
addq %rdx, %rax
movl 0x18(%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0xb8177(%rip), %rax     # 0x382e9b
movsbl (%rax,%rdx), %r14d
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
imulq $0x1c, -0x58(%rbp), %rdx
addq %rdx, %rax
movl 0xc(%rax), %ebx
addl $0x1, %ebx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x20(%rbp), %rdx
movq 0x18(%rdx), %rdx
imulq $0x1c, -0x58(%rbp), %rsi
addq %rsi, %rdx
movl 0xc(%rdx), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %edx
leaq 0xba58f(%rip), %rax     # 0x385303
movsbl (%rax,%rdx), %r11d
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
imulq $0x1c, -0x58(%rbp), %rdx
addq %rdx, %rax
movl 0x10(%rax), %r10d
movq 0x20(%rbp), %rax
movq 0x18(%rax), %rax
imulq $0x1c, -0x58(%rbp), %rdx
addq %rdx, %rax
movl 0x14(%rax), %eax
leaq 0xc7d26(%rip), %rsi     # 0x392acd
leaq 0xc7d0b(%rip), %rdx     # 0x392ab9
movl %r15d, (%rsp)
movl %r14d, 0x8(%rsp)
movl %ebx, 0x10(%rsp)
movl %r11d, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movb $0x0, %al
callq 0x22a0
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x2cac71
movq $0x0, -0x68(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x2cb19f
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x2cae2e
jmp 0x2cb18e
movq -0x50(%rbp), %rax
movl %eax, -0x15c(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x150(%rbp)
movl -0x144(%rbp), %eax
andl $0xbfffffff, %eax       # imm = 0xBFFFFFFF
orl $0x40000000, %eax       # imm = 0x40000000
movl %eax, -0x144(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x30(%rax), %ecx
movl -0x144(%rbp), %eax
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
andl $0xc0000000, %eax       # imm = 0xC0000000
orl %ecx, %eax
movl %eax, -0x144(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x1c(%rax), %ecx
movl -0x144(%rbp), %eax
andl $0x1, %ecx
shll $0x1f, %ecx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
orl %ecx, %eax
movl %eax, -0x144(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x158(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
movl -0x144(%rbp), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x2caf87
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl -0x150(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x58(%rbp), %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
addl $0x1, %ecx
subl %ecx, %eax
movl %eax, -0x14c(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl -0x150(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x58(%rbp), %rdx
addq %rdx, %rcx
subl 0x14(%rcx), %eax
movl %eax, -0x148(%rbp)
jmp 0x2cafc0
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movl %eax, -0x14c(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x58(%rbp), %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
addl $0x1, %eax
movl %eax, -0x148(%rbp)
movq -0x140(%rbp), %rdi
movl -0x158(%rbp), %eax
movl %eax, %esi
movl -0x154(%rbp), %eax
movl %eax, %edx
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl -0x150(%rbp), %r8d
imulq $0x28, %r8, %r8
addq %r8, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %r8d
callq 0x2c4370
movq %rax, -0x170(%rbp)
cmpq $0x7fffffff, -0x170(%rbp) # imm = 0x7FFFFFFF
je 0x2cb023
cmpq $0x0, -0x170(%rbp)
jge 0x2cb028
jmp 0x2cb18e
movq -0x170(%rbp), %rax
cmpq -0x40(%rbp), %rax
ja 0x2cb0cb
movaps 0xb6fd0(%rip), %xmm0    # 0x382010
movq -0x170(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0xb6fcc(%rip), %xmm0    # 0x382020
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movl -0x158(%rbp), %ecx
movl -0x154(%rbp), %eax
subl %ecx, %eax
cvtsi2sd %rax, %xmm0
mulsd -0x38(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x2cb0cb
movaps 0xb6f88(%rip), %xmm0    # 0x382010
movq -0x170(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0xb6f84(%rip), %xmm0    # 0x382020
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movl -0x14c(%rbp), %ecx
movl -0x148(%rbp), %eax
subl %ecx, %eax
cvtsi2sd %rax, %xmm0
mulsd -0x38(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x2cb0cb
jmp 0x2cb104
movq -0x170(%rbp), %rax
cmpq -0x40(%rbp), %rax
jbe 0x2cb102
movl -0x154(%rbp), %eax
subl -0x158(%rbp), %eax
movl %eax, %eax
cmpq -0x48(%rbp), %rax
jbe 0x2cb102
movl -0x148(%rbp), %eax
subl -0x14c(%rbp), %eax
movl %eax, %eax
cmpq -0x48(%rbp), %rax
jbe 0x2cb102
jmp 0x2cb102
jmp 0x2cb104
movq -0x58(%rbp), %rax
cmpq -0x68(%rbp), %rax
je 0x2cb182
movq -0x20(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x58(%rbp), %rax
addq %rax, %rsi
leaq -0x138(%rbp), %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x20(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x68(%rbp), %rax
addq %rax, %rsi
movq -0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x58(%rbp), %rax
addq %rax, %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x68(%rbp), %rax
addq %rax, %rdi
leaq -0x138(%rbp), %rsi
movl $0xa8, %edx
callq 0x2180
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x2cadf1
movq -0x68(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)