// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/svmprepare.c
// Function: prepare_svm_problem
void prepare_svm_problem(Svm_problemptr prob, SVM_TYPE probtype, Instanceptr data, Partition p)
{
 /*Last Changed 27.05.2005*/
	int i = 0, *assignments;
	Instanceptr tmp;
	if (probtype == TWO_CLASS)
	 {
			assignments = find_class_assignments(p);
		 prob->nr_class = 2;
	 }
	else
  	prob->nr_class = current_dataset->classno;
	prob->l = data_size(data);
	prob->x = safemalloc(prob->l * sizeof(Svm_nodeptr), "prepare_svm_parameters", 11);
	prob->y = safemalloc(prob->l * sizeof(double), "prepare_svm_parameters", 12);
	tmp = data;
	while (tmp)
	 {
		 if (in_list(probtype, 2, C_SVC, NU_SVC))
		   prob->y[i] = give_classno(tmp);
			else
				 if (probtype == TWO_CLASS)
							prob->y[i] = assignments[give_classno(tmp)];
					else
  				 prob->y[i] = give_regressionvalue(tmp);
			prob->x[i] = instance_to_svmnode(tmp);
		 tmp = tmp->next;
			i++;
	 }
	if (probtype == TWO_CLASS)
			safe_free(assignments);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x5, -0xc(%rbp)
jne 0xcaf6b
movq -0x38(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x7a860
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl $0x2, 0x18(%rax)
jmp 0xcaf7f
leaq 0x3a8ce(%rip), %rax     # 0x105840
movq (%rax), %rax
movl 0x10(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x18(%rbp), %rdi
callq 0x449f0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movslq (%rax), %rdi
shlq $0x3, %rdi
leaq 0x231fd(%rip), %rsi     # 0xee19f
movl $0xb, %edx
callq 0x52d70
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movslq (%rax), %rdi
shlq $0x3, %rdi
leaq 0x231d6(%rip), %rsi     # 0xee19f
movl $0xc, %edx
callq 0x52d70
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xcb0b6
movl -0xc(%rbp), %edi
movl $0x2, %esi
xorl %edx, %edx
movl $0x1, %ecx
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
je 0xcb02c
movq -0x30(%rbp), %rdi
callq 0x43530
cvtsi2sd %eax, %xmm0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xcb080
cmpl $0x5, -0xc(%rbp)
jne 0xcb064
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
callq 0x43530
movl %eax, %ecx
movq -0x40(%rbp), %rax
movslq %ecx, %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xcb07e
movq -0x30(%rbp), %rdi
callq 0x43580
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xcb080
movq -0x30(%rbp), %rdi
callq 0x42b00
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xcafe6
cmpl $0x5, -0xc(%rbp)
jne 0xcb0c5
movq -0x28(%rbp), %rdi
callq 0x52e80
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)