// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/data.c
// Function: normalize_instance
void normalize_instance(Instanceptr myptr, Instance mean, Instance variance)
{
 int i;
 double sum;
 Instanceptr temp;
 NORMALIZATION_TYPE normtype = get_parameter_l("normalization"); 
 temp = myptr;
 if (mustrealize)
  {
   if (normtype == VECTOR_NORMALIZATION)
    {
     sum = 0.0;
     for (i = 0; i < current_dataset->multifeaturecount; i++)
       if (i != current_dataset->classdefno)
         sum += temp->values[i].floatvalue * temp->values[i].floatvalue;
    }
   for (i = 0; i < current_dataset->multifeaturecount; i++)
     if (i != current_dataset->classdefno)
       switch (normtype)
        {
         case        Z_NORMALIZATION:if (variance.values[i].floatvalue != 0)
                                       temp->values[i].floatvalue = (double) ((temp->values[i].floatvalue - mean.values[i].floatvalue) / sqrt(variance.values[i].floatvalue));
                                     break;
         case STANDARD_NORMALIZATION:temp->values[i].floatvalue = (temp->values[i].floatvalue - current_dataset->features[i].min.floatvalue) / (current_dataset->features[i].max.floatvalue - current_dataset->features[i].min.floatvalue);
                                     break;
         case   VECTOR_NORMALIZATION:if (sum != 0)
                                       temp->values[i].floatvalue = temp->values[i].floatvalue / sqrt(sum);
                                     break;
        } 
  }
 else
  {
   if (normtype == VECTOR_NORMALIZATION)
    {
     sum = 0.0;
     for (i = 0; i < current_dataset->featurecount; i++)
       switch (current_dataset->features[i].type)
        {     
         case INTEGER:sum += temp->values[i].intvalue * temp->values[i].intvalue;
                      break;
         case    REAL:sum += temp->values[i].floatvalue * temp->values[i].floatvalue;
                      break;
        }     
    }
   for (i = 0; i < current_dataset->featurecount; i++)
     switch (current_dataset->features[i].type)
      {
       case INTEGER:switch (normtype)
                     {
                      case        Z_NORMALIZATION:if (variance.values[i].floatvalue != 0)
                                                    temp->values[i].floatvalue = (double) ((temp->values[i].intvalue - mean.values[i].floatvalue) / sqrt(variance.values[i].floatvalue));
                                                  else
                                                    temp->values[i].floatvalue = (double) (temp->values[i].intvalue);
                                                  break;
                      case STANDARD_NORMALIZATION:temp->values[i].floatvalue = (temp->values[i].intvalue - current_dataset->features[i].min.intvalue) / (current_dataset->features[i].max.intvalue - current_dataset->features[i].min.intvalue + 0.0);
                                                  break;
                      case   VECTOR_NORMALIZATION:if (sum != 0)
                                                    temp->values[i].floatvalue = temp->values[i].intvalue / sqrt(sum);
                                                  break;
                     }
                    break;
       case    REAL:switch (normtype)
                     {
                      case        Z_NORMALIZATION:if (variance.values[i].floatvalue != 0)
                                                    temp->values[i].floatvalue = (double) ((temp->values[i].floatvalue-mean.values[i].floatvalue) / sqrt(variance.values[i].floatvalue));
                                                  break;
                      case STANDARD_NORMALIZATION:temp->values[i].floatvalue = (temp->values[i].floatvalue - current_dataset->features[i].min.floatvalue) / (current_dataset->features[i].max.floatvalue - current_dataset->features[i].min.floatvalue);
                                                  break;
                      case   VECTOR_NORMALIZATION:if (sum != 0)
                                                    temp->values[i].floatvalue = temp->values[i].floatvalue / sqrt(sum);
                                                  break;
                     }
                    break;
      }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
leaq 0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq %rdi, -0x8(%rbp)
leaq 0xcc92a(%rip), %rdi     # 0xe2fe0
callq 0x792b0
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x3cb8a7(%rip), %rax    # 0x3e1f74
cmpl $0x0, (%rax)
je 0x16927
cmpl $0x2, -0x24(%rbp)
jne 0x16756
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
leaq 0xef14b(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x1c0(%rcx), %eax
jge 0x16754
movl -0xc(%rbp), %eax
leaq 0xef136(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x1407128(%rcx), %eax
je 0x16747
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x18(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0x16749
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x166eb
jmp 0x16756
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
leaq 0xef0d9(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x1c0(%rcx), %eax
jge 0x16922
movl -0xc(%rbp), %eax
leaq 0xef0c0(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x1407128(%rcx), %eax
je 0x16912
movl -0x24(%rbp), %eax
movl %eax, -0x3c(%rbp)
testl %eax, %eax
je 0x167ba
jmp 0x1679b
movl -0x3c(%rbp), %eax
subl $0x1, %eax
je 0x16832
jmp 0x167a9
movl -0x3c(%rbp), %eax
subl $0x2, %eax
je 0x168c1
jmp 0x16910
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x167d7
jp 0x167d7
jmp 0x1682d
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rdx
movq (%rdx), %rdx
movslq -0xc(%rbp), %rsi
movsd (%rdx,%rsi,8), %xmm0
movq (%rcx), %rcx
movslq -0xc(%rbp), %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x48(%rbp)
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x16910
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0xeeff7(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
subsd 0x8(%rax), %xmm0
leaq 0xeefd4(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movsd 0x10(%rax), %xmm1
leaq 0xeefb1(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
subsd 0x8(%rax), %xmm1
divsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x16910
movsd -0x18(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x168d3
jp 0x168d3
jmp 0x1690e
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0x50(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x16910
jmp 0x16912
jmp 0x16914
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1675d
jmp 0x16d9b
cmpl $0x2, -0x24(%rbp)
jne 0x169f9
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
leaq 0xeeef6(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x1bc(%rcx), %eax
jge 0x169f7
leaq 0xeeee0(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movl 0x30f08(%rax,%rcx), %eax
movl %eax, -0x54(%rbp)
testl %eax, %eax
je 0x16988
jmp 0x1697e
movl -0x54(%rbp), %eax
subl $0x2, %eax
je 0x169b5
jmp 0x169e7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,8), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
movslq -0xc(%rbp), %rdx
imull (%rcx,%rdx,8), %eax
cvtsi2sd %eax, %xmm0
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0x169e7
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x18(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0x169e9
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x16940
jmp 0x169f9
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
leaq 0xeee36(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x1bc(%rcx), %eax
jge 0x16d99
leaq 0xeee20(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movl 0x30f08(%rax,%rcx), %eax
movl %eax, -0x58(%rbp)
testl %eax, %eax
je 0x16a4f
jmp 0x16a3e
movl -0x58(%rbp), %eax
subl $0x2, %eax
je 0x16c00
jmp 0x16d89
movl -0x24(%rbp), %eax
movl %eax, -0x5c(%rbp)
testl %eax, %eax
je 0x16a7a
jmp 0x16a5b
movl -0x5c(%rbp), %eax
subl $0x1, %eax
je 0x16b14
jmp 0x16a69
movl -0x5c(%rbp), %eax
subl $0x2, %eax
je 0x16bac
jmp 0x16bfb
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x16a97
jp 0x16a97
jmp 0x16aef
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rdx
movq (%rdx), %rdx
movslq -0xc(%rbp), %rsi
cvtsi2sdl (%rdx,%rsi,8), %xmm0
movq (%rcx), %rcx
movslq -0xc(%rbp), %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x68(%rbp)
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0x68(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x16b0f
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x16bfb
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,8), %eax
leaq 0xeed17(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
addq $0x30f08, %rcx          # imm = 0x30F08
movslq -0xc(%rbp), %rdx
imulq $0x340, %rdx, %rdx      # imm = 0x340
addq %rdx, %rcx
subl 0x8(%rcx), %eax
cvtsi2sd %eax, %xmm0
leaq 0xeecf1(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl 0x10(%rax), %eax
leaq 0xeecd0(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
addq $0x30f08, %rcx          # imm = 0x30F08
movslq -0xc(%rbp), %rdx
imulq $0x340, %rdx, %rdx      # imm = 0x340
addq %rdx, %rcx
subl 0x8(%rcx), %eax
cvtsi2sd %eax, %xmm1
xorps %xmm2, %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x16bfb
movsd -0x18(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x16bbe
jp 0x16bbe
jmp 0x16bf9
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0x70(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x16bfb
jmp 0x16d89
movl -0x24(%rbp), %eax
movl %eax, -0x74(%rbp)
testl %eax, %eax
je 0x16c2b
jmp 0x16c0c
movl -0x74(%rbp), %eax
subl $0x1, %eax
je 0x16ca3
jmp 0x16c1a
movl -0x74(%rbp), %eax
subl $0x2, %eax
je 0x16d32
jmp 0x16d87
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x16c48
jp 0x16c48
jmp 0x16c9e
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rdx
movq (%rdx), %rdx
movslq -0xc(%rbp), %rsi
movsd (%rdx,%rsi,8), %xmm0
movq (%rcx), %rcx
movslq -0xc(%rbp), %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x80(%rbp)
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0x80(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x16d87
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0xeeb86(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
subsd 0x8(%rax), %xmm0
leaq 0xeeb63(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movsd 0x10(%rax), %xmm1
leaq 0xeeb40(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
subsd 0x8(%rax), %xmm1
divsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x16d87
movsd -0x18(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x16d44
jp 0x16d44
jmp 0x16d85
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x42a0
movaps %xmm0, %xmm1
movsd -0x88(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x16d87
jmp 0x16d89
jmp 0x16d8b
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x16a00
jmp 0x16d9b
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)