// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/univariatetree.c
// Function: find_split_for_partition_without_outliers
double find_split_for_partition_without_outliers(Instanceptr instances, Partition p, int fno, int conditiontype, double variancerange)
{
 /*!Last Changed 30.12.2003*/
 int nl = 0, nr = 0;
 double ml, mr, sr, sl, llower, lupper, rlower, rupper;
 if (p.count == 0 || instances == NULL || fno < 0 || all_same_side(p))
   return ISELL;
 left_and_right_sum(instances, p, fno, &ml, &mr, &nl, &nr, conditiontype);
 if (nl > 0)
   ml /= nl;
 else
   return ISELL;
 if (nr > 0)
   mr /= nr;
 else
   return ISELL;
 left_and_right_variance(instances, p, fno, &sl, &sr, ml, mr, conditiontype);
 if (nl > 1)
   sl /= (nl-1);
 else
   sl = 0;
 if (nr > 1)
   sr /= (nr-1);
 else
   sr = 0;
 llower = ml - variancerange * sqrt(sl);
 lupper = ml + variancerange * sqrt(sl);
 rlower = mr - variancerange * sqrt(sr);
 rupper = mr + variancerange * sqrt(sr);
 left_and_right_sum_without_outliers(instances, p, fno, &ml, &mr, &nl, &nr, llower, lupper, rlower, rupper);
 if (nl > 0)
   ml /= nl;
 else
   return ISELL;
 if (nr > 0)
   mr /= nr;
 else
   return ISELL;
 left_and_right_variance_without_outliers(instances, p, fno, &sl, &sr, ml, mr, llower, lupper, rlower, rupper);
 if (nl > 1)
   sl /= (nl-1);
 else
   sl = 0;
 if (nr > 1)
   sr /= (nr-1);
 else
   sr = 0;
 return solve_for_ldt_second_order_equation(ml, mr, sl, sr, nl, nr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movapd %xmm0, 0x90(%rsp)
andl $0x0, 0x44(%rsp)
andl $0x0, 0x2c(%rsp)
testl %esi, %esi
js 0x925d9
movq %rdi, %r14
testq %rdi, %rdi
je 0x925d9
cmpl $0x0, 0xf0(%rsp)
je 0x925d9
movl %edx, %ebp
movl %esi, %ebx
leaq 0xe0(%rsp), %r13
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movupd (%r13), %xmm0
movupd %xmm0, (%rsp)
callq 0x4dbfb
testl %eax, %eax
je 0x925f3
movsd 0x3717(%rip), %xmm0     # 0x95cf8
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movupd (%r13), %xmm0
movupd %xmm0, (%rsp)
movl %ebp, 0x18(%rsp)
leaq 0x70(%rsp), %rdx
leaq 0x68(%rsp), %rcx
leaq 0x44(%rsp), %r15
leaq 0x2c(%rsp), %r9
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %r8
callq 0x91cfa
movl (%r15), %r12d
testl %r12d, %r12d
jle 0x925d9
cvtsi2sd %r12d, %xmm1
movsd 0x70(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x70(%rsp)
movl 0x2c(%rsp), %r15d
testl %r15d, %r15d
jle 0x925d9
cvtsi2sd %r15d, %xmm2
movsd 0x68(%rsp), %xmm1
divsd %xmm2, %xmm1
movsd %xmm1, 0x68(%rsp)
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movupd (%r13), %xmm2
movupd %xmm2, (%rsp)
leaq 0x58(%rsp), %rdx
leaq 0x60(%rsp), %rcx
movq %r14, %rdi
movl %ebx, %esi
movsd %xmm0, 0x50(%rsp)
movsd %xmm1, 0x48(%rsp)
movl %ebp, %r8d
callq 0x92114
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
cmpl $0x1, %r12d
je 0x926bf
decl %r12d
cvtsi2sd %r12d, %xmm1
movsd 0x58(%rsp), %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x58(%rsp)
xorpd %xmm4, %xmm4
cmpl $0x1, %r15d
je 0x926e1
decl %r15d
cvtsi2sd %r15d, %xmm1
movsd 0x60(%rsp), %xmm4
divsd %xmm1, %xmm4
movsd %xmm4, 0x60(%rsp)
sqrtsd %xmm2, %xmm1
ucomisd %xmm0, %xmm2
movapd %xmm1, %xmm3
movsd %xmm4, 0x38(%rsp)
jae 0x9272c
movapd %xmm2, %xmm0
movsd %xmm1, 0x30(%rsp)
movsd %xmm2, 0x80(%rsp)
callq 0x4300
movsd 0x80(%rsp), %xmm2
movsd 0x38(%rsp), %xmm4
movsd 0x30(%rsp), %xmm1
movapd %xmm0, %xmm3
movapd 0x3a9c(%rip), %xmm0     # 0x961d0
xorpd 0x90(%rsp), %xmm0
movapd %xmm0, 0x80(%rsp)
xorpd %xmm6, %xmm6
ucomisd %xmm6, %xmm2
jae 0x92773
movapd %xmm2, %xmm0
movsd %xmm3, 0x78(%rsp)
callq 0x4300
xorpd %xmm6, %xmm6
movsd 0x78(%rsp), %xmm3
movsd 0x38(%rsp), %xmm4
movapd %xmm0, %xmm1
movapd 0x90(%rsp), %xmm0
mulsd %xmm0, %xmm3
mulsd %xmm0, %xmm1
sqrtsd %xmm4, %xmm5
ucomisd %xmm6, %xmm4
movapd %xmm5, %xmm0
jae 0x927cb
movapd %xmm4, %xmm0
movsd %xmm1, 0x30(%rsp)
movsd %xmm3, 0x78(%rsp)
movsd %xmm5, 0xa0(%rsp)
callq 0x4300
movsd 0xa0(%rsp), %xmm5
movsd 0x78(%rsp), %xmm3
movsd 0x38(%rsp), %xmm4
movsd 0x30(%rsp), %xmm1
movsd 0x50(%rsp), %xmm2
addsd %xmm2, %xmm1
subsd %xmm3, %xmm2
movapd 0x80(%rsp), %xmm3
mulsd %xmm0, %xmm3
addsd 0x48(%rsp), %xmm3
movapd %xmm3, 0x80(%rsp)
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm4
movsd %xmm2, 0x50(%rsp)
movsd %xmm1, 0x30(%rsp)
jae 0x92824
movapd %xmm4, %xmm0
callq 0x4300
movsd 0x30(%rsp), %xmm1
movsd 0x50(%rsp), %xmm2
movapd %xmm0, %xmm5
movapd 0x90(%rsp), %xmm3
mulsd %xmm5, %xmm3
addsd 0x48(%rsp), %xmm3
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
leaq 0x70(%rsp), %rdx
leaq 0x68(%rsp), %rcx
leaq 0x44(%rsp), %r15
leaq 0x2c(%rsp), %r9
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %r8
movapd %xmm2, %xmm0
movaps 0x80(%rsp), %xmm2
movapd %xmm3, 0x90(%rsp)
callq 0x91e50
movsd 0x50(%rsp), %xmm2
movl (%r15), %r15d
testl %r15d, %r15d
jle 0x925d9
movl 0x2c(%rsp), %r12d
testl %r12d, %r12d
jle 0x925d9
movsd 0x70(%rsp), %xmm0
cvtsi2sd %r15d, %xmm1
divsd %xmm1, %xmm0
cvtsi2sd %r12d, %xmm3
movsd 0x68(%rsp), %xmm1
divsd %xmm3, %xmm1
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm3
movups %xmm3, (%rsp)
leaq 0x58(%rsp), %rdx
leaq 0x60(%rsp), %rcx
movq %r14, %rdi
movl %ebx, %esi
movsd %xmm0, 0x48(%rsp)
movsd %xmm1, 0x38(%rsp)
movsd 0x30(%rsp), %xmm3
movaps 0x80(%rsp), %xmm4
movaps 0x90(%rsp), %xmm5
callq 0x91faf
xorpd %xmm3, %xmm3
xorpd %xmm2, %xmm2
cmpl $0x1, %r15d
je 0x92925
leal -0x1(%r15), %eax
cvtsi2sd %eax, %xmm0
movsd 0x58(%rsp), %xmm2
divsd %xmm0, %xmm2
cmpl $0x1, %r12d
je 0x9293e
leal -0x1(%r12), %eax
cvtsi2sd %eax, %xmm0
movsd 0x60(%rsp), %xmm3
divsd %xmm0, %xmm3
movsd 0x48(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movl %r15d, %edi
movl %r12d, %esi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x92266