// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/svmsolve.c
// Function: do_shrinking
void do_shrinking(Solverptr s)
{
 /*Last Changed 28.04.2005*/
	int i, j, k;
	double Gm1, Gm2;
	if (select_working_set(s, &i, &j) != 0) 
		 return;
	Gm1 = -s->y[j] * s->G[j];
	Gm2 = s->y[i] * s->G[i];
	for (k = 0; k < s->active_size; k++)
	 {
 		if (is_lower_bound(s, k))
			 {
		  	if (s->y[k] == +1)
					 {
				   if (-s->G[k] >= Gm1) 
								 continue;
					 }
			  else	
						 if (-s->G[k] >= Gm2) 
								 continue;
			 }
		 else 
				 if (is_upper_bound(s, k))
					 {
			    if (s->y[k] == +1)
							 {
				     if (s->G[k] >= Gm2) 
										 continue;
							 }
			    else	
								 if (s->G[k] >= Gm1) 
										 continue;
					 }
		   else 
						 continue;
		 --s->active_size;
		 solver_swap_index(s, k, s->active_size);
		 --k;	
	 }
	/* unshrink, check all variables again before final iterations*/
	if (s->unshrinked || -(Gm1 + Gm2) > s->eps * 10) 
		 return;
	s->unshrinked = 1;
	reconstruct_gradient(s);
	for (k = s->l - 1; k >= s->active_size; k--)
	 {
	 	if (is_lower_bound(s, k))
			 {
		  	if (s->y[k] == +1)
					 {
				   if (-s->G[k] < Gm1) 
								 continue;
					 }
			  else	
						 if (-s->G[k] < Gm2) 
								 continue;
			 }
		 else 
				 if (is_upper_bound(s, k))
					 {
			    if (s->y[k] == +1)
							 {
				     if (s->G[k] < Gm2) 
										 continue;
							 }
			    else	
								 if (s->G[k] < Gm1) 
										 continue;
					 } 
		   else 
						 continue;
		 solver_swap_index(s, k, s->active_size);
		 s->active_size++;
		 ++k;	
	 }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq -0xc(%rbp), %rsi
leaq -0x10(%rbp), %rdx
callq 0xce370
cmpl $0x0, %eax
je 0xceba7
jmp 0xceefc
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x10(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x10(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x28(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jge 0xced45
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xcdc50
cmpl $0x0, %eax
je 0xcecad
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0xcec75
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
ucomisd -0x20(%rbp), %xmm0
jb 0xcec73
jmp 0xced37
jmp 0xcecab
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
ucomisd -0x28(%rbp), %xmm0
jb 0xceca9
jmp 0xced37
jmp 0xcecab
jmp 0xced11
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xcdc10
cmpl $0x0, %eax
je 0xced0d
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0xcecef
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd -0x28(%rbp), %xmm0
jb 0xceced
jmp 0xced37
jmp 0xced0b
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd -0x20(%rbp), %xmm0
jb 0xced09
jmp 0xced37
jmp 0xced0b
jmp 0xced0f
jmp 0xced37
jmp 0xced11
movq -0x8(%rbp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x8(%rbp), %rax
movl (%rax), %edx
callq 0xcdd70
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xcec06
movq -0x8(%rbp), %rax
cmpl $0x0, 0x7c(%rax)
jne 0xced87
movsd -0x20(%rbp), %xmm0
addsd -0x28(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x8(%rbp), %rax
movsd 0x15bcc(%rip), %xmm1    # 0xe4948
mulsd 0x48(%rax), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xced8c
jmp 0xceefc
movq -0x8(%rbp), %rax
movl $0x1, 0x7c(%rax)
movq -0x8(%rbp), %rdi
callq 0xcdf30
movq -0x8(%rbp), %rax
movl 0x78(%rax), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jl 0xceefc
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xcdc50
cmpl $0x0, %eax
je 0xcee5c
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0xcee20
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xcee1e
jmp 0xceeee
jmp 0xcee5a
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd -0x28(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xcee58
jmp 0xceeee
jmp 0xcee5a
jmp 0xceec8
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xcdc10
cmpl $0x0, %eax
je 0xceec4
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0xceea2
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0x28(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xceea0
jmp 0xceeee
jmp 0xceec2
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xceec0
jmp 0xceeee
jmp 0xceec2
jmp 0xceec6
jmp 0xceeee
jmp 0xceec8
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x8(%rbp), %rax
movl (%rax), %edx
callq 0xcdd70
movq -0x8(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xcedad
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)