// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/svm.c
// Function: solve_nu_svc
void solve_nu_svc(Svm_problem prob, Svm_parameter param, double *alpha, Solutioninfoptr si)
{
	/*Last Changed 29.04.2005*/
	Nusolverptr n;
	int i, l = prob.l;
	double nu = param.nu, sum_pos, sum_neg, *zeros, r;
	signed char* y;
	y = safemalloc(l * sizeof(signed char), "solve_nu_svc", 5);
	n = safemalloc(sizeof(Nusolver), "solve_nu_svc", 6);
	for (i = 0; i < l; i++)
		 if (prob.y[i] > 0)
			  y[i] = +1;
		 else
			  y[i] = -1;
	sum_pos = nu * l / 2;
	sum_neg = nu * l / 2;
	for (i = 0; i < l; i++)
		 if (y[i] == +1)
			 {
	  		alpha[i] = fmin(1.0, sum_pos);
			  sum_pos -= alpha[i];
			 }
		 else
			 {
		  	alpha[i] = fmin(1.0, sum_neg);
			  sum_neg -= alpha[i];
			 }
 zeros = safemalloc(l * sizeof(double), "solve_nu_svc", 25);
	for (i = 0; i < l; i++)
		 zeros[i] = 0;
	nu_solve(n, l, QC, zeros, y, alpha, 1.0, 1.0, si, prob, param);
	r = si->r;
	for (i = 0; i < l; i++)
		 alpha[i] *= y[i] / r;
	si->rho /= r;
	si->obj /= (r*r);
	si->upper_bound_p = 1/r;
	si->upper_bound_n = 1/r;
	safe_free(n);
	safe_free(y);
	safe_free(zeros);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xe8, %rsp
leaq 0x30(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq 0x10(%rbp), %rcx
movq %rcx, -0x60(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl (%rcx), %ecx
movl %ecx, -0x28(%rbp)
movsd 0x40(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movslq -0x28(%rbp), %rdi
shlq $0x0, %rdi
leaq 0x27e46(%rip), %rsi     # 0xee018
movl $0x5, %edx
callq 0x52d70
movq %rax, -0x58(%rbp)
movl $0x88, %edi
leaq 0x27e2c(%rip), %rsi     # 0xee018
movl $0x6, %edx
callq 0x52d70
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0xc624a
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xc6231
movq -0x58(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0xc623d
movq -0x58(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $-0x1, (%rax,%rcx)
jmp 0xc623f
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc6201
movsd -0x30(%rbp), %xmm0
cvtsi2sdl -0x28(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x1ca40(%rip), %xmm1    # 0xe2ca0
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x30(%rbp), %xmm0
cvtsi2sdl -0x28(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x1ca21(%rip), %xmm1    # 0xe2ca0
divsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0xc6330
movq -0x58(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0xc62e7
movsd -0x38(%rbp), %xmm0
movsd 0x1bd5f(%rip), %xmm1    # 0xe2018
minsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0x38(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
jmp 0xc6320
movsd -0x40(%rbp), %xmm0
movsd 0x1bd24(%rip), %xmm1    # 0xe2018
minsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0x40(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
jmp 0xc6322
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc628f
movslq -0x28(%rbp), %rdi
shlq $0x3, %rdi
leaq 0x27cd9(%rip), %rsi     # 0xee018
movl $0x19, %edx
callq 0x52d70
movq %rax, -0x48(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0xc6377
movq -0x48(%rbp), %rax
movslq -0x24(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc6354
movq -0x60(%rbp), %r10
movq -0x68(%rbp), %r11
movq -0x20(%rbp), %rdi
movl -0x28(%rbp), %esi
movq -0x48(%rbp), %rcx
movq -0x58(%rbp), %r8
movq -0x10(%rbp), %r9
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movq 0x50(%r11), %rbx
movq %rsp, %rax
movq %rax, -0x70(%rbp)
movq %rbx, 0x78(%rax)
movups 0x40(%r11), %xmm0
movups %xmm0, 0x68(%rax)
movups (%r11), %xmm0
movups 0x10(%r11), %xmm1
movups 0x20(%r11), %xmm2
movups 0x30(%r11), %xmm3
movups %xmm3, 0x58(%rax)
movups %xmm2, 0x48(%rax)
movups %xmm1, 0x38(%rax)
movups %xmm0, 0x28(%rax)
movups (%r10), %xmm0
movups 0x10(%r10), %xmm1
movups %xmm1, 0x18(%rax)
movups %xmm0, 0x8(%rax)
movq %rdx, (%rax)
xorl %edx, %edx
movsd 0x1bc27(%rip), %xmm1    # 0xe2018
movaps %xmm1, %xmm0
callq 0xd0590
movq -0x18(%rbp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0xc6448
movq -0x58(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
divsd -0x50(%rbp), %xmm0
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xc640e
movsd -0x50(%rbp), %xmm1
movq -0x18(%rbp), %rax
movsd 0x8(%rax), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rax)
movsd -0x50(%rbp), %xmm1
mulsd -0x50(%rbp), %xmm1
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movsd 0x1bb97(%rip), %xmm0    # 0xe2018
divsd -0x50(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movsd 0x1bb81(%rip), %xmm0    # 0xe2018
divsd -0x50(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movq -0x20(%rbp), %rdi
callq 0x52e80
movq -0x58(%rbp), %rdi
callq 0x52e80
movq -0x48(%rbp), %rdi
callq 0x52e80
addq $0xe8, %rsp
popq %rbx
popq %rbp
retq
nopw (%rax,%rax)