// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/lerils.c
// Function: possible_split_points
double* possible_split_points(Instanceptr instances, int fno, int* count)
{
 int j, size;
 Instanceptr instancelist;
 double* result, value, valuebefore = -INT_MAX;
 *count = 1;
 result = safemalloc(sizeof(double), "possible_split_points", 5);
 result[0] = -INT_MAX;
 instancelist = sort_instances(instances, fno, &size);
 if (current_dataset->features[fno].type == INTEGER)
   valuebefore = instancelist[0].values[fno].intvalue;  
 else
   valuebefore = instancelist[0].values[fno].floatvalue;
 j = 1;
 while (j < size)
  {
   if (current_dataset->features[fno].type == INTEGER)
     value = instancelist[j].values[fno].intvalue;  
   else
     value = instancelist[j].values[fno].floatvalue;
   if (value != valuebefore)
    {
     (*count)++;
     result = alloc(result, (*count) * sizeof(double), *count);
     result[(*count) - 1] = (value + valuebefore) / 2;
     valuebefore = value;
    }
   j++;
  }
 (*count)++;
 result = alloc(result, (*count) * sizeof(double), *count);
 result[(*count) - 1] = +INT_MAX;
 safe_free(instancelist);
 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movsd 0x93fdd(%rip), %xmm0    # 0xe2008
movsd %xmm0, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movl $0x8, %edi
leaq 0x982af(%rip), %rsi     # 0xe62f5
movl $0x5, %edx
callq 0x52d70
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movsd 0x93fa8(%rip), %xmm0    # 0xe2008
movsd %xmm0, (%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x20(%rbp), %rdx
callq 0xdc050
movq %rax, -0x28(%rbp)
leaq 0xb77c1(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
cmpl $0x0, (%rax)
jne 0x4e0b2
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x40(%rbp)
jmp 0x4e0c7
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x40(%rbp)
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x4e1bb
leaq 0xb775f(%rip), %rax     # 0x105840
movq (%rax), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0xc(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
cmpl $0x0, (%rax)
jne 0x4e11f
movq -0x28(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x38(%rbp)
jmp 0x4e13f
movq -0x28(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
ucomisd -0x40(%rbp), %xmm0
jne 0x4e14f
jp 0x4e14f
jmp 0x4e1ad
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq (%rax), %rsi
shlq $0x3, %rsi
movq -0x18(%rbp), %rax
movl (%rax), %edx
callq 0x52d10
movq %rax, -0x30(%rbp)
movsd -0x38(%rbp), %xmm0
addsd -0x40(%rbp), %xmm0
movsd 0x94b16(%rip), %xmm1    # 0xe2ca0
divsd %xmm1, %xmm0
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4e0ce
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq (%rax), %rsi
shlq $0x3, %rsi
movq -0x18(%rbp), %rax
movl (%rax), %edx
callq 0x52d10
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd 0x93e14(%rip), %xmm0    # 0xe2010
movsd %xmm0, (%rax,%rcx,8)
movq -0x28(%rbp), %rdi
callq 0x52e80
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)