// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/dataset.c
// Function: volume_overlap_region
double volume_overlap_region(Datasetptr d)
{
 /* multiclass is handled by one vs one */
 Instanceptr traindata;
 int i, j, k;
 double result = 0, classsum, min1, max1, min2, max2;
 read_from_train_file(d, &traindata);
 realize(traindata);
 exchange_classdefno(d);
 result = 1;
 for (i = 0; i < d->multifeaturecount; i++)
  {
   if (i != d->classdefno)
    {   
     classsum = 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);
         classsum += (fmin(max1, max2) - fmax(min1, min2)) / (fmax(max1, max2) + fmin(min1, min2));
        }
      }
     result *= (classsum / (d->classno * (d->classno - 1) / 2));
    }
  }
 exchange_classdefno(d); 
 deallocate(traindata);
 traindata = NULL;
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x5c7af
movq (%r14), %rdi
callq 0x10964
leaq 0x1407128(%rbx), %r12
leaq 0x1407138(%rbx), %rsi
movq %r12, %rdi
movq %rsi, 0x20(%rsp)
callq 0x395a3
cmpl $0x0, 0x1c0(%rbx)
jle 0x19a53
xorl %ebp, %ebp
movsd 0x88c35(%rip), %xmm0    # 0xa2520
movsd %xmm0, 0x8(%rsp)
leaq 0x40(%rsp), %r15
leaq 0x38(%rsp), %r14
movq %r12, 0x28(%rsp)
cmpl (%r12), %ebp
je 0x19a43
movl 0x10(%rbx), %eax
testl %eax, %eax
jle 0x19a10
xorl %ecx, %ecx
xorpd %xmm1, %xmm1
movl %ecx, %r12d
leal 0x1(%r12), %r13d
cmpl 0x10(%rbx), %r13d
movl %r13d, 0x1c(%rsp)
jge 0x199ff
movsd %xmm1, 0x30(%rsp)
movq 0x10(%rsp), %rdi
movl %ebp, %esi
movl %r12d, %edx
leaq 0x50(%rsp), %rcx
leaq 0x48(%rsp), %r8
callq 0x10f78
movq 0x10(%rsp), %rdi
movl %ebp, %esi
movl %r13d, %edx
movq %r15, %rcx
movq %r14, %r8
callq 0x10f78
movsd 0x48(%rsp), %xmm2
movsd 0x38(%rsp), %xmm1
ucomisd %xmm2, %xmm2
movapd %xmm1, %xmm0
jp 0x19984
movapd %xmm1, %xmm0
maxsd %xmm2, %xmm0
movsd 0x50(%rsp), %xmm4
movsd 0x40(%rsp), %xmm3
ucomisd %xmm4, %xmm4
movapd %xmm3, %xmm5
jp 0x199a2
movapd %xmm3, %xmm5
minsd %xmm4, %xmm5
addsd %xmm5, %xmm0
movapd %xmm2, %xmm5
cmpunordsd %xmm2, %xmm5
movapd %xmm5, %xmm6
andpd %xmm1, %xmm6
minsd %xmm2, %xmm1
andnpd %xmm1, %xmm5
orpd %xmm6, %xmm5
movapd %xmm4, %xmm1
cmpunordsd %xmm4, %xmm1
movapd %xmm1, %xmm2
andpd %xmm3, %xmm2
maxsd %xmm4, %xmm3
andnpd %xmm3, %xmm1
orpd %xmm2, %xmm1
subsd %xmm1, %xmm5
divsd %xmm0, %xmm5
movsd 0x30(%rsp), %xmm1
addsd %xmm5, %xmm1
incl %r13d
cmpl 0x10(%rbx), %r13d
jl 0x19932
movl 0x10(%rbx), %eax
movl 0x1c(%rsp), %ecx
cmpl %eax, %ecx
jl 0x1991b
jmp 0x19a14
xorpd %xmm1, %xmm1
leal -0x1(%rax), %ecx
imull %eax, %ecx
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x28(%rsp), %r12
incl %ebp
cmpl 0x1c0(%rbx), %ebp
jl 0x19900
jmp 0x19a61
movsd 0x88ac5(%rip), %xmm0    # 0xa2520
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
movq 0x20(%rsp), %rsi
callq 0x395a3
movq 0x10(%rsp), %rdi
callq 0x2f616
movsd 0x8(%rsp), %xmm0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq