// File: qmmlib[P]QmmLibrary/linear.cpp
// Function: solve_l2r_l1l2_svc(problem const*, double*, double, double, double, int)
static void solve_l2r_l1l2_svc(
	const problem *prob, double *w, double eps, 
	double Cp, double Cn, int solver_type)
{
	int l = prob->l;
	int w_size = prob->n;
	int i, s, iter = 0;
	double C, d, G;
	double *QD = new double[l];
	int max_iter = 1000;
	int *index = new int[l];
	double *alpha = new double[l];
	schar *y = new schar[l];
	int active_size = l;

	// PG: projected gradient, for shrinking and stopping
	double PG;
	double PGmax_old = INF;
	double PGmin_old = -INF;
	double PGmax_new, PGmin_new;

	// default solver_type: L2R_L2LOSS_SVC_DUAL
	double diag[3] = {0.5/Cn, 0, 0.5/Cp};
	double upper_bound[3] = {INF, 0, INF};
	if(solver_type == L2R_L1LOSS_SVC_DUAL)
	{
		diag[0] = 0;
		diag[2] = 0;
		upper_bound[0] = Cn;
		upper_bound[2] = 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)]
	for(i=0; i<l; i++)
		alpha[i] = 0;
	
	for(i=0; i<w_size; i++)
		w[i] = 0;
	for(i=0; i<l; i++)
	{
		QD[i] = diag[GETI(i)];

		feature_node *xi = prob->x[i];
		while (xi->index != -1)
		{
			double val = xi->value;
			QD[i] += val*val;
			w[xi->index-1] += y[i]*alpha[i]*val;
			xi++;
		}
		index[i] = i;
	}

	while (iter < max_iter)
	{
		PGmax_new = -INF;
		PGmin_new = 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];
			G = 0;
			schar yi = y[i];

			feature_node *xi = prob->x[i];
			while(xi->index!= -1)
			{
				G += w[xi->index-1]*(xi->value);
				xi++;
			}
			G = G*yi-1;

			C = upper_bound[GETI(i)];
			G += alpha[i]*diag[GETI(i)];

			PG = 0;
			if (alpha[i] == 0)
			{
				if (G > PGmax_old)
				{
					active_size--;
					swap(index[s], index[active_size]);
					s--;
					continue;
				}
				else if (G < 0)
					PG = G;
			}
			else if (alpha[i] == C)
			{
				if (G < PGmin_old)
				{
					active_size--;
					swap(index[s], index[active_size]);
					s--;
					continue;
				}
				else if (G > 0)
					PG = G;
			}
			else
				PG = G;

			PGmax_new = max(PGmax_new, PG);
			PGmin_new = min(PGmin_new, PG);

			if(fabs(PG) > 1.0e-12)
			{
				double alpha_old = alpha[i];
				alpha[i] = min(max(alpha[i] - G/QD[i], 0.0), C);
				d = (alpha[i] - alpha_old)*yi;
				xi = prob->x[i];
				while (xi->index != -1)
				{
					w[xi->index-1] += d*xi->value;
					xi++;
				}
			}
		}

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

		if(PGmax_new - PGmin_new <= eps)
		{
			if(active_size == l)
				break;
			else
			{
				active_size = l;
				info("*");
				PGmax_old = INF;
				PGmin_old = -INF;
				continue;
			}
		}
		PGmax_old = PGmax_new;
		PGmin_old = PGmin_new;
		if (PGmax_old <= 0)
			PGmax_old = INF;
		if (PGmin_old >= 0)
			PGmin_old = -INF;
	}

	info("\noptimization finished, #iter = %d\n",iter);
	if (iter >= max_iter)
		info("\nWARNING: reaching max number of iterations\nUsing -s 2 may be faster (also see FAQ)\n\n");

	// calculate objective value

	double v = 0;
	int nSV = 0;
	for(i=0; i<w_size; i++)
		v += w[i]*w[i];
	for(i=0; i<l; i++)
	{
		v += alpha[i]*(alpha[i]*diag[GETI(i)] - 2);
		if(alpha[i] > 0)
			++nSV;
	}
	info("Objective value = %lf\n",v/2);
	info("nSV = %d\n",nSV);

	delete [] QD;
	delete [] alpha;
	delete [] y;
	delete [] index;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x20(%rbp)
movsd %xmm2, -0x28(%rbp)
movl %edx, -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)
movl $0x0, -0x40(%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 0x3030
movq %rax, -0x60(%rbp)
movl $0x3e8, -0x64(%rbp)     # imm = 0x3E8
movslq -0x30(%rbp), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x3030
movq %rax, -0x70(%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 0x3030
movq %rax, -0x78(%rbp)
movslq -0x30(%rbp), %rdi
callq 0x3030
movq %rax, -0x80(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x84(%rbp)
movsd 0x14901(%rip), %xmm0    # 0x24040
movsd %xmm0, -0x98(%rbp)
movsd 0x15b49(%rip), %xmm0    # 0x25298
movsd %xmm0, -0xa0(%rbp)
movsd 0x148c1(%rip), %xmm0    # 0x24020
divsd -0x28(%rbp), %xmm0
movsd %xmm0, -0xd0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xc8(%rbp)
movsd 0x148a1(%rip), %xmm0    # 0x24020
divsd -0x20(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movq 0x15c4d(%rip), %rax     # 0x253e0
movq %rax, -0xf0(%rbp)
movq 0x15c47(%rip), %rax     # 0x253e8
movq %rax, -0xe8(%rbp)
movq 0x15c41(%rip), %rax     # 0x253f0
movq %rax, -0xe0(%rbp)
cmpl $0x3, -0x2c(%rbp)
jne 0xf7ec
xorps %xmm0, %xmm0
movsd %xmm0, -0xd0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0xf0(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0xe0(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0xf83c
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xf823
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0xf82f
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movb $-0x1, (%rax,%rcx)
jmp 0xf831
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xf7f3
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0xf866
movq -0x78(%rbp), %rax
movslq -0x38(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xf843
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xf890
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xf86d
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0xf9ac
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0xd0(%rbp,%rax,8), %xmm0
movq -0x60(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
cmpl $-0x1, (%rax)
je 0xf990
movq -0xf8(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x100(%rbp)
movsd -0x100(%rbp), %xmm0
movsd -0x100(%rbp), %xmm2
movq -0x60(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
movq -0x78(%rbp), %rax
movslq -0x38(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd -0x100(%rbp), %xmm2
movq -0x10(%rbp), %rax
movq -0xf8(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0xf8(%rbp), %rax
addq $0x10, %rax
movq %rax, -0xf8(%rbp)
jmp 0xf8e1
movl -0x38(%rbp), %edx
movq -0x70(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xf897
jmp 0xf9ae
movl -0x40(%rbp), %eax
cmpl -0x64(%rbp), %eax
jge 0xfee8
movsd 0x158d6(%rip), %xmm0    # 0x25298
movsd %xmm0, -0xa8(%rbp)
movsd 0x1466e(%rip), %xmm0    # 0x24040
movsd %xmm0, -0xb0(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x84(%rbp), %eax
jge 0xfa45
movl -0x38(%rbp), %eax
movl %eax, -0x128(%rbp)
callq 0x30b0
movl -0x84(%rbp), %ecx
subl -0x38(%rbp), %ecx
cltd
idivl %ecx
movl -0x128(%rbp), %eax
addl %edx, %eax
movl %eax, -0x104(%rbp)
movq -0x70(%rbp), %rdi
movslq -0x38(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x70(%rbp), %rsi
movslq -0x104(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x9420
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xf9e1
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jge 0xfdf7
movq -0x70(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x105(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rax
cmpl $-0x1, (%rax)
je 0xfaef
movq -0x10(%rbp), %rax
movq -0x110(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x110(%rbp), %rax
movsd 0x8(%rax), %xmm2
movsd -0x58(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x110(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x110(%rbp)
jmp 0xfa99
movsd -0x58(%rbp), %xmm0
movsbl -0x105(%rbp), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
movsd 0x14525(%rip), %xmm1    # 0x24030
addsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0xf0(%rbp,%rax,8), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x78(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0xd0(%rbp,%rax,8), %xmm2
movsd -0x58(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x90(%rbp)
movq -0x78(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xfbff
jp 0xfbff
movsd -0x58(%rbp), %xmm0
ucomisd -0x98(%rbp), %xmm0
jbe 0xfbe1
movl -0x84(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x84(%rbp)
movq -0x70(%rbp), %rdi
movslq -0x3c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x70(%rbp), %rsi
movslq -0x84(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x9420
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xfde9
xorps %xmm0, %xmm0
ucomisd -0x58(%rbp), %xmm0
jbe 0xfbf8
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
jmp 0xfbfa
jmp 0xfc99
movq -0x78(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd -0x48(%rbp), %xmm0
jne 0xfc8a
jp 0xfc8a
movsd -0x58(%rbp), %xmm1
movsd -0xa0(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xfc6b
movl -0x84(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x84(%rbp)
movq -0x70(%rbp), %rdi
movslq -0x3c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x70(%rbp), %rsi
movslq -0x84(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x9420
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xfde9
movsd -0x58(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xfc86
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
jmp 0xfc88
jmp 0xfc97
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
jmp 0xfc99
movsd -0xa8(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
callq 0x93e0
movsd %xmm0, -0xa8(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
callq 0x82a0
movsd %xmm0, -0xb0(%rbp)
movsd -0x90(%rbp), %xmm0
movaps 0x1543e(%rip), %xmm1    # 0x25120
pand %xmm1, %xmm0
movsd 0x15422(%rip), %xmm1    # 0x25110
ucomisd %xmm1, %xmm0
jbe 0xfde7
movq -0x78(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x118(%rbp)
movq -0x78(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd -0x58(%rbp), %xmm1
movq -0x60(%rbp), %rax
movslq -0x38(%rbp), %rcx
divsd (%rax,%rcx,8), %xmm1
subsd %xmm1, %xmm0
xorps %xmm1, %xmm1
callq 0x93e0
movsd -0x48(%rbp), %xmm1
callq 0x82a0
movq -0x78(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x78(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
subsd -0x118(%rbp), %xmm0
movsbl -0x105(%rbp), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rax
cmpl $-0x1, (%rax)
je 0xfde5
movsd -0x50(%rbp), %xmm0
movq -0x110(%rbp), %rax
movsd 0x8(%rax), %xmm2
movq -0x10(%rbp), %rax
movq -0x110(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x110(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x110(%rbp)
jmp 0xfd8f
jmp 0xfde7
jmp 0xfde9
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xfa4c
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0xfe1e
leaq 0x1595c(%rip), %rdi     # 0x25773
movb $0x0, %al
callq 0x9490
movsd -0xa8(%rbp), %xmm1
subsd -0xb0(%rbp), %xmm1
movsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xfe85
movl -0x84(%rbp), %eax
cmpl -0x30(%rbp), %eax
jne 0xfe49
jmp 0xfee8
movl -0x30(%rbp), %eax
movl %eax, -0x84(%rbp)
leaq 0x1559f(%rip), %rdi     # 0x253f8
movb $0x0, %al
callq 0x9490
movsd 0x141d8(%rip), %xmm0    # 0x24040
movsd %xmm0, -0x98(%rbp)
movsd 0x15420(%rip), %xmm0    # 0x25298
movsd %xmm0, -0xa0(%rbp)
jmp 0xf9ae
movsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x98(%rbp), %xmm0
jb 0xfec2
movsd 0x14186(%rip), %xmm0    # 0x24040
movsd %xmm0, -0x98(%rbp)
movsd -0xa0(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xfee3
movsd 0x153bd(%rip), %xmm0    # 0x25298
movsd %xmm0, -0xa0(%rbp)
jmp 0xf9ae
movl -0x40(%rbp), %esi
leaq 0x15508(%rip), %rdi     # 0x253fa
movb $0x0, %al
callq 0x9490
movl -0x40(%rbp), %eax
cmpl -0x64(%rbp), %eax
jl 0xff0f
leaq 0x156f3(%rip), %rdi     # 0x255fb
movb $0x0, %al
callq 0x9490
xorps %xmm0, %xmm0
movsd %xmm0, -0x120(%rbp)
movl $0x0, -0x124(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xff70
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x120(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x120(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xff2b
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x10014
movq -0x78(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x78(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq -0x80(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0xd0(%rbp,%rax,8), %xmm1
mulsd %xmm1, %xmm2
movsd 0x152e5(%rip), %xmm1    # 0x252a8
addsd %xmm1, %xmm2
movsd -0x120(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x120(%rbp)
movq -0x78(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10004
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x10006
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xff77
movsd -0x120(%rbp), %xmm0
movsd 0x15264(%rip), %xmm1    # 0x25288
divsd %xmm1, %xmm0
leaq 0x1541c(%rip), %rdi     # 0x2544b
movb $0x1, %al
callq 0x9490
movl -0x124(%rbp), %esi
leaq 0x1541f(%rip), %rdi     # 0x25462
movb $0x0, %al
callq 0x9490
movq -0x60(%rbp), %rax
movq %rax, -0x130(%rbp)
cmpq $0x0, %rax
je 0x10067
movq -0x130(%rbp), %rdi
callq 0x33b0
movq -0x78(%rbp), %rax
movq %rax, -0x138(%rbp)
cmpq $0x0, %rax
je 0x10084
movq -0x138(%rbp), %rdi
callq 0x33b0
movq -0x80(%rbp), %rax
movq %rax, -0x140(%rbp)
cmpq $0x0, %rax
je 0x100a1
movq -0x140(%rbp), %rdi
callq 0x33b0
movq -0x70(%rbp), %rax
movq %rax, -0x148(%rbp)
cmpq $0x0, %rax
je 0x100be
movq -0x148(%rbp), %rdi
callq 0x33b0
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw (%rax,%rax)