// File: cjlin1[P]liblinear/linear.cpp
// Function: solve_l2r_lr_dual(problem const*, parameter const*, double*, double, double, int)
static int solve_l2r_lr_dual(const problem *prob, const parameter *param, double *w, double Cp, double Cn, int max_iter=300)
{
	int l = prob->l;
	int w_size = prob->n;
	double eps = param->eps;
	int i, s, iter = 0;
	double *xTx = new double[l];
	int *index = new int[l];
	double *alpha = new double[2*l]; // store alpha and C - alpha
	schar *y = new schar[l];
	int max_inner_iter = 100; // for inner Newton
	double innereps = 1e-2;
	double innereps_min = min(1e-8, eps);
	double upper_bound[3] = {Cn, 0, Cp};

	for(i=0; i<l; i++)
	{
		if(prob->y[i] > 0)
		{
			y[i] = +1;
		}
		else
		{
			y[i] = -1;
		}
	}

	// Initial alpha can be set here. Note that
	// 0 < alpha[i] < upper_bound[GETI(i)]
	// alpha[2*i] + alpha[2*i+1] = upper_bound[GETI(i)]
	for(i=0; i<l; i++)
	{
		alpha[2*i] = min(0.001*upper_bound[GETI(i)], 1e-8);
		alpha[2*i+1] = upper_bound[GETI(i)] - alpha[2*i];
	}

	for(i=0; i<w_size; i++)
		w[i] = 0;
	for(i=0; i<l; i++)
	{
		feature_node * const xi = prob->x[i];
		xTx[i] = sparse_operator::nrm2_sq(xi);
		sparse_operator::axpy(y[i]*alpha[2*i], xi, w);
		index[i] = i;
	}

	while (iter < max_iter)
	{
		for (i=0; i<l; i++)
		{
			int j = i+rand()%(l-i);
			swap(index[i], index[j]);
		}
		int newton_iter = 0;
		double Gmax = 0;
		for (s=0; s<l; s++)
		{
			i = index[s];
			const schar yi = y[i];
			double C = upper_bound[GETI(i)];
			double ywTx = 0, xisq = xTx[i];
			feature_node * const xi = prob->x[i];
			ywTx = yi*sparse_operator::dot(w, xi);
			double a = xisq, b = ywTx;

			// Decide to minimize g_1(z) or g_2(z)
			int ind1 = 2*i, ind2 = 2*i+1, sign = 1;
			if(0.5*a*(alpha[ind2]-alpha[ind1])+b < 0)
			{
				ind1 = 2*i+1;
				ind2 = 2*i;
				sign = -1;
			}

			//  g_t(z) = z*log(z) + (C-z)*log(C-z) + 0.5a(z-alpha_old)^2 + sign*b(z-alpha_old)
			double alpha_old = alpha[ind1];
			double z = alpha_old;
			if(C - z < 0.5 * C)
				z = 0.1*z;
			double gp = a*(z-alpha_old)+sign*b+log(z/(C-z));
			Gmax = max(Gmax, fabs(gp));

			// Newton method on the sub-problem
			const double eta = 0.1; // xi in the paper
			int inner_iter = 0;
			while (inner_iter <= max_inner_iter)
			{
				if(fabs(gp) < innereps)
					break;
				double gpp = a + C/(C-z)/z;
				double tmpz = z - gp/gpp;
				if(tmpz <= 0)
					z *= eta;
				else // tmpz in (0, C)
					z = tmpz;
				gp = a*(z-alpha_old)+sign*b+log(z/(C-z));
				newton_iter++;
				inner_iter++;
			}

			if(inner_iter > 0) // update w
			{
				alpha[ind1] = z;
				alpha[ind2] = C-z;
				sparse_operator::axpy(sign*(z-alpha_old)*yi, xi, w);
			}
		}

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

		if(Gmax < eps)
			break;

		if(newton_iter <= l/10)
			innereps = max(innereps_min, 0.1*innereps);

	}

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

	// calculate objective value

	double v = 0;
	for(i=0; i<w_size; i++)
		v += w[i] * w[i];
	v *= 0.5;
	for(i=0; i<l; i++)
		v += alpha[2*i] * log(alpha[2*i]) + alpha[2*i+1] * log(alpha[2*i+1])
			- upper_bound[GETI(i)] * log(upper_bound[GETI(i)]);
	info("Objective value = %lf\n", v);

	delete [] xTx;
	delete [] alpha;
	delete [] y;
	delete [] index;

	return iter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movsd %xmm0, -0x20(%rbp)
movsd %xmm1, -0x28(%rbp)
movl %ecx, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movl $0x0, -0x4c(%rbp)
movslq -0x30(%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, -0x58(%rbp)
movslq -0x30(%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)
movl -0x30(%rbp), %eax
shll %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, -0x68(%rbp)
movslq -0x30(%rbp), %rdi
callq 0x2030
movq %rax, -0x70(%rbp)
movl $0x64, -0x74(%rbp)
movsd 0x225a(%rip), %xmm0     # 0x12030
movsd %xmm0, -0x80(%rbp)
movsd -0x40(%rbp), %xmm1
movsd 0x3060(%rip), %xmm0     # 0x12e48
callq 0x5f30
movsd %xmm0, -0x88(%rbp)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0xfe6a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x44(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xfe51
movq -0x70(%rbp), %rax
movslq -0x44(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0xfe5d
movq -0x70(%rbp), %rax
movslq -0x44(%rbp), %rcx
movb $-0x1, (%rax,%rcx)
jmp 0xfe5f
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xfe21
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0xff0a
movq -0x70(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd 0x2f72(%rip), %xmm0     # 0x12e08
mulsd -0xa0(%rbp,%rax,8), %xmm0
movsd 0x2fa1(%rip), %xmm1     # 0x12e48
callq 0x5f30
movq -0x68(%rbp), %rax
movl -0x44(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x70(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0xa0(%rbp,%rax,8), %xmm0
movq -0x68(%rbp), %rax
movl -0x44(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm0
movq -0x68(%rbp), %rax
movl -0x44(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xfe71
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xff34
movq -0x18(%rbp), %rax
movslq -0x44(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xff11
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0xffc0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
callq 0x11640
movq -0x58(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x70(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
movq -0x68(%rbp), %rax
movl -0x44(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
mulsd (%rax,%rcx,8), %xmm0
movq -0xa8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11590
movl -0x44(%rbp), %edx
movq -0x60(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xff3b
jmp 0xffc2
movl -0x4c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x1053b
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x10033
movl -0x44(%rbp), %eax
movl %eax, -0x144(%rbp)
callq 0x2090
movl -0x30(%rbp), %ecx
subl -0x44(%rbp), %ecx
cltd
idivl %ecx
movl -0x144(%rbp), %eax
addl %edx, %eax
movl %eax, -0xac(%rbp)
movq -0x60(%rbp), %rdi
movslq -0x44(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x60(%rbp), %rsi
movslq -0xac(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x70b0
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xffd5
movl $0x0, -0xb0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xb8(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x104b8
movq -0x60(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movq -0x70(%rbp), %rax
movslq -0x44(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0xb9(%rbp)
movq -0x70(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0xa0(%rbp,%rax,8), %xmm0
movsd %xmm0, -0xc8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xd0(%rbp)
movq -0x58(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xd8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xe0(%rbp)
movsbl -0xb9(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x150(%rbp)
movq -0x18(%rbp), %rdi
movq -0xe0(%rbp), %rsi
callq 0x11520
movaps %xmm0, %xmm1
movsd -0x150(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0xd0(%rbp)
movsd -0xd8(%rbp), %xmm0
movsd %xmm0, -0xe8(%rbp)
movsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0xf0(%rbp)
movl -0x44(%rbp), %eax
shll %eax
movl %eax, -0xf4(%rbp)
movl -0x44(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, -0xf8(%rbp)
movl $0x1, -0xfc(%rbp)
movsd 0x1ec0(%rip), %xmm1     # 0x12018
mulsd -0xe8(%rbp), %xmm1
movq -0x68(%rbp), %rax
movslq -0xf8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq -0x68(%rbp), %rax
movslq -0xf4(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm2
movsd -0xf0(%rbp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x101bc
movl -0x44(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
movl -0x44(%rbp), %eax
shll %eax
movl %eax, -0xf8(%rbp)
movl $0xffffffff, -0xfc(%rbp) # imm = 0xFFFFFFFF
movq -0x68(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x108(%rbp)
movsd -0x108(%rbp), %xmm0
movsd %xmm0, -0x110(%rbp)
movsd -0xc8(%rbp), %xmm1
subsd -0x110(%rbp), %xmm1
movsd 0x1e1c(%rip), %xmm0     # 0x12018
mulsd -0xc8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x10222
movsd 0x1e0e(%rip), %xmm0     # 0x12020
mulsd -0x110(%rbp), %xmm0
movsd %xmm0, -0x110(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd -0x110(%rbp), %xmm2
subsd -0x108(%rbp), %xmm2
cvtsi2sdl -0xfc(%rbp), %xmm1
mulsd -0xf0(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x158(%rbp)
movsd -0x110(%rbp), %xmm0
movsd -0xc8(%rbp), %xmm1
subsd -0x110(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x20e0
movaps %xmm0, %xmm1
movsd -0x158(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x118(%rbp)
movsd -0xb8(%rbp), %xmm0
movsd -0x118(%rbp), %xmm1
movaps 0x29f7(%rip), %xmm2     # 0x12ca0
pand %xmm2, %xmm1
callq 0x7070
movsd %xmm0, -0xb8(%rbp)
movsd 0x1d5e(%rip), %xmm0     # 0x12020
movsd %xmm0, -0x120(%rbp)
movl $0x0, -0x124(%rbp)
movl -0x124(%rbp), %eax
cmpl -0x74(%rbp), %eax
jg 0x1042c
movsd -0x118(%rbp), %xmm1
movaps 0x29ae(%rip), %xmm0     # 0x12ca0
pand %xmm0, %xmm1
movsd -0x80(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x10306
jmp 0x1042c
movsd -0xe8(%rbp), %xmm0
movsd -0xc8(%rbp), %xmm1
movsd -0xc8(%rbp), %xmm2
subsd -0x110(%rbp), %xmm2
divsd %xmm2, %xmm1
divsd -0x110(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x130(%rbp)
movsd -0x110(%rbp), %xmm0
movsd -0x118(%rbp), %xmm1
divsd -0x130(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x138(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x138(%rbp), %xmm0
jb 0x10389
movsd 0x1ca9(%rip), %xmm0     # 0x12020
mulsd -0x110(%rbp), %xmm0
movsd %xmm0, -0x110(%rbp)
jmp 0x10399
movsd -0x138(%rbp), %xmm0
movsd %xmm0, -0x110(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd -0x110(%rbp), %xmm2
subsd -0x108(%rbp), %xmm2
cvtsi2sdl -0xfc(%rbp), %xmm1
mulsd -0xf0(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x160(%rbp)
movsd -0x110(%rbp), %xmm0
movsd -0xc8(%rbp), %xmm1
subsd -0x110(%rbp), %xmm1
divsd %xmm1, %xmm0
callq 0x20e0
movaps %xmm0, %xmm1
movsd -0x160(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x118(%rbp)
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb0(%rbp)
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x102d4
cmpl $0x0, -0x124(%rbp)
jle 0x104a8
movsd -0x110(%rbp), %xmm0
movq -0x68(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0xc8(%rbp), %xmm0
subsd -0x110(%rbp), %xmm0
movq -0x68(%rbp), %rax
movslq -0xf8(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
cvtsi2sdl -0xfc(%rbp), %xmm0
movsd -0x110(%rbp), %xmm1
subsd -0x108(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsbl -0xb9(%rbp), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
movq -0xe0(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11590
jmp 0x104aa
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x1004f
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x104df
leaq 0x2a10(%rip), %rdi      # 0x12ee8
movb $0x0, %al
callq 0x7120
movsd -0xb8(%rbp), %xmm1
movsd -0x40(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x104f4
jmp 0x1053b
movl -0xb0(%rbp), %eax
movl %eax, -0x164(%rbp)
movl -0x30(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x164(%rbp), %eax
cmpl %ecx, %eax
jg 0x10536
movsd -0x88(%rbp), %xmm0
movsd 0x1af9(%rip), %xmm1     # 0x12020
mulsd -0x80(%rbp), %xmm1
callq 0x7070
movsd %xmm0, -0x80(%rbp)
jmp 0xffc2
movl -0x4c(%rbp), %esi
leaq 0x29a7(%rip), %rdi      # 0x12eec
movb $0x0, %al
callq 0x7120
xorps %xmm0, %xmm0
movsd %xmm0, -0x140(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x105a3
movq -0x18(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x140(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x140(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x1055e
movsd 0x1a6d(%rip), %xmm0     # 0x12018
mulsd -0x140(%rbp), %xmm0
movsd %xmm0, -0x140(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x106fa
movq -0x68(%rbp), %rax
movl -0x44(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x180(%rbp)
movq -0x68(%rbp), %rax
movl -0x44(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x20e0
movsd %xmm0, -0x188(%rbp)
movq -0x68(%rbp), %rax
movl -0x44(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x190(%rbp)
movq -0x68(%rbp), %rax
movl -0x44(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x20e0
movsd -0x190(%rbp), %xmm1
movsd -0x188(%rbp), %xmm2
movaps %xmm0, %xmm3
movsd -0x180(%rbp), %xmm0
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x178(%rbp)
movq -0x70(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0xa0(%rbp,%rax,8), %xmm0
movsd %xmm0, -0x170(%rbp)
movq -0x70(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0xa0(%rbp,%rax,8), %xmm0
callq 0x20e0
movsd -0x178(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x170(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd -0x140(%rbp), %xmm0
movsd %xmm0, -0x140(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x105c2
movsd -0x140(%rbp), %xmm0
leaq 0x2834(%rip), %rdi      # 0x12f3d
movb $0x1, %al
callq 0x7120
movq -0x58(%rbp), %rax
movq %rax, -0x198(%rbp)
cmpq $0x0, %rax
je 0x1072d
movq -0x198(%rbp), %rdi
callq 0x21b0
movq -0x68(%rbp), %rax
movq %rax, -0x1a0(%rbp)
cmpq $0x0, %rax
je 0x1074a
movq -0x1a0(%rbp), %rdi
callq 0x21b0
movq -0x70(%rbp), %rax
movq %rax, -0x1a8(%rbp)
cmpq $0x0, %rax
je 0x10767
movq -0x1a8(%rbp), %rdi
callq 0x21b0
movq -0x60(%rbp), %rax
movq %rax, -0x1b0(%rbp)
cmpq $0x0, %rax
je 0x10784
movq -0x1b0(%rbp), %rdi
callq 0x21b0
movl -0x4c(%rbp), %eax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq