// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/rise.c
// Function: distance_between_discrete_values_of_feature
matrix distance_between_discrete_values_of_feature(int*** feature_counts, int fno)
{
 int i, j, k, count = current_dataset->features[fno].valuecount, *counts;
 double distance;
 matrix result;
 counts = safecalloc(count, sizeof(int), "distance_between_discrete_values_of_feature", 3);
 result = matrix_alloc(count, count);
 for (i = 0; i < count; i++)
   for (j = 0; j < current_dataset->classno; j++)
     counts[i] += feature_counts[j][fno][i];
 for (i = 0; i < count; i++)
   for (j = i + 1; j < count; j++)
    {
     distance = 0.0;
     for (k = 0; k < current_dataset->classno; k++)
       if (counts[i] > 0 && counts[j] > 0)
         distance += fabs(feature_counts[k][fno][i] / (counts[i] + 0.0) - feature_counts[k][fno][j] / (counts[j] + 0.0));
     result.values[i][j] = distance * distance;
     result.values[j][i] = distance * distance;
    }
 safe_free(counts);
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x5d99b(%rip), %rax     # 0xcd870
movq (%rax), %rax
movslq %esi, %r15
imulq $0x340, %r15, %rcx      # imm = 0x340
movl 0x30f20(%rax,%rcx), %ebp
movslq %ebp, %r13
leaq 0x2fd3d(%rip), %rdx     # 0x9fc30
pushq $0x4
popq %rsi
pushq $0x3
popq %rcx
movq %r13, %rdi
callq 0x35067
movq %rax, %r14
movl %r13d, %edi
movl %r13d, %esi
callq 0x380d3
movq %rax, 0x8(%rsp)
movq %rdx, %r12
leaq 0x5d952(%rip), %rax     # 0xcd870
movq (%rax), %rcx
xorl %edx, %edx
testl %r13d, %r13d
movl $0x0, %eax
cmovgl %ebp, %eax
cmpq %rax, %rdx
je 0x6ff57
xorl %esi, %esi
movslq 0x10(%rcx), %rdi
cmpq %rdi, %rsi
jge 0x6ff52
movq (%rbx,%rsi,8), %rdi
movq (%rdi,%r15,8), %rdi
movl (%rdi,%rdx,4), %edi
addl %edi, (%r14,%rdx,4)
incq %rsi
jmp 0x6ff35
incq %rdx
jmp 0x6ff2e
pushq $0x1
popq %rcx
xorl %edx, %edx
movdqa 0x2fcbc(%rip), %xmm0    # 0x9fc20
movapd 0x26274(%rip), %xmm1    # 0x961e0
xorl %esi, %esi
movq %rax, 0x10(%rsp)
cmpq %rax, %rsi
je 0x70037
leaq 0x5d8ed(%rip), %rax     # 0xcd870
movq (%rax), %rdi
movq %rcx, %r8
cmpl %r8d, %ebp
jle 0x70027
movl 0x10(%rdi), %r9d
testl %r9d, %r9d
cmovlel %edx, %r9d
xorpd %xmm2, %xmm2
xorl %r10d, %r10d
cmpq %r10, %r9
je 0x70008
movl (%r14,%rsi,4), %r11d
testl %r11d, %r11d
jle 0x70003
movl (%r14,%r8,4), %r13d
testl %r13d, %r13d
jle 0x70003
movq (%rbx,%r10,8), %rax
movq (%rax,%r15,8), %rax
movd %r13d, %xmm3
movd %r11d, %xmm4
punpcklqdq %xmm3, %xmm4    # xmm4 = xmm4[0],xmm3[0]
por %xmm0, %xmm4
subpd %xmm0, %xmm4
movss (%rax,%r8,4), %xmm3
movss (%rax,%rsi,4), %xmm5
unpcklps %xmm3, %xmm5            # xmm5 = xmm5[0],xmm3[0],xmm5[1],xmm3[1]
cvtdq2pd %xmm5, %xmm3
divpd %xmm4, %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
subsd %xmm4, %xmm3
andpd %xmm1, %xmm3
addsd %xmm3, %xmm2
incq %r10
jmp 0x6ffa4
mulsd %xmm2, %xmm2
movq (%r12,%rsi,8), %rax
movsd %xmm2, (%rax,%r8,8)
movq (%r12,%r8,8), %rax
movsd %xmm2, (%rax,%rsi,8)
incq %r8
jmp 0x6ff89
incq %rsi
incq %rcx
movq 0x10(%rsp), %rax
jmp 0x6ff73
movq %r14, %rdi
callq 0x34ff7
movq 0x8(%rsp), %rax
movq %r12, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq