// File: cjlin1[P]liblinear/linear.cpp
// Function: solve_l2r_l1l2_svr(problem const*, parameter const*, double*, int)
static int solve_l2r_l1l2_svr(const problem *prob, const parameter *param, double *w, int max_iter=300)
{
	const int solver_type = param->solver_type;
	int l = prob->l;
	double C = param->C;
	double p = param->p;
	int w_size = prob->n;
	double eps = param->eps;
	int i, s, iter = 0;
	int active_size = l;
	int *index = new int[l];

	double d, G, H;
	double Gmax_old = INF;
	double Gmax_new, Gnorm1_new;
	double Gnorm1_init = -1.0; // Gnorm1_init is initialized at the first iteration
	double *beta = new double[l];
	double *QD = new double[l];
	double *y = prob->y;

	// L2R_L2LOSS_SVR_DUAL
	double lambda[1], upper_bound[1];
	lambda[0] = 0.5/C;
	upper_bound[0] = INF;

	if(solver_type == L2R_L1LOSS_SVR_DUAL)
	{
		lambda[0] = 0;
		upper_bound[0] = C;
	}

	// Initial beta can be set here. Note that
	// -upper_bound <= beta[i] <= upper_bound
	for(i=0; i<l; i++)
		beta[i] = 0;

	for(i=0; i<w_size; i++)
		w[i] = 0;
	for(i=0; i<l; i++)
	{
		feature_node * const xi = prob->x[i];
		QD[i] = sparse_operator::nrm2_sq(xi);
		sparse_operator::axpy(beta[i], xi, w);

		index[i] = i;
	}


	while(iter < max_iter)
	{
		Gmax_new = 0;
		Gnorm1_new = 0;

		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];
			G = -y[i] + lambda[GETI(i)]*beta[i];
			H = QD[i] + lambda[GETI(i)];

			feature_node * const xi = prob->x[i];
			G += sparse_operator::dot(w, xi);

			double Gp = G+p;
			double Gn = G-p;
			double violation = 0;
			if(beta[i] == 0)
			{
				if(Gp < 0)
					violation = -Gp;
				else if(Gn > 0)
					violation = Gn;
				else if(Gp>Gmax_old && Gn<-Gmax_old)
				{
					active_size--;
					swap(index[s], index[active_size]);
					s--;
					continue;
				}
			}
			else if(beta[i] >= upper_bound[GETI(i)])
			{
				if(Gp > 0)
					violation = Gp;
				else if(Gp < -Gmax_old)
				{
					active_size--;
					swap(index[s], index[active_size]);
					s--;
					continue;
				}
			}
			else if(beta[i] <= -upper_bound[GETI(i)])
			{
				if(Gn < 0)
					violation = -Gn;
				else if(Gn > Gmax_old)
				{
					active_size--;
					swap(index[s], index[active_size]);
					s--;
					continue;
				}
			}
			else if(beta[i] > 0)
				violation = fabs(Gp);
			else
				violation = fabs(Gn);

			Gmax_new = max(Gmax_new, violation);
			Gnorm1_new += violation;

			// obtain Newton direction d
			if(Gp < H*beta[i])
				d = -Gp/H;
			else if(Gn > H*beta[i])
				d = -Gn/H;
			else
				d = -beta[i];

			if(fabs(d) < 1.0e-12)
				continue;

			double beta_old = beta[i];
			beta[i] = min(max(beta[i]+d, -upper_bound[GETI(i)]), upper_bound[GETI(i)]);
			d = beta[i]-beta_old;

			if(d != 0)
				sparse_operator::axpy(d, xi, w);
		}

		if(iter == 0)
			Gnorm1_init = Gnorm1_new;
		iter++;
		if(iter % 10 == 0)
			info(".");

		if(Gnorm1_new <= eps*Gnorm1_init)
		{
			if(active_size == l)
				break;
			else
			{
				active_size = l;
				info("*");
				Gmax_old = INF;
				continue;
			}
		}

		Gmax_old = Gmax_new;
	}

	info("\noptimization finished, #iter = %d\n", iter);

	// calculate objective value
	double v = 0;
	int nSV = 0;
	for(i=0; i<w_size; i++)
		v += w[i]*w[i];
	v = 0.5*v;
	for(i=0; i<l; i++)
	{
		v += p*fabs(beta[i]) - y[i]*beta[i] + 0.5*lambda[GETI(i)]*beta[i]*beta[i];
		if(beta[i] != 0)
			nSV++;
	}

	info("Objective value = %lf\n", v);
	info("nSV = %d\n",nSV);

	delete [] beta;
	delete [] QD;
	delete [] index;

	return iter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x58(%rbp)
movslq -0x24(%rbp), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, -0x60(%rbp)
movsd 0x17e2(%rip), %xmm0     # 0x12010
movsd %xmm0, -0x80(%rbp)
movsd 0x17cd(%rip), %xmm0     # 0x12008
movsd %xmm0, -0x98(%rbp)
movslq -0x24(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, -0xa0(%rbp)
movslq -0x24(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, -0xa8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xb0(%rbp)
movsd 0x1766(%rip), %xmm0     # 0x12018
divsd -0x30(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd 0x1749(%rip), %xmm0     # 0x12010
movsd %xmm0, -0xc0(%rbp)
cmpl $0xd, -0x20(%rbp)
jne 0x108ed
xorps %xmm0, %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1091a
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x108f4
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x10944
movq -0x18(%rbp), %rax
movslq -0x4c(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x10921
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x109bf
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x11640
movq -0xa8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0xc8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11590
movl -0x4c(%rbp), %edx
movq -0x60(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1094b
jmp 0x109c1
movl -0x54(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x1106a
xorps %xmm0, %xmm0
movsd %xmm0, -0x88(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x90(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x10a48
movl -0x4c(%rbp), %eax
movl %eax, -0x108(%rbp)
callq 0x2090
movl -0x58(%rbp), %ecx
subl -0x4c(%rbp), %ecx
cltd
idivl %ecx
movl -0x108(%rbp), %eax
addl %edx, %eax
movl %eax, -0xcc(%rbp)
movq -0x60(%rbp), %rdi
movslq -0x4c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x60(%rbp), %rsi
movslq -0xcc(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x70b0
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x109ea
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x10fd0
movq -0x60(%rbp), %rax
movslq -0x50(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
movq -0xb0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd -0xb8(%rbp), %xmm0
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0xa8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xd8(%rbp)
movq -0x18(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x11520
addsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x70(%rbp), %xmm0
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0x70(%rbp), %xmm0
subsd -0x38(%rbp), %xmm0
movsd %xmm0, -0xe8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xf0(%rbp)
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x10c2d
jp 0x10c2d
xorps %xmm0, %xmm0
ucomisd -0xe0(%rbp), %xmm0
jbe 0x10b8e
movsd -0xe0(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0xf0(%rbp)
jmp 0x10c28
movsd -0xe8(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10bb1
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0xf0(%rbp)
jmp 0x10c26
movsd -0xe0(%rbp), %xmm0
ucomisd -0x80(%rbp), %xmm0
jbe 0x10c24
movsd -0xe8(%rbp), %xmm1
movsd -0x80(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x10c24
movl -0x58(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x58(%rbp)
movq -0x60(%rbp), %rdi
movslq -0x50(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x60(%rbp), %rsi
movslq -0x58(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x70b0
movl -0x50(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x10fc2
jmp 0x10c26
jmp 0x10c28
jmp 0x10dec
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd -0xc0(%rbp), %xmm0
jb 0x10cd9
movsd -0xe0(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10c6e
movsd -0xe0(%rbp), %xmm0
movsd %xmm0, -0xf0(%rbp)
jmp 0x10cd4
movsd -0xe0(%rbp), %xmm1
movsd -0x80(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x10cd2
movl -0x58(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x58(%rbp)
movq -0x60(%rbp), %rdi
movslq -0x50(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x60(%rbp), %rsi
movslq -0x58(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x70b0
movl -0x50(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x10fc2
jmp 0x10cd4
jmp 0x10dea
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0xc0(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
ucomisd %xmm1, %xmm0
jb 0x10d95
xorps %xmm0, %xmm0
ucomisd -0xe8(%rbp), %xmm0
jbe 0x10d48
movsd -0xe8(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0xf0(%rbp)
jmp 0x10d93
movsd -0xe8(%rbp), %xmm0
ucomisd -0x80(%rbp), %xmm0
jbe 0x10d91
movl -0x58(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x58(%rbp)
movq -0x60(%rbp), %rdi
movslq -0x50(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x60(%rbp), %rsi
movslq -0x58(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x70b0
movl -0x50(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x10fc2
jmp 0x10d93
jmp 0x10de8
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10dcb
movsd -0xe0(%rbp), %xmm0
movaps 0x1ee3(%rip), %xmm1     # 0x12ca0
pand %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
jmp 0x10de6
movsd -0xe8(%rbp), %xmm0
movaps 0x1ec6(%rip), %xmm1     # 0x12ca0
pand %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
jmp 0x10de8
jmp 0x10dea
jmp 0x10dec
movsd -0x88(%rbp), %xmm0
movsd -0xf0(%rbp), %xmm1
callq 0x7070
movsd %xmm0, -0x88(%rbp)
movsd -0xf0(%rbp), %xmm0
addsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0xe0(%rbp), %xmm1
movsd -0x78(%rbp), %xmm0
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x10e6f
movsd -0xe0(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
divsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0x10eeb
movsd -0xe8(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10ebd
movsd -0xe8(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
divsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0x10ee9
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0x10eeb
movsd -0x68(%rbp), %xmm1
movaps 0x1da9(%rip), %xmm0     # 0x12ca0
pand %xmm0, %xmm1
movsd 0x1d7d(%rip), %xmm0     # 0x12c80
ucomisd %xmm1, %xmm0
jbe 0x10f0e
jmp 0x10fc2
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xf8(%rbp)
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x68(%rbp), %xmm0
movsd -0xc0(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
callq 0x7070
movsd -0xc0(%rbp), %xmm1
callq 0x5f30
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
subsd -0xf8(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x10fab
jp 0x10fab
jmp 0x10fc0
movsd -0x68(%rbp), %xmm0
movq -0xd8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11590
jmp 0x10fc2
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x10a4f
cmpl $0x0, -0x54(%rbp)
jne 0x10fe6
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x1100d
leaq 0x1ee2(%rip), %rdi      # 0x12ee8
movb $0x0, %al
callq 0x7120
movsd -0x90(%rbp), %xmm1
movsd -0x48(%rbp), %xmm0
mulsd -0x98(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x11058
movl -0x58(%rbp), %eax
cmpl -0x24(%rbp), %eax
jne 0x11032
jmp 0x1106a
movl -0x24(%rbp), %eax
movl %eax, -0x58(%rbp)
leaq 0x1eab(%rip), %rdi      # 0x12eea
movb $0x0, %al
callq 0x7120
movsd 0xfc2(%rip), %xmm0      # 0x12010
movsd %xmm0, -0x80(%rbp)
jmp 0x109c1
movsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
jmp 0x109c1
movl -0x54(%rbp), %esi
leaq 0x1e78(%rip), %rdi      # 0x12eec
movb $0x0, %al
callq 0x7120
xorps %xmm0, %xmm0
movsd %xmm0, -0x100(%rbp)
movl $0x0, -0x104(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x110dc
movq -0x18(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x100(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x100(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x11097
movsd 0xf34(%rip), %xmm0      # 0x12018
mulsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x100(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x111ea
movsd -0x38(%rbp), %xmm1
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movaps 0x1b7d(%rip), %xmm0     # 0x12ca0
pand %xmm0, %xmm2
movq -0xb0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0xeaa(%rip), %xmm0      # 0x12018
mulsd -0xb8(%rbp), %xmm0
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x100(%rbp)
movq -0xa0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x111cb
jp 0x111cb
jmp 0x111da
movl -0x104(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
jmp 0x111dc
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x110fb
movsd -0x100(%rbp), %xmm0
leaq 0x1d44(%rip), %rdi      # 0x12f3d
movb $0x1, %al
callq 0x7120
movl -0x104(%rbp), %esi
leaq 0x1d47(%rip), %rdi      # 0x12f54
movb $0x0, %al
callq 0x7120
movq -0xa0(%rbp), %rax
movq %rax, -0x110(%rbp)
cmpq $0x0, %rax
je 0x11234
movq -0x110(%rbp), %rdi
callq 0x21b0
movq -0xa8(%rbp), %rax
movq %rax, -0x118(%rbp)
cmpq $0x0, %rax
je 0x11254
movq -0x118(%rbp), %rdi
callq 0x21b0
movq -0x60(%rbp), %rax
movq %rax, -0x120(%rbp)
cmpq $0x0, %rax
je 0x11271
movq -0x120(%rbp), %rdi
callq 0x21b0
movl -0x54(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopl (%rax)