// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/process.c
// Function: create_cvdata
void create_cvdata()
{
 /*!Last Changed 26.11.2005 removed bug safe_free(myarray) called for regression*/
 /*!Last Changed 28.10.2005 added find_classes and find_class_counts*/
 /*!Last Changed 23.11.2004 added traincount*/
 /*!Last Changed 02.02.2004 added safemalloc*/
 /*!Last Changed 14.01.2004*/
 int j, dat = data_size(traindata), *myarray = NULL, *partition, *classcounts = NULL;
 Instanceptr cvbefore = NULL, trainbefore = NULL, train = traindata; 
 if (cvdata)
  {
   deallocate(cvdata);
   cvdata = NULL;
  } 
 if (current_dataset->classno > 0)
  { 
   myarray = find_classes(traindata);
   classcounts = find_class_counts(traindata);
  }  
 partition = stratified_partition(myarray, dat, current_dataset->classno, classcounts);
 j = 0; 
 while (train)
  {
   if (partition[j] % 5 == 0)
    {
     if (cvbefore)
      {
       cvbefore->next = train;
       cvbefore = cvbefore->next;
      }
     else
      {
       cvdata = train;
       cvbefore = cvdata;
      }
    }
   else
     if (trainbefore)
      {
       trainbefore->next = train;
       trainbefore = trainbefore->next;
      }
     else
      {
       traindata = train;
       trainbefore = traindata;
      }
   train = train->next;
   j++;
  }
	if (trainbefore)
   trainbefore->next = NULL;
	if (cvbefore)
   cvbefore->next = NULL;
 current_dataset->traincount = data_size(traindata);
 if (current_dataset->classno > 0)
  {
   safe_free(classcounts);
   safe_free(myarray);
  }
 safe_free(partition);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq 0x2e0391(%rip), %rdi    # 0x367e00
callq 0x449f0
movl %eax, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq 0x2e0362(%rip), %rax    # 0x367e00
movq %rax, -0x38(%rbp)
cmpq $0x0, 0x2e0366(%rip)    # 0x367e10
je 0x87ac3
movq 0x2e035d(%rip), %rdi    # 0x367e10
callq 0x44510
movq $0x0, 0x2e034d(%rip) # 0x367e10
movq 0x7dd76(%rip), %rax     # 0x105840
cmpl $0x0, 0x10(%rax)
jle 0x87af0
movq 0x2e0329(%rip), %rdi    # 0x367e00
callq 0x18500
movq %rax, -0x10(%rbp)
movq 0x2e0319(%rip), %rdi    # 0x367e00
callq 0x183a0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl -0x8(%rbp), %esi
movq 0x7dd42(%rip), %rax     # 0x105840
movl 0x10(%rax), %edx
movq -0x20(%rbp), %rcx
callq 0x43d20
movq %rax, -0x18(%rbp)
movl $0x0, -0x4(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x87bc4
movq -0x18(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl $0x5, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x87b71
cmpq $0x0, -0x28(%rbp)
je 0x87b59
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x87b6f
movq -0x38(%rbp), %rax
movq %rax, 0x2e02ac(%rip)    # 0x367e10
movq 0x2e02a5(%rip), %rax    # 0x367e10
movq %rax, -0x28(%rbp)
jmp 0x87baa
cmpq $0x0, -0x30(%rbp)
je 0x87b92
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x87ba8
movq -0x38(%rbp), %rax
movq %rax, 0x2e0263(%rip)    # 0x367e00
movq 0x2e025c(%rip), %rax    # 0x367e00
movq %rax, -0x30(%rbp)
jmp 0x87baa
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x87b15
cmpq $0x0, -0x30(%rbp)
je 0x87bd7
movq -0x30(%rbp), %rax
movq $0x0, 0x10(%rax)
cmpq $0x0, -0x28(%rbp)
je 0x87bea
movq -0x28(%rbp), %rax
movq $0x0, 0x10(%rax)
movq 0x2e020f(%rip), %rdi    # 0x367e00
callq 0x449f0
movl %eax, %ecx
movq 0x7dc41(%rip), %rax     # 0x105840
movl %ecx, 0x1407124(%rax)
movq 0x7dc34(%rip), %rax     # 0x105840
cmpl $0x0, 0x10(%rax)
jle 0x87c24
movq -0x20(%rbp), %rdi
callq 0x52e80
movq -0x10(%rbp), %rdi
callq 0x52e80
movq -0x18(%rbp), %rdi
callq 0x52e80
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)