// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/dataset.c
// Function: feature_efficiency
double feature_efficiency(Datasetptr d, double *overlap)
{
 /* multiclass is handled by one vs one */
 Instanceptr traindata;
 int i, j, k, ccount=0;
 double result = 0, maxefficiency, min1, max1, min2, max2;
 double efficiency, binoverlap;
 read_from_train_file(d, &traindata);
 realize(traindata);
 exchange_classdefno(d);
 maxefficiency = 0;
 *overlap = 1;
 for (i = 0; i < d->multifeaturecount; i++)
  {
   if (i != d->classdefno)
    {
     binoverlap = 0;
     efficiency = 0;
     for (j = 0; j < d->classno; j++)
      {
       for (k = j + 1; k < d->classno; k++)
        {
         find_bounds_of_feature_class(traindata, i, j, &min1, &max1);
         find_bounds_of_feature_class(traindata, i, k, &min2, &max2);
         ccount = 0;
         if (max1 > max2)
           ccount += find_thresholded_class_count(traindata, j, i, max2, UPPER);
         else
           ccount += find_thresholded_class_count(traindata, k, i, max1, UPPER);     
         if (min1 > min2)
           ccount += find_thresholded_class_count(traindata, k, i, min1, LOWER);
         else
           ccount += find_thresholded_class_count(traindata, j, i, min2, LOWER);     
         binoverlap += (fmin(max1, max2) - fmax(min1, min2)) / (fmax(max1, max2) + fmin(min1, min2));
         efficiency += ((double) ccount / (d->classcounts[j] + d->classcounts[k]));     
        }
      }
     *overlap *= (binoverlap / (d->classno * (d->classno - 1) / 2));
     if (efficiency > maxefficiency)
       maxefficiency = efficiency;
    }
  }
 result = (maxefficiency / (d->classno * (d->classno - 1) / 2));
 exchange_classdefno(d);
 deallocate(traindata);
 traindata = NULL;
 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x28(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x85c60
movq -0x18(%rbp), %rdi
callq 0x17090
movq -0x8(%rbp), %rdi
callq 0x1a880
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movsd 0xbd2c6(%rip), %xmm0    # 0xe2018
movsd %xmm0, (%rax)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1c0(%rcx), %eax
jge 0x24ff0
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1407128(%rcx), %eax
je 0x24fe0
xorps %xmm0, %xmm0
movsd %xmm0, -0x68(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x24f93
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x24f83
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
leaq -0x40(%rbp), %rcx
leaq -0x48(%rbp), %r8
callq 0x17a00
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x24(%rbp), %edx
leaq -0x50(%rbp), %rcx
leaq -0x58(%rbp), %r8
callq 0x17a00
movl $0x0, -0x28(%rbp)
movsd -0x48(%rbp), %xmm0
ucomisd -0x58(%rbp), %xmm0
jbe 0x24e25
movq -0x18(%rbp), %rdi
movl -0x20(%rbp), %esi
movl -0x1c(%rbp), %edx
movsd -0x58(%rbp), %xmm0
movl $0x1, %ecx
callq 0x17af0
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x24e44
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x1c(%rbp), %edx
movsd -0x48(%rbp), %xmm0
movl $0x1, %ecx
callq 0x17af0
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movsd -0x40(%rbp), %xmm0
ucomisd -0x50(%rbp), %xmm0
jbe 0x24e6e
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x1c(%rbp), %edx
movsd -0x40(%rbp), %xmm0
xorl %ecx, %ecx
callq 0x17af0
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x24e8a
movq -0x18(%rbp), %rdi
movl -0x20(%rbp), %esi
movl -0x1c(%rbp), %edx
movsd -0x50(%rbp), %xmm0
xorl %ecx, %ecx
callq 0x17af0
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movsd -0x48(%rbp), %xmm3
movsd -0x58(%rbp), %xmm2
movaps %xmm2, %xmm4
movaps %xmm3, %xmm0
cmpunordsd %xmm0, %xmm0
movaps %xmm0, %xmm1
pand %xmm4, %xmm1
minsd %xmm3, %xmm2
pandn %xmm2, %xmm0
por %xmm1, %xmm0
movsd -0x40(%rbp), %xmm4
movsd -0x50(%rbp), %xmm3
movaps %xmm3, %xmm5
movaps %xmm4, %xmm1
cmpunordsd %xmm1, %xmm1
movaps %xmm1, %xmm2
pand %xmm5, %xmm2
maxsd %xmm4, %xmm3
pandn %xmm3, %xmm1
por %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd -0x48(%rbp), %xmm4
movsd -0x58(%rbp), %xmm3
movaps %xmm3, %xmm5
movaps %xmm4, %xmm1
cmpunordsd %xmm1, %xmm1
movaps %xmm1, %xmm2
pand %xmm5, %xmm2
maxsd %xmm4, %xmm3
pandn %xmm3, %xmm1
por %xmm2, %xmm1
movsd -0x40(%rbp), %xmm5
movsd -0x50(%rbp), %xmm4
movaps %xmm4, %xmm6
movaps %xmm5, %xmm2
cmpunordsd %xmm2, %xmm2
movaps %xmm2, %xmm3
pand %xmm6, %xmm3
minsd %xmm5, %xmm4
pandn %xmm4, %xmm2
por %xmm3, %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
addsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
cvtsi2sdl -0x28(%rbp), %xmm0
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl 0x1407140(%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movslq -0x24(%rbp), %rdx
addl 0x1407140(%rcx,%rdx,4), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
addsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x24db3
jmp 0x24f85
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x24d9a
movsd -0x68(%rbp), %xmm0
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
imull %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
mulsd (%rax), %xmm0
movsd %xmm0, (%rax)
movsd -0x60(%rbp), %xmm0
ucomisd -0x38(%rbp), %xmm0
jbe 0x24fde
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
jmp 0x24fe0
jmp 0x24fe2
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x24d5d
movsd -0x38(%rbp), %xmm0
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
imull %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1a880
movq -0x18(%rbp), %rdi
callq 0x44510
movq $0x0, -0x18(%rbp)
movsd -0x30(%rbp), %xmm0
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)