// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/process.c
// Function: outlier_features
int outlier_features(char* datasetname)
{
 /*!Last Changed 23.02.2007 added free of variancefeatures*/
 /*!Last Changed 26.03.2004*/
 Datasetptr tmp;
 Instanceptr list;
 Instance variancefeatures;
 int i, count = 0, size, j, start, end;
 double sum;
 tmp = search_dataset(Datasets, datasetname);
 if (!tmp)
  {
   printf(m1279, datasetname);
   return -1;
  }
 current_dataset = tmp;
 if (traindata)
  {
   deallocate(traindata);
   traindata = NULL;
  }
 read_from_train_file(tmp, &traindata);
 variancefeatures = find_variance(traindata);
 for (i = 0; i < tmp->featurecount; i++)
   if (in_list(tmp->features[i].type, 2, REAL, INTEGER))
    {
     list = sort_instances(traindata, i, &size);
     sum = 0;
     start = (int)(size * 0.05);
     end = (int)(size * 0.95);
     for (j = start; j <= end; j++)
       sum += list[j].values[i].floatvalue;
     sum /= (end - start + 1);
     if (variancefeatures.values[i].floatvalue / sum < 0.7)
       count++;
     safe_free(list);
    }
 safe_free(variancefeatures.values);
 return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
movq 0x77d3c(%rip), %rdi     # 0xd5878
movq %r14, %rsi
callq 0x14fb7
testq %rax, %rax
je 0x5dc8a
movq %rax, %rbx
movq %rax, 0x77d19(%rip)     # 0xd5870
movq 0x2da2d2(%rip), %rdi    # 0x337e30
testq %rdi, %rdi
je 0x5db73
callq 0x2ff55
movq $0x0, 0x2da2bd(%rip) # 0x337e30
leaq 0x2da2b6(%rip), %rsi    # 0x337e30
movq %rbx, %rdi
callq 0x5dcbd
movq 0x2da2a7(%rip), %rsi    # 0x337e30
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x127bd
movq (%r14), %r14
cmpl $0x0, 0x1bc(%rbx)
jle 0x5dca2
movq %rbx, %r13
addq $0x30f08, %r13          # imm = 0x30F08
leaq 0x8(%rsp), %r15
xorl %r12d, %r12d
xorl %ebp, %ebp
imulq $0x340, %r12, %rax      # imm = 0x340
movl (%r13,%rax), %edi
movl $0x2, %esi
movl $0x2, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x3aa8c
testl %eax, %eax
je 0x5dc75
movq 0x2da248(%rip), %rdi    # 0x337e30
movl %r12d, %esi
movq %r15, %rdx
callq 0xa0055
xorps %xmm0, %xmm0
cvtsi2sdl 0x8(%rsp), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd 0x4dc78(%rip), %xmm0    # 0xab880
cvttpd2dq %xmm0, %xmm0
movd %xmm0, %edx
pshufd $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movd %xmm0, %ecx
pxor %xmm0, %xmm0
subl %edx, %ecx
jl 0x5dc43
movslq %edx, %rdx
leaq (%rdx,%rdx,2), %rdx
shlq $0x4, %rdx
addq %rax, %rdx
leal 0x1(%rcx), %esi
movq (%rdx), %rdi
addsd (%rdi,%r12,8), %xmm0
addq $0x30, %rdx
decl %esi
jne 0x5dc32
incl %ecx
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
movsd (%r14,%r12,8), %xmm1
divsd %xmm0, %xmm1
xorl %ecx, %ecx
movsd 0x4d234(%rip), %xmm0    # 0xaae98
ucomisd %xmm1, %xmm0
seta %cl
addl %ecx, %ebp
movq %rax, %rdi
callq 0x3a180
incq %r12
movslq 0x1bc(%rbx), %rax
cmpq %rax, %r12
jl 0x5dbba
jmp 0x5dca4
leaq 0x4dcde(%rip), %rdi     # 0xab96f
movq %r14, %rsi
xorl %eax, %eax
callq 0x4030
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x5dcac
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x3a180
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq