// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/svm.c
// Function: svm_train_one
Svm_weights svm_train_one(Svm_problem prob, Svm_parameter param, double Cp, double Cn)
{
	/*Last Changed 29.04.2005*/
	Svm_weights result;
	double *alpha;
	Solutioninfo si;
	int nSV = 0, nBSV = 0, i;
 alpha = safemalloc(sizeof(double) * prob.l, "svm_train_one", 5);
	switch (param.svm_type)
	 {
	 	case C_SVC      :solve_c_svc(prob, param, alpha, &si, Cp, Cn);
			                 break;
		 case NU_SVC     :solve_nu_svc(prob, param, alpha, &si);
			                 break;
		 case ONE_CLASS  :solve_one_class(prob, param, alpha, &si);
			                 break;
		 case EPSILON_SVR:solve_epsilon_svr(prob, param, alpha, &si);
			                 break;
		 case NU_SVR     :solve_nu_svr(prob, param, alpha, &si);
			                 break;
   default         :printf(m1234, param.svm_type);
                    break;
	 }
	for (i = 0; i < prob.l; i++)
	 {
	 	if (fabs(alpha[i]) > 0)
			 {
		  	++nSV;
			  if (prob.y[i] > 0)
					 {
				   if (fabs(alpha[i]) >= si.upper_bound_p)
					    ++nBSV;
					 }
			  else
					 {
			   	if (fabs(alpha[i]) >= si.upper_bound_n)
					    ++nBSV;
					 }
			 }
	 }
	result.alpha = alpha;
	result.rho = si.rho;
	result.nSV = nSV;
	result.nBSV = nBSV;
	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xb0, %rsp
movsd %xmm1, 0x80(%rsp)
movsd %xmm0, 0x78(%rsp)
movq %rdi, %rbx
leaq 0xd0(%rsp), %r15
movslq (%r15), %rdi
shlq $0x3, %rdi
leaq 0x20217(%rip), %rsi     # 0xae9bc
movl $0x5, %edx
callq 0x390f5
movq %rax, %r14
movl 0xf0(%rsp), %eax
cmpq $0x4, %rax
ja 0x8e8f5
leaq 0xf0(%rsp), %rsi
leaq 0x2018e(%rip), %rcx     # 0xae960
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x20(%rsp), %rdi
movl $0xb, %ecx
rep  movsq (%rsi), %es:(%rdi)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x88(%rsp), %rsi
movq %r14, %rdi
movsd 0x78(%rsp), %xmm0
movsd 0x80(%rsp), %xmm1
callq 0x8de8f
jmp 0x8e905
leaq 0x20(%rsp), %rdi
movl $0xb, %ecx
rep  movsq (%rsi), %es:(%rdi)
movupd (%r15), %xmm0
movupd 0x10(%r15), %xmm1
movupd %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
leaq 0x88(%rsp), %rsi
movq %r14, %rdi
callq 0x8e563
jmp 0x8e905
leaq 0x20(%rsp), %rdi
movl $0xb, %ecx
rep  movsq (%rsi), %es:(%rdi)
movupd (%r15), %xmm0
movupd 0x10(%r15), %xmm1
movupd %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
leaq 0x88(%rsp), %rsi
movq %r14, %rdi
callq 0x8e225
jmp 0x8e905
leaq 0x20(%rsp), %rdi
movl $0xb, %ecx
rep  movsq (%rsi), %es:(%rdi)
movupd (%r15), %xmm0
movupd 0x10(%r15), %xmm1
movupd %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
leaq 0x88(%rsp), %rsi
movq %r14, %rdi
callq 0x8e39c
jmp 0x8e905
leaq 0x20(%rsp), %rdi
movl $0xb, %ecx
rep  movsq (%rsi), %es:(%rdi)
movupd (%r15), %xmm0
movupd 0x10(%r15), %xmm1
movupd %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
leaq 0x88(%rsp), %rsi
movq %r14, %rdi
callq 0x8e006
jmp 0x8e905
leaq 0x200ce(%rip), %rdi     # 0xae9ca
movl %eax, %esi
xorl %eax, %eax
callq 0x4030
movslq (%r15), %rax
testq %rax, %rax
jle 0x8e96c
movq 0x8(%r15), %rsi
movsd 0x98(%rsp), %xmm0
movsd 0xa0(%rsp), %xmm1
xorl %edi, %edi
movapd 0x148b3(%rip), %xmm2    # 0xa31e0
xorpd %xmm3, %xmm3
xorl %ecx, %ecx
xorl %edx, %edx
movsd (%r14,%rdi,8), %xmm4
ucomisd %xmm4, %xmm3
je 0x8e962
andpd %xmm2, %xmm4
incl %edx
movsd (%rsi,%rdi,8), %xmm5
ucomisd %xmm3, %xmm5
jbe 0x8e95a
ucomisd %xmm0, %xmm4
jae 0x8e960
jmp 0x8e962
ucomisd %xmm1, %xmm4
jb 0x8e962
incl %ecx
incq %rdi
cmpq %rdi, %rax
jne 0x8e935
jmp 0x8e970
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, (%rbx)
movsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x8(%rbx)
movl %edx, 0x10(%rbx)
movl %ecx, 0x14(%rbx)
movq %rbx, %rax
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %r15
retq