// File: cjlin1[P]liblinear/linear.cpp
// Function: solve_l2r_l1l2_svc(problem const*, parameter const*, double*, double, double, int)
static int solve_l2r_l1l2_svc(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 solver_type = param->solver_type;
	int i, s, iter = 0;
	double C, d, G;
	double *QD = new double[l];
	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 * const xi = prob->x[i];
		QD[i] += sparse_operator::nrm2_sq(xi);
		sparse_operator::axpy(y[i]*alpha[i], xi, w);

		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];
			const schar yi = y[i];
			feature_node * const xi = prob->x[i];

			G = yi*sparse_operator::dot(w, xi)-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;
				sparse_operator::axpy(d, xi, w);
			}
		}

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

		if(PGmax_new - PGmin_new <= eps &&
			fabs(PGmax_new) <= eps && fabs(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);

	// 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);

	// Reconstruct w from the primal-dual relationship w=sum(\alpha_i y_i x_i)
	// This may reduce the weight density. Some zero weights become non-zeros
	// due to the numerical update w <- w + (alpha[i] - alpha_old) y_i x_i.
	if (param->w_recalc)
	{
		for(i=0; i<w_size; i++)
			w[i] = 0;
		for(i=0; i<l; i++)
		{
			feature_node * const xi = prob->x[i];
			if(alpha[i] > 0)
				sparse_operator::axpy(y[i]*alpha[i], xi, w);
		}
	}

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

	return iter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
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)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movl $0x0, -0x50(%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, -0x70(%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, -0x78(%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, -0x80(%rbp)
movslq -0x30(%rbp), %rdi
callq 0x2030
movq %rax, -0x88(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x8c(%rbp)
movsd 0x5d4f(%rip), %xmm0     # 0x12010
movsd %xmm0, -0xa0(%rbp)
movsd 0x6b2f(%rip), %xmm0     # 0x12e00
movsd %xmm0, -0xa8(%rbp)
movsd 0x5d37(%rip), %xmm0     # 0x12018
divsd -0x28(%rbp), %xmm0
movsd %xmm0, -0xd0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xc8(%rbp)
movsd 0x5d17(%rip), %xmm0     # 0x12018
divsd -0x20(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movq 0x6bbb(%rip), %rax      # 0x12ed0
movq %rax, -0xf0(%rbp)
movq 0x6bb5(%rip), %rax      # 0x12ed8
movq %rax, -0xe8(%rbp)
movq 0x6baf(%rip), %rax      # 0x12ee0
movq %rax, -0xe0(%rbp)
cmpl $0x3, -0x44(%rbp)
jne 0xc36e
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, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0xc3c4
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xc3a8
movq -0x88(%rbp), %rax
movslq -0x48(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0xc3b7
movq -0x88(%rbp), %rax
movslq -0x48(%rbp), %rcx
movb $-0x1, (%rax,%rcx)
jmp 0xc3b9
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xc375
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0xc3ee
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xc3cb
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xc418
movq -0x18(%rbp), %rax
movslq -0x48(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xc3f5
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0xc4d6
movq -0x88(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0xd0(%rbp,%rax,8), %xmm0
movq -0x70(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rdi
callq 0x11640
movq -0x70(%rbp), %rax
movslq -0x48(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x88(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movq -0xf8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11590
movl -0x48(%rbp), %edx
movq -0x78(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xc41f
jmp 0xc4d8
movl -0x50(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0xc9c1
movsd 0x6914(%rip), %xmm0     # 0x12e00
movsd %xmm0, -0xb0(%rbp)
movsd 0x5b14(%rip), %xmm0     # 0x12010
movsd %xmm0, -0xb8(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x8c(%rbp), %eax
jge 0xc56f
movl -0x48(%rbp), %eax
movl %eax, -0x12c(%rbp)
callq 0x2090
movl -0x8c(%rbp), %ecx
subl -0x48(%rbp), %ecx
cltd
idivl %ecx
movl -0x12c(%rbp), %eax
addl %edx, %eax
movl %eax, -0xfc(%rbp)
movq -0x78(%rbp), %rdi
movslq -0x48(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x78(%rbp), %rsi
movslq -0xfc(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x70b0
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xc50b
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x8c(%rbp), %eax
jge 0xc890
movq -0x78(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movq -0x88(%rbp), %rax
movslq -0x48(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0xfd(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x108(%rbp)
movsbl -0xfd(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x138(%rbp)
movq -0x18(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x11520
movaps %xmm0, %xmm1
movsd -0x138(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd 0x5a10(%rip), %xmm1     # 0x12008
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x88(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0xf0(%rbp,%rax,8), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x88(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0xd0(%rbp,%rax,8), %xmm2
movsd -0x68(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x98(%rbp)
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xc6f2
jp 0xc6f2
movsd -0x68(%rbp), %xmm0
ucomisd -0xa0(%rbp), %xmm0
jbe 0xc6d4
movl -0x8c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8c(%rbp)
movq -0x78(%rbp), %rdi
movslq -0x4c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x78(%rbp), %rsi
movslq -0x8c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x70b0
movl -0x4c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xc882
xorps %xmm0, %xmm0
ucomisd -0x68(%rbp), %xmm0
jbe 0xc6eb
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
jmp 0xc6ed
jmp 0xc78c
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd -0x58(%rbp), %xmm0
jne 0xc77d
jp 0xc77d
movsd -0x68(%rbp), %xmm1
movsd -0xa8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xc75e
movl -0x8c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8c(%rbp)
movq -0x78(%rbp), %rdi
movslq -0x4c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x78(%rbp), %rsi
movslq -0x8c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x70b0
movl -0x4c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xc882
movsd -0x68(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xc779
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
jmp 0xc77b
jmp 0xc78a
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
jmp 0xc78c
movsd -0xb0(%rbp), %xmm0
movsd -0x98(%rbp), %xmm1
callq 0x7070
movsd %xmm0, -0xb0(%rbp)
movsd -0xb8(%rbp), %xmm0
movsd -0x98(%rbp), %xmm1
callq 0x5f30
movsd %xmm0, -0xb8(%rbp)
movsd -0x98(%rbp), %xmm0
movaps 0x64cb(%rip), %xmm1     # 0x12ca0
pand %xmm1, %xmm0
movsd 0x649f(%rip), %xmm1     # 0x12c80
ucomisd %xmm1, %xmm0
jbe 0xc880
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x110(%rbp)
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd -0x68(%rbp), %xmm1
movq -0x70(%rbp), %rax
movslq -0x48(%rbp), %rcx
divsd (%rax,%rcx,8), %xmm1
subsd %xmm1, %xmm0
xorps %xmm1, %xmm1
callq 0x7070
movsd -0x58(%rbp), %xmm1
callq 0x5f30
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
subsd -0x110(%rbp), %xmm0
movsbl -0xfd(%rbp), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movq -0x108(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11590
jmp 0xc882
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xc576
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0xc8b7
leaq 0x6638(%rip), %rdi      # 0x12ee8
movb $0x0, %al
callq 0x7120
movsd -0xb0(%rbp), %xmm1
subsd -0xb8(%rbp), %xmm1
movsd -0x40(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xc95e
movsd -0xb0(%rbp), %xmm1
movaps 0x63bb(%rip), %xmm0     # 0x12ca0
pand %xmm0, %xmm1
movsd -0x40(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xc95e
movsd -0xb8(%rbp), %xmm1
movaps 0x639d(%rip), %xmm0     # 0x12ca0
pand %xmm0, %xmm1
movsd -0x40(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xc95e
movl -0x8c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jne 0xc922
jmp 0xc9c1
movl -0x30(%rbp), %eax
movl %eax, -0x8c(%rbp)
leaq 0x65b8(%rip), %rdi      # 0x12eea
movb $0x0, %al
callq 0x7120
movsd 0x56cf(%rip), %xmm0     # 0x12010
movsd %xmm0, -0xa0(%rbp)
movsd 0x64af(%rip), %xmm0     # 0x12e00
movsd %xmm0, -0xa8(%rbp)
jmp 0xc4d8
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
xorps %xmm0, %xmm0
ucomisd -0xa0(%rbp), %xmm0
jb 0xc99b
movsd 0x567d(%rip), %xmm0     # 0x12010
movsd %xmm0, -0xa0(%rbp)
movsd -0xa8(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xc9bc
movsd 0x644c(%rip), %xmm0     # 0x12e00
movsd %xmm0, -0xa8(%rbp)
jmp 0xc4d8
movl -0x50(%rbp), %esi
leaq 0x6521(%rip), %rdi      # 0x12eec
movb $0x0, %al
callq 0x7120
xorps %xmm0, %xmm0
movsd %xmm0, -0x118(%rbp)
movl $0x0, -0x11c(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xca33
movq -0x18(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x118(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x118(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xc9ee
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0xcada
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq -0x88(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0xd0(%rbp,%rax,8), %xmm1
mulsd %xmm1, %xmm2
movsd 0x63a7(%rip), %xmm1     # 0x12e30
addsd %xmm1, %xmm2
movsd -0x118(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x118(%rbp)
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xcaca
movl -0x11c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x11c(%rbp)
jmp 0xcacc
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xca3a
movsd -0x118(%rbp), %xmm0
movsd 0x6306(%rip), %xmm1     # 0x12df0
divsd %xmm1, %xmm0
leaq 0x6448(%rip), %rdi      # 0x12f3d
movb $0x1, %al
callq 0x7120
movl -0x11c(%rbp), %esi
leaq 0x644b(%rip), %rdi      # 0x12f54
movb $0x0, %al
callq 0x7120
movq -0x10(%rbp), %rax
testb $0x1, 0x4c(%rax)
je 0xcbc3
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xcb48
movq -0x18(%rbp), %rax
movslq -0x48(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xcb25
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0xcbc1
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x128(%rbp)
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xcbb4
movq -0x88(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
movq -0x80(%rbp), %rax
movslq -0x48(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movq -0x128(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11590
jmp 0xcbb6
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xcb4f
jmp 0xcbc3
movq -0x70(%rbp), %rax
movq %rax, -0x140(%rbp)
cmpq $0x0, %rax
je 0xcbe0
movq -0x140(%rbp), %rdi
callq 0x21b0
movq -0x80(%rbp), %rax
movq %rax, -0x148(%rbp)
cmpq $0x0, %rax
je 0xcbfd
movq -0x148(%rbp), %rdi
callq 0x21b0
movq -0x88(%rbp), %rax
movq %rax, -0x150(%rbp)
cmpq $0x0, %rax
je 0xcc1d
movq -0x150(%rbp), %rdi
callq 0x21b0
movq -0x78(%rbp), %rax
movq %rax, -0x158(%rbp)
cmpq $0x0, %rax
je 0xcc3a
movq -0x158(%rbp), %rdi
callq 0x21b0
movl -0x50(%rbp), %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopw %cs:(%rax,%rax)