// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: gen_src_shared_interval_adv(unsigned int, ma_ug_t*, kv_ul_ov_t*)
void gen_src_shared_interval_adv(uint32_t src, ma_ug_t *ug, kv_ul_ov_t *res)
{
	uint32_t st, v, w, i, k, z, nv, nw, nz, rn; asg_arc_t *av, *aw, *az;
	ul_ov_t s1, s2, s3, s4, s5; rn = res->n; ///res->n = 0;

	st = src<<1; 
	v = st; av = asg_arc_a(ug->g, v); nv = asg_arc_n(ug->g, v);
	for (i = 0; i < nv; i++) {
        if(av[i].del) continue;
		if((av[i].v>>1) == (st>>1)) continue;
		w = av[i].v;
		cal_s_interval(ug, &(av[i]), &s1);
		if(s1.qn == src && s1.tn != src) kv_push(ul_ov_t, *res, s1);

		aw = asg_arc_a(ug->g, (w^1)); 
		nw = asg_arc_n(ug->g, (w^1));
		for (k = 0; k < nw; k++) {
			if(aw[k].del) continue;
			if((aw[k].v>>1) == (st>>1)) continue;

			cal_s_interval(ug, &(aw[k]), &s2);
			if(!cal_x_interval(ug, &s1, &s2, &s3)) continue;
			if(s3.qn == src && s3.tn != src) kv_push(ul_ov_t, *res, s3);

			az = asg_arc_a(ug->g, (aw[k].v^1)); 
			nz = asg_arc_n(ug->g, (aw[k].v^1));
			for (z = 0; z < nz; z++) {
				if(az[z].del) continue;
				cal_s_interval(ug, &(az[z]), &s4);
				if(!cal_x_interval(ug, &s3, &s4, &s5)) continue;
				if(s5.qn == src && s5.tn != src) kv_push(ul_ov_t, *res, s5);
			}
		}
    }

	st ^= 1; 
	v = st; av = asg_arc_a(ug->g, v); nv = asg_arc_n(ug->g, v);
	for (i = 0; i < nv; i++) {
        if(av[i].del) continue;
		if((av[i].v>>1) == (st>>1)) continue;
		w = av[i].v;
		cal_s_interval(ug, &(av[i]), &s1);
		if(s1.qn == src && s1.tn != src) kv_push(ul_ov_t, *res, s1);

		aw = asg_arc_a(ug->g, (w^1)); 
		nw = asg_arc_n(ug->g, (w^1));
		for (k = 0; k < nw; k++) {
			if(aw[k].del) continue;
			if((aw[k].v>>1) == (st>>1)) continue;

			cal_s_interval(ug, &(aw[k]), &s2);
			if(!cal_x_interval(ug, &s1, &s2, &s3)) continue;
			if(s3.qn == src && s3.tn != src) kv_push(ul_ov_t, *res, s3);

			az = asg_arc_a(ug->g, (aw[k].v^1)); 
			nz = asg_arc_n(ug->g, (aw[k].v^1));
			for (z = 0; z < nz; z++) {
				if(az[z].del) continue;
				cal_s_interval(ug, &(az[z]), &s4);
				if(!cal_x_interval(ug, &s3, &s4, &s5)) continue;
				if(s5.qn == src && s5.tn != src) kv_push(ul_ov_t, *res, s5);
			}
		}
    }

	radix_sort_ul_ov_srt_tn(res->a + rn, res->a + res->n);
	if(res->n > rn) {
		uint64_t os, oe, on, ovlpq, ovlpt, is_cov;
		for (k = rn + 1, i = rn; k <= res->n; k++) {
			if(k == res->n || res->a[k].tn != res->a[i].tn) {
				on = k - i;
				if(k - i > 1) {
					for (v = i; v < k; v++) {
						if(res->a[v].tn == (uint32_t)-1) continue;
						for (z = i; z < k; z++) {
							if(v == z) continue;
							if(res->a[z].tn == (uint32_t)-1) continue;
							if(res->a[v].rev != res->a[z].rev) continue;


							os = MAX(res->a[v].qs, res->a[z].qs); 
							oe = MIN(res->a[v].qe, res->a[z].qe);
							if(oe <= os) continue;
							ovlpq = oe - os;

							os = MAX(res->a[v].ts, res->a[z].ts); 
							oe = MIN(res->a[v].te, res->a[z].te);
							if(oe <= os) continue;
							ovlpt = oe - os;

							is_cov = 0;
							if(((ovlpq == (res->a[v].qe-res->a[v].qs)) && (ovlpt == (res->a[v].te-res->a[v].ts))) || 
							((ovlpq == (res->a[z].qe-res->a[z].qs)) && (ovlpt == (res->a[z].te-res->a[z].ts)))) {
								is_cov = 1;
							}

							if(!is_cov) {
								if(ovlpq <= ((res->a[v].qe-res->a[v].qs)*0.95)) continue;
								if(ovlpq <= ((res->a[z].qe-res->a[z].qs)*0.95)) continue;
								if(ovlpt <= ((res->a[v].te-res->a[v].ts)*0.95)) continue;
								if(ovlpt <= ((res->a[z].te-res->a[z].ts)*0.95)) continue;
							}

							if(res->a[v].qs > res->a[z].qs) res->a[v].qs = res->a[z].qs;
							if(res->a[v].qe < res->a[z].qe) res->a[v].qe = res->a[z].qe;
							if(res->a[v].ts > res->a[z].ts) res->a[v].ts = res->a[z].ts;
							if(res->a[v].te < res->a[z].te) res->a[v].te = res->a[z].te;
							res->a[z].tn = (uint32_t)-1; on--;

							// uint64_t vd, vz;
							// vd = (uint64_t)(res->a[v].qe-res->a[v].qs) + (uint64_t)(res->a[v].te-res->a[v].ts);
							// zd = (uint64_t)(res->a[z].qe-res->a[z].qs) + (uint64_t)(res->a[z].te-res->a[z].ts);
							// ovlp = ((vd>=zd)?(vd-zd):(zd-vd));
							// if(ovlp > 64) {
							// 	if(vd < zd) {
							// 		res->a[v].tn = (uint32_t)-1; break;
							// 	} else if(vd < zd) {
							// 		res->a[z].tn = (uint32_t)-1; continue;
							// 	}
							// }

							// vd = ((res->a[v].qe-res->a[v].qs)>=(res->a[v].te-res->a[v].ts))?
							// 		((res->a[v].qe-res->a[v].qs)-(res->a[v].te-res->a[v].ts)):
							// 			((res->a[v].te-res->a[v].ts)-(res->a[v].qe-res->a[v].qs));
							// zd = ((res->a[z].qe-res->a[z].qs)>=(res->a[z].te-res->a[z].ts))?
							// 		((res->a[z].qe-res->a[z].qs)-(res->a[z].te-res->a[z].ts)):
							// 			((res->a[z].te-res->a[z].ts)-(res->a[z].qe-res->a[z].qs));
							// if(zd <= vd) {
							// 	res->a[v].tn = (uint32_t)-1; break;
							// } else {
							// 	res->a[z].tn = (uint32_t)-1;
							// }
						}
					}
					if(on > 1) radix_sort_ul_ov_srt_qs(res->a + i, res->a + k);
				}
				i = k;
			}
		}
		for (k = z = rn; k < res->n; k++) {
			if(res->a[k].tn == (uint32_t)-1) continue;
			res->a[z++] = res->a[k];
		}
		res->n = z;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, %r14
movl %edi, %r15d
movq %rdx, 0x8(%rsp)
movq 0x8(%rdx), %rax
movq %rax, 0x88(%rsp)
movl %eax, %eax
movq %rax, 0x90(%rsp)
leal (%r15,%r15), %esi
movq 0x18(%r14), %rcx
movq 0x8(%rcx), %rax
movq 0x28(%rcx), %rcx
movq (%rcx,%rsi,8), %rdx
testl %edx, %edx
je 0x1c9450
movq %rsi, 0x40(%rsp)
movq %rdx, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, 0x28(%rsp)
movl %r15d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, 0x10(%rsp)
movl %edx, %eax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
movq %rax, 0x18(%rsp)
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
cmpl $0x0, 0xc(%rcx,%rax,8)
js 0x1c942c
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,8), %rsi
movl 0x8(%rsi), %r12d
movl %r12d, %eax
shrl %eax
cmpl 0x10(%rsp), %eax
je 0x1c942c
movq %r14, %rdi
leaq 0x6c(%rsp), %rdx
callq 0x1c83c0
cmpl %r15d, 0x6c(%rsp)
jne 0x1c920e
cmpl %r15d, 0x78(%rsp)
je 0x1c920e
movq 0x8(%rsp), %rbx
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq 0x10(%rbx), %rcx
jne 0x1c91e4
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0x10(%rbx)
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rsi
addq %rdx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, (%rbx)
movq 0x8(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rbx)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movupd 0x6c(%rsp), %xmm0
movupd 0x78(%rsp), %xmm1
movupd %xmm1, 0xc(%rax,%rdx)
movupd %xmm0, (%rax,%rdx)
movq 0x18(%r14), %rax
movq 0x28(%rax), %rcx
xorq $0x1, %r12
movq (%rcx,%r12,8), %rcx
testl %ecx, %ecx
je 0x1c942c
movq %rcx, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
shlq $0x3, %rdx
addq 0x8(%rax), %rdx
movq %rdx, 0x20(%rsp)
movl %ecx, %eax
movq %rax, 0x38(%rsp)
xorl %r12d, %r12d
leaq (%r12,%r12,2), %rax
movq 0x20(%rsp), %rcx
cmpl $0x0, 0xc(%rcx,%rax,8)
js 0x1c941e
movq 0x20(%rsp), %rcx
leaq (%rcx,%rax,8), %r13
movl 0x8(%r13), %ebx
movl %ebx, %eax
shrl %eax
cmpl 0x10(%rsp), %eax
je 0x1c941e
movq %r14, %rdi
movq %r13, %rsi
leaq 0x10c(%rsp), %rbp
movq %rbp, %rdx
callq 0x1c83c0
leaq 0x6c(%rsp), %rsi
movq %rbp, %rdx
leaq 0x50(%rsp), %rcx
callq 0x1c850b
testl %eax, %eax
je 0x1c941e
cmpl %r15d, 0x50(%rsp)
jne 0x1c9323
cmpl %r15d, 0x5c(%rsp)
je 0x1c9323
movq 0x8(%rsp), %rbx
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq 0x10(%rbx), %rcx
jne 0x1c92f5
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0x10(%rbx)
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rsi
addq %rdx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, (%rbx)
movq 0x8(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rbx)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movupd 0x50(%rsp), %xmm0
movupd 0x5c(%rsp), %xmm1
movupd %xmm1, 0xc(%rax,%rdx)
movupd %xmm0, (%rax,%rdx)
movl 0x8(%r13), %ebx
movq 0x18(%r14), %rax
movq 0x28(%rax), %rcx
xorl $0x1, %ebx
movq (%rcx,%rbx,8), %rcx
testl %ecx, %ecx
je 0x1c941e
movq %rcx, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %r13
shlq $0x3, %r13
addq 0x8(%rax), %r13
movl %ecx, %ebp
cmpl $0x0, 0xc(%r13)
js 0x1c9411
movq %r14, %rdi
movq %r13, %rsi
leaq 0xf0(%rsp), %rbx
movq %rbx, %rdx
callq 0x1c83c0
leaq 0x50(%rsp), %rsi
movq %rbx, %rdx
leaq 0xa4(%rsp), %rcx
callq 0x1c850b
testl %eax, %eax
je 0x1c9411
cmpl %r15d, 0xa4(%rsp)
jne 0x1c9411
cmpl %r15d, 0xb0(%rsp)
je 0x1c9411
movq 0x8(%rsp), %rbx
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq 0x10(%rbx), %rcx
jne 0x1c93e1
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0x10(%rbx)
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rsi
addq %rdx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, (%rbx)
movq 0x8(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rbx)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movupd 0xa4(%rsp), %xmm0
movupd 0xb0(%rsp), %xmm1
movupd %xmm1, 0xc(%rax,%rdx)
movupd %xmm0, (%rax,%rdx)
addq $0x18, %r13
decq %rbp
jne 0x1c934f
incq %r12
cmpq 0x38(%rsp), %r12
jne 0x1c9248
movq 0x18(%rsp), %rax
incq %rax
cmpq 0x30(%rsp), %rax
jne 0x1c9154
movq 0x18(%r14), %rcx
movq 0x8(%rcx), %rax
movq 0x28(%rcx), %rcx
movq 0x40(%rsp), %rsi
movl %esi, %edx
movq 0x8(%rcx,%rdx,8), %rcx
testl %ecx, %ecx
je 0x1c9773
movq %rcx, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rax
movq %rax, 0x28(%rsp)
movl %r15d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, 0x10(%rsp)
movl %ecx, %eax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
movq %rax, 0x18(%rsp)
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
cmpl $0x0, 0xc(%rcx,%rax,8)
js 0x1c9760
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,8), %rsi
movl 0x8(%rsi), %r12d
movl %r12d, %eax
shrl %eax
cmpl 0x10(%rsp), %eax
je 0x1c9760
movq %r14, %rdi
leaq 0x6c(%rsp), %rdx
callq 0x1c83c0
cmpl %r15d, 0x6c(%rsp)
jne 0x1c9542
cmpl %r15d, 0x78(%rsp)
je 0x1c9542
movq 0x8(%rsp), %rbx
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq 0x10(%rbx), %rcx
jne 0x1c9518
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0x10(%rbx)
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rsi
addq %rdx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, (%rbx)
movq 0x8(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rbx)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movupd 0x6c(%rsp), %xmm0
movupd 0x78(%rsp), %xmm1
movupd %xmm1, 0xc(%rax,%rdx)
movupd %xmm0, (%rax,%rdx)
movq 0x18(%r14), %rax
movq 0x28(%rax), %rcx
xorq $0x1, %r12
movq (%rcx,%r12,8), %rcx
testl %ecx, %ecx
je 0x1c9760
movq %rcx, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
shlq $0x3, %rdx
addq 0x8(%rax), %rdx
movq %rdx, 0x20(%rsp)
movl %ecx, %eax
movq %rax, 0x38(%rsp)
xorl %r12d, %r12d
leaq (%r12,%r12,2), %rax
movq 0x20(%rsp), %rcx
cmpl $0x0, 0xc(%rcx,%rax,8)
js 0x1c9752
movq 0x20(%rsp), %rcx
leaq (%rcx,%rax,8), %r13
movl 0x8(%r13), %ebx
movl %ebx, %eax
shrl %eax
cmpl 0x10(%rsp), %eax
je 0x1c9752
movq %r14, %rdi
movq %r13, %rsi
leaq 0x10c(%rsp), %rbp
movq %rbp, %rdx
callq 0x1c83c0
leaq 0x6c(%rsp), %rsi
movq %rbp, %rdx
leaq 0x50(%rsp), %rcx
callq 0x1c850b
testl %eax, %eax
je 0x1c9752
cmpl %r15d, 0x50(%rsp)
jne 0x1c9657
cmpl %r15d, 0x5c(%rsp)
je 0x1c9657
movq 0x8(%rsp), %rbx
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq 0x10(%rbx), %rcx
jne 0x1c9629
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0x10(%rbx)
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rsi
addq %rdx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, (%rbx)
movq 0x8(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rbx)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movupd 0x50(%rsp), %xmm0
movupd 0x5c(%rsp), %xmm1
movupd %xmm1, 0xc(%rax,%rdx)
movupd %xmm0, (%rax,%rdx)
movl 0x8(%r13), %ebx
movq 0x18(%r14), %rax
movq 0x28(%rax), %rcx
xorl $0x1, %ebx
movq (%rcx,%rbx,8), %rcx
testl %ecx, %ecx
je 0x1c9752
movq %rcx, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %r13
shlq $0x3, %r13
addq 0x8(%rax), %r13
movl %ecx, %ebp
cmpl $0x0, 0xc(%r13)
js 0x1c9745
movq %r14, %rdi
movq %r13, %rsi
leaq 0xf0(%rsp), %rbx
movq %rbx, %rdx
callq 0x1c83c0
leaq 0x50(%rsp), %rsi
movq %rbx, %rdx
leaq 0xa4(%rsp), %rcx
callq 0x1c850b
testl %eax, %eax
je 0x1c9745
cmpl %r15d, 0xa4(%rsp)
jne 0x1c9745
cmpl %r15d, 0xb0(%rsp)
je 0x1c9745
movq 0x8(%rsp), %rbx
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq 0x10(%rbx), %rcx
jne 0x1c9715
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0x10(%rbx)
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rsi
addq %rdx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, (%rbx)
movq 0x8(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rbx)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movupd 0xa4(%rsp), %xmm0
movupd 0xb0(%rsp), %xmm1
movupd %xmm1, 0xc(%rax,%rdx)
movupd %xmm0, (%rax,%rdx)
addq $0x18, %r13
decq %rbp
jne 0x1c9683
incq %r12
cmpq 0x38(%rsp), %r12
jne 0x1c957c
movq 0x18(%rsp), %rax
incq %rax
cmpq 0x30(%rsp), %rax
jne 0x1c9488
movq 0x90(%rsp), %r15
leaq (%r15,%r15,8), %rax
leaq (%rax,%rax,2), %rdi
addq %r15, %rdi
movq 0x8(%rsp), %rbx
movq (%rbx), %rsi
movq 0x8(%rbx), %rax
addq %rsi, %rdi
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rax, %rsi
addq %rcx, %rsi
callq 0x19e855
movq 0x8(%rbx), %rdi
cmpq %r15, %rdi
jbe 0x1c9ba8
movq 0x88(%rsp), %r14
leal 0x1(%r14), %r12d
cmpq %r12, %rdi
jb 0x1c9b4d
movq 0x67aae(%rip), %xmm3    # 0x231280
movapd 0x67ab6(%rip), %xmm4    # 0x231290
movsd 0x67db6(%rip), %xmm5    # 0x231598
movl %r14d, %r8d
cmpq %r12, %rdi
je 0x1c9818
movq (%rbx), %rax
leaq (%r12,%r12,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %r12, %rcx
movl 0xc(%rax,%rcx), %ecx
movl %r8d, %edx
leaq (%rdx,%rdx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rdx, %rsi
cmpl 0xc(%rax,%rsi), %ecx
jne 0x1c9818
movl %r8d, %eax
jmp 0x1c9b3e
movl %r12d, %eax
subl %r8d, %eax
cmpl $0x2, %eax
jb 0x1c9b3b
cmpl %r8d, %r12d
jbe 0x1c9af8
movq %rdi, 0xc8(%rsp)
movq %r12, 0xc0(%rsp)
movl %r12d, %ecx
movl %eax, %eax
movq %rax, 0x98(%rsp)
movq (%rbx), %rsi
movl %r8d, 0x4c(%rsp)
movl %r8d, %edx
leaq (%rdx,%rdx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rdx, %rax
movq %rsi, 0x30(%rsp)
addq %rsi, %rax
addq $0x18, %rax
movq %rax, 0xe8(%rsp)
movq %rdx, %r10
movq %rcx, 0x40(%rsp)
subq %rcx, %r10
xorl %r11d, %r11d
leaq (%rdx,%rdx,8), %rax
leaq (%rax,%rax,2), %rax
movq %rdx, 0x28(%rsp)
addq %rdx, %rax
movq 0x30(%rsp), %rcx
cmpl $-0x1, 0xc(%rcx,%rax)
je 0x1c9aaf
movq 0x30(%rsp), %rdx
leaq (%rdx,%rax), %rcx
leaq (%rdx,%rax), %r12
addq $0x8, %r12
movq 0xe8(%rsp), %r13
xorl %ebp, %ebp
movq %rcx, 0x10(%rsp)
movq %r12, 0x18(%rsp)
cmpq %rbp, %r11
je 0x1c9a9f
cmpl $-0x1, -0xc(%r13)
je 0x1c9a9f
movl (%r13), %eax
xorl 0x18(%rcx), %eax
js 0x1c9a9f
movl 0x4(%rcx), %r14d
movl -0x14(%r13), %r9d
cmpl %r9d, %r14d
movl %r9d, %ebx
cmoval %r14d, %ebx
movl -0x10(%r13), %eax
movl (%r12), %edx
cmpl %eax, %edx
movl %eax, %r15d
cmovbl %edx, %r15d
cmpl %ebx, %r15d
jbe 0x1c99ea
movl 0x8(%r12), %edi
movl -0x8(%r13), %ecx
cmpl %ecx, %edi
movq %r12, %r8
movl %ecx, 0x38(%rsp)
movl %ecx, %r12d
cmoval %edi, %r12d
movl -0x4(%r13), %ecx
movl 0xc(%r8), %r8d
cmpl %ecx, %r8d
movl %ecx, 0x20(%rsp)
cmovbl %r8d, %ecx
cmpl %r12d, %ecx
jbe 0x1c9a90
movl %ebx, %esi
movl %r15d, %ebx
subq %rsi, %rbx
movl %r12d, %esi
movl %ecx, %r12d
subq %rsi, %r12
movl %edx, %r15d
subl %r14d, %r15d
movl %r8d, %ecx
subl %edi, %ecx
cmpq %r15, %rbx
jne 0x1c9972
cmpq %rcx, %r12
je 0x1c9999
movl %eax, %esi
subl %r9d, %esi
movq %rcx, 0xd8(%rsp)
movl 0x20(%rsp), %ecx
subl 0x38(%rsp), %ecx
movq %rsi, 0xe0(%rsp)
cmpq %rsi, %rbx
jne 0x1c99f4
cmpq %rcx, %r12
jne 0x1c99f4
cmpl %r9d, %r14d
movq 0x18(%rsp), %r12
jbe 0x1c99a8
movl %r9d, -0x4(%r12)
cmpl %eax, %edx
jae 0x1c99b0
movl %eax, (%r12)
movl 0x38(%rsp), %eax
cmpl %eax, %edi
movq 0x8(%rsp), %rbx
movq 0x10(%rsp), %rcx
jbe 0x1c99c7
movl %eax, 0x8(%r12)
movl 0x20(%rsp), %eax
cmpl %eax, %r8d
jae 0x1c99d5
movl %eax, 0xc(%r12)
movl $0xffffffff, -0xc(%r13) # imm = 0xFFFFFFFF
decq 0x98(%rsp)
jmp 0x1c9a9f
movq 0x8(%rsp), %rbx
jmp 0x1c9a9f
movq %rcx, 0xd0(%rsp)
movq %rbx, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm4, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
movl %r15d, %ecx
cvtsi2sd %rcx, %xmm2
addsd %xmm1, %xmm0
mulsd %xmm5, %xmm2
ucomisd %xmm0, %xmm2
jae 0x1c9a90
movl 0xe0(%rsp), %ecx
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
mulsd %xmm5, %xmm1
ucomisd %xmm0, %xmm1
movq 0x8(%rsp), %rbx
jae 0x1c9a95
movq %r12, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm4, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
xorps %xmm2, %xmm2
cvtsi2sdq 0xd8(%rsp), %xmm2
addsd %xmm1, %xmm0
mulsd %xmm5, %xmm2
ucomisd %xmm0, %xmm2
jae 0x1c9a95
xorps %xmm1, %xmm1
cvtsi2sdq 0xd0(%rsp), %xmm1
mulsd %xmm5, %xmm1
ucomisd %xmm0, %xmm1
jb 0x1c9999
movq 0x8(%rsp), %rbx
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %r12
decq %rbp
addq $0x1c, %r13
cmpq %rbp, %r10
jne 0x1c98ca
movq 0x28(%rsp), %rdx
incq %rdx
decq %r11
cmpq 0x40(%rsp), %rdx
jne 0x1c9885
movq 0xc0(%rsp), %r12
movl %r12d, %eax
cmpq $0x2, 0x98(%rsp)
movq 0x88(%rsp), %r14
movq 0x90(%rsp), %r15
movq 0xc8(%rsp), %rdi
movl 0x4c(%rsp), %r8d
jb 0x1c9b3e
movq (%rbx), %rax
movl %r8d, %ecx
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdi
addq %rcx, %rdi
addq %rax, %rdi
leaq (%r12,%r12,8), %rcx
leaq (%rcx,%rcx,2), %rsi
addq %r12, %rsi
addq %rax, %rsi
callq 0x19e55c
movsd 0x67a71(%rip), %xmm5    # 0x231598
movapd 0x67761(%rip), %xmm4    # 0x231290
movq 0x67749(%rip), %xmm3    # 0x231280
movq 0x8(%rbx), %rdi
movl %r12d, %eax
incl %r12d
movl %eax, %r8d
cmpq %r12, %rdi
jae 0x1c97e5
cmpq %r15, %rdi
jbe 0x1c9ba1
leal 0x1(%r14), %eax
movq (%rbx), %rcx
leaq (%r15,%r15,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %r15, %rdx
cmpl $-0x1, 0xc(%rcx,%rdx)
je 0x1c9b97
addq %rcx, %rdx
movl %r14d, %esi
incl %r14d
leaq (%rsi,%rsi,8), %rdi
leaq (%rdi,%rdi,2), %rdi
addq %rsi, %rdi
movupd (%rdx), %xmm0
movupd 0xc(%rdx), %xmm1
movupd %xmm1, 0xc(%rcx,%rdi)
movupd %xmm0, (%rcx,%rdi)
movq 0x8(%rbx), %rdi
movl %eax, %r15d
incl %eax
cmpq %r15, %rdi
ja 0x1c9b56
movl %r14d, %eax
movq %rax, 0x8(%rbx)
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq