// File: 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
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x108(%rbp)
movl $0x0, -0x20(%rbp)
movl 0x1c(%rcx), %eax
imull 0x20(%rcx), %eax
cltq
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x28(%rbp)
movslq 0x20(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x30(%rbp)
movslq 0x1c(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x38(%rbp)
movslq 0x1c(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x40(%rbp)
movslq 0x20(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x48(%rbp)
movslq 0x20(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq -0x108(%rbp), %rcx
movq %rax, -0x50(%rbp)
movl 0x20(%rcx), %eax
imull 0x1c(%rcx), %eax
cltq
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x58(%rbp)
movslq 0x1c(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x60(%rbp)
movl 0x1c(%rax), %ecx
movl %ecx, -0x64(%rbp)
movslq 0x1c(%rax), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x70(%rbp)
movsd 0xcbe3(%rip), %xmm0     # 0x12df8
mulsd 0x28(%rax), %xmm0
movsd 0xbe06(%rip), %xmm1     # 0x12028
callq 0x7070
movsd %xmm0, -0x78(%rbp)
movb $0x1, -0x79(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x108(%rbp), %rdx
movl -0x14(%rbp), %eax
movl 0x1c(%rdx), %ecx
imull 0x20(%rdx), %ecx
cmpl %ecx, %eax
jge 0x6267
movq -0x28(%rbp), %rax
movslq -0x14(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6237
movl $0x0, -0x14(%rbp)
movq -0x108(%rbp), %rdx
movl -0x14(%rbp), %eax
movl 0x18(%rdx), %ecx
imull 0x20(%rdx), %ecx
cmpl %ecx, %eax
jge 0x629e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x626e
movl $0x0, -0x14(%rbp)
movq -0x108(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x1c(%rcx), %eax
jge 0x63d0
movl $0x0, -0x18(%rbp)
movq -0x108(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x20(%rcx), %eax
jge 0x62f7
movq -0x108(%rbp), %rsi
movl -0x18(%rbp), %edx
movq -0x58(%rbp), %rax
movl -0x14(%rbp), %ecx
imull 0x20(%rsi), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x62bf
movq -0x108(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x88(%rbp)
movq -0x40(%rbp), %rax
movslq -0x14(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x88(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x6383
movq -0x88(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x90(%rbp), %xmm0
movsd -0x90(%rbp), %xmm2
movq -0x40(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x88(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x88(%rbp)
jmp 0x6325
movq -0x108(%rbp), %rax
movl 0x20(%rax), %esi
movq -0x70(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movl %esi, (%rcx,%rdx,4)
movq 0x30(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
cvttsd2si (%rax,%rcx,8), %edx
movq -0x60(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %edx
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x62a5
jmp 0x63d2
movq -0x108(%rbp), %rcx
movl -0x20(%rbp), %eax
cmpl 0x24(%rcx), %eax
jge 0x6dac
movsd 0xca13(%rip), %xmm0     # 0x12e00
movsd %xmm0, -0x98(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x64(%rbp), %eax
jge 0x645a
movl -0x14(%rbp), %eax
movl %eax, -0x10c(%rbp)
callq 0x2090
movl -0x64(%rbp), %ecx
subl -0x14(%rbp), %ecx
cltd
idivl %ecx
movl -0x10c(%rbp), %eax
addl %edx, %eax
movl %eax, -0x9c(%rbp)
movq -0x38(%rbp), %rdi
movslq -0x14(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x38(%rbp), %rsi
movslq -0x9c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x70b0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x63fc
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x64(%rbp), %eax
jge 0x6cbb
movq -0x108(%rbp), %rdx
movq -0x38(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
movq -0x40(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xa8(%rbp)
movq -0x28(%rbp), %rax
movl -0x14(%rbp), %ecx
imull 0x20(%rdx), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
movq -0x58(%rbp), %rax
movl -0x14(%rbp), %ecx
imull 0x20(%rdx), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movsd -0xa8(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x6cab
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x70(%rbp), %rcx
movslq -0x14(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x6522
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movsd 0xbb16(%rip), %xmm0     # 0x12028
movsd %xmm0, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x64eb
movq -0x60(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x70(%rbp), %rcx
movslq -0x14(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x6559
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x60(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x108(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x6634
movq -0x108(%rbp), %rdx
movq -0x10(%rbp), %rax
movq -0xc0(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
imull 0x20(%rdx), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0xc8(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x70(%rbp), %rcx
movslq -0x14(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x661d
movq -0x108(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq -0xb8(%rbp), %rdx
movslq -0x18(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq -0xc0(%rbp), %rcx
movsd 0x8(%rcx), %xmm2
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x65ba
movq -0xc0(%rbp), %rax
addq $0x10, %rax
movq %rax, -0xc0(%rbp)
jmp 0x6577
movsd 0xb9d4(%rip), %xmm0     # 0x12010
movsd %xmm0, -0xd0(%rbp)
movsd 0xc7b4(%rip), %xmm0     # 0x12e00
movsd %xmm0, -0xd8(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x70(%rbp), %rcx
movslq -0x14(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x6717
movq -0xb0(%rbp), %rax
movq -0xb8(%rbp), %rcx
movslq -0x18(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
xorps %xmm0, %xmm0
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x66cd
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0xd0(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x66cd
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xd0(%rbp)
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd -0xd8(%rbp), %xmm0
jbe 0x6707
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xd8(%rbp)
jmp 0x6709
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x665b
movq -0x60(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x70(%rbp), %rcx
movslq -0x14(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x67cd
movq -0x108(%rbp), %rcx
movq -0xb0(%rbp), %rax
movq 0x30(%rcx), %rdx
movq 0x8(%rdx), %rdx
movslq -0x14(%rbp), %rsi
cvttsd2si (%rdx,%rsi,8), %edx
movslq %edx, %rdx
movsd (%rax,%rdx,8), %xmm1
movq 0x8(%rcx), %rax
movq 0x30(%rcx), %rcx
movq 0x8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
cvttsd2si (%rcx,%rdx,8), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x67cb
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x60(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0xd0(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x67cb
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x60(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xd0(%rbp)
jmp 0x67cd
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x70(%rbp), %rcx
movslq -0x14(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x698d
movq -0x108(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movq -0x60(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movq -0xb0(%rbp), %rax
movq -0xb8(%rbp), %r8
movslq -0x18(%rbp), %r9
movslq (%r8,%r9,4), %r8
movsd (%rax,%r8,8), %xmm0
movsd -0xd0(%rbp), %xmm1
callq 0x5f70
testb $0x1, %al
jne 0x6832
jmp 0x697d
movq -0x70(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x70(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x18(%rbp), %eax
jle 0x697b
movq -0x108(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x70(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x60(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movq -0xb0(%rbp), %rax
movq -0xb8(%rbp), %r8
movq -0x70(%rbp), %r9
movslq -0x14(%rbp), %r10
movslq (%r9,%r10,4), %r9
movslq (%r8,%r9,4), %r8
movsd (%rax,%r8,8), %xmm0
movsd -0xd0(%rbp), %xmm1
callq 0x5f70
testb $0x1, %al
jne 0x6965
movq -0xb8(%rbp), %rdi
movslq -0x18(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0xb8(%rbp), %rsi
movq -0x70(%rbp), %rax
movslq -0x14(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x70b0
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0x18(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rdi
movq 0x10(%rax), %rsi
movq -0x70(%rbp), %rax
movslq -0x14(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x70e0
movq -0x60(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x70(%rbp), %rcx
movslq -0x14(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0x693b
movl -0x18(%rbp), %edx
movq -0x60(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x6963
movq -0x60(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x18(%rbp), %eax
jne 0x6961
movq -0x70(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x60(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x6963
jmp 0x697b
movq -0x70(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x6843
jmp 0x697d
jmp 0x697f
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x67d4
movq -0x70(%rbp), %rax
movslq -0x14(%rbp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jg 0x69d5
movl -0x64(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x64(%rbp)
movq -0x38(%rbp), %rdi
movslq -0x1c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x38(%rbp), %rsi
movslq -0x64(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x70b0
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6cad
movsd -0xd8(%rbp), %xmm1
subsd -0xd0(%rbp), %xmm1
movsd 0xc293(%rip), %xmm0     # 0x12c80
ucomisd %xmm1, %xmm0
jb 0x69f8
jmp 0x6cad
movsd -0xd8(%rbp), %xmm0
subsd -0xd0(%rbp), %xmm0
movsd -0x98(%rbp), %xmm1
callq 0x7070
movsd %xmm0, -0x98(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x70(%rbp), %rcx
movslq -0x14(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x6aa1
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rcx
movslq -0x18(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm1
movsd -0xa8(%rbp), %xmm0
movq -0xb0(%rbp), %rcx
movq -0xb8(%rbp), %rdx
movslq -0x18(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movsd (%rcx,%rdx,8), %xmm2
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq (%rax), %rax
movslq -0x18(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6a24
movq -0x108(%rbp), %rdi
movsd -0xa8(%rbp), %xmm0
movq -0x60(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %esi
movq 0x8(%rdi), %rax
movq 0x30(%rdi), %rcx
movq 0x8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
cvttsd2si (%rcx,%rdx,8), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x70(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x30(%rbp), %rcx
callq 0x5d00
movl $0x0, -0xdc(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x70(%rbp), %rcx
movslq -0x14(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x6bdd
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0xb0(%rbp), %rax
movq -0xb8(%rbp), %rcx
movslq -0x18(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
subsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xe8(%rbp)
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0xb0(%rbp), %rax
movq -0xb8(%rbp), %rcx
movslq -0x18(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0xe8(%rbp), %xmm0
movaps 0xc128(%rip), %xmm1     # 0x12ca0
pand %xmm1, %xmm0
movsd 0xc0fc(%rip), %xmm1     # 0x12c80
ucomisd %xmm1, %xmm0
jb 0x6bcd
movq -0xb8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x48(%rbp), %rax
movslq -0xdc(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movsd -0xe8(%rbp), %xmm0
movq -0x50(%rbp), %rax
movslq -0xdc(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0xdc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdc(%rbp)
jmp 0x6bcf
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6afd
movq -0x108(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x6ca9
movq -0x108(%rbp), %rdx
movq -0x10(%rbp), %rax
movq -0xc0(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
imull 0x20(%rdx), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0xf0(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0xdc(%rbp), %eax
jge 0x6c92
movq -0x50(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0xc0(%rbp), %rax
movsd 0x8(%rax), %xmm2
movq -0xf0(%rbp), %rax
movq -0x48(%rbp), %rcx
movslq -0x18(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6c3e
movq -0xc0(%rbp), %rax
addq $0x10, %rax
movq %rax, -0xc0(%rbp)
jmp 0x6bfb
jmp 0x6cab
jmp 0x6cad
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6461
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x6ce2
leaq 0xc20d(%rip), %rdi      # 0x12ee8
movb $0x0, %al
callq 0x7120
movsd -0x98(%rbp), %xmm1
movsd -0x78(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x6da3
movq -0x108(%rbp), %rax
movsd -0x98(%rbp), %xmm1
movsd 0x28(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x6d25
movb -0x79(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x6d25
jmp 0x6dac
movq -0x108(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x64(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x108(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x1c(%rcx), %eax
jge 0x6d68
movq -0x108(%rbp), %rax
movl 0x20(%rax), %edx
movq -0x70(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6d39
leaq 0xc17b(%rip), %rdi      # 0x12eea
movb $0x0, %al
callq 0x7120
movq -0x108(%rbp), %rax
movsd -0x78(%rbp), %xmm0
movsd 0xc066(%rip), %xmm1     # 0x12df0
divsd %xmm1, %xmm0
movsd 0x28(%rax), %xmm1
callq 0x7070
movsd %xmm0, -0x78(%rbp)
movb $0x1, -0x79(%rbp)
jmp 0x6da7
movb $0x0, -0x79(%rbp)
jmp 0x63d2
movl -0x20(%rbp), %esi
leaq 0xc136(%rip), %rdi      # 0x12eec
movb $0x0, %al
callq 0x7120
movq -0x108(%rbp), %rcx
movl -0x20(%rbp), %eax
cmpl 0x24(%rcx), %eax
jl 0x6dda
leaq 0xc13d(%rip), %rdi      # 0x12f10
movb $0x0, %al
callq 0x7120
xorps %xmm0, %xmm0
movsd %xmm0, -0xf8(%rbp)
movl $0x0, -0xfc(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x108(%rbp), %rdx
movl -0x14(%rbp), %eax
movl 0x18(%rdx), %ecx
imull 0x20(%rdx), %ecx
cmpl %ecx, %eax
jge 0x6e48
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0xf8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xf8(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6df6
movsd 0xb1c8(%rip), %xmm0     # 0x12018
mulsd -0xf8(%rbp), %xmm0
movsd %xmm0, -0xf8(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x108(%rbp), %rdx
movl -0x14(%rbp), %eax
movl 0x1c(%rdx), %ecx
imull 0x20(%rdx), %ecx
cmpl %ecx, %eax
jge 0x6ed6
movq -0x28(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0xf8(%rbp), %xmm0
movsd %xmm0, -0xf8(%rbp)
movq -0x28(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movaps 0xbdf3(%rip), %xmm1     # 0x12ca0
pand %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x6ec9
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x6ecb
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6e67
movl $0x0, -0x14(%rbp)
movq -0x108(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x1c(%rcx), %eax
jge 0x6f38
movq -0x108(%rbp), %rdx
movq -0x28(%rbp), %rax
movl -0x14(%rbp), %ecx
imull 0x20(%rdx), %ecx
movq 0x30(%rdx), %rdx
movq 0x8(%rdx), %rdx
movslq -0x14(%rbp), %rsi
cvttsd2si (%rdx,%rsi,8), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0xf8(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0xf8(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6edd
movsd -0xf8(%rbp), %xmm0
leaq 0xbff6(%rip), %rdi      # 0x12f3d
movb $0x1, %al
callq 0x7120
movl -0xfc(%rbp), %esi
leaq 0xbff9(%rip), %rdi      # 0x12f54
movb $0x0, %al
callq 0x7120
movq -0x28(%rbp), %rax
movq %rax, -0x118(%rbp)
cmpq $0x0, %rax
je 0x6f7f
movq -0x118(%rbp), %rdi
callq 0x21b0
movq -0x30(%rbp), %rax
movq %rax, -0x120(%rbp)
cmpq $0x0, %rax
je 0x6f9c
movq -0x120(%rbp), %rdi
callq 0x21b0
movq -0x38(%rbp), %rax
movq %rax, -0x128(%rbp)
cmpq $0x0, %rax
je 0x6fb9
movq -0x128(%rbp), %rdi
callq 0x21b0
movq -0x40(%rbp), %rax
movq %rax, -0x130(%rbp)
cmpq $0x0, %rax
je 0x6fd6
movq -0x130(%rbp), %rdi
callq 0x21b0
movq -0x48(%rbp), %rax
movq %rax, -0x138(%rbp)
cmpq $0x0, %rax
je 0x6ff3
movq -0x138(%rbp), %rdi
callq 0x21b0
movq -0x50(%rbp), %rax
movq %rax, -0x140(%rbp)
cmpq $0x0, %rax
je 0x7010
movq -0x140(%rbp), %rdi
callq 0x21b0
movq -0x58(%rbp), %rax
movq %rax, -0x148(%rbp)
cmpq $0x0, %rax
je 0x702d
movq -0x148(%rbp), %rdi
callq 0x21b0
movq -0x60(%rbp), %rax
movq %rax, -0x150(%rbp)
cmpq $0x0, %rax
je 0x704a
movq -0x150(%rbp), %rdi
callq 0x21b0
movq -0x70(%rbp), %rax
movq %rax, -0x158(%rbp)
cmpq $0x0, %rax
je 0x7067
movq -0x158(%rbp), %rdi
callq 0x21b0
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq