// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/dataset.c
// Function: nn_nonlinearity
double nn_nonlinearity(Datasetptr d, Instanceptr testdata)
{
 /*!Last Changed 07.05.2006 Oya*/
 Instance mean, variance;
 Instanceptr temp, traindata, *nearestneighbors;
 int count, cno1, cno2;
 double result = 0;
 int intranum = 0, internum = 0;
 read_from_train_file(d, &traindata);
 mean = find_mean(traindata);
 variance = find_variance(traindata);
 normalize(traindata, mean, variance);
 normalize(testdata, mean, variance);
 type_change(d);
 temp = testdata;
 count = 1;
 while (temp)
  {
   nearestneighbors = find_nearest_neighbors(traindata, temp, count);
   cno1 = give_classno(nearestneighbors[0]);
   cno2 = give_classno(temp);
   if (cno1 == cno2)
     intranum++;
   else
     internum++;
   temp = temp->next;
   safe_free(nearestneighbors);
  }
 result = (double) internum / (internum + intranum);
 safe_free(mean.values);
 safe_free(variance.values);
 deallocate(traindata);
 type_restore(d);
 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
movl $0x0, -0xa4(%rbp)
movl $0x0, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x85c60
movq -0x80(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
callq 0x19b30
leaq -0x40(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
movl $0x30, %edx
callq 0x42b0
movq -0x80(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x1a0a0
leaq -0x70(%rbp), %rdi
leaq -0x108(%rbp), %rsi
movl $0x30, %edx
callq 0x42b0
movq -0x80(%rbp), %rdi
movups -0x70(%rbp), %xmm0
movups -0x60(%rbp), %xmm1
movups -0x50(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x50(%rax)
movups %xmm1, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x16db0
movq -0x10(%rbp), %rdi
movups -0x70(%rbp), %xmm0
movups -0x60(%rbp), %xmm1
movups -0x50(%rbp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x50(%rax)
movups %xmm1, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups -0x40(%rbp), %xmm0
movups -0x30(%rbp), %xmm1
movups -0x20(%rbp), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x16db0
movq -0x8(%rbp), %rdi
callq 0x22930
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movl $0x1, -0x8c(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x2592e
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
movl -0x8c(%rbp), %edx
callq 0x467e0
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq (%rax), %rdi
callq 0x43530
movl %eax, -0x90(%rbp)
movq -0x78(%rbp), %rdi
callq 0x43530
movl %eax, -0x94(%rbp)
movl -0x90(%rbp), %eax
cmpl -0x94(%rbp), %eax
jne 0x25902
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x25911
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x88(%rbp), %rdi
callq 0x52e80
jmp 0x2589a
cvtsi2sdl -0xa8(%rbp), %xmm0
movl -0xa8(%rbp), %eax
addl -0xa4(%rbp), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
movq -0x40(%rbp), %rdi
callq 0x52e80
movq -0x70(%rbp), %rdi
callq 0x52e80
movq -0x80(%rbp), %rdi
callq 0x44510
movq -0x8(%rbp), %rdi
callq 0x229e0
movsd -0xa0(%rbp), %xmm0
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopw (%rax,%rax)