// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/ktree.c
// Function: update_best_discrete_split
void update_best_discrete_split(Korderingsplit* split, int* perm[], int* rangelist, int* iter, int** featurecounts, int* nodecounts, double* bestgain)
{
	int i, j, size = split->featurecount, permpos, permmultiplier;
 int* mixediter;
 int counts[2][MAXCLASSES];
	double gain;
 for (i = 0; i < MAXCLASSES; i++)
   counts[0][i] = counts[1][i] = 0;
 for (i = 0; i < current_dataset->classno; i++)
   counts[1][i] = nodecounts[i];
 mixediter = first_mixed_iterator(size);
 do{
   permpos = 0;
   permmultiplier = 1;
   for (i = 0; i < size; i++)
    {
     permpos += permmultiplier * perm[i][mixediter[i]];
     permmultiplier *= rangelist[i];
    }
   for (i = 0; i < current_dataset->classno; i++)
    {
     counts[0][i] += featurecounts[permpos][i];
     counts[1][i] -= featurecounts[permpos][i];
    }
   gain = information_gain(counts);
   if (dless(gain, *bestgain))
    {
     *bestgain = gain;
     for (i = 0; i < size; i++)
      {
       split->featurelist[i] = iter[i];
       split->discretesplit[i] = mixediter[i];
       safe_free(split->sortorder[i]);
       split->sortorder[i] = safemalloc(rangelist[i] * sizeof(int), "update_best_discrete_split", 70);
       for (j = 0; j < rangelist[i]; j++)
         split->sortorder[i][j] = perm[i][j];
      }
    }
 }while (next_mixed_iterator(mixediter, size, rangelist));
 safe_free(mixediter);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x32, -0x34(%rbp)
jge 0x481a6
movslq -0x34(%rbp), %rax
movl $0x0, -0x118(%rbp,%rax,4)
movslq -0x34(%rbp), %rax
movl $0x0, -0x1e0(%rbp,%rax,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x48177
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
leaq 0xbd689(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x481e0
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movslq -0x34(%rbp), %rax
movl %ecx, -0x118(%rbp,%rax,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x481ad
movl -0x3c(%rbp), %edi
callq 0x51b80
movq %rax, -0x50(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x1, -0x44(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x4824b
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x34(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq -0x50(%rbp), %rdx
movslq -0x34(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
imull (%rcx,%rdx,4), %eax
addl -0x40(%rbp), %eax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
imull -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x48201
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
leaq 0xbd5e4(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x482bb
movq -0x28(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movslq -0x34(%rbp), %rax
addl -0x1e0(%rbp,%rax,4), %ecx
movl %ecx, -0x1e0(%rbp,%rax,4)
movq -0x28(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movslq -0x34(%rbp), %rax
movl -0x118(%rbp,%rax,4), %ecx
subl %edx, %ecx
movl %ecx, -0x118(%rbp,%rax,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x48252
leaq -0x1e0(%rbp), %rdi
callq 0x2ac00
movsd %xmm0, -0x1e8(%rbp)
movsd -0x1e8(%rbp), %xmm0
movq 0x10(%rbp), %rax
movsd (%rax), %xmm1
callq 0x52750
cmpl $0x0, %eax
je 0x483eb
movsd -0x1e8(%rbp), %xmm0
movq 0x10(%rbp), %rax
movsd %xmm0, (%rax)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x483e9
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x50(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x52e80
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movslq (%rax,%rcx,4), %rdi
shlq $0x2, %rdi
leaq 0x9d4bf(%rip), %rsi     # 0xe582f
movl $0x46, %edx
callq 0x52d70
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x34(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x483d9
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x38(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x48394
jmp 0x483db
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x48304
jmp 0x483eb
jmp 0x483ed
movq -0x50(%rbp), %rdi
movl -0x3c(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x523a0
cmpl $0x0, %eax
jne 0x481ec
movq -0x50(%rbp), %rdi
callq 0x52e80
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
nopl (%rax,%rax)