// File: /workspace/github_c_makefile_star2_O3/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 0x5b4f1(%rip), %r12     # 0xd5870
movq (%r12), %rax
movslq %esi, %rbp
imulq $0x340, %rbp, %rcx      # imm = 0x340
movslq 0x30f20(%rax,%rcx), %r14
leaq 0x35961(%rip), %rdx     # 0xafcfd
movl $0x4, %esi
movq %r14, %rdi
movl $0x3, %ecx
callq 0x3a1fc
movq %rax, %r15
movl %r14d, %edi
movl %r14d, %esi
callq 0x3d79d
movq %rax, 0x8(%rsp)
movq %rdx, %r13
testq %r14, %r14
jle 0x7a4e4
movq (%r12), %rax
movl 0x10(%rax), %edx
xorl %ecx, %ecx
testl %edx, %edx
jle 0x7a3fb
movl (%r15,%rcx,4), %esi
xorl %edi, %edi
movq (%rbx,%rdi,8), %rdx
movq (%rdx,%rbp,8), %rdx
addl (%rdx,%rcx,4), %esi
movl %esi, (%r15,%rcx,4)
incq %rdi
movslq 0x10(%rax), %rdx
cmpq %rdx, %rdi
jl 0x7a3e0
incq %rcx
cmpq %r14, %rcx
jne 0x7a3d6
testl %r14d, %r14d
jle 0x7a4e4
movq (%r12), %rax
movq %rax, 0x10(%rsp)
movl $0x1, %ecx
xorl %edx, %edx
movapd 0x2bdbc(%rip), %xmm0    # 0xa61e0
movq %rdx, %rsi
incq %rdx
cmpq %r14, %rdx
jge 0x7a4d8
movq 0x10(%rsp), %rax
movl 0x10(%rax), %edi
movq (%r13,%rsi,8), %r8
movq %rcx, %r9
testl %edi, %edi
jle 0x7a4b4
movl (%r15,%rsi,4), %r10d
xorps %xmm2, %xmm2
cvtsi2sd %r10d, %xmm2
xorpd %xmm1, %xmm1
xorl %r11d, %r11d
testl %r10d, %r10d
jle 0x7a4aa
movl (%r15,%r9,4), %r12d
testl %r12d, %r12d
jle 0x7a4aa
movq (%rbx,%r11,8), %rax
movq (%rax,%rbp,8), %rax
xorps %xmm3, %xmm3
cvtsi2sd %r12d, %xmm3
movss (%rax,%r9,4), %xmm4
movss (%rax,%rsi,4), %xmm5
unpcklps %xmm4, %xmm5            # xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1]
cvtdq2pd %xmm5, %xmm4
movapd %xmm2, %xmm5
unpcklpd %xmm3, %xmm5            # xmm5 = xmm5[0],xmm3[0]
divpd %xmm5, %xmm4
movapd %xmm4, %xmm3
unpckhpd %xmm4, %xmm3            # xmm3 = xmm3[1],xmm4[1]
subsd %xmm3, %xmm4
andpd %xmm0, %xmm4
addsd %xmm4, %xmm1
incq %r11
cmpq %r11, %rdi
jne 0x7a45a
jmp 0x7a4b8
xorpd %xmm1, %xmm1
mulsd %xmm1, %xmm1
movsd %xmm1, (%r8,%r9,8)
movq (%r13,%r9,8), %rax
movsd %xmm1, (%rax,%rsi,8)
incq %r9
cmpq %r14, %r9
jne 0x7a443
incq %rcx
cmpq %r14, %rdx
jne 0x7a424
movq %r15, %rdi
callq 0x3a180
movq 0x8(%rsp), %rax
movq %r13, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq