// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x18(%rbp)
movl %esi, -0x1c(%rbp)
leaq 0x5a83a(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x1c(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, -0x2c(%rbp)
movslq -0x2c(%rbp), %rdi
movl $0x4, %esi
leaq 0x413da(%rip), %rdx     # 0xec40d
movl $0x3, %ecx
callq 0x52f40
movq %rax, -0x38(%rbp)
movl -0x2c(%rbp), %edi
movl -0x2c(%rbp), %esi
callq 0x57fc0
movq %rax, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0xab0cd
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
leaq 0x5a7bc(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0xab0c0
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x38(%rbp), %rax
movslq -0x20(%rbp), %rcx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xab07a
jmp 0xab0c2
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xab06b
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0xab22d
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0xab21d
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
leaq 0x5a732(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0xab1d1
movq -0x38(%rbp), %rax
movslq -0x20(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0xab1c1
movq -0x38(%rbp), %rax
movslq -0x24(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0xab1c1
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movq -0x38(%rbp), %rax
movslq -0x20(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
xorps %xmm2, %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x24(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
movq -0x38(%rbp), %rax
movslq -0x24(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm2
xorps %xmm3, %xmm3
addsd %xmm3, %xmm2
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movaps 0x37cad(%rip), %xmm1    # 0xe2e60
pand %xmm1, %xmm0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
jmp 0xab1c3
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xab104
movsd -0x40(%rbp), %xmm0
mulsd -0x40(%rbp), %xmm0
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x24(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x40(%rbp), %xmm0
mulsd -0x40(%rbp), %xmm0
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xab0e9
jmp 0xab21f
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xab0d4
movq -0x38(%rbp), %rdi
callq 0x52e80
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)