// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/svm.c
// Function: solve_nu_svr
void solve_nu_svr(Svm_problem prob, Svm_parameter param, double *alpha, Solutioninfoptr si)
{
	/*Last Changed 29.04.2005*/
	Nusolverptr n;
	int l = prob.l, i;
	double C = param.C, *alpha2, *linear_term, sum;
	signed char *y;
 alpha2 = safemalloc(2 * l * sizeof(double), "solve_nu_svr", 5);
 linear_term = safemalloc(2 * l * sizeof(double), "solve_nu_svr", 6);
	y = safemalloc(2 * l * sizeof(signed char), "solve_nu_svr", 7);
	n = safemalloc(sizeof(Nusolver), "solve_nu_svr", 8);
	sum = C * param.nu * l / 2;
	for (i = 0; i < l; i++)
	 {
	 	alpha2[i] = fmin(sum, C);
			alpha2[i + l] = fmin(sum, C);
		 sum -= alpha2[i];
		 linear_term[i] = -prob.y[i];
		 y[i] = 1;
		 linear_term[i+l] = prob.y[i];
		 y[i+l] = -1;
	 }
 nu_solve(n, 2 * l, QR, linear_term, y, alpha2, C, C, si, prob, param);
	for (i = 0; i < l; i++)
		 alpha[i] = alpha2[i] - alpha2[i + l];
	safe_free(n);
	safe_free(alpha2);
 safe_free(linear_term);
	safe_free(y);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, 0x90(%rsp)
movq %rdi, %r12
leaq 0x110(%rsp), %rcx
leaq 0xf0(%rsp), %rax
movslq (%rax), %r14
movsd 0x30(%rcx), %xmm0
movaps %xmm0, 0xa0(%rsp)
leaq (%r14,%r14), %r13
movq %r14, %r15
shlq $0x4, %r15
leaq 0x20abf(%rip), %rbp     # 0xb1a27
movq %r15, %rdi
movq %rbp, %rsi
movl $0x5, %edx
callq 0x3a0e1
movq %rax, %rbx
movq %r15, %rdi
movq %rbp, %r15
movq %rbp, %rsi
movl $0x6, %edx
callq 0x3a0e1
movq %rax, %rbp
movq %r13, 0x88(%rsp)
movq %r13, %rdi
movq %r15, %rsi
movq %r15, %r13
movl $0x7, %edx
callq 0x3a0e1
movq %rax, %r15
movl $0x88, %edi
movq %r13, %rsi
movl $0x8, %edx
callq 0x3a0e1
testq %r14, %r14
movq %rax, 0x98(%rsp)
jle 0x910ff
movq 0x88(%rsp), %r9
movq 0x90(%rsp), %r8
leaq 0x110(%rsp), %rsi
movsd 0x40(%rsi), %xmm1
cvtsi2sd %r14d, %xmm5
movapd 0xa0(%rsp), %xmm0
mulsd %xmm0, %xmm1
mulsd %xmm1, %xmm5
mulsd 0x14d0b(%rip), %xmm5    # 0xa5d18
leaq 0xf0(%rsp), %r10
movq 0x8(%r10), %rdi
movq %r15, %rcx
addq %r14, %rcx
leaq (,%r14,8), %rdx
addq %rbp, %rdx
leaq (%rbx,%r14,8), %r13
xorl %r11d, %r11d
movaps 0x15198(%rip), %xmm1    # 0xa61d0
movapd %xmm5, %xmm2
cmpunordsd %xmm5, %xmm2
movapd %xmm2, %xmm3
andpd %xmm0, %xmm3
movapd %xmm0, %xmm4
minsd %xmm5, %xmm4
andnpd %xmm4, %xmm2
orpd %xmm3, %xmm2
movlpd %xmm2, (%rbx,%r11,8)
movlpd %xmm2, (%r13,%r11,8)
subsd %xmm2, %xmm5
movsd (%rdi,%r11,8), %xmm2
xorps %xmm1, %xmm2
movlps %xmm2, (%rbp,%r11,8)
movb $0x1, (%r15,%r11)
movsd (%rdi,%r11,8), %xmm2
movsd %xmm2, (%rdx,%r11,8)
movb $-0x1, (%rcx,%r11)
incq %r11
cmpq %r11, %r14
jne 0x91038
leaq 0x28(%rsp), %rdi
movl $0xb, %ecx
rep  movsq (%rsi), %es:(%rdi)
movups (%r10), %xmm2
movups 0x10(%r10), %xmm1
movups %xmm1, 0x18(%rsp)
movups %xmm2, 0x8(%rsp)
movq %r8, (%rsp)
movq %rax, %rdi
movl %r9d, %esi
movl $0x1, %edx
movq %rbp, %rcx
movq %r15, %r8
movq %rbx, %r9
movapd %xmm0, %xmm1
callq 0x9755c
testl %r14d, %r14d
jle 0x91164
xorl %eax, %eax
movsd (%rbx,%rax,8), %xmm0
subsd (%r13,%rax,8), %xmm0
movsd %xmm0, (%r12,%rax,8)
incq %rax
cmpq %rax, %r14
jne 0x910e3
jmp 0x91164
leaq 0x28(%rsp), %rdi
movl $0xb, %ecx
leaq 0x110(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xf0(%rsp), %rcx
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
movq 0x90(%rsp), %rcx
movq %rcx, (%rsp)
movq %rax, %rdi
movq 0x88(%rsp), %rsi
movl $0x1, %edx
movq %rbp, %rcx
movq %r15, %r8
movq %rbx, %r9
movapd 0xa0(%rsp), %xmm0
movapd %xmm0, %xmm1
callq 0x9755c
movq 0x98(%rsp), %rdi
callq 0x3a180
movq %rbx, %rdi
callq 0x3a180
movq %rbp, %rdi
callq 0x3a180
movq %r15, %rdi
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3a180