// File: /workspace/github_cpp_makefile_star2_O2/cjlin1[P]liblinear/linear.cpp
// Function: Solver_MCSVM_CS::Solve(double*)
void Solver_MCSVM_CS::Solve(double *w)
{
	int i, m, s;
	int iter = 0;
	double *alpha = new double[l*nr_class];
	double *alpha_new = new double[nr_class];
	int *index = new int[l];
	double *QD = new double[l];
	int *d_ind = new int[nr_class];
	double *d_val = new double[nr_class];
	int *alpha_index = new int[nr_class*l];
	int *y_index = new int[l];
	int active_size = l;
	int *active_size_i = new int[l];
	double eps_shrink = max(10.0*eps, 1.0); // stopping tolerance for shrinking
	bool start_from_all = true;

	// Initial alpha can be set here. Note that
	// sum_m alpha[i*nr_class+m] = 0, for all i=1,...,l-1
	// alpha[i*nr_class+m] <= C[GETI(i)] if prob->y[i] == m
	// alpha[i*nr_class+m] <= 0 if prob->y[i] != m
	// If initial alpha isn't zero, uncomment the for loop below to initialize w
	for(i=0;i<l*nr_class;i++)
		alpha[i] = 0;

	for(i=0;i<w_size*nr_class;i++)
		w[i] = 0;
	for(i=0;i<l;i++)
	{
		for(m=0;m<nr_class;m++)
			alpha_index[i*nr_class+m] = m;
		feature_node *xi = prob->x[i];
		QD[i] = 0;
		while(xi->index != -1)
		{
			double val = xi->value;
			QD[i] += val*val;

			// Uncomment the for loop if initial alpha isn't zero
			// for(m=0; m<nr_class; m++)
			//	w[(xi->index-1)*nr_class+m] += alpha[i*nr_class+m]*val;
			xi++;
		}
		active_size_i[i] = nr_class;
		y_index[i] = (int)prob->y[i];
		index[i] = i;
	}

	while(iter < max_iter)
	{
		double stopping = -INF;
		for(i=0;i<active_size;i++)
		{
			int j = i+rand()%(active_size-i);
			swap(index[i], index[j]);
		}
		for(s=0;s<active_size;s++)
		{
			i = index[s];
			double Ai = QD[i];
			double *alpha_i = &alpha[i*nr_class];
			int *alpha_index_i = &alpha_index[i*nr_class];

			if(Ai > 0)
			{
				for(m=0;m<active_size_i[i];m++)
					G[m] = 1;
				if(y_index[i] < active_size_i[i])
					G[y_index[i]] = 0;

				feature_node *xi = prob->x[i];
				while(xi->index!= -1)
				{
					double *w_i = &w[(xi->index-1)*nr_class];
					for(m=0;m<active_size_i[i];m++)
						G[m] += w_i[alpha_index_i[m]]*(xi->value);
					xi++;
				}

				double minG = INF;
				double maxG = -INF;
				for(m=0;m<active_size_i[i];m++)
				{
					if(alpha_i[alpha_index_i[m]] < 0 && G[m] < minG)
						minG = G[m];
					if(G[m] > maxG)
						maxG = G[m];
				}
				if(y_index[i] < active_size_i[i])
					if(alpha_i[(int) prob->y[i]] < C[GETI(i)] && G[y_index[i]] < minG)
						minG = G[y_index[i]];

				for(m=0;m<active_size_i[i];m++)
				{
					if(be_shrunk(i, m, y_index[i], alpha_i[alpha_index_i[m]], minG))
					{
						active_size_i[i]--;
						while(active_size_i[i]>m)
						{
							if(!be_shrunk(i, active_size_i[i], y_index[i],
											alpha_i[alpha_index_i[active_size_i[i]]], minG))
							{
								swap(alpha_index_i[m], alpha_index_i[active_size_i[i]]);
								swap(G[m], G[active_size_i[i]]);
								if(y_index[i] == active_size_i[i])
									y_index[i] = m;
								else if(y_index[i] == m)
									y_index[i] = active_size_i[i];
								break;
							}
							active_size_i[i]--;
						}
					}
				}

				if(active_size_i[i] <= 1)
				{
					active_size--;
					swap(index[s], index[active_size]);
					s--;
					continue;
				}

				if(maxG-minG <= 1e-12)
					continue;
				else
					stopping = max(maxG - minG, stopping);

				for(m=0;m<active_size_i[i];m++)
					B[m] = G[m] - Ai*alpha_i[alpha_index_i[m]] ;

				solve_sub_problem(Ai, y_index[i], C[GETI(i)], active_size_i[i], alpha_new);
				int nz_d = 0;
				for(m=0;m<active_size_i[i];m++)
				{
					double d = alpha_new[m] - alpha_i[alpha_index_i[m]];
					alpha_i[alpha_index_i[m]] = alpha_new[m];
					if(fabs(d) >= 1e-12)
					{
						d_ind[nz_d] = alpha_index_i[m];
						d_val[nz_d] = d;
						nz_d++;
					}
				}

				xi = prob->x[i];
				while(xi->index != -1)
				{
					double *w_i = &w[(xi->index-1)*nr_class];
					for(m=0;m<nz_d;m++)
						w_i[d_ind[m]] += d_val[m]*xi->value;
					xi++;
				}
			}
		}

		iter++;
		if(iter % 10 == 0)
		{
			info(".");
		}

		if(stopping < eps_shrink)
		{
			if(stopping < eps && start_from_all == true)
				break;
			else
			{
				active_size = l;
				for(i=0;i<l;i++)
					active_size_i[i] = nr_class;
				info("*");
				eps_shrink = max(eps_shrink/2, eps);
				start_from_all = true;
			}
		}
		else
			start_from_all = false;
	}

	info("\noptimization finished, #iter = %d\n",iter);
	if (iter >= max_iter)
		info("\nWARNING: reaching max number of iterations\n");

	// calculate objective value
	double v = 0;
	int nSV = 0;
	for(i=0;i<w_size*nr_class;i++)
		v += w[i]*w[i];
	v = 0.5*v;
	for(i=0;i<l*nr_class;i++)
	{
		v += alpha[i];
		if(fabs(alpha[i]) > 0)
			nSV++;
	}
	for(i=0;i<l;i++)
		v -= alpha[i*nr_class+(int)prob->y[i]];
	info("Objective value = %lf\n",v);
	info("nSV = %d\n",nSV);

	delete [] alpha;
	delete [] alpha_new;
	delete [] index;
	delete [] QD;
	delete [] d_ind;
	delete [] d_val;
	delete [] alpha_index;
	delete [] y_index;
	delete [] active_size_i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, 0x38(%rsp)
movq %rdi, 0x10(%rsp)
movslq 0x1c(%rdi), %rbp
movslq 0x20(%rdi), %rbx
movl %ebx, %eax
imull %ebp, %eax
cltq
xorl %r14d, %r14d
testl %eax, %eax
movl $0x0, %r12d
cmovgl %eax, %r12d
leaq (,%rax,4), %rcx
testl %eax, %eax
pushq $-0x1
popq %r13
cmovsq %r13, %rcx
movq %rcx, 0x20(%rsp)
movq %rax, %rdi
shlq $0x3, %rdi
testl %eax, %eax
cmovsq %r13, %rdi
callq 0x2030
movq %rax, 0x58(%rsp)
leaq (,%rbx,8), %rdi
leaq (,%rbx,4), %r15
testq %rbx, %rbx
cmovsq %r13, %rdi
movq %rdi, 0x18(%rsp)
movq %r15, %rax
cmovsq %r13, %rax
movq %rax, 0x28(%rsp)
callq 0x2030
movq %rax, 0xb8(%rsp)
leaq (,%rbp,4), %r13
testq %rbp, %rbp
pushq $-0x1
popq %rax
cmovsq %rax, %r13
movq %rbp, 0x48(%rsp)
leaq (,%rbp,8), %rbp
cmovsq %rax, %rbp
movq %r13, %rdi
callq 0x2030
movq %rax, 0x60(%rsp)
movq %rbp, %rdi
callq 0x2030
movq %rax, 0x40(%rsp)
movq 0x28(%rsp), %rdi
callq 0x2030
movq %rax, 0x80(%rsp)
movq 0x18(%rsp), %rdi
callq 0x2030
movq %rax, 0x68(%rsp)
movq 0x20(%rsp), %rdi
callq 0x2030
movq %rax, 0x90(%rsp)
movq %r13, %rdi
callq 0x2030
movq %rax, 0x78(%rsp)
movq %r13, %rdi
callq 0x2030
movq %rax, 0x70(%rsp)
movq 0x10(%rsp), %rax
movsd 0x28(%rax), %xmm0
mulsd 0x8434(%rip), %xmm0     # 0xcdd0
movsd %xmm0, 0x50(%rsp)
movq 0x58(%rsp), %rax
cmpq %r14, %r12
je 0x49b6
andq $0x0, (%rax,%r14,8)
incq %r14
jmp 0x49a7
movq 0x10(%rsp), %rax
movl 0x18(%rax), %eax
imull %ebx, %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movq 0x40(%rsp), %r9
movq 0x80(%rsp), %r12
movq 0x68(%rsp), %r14
movq 0x38(%rsp), %rdx
cmpq %rcx, %rax
je 0x49ee
andq $0x0, (%rdx,%rcx,8)
incq %rcx
jmp 0x49df
movsd 0x50(%rsp), %xmm0
maxsd 0x8244(%rip), %xmm0     # 0xcc40
movsd %xmm0, 0x50(%rsp)
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rax
xorl %ecx, %ecx
testl %ebx, %ebx
movl $0x0, %edx
cmovgl %ebx, %edx
movq 0x48(%rsp), %rdi
testl %edi, %edi
movl $0x0, %esi
cmovgl %edi, %esi
movq 0x90(%rsp), %rdi
movq 0x78(%rsp), %r10
cmpq %rsi, %rcx
je 0x4aa2
xorl %r8d, %r8d
cmpq %r8, %rdx
je 0x4a49
movl %r8d, (%rdi,%r8,4)
incq %r8
jmp 0x4a3b
movq 0x10(%rax), %r8
movq (%r8,%rcx,8), %r8
andq $0x0, (%r9,%rcx,8)
xorpd %xmm0, %xmm0
cmpl $-0x1, (%r8)
je 0x4a7a
movsd 0x8(%r8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%r9,%rcx,8)
addq $0x10, %r8
jmp 0x4a5a
movq 0x70(%rsp), %r8
movl %ebx, (%r8,%rcx,4)
movq 0x8(%rax), %r8
cvttsd2si (%r8,%rcx,8), %r8d
movl %r8d, (%r10,%rcx,4)
movq 0x60(%rsp), %r8
movl %ecx, (%r8,%rcx,4)
incq %rcx
addq %r15, %rdi
jmp 0x4a33
movb $0x1, %bl
xorl %r8d, %r8d
movq 0x10(%rsp), %r15
cmpl 0x24(%r15), %r8d
jge 0x517d
movq %r14, %r13
movb %bl, 0xf(%rsp)
movl %r8d, 0xb4(%rsp)
movq 0x48(%rsp), %rax
testl %eax, %eax
movl $0x0, %ebx
cmovgl %eax, %ebx
movl %eax, %ebp
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x4b06
callq 0x2090
cltd
idivl %ebp
movslq %edx, %rax
addq %r14, %rax
movq 0x60(%rsp), %rsi
movl (%rsi,%r14,4), %ecx
movl (%rsi,%rax,4), %edx
movl %edx, (%rsi,%r14,4)
movl %ecx, (%rsi,%rax,4)
incq %r14
decl %ebp
jmp 0x4ad9
xorl %ecx, %ecx
movsd 0x82c8(%rip), %xmm3     # 0xcdd8
movq 0x40(%rsp), %r9
movq 0x38(%rsp), %r11
movq %r13, %r14
cmpl 0x48(%rsp), %ecx
movsd %xmm3, 0x28(%rsp)
jge 0x50c6
movslq %ecx, %rdx
movq 0x60(%rsp), %rax
movl (%rax,%rdx,4), %esi
movslq %esi, %rbp
movsd (%r9,%rbp,8), %xmm0
movapd %xmm0, 0x100(%rsp)
ucomisd 0x74e6(%rip), %xmm0     # 0xc038
jbe 0x50bf
movq %rdx, 0xe8(%rsp)
movl %ecx, 0x30(%rsp)
movl 0x20(%r15), %edx
movl %edx, %eax
movl %esi, 0x34(%rsp)
imull %esi, %eax
cltq
movq 0x58(%rsp), %rcx
leaq (%rcx,%rax,8), %rcx
movq %rcx, 0x20(%rsp)
movq 0x90(%rsp), %rcx
leaq (%rcx,%rax,4), %r14
movq 0x70(%rsp), %rax
movl (%rax,%rbp,4), %esi
movq 0x10(%r15), %rcx
testl %esi, %esi
movl $0x0, %eax
movq %rsi, %rbx
cmovgl %esi, %eax
xorl %esi, %esi
cmpq %rsi, %rax
je 0x4bc0
movabsq $0x3ff0000000000000, %rdi # imm = 0x3FF0000000000000
movq %rdi, (%rcx,%rsi,8)
incq %rsi
jmp 0x4ba8
movq 0x78(%rsp), %rcx
movl (%rcx,%rbp,4), %esi
movl %esi, %ecx
movslq %esi, %rdi
cmpl %ebx, %edi
jge 0x4bda
movq 0x10(%r15), %rsi
andq $0x0, (%rsi,%rdi,8)
movq %rdi, 0x18(%rsp)
movq 0x30(%r15), %rsi
movq %rsi, %r13
movq 0x10(%rsi), %rsi
movq (%rsi,%rbp,8), %rsi
movl (%rsi), %edi
cmpl $-0x1, %edi
je 0x4c33
decl %edi
imull %edx, %edi
movslq %edi, %rdi
leaq (%r11,%rdi,8), %rdi
movq 0x10(%r15), %r8
xorl %r9d, %r9d
cmpq %r9, %rax
je 0x4c2d
movslq (%r14,%r9,4), %r10
movsd (%rdi,%r10,8), %xmm0
mulsd 0x8(%rsi), %xmm0
addsd (%r8,%r9,8), %xmm0
movsd %xmm0, (%r8,%r9,8)
incq %r9
jmp 0x4c08
addq $0x10, %rsi
jmp 0x4bee
movq 0x10(%r15), %rdx
movq %rdx, 0xa0(%rsp)
xorl %edx, %edx
movsd 0x73e7(%rip), %xmm1     # 0xc030
movsd 0x8187(%rip), %xmm4     # 0xcdd8
movq %rbx, %r8
cmpq %rdx, %rax
je 0x4cad
movslq (%r14,%rdx,4), %rsi
movq 0xa0(%rsp), %rdi
movsd (%rdi,%rdx,8), %xmm0
movq 0x20(%rsp), %rdi
movsd (%rdi,%rsi,8), %xmm5
xorpd %xmm2, %xmm2
cmpltpd %xmm2, %xmm5
movapd %xmm0, %xmm2
cmpltpd %xmm1, %xmm2
andpd %xmm5, %xmm2
movd %xmm2, %esi
movapd %xmm0, %xmm2
testb $0x1, %sil
jne 0x4c9c
movapd %xmm1, %xmm2
maxsd %xmm4, %xmm0
incq %rdx
movapd %xmm2, %xmm1
movapd %xmm0, %xmm4
jmp 0x4c54
cmpl %r8d, %ecx
movsd %xmm4, 0x98(%rsp)
movq %r13, 0xe0(%rsp)
jge 0x4cff
movq 0x8(%r13), %rax
cvttsd2si (%rax,%rbp,8), %eax
cltq
movq 0x8(%r15), %rdx
movsd (%rdx,%rax,8), %xmm0
movq 0x20(%rsp), %rdx
ucomisd (%rdx,%rax,8), %xmm0
jbe 0x4cff
movq 0xa0(%rsp), %rax
movq 0x18(%rsp), %rdx
movsd (%rax,%rdx,8), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x4cff
movapd %xmm0, %xmm1
movq %r15, %rbx
xorl %r9d, %r9d
movq %r14, 0x88(%rsp)
movq %rbp, 0xa8(%rsp)
movapd %xmm1, 0xd0(%rsp)
movslq %r8d, %rdx
movq %rdx, 0xc0(%rsp)
cmpq %rdx, %r9
movl %ecx, 0x18(%rsp)
jge 0x4ed9
movq %r8, %r13
movslq (%r14,%r9,4), %rdx
movq 0x20(%rsp), %rax
movq %rdx, 0xf8(%rsp)
movsd (%rax,%rdx,8), %xmm0
movq %rbx, %rdi
movl 0x34(%rsp), %esi
movq %r9, %r15
movl %r9d, %edx
callq 0x4826
testb %al, %al
je 0x4e63
movq 0xc0(%rsp), %rcx
leaq (%r14,%rcx,4), %r12
leaq -0x1(%rcx), %rbx
leal -0x1(%r13), %ecx
movq %rcx, 0xc8(%rsp)
movq %r13, 0xf0(%rsp)
xorl %ecx, %ecx
movsd 0x28(%rsp), %xmm3
movq %rcx, %r14
leaq (%rbx,%rcx), %rax
movq 0xc8(%rsp), %rcx
leaq (%rcx,%r14), %rdx
movq 0x70(%rsp), %rcx
movq 0xa8(%rsp), %rbp
movl %edx, (%rcx,%rbp,4)
cmpq %r15, %rax
movl 0x18(%rsp), %ecx
movapd 0xd0(%rsp), %xmm1
jle 0x4e7e
movslq -0x4(%r12,%r14,4), %rbp
movq 0x20(%rsp), %rax
movsd (%rax,%rbp,8), %xmm0
movq 0x10(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x4826
movsd 0x28(%rsp), %xmm3
leaq -0x1(%r14), %rcx
decl %r13d
testb %al, %al
jne 0x4d95
movq 0x88(%rsp), %rax
movq %r15, %r9
movl %ebp, (%rax,%r15,4)
movq 0xf8(%rsp), %rax
movl %eax, (%r12,%rcx,4)
movq 0xa0(%rsp), %rdx
movq 0xc0(%rsp), %rax
leaq (%rdx,%rax,8), %rax
movsd (%rdx,%r15,8), %xmm0
movsd (%rax,%rcx,8), %xmm1
movsd %xmm1, (%rdx,%r15,8)
movsd %xmm0, (%rax,%rcx,8)
movl 0x18(%rsp), %ecx
cmpl %r13d, %ecx
movapd 0xd0(%rsp), %xmm1
jne 0x4e91
movl %r9d, %r13d
movl %ecx, %r8d
movq 0xa8(%rsp), %rbp
jmp 0x4ea3
movsd 0x28(%rsp), %xmm3
movl 0x18(%rsp), %ecx
movq %r13, %r8
movapd 0xd0(%rsp), %xmm1
movq %r15, %r9
jmp 0x4ed1
movq %r15, %r9
movq 0xf0(%rsp), %r8
addl %r14d, %r8d
decl %r8d
jmp 0x4ebc
movl %ecx, %eax
movl %r13d, %r8d
cmpq %rax, %r9
movq 0xa8(%rsp), %rbp
jne 0x4eb1
movq 0x78(%rsp), %rax
movl %r13d, (%rax,%rbp,4)
movl %r13d, %ecx
jmp 0x4ebc
movq 0xc8(%rsp), %r8
addq %r14, %r8
movq 0x80(%rsp), %r12
movq 0x10(%rsp), %rbx
movq 0x88(%rsp), %r14
incq %r9
jmp 0x4d1e
cmpl $0x1, %r8d
jg 0x4f1c
movq 0x48(%rsp), %rcx
movslq %ecx, %rax
decl %ecx
movq %rcx, 0x48(%rsp)
movq 0x60(%rsp), %rdx
movl -0x4(%rdx,%rax,4), %ecx
movq 0xe8(%rsp), %rsi
movl %ecx, (%rdx,%rsi,4)
movl 0x34(%rsp), %ecx
movl %ecx, -0x4(%rdx,%rax,4)
movl 0x30(%rsp), %ecx
decl %ecx
movq 0x40(%rsp), %r9
movq 0x38(%rsp), %r11
jmp 0x4f97
movsd 0x98(%rsp), %xmm2
subsd %xmm1, %xmm2
movsd 0x7d1f(%rip), %xmm0     # 0xcc50
ucomisd %xmm2, %xmm0
movq 0x40(%rsp), %r9
movq 0x38(%rsp), %r11
jae 0x4f93
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movapd 0x100(%rsp), %xmm0
movapd %xmm0, %xmm3
xorpd 0x7d23(%rip), %xmm3     # 0xcc80
movq %r8, %rdx
movl %edx, %r10d
xorl %r9d, %r9d
movl 0x18(%rsp), %esi
cmpq %r9, %r10
je 0x4fa4
movslq (%r14,%r9,4), %rdi
movq 0x20(%rsp), %r8
movsd (%r8,%rdi,8), %xmm1
mulsd %xmm3, %xmm1
addsd (%rcx,%r9,8), %xmm1
movsd %xmm1, (%rax,%r9,8)
incq %r9
jmp 0x4f6a
movl 0x30(%rsp), %ecx
movq %rbx, %r15
movq 0x68(%rsp), %r14
jmp 0x50bf
movq 0xe0(%rsp), %rax
movq 0x8(%rax), %rax
cvttsd2si (%rax,%rbp,8), %eax
movq %rbx, %r15
movq 0x8(%rbx), %rcx
cltq
movsd (%rcx,%rax,8), %xmm1
movq %rbx, %rdi
movq %rdx, %r13
movq 0xb8(%rsp), %rbx
movq %rbx, %rcx
movsd %xmm2, 0x98(%rsp)
callq 0x46e2
movsd 0x98(%rsp), %xmm3
movsd 0x28(%rsp), %xmm2
movq 0x38(%rsp), %r11
movq 0x40(%rsp), %r9
xorl %ecx, %ecx
testl %r13d, %r13d
cmovlel %ecx, %r13d
movq %r13, %rdi
xorl %eax, %eax
cmpq %rcx, %rdi
je 0x5057
movsd (%rbx,%rcx,8), %xmm1
movslq (%r14,%rcx,4), %rdx
movapd %xmm1, %xmm0
movq 0x20(%rsp), %rsi
subsd (%rsi,%rdx,8), %xmm0
movsd %xmm1, (%rsi,%rdx,8)
movapd %xmm0, %xmm1
andpd 0x7c3a(%rip), %xmm1     # 0xcc70
ucomisd 0x7c12(%rip), %xmm1     # 0xcc50
jb 0x5052
cltq
movl %edx, (%r12,%rax,4)
movq 0x68(%rsp), %rdx
movsd %xmm0, (%rdx,%rax,8)
incl %eax
incq %rcx
jmp 0x5009
movq 0x30(%r15), %rcx
movq 0x10(%rcx), %rcx
movq (%rcx,%rbp,8), %rcx
movslq 0x20(%r15), %rdx
testl %eax, %eax
movl $0x0, %esi
cmovlel %esi, %eax
movq 0x68(%rsp), %r14
movslq (%rcx), %rsi
cmpq $-0x1, %rsi
je 0x50b7
decq %rsi
imulq %rdx, %rsi
leaq (%r11,%rsi,8), %rsi
xorl %edi, %edi
cmpq %rdi, %rax
je 0x50b1
movsd (%r14,%rdi,8), %xmm0
movslq (%r12,%rdi,4), %r8
mulsd 0x8(%rcx), %xmm0
addsd (%rsi,%r8,8), %xmm0
movsd %xmm0, (%rsi,%r8,8)
incq %rdi
jmp 0x508c
addq $0x10, %rcx
jmp 0x5076
maxsd %xmm2, %xmm3
movl 0x30(%rsp), %ecx
incl %ecx
jmp 0x4b1d
movl 0xb4(%rsp), %r8d
incl %r8d
movl %r8d, %eax
xorl %edx, %edx
pushq $0xa
popq %rcx
divl %ecx
testl %edx, %edx
jne 0x50f9
leaq 0x7e52(%rip), %rdi      # 0xcf38
xorl %eax, %eax
movl %r8d, %ebx
callq 0x52d8
movsd 0x28(%rsp), %xmm3
movl %ebx, %r8d
movsd 0x50(%rsp), %xmm0
ucomisd %xmm3, %xmm0
seta %bl
jbe 0x4aac
movsd 0x28(%r15), %xmm0
ucomisd %xmm3, %xmm0
seta %al
testb %al, 0xf(%rsp)
jne 0x517d
movl 0x1c(%r15), %edx
movl 0x20(%r15), %eax
testl %edx, %edx
movl $0x0, %ecx
movq %rdx, 0x48(%rsp)
cmovgl %edx, %ecx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x514a
movq 0x70(%rsp), %rsi
movl %eax, (%rsi,%rdx,4)
incq %rdx
jmp 0x5138
leaq 0x7de9(%rip), %rdi      # 0xcf3a
xorl %eax, %eax
movl %r8d, %ebp
callq 0x52d8
movl %ebp, %r8d
movsd 0x50(%rsp), %xmm0
mulsd 0x7ac4(%rip), %xmm0     # 0xcc30
maxsd 0x28(%r15), %xmm0
movsd %xmm0, 0x50(%rsp)
jmp 0x4aac
leaq 0x7db8(%rip), %rdi      # 0xcf3c
xorl %ebx, %ebx
movl %r8d, %esi
xorl %eax, %eax
movl %r8d, %ebp
callq 0x52d8
cmpl 0x24(%r15), %ebp
jl 0x51a7
leaq 0x7dc0(%rip), %rdi      # 0xcf60
xorl %eax, %eax
callq 0x52d8
movslq 0x20(%r15), %rax
movl 0x18(%r15), %ecx
imull %eax, %ecx
testl %ecx, %ecx
cmovlel %ebx, %ecx
xorpd %xmm0, %xmm0
movq 0x38(%rsp), %rdx
cmpq %rbx, %rcx
je 0x51d7
movsd (%rdx,%rbx,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rbx
jmp 0x51c0
mulsd 0x7a51(%rip), %xmm0     # 0xcc30
movl 0x1c(%r15), %ecx
movl %ecx, %edx
imull %eax, %edx
xorl %esi, %esi
testl %edx, %edx
cmovlel %esi, %edx
xorpd %xmm1, %xmm1
xorl %ebp, %ebp
cmpq %rsi, %rdx
je 0x5219
movq 0x58(%rsp), %rdi
movsd (%rdi,%rsi,8), %xmm2
xorl %edi, %edi
ucomisd %xmm2, %xmm1
addsd %xmm2, %xmm0
setne %dil
addl %edi, %ebp
incq %rsi
jmp 0x51f5
movq 0x30(%r15), %rdx
xorl %esi, %esi
testl %ecx, %ecx
cmovlel %esi, %ecx
shlq $0x3, %rax
movq 0x58(%rsp), %rdi
cmpq %rsi, %rcx
je 0x524d
movq 0x8(%rdx), %r8
cvttsd2si (%r8,%rsi,8), %r8d
movslq %r8d, %r8
subsd (%rdi,%r8,8), %xmm0
incq %rsi
addq %rax, %rdi
jmp 0x522d
leaq 0x7d39(%rip), %rdi      # 0xcf8d
movb $0x1, %al
callq 0x52d8
leaq 0x7d42(%rip), %rdi      # 0xcfa4
movl %ebp, %esi
xorl %eax, %eax
callq 0x52d8
movq 0x58(%rsp), %rdi
callq 0x21e0
movq 0xb8(%rsp), %rdi
callq 0x21e0
movq 0x60(%rsp), %rdi
callq 0x21e0
movq 0x40(%rsp), %rdi
callq 0x21e0
movq %r12, %rdi
callq 0x21e0
movq %r14, %rdi
callq 0x21e0
movq 0x90(%rsp), %rdi
callq 0x21e0
movq 0x78(%rsp), %rdi
callq 0x21e0
movq 0x70(%rsp), %rdi
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21e0