// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/svm.c
// Function: svm_predict_values
void svm_predict_values(Svm_modelptr model, Svm_nodeptr x, double* dec_values)
{
	/*Last Changed 02.05.2005*/
 ON_OFF normalizekernel = get_parameter_o("normalizekernel");
	int i, j, k, nr_class, l, *start, p = 0, pos = 0, si, sj, ci, cj;
	double* sv_coef, sum = 0.0, *kvalue, *coef1, *coef2;
	if (in_list(model->param.svm_type, 3, ONE_CLASS, EPSILON_SVR, NU_SVR))
	 {
	 	sv_coef = model->sv_coef[0];
		 for (i = 0; i < model->l; i++)
     if (normalizekernel == ON)
  			  sum += sv_coef[i] * k_function_normalized(x, model->SV[i], model->param);
     else
       sum += sv_coef[i] * k_function(x, model->SV[i], model->param);
		 sum -= model->rho[0];
		 *dec_values = sum;
	 }
	else
	 {
 		nr_class = model->nr_class;
 		l = model->l;
 		kvalue = safemalloc(sizeof(double) * l, "svm_predict_values", 15);
 		for (i = 0; i < l; i++)
     if (normalizekernel == ON)
   			 kvalue[i] = k_function_normalized(x, model->SV[i], model->param);
     else
       kvalue[i] = k_function(x, model->SV[i], model->param);
 		start = safemalloc(sizeof(int) * nr_class, "svm_predict_values", 18);
 		start[0] = 0;
 		for (i = 1; i < nr_class; i++)
 			 start[i] = start[i - 1] + model->nSV[i - 1];
 		for (i = 0; i < nr_class; i++)
 			 for (j = i + 1; j < nr_class; j++)
					 {
						 sum = 0;
			 	  si = start[i];
			 	  sj = start[j];
			 	  ci = model->nSV[i];
			 	  cj = model->nSV[j];				
			 	  coef1 = model->sv_coef[j-1];
			 	  coef2 = model->sv_coef[i];
  	 			for (k = 0; k < ci; k++)
  	  				sum += coef1[si + k] * kvalue[si + k];
  	 			for (k = 0; k < cj; k++)
    					sum += coef2[sj + k] * kvalue[sj + k];
  	 			sum -= model->rho[p++];
  	 			dec_values[pos++] = sum;
					 }
		 safe_free(kvalue);
		 safe_free(start);
	 }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0x22b46(%rip), %rdi     # 0xeb124
callq 0x79440
movl %eax, -0x1c(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
movl $0x3, %ecx
movl $0x2, %edx
movl $0x4, %r8d
movl %ecx, %esi
movb $0x0, %al
callq 0x53e40
cmpl $0x0, %eax
je 0xc878b
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x5c(%rcx), %eax
jge 0xc875f
cmpl $0x1, -0x1c(%rbp)
jne 0xc86cf
movq -0x58(%rbp), %rax
movslq -0x20(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x8(%rbp), %rcx
movq 0x50(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x50(%rax)
movups 0x40(%rcx), %xmm0
movups %xmm0, 0x40(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups 0x30(%rcx), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0xcad80
movaps %xmm0, %xmm2
movsd -0x80(%rbp), %xmm0
movsd -0x60(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
jmp 0xc874f
movq -0x58(%rbp), %rax
movslq -0x20(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x88(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x8(%rbp), %rcx
movq 0x50(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x50(%rax)
movups 0x40(%rcx), %xmm0
movups %xmm0, 0x40(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups 0x30(%rcx), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0xcaa90
movaps %xmm0, %xmm2
movsd -0x88(%rbp), %xmm0
movsd -0x60(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
jmp 0xc8751
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xc863a
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movsd (%rax), %xmm1
movsd -0x60(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0xc8abf
movq -0x8(%rbp), %rax
movl 0x58(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl 0x5c(%rax), %eax
movl %eax, -0x30(%rbp)
movslq -0x30(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x258f7(%rip), %rsi     # 0xee0a5
movl $0xf, %edx
callq 0x52d70
movq %rax, -0x68(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0xc889d
cmpl $0x1, -0x1c(%rbp)
jne 0xc8832
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x8(%rbp), %rcx
movq 0x50(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x50(%rax)
movups 0x40(%rcx), %xmm0
movups %xmm0, 0x40(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups 0x30(%rcx), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0xcad80
movq -0x68(%rbp), %rax
movslq -0x20(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xc888d
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x8(%rbp), %rcx
movq 0x50(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x50(%rax)
movups 0x40(%rcx), %xmm0
movups %xmm0, 0x40(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups 0x30(%rcx), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0xcaa90
movq -0x68(%rbp), %rax
movslq -0x20(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xc888f
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xc87c3
movslq -0x2c(%rbp), %rdi
shlq $0x2, %rdi
leaq 0x257f9(%rip), %rsi     # 0xee0a5
movl $0x12, %edx
callq 0x52d70
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl $0x0, (%rax)
movl $0x1, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0xc890d
movq -0x38(%rbp), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rax
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
addl (%rax,%rcx,4), %edx
movq -0x38(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xc88cb
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0xc8aad
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0xc8a9d
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x38(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movq -0x38(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x78(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0xc89fa
movq -0x70(%rbp), %rax
movl -0x44(%rbp), %ecx
addl -0x28(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x68(%rbp), %rax
movl -0x44(%rbp), %ecx
addl -0x28(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x60(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xc89b1
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x50(%rbp), %eax
jge 0xc8a4a
movq -0x78(%rbp), %rax
movl -0x48(%rbp), %ecx
addl -0x28(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x68(%rbp), %rax
movl -0x48(%rbp), %ecx
addl -0x28(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x60(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xc8a01
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movl -0x3c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x3c(%rbp)
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0x60(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x40(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x40(%rbp)
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc8929
jmp 0xc8a9f
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xc8914
movq -0x68(%rbp), %rdi
callq 0x52e80
movq -0x38(%rbp), %rdi
callq 0x52e80
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax,%rax)