// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/dataset.c
// Function: find_counts_for_all_splits
int** find_counts_for_all_splits(Datasetptr original, int fno, Instanceptr data, int* size, double** values)
{
 int i, j, k, count, **counts, classno;
 Instanceptr sorted;
 double previous = +INT_MAX, value;
 *size = 0;
 sorted = sort_instances(data, fno, &count);
 for (i = 0; i < count; i++)
  {
   switch (original->features[fno].type)
    {
     case INTEGER:value = sorted[i].values[fno].intvalue;
                  break;
     case    REAL:value = sorted[i].values[fno].floatvalue;
                  break; 
    }
   if (value != previous)
    {
     previous = value;
     (*size)++;
    }
  }
 counts = (int **) safecalloc_2d(sizeof(int*), sizeof(int), *size, MAXCLASSES, "find_counts_for_all_splits", 12);
 *values = safemalloc((*size) * sizeof(double), "find_counts_for_all_splits", 13); 
 j = -1;
 previous = +INT_MAX;
 for (i = 0; i < count; i++)
  {
   switch (original->features[fno].type)
    {
     case INTEGER:value = sorted[i].values[fno].intvalue;
                  break;
     case    REAL:value = sorted[i].values[fno].floatvalue;
                  break; 
    }
   classno = give_classno(&(sorted[i]));
   if (value != previous)
    {
     previous = value;
     j++;
     (*values)[j] = value;
     if (j != 0)
       for (k = 0; k < original->classno; k++)
         counts[j][k] = counts[j - 1][k];
    }
   counts[j][classno]++;
  }
 safe_free(sorted);
 return counts;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movsd 0xc334d(%rip), %xmm0    # 0xe2010
movsd %xmm0, -0x58(%rbp)
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x38(%rbp), %rdx
callq 0xdc050
movq %rax, -0x50(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0x1ed99
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movl 0x30f08(%rax,%rcx), %eax
movl %eax, -0x64(%rbp)
testl %eax, %eax
je 0x1ed22
jmp 0x1ed18
movl -0x64(%rbp), %eax
subl $0x2, %eax
je 0x1ed44
jmp 0x1ed64
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x60(%rbp)
jmp 0x1ed64
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
ucomisd -0x58(%rbp), %xmm0
jne 0x1ed74
jp 0x1ed74
jmp 0x1ed89
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x1ed8b
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1eced
movq -0x20(%rbp), %rax
movl (%rax), %edx
movl $0x8, %edi
movl $0x4, %esi
movl $0x32, %ecx
leaq 0xc4731(%rip), %r8      # 0xe34e6
movl $0xc, %r9d
callq 0x52fa0
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movslq (%rax), %rdi
shlq $0x3, %rdi
leaq 0xc4710(%rip), %rsi     # 0xe34e6
movl $0xd, %edx
callq 0x52d70
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movl $0xffffffff, -0x30(%rbp) # imm = 0xFFFFFFFF
movsd 0xc3217(%rip), %xmm0    # 0xe2010
movsd %xmm0, -0x58(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0x1ef45
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movl 0x30f08(%rax,%rcx), %eax
movl %eax, -0x68(%rbp)
testl %eax, %eax
je 0x1ee3a
jmp 0x1ee30
movl -0x68(%rbp), %eax
subl $0x2, %eax
je 0x1ee5c
jmp 0x1ee7c
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x60(%rbp)
jmp 0x1ee7c
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x50(%rbp), %rdi
movslq -0x2c(%rbp), %rax
imulq $0x30, %rax, %rax
addq %rax, %rdi
callq 0x43530
movl %eax, -0x44(%rbp)
movsd -0x60(%rbp), %xmm0
ucomisd -0x58(%rbp), %xmm0
jne 0x1eea3
jp 0x1eea3
jmp 0x1ef1e
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movsd -0x60(%rbp), %xmm0
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x30(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpl $0x0, -0x30(%rbp)
je 0x1ef1c
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x1ef1a
movq -0x40(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x40(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1eed8
jmp 0x1ef1c
jmp 0x1ef1e
movq -0x40(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1ee05
movq -0x50(%rbp), %rdi
callq 0x52e80
movq -0x40(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)