// File: /workspace/github_cpp_makefile_star2_O1/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 $0x108, %rsp            # imm = 0x108
movq %rsi, %r14
movl %edi, %r15d
movq %rdx, (%rsp)
movq 0x8(%rdx), %rax
movq %rax, 0x80(%rsp)
movl %eax, %eax
movq %rax, 0x88(%rsp)
leal (%r15,%r15), %edx
movq 0x18(%rsi), %rcx
movq 0x28(%rcx), %rax
movq %rdx, 0x38(%rsp)
movq (%rax,%rdx,8), %rax
testl %eax, %eax
je 0x1bf655
movq %rax, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
shlq $0x3, %rdx
addq 0x8(%rcx), %rdx
movq %rdx, 0x18(%rsp)
movl %r15d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, 0xc(%rsp)
movl %eax, %eax
movq %rax, 0x20(%rsp)
xorl %eax, %eax
movq %rax, 0x28(%rsp)
leaq (%rax,%rax,2), %rax
movq 0x18(%rsp), %rcx
cmpl $0x0, 0xc(%rcx,%rax,8)
js 0x1bf642
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax,8), %rsi
movl 0x8(%rsi), %r12d
movl %r12d, %eax
shrl %eax
cmpl 0xc(%rsp), %eax
je 0x1bf642
movq %r14, %rdi
leaq 0x64(%rsp), %rdx
callq 0x1be59e
cmpl %r15d, 0x64(%rsp)
jne 0x1bf407
cmpl %r15d, 0x70(%rsp)
je 0x1bf407
movq (%rsp), %rcx
movq 0x10(%rcx), %rax
cmpq %rax, 0x8(%rcx)
jne 0x1bf3d2
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq (%rsp), %rbx
movq %rcx, 0x10(%rbx)
movq (%rbx), %rdi
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rsi
addq %rcx, %rsi
callq 0x2370
movq %rax, (%rbx)
movq (%rsp), %rsi
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rsi)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movupd 0x64(%rsp), %xmm0
movupd 0x70(%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 0x1bf642
movq %rcx, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
shlq $0x3, %rdx
addq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movl %ecx, %eax
movq %rax, 0x30(%rsp)
xorl %r12d, %r12d
leaq (%r12,%r12,2), %rax
movq 0x10(%rsp), %rcx
cmpl $0x0, 0xc(%rcx,%rax,8)
js 0x1bf634
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax,8), %r13
movl 0x8(%r13), %eax
shrl %eax
cmpl 0xc(%rsp), %eax
je 0x1bf634
movq %r14, %rdi
movq %r13, %rsi
leaq 0xec(%rsp), %rbp
movq %rbp, %rdx
callq 0x1be59e
leaq 0x64(%rsp), %rsi
movq %rbp, %rdx
leaq 0x48(%rsp), %rcx
callq 0x1be6f7
testl %eax, %eax
je 0x1bf634
cmpl %r15d, 0x48(%rsp)
jne 0x1bf51d
cmpl %r15d, 0x54(%rsp)
je 0x1bf51d
movq (%rsp), %rcx
movq 0x10(%rcx), %rax
cmpq %rax, 0x8(%rcx)
jne 0x1bf4e8
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq (%rsp), %rbx
movq %rcx, 0x10(%rbx)
movq (%rbx), %rdi
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rsi
addq %rcx, %rsi
callq 0x2370
movq %rax, (%rbx)
movq (%rsp), %rsi
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rsi)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movupd 0x48(%rsp), %xmm0
movupd 0x54(%rsp), %xmm1
movupd %xmm1, 0xc(%rax,%rdx)
movupd %xmm0, (%rax,%rdx)
movq 0x18(%r14), %rax
movq 0x28(%rax), %rcx
movl 0x8(%r13), %edx
xorq $0x1, %rdx
movq (%rcx,%rdx,8), %rcx
testl %ecx, %ecx
je 0x1bf634
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 0x1bf627
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rbx
movq %r14, %r15
leaq 0xd0(%rsp), %r14
movq %r14, %rdx
callq 0x1be59e
leaq 0x48(%rsp), %rsi
movq %r14, %rdx
movq %r15, %r14
movq %rbx, %r15
leaq 0x9c(%rsp), %rcx
callq 0x1be6f7
testl %eax, %eax
je 0x1bf627
cmpl %r15d, 0x9c(%rsp)
jne 0x1bf627
cmpl %r15d, 0xa8(%rsp)
je 0x1bf627
movq (%rsp), %rcx
movq 0x10(%rcx), %rax
cmpq %rax, 0x8(%rcx)
jne 0x1bf5ec
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq (%rsp), %rbx
movq %rcx, 0x10(%rbx)
movq (%rbx), %rdi
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rsi
addq %rcx, %rsi
callq 0x2370
movq %rax, (%rbx)
movq (%rsp), %rsi
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rsi)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movupd 0x9c(%rsp), %xmm0
movupd 0xa8(%rsp), %xmm1
movupd %xmm1, 0xc(%rax,%rdx)
movupd %xmm0, (%rax,%rdx)
addq $0x18, %r13
decq %rbp
jne 0x1bf54e
incq %r12
cmpq 0x30(%rsp), %r12
jne 0x1bf441
movq 0x28(%rsp), %rax
incq %rax
cmpq 0x20(%rsp), %rax
jne 0x1bf346
movq 0x18(%r14), %rcx
movq 0x28(%rcx), %rax
movl 0x38(%rsp), %edx
movq 0x8(%rax,%rdx,8), %rax
testl %eax, %eax
je 0x1bf9bf
movq %rax, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
shlq $0x3, %rdx
addq 0x8(%rcx), %rdx
movq %rdx, 0x18(%rsp)
movl %r15d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, 0xc(%rsp)
movl %eax, %eax
movq %rax, 0x20(%rsp)
xorl %eax, %eax
leaq 0xd0(%rsp), %rbx
movq %rax, 0x28(%rsp)
leaq (%rax,%rax,2), %rax
movq 0x18(%rsp), %rcx
cmpl $0x0, 0xc(%rcx,%rax,8)
js 0x1bf9ac
movq 0x18(%rsp), %rcx
leaq (%rcx,%rax,8), %rsi
movl 0x8(%rsi), %r12d
movl %r12d, %eax
shrl %eax
cmpl 0xc(%rsp), %eax
je 0x1bf9ac
movq %r14, %rdi
leaq 0x64(%rsp), %rdx
callq 0x1be59e
cmpl %r15d, 0x64(%rsp)
jne 0x1bf771
cmpl %r15d, 0x70(%rsp)
je 0x1bf771
movq (%rsp), %rcx
movq 0x10(%rcx), %rax
cmpq %rax, 0x8(%rcx)
jne 0x1bf73c
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq (%rsp), %rbx
movq %rcx, 0x10(%rbx)
movq (%rbx), %rdi
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rsi
addq %rcx, %rsi
callq 0x2370
movq %rax, (%rbx)
leaq 0xd0(%rsp), %rbx
movq (%rsp), %rsi
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rsi)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movupd 0x64(%rsp), %xmm0
movupd 0x70(%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 0x1bf9ac
movq %rcx, %rdx
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdx
shlq $0x3, %rdx
addq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movl %ecx, %eax
movq %rax, 0x30(%rsp)
xorl %r12d, %r12d
leaq (%r12,%r12,2), %rax
movq 0x10(%rsp), %rcx
cmpl $0x0, 0xc(%rcx,%rax,8)
js 0x1bf99e
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax,8), %r13
movl 0x8(%r13), %eax
shrl %eax
cmpl 0xc(%rsp), %eax
je 0x1bf99e
movq %r14, %rdi
movq %r13, %rsi
leaq 0xec(%rsp), %rbp
movq %rbp, %rdx
callq 0x1be59e
leaq 0x64(%rsp), %rsi
movq %rbp, %rdx
leaq 0x48(%rsp), %rcx
callq 0x1be6f7
testl %eax, %eax
je 0x1bf99e
cmpl %r15d, 0x48(%rsp)
jne 0x1bf893
cmpl %r15d, 0x54(%rsp)
je 0x1bf893
movq (%rsp), %rcx
movq 0x10(%rcx), %rax
cmpq %rax, 0x8(%rcx)
jne 0x1bf85e
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq (%rsp), %rbx
movq %rcx, 0x10(%rbx)
movq (%rbx), %rdi
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rsi
addq %rcx, %rsi
callq 0x2370
movq %rax, (%rbx)
leaq 0xd0(%rsp), %rbx
movq (%rsp), %rsi
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rsi)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movupd 0x48(%rsp), %xmm0
movupd 0x54(%rsp), %xmm1
movupd %xmm1, 0xc(%rax,%rdx)
movupd %xmm0, (%rax,%rdx)
movq 0x18(%r14), %rax
movq 0x28(%rax), %rcx
movl 0x8(%r13), %edx
xorq $0x1, %rdx
movq (%rcx,%rdx,8), %rcx
testl %ecx, %ecx
je 0x1bf99e
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 0x1bf991
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x1be59e
leaq 0x48(%rsp), %rsi
movq %rbx, %rdx
leaq 0x9c(%rsp), %rcx
callq 0x1be6f7
testl %eax, %eax
je 0x1bf991
cmpl %r15d, 0x9c(%rsp)
jne 0x1bf991
cmpl %r15d, 0xa8(%rsp)
je 0x1bf991
movq (%rsp), %rcx
movq 0x10(%rcx), %rax
cmpq %rax, 0x8(%rcx)
jne 0x1bf956
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq (%rsp), %rbx
movq %rcx, 0x10(%rbx)
movq (%rbx), %rdi
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rsi
addq %rcx, %rsi
callq 0x2370
movq %rax, (%rbx)
leaq 0xd0(%rsp), %rbx
movq (%rsp), %rsi
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%rsi)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movupd 0x9c(%rsp), %xmm0
movupd 0xa8(%rsp), %xmm1
movupd %xmm1, 0xc(%rax,%rdx)
movupd %xmm0, (%rax,%rdx)
addq $0x18, %r13
decq %rbp
jne 0x1bf8c4
incq %r12
cmpq 0x30(%rsp), %r12
jne 0x1bf7ab
movq 0x28(%rsp), %rax
incq %rax
cmpq 0x20(%rsp), %rax
jne 0x1bf6a4
movq 0x88(%rsp), %r15
leaq (%r15,%r15,8), %rax
leaq (%rax,%rax,2), %rdi
addq %r15, %rdi
movq (%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 0x195abc
cmpq %r15, 0x8(%rbx)
jbe 0x1bfde3
movq 0x80(%rsp), %r14
leal 0x1(%r14), %r12d
movq (%rsp), %rax
movq 0x8(%rax), %rax
cmpq %r12, %rax
jb 0x1bfd7a
movq 0x6581e(%rip), %xmm3    # 0x225240
movapd 0x65826(%rip), %xmm4    # 0x225250
movsd 0x65a66(%rip), %xmm5    # 0x225498
movl %r14d, %edi
cmpq %r12, %rax
je 0x1bfa6a
movq (%rsp), %rax
movq (%rax), %rax
leaq (%r12,%r12,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %r12, %rcx
movl 0xc(%rax,%rcx), %ecx
movl %edi, %edx
leaq (%rdx,%rdx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rdx, %rsi
cmpl 0xc(%rax,%rsi), %ecx
jne 0x1bfa6a
movl %edi, %ecx
jmp 0x1bfd64
movl %r12d, %eax
subl %edi, %eax
movl %r12d, %ecx
cmpl $0x2, %eax
jb 0x1bfd64
cmpl %edi, %r12d
jbe 0x1bfd1f
movq %r12, 0xb8(%rsp)
movl %r12d, %ecx
movl %eax, %eax
movq %rax, 0x90(%rsp)
movq (%rsp), %rax
movq (%rax), %rsi
movl %edi, 0x44(%rsp)
movl %edi, %edx
leaq (%rdx,%rdx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rdx, %rax
movq %rsi, 0x20(%rsp)
addq %rsi, %rax
addq $0x18, %rax
movq %rax, 0xc0(%rsp)
movq %rdx, %r9
movq %rcx, 0xc8(%rsp)
subq %rcx, %r9
xorl %r10d, %r10d
leaq (%rdx,%rdx,8), %rax
leaq (%rax,%rax,2), %rax
movq %rdx, 0x18(%rsp)
addq %rdx, %rax
movq 0x20(%rsp), %rcx
cmpl $-0x1, 0xc(%rcx,%rax)
je 0x1bfcdc
movq 0x20(%rsp), %rcx
leaq (%rcx,%rax), %r11
leaq (%rcx,%rax), %r8
addq $0x8, %r8
movq 0xc0(%rsp), %r12
xorl %r13d, %r13d
movq %r8, 0x10(%rsp)
cmpq %r13, %r10
je 0x1bfccc
cmpl $-0x1, -0xc(%r12)
je 0x1bfccc
movl (%r12), %eax
xorl 0x18(%r11), %eax
js 0x1bfccc
movl 0x4(%r11), %r15d
movl -0x14(%r12), %edi
cmpl %edi, %r15d
movl %edi, %edx
cmoval %r15d, %edx
movl -0x10(%r12), %ebp
movl (%r8), %ecx
cmpl %ebp, %ecx
movl %ebp, %esi
cmovbl %ecx, %esi
cmpl %edx, %esi
jbe 0x1bfccc
movl 0x8(%r8), %eax
movl -0x8(%r12), %r14d
cmpl %r14d, %eax
movl %r14d, 0x30(%rsp)
movl %eax, 0xc(%rsp)
cmoval %eax, %r14d
movl -0x4(%r12), %eax
movl 0xc(%r8), %ebx
cmpl %eax, %ebx
movl %eax, %r8d
movl %ebx, 0x28(%rsp)
cmovbl %ebx, %r8d
cmpl %r14d, %r8d
jbe 0x1bfcc7
movl %eax, 0x38(%rsp)
movl %edx, %ebx
movl %esi, %edx
subq %rbx, %rdx
movl %r14d, %ebx
movl %r8d, %esi
subq %rbx, %rsi
movl 0x8(%r11), %r14d
subl %r15d, %r14d
cmpq %r14, %rdx
jne 0x1bfbc8
movl 0x14(%r11), %r8d
subl 0x10(%r11), %r8d
cmpq %r8, %rsi
je 0x1bfbe4
movl -0x10(%r12), %r15d
subl %edi, %r15d
cmpq %r15, %rdx
jne 0x1bfc31
movl -0x4(%r12), %edi
subl -0x8(%r12), %edi
cmpq %rdi, %rsi
jne 0x1bfc31
movl -0x14(%r12), %edx
movq 0x10(%rsp), %r8
cmpl %edx, -0x4(%r8)
jbe 0x1bfbf8
movl %edx, -0x4(%r8)
cmpl %ebp, %ecx
movl 0x38(%rsp), %eax
movl 0x30(%rsp), %ecx
jae 0x1bfc07
movl %ebp, (%r8)
cmpl %ecx, 0xc(%rsp)
jbe 0x1bfc11
movl %ecx, 0x8(%r8)
cmpl %eax, 0x28(%rsp)
jae 0x1bfc1b
movl %eax, 0xc(%r8)
movl $0xffffffff, -0xc(%r12) # imm = 0xFFFFFFFF
decq 0x90(%rsp)
jmp 0x1bfccc
movq %rdx, %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 %r14d, %edx
xorps %xmm2, %xmm2
cvtsi2sd %rdx, %xmm2
addsd %xmm1, %xmm0
mulsd %xmm5, %xmm2
ucomisd %xmm0, %xmm2
jae 0x1bfcc7
movl %r15d, %edx
xorps %xmm1, %xmm1
cvtsi2sd %rdx, %xmm1
mulsd %xmm5, %xmm1
ucomisd %xmm0, %xmm1
jae 0x1bfcc7
movq %rsi, %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 0x14(%r11), %edx
subl 0x10(%r11), %edx
xorps %xmm2, %xmm2
cvtsi2sd %rdx, %xmm2
addsd %xmm1, %xmm0
mulsd %xmm5, %xmm2
ucomisd %xmm0, %xmm2
jae 0x1bfcc7
movl -0x4(%r12), %edx
subl -0x8(%r12), %edx
xorps %xmm1, %xmm1
cvtsi2sd %rdx, %xmm1
mulsd %xmm5, %xmm1
ucomisd %xmm0, %xmm1
jb 0x1bfbe4
movq 0x10(%rsp), %r8
decq %r13
addq $0x1c, %r12
cmpq %r13, %r9
jne 0x1bfb17
movq 0x18(%rsp), %rdx
incq %rdx
decq %r10
cmpq 0xc8(%rsp), %rdx
jne 0x1bfad6
movq 0xb8(%rsp), %r12
movl %r12d, %ecx
cmpq $0x2, 0x90(%rsp)
movq 0x80(%rsp), %r14
movq 0x88(%rsp), %r15
movl 0x44(%rsp), %edi
jb 0x1bfd64
movq (%rsp), %rax
movq (%rax), %rax
movl %edi, %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 0x1957bd
movsd 0x65747(%rip), %xmm5    # 0x225498
movapd 0x654f7(%rip), %xmm4    # 0x225250
movq 0x654df(%rip), %xmm3    # 0x225240
movl %r12d, %ecx
incl %r12d
movq (%rsp), %rax
movq 0x8(%rax), %rax
movl %ecx, %edi
cmpq %r12, %rax
jae 0x1bfa35
movq (%rsp), %rax
cmpq %r15, 0x8(%rax)
jbe 0x1bfdd8
leal 0x1(%r14), %eax
movq (%rsp), %rcx
movq (%rcx), %rcx
leaq (%r15,%r15,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %r15, %rdx
cmpl $-0x1, 0xc(%rcx,%rdx)
je 0x1bfdc9
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)
movl %eax, %r15d
incl %eax
movq (%rsp), %rcx
cmpq %r15, 0x8(%rcx)
ja 0x1bfd88
movl %r14d, %eax
movq (%rsp), %rcx
movq %rax, 0x8(%rcx)
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq