// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/univariatetree.c
// Function: left_and_right_variance
void left_and_right_variance(Instanceptr instances, Partition p, int fno, double* leftsum, double* rightsum, double leftmean, double rightmean, int conditiontype)
{
/* Last Changed 09.02.2003*/
 int *classassignments, i;
 double value, sub, added;
 Instanceptr tmp;
 *leftsum = 0;
 *rightsum = 0;
 if (fno < 0 || instances == NULL || p.count == 0 || all_same_side(p))
   return;
 classassignments = find_class_assignments(p);
 tmp = instances;
 while (tmp)
  {
   if (conditiontype == HYBRID_CONDITION)
     value = real_feature(tmp, fno);
   else
     if (current_dataset->features[fno].type == INTEGER)
       value = tmp->values[fno].intvalue;
     else
       value = tmp->values[fno].floatvalue;
   i = give_classno(tmp);
   if (classassignments[i] == LEFT)
    {
     sub = value - leftmean;
     added = sub * sub;
     (*leftsum) += added;
    }
   else
    {
     sub = value - rightmean;
     added = sub * sub;
     (*rightsum) += added;
    }
   tmp = tmp->next;
  }
 safe_free(classassignments);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
movsd %xmm1, -0x30(%rbp)
movl %r8d, -0x34(%rbp)
movq -0x18(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movq -0x20(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
cmpl $0x0, -0xc(%rbp)
jl 0xde044
cmpq $0x0, -0x8(%rbp)
je 0xde044
movq -0x70(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0xde044
movq -0x70(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x7a7f0
cmpl $0x0, %eax
je 0xde049
jmp 0xde180
movq -0x70(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x7a860
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0xde177
cmpl $0x2, -0x34(%rbp)
jne 0xde09b
movq -0x68(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x42c40
movsd %xmm0, -0x50(%rbp)
jmp 0xde0ec
leaq 0x2779e(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
cmpl $0x0, (%rax)
jne 0xde0d5
movq -0x68(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0xde0ea
movq -0x68(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0xde0ec
movq -0x68(%rbp), %rdi
callq 0x43530
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movslq -0x44(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xde137
movsd -0x50(%rbp), %xmm0
subsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
mulsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movq -0x18(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0xde166
movsd -0x50(%rbp), %xmm0
subsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
mulsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movq -0x20(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movq -0x68(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0xde077
movq -0x40(%rbp), %rdi
callq 0x52e80
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)