// File: /workspace/github_c_makefile_star2_O3/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, %rbp
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x5dcbd
movq (%r14), %rdi
callq 0x10954
leaq 0x1407128(%rbp), %r12
leaq 0x1407138(%rbp), %rsi
movq %r12, %rdi
movq %rsi, 0x20(%rsp)
callq 0x3a5af
movl 0x1c0(%rbp), %eax
testl %eax, %eax
jle 0x19f4e
xorl %edi, %edi
movsd 0x8b71c(%rip), %xmm1    # 0xa5520
leaq 0x50(%rsp), %rcx
leaq 0x48(%rsp), %r14
movq %r12, 0x28(%rsp)
cmpl (%r12), %edi
je 0x19f42
movl 0x10(%rbp), %esi
testl %esi, %esi
jle 0x19f20
movl %edi, 0x4(%rsp)
movsd %xmm1, 0x8(%rsp)
xorl %eax, %eax
xorpd %xmm2, %xmm2
movl %eax, %ebx
leal 0x1(%rbx), %r13d
cmpl %esi, %r13d
movl %r13d, 0x1c(%rsp)
jge 0x19efd
movl 0x4(%rsp), %r12d
movsd %xmm2, 0x30(%rsp)
movq 0x10(%rsp), %rdi
movl %r12d, %esi
movl %ebx, %edx
movq %rcx, %r15
movq %r14, %r8
callq 0x10f4d
movq 0x10(%rsp), %rdi
movl %r12d, %esi
movl %r13d, %edx
leaq 0x40(%rsp), %rcx
leaq 0x38(%rsp), %r8
callq 0x10f4d
movq %r15, %rcx
movsd 0x48(%rsp), %xmm0
movhpd 0x50(%rsp), %xmm0       # xmm0 = xmm0[0],mem[0]
movsd 0x38(%rsp), %xmm1
movhpd 0x40(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0]
movapd %xmm1, %xmm2
maxpd %xmm0, %xmm2
movapd %xmm1, %xmm3
minpd %xmm0, %xmm1
cmpunordpd %xmm0, %xmm0
movapd %xmm0, %xmm4
andpd %xmm0, %xmm3
andnpd %xmm2, %xmm4
orpd %xmm3, %xmm4
andnpd %xmm1, %xmm0
orpd %xmm3, %xmm0
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
addsd %xmm4, %xmm1
pshufd $0xee, %xmm4, %xmm2     # xmm2 = xmm4[2,3,2,3]
subsd %xmm2, %xmm0
movsd 0x30(%rsp), %xmm2
divsd %xmm1, %xmm0
addsd %xmm0, %xmm2
incl %r13d
movl 0x10(%rbp), %esi
cmpl %esi, %r13d
jl 0x19e51
movl 0x1c(%rsp), %eax
cmpl %esi, %eax
jl 0x19e38
movl 0x1c0(%rbp), %eax
movq 0x28(%rsp), %r12
movsd 0x8(%rsp), %xmm1
movl 0x4(%rsp), %edi
jmp 0x19f24
xorpd %xmm2, %xmm2
leal -0x1(%rsi), %edx
imull %esi, %edx
movl %edx, %esi
shrl $0x1f, %esi
addl %edx, %esi
sarl %esi
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
divsd %xmm0, %xmm2
mulsd %xmm2, %xmm1
incl %edi
cmpl %eax, %edi
jl 0x19e13
jmp 0x19f56
movsd 0x8b5ca(%rip), %xmm1    # 0xa5520
movsd %xmm1, 0x8(%rsp)
movq %r12, %rdi
movq 0x20(%rsp), %rsi
callq 0x3a5af
movq 0x10(%rsp), %rdi
callq 0x2ff55
movsd 0x8(%rsp), %xmm0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq