// File: /workspace/github_c_makefile_star2_O3/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 0x20866(%rip), %rsi     # 0xb1a34
movl $0x5, %edx
callq 0x3a0e1
movq %rax, %r14
movl 0xf0(%rsp), %eax
cmpq $0x4, %rax
ja 0x9131e
leaq 0xf0(%rsp), %rsi
leaq 0x207dd(%rip), %rcx     # 0xb19d8
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 0x90652
jmp 0x9132e
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 0x90f1a
jmp 0x9132e
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 0x90add
jmp 0x9132e
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 0x90cda
jmp 0x9132e
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 0x90838
jmp 0x9132e
leaq 0x2071d(%rip), %rdi     # 0xb1a42
movl %eax, %esi
xorl %eax, %eax
callq 0x4030
movslq (%r15), %rax
testq %rax, %rax
jle 0x91395
movq 0x8(%r15), %rsi
movsd 0x98(%rsp), %xmm0
movsd 0xa0(%rsp), %xmm1
xorl %edi, %edi
movapd 0x14e8a(%rip), %xmm2    # 0xa61e0
xorpd %xmm3, %xmm3
xorl %ecx, %ecx
xorl %edx, %edx
movsd (%r14,%rdi,8), %xmm4
ucomisd %xmm4, %xmm3
je 0x9138b
andpd %xmm2, %xmm4
incl %edx
movsd (%rsi,%rdi,8), %xmm5
ucomisd %xmm3, %xmm5
jbe 0x91383
ucomisd %xmm0, %xmm4
jae 0x91389
jmp 0x9138b
ucomisd %xmm1, %xmm4
jb 0x9138b
incl %ecx
incq %rdi
cmpq %rdi, %rax
jne 0x9135e
jmp 0x91399
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