// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/metaclassification.c
// Function: train_one_vs_rest
void** train_one_vs_rest(Instanceptr* trdata, Instanceptr* cvdata, int algorithm, void* parameters)
{
 Datasetptr tmp;
 int i;
 void** model;
 Instanceptr train = NULL, cv = NULL;
 model = safemalloc(sizeof(void*) * current_dataset->classno, "test_one_vs_rest", 2);
 for (i = 0; i < current_dataset->classno; i++)
  {
   divide_instancelist_one_vs_rest_with_copy(*trdata, &train, i);
   divide_instancelist_one_vs_rest_with_copy(*cvdata, &cv, i);
   tmp = copy_of_dataset(current_dataset);
   current_dataset->classno = 2;
   current_dataset->classcounts[0] = tmp->classcounts[i];
   current_dataset->classcounts[1] = tmp->datacount - tmp->classcounts[i];
   model[i] = classification_algorithms[algorithm - SELECTMAX].train_algorithm(&train, &cv, parameters);
   current_dataset->classno = tmp->classno;
   current_dataset->classcounts[0] = tmp->classcounts[0];
   current_dataset->classcounts[1] = tmp->classcounts[1];
   free_dataset(tmp);
   if (!in_list(algorithm, 1, KNN))
    {
     deallocate(train);
     deallocate(cv);
    }
  }
 return model;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
leaq 0xa5742(%rip), %rax     # 0x105840
movq (%rax), %rax
movslq 0x10(%rax), %rdi
shlq $0x3, %rdi
leaq 0x86cd7(%rip), %rsi     # 0xe6de7
movl $0x2, %edx
callq 0x52d70
movq %rax, -0x38(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
leaq 0xa5711(%rip), %rcx     # 0x105840
movq (%rcx), %rcx
cmpl 0x10(%rcx), %eax
jge 0x60292
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0x2c(%rbp), %edx
leaq -0x40(%rbp), %rsi
callq 0x45a30
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x2c(%rbp), %edx
leaq -0x48(%rbp), %rsi
callq 0x45a30
leaq 0xa56d8(%rip), %rax     # 0x105840
movq (%rax), %rdi
callq 0x1aa40
movq %rax, -0x28(%rbp)
leaq 0xa56c5(%rip), %rax     # 0x105840
movq (%rax), %rax
movl $0x2, 0x10(%rax)
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl 0x1407140(%rax,%rcx,4), %ecx
leaq 0xa56a5(%rip), %rax     # 0x105840
movq (%rax), %rax
movl %ecx, 0x1407140(%rax)
movq -0x28(%rbp), %rax
movl 0x1407120(%rax), %ecx
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rdx
subl 0x1407140(%rax,%rdx,4), %ecx
leaq 0xa567c(%rip), %rax     # 0x105840
movq (%rax), %rax
movl %ecx, 0x1407144(%rax)
movl -0x14(%rbp), %eax
subl $0x3e8, %eax            # imm = 0x3E8
movslq %eax, %rcx
leaq 0xa3fb1(%rip), %rax     # 0x104190
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x20(%rbp), %rdx
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq *%rax
movq %rax, %rdx
movq -0x38(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movl 0x10(%rax), %ecx
leaq 0xa562c(%rip), %rax     # 0x105840
movq (%rax), %rax
movl %ecx, 0x10(%rax)
movq -0x28(%rbp), %rax
movl 0x1407140(%rax), %ecx
leaq 0xa5615(%rip), %rax     # 0x105840
movq (%rax), %rax
movl %ecx, 0x1407140(%rax)
movq -0x28(%rbp), %rax
movl 0x1407144(%rax), %ecx
leaq 0xa55fb(%rip), %rax     # 0x105840
movq (%rax), %rax
movl %ecx, 0x1407144(%rax)
movq -0x28(%rbp), %rdi
callq 0x1b710
movl -0x14(%rbp), %edi
movl $0x1, %esi
movl $0x3e9, %edx            # imm = 0x3E9
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
jne 0x60282
movq -0x40(%rbp), %rdi
callq 0x44510
movq -0x48(%rbp), %rdi
callq 0x44510
jmp 0x60284
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x60125
movq -0x38(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)