// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/instance.c
// Function: distance_between_instances_before_normalize
double distance_between_instances_before_normalize(Instanceptr inst1,Instanceptr inst2, Instance mean, Instance variance)
{
	/*!Last Changed 17.05.2004*/
 int i;
 double res = 0, value1, value2;
 if (!mustrealize)
  {
   for (i=0;i<current_dataset->featurecount;i++)
     switch (current_dataset->features[i].type)
      {
       case INTEGER:value1 = inst1->values[i].intvalue;
								            value2 = inst2->values[i].intvalue;
                    if (variance.values[i].floatvalue != 0)
																				 {
								              value1 = (value1 - mean.values[i].floatvalue) / sqrt(variance.values[i].floatvalue);
								              value2 = (value2 - mean.values[i].floatvalue) / sqrt(variance.values[i].floatvalue);
								              res += (value1 - value2) * (value1 - value2);
																				 }
                    break;
       case    REAL:value1 = inst1->values[i].floatvalue;
								            value2 = inst2->values[i].floatvalue;
                    if (variance.values[i].floatvalue != 0)
																				 {
								              value1 = (value1 - mean.values[i].floatvalue) / sqrt(variance.values[i].floatvalue);
								              value2 = (value2 - mean.values[i].floatvalue) / sqrt(variance.values[i].floatvalue);
								              res += (value1 - value2) * (value1 - value2);
																				 }
                    break;
       case  STRING:if (inst1->values[i].stringindex != inst2->values[i].stringindex)
                      res+=1;
                    break;
      }
  }
 return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
leaq 0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
leaq 0x39dfd5(%rip), %rax    # 0x3e1f74
cmpl $0x0, (%rax)
jne 0x44237
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
leaq 0xc1887(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x1bc(%rcx), %eax
jge 0x44235
leaq 0xc1871(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movl 0x30f08(%rax,%rcx), %eax
movl %eax, -0x44(%rbp)
testl %eax, %eax
je 0x4400c
jmp 0x43fed
movl -0x44(%rbp), %eax
subl $0x1, %eax
je 0x441f3
jmp 0x43ffb
movl -0x44(%rbp), %eax
subl $0x2, %eax
je 0x44101
jmp 0x44225
movq -0x40(%rbp), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movslq -0x14(%rbp), %rdx
cvtsi2sdl (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movslq -0x14(%rbp), %rdx
cvtsi2sdl (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x30(%rbp)
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x44056
jp 0x44056
jmp 0x440fc
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
movsd -0x28(%rbp), %xmm0
movq (%rcx), %rcx
movslq -0x14(%rbp), %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x58(%rbp)
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x42a0
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x58(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x30(%rbp), %xmm0
movq (%rcx), %rcx
movslq -0x14(%rbp), %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0x50(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x28(%rbp), %xmm0
subsd -0x30(%rbp), %xmm0
movsd -0x28(%rbp), %xmm2
subsd -0x30(%rbp), %xmm2
movsd -0x20(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x44225
movq -0x40(%rbp), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movslq -0x14(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movslq -0x14(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x30(%rbp)
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x4414b
jp 0x4414b
jmp 0x441f1
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
movsd -0x28(%rbp), %xmm0
movq (%rcx), %rcx
movslq -0x14(%rbp), %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x68(%rbp)
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x42a0
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x68(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x30(%rbp), %xmm0
movq (%rcx), %rcx
movslq -0x14(%rbp), %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x60(%rbp)
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0x60(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x28(%rbp), %xmm0
subsd -0x30(%rbp), %xmm0
movsd -0x28(%rbp), %xmm2
subsd -0x30(%rbp), %xmm2
movsd -0x20(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x44225
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,8), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movslq -0x14(%rbp), %rdx
cmpl (%rcx,%rdx,8), %eax
je 0x44223
movsd 0x9ddff(%rip), %xmm0    # 0xe2018
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x44225
jmp 0x44227
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x43faf
jmp 0x44237
movsd -0x20(%rbp), %xmm0
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)