// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/rcut.cpp
// Function: update_mc_edges(mc_g_t*, hap_overlaps_list*, kv_u_trans_t*, trans_chain*, double, unsigned int)
void update_mc_edges(mc_g_t *mg, hap_overlaps_list* ha, kv_u_trans_t *ta, trans_chain* t_ch, double f_rate, uint32_t is_sys)
{
	uint32_t v, i, k, qn, tn, qs, qe, ts, te, occ, as, ae, l, offset, l_pos;
	uint64_t hetLen, homLen, oLen;
	mc_interval_t *a = NULL;
	mc_edge_t *ma = NULL;
	asg_t* nsg = mg->ug->g;
	ma_utg_t *u = NULL;
	mc_interval_t *t = NULL;

	kvec_t(mc_interval_t) p; kv_init(p);
	kvec_t(uint32_t) p_idx; kv_init(p_idx);
	if(t_ch)
	{
		kv_push(uint32_t, p_idx, 0);
		for (v = 0; v < nsg->n_seq; v++)
		{
			u = &(mg->ug->u.a[v]);
			for (k = 1, l = 0, offset = 0, l_pos = 0; k <= u->n; ++k) 
			{   
				if (k == u->n || t_ch->ir_het[u->a[k]>>33] != t_ch->ir_het[u->a[l]>>33])
				{
					kv_pushp(mc_interval_t, p, &t);
					t->uID = v;
					t->hs = t_ch->ir_het[u->a[l]>>33];

					t->bS = l_pos;
					t->bE = offset + mg->rg->seq[u->a[k-1]>>33].len - 1;

					t->nS = l;
					t->nE = k - 1;
					l = k;
					l_pos = offset + (uint32_t)u->a[k-1];
				}
				offset += (uint32_t)u->a[k-1];
			}
			kv_push(uint32_t, p_idx, p.n);
		}

		///debug_mc_interval_t(p.a, p.n, p_idx.a, mg->ug, mg->rg, t_ch);
	}

	if(!mg->e)
	{
		CALLOC(mg->e, 1);
		mg->e->n_seq = mg->ug->g->n_seq;
		kv_init(mg->e->idx); kv_init(mg->e->ma); 
	}

	if(ha)
	{
		for (v = 0; v < ha->num; v++)
		{
			for (i = 0; i < ha->x[v].a.n; i++)
			{
				if(ha->x[v].a.a[i].score <= 0) continue;
				if(ha->x[v].a.a[i].xUid == ha->x[v].a.a[i].yUid) continue;
				if(p.n > 0 && p_idx.n > 0)
				{
					/*****************qn*****************/
					qn = ha->x[v].a.a[i].xUid;
					qs = ha->x[v].a.a[i].x_beg_pos;
					qe = ha->x[v].a.a[i].x_end_pos - 1;

					a = p.a + p_idx.a[qn]; 
					occ = p_idx.a[qn+1] - p_idx.a[qn];
					for (k = 0, hetLen = 0, homLen = 0; k < occ; k++)
					{
						as = a[k].bS;
						ae = a[k].bE;
						oLen = ((MIN(qe, ae) >= MAX(qs, as))? MIN(qe, ae) - MAX(qs, as) + 1 : 0);
						if(homLen + hetLen > 0 && oLen == 0) break;
						if(oLen == 0) continue;
						if(a[k].hs == N_HET)
						{
							homLen += oLen;
						} 
						else if(asm_opt.polyploidy <= 2 && (a[k].hs&P_HET))///if(asm_opt.polyploidy <= 2 && (a[k].hs&S_HET))
						{
							homLen += oLen;
						}
						else
						{
							hetLen += oLen;
						}                
					}

					if(hetLen <= ((hetLen + homLen)*f_rate)) continue;
					/*****************qn*****************/


					/*****************tn*****************/
					tn = ha->x[v].a.a[i].yUid;
					ts = ha->x[v].a.a[i].y_beg_pos;
					te = ha->x[v].a.a[i].y_end_pos - 1;

					a = p.a + p_idx.a[tn]; 
					occ = p_idx.a[tn+1] - p_idx.a[tn];
					for (k = 0, hetLen = 0, homLen = 0; k < occ; k++)
					{
						as = a[k].bS;
						ae = a[k].bE;
						oLen = ((MIN(te, ae) >= MAX(ts, as))? MIN(te, ae) - MAX(ts, as) + 1 : 0);
						if(homLen + hetLen > 0 && oLen == 0) break;
						if(oLen == 0) continue;
						if(a[k].hs == N_HET)
						{
							homLen += oLen;
						} 
						else if(asm_opt.polyploidy <= 2 && (a[k].hs&P_HET))///if(asm_opt.polyploidy <= 2 && (a[k].hs&S_HET))
						{
							homLen += oLen;
						}
						else
						{
							hetLen += oLen;
						}                 
					}

					if(hetLen <= ((hetLen + homLen)*f_rate)) continue;
					/*****************tn*****************/
				}
				kv_pushp(mc_edge_t, mg->e->ma, &ma);
				ma->x = (uint64_t)ha->x[v].a.a[i].xUid << 32 | ha->x[v].a.a[i].yUid;
				ma->w = ha->x[v].a.a[i].score;
			}
		}
	}

	if(ta)
	{
		// double sc = get_w_scale(ta);
		// fprintf(stderr, "sc: %f\n", sc);
		for (i = 0; i < ta->n; ++i)
		{
			if(ta->a[i].del) continue;
			if(p.n > 0 && p_idx.n > 0)
			{
				/*****************qn*****************/
				qn = ta->a[i].qn;
				qs = ta->a[i].qs;
				qe = ta->a[i].qe - 1;

				a = p.a + p_idx.a[qn]; 
				occ = p_idx.a[qn+1] - p_idx.a[qn];
				for (k = 0, hetLen = 0, homLen = 0; k < occ; k++)
				{
					as = a[k].bS;
					ae = a[k].bE;
					oLen = ((MIN(qe, ae) >= MAX(qs, as))? MIN(qe, ae) - MAX(qs, as) + 1 : 0);
					if(homLen + hetLen > 0 && oLen == 0) break;
					if(oLen == 0) continue;
					if(a[k].hs == N_HET)
					{
						homLen += oLen;
					} 
					else if(asm_opt.polyploidy <= 2 && (a[k].hs&P_HET))///if(asm_opt.polyploidy <= 2 && (a[k].hs&S_HET))
					{
						homLen += oLen;
					}
					else
					{
						hetLen += oLen;
					}                
				}

				if(hetLen <= ((hetLen + homLen)*f_rate)) continue;
				/*****************qn*****************/

				/*****************tn*****************/
				tn = ta->a[i].tn;
				ts = ta->a[i].ts;
				te = ta->a[i].te - 1;

				a = p.a + p_idx.a[tn]; 
				occ = p_idx.a[tn+1] - p_idx.a[tn];
				for (k = 0, hetLen = 0, homLen = 0; k < occ; k++)
				{
					as = a[k].bS;
					ae = a[k].bE;
					oLen = ((MIN(te, ae) >= MAX(ts, as))? MIN(te, ae) - MAX(ts, as) + 1 : 0);
					if(homLen + hetLen > 0 && oLen == 0) break;
					if(oLen == 0) continue;
					if(a[k].hs == N_HET)
					{
						homLen += oLen;
					} 
					else if(asm_opt.polyploidy <= 2 && (a[k].hs&P_HET))///if(asm_opt.polyploidy <= 2 && (a[k].hs&S_HET))
					{
						homLen += oLen;
					}
					else
					{
						hetLen += oLen;
					}                 
				}

				if(hetLen <= ((hetLen + homLen)*f_rate)) continue;
				/*****************tn*****************/
			}
			kv_pushp(mc_edge_t, mg->e->ma, &ma);
			ma->x = (uint64_t)ta->a[i].qn << 32 | ta->a[i].tn;
			// ma->w = w_cast((ta->a[i].nw*sc));
			ma->w = w_cast((ta->a[i].nw));
		}
	}

	for (i = k = 0; i < mg->e->ma.n; i++)
    {
		if(mg->e->ma.a[i].w == 0) continue;
		mg->e->ma.a[k] = mg->e->ma.a[i];
        k++;
    }
    mg->e->ma.n = k;
	
	radix_sort_mce(mg->e->ma.a, mg->e->ma.a + mg->e->ma.n);
	mc_merge_dup(mg);
	mc_edges_idx(mg->e);
	if(is_sys) mc_edges_symm(mg->e);
	kv_destroy(p); kv_destroy(p_idx);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r8d, 0x54(%rsp)
movsd %xmm0, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
testq %rcx, %rcx
movq %rdi, (%rsp)
movq %rcx, 0x40(%rsp)
movq %rsi, 0x18(%rsp)
je 0x162603
movq %rcx, %r14
movq 0x18(%rdi), %rax
movq 0x18(%rax), %rbx
movl $0x8, %edi
callq 0x2280
movq %rax, %r12
movl $0x0, (%rax)
movq %rbx, 0x58(%rsp)
testl $0x7fffffff, 0x14(%rbx) # imm = 0x7FFFFFFF
je 0x16261a
movl $0x1, %r15d
xorl %r9d, %r9d
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movl $0x2, %ecx
xorl %r10d, %r10d
xorl %r11d, %r11d
xorl %r8d, %r8d
movq (%rsp), %rdi
movq %rcx, 0x60(%rsp)
movq %r15, 0x10(%rsp)
movq %r12, 0x28(%rsp)
movq 0x18(%rdi), %rax
movq 0x10(%rax), %rcx
leaq (%r9,%r9,4), %rdx
movl 0x10(%rcx,%rdx,8), %eax
testl %eax, %eax
je 0x16256e
leaq (%rcx,%rdx,8), %rbp
movl $0x1, %ebx
movq $0x0, 0x20(%rsp)
xorl %r12d, %r12d
xorl %esi, %esi
movq %rbp, 0x48(%rsp)
movl %esi, %r15d
cmpl %eax, %ebx
je 0x162498
movq 0x10(%r14), %rax
movq 0x18(%rbp), %rcx
movl %ebx, %edx
movq (%rcx,%rdx,8), %rdx
shrq $0x21, %rdx
movb (%rax,%rdx), %dl
movq (%rcx,%r15,8), %rcx
shrq $0x21, %rcx
cmpb (%rax,%rcx), %dl
je 0x162556
movl %esi, 0x8(%rsp)
cmpq %r11, %r10
jne 0x1624eb
leaq (%r11,%r11), %r14
testq %r11, %r11
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %rsi
movq %r8, %rdi
movq %r9, %r13
movq %r10, %rbp
callq 0x2370
movq %rbp, %r10
movq 0x48(%rsp), %rbp
movq %r13, %r9
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movq (%rsp), %rdi
movq %rax, %r8
movq %r14, %r11
movq 0x40(%rsp), %r14
leaq (%r10,%r10,2), %rax
incq %r10
movl %r9d, 0x10(%r8,%rax,8)
movq 0x10(%r14), %rcx
movq 0x18(%rbp), %rdx
movq (%rdx,%r15,8), %rsi
shrq $0x21, %rsi
movb (%rcx,%rsi), %cl
movb %cl, 0x14(%r8,%rax,8)
movq 0x20(%rsp), %rcx
movl %ecx, (%r8,%rax,8)
movq 0x20(%rdi), %rcx
movq 0x20(%rcx), %rcx
leal -0x1(%rbx), %esi
movq (%rdx,%rsi,8), %r15
movq %r15, %rdx
shrq $0x21, %rdx
movl (%rcx,%rdx,8), %ecx
andl %r13d, %ecx
addl %r12d, %ecx
decl %ecx
movl %ecx, 0x4(%r8,%rax,8)
movl 0x8(%rsp), %ecx
movl %ecx, 0x8(%r8,%rax,8)
movl %esi, 0xc(%r8,%rax,8)
addl %r12d, %r15d
movq %r15, 0x20(%rsp)
movl %ebx, %esi
movq 0x18(%rbp), %rax
leal -0x1(%rbx), %ecx
addl (%rax,%rcx,8), %r12d
incl %ebx
movl 0x10(%rbp), %eax
cmpl %eax, %ebx
jbe 0x16246b
movq 0x10(%rsp), %r15
movq 0x60(%rsp), %rcx
cmpq %rcx, %r15
jne 0x1625cc
leaq (%rcx,%rcx), %rbx
testq %rcx, %rcx
movl $0x2, %eax
cmoveq %rax, %rbx
leaq (,%rbx,4), %rsi
movq 0x28(%rsp), %rdi
movq %r8, %r14
movq %r9, %r12
movq %r10, 0x20(%rsp)
movq %r11, %rbp
callq 0x2370
movq %rbp, %r11
movq 0x20(%rsp), %r10
movq %r12, %r9
movq %r14, %r8
movq 0x40(%rsp), %r14
movq (%rsp), %rdi
movq %rax, %r12
movq %rbx, %rcx
jmp 0x1625d1
movq 0x28(%rsp), %r12
movl %r10d, (%r12,%r15,4)
incq %r15
incq %r9
movq 0x58(%rsp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %r9
jb 0x162428
movq %r8, 0x8(%rsp)
testq %r10, %r10
setne %al
movq %rax, 0x10(%rsp)
jmp 0x162630
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
xorl %r12d, %r12d
jmp 0x162635
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
cmpq $0x0, 0x28(%rdi)
jne 0x16267d
movl $0x1, %edi
movl $0x40, %esi
callq 0x2120
movq 0x18(%rsp), %rsi
movq (%rsp), %rdi
movq %rax, 0x28(%rdi)
movq 0x18(%rdi), %rcx
movq 0x18(%rcx), %rcx
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl 0x14(%rcx), %edx
movl %edx, 0x38(%rax)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
testq %rsi, %rsi
movq %r12, 0x28(%rsp)
je 0x1629ad
cmpl $0x0, 0x8(%rsi)
je 0x1629ad
cmpq $0x0, 0x40(%rsp)
setne %al
andb 0x10(%rsp), %al
movb %al, 0x20(%rsp)
xorl %ecx, %ecx
movq 0xc2b90(%rip), %xmm3    # 0x225240
movapd 0xc2b98(%rip), %xmm4    # 0x225250
movq (%rsi), %rax
movq %rcx, 0x48(%rsp)
leaq (%rcx,%rcx,2), %r13
cmpq $0x0, (%rax,%r13,8)
je 0x162999
xorl %r15d, %r15d
xorl %ebp, %ebp
xorl %r14d, %r14d
movq 0x10(%rax,%r13,8), %rcx
shlq $0x6, %rbp
cmpq $0x0, 0x30(%rcx,%rbp)
jle 0x162986
addq %rbp, %rcx
movl 0x24(%rcx), %edx
cmpl 0x28(%rcx), %edx
je 0x162986
cmpb $0x0, 0x20(%rsp)
je 0x1628ed
movl (%r12,%rdx,4), %r9d
incl %edx
movl (%r12,%rdx,4), %esi
subl %r9d, %esi
jne 0x16271e
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x1627a4
movl 0x4(%rcx), %edi
movl 0x8(%rcx), %r8d
decl %r8d
leaq (%r9,%r9,2), %rcx
movq 0x8(%rsp), %rdx
leaq (%rdx,%rcx,8), %r9
leaq 0x12801c(%rip), %rcx    # 0x28a758
movl 0x1bc(%rcx), %r10d
xorl %ecx, %ecx
xorl %edx, %edx
movl (%r9), %r11d
movl 0x4(%r9), %ebx
cmpl %ebx, %r8d
cmovbl %r8d, %ebx
cmpl %r11d, %edi
cmoval %edi, %r11d
subl %r11d, %ebx
leal 0x1(%rbx), %r11d
cmovbl %r15d, %r11d
movq %rcx, %rbx
addq %rdx, %rbx
setne %bl
testl %r11d, %r11d
sete %r12b
testb %r12b, %bl
jne 0x1627a4
testq %r11, %r11
je 0x16279c
movb 0x14(%r9), %bl
testb %bl, %bl
je 0x162794
testb $0x2, %bl
je 0x162799
cmpl $0x2, %r10d
jg 0x162799
addq %r11, %rcx
jmp 0x16279c
addq %r11, %rdx
addq $0x18, %r9
decl %esi
jne 0x162747
movq %rdx, %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm4, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addq %rdx, %rcx
movq %rcx, %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm4, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
mulsd 0x38(%rsp), %xmm2
ucomisd %xmm1, %xmm2
movq (%rsp), %rdi
movq 0x28(%rsp), %r12
movq 0x18(%rsp), %rsi
jae 0x162986
movq 0x10(%rax,%r13,8), %rax
movl 0x28(%rax,%rbp), %edx
movl (%r12,%rdx,4), %ecx
incl %edx
movl (%r12,%rdx,4), %edx
subl %ecx, %edx
jne 0x162817
xorl %ecx, %ecx
xorl %eax, %eax
jmp 0x16289f
movl 0xc(%rax,%rbp), %esi
movl 0x10(%rax,%rbp), %edi
decl %edi
leaq (%rcx,%rcx,2), %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %r8
leaq 0x127f23(%rip), %rax    # 0x28a758
movl 0x1bc(%rax), %r9d
xorl %eax, %eax
xorl %ecx, %ecx
movl (%r8), %r10d
movl 0x4(%r8), %r11d
cmpl %r11d, %edi
cmovbl %edi, %r11d
cmpl %r10d, %esi
cmoval %esi, %r10d
subl %r10d, %r11d
leal 0x1(%r11), %r10d
cmovbl %r15d, %r10d
movq %rax, %r11
addq %rcx, %r11
setne %r11b
testl %r10d, %r10d
sete %bl
testb %bl, %r11b
jne 0x16289f
testq %r10, %r10
je 0x162897
movb 0x14(%r8), %r11b
testb %r11b, %r11b
je 0x16288f
testb $0x2, %r11b
je 0x162894
cmpl $0x2, %r9d
jg 0x162894
addq %r10, %rax
jmp 0x162897
addq %r10, %rcx
addq $0x18, %r8
decl %edx
jne 0x162840
movq %rcx, %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm4, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addq %rcx, %rax
movq %rax, %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm4, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
mulsd 0x38(%rsp), %xmm2
ucomisd %xmm1, %xmm2
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
jae 0x162986
movq 0x28(%rdi), %rax
movq 0x20(%rax), %rcx
cmpq %rcx, 0x18(%rax)
jne 0x16293d
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x20(%rax)
movq 0x28(%rax), %rdi
shlq $0x4, %rsi
callq 0x2370
movapd 0xc292c(%rip), %xmm4    # 0x225250
movq 0xc2914(%rip), %xmm3    # 0x225240
movq 0x18(%rsp), %rsi
movq (%rsp), %rdi
movq 0x28(%rdi), %rcx
movq %rax, 0x28(%rcx)
movq 0x28(%rdi), %rax
movq 0x18(%rax), %rcx
movq 0x28(%rax), %rdx
leaq 0x1(%rcx), %r8
movq %r8, 0x18(%rax)
shlq $0x4, %rcx
movq (%rsi), %rax
movq 0x10(%rax,%r13,8), %rax
movl 0x24(%rax,%rbp), %esi
movl 0x28(%rax,%rbp), %r8d
shlq $0x20, %rsi
orq %rsi, %r8
movq %r8, (%rdx,%rcx)
movq 0x18(%rsp), %rsi
xorps %xmm0, %xmm0
cvtsi2sdq 0x30(%rax,%rbp), %xmm0
movsd %xmm0, 0x8(%rdx,%rcx)
incl %r14d
movq (%rsi), %rax
movq %r14, %rbp
cmpq %r14, (%rax,%r13,8)
ja 0x1626d7
movq 0x48(%rsp), %rcx
incq %rcx
movl 0x8(%rsi), %eax
cmpq %rax, %rcx
jb 0x1626b8
movq 0x30(%rsp), %rdx
testq %rdx, %rdx
je 0x162c92
cmpq $0x0, (%rdx)
je 0x162c92
cmpq $0x0, 0x40(%rsp)
setne %al
movq 0x10(%rsp), %rcx
andb %al, %cl
movq %rcx, 0x10(%rsp)
xorl %ebx, %ebx
movq 0xc285c(%rip), %xmm3    # 0x225240
movapd 0xc2864(%rip), %xmm4    # 0x225250
leaq 0x127d65(%rip), %r14    # 0x28a758
xorl %ecx, %ecx
xorl %r13d, %r13d
movq 0x10(%rdx), %rax
leaq (%rcx,%rcx,2), %rbp
shlq $0x4, %rbp
cmpb $0x0, 0x28(%rax,%rbp)
js 0x162c83
cmpb $0x0, 0x10(%rsp)
je 0x162bf4
addq %rbp, %rax
movl 0x8(%rax), %edx
movl (%r12,%rdx,4), %ecx
incl %edx
movl (%r12,%rdx,4), %esi
subl %ecx, %esi
jne 0x162a37
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x162ab9
movl (%rax), %edi
movl 0x4(%rax), %r8d
decl %r8d
leaq (%rcx,%rcx,2), %rcx
movq 0x8(%rsp), %rdx
leaq (%rdx,%rcx,8), %r9
movl 0x1bc(%r14), %r10d
xorl %ecx, %ecx
xorl %edx, %edx
movl (%r9), %r11d
movl 0x4(%r9), %r12d
cmpl %r12d, %r8d
cmovbl %r8d, %r12d
cmpl %r11d, %edi
cmoval %edi, %r11d
subl %r11d, %r12d
leal 0x1(%r12), %r11d
cmovbl %ebx, %r11d
movq %rcx, %r12
addq %rdx, %r12
setne %r12b
testl %r11d, %r11d
sete %r15b
testb %r15b, %r12b
jne 0x162ab9
testq %r11, %r11
je 0x162ab1
movb 0x14(%r9), %r12b
testb %r12b, %r12b
je 0x162aa9
testb $0x2, %r12b
je 0x162aae
cmpl $0x2, %r10d
jg 0x162aae
addq %r11, %rcx
jmp 0x162ab1
addq %r11, %rdx
addq $0x18, %r9
decl %esi
jne 0x162a58
movq %rdx, %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm4, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addq %rdx, %rcx
movq %rcx, %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm4, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
mulsd 0x38(%rsp), %xmm2
ucomisd %xmm1, %xmm2
movq (%rsp), %rdi
movq 0x28(%rsp), %r12
movq 0x30(%rsp), %rdx
jae 0x162c83
movl 0x14(%rax), %edx
movl (%r12,%rdx,4), %ecx
incl %edx
movl (%r12,%rdx,4), %edx
subl %ecx, %edx
jne 0x162b26
xorl %ecx, %ecx
xorl %eax, %eax
jmp 0x162ba6
movl 0xc(%rax), %esi
movl 0x10(%rax), %edi
decl %edi
leaq (%rcx,%rcx,2), %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %r8
movl 0x1bc(%r14), %r9d
xorl %eax, %eax
xorl %ecx, %ecx
movl (%r8), %r10d
movl 0x4(%r8), %r11d
cmpl %r11d, %edi
cmovbl %edi, %r11d
cmpl %r10d, %esi
cmoval %esi, %r10d
subl %r10d, %r11d
leal 0x1(%r11), %r10d
cmovbl %ebx, %r10d
movq %rax, %r11
addq %rcx, %r11
setne %r11b
testl %r10d, %r10d
sete %r15b
testb %r15b, %r11b
jne 0x162ba6
testq %r10, %r10
je 0x162b9e
movb 0x14(%r8), %r11b
testb %r11b, %r11b
je 0x162b96
testb $0x2, %r11b
je 0x162b9b
cmpl $0x2, %r9d
jg 0x162b9b
addq %r10, %rax
jmp 0x162b9e
addq %r10, %rcx
addq $0x18, %r8
decl %edx
jne 0x162b46
movq %rcx, %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm4, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addq %rcx, %rax
movq %rax, %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm4, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
mulsd 0x38(%rsp), %xmm2
ucomisd %xmm1, %xmm2
movq (%rsp), %rdi
movq 0x30(%rsp), %rdx
jae 0x162c83
movq 0x28(%rdi), %rax
movq 0x20(%rax), %rcx
cmpq %rcx, 0x18(%rax)
jne 0x162c3f
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x20(%rax)
movq 0x28(%rax), %rdi
shlq $0x4, %rsi
callq 0x2370
movapd 0xc2625(%rip), %xmm4    # 0x225250
movq 0xc260d(%rip), %xmm3    # 0x225240
movq (%rsp), %rdi
movq 0x28(%rdi), %rcx
movq %rax, 0x28(%rcx)
movq 0x28(%rdi), %rax
movq 0x18(%rax), %rcx
movq 0x28(%rax), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x18(%rax)
shlq $0x4, %rcx
movq 0x30(%rsp), %r9
movq 0x10(%r9), %rax
movl 0x8(%rax,%rbp), %esi
movl 0x14(%rax,%rbp), %r8d
shlq $0x20, %rsi
orq %rsi, %r8
movq %r8, (%rdx,%rcx)
movsd 0x20(%rax,%rbp), %xmm0
movsd %xmm0, 0x8(%rdx,%rcx)
movq %r9, %rdx
incl %r13d
movq %r13, %rcx
cmpq %r13, (%rdx)
ja 0x1629f8
movq 0x28(%rdi), %rcx
xorl %esi, %esi
cmpq $0x0, 0x18(%rcx)
je 0x162ce6
movl $0x1, %eax
xorpd %xmm0, %xmm0
xorl %edx, %edx
movq 0x28(%rcx), %rcx
shlq $0x4, %rdx
movsd 0x8(%rcx,%rdx), %xmm1
ucomisd %xmm0, %xmm1
jne 0x162cc0
jnp 0x162cd6
addq %rcx, %rdx
movl %esi, %r8d
shlq $0x4, %r8
movupd (%rdx), %xmm1
movupd %xmm1, (%rcx,%r8)
incl %esi
movl %eax, %edx
movq 0x28(%rdi), %rcx
incl %eax
cmpq %rdx, 0x18(%rcx)
ja 0x162caa
movl %esi, %esi
movq %rsi, 0x18(%rcx)
movq 0x28(%rcx), %rdi
shlq $0x4, %rsi
addq %rdi, %rsi
callq 0x160033
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x1607ec
movq 0x28(%rbx), %rdi
callq 0x16219e
cmpl $0x0, 0x54(%rsp)
je 0x162d1f
movq 0x28(%rbx), %rdi
callq 0x162057
movq 0x8(%rsp), %rdi
callq 0x2220
movq %r12, %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220