// File: /workspace/github_cpp_makefile_star2_O1/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 $0xd8, %rsp
movq %rsi, 0x88(%rsp)
movq %rdi, 0x98(%rsp)
movslq 0x1c(%rdi), %r13
movslq 0x20(%rdi), %rbx
movl %ebx, %eax
imull %r13d, %eax
movl %eax, 0x14(%rsp)
cltq
movq %rax, 0x70(%rsp)
leaq (,%rax,8), %rdi
testl %eax, %eax
movq $-0x1, %r12
cmovsq %r12, %rdi
leaq (,%rax,4), %rax
cmovsq %r12, %rax
movq %rax, 0x20(%rsp)
callq 0x2030
movq %rax, 0x68(%rsp)
leaq (,%rbx,8), %rbp
testq %rbx, %rbx
cmovsq %r12, %rbp
leaq (,%rbx,4), %rax
cmovsq %r12, %rax
movq %rax, 0x40(%rsp)
movq %rbp, %rdi
callq 0x2030
movq %rax, 0x90(%rsp)
leaq (,%r13,4), %r15
testq %r13, %r13
cmovsq %r12, %r15
movq %r13, %r14
leaq (,%r13,8), %r13
cmovsq %r12, %r13
movq %r15, %rdi
callq 0x2030
movq %rax, %r12
movq %r13, %rdi
callq 0x2030
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rdi
callq 0x2030
movq %rax, 0x18(%rsp)
movq %rbp, %rdi
movq 0x98(%rsp), %rbp
callq 0x2030
movq %rax, %r13
movq 0x20(%rsp), %rdi
callq 0x2030
movq %rax, 0x80(%rsp)
movq %r15, %rdi
callq 0x2030
movq %rax, 0x50(%rsp)
movq %r15, %rdi
callq 0x2030
movq %rax, 0x38(%rsp)
movsd 0x28(%rbp), %xmm0
movsd %xmm0, 0x28(%rsp)
cmpl $0x0, 0x70(%rsp)
movq 0x68(%rsp), %rdi
jle 0x5144
movl 0x14(%rsp), %edx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x20c0
movl 0x18(%rbp), %eax
imull %ebx, %eax
testl %eax, %eax
jle 0x5163
movl %eax, %edx
shlq $0x3, %rdx
movq 0x88(%rsp), %rdi
xorl %esi, %esi
callq 0x20c0
movsd 0x28(%rsp), %xmm0
mulsd 0x8c2f(%rip), %xmm0     # 0xdda0
movsd %xmm0, 0x28(%rsp)
testl %r14d, %r14d
jle 0x5219
movl %ebx, %eax
movq 0x30(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq 0x10(%rdx), %rdx
leaq (,%rax,4), %rsi
xorl %edi, %edi
movq 0x80(%rsp), %r8
testl %ebx, %ebx
jle 0x51b3
xorl %r9d, %r9d
movl %r9d, (%r8,%r9,4)
incq %r9
cmpq %r9, %rax
jne 0x51a7
movq (%rdx,%rdi,8), %r9
movq 0x30(%rsp), %r10
movq $0x0, (%r10,%rdi,8)
cmpl $-0x1, (%r9)
je 0x51f2
movsd (%r10,%rdi,8), %xmm0
addq $0x10, %r9
movsd -0x8(%r9), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%r10,%rdi,8)
cmpl $-0x1, (%r9)
leaq 0x10(%r9), %r9
jne 0x51d4
movq 0x38(%rsp), %r9
movl %ebx, (%r9,%rdi,4)
cvttsd2si (%rcx,%rdi,8), %r9d
movq 0x50(%rsp), %r10
movl %r9d, (%r10,%rdi,4)
movl %edi, (%r12,%rdi,4)
incq %rdi
addq %rsi, %r8
cmpq %r14, %rdi
jne 0x51a0
movsd 0x28(%rsp), %xmm0
maxsd 0x89f1(%rip), %xmm0     # 0xdc18
movsd %xmm0, 0x28(%rsp)
movq 0x80(%rsp), %rax
addq $-0x4, %rax
movq %rax, 0xb0(%rsp)
movb $0x1, %al
movl %eax, 0x4c(%rsp)
movl $0x0, 0x10(%rsp)
movq %r12, 0x60(%rsp)
movq 0x18(%rsp), %rbx
movq %r13, 0xa0(%rsp)
movl 0x10(%rsp), %eax
cmpl 0x24(%rbp), %eax
jge 0x5949
movq %r14, %r15
testl %r14d, %r14d
jle 0x52a2
movl %r15d, %ebx
xorl %r14d, %r14d
callq 0x2090
cltd
idivl %ebx
movslq %edx, %rax
addq %r14, %rax
movl (%r12,%r14,4), %ecx
movl (%r12,%rax,4), %edx
movl %edx, (%r12,%r14,4)
movl %ecx, (%r12,%rax,4)
incq %r14
decq %rbx
jne 0x527c
movq %r15, %r14
testl %r14d, %r14d
jle 0x5881
xorl %ecx, %ecx
movsd 0x8af0(%rip), %xmm4     # 0xdda8
movapd %xmm4, %xmm8
movq 0x30(%rsp), %rax
movq 0x18(%rsp), %rbx
xorpd %xmm5, %xmm5
movsd 0x7d35(%rip), %xmm6     # 0xd008
movsd 0x894d(%rip), %xmm7     # 0xdc28
movslq %ecx, %rdx
movq %rdx, 0xb8(%rsp)
movl (%r12,%rdx,4), %edx
movslq %edx, %r15
movsd (%rax,%r15,8), %xmm0
ucomisd %xmm5, %xmm0
jbe 0x5874
movl %edx, 0x7c(%rsp)
movl %ecx, 0xc(%rsp)
movq %r14, 0x58(%rsp)
movl 0x20(%rbp), %ecx
movq 0x38(%rsp), %rax
movl (%rax,%r15,4), %edx
testl %edx, %edx
movabsq $0x3ff0000000000000, %rdi # imm = 0x3FF0000000000000
jle 0x5336
movq 0x10(%rbp), %rax
xorl %esi, %esi
movq %rdi, (%rax,%rsi,8)
incq %rsi
cmpq %rsi, %rdx
jne 0x532a
movq 0x50(%rsp), %rax
movslq (%rax,%r15,4), %r8
cmpl %edx, %r8d
movq 0x88(%rsp), %rbx
jge 0x5358
movq 0x10(%rbp), %rax
movq $0x0, (%rax,%r8,8)
movl %ecx, %eax
imull 0x7c(%rsp), %eax
movslq %eax, %rdi
movq 0x80(%rsp), %rax
leaq (%rax,%rdi,4), %r12
movq 0x30(%rbp), %rax
movq %rax, 0x20(%rsp)
movq 0x10(%rax), %rax
movq (%rax,%r15,8), %rax
movl (%rax), %esi
cmpl $-0x1, %esi
je 0x53cc
movq 0x10(%rbp), %r9
testl %edx, %edx
jle 0x53c0
decl %esi
imull %ecx, %esi
movslq %esi, %rsi
leaq (%rbx,%rsi,8), %rsi
xorl %r10d, %r10d
movslq (%r12,%r10,4), %r11
movsd (%rsi,%r11,8), %xmm1
mulsd 0x8(%rax), %xmm1
addsd (%r9,%r10,8), %xmm1
movsd %xmm1, (%r9,%r10,8)
incq %r10
cmpq %r10, %rdx
jne 0x539d
movl 0x10(%rax), %esi
addq $0x10, %rax
cmpl $-0x1, %esi
jne 0x538a
movq 0x68(%rsp), %rax
leaq (%rax,%rdi,8), %rbx
movapd %xmm6, %xmm1
movapd %xmm4, %xmm9
testl %edx, %edx
jle 0x5422
movq 0x10(%rbp), %rax
xorl %ecx, %ecx
movapd %xmm4, %xmm2
movapd %xmm6, %xmm1
movslq (%r12,%rcx,4), %rsi
ucomisd (%rbx,%rsi,8), %xmm5
jbe 0x540a
movsd (%rax,%rcx,8), %xmm3
ucomisd %xmm3, %xmm1
jbe 0x540a
movapd %xmm3, %xmm1
movsd (%rax,%rcx,8), %xmm9
maxsd %xmm2, %xmm9
incq %rcx
movapd %xmm9, %xmm2
cmpq %rcx, %rdx
jne 0x53f0
cmpl %edx, %r8d
jge 0x5467
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
cvttsd2si (%rax,%r15,8), %eax
cltq
movq 0x8(%rbp), %rcx
movsd (%rcx,%rax,8), %xmm2
ucomisd (%rbx,%rax,8), %xmm2
jbe 0x5467
movq 0x10(%rbp), %rax
movsd (%rax,%r8,8), %xmm2
ucomisd %xmm2, %xmm1
movq 0x58(%rsp), %r14
movl 0xc(%rsp), %ecx
jbe 0x5470
movapd %xmm2, %xmm1
jmp 0x5470
movq 0x58(%rsp), %r14
movl 0xc(%rsp), %ecx
movq 0x38(%rsp), %rax
movl (%rax,%r15,4), %r8d
testl %r8d, %r8d
jle 0x565e
movq 0x8(%rbp), %rax
movq %rax, 0xd0(%rsp)
movq 0x10(%rbp), %r9
movq 0x50(%rsp), %rax
movl (%rax,%r15,4), %r14d
movq 0xb0(%rsp), %rax
leaq (%rax,%rdi,4), %rax
movq %rax, 0xc8(%rsp)
leaq -0x8(%r9), %rax
movq %rax, 0xc0(%rsp)
xorl %ecx, %ecx
movq %r15, 0x70(%rsp)
movq %r9, 0xa8(%rsp)
movl %r14d, %eax
xorpd %xmm2, %xmm2
cmpq %rax, %rcx
jne 0x54f5
movq 0x20(%rsp), %rdx
movq 0x8(%rdx), %rdx
cvttsd2si (%rdx,%r15,8), %edx
movslq %edx, %rdx
movq 0xd0(%rsp), %rsi
movsd (%rsi,%rdx,8), %xmm2
movslq (%r12,%rcx,4), %r11
ucomisd (%rbx,%r11,8), %xmm2
jne 0x5638
jp 0x5638
ucomisd (%r9,%rcx,8), %xmm1
jbe 0x5638
movq 0x8(%rbp), %r13
movq 0x10(%rbp), %rdx
movq %r8, 0x40(%rsp)
movslq %r8d, %r15
movq 0xc8(%rsp), %rsi
leaq (%rsi,%r15,4), %rdi
movl %r14d, 0x14(%rsp)
movl %r14d, %esi
negl %esi
leal -0x1(%r15), %ebp
addq %rsi, %rbp
leaq -0x1(%r15), %r14
leaq (%rdx,%r15,8), %rsi
addq $-0x8, %rsi
xorl %r8d, %r8d
movq %r8, %rdx
addq %r14, %r8
cmpq %rcx, %r8
jle 0x560b
movl %ebp, %r10d
xorpd %xmm2, %xmm2
addl %edx, %r10d
jne 0x558c
movq 0x20(%rsp), %r8
movq 0x8(%r8), %r8
movq 0x70(%rsp), %r9
cvttsd2si (%r8,%r9,8), %r8d
movslq %r8d, %r8
movsd (%r13,%r8,8), %xmm2
movslq (%rdi,%rdx,4), %r9
ucomisd (%rbx,%r9,8), %xmm2
jne 0x55a5
jp 0x55a5
leaq -0x1(%rdx), %r8
ucomisd (%rsi,%rdx,8), %xmm1
ja 0x5553
cmpq %rax, %rcx
movq 0x40(%rsp), %r8
leal -0x1(%r8,%rdx), %r8d
movl 0x14(%rsp), %r14d
cmovel %r8d, %r14d
testl %r10d, %r10d
movl %r9d, (%r12,%rcx,4)
movl %r11d, (%rdi,%rdx,4)
movq 0xc0(%rsp), %rax
leaq (%rax,%r15,8), %rax
movq 0xa8(%rsp), %r9
movsd (%r9,%rcx,8), %xmm2
movsd (%rax,%rdx,8), %xmm3
movsd %xmm3, (%r9,%rcx,8)
movsd %xmm2, (%rax,%rdx,8)
cmovel %ecx, %r14d
movq 0xa0(%rsp), %r13
movq 0x98(%rsp), %rbp
movq 0x70(%rsp), %r15
jmp 0x5638
movq 0x40(%rsp), %r8
addl %edx, %r8d
decl %r8d
movq 0xa0(%rsp), %r13
movq 0x98(%rsp), %rbp
movq 0x70(%rsp), %r15
movl 0x14(%rsp), %r14d
movq 0xa8(%rsp), %r9
incq %rcx
movslq %r8d, %rax
cmpq %rax, %rcx
jl 0x54ca
movq 0x50(%rsp), %rax
movl %r14d, (%rax,%r15,4)
movq 0x38(%rsp), %rax
movq 0x58(%rsp), %r14
movl 0xc(%rsp), %ecx
movl %r8d, (%rax,%r15,4)
cmpl $0x1, %r8d
jg 0x5696
movslq %r14d, %rax
decl %r14d
movq 0x60(%rsp), %r12
movl -0x4(%r12,%rax,4), %ecx
movq 0xb8(%rsp), %rdx
movl %ecx, (%r12,%rdx,4)
movl 0x7c(%rsp), %ecx
movl %ecx, -0x4(%r12,%rax,4)
decl %edx
movl %edx, %ecx
jmp 0x57b1
subsd %xmm1, %xmm9
ucomisd %xmm9, %xmm7
jae 0x57ac
maxsd %xmm8, %xmm9
movsd %xmm9, 0x40(%rsp)
movq (%rbp), %rax
movq 0x10(%rbp), %rcx
movapd %xmm0, %xmm1
xorpd 0x858a(%rip), %xmm1     # 0xdc50
movl %r8d, %edx
xorl %esi, %esi
movslq (%r12,%rsi,4), %rdi
movsd (%rbx,%rdi,8), %xmm2
mulsd %xmm1, %xmm2
addsd (%rcx,%rsi,8), %xmm2
movsd %xmm2, (%rax,%rsi,8)
incq %rsi
cmpq %rsi, %rdx
jne 0x56cb
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
cvttsd2si (%rax,%r15,8), %eax
movq 0x50(%rsp), %rcx
movl (%rcx,%r15,4), %esi
movq 0x8(%rbp), %rcx
cltq
movsd (%rcx,%rax,8), %xmm1
movq %rbp, %rdi
movl %r8d, %edx
movq 0x90(%rsp), %rcx
callq 0x4e5e
movq 0x38(%rsp), %rax
movslq (%rax,%r15,4), %rcx
testq %rcx, %rcx
jle 0x57c0
xorl %edx, %edx
xorl %eax, %eax
movq 0x90(%rsp), %rdi
movsd 0x8662(%rip), %xmm4     # 0xdda8
xorpd %xmm5, %xmm5
movsd 0x78b6(%rip), %xmm6     # 0xd008
movsd 0x84ce(%rip), %xmm7     # 0xdc28
movapd 0x84de(%rip), %xmm2     # 0xdc40
movsd 0x40(%rsp), %xmm8
movsd (%rdi,%rdx,8), %xmm1
movslq (%r12,%rdx,4), %rsi
movapd %xmm1, %xmm0
subsd (%rbx,%rsi,8), %xmm0
movsd %xmm1, (%rbx,%rsi,8)
movapd %xmm0, %xmm1
andpd %xmm2, %xmm1
ucomisd %xmm7, %xmm1
jb 0x57a2
cltq
movq 0x18(%rsp), %r8
movl %esi, (%r8,%rax,4)
movsd %xmm0, (%r13,%rax,8)
incl %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x5769
jmp 0x57e5
movq 0x60(%rsp), %r12
movq 0x30(%rsp), %rax
movq 0x18(%rsp), %rbx
jmp 0x5874
xorl %eax, %eax
movsd 0x85de(%rip), %xmm4     # 0xdda8
xorpd %xmm5, %xmm5
movsd 0x7832(%rip), %xmm6     # 0xd008
movsd 0x844a(%rip), %xmm7     # 0xdc28
movsd 0x40(%rsp), %xmm8
movq 0x30(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq (%rcx,%r15,8), %rcx
movl (%rcx), %edi
cmpl $-0x1, %edi
je 0x585c
movslq 0x20(%rbp), %rdx
movl %eax, %esi
movq 0x60(%rsp), %r12
movq 0x18(%rsp), %rbx
testl %eax, %eax
jle 0x5849
movslq %edi, %rdi
decq %rdi
imulq %rdx, %rdi
movq 0x88(%rsp), %r8
leaq (%r8,%rdi,8), %rdi
xorl %r8d, %r8d
movsd (%r13,%r8,8), %xmm0
movslq (%rbx,%r8,4), %r9
mulsd 0x8(%rcx), %xmm0
addsd (%rdi,%r9,8), %xmm0
movsd %xmm0, (%rdi,%r9,8)
incq %r8
cmpq %r8, %rsi
jne 0x5825
movl 0x10(%rcx), %edi
addq $0x10, %rcx
cmpl $-0x1, %edi
jne 0x5808
movq 0x30(%rsp), %rax
jmp 0x586b
movq 0x60(%rsp), %r12
movq 0x30(%rsp), %rax
movq 0x18(%rsp), %rbx
movq 0x58(%rsp), %r14
movl 0xc(%rsp), %ecx
incl %ecx
cmpl %r14d, %ecx
jl 0x52db
jmp 0x588f
movsd 0x851e(%rip), %xmm8     # 0xdda8
movq 0x18(%rsp), %rbx
movl 0x10(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
rorl %eax
cmpl $0x19999999, %eax       # imm = 0x19999999
ja 0x58c4
leaq 0x8639(%rip), %rdi      # 0xdee8
xorl %eax, %eax
movsd %xmm8, 0x20(%rsp)
callq 0x5ab4
movsd 0x20(%rsp), %xmm8
movsd 0x28(%rsp), %xmm0
ucomisd %xmm8, %xmm0
jbe 0x58e8
movsd 0x28(%rbp), %xmm0
ucomisd %xmm8, %xmm0
jbe 0x58f4
testb $0x1, 0x4c(%rsp)
je 0x58f4
xorl %eax, %eax
jmp 0x5941
movb $0x1, %al
movl $0x0, 0x4c(%rsp)
jmp 0x5941
movslq 0x1c(%rbp), %r14
testq %r14, %r14
movq 0x38(%rsp), %rdx
jle 0x5912
movl 0x20(%rbp), %eax
xorl %ecx, %ecx
movl %eax, (%rdx,%rcx,4)
incq %rcx
cmpq %rcx, %r14
jne 0x5907
leaq 0x85d1(%rip), %rdi      # 0xdeea
xorl %eax, %eax
callq 0x5ab4
movsd 0x28(%rsp), %xmm0
mulsd 0x82da(%rip), %xmm0     # 0xdc08
maxsd 0x28(%rbp), %xmm0
movsd %xmm0, 0x28(%rsp)
movb $0x1, %al
movl %eax, 0x4c(%rsp)
movb $0x1, %al
testb %al, %al
jne 0x5261
leaq 0x859c(%rip), %rdi      # 0xdeec
movl 0x10(%rsp), %r14d
movl %r14d, %esi
xorl %eax, %eax
callq 0x5ab4
cmpl 0x24(%rbp), %r14d
jl 0x5973
leaq 0x85a4(%rip), %rdi      # 0xdf10
xorl %eax, %eax
callq 0x5ab4
movslq 0x20(%rbp), %rax
movl 0x18(%rbp), %ecx
imull %eax, %ecx
testl %ecx, %ecx
jle 0x59b5
movl %ecx, %ecx
xorpd %xmm0, %xmm0
xorl %edx, %edx
movq 0x68(%rsp), %r8
movq 0x88(%rsp), %rsi
movsd (%rsi,%rdx,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rdx
cmpq %rdx, %rcx
jne 0x5996
mulsd 0x8255(%rip), %xmm0     # 0xdc08
jmp 0x59be
xorpd %xmm0, %xmm0
movq 0x68(%rsp), %r8
movl 0x1c(%rbp), %ecx
movl %ecx, %edx
imull %eax, %edx
testl %edx, %edx
jle 0x59f6
movl %edx, %edx
xorl %esi, %esi
xorpd %xmm1, %xmm1
xorl %r12d, %r12d
movsd (%r8,%rsi,8), %xmm2
addsd %xmm2, %xmm0
xorl %edi, %edi
ucomisd %xmm2, %xmm1
setne %dil
addl %edi, %r12d
incq %rsi
cmpq %rsi, %rdx
jne 0x59d5
jmp 0x59f9
xorl %r12d, %r12d
testl %ecx, %ecx
jle 0x5a28
movq 0x30(%rbp), %rdx
movq 0x8(%rdx), %rdx
shlq $0x3, %rax
xorl %esi, %esi
movq %r8, %rdi
cvttsd2si (%rdx,%rsi,8), %r8d
movslq %r8d, %r8
subsd (%rdi,%r8,8), %xmm0
incq %rsi
addq %rax, %rdi
cmpq %rsi, %rcx
jne 0x5a0e
leaq 0x850e(%rip), %rdi      # 0xdf3d
movb $0x1, %al
callq 0x5ab4
leaq 0x8517(%rip), %rdi      # 0xdf54
movl %r12d, %esi
xorl %eax, %eax
callq 0x5ab4
movq 0x68(%rsp), %rdi
callq 0x21e0
movq 0x90(%rsp), %rdi
callq 0x21e0
movq 0x60(%rsp), %rdi
callq 0x21e0
movq 0x30(%rsp), %rdi
callq 0x21e0
movq %rbx, %rdi
callq 0x21e0
movq %r13, %rdi
callq 0x21e0
movq 0x80(%rsp), %rdi
callq 0x21e0
movq 0x50(%rsp), %rdi
callq 0x21e0
movq 0x38(%rsp), %rdi
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21e0