// File: /workspace/github_c_makefile_star2_O2/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 0x1e6af(%rip), %rsi     # 0xa1994
pushq $0x5
popq %rdx
callq 0x34f59
movq %rax, %r14
movl 0xf0(%rsp), %eax
cmpq $0x4, %rax
ja 0x83419
leaq 0xf0(%rsp), %rsi
leaq 0x1e628(%rip), %rcx     # 0xa1938
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x20(%rsp), %rdi
pushq $0xb
popq %rcx
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 0x829c5
jmp 0x83429
leaq 0x20(%rsp), %rdi
pushq $0xb
popq %rcx
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
callq 0x83061
jmp 0x83429
leaq 0x20(%rsp), %rdi
pushq $0xb
popq %rcx
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
callq 0x82d4a
jmp 0x83429
leaq 0x20(%rsp), %rdi
pushq $0xb
popq %rcx
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
callq 0x82eb2
jmp 0x83429
leaq 0x20(%rsp), %rdi
pushq $0xb
popq %rcx
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
callq 0x82b3c
jmp 0x83429
leaq 0x1e582(%rip), %rdi     # 0xa19a2
movl %eax, %esi
xorl %eax, %eax
callq 0x4030
movl (%r15), %eax
movq 0x8(%r15), %rcx
movsd 0x98(%rsp), %xmm0
movsd 0xa0(%rsp), %xmm1
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
movapd 0x12d8f(%rip), %xmm2    # 0x961e0
xorpd %xmm3, %xmm3
xorl %edi, %edi
xorl %esi, %esi
cmpq %rdx, %rax
je 0x83490
movsd (%r14,%rdx,8), %xmm4
ucomisd %xmm4, %xmm3
je 0x8348b
andpd %xmm2, %xmm4
incl %edi
movsd (%rcx,%rdx,8), %xmm5
ucomisd %xmm3, %xmm5
jbe 0x83483
ucomisd %xmm0, %xmm4
jae 0x83489
jmp 0x8348b
ucomisd %xmm1, %xmm4
jb 0x8348b
incl %esi
incq %rdx
jmp 0x83459
movq %r14, (%rbx)
movsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x8(%rbx)
movl %edi, 0x10(%rbx)
movl %esi, 0x14(%rbx)
movq %rbx, %rax
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %r15
retq