// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/univariaterule.c
// Function: find_best_condition_for_realized_features
Decisionconditionptr find_best_condition_for_realized_features(Instanceptr growset, int positive)
{
 /*!Last Changed 22.01.2004*/
 int i, j, size, tpositive, t, tdotpositive, tdot, equal, equalpositive;
 Instanceptr instancelist, tmp;
 double bestgain = 0, valuebefore, value, it;
 Decisionconditionptr result;
 result = empty_condition();
 result->conditiontype = HYBRID_CONDITION;
 result->freeparam = 1;
 tmp = growset;
 tpositive = 0;
 t = 0;
 while (tmp)
  {
   t++;
   if (give_classno(tmp) == positive)
     tpositive++;
   tmp = tmp->next;
  }
 if (tpositive == 0)
  {
   safe_free(result);
   return NULL;
  }
 it = information(tpositive, t);
 for (i = 0; i < current_dataset->multifeaturecount - 1; i++)
  { 
   instancelist = sort_instances(growset, i, &size);
   valuebefore = real_feature(&(instancelist[0]), i);
   tdot = 1;
   if (give_classno(&(instancelist[0])) == positive)
     tdotpositive = 1;
   else
     tdotpositive = 0;
   equalpositive = tdotpositive;
   equal = 1;
   for (j = 1; j < size; j++)
    {
     value = real_feature(&(instancelist[j]), i);
     if (value != valuebefore)
      {
       check_for_bestgain(tdotpositive, tdot, it, &bestgain, result, '<', valuebefore + DBL_EPSILON, i);
       check_for_bestgain(tpositive - tdotpositive + equalpositive, t - tdot + equal, it, &bestgain, result, '>', valuebefore - DBL_EPSILON, i);
       valuebefore = value;
       equal = 0;
       equalpositive = 0;
      }
     equal++;
     if (give_classno(&(instancelist[j])) == positive)
      {
       tdotpositive++;
       equalpositive++;
      }
     tdot++;
    }
   check_for_bestgain(equalpositive, equal, it, &bestgain, result, '>', value - DBL_EPSILON, i);
   safe_free(instancelist);
  }
 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
movb $0x0, %al
callq 0xadea0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl $0x2, 0x40(%rax)
movq -0x70(%rbp), %rax
movl $0x1, 0x3c(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0xda403
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movq -0x48(%rbp), %rdi
callq 0x43530
cmpl -0x14(%rbp), %eax
jne 0xda3f5
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0xda3ce
cmpl $0x0, -0x24(%rbp)
jne 0xda41f
movq -0x70(%rbp), %rdi
callq 0x52e80
movq $0x0, -0x8(%rbp)
jmp 0xda610
movl -0x24(%rbp), %edi
movl -0x28(%rbp), %esi
callq 0xae3a0
movsd %xmm0, -0x68(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
leaq 0x2b400(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
movl 0x1c0(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0xda608
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
leaq -0x20(%rbp), %rdx
callq 0xdc050
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x42c40
movsd %xmm0, -0x58(%rbp)
movl $0x1, -0x30(%rbp)
movq -0x40(%rbp), %rdi
callq 0x43530
cmpl -0x14(%rbp), %eax
jne 0xda497
movl $0x1, -0x2c(%rbp)
jmp 0xda49e
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x38(%rbp)
movl $0x1, -0x34(%rbp)
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0xda5be
movq -0x40(%rbp), %rdi
movslq -0x1c(%rbp), %rax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movl -0x18(%rbp), %esi
callq 0x42c40
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
ucomisd -0x58(%rbp), %xmm0
jne 0xda4ed
jp 0xda4ed
jmp 0xda573
movl -0x2c(%rbp), %edi
movl -0x30(%rbp), %esi
movsd -0x68(%rbp), %xmm0
movq -0x70(%rbp), %rcx
movsd 0x14534(%rip), %xmm1    # 0xeea38
addsd -0x58(%rbp), %xmm1
movl -0x18(%rbp), %r9d
leaq -0x50(%rbp), %rdx
movl $0x3c, %r8d
callq 0xda2d0
movl -0x24(%rbp), %edi
subl -0x2c(%rbp), %edi
addl -0x38(%rbp), %edi
movl -0x28(%rbp), %esi
subl -0x30(%rbp), %esi
addl -0x34(%rbp), %esi
movsd -0x68(%rbp), %xmm0
movq -0x70(%rbp), %rcx
movsd -0x58(%rbp), %xmm1
movsd 0x144f4(%rip), %xmm2    # 0xeea38
subsd %xmm2, %xmm1
movl -0x18(%rbp), %r9d
leaq -0x50(%rbp), %rdx
movl $0x3e, %r8d
callq 0xda2d0
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x40(%rbp), %rdi
movslq -0x1c(%rbp), %rax
imulq $0x30, %rax, %rax
addq %rax, %rdi
callq 0x43530
cmpl -0x14(%rbp), %eax
jne 0xda5a7
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xda4b2
movl -0x38(%rbp), %edi
movl -0x34(%rbp), %esi
movsd -0x68(%rbp), %xmm0
movq -0x70(%rbp), %rcx
movsd -0x60(%rbp), %xmm1
movsd 0x1445e(%rip), %xmm2    # 0xeea38
subsd %xmm2, %xmm1
movl -0x18(%rbp), %r9d
leaq -0x50(%rbp), %rdx
movl $0x3e, %r8d
callq 0xda2d0
movq -0x40(%rbp), %rdi
callq 0x52e80
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xda436
movq -0x70(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)