// File: qmmlib[P]QmmLibrary/linear.cpp
// Function: solve_l1r_l2_svc(problem*, double*, double, double, double, parameter const*, model const*, long)
static void solve_l1r_l2_svc(
	problem *prob_col, double *w, double eps, 
	double Cp, double Cn, const parameter *param, const struct model* model_, clock_t cpu_begin)
{
	int l = prob_col->l;
	int w_size = prob_col->n;
	int j, s, iter = 0;
	int max_iter = 1000;
	int active_size = w_size;
	int max_num_linesearch = 20;

	double sigma = 0.01;
	double d, G_loss, G, H;
	double Gmax_old = INF;
	double Gmax_new, Gnorm1_new;
	double Gnorm1_init;
	double d_old, d_diff;
	double loss_old, loss_new;
	double appxcond, cond;

	int *index = new int[w_size];
	schar *y = new schar[l];
	double *b = new double[l]; // b = 1-ywTx
	double *xj_sq = new double[w_size];
	feature_node *x;

	clock_t cpu_now;
	double cpu_time_elapsed;

	double C[3] = {Cn,0,Cp};

	// Initial w can be set here.
	for(j=0; j<w_size; j++)
		w[j] = 0;

	for(j=0; j<l; j++)
	{
		b[j] = 1;
		if(prob_col->y[j] > 0)
			y[j] = 1;
		else
			y[j] = -1;
	}
	for(j=0; j<w_size; j++)
	{
		index[j] = j;
		xj_sq[j] = 0;
		x = prob_col->x[j];
		while(x->index != -1)
		{
			int ind = x->index-1;
			x->value *= y[ind]; // x->value stores yi*xij
			double val = x->value;
			b[ind] -= w[j]*val;
			xj_sq[j] += C[GETI(ind)]*val*val;
			x++;
		}
	}

	if(param->save_each_iter!=0) {char filenametosave[1024]; sprintf(filenametosave,"%s%d.model",param->save_each_iter,0); save_model(filenametosave,model_);}
	if (param->chat_level > 0)
	{
		cpu_now = clock();
		cpu_time_elapsed = ((double) (cpu_now - cpu_begin)) / ((double) CLOCKS_PER_SEC);																					
		double objective_value = 0;
		for(j=0; j<w_size; j++)
			if(w[j] != 0)
				objective_value += fabs(w[j]);
		for(j=0; j<l; j++)
			if(b[j] > 0)
				objective_value += C[GETI(j)]*b[j]*b[j];
		__QMMCHAT__
		cpu_begin += (clock() - cpu_now);
	}

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

		for(j=0; j<active_size; j++)
		{
			int i = j+rand()%(active_size-j);
			swap(index[i], index[j]);
		}

		for(s=0; s<active_size; s++)
		{
			j = index[s];
			G_loss = 0;
			H = 0;

			x = prob_col->x[j];
			while(x->index != -1)
			{
				int ind = x->index-1;
				if(b[ind] > 0)
				{
					double val = x->value;
					double tmp = C[GETI(ind)]*val;
					G_loss -= tmp*b[ind];
					H += tmp*val;
				}
				x++;
			}
			G_loss *= 2;

			G = G_loss;
			H *= 2;
			H = max(H, 1e-12);

			double Gp = G+1;
			double Gn = G-1;
			double violation = 0;
			if(w[j] == 0)
			{
				if(Gp < 0)
					violation = -Gp;
				else if(Gn > 0)
					violation = Gn;
				else if(Gp>Gmax_old/l && Gn<-Gmax_old/l)
				{
					active_size--;
					swap(index[s], index[active_size]);
					s--;
					continue;
				}
			}
			else if(w[j] > 0)
				violation = fabs(Gp);
			else
				violation = fabs(Gn);

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

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

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

			double delta = fabs(w[j]+d)-fabs(w[j]) + G*d;
			d_old = 0;
			int num_linesearch;
			for(num_linesearch=0; num_linesearch < max_num_linesearch; num_linesearch++)
			{
				d_diff = d_old - d;
				cond = fabs(w[j]+d)-fabs(w[j]) - sigma*delta;

				appxcond = xj_sq[j]*d*d + G_loss*d + cond;
				if(appxcond <= 0)
				{
					x = prob_col->x[j];
					while(x->index != -1)
					{
						b[x->index-1] += d_diff*x->value;
						x++;
					}
					break;
				}

				if(num_linesearch == 0)
				{
					loss_old = 0;
					loss_new = 0;
					x = prob_col->x[j];
					while(x->index != -1)
					{
						int ind = x->index-1;
						if(b[ind] > 0)
							loss_old += C[GETI(ind)]*b[ind]*b[ind];
						double b_new = b[ind] + d_diff*x->value;
						b[ind] = b_new;
						if(b_new > 0)
							loss_new += C[GETI(ind)]*b_new*b_new;
						x++;
					}
				}
				else
				{
					loss_new = 0;
					x = prob_col->x[j];
					while(x->index != -1)
					{
						int ind = x->index-1;
						double b_new = b[ind] + d_diff*x->value;
						b[ind] = b_new;
						if(b_new > 0)
							loss_new += C[GETI(ind)]*b_new*b_new;
						x++;
					}
				}

				cond = cond + loss_new - loss_old;
				if(cond <= 0)
					break;
				else
				{
					d_old = d;
					d *= 0.5;
					delta *= 0.5;
				}
			}

			w[j] += d;

			// recompute b[] if line search takes too many steps
			if(num_linesearch >= max_num_linesearch)
			{
				info("#");
				for(int i=0; i<l; i++)
					b[i] = 1;

				for(int i=0; i<w_size; i++)
				{
					if(w[i]==0) continue;
					x = prob_col->x[i];
					while(x->index != -1)
					{
						b[x->index-1] -= w[i]*x->value;
						x++;
					}
				}
			}
		}

		if(iter == 0)
			Gnorm1_init = Gnorm1_new;

		iter++;
		
		if(param->save_each_iter!=0) {char filenametosave[1024]; sprintf(filenametosave,"%s%d.model",param->save_each_iter,iter); save_model(filenametosave,model_);}
		if (param->chat_level > 0)
		{
			cpu_now = clock();
			cpu_time_elapsed = ((double) (cpu_now - cpu_begin)) / ((double) CLOCKS_PER_SEC);																					
			double objective_value = 0;
			for(j=0; j<w_size; j++)
				if(w[j] != 0)
					objective_value += fabs(w[j]);
			for(j=0; j<l; j++)
				if(b[j] > 0)
					objective_value += C[GETI(j)]*b[j]*b[j];
			__QMMCHAT__
			cpu_begin += (clock() - cpu_now);
		}

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

		Gmax_old = Gmax_new;
	}

	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 nnz = 0;
	for(j=0; j<w_size; j++)
	{
		x = prob_col->x[j];
		while(x->index != -1)
		{
			x->value *= prob_col->y[x->index-1]; // restore x->value
			x++;
		}
		if(w[j] != 0)
		{
			v += fabs(w[j]);
			nnz++;
		}
	}
	for(j=0; j<l; j++)
		if(b[j] > 0)
			v += C[GETI(j)]*b[j]*b[j];

	info("Objective value = %lf\n", v);
	info("#nonzeros/#features = %d/%d\n", nnz, w_size);

	delete [] index;
	delete [] y;
	delete [] b;
	delete [] xj_sq;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x9f0, %rsp            # imm = 0x9F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x20(%rbp)
movsd %xmm2, -0x28(%rbp)
movq %rdx, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
movq %r8, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x48(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x3e8, -0x58(%rbp)     # imm = 0x3E8
movl -0x48(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl $0x14, -0x60(%rbp)
movsd 0x13edc(%rip), %xmm0    # 0x24010
movsd %xmm0, -0x68(%rbp)
movsd 0x13eff(%rip), %xmm0    # 0x24040
movsd %xmm0, -0x90(%rbp)
movslq -0x48(%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, -0xe0(%rbp)
movslq -0x44(%rbp), %rdi
callq 0x3030
movq %rax, -0xe8(%rbp)
movslq -0x44(%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, -0xf0(%rbp)
movslq -0x48(%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, -0xf8(%rbp)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x130(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x128(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x120(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x1022c
movq -0x10(%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 0x10209
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x1029a
movq -0xf0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd 0x13dda(%rip), %xmm0    # 0x24028
movsd %xmm0, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1027e
movq -0xe8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0x1028d
movq -0xe8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movb $-0x1, (%rax,%rcx)
jmp 0x1028f
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x10233
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x10405
movl -0x4c(%rbp), %edx
movq -0xe0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0xf8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x103f5
movq -0x100(%rbp), %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x134(%rbp)
movq -0xe8(%rbp), %rax
movslq -0x134(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
movq -0x100(%rbp), %rax
mulsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
movq -0x100(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x140(%rbp)
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd -0x140(%rbp), %xmm2
movq -0xf0(%rbp), %rax
movslq -0x134(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq %xmm0, %rdx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
xorq %rsi, %rdx
movq %rdx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0xe8(%rbp), %rax
movslq -0x134(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0x130(%rbp,%rax,8), %xmm0
mulsd -0x140(%rbp), %xmm0
movsd -0x140(%rbp), %xmm2
movq -0xf8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x100(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x100(%rbp)
jmp 0x102e8
jmp 0x103f7
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x102a1
movq -0x30(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x1043f
leaq -0x540(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rdx
leaq 0x14d0a(%rip), %rsi     # 0x25130
xorl %ecx, %ecx
movb $0x0, %al
callq 0x30a0
leaq -0x540(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0xe810
movq -0x30(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jle 0x10667
callq 0x3180
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rax
subq -0x40(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x13b97(%rip), %xmm1    # 0x24008
divsd %xmm1, %xmm0
movsd %xmm0, -0x110(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x548(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x104e6
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x104b1
jp 0x104b1
jmp 0x104d9
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movaps 0x14c5b(%rip), %xmm1    # 0x25120
pand %xmm1, %xmm0
addsd -0x548(%rbp), %xmm0
movsd %xmm0, -0x548(%rbp)
jmp 0x104db
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1048f
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x10573
movq -0xf0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10563
movq -0xe8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0x130(%rbp,%rax,8), %xmm0
movq -0xf0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movq -0xf0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x548(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x548(%rbp)
jmp 0x10565
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x104ed
movq -0x30(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jle 0x10653
movl -0x54(%rbp), %esi
movsd -0x110(%rbp), %xmm0
leaq 0x14ba8(%rip), %rdi     # 0x2513b
movb $0x1, %al
callq 0x9490
movq -0x30(%rbp), %rax
cmpl $0x1, 0x40(%rax)
jle 0x10645
movq -0x30(%rbp), %rax
cmpl $0x2, 0x40(%rax)
jle 0x10643
movsd -0x548(%rbp), %xmm0
leaq 0x14b8e(%rip), %rdi     # 0x25153
movb $0x1, %al
callq 0x9490
movq -0x30(%rbp), %rax
cmpl $0x3, 0x40(%rax)
jle 0x10641
movq -0x30(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x10603
movq 0x1a9f0(%rip), %rax     # 0x2afd8
movq (%rax), %rdi
leaq 0x14b76(%rip), %rsi     # 0x25168
movb $0x0, %al
callq 0x3400
movl $0x1, %edi
callq 0x3380
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x38(%rbp), %rsi
callq 0x20fa0
leaq 0x14b87(%rip), %rdi     # 0x251a2
movb $0x1, %al
callq 0x9490
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x38(%rbp), %rsi
callq 0x20fa0
leaq 0x14b78(%rip), %rdi     # 0x251b2
movb $0x1, %al
callq 0x9490
jmp 0x10643
jmp 0x10645
leaq 0x149e1(%rip), %rdi     # 0x2502d
movb $0x0, %al
callq 0x9490
callq 0x3180
subq -0x108(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x10669
movl -0x54(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x11491
xorps %xmm0, %xmm0
movsd %xmm0, -0x98(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x106f6
movl -0x4c(%rbp), %eax
movl %eax, -0x9c8(%rbp)
callq 0x30b0
movl -0x5c(%rbp), %ecx
subl -0x4c(%rbp), %ecx
cltd
idivl %ecx
movl -0x9c8(%rbp), %eax
addl %edx, %eax
movl %eax, -0x54c(%rbp)
movq -0xe0(%rbp), %rdi
movslq -0x54c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0xe0(%rbp), %rsi
movslq -0x4c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x9420
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x10692
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x111ac
movq -0xe0(%rbp), %rax
movslq -0x50(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x78(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x88(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x1084d
movq -0x100(%rbp), %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x550(%rbp)
movq -0xf0(%rbp), %rax
movslq -0x550(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10836
movq -0x100(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x558(%rbp)
movq -0xe8(%rbp), %rax
movslq -0x550(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0x130(%rbp,%rax,8), %xmm0
mulsd -0x558(%rbp), %xmm0
movsd %xmm0, -0x560(%rbp)
movsd -0x560(%rbp), %xmm0
movq -0xf0(%rbp), %rax
movslq -0x550(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x78(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x560(%rbp), %xmm0
movsd -0x558(%rbp), %xmm2
movsd -0x88(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movq -0x100(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x100(%rbp)
jmp 0x10744
movsd 0x14a33(%rip), %xmm0    # 0x25288
mulsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd 0x14a17(%rip), %xmm0    # 0x25288
mulsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x88(%rbp), %xmm0
movsd 0x1487f(%rip), %xmm1    # 0x25110
callq 0x93e0
movsd %xmm0, -0x88(%rbp)
movsd 0x13782(%rip), %xmm0    # 0x24028
addsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x568(%rbp)
movsd -0x80(%rbp), %xmm0
movsd 0x13768(%rip), %xmm1    # 0x24028
subsd %xmm1, %xmm0
movsd %xmm0, -0x570(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x578(%rbp)
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x109f1
jp 0x109f1
xorps %xmm0, %xmm0
ucomisd -0x568(%rbp), %xmm0
jbe 0x10930
movsd -0x568(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x578(%rbp)
jmp 0x109ef
movsd -0x570(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10956
movsd -0x570(%rbp), %xmm0
movsd %xmm0, -0x578(%rbp)
jmp 0x109ed
movsd -0x568(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
cvtsi2sdl -0x44(%rbp), %xmm2
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x109eb
movsd -0x570(%rbp), %xmm1
movsd -0x90(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
cvtsi2sdl -0x44(%rbp), %xmm2
divsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x109eb
movl -0x5c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x5c(%rbp)
movq -0xe0(%rbp), %rdi
movslq -0x50(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0xe0(%rbp), %rsi
movslq -0x5c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x9420
movl -0x50(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x1119e
jmp 0x109ed
jmp 0x109ef
jmp 0x10a41
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10a24
movsd -0x568(%rbp), %xmm0
movaps 0x1470a(%rip), %xmm1    # 0x25120
pand %xmm1, %xmm0
movsd %xmm0, -0x578(%rbp)
jmp 0x10a3f
movsd -0x570(%rbp), %xmm0
movaps 0x146ed(%rip), %xmm1    # 0x25120
pand %xmm1, %xmm0
movsd %xmm0, -0x578(%rbp)
jmp 0x10a41
movsd -0x98(%rbp), %xmm0
movsd -0x578(%rbp), %xmm1
callq 0x93e0
movsd %xmm0, -0x98(%rbp)
movsd -0x578(%rbp), %xmm0
addsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0x568(%rbp), %xmm1
movsd -0x88(%rbp), %xmm0
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x10ac7
movsd -0x568(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
divsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
jmp 0x10b43
movsd -0x570(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10b18
movsd -0x570(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
divsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
jmp 0x10b41
movq -0x10(%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, -0x70(%rbp)
jmp 0x10b43
movsd -0x70(%rbp), %xmm1
movaps 0x145d1(%rip), %xmm0    # 0x25120
pand %xmm0, %xmm1
movsd 0x145b5(%rip), %xmm0    # 0x25110
ucomisd %xmm1, %xmm0
jbe 0x10b66
jmp 0x1119e
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
addsd -0x70(%rbp), %xmm1
movaps 0x145a1(%rip), %xmm0    # 0x25120
pand %xmm0, %xmm1
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movaps 0x14589(%rip), %xmm2    # 0x25120
pand %xmm2, %xmm0
subsd %xmm0, %xmm1
movsd -0x80(%rbp), %xmm0
movsd -0x70(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x580(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xb0(%rbp)
movl $0x0, -0x584(%rbp)
movl -0x584(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0x11041
movsd -0xb0(%rbp), %xmm0
subsd -0x70(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
addsd -0x70(%rbp), %xmm1
movaps 0x14515(%rip), %xmm0    # 0x25120
pand %xmm0, %xmm1
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movaps 0x144fd(%rip), %xmm2    # 0x25120
pand %xmm2, %xmm0
subsd %xmm0, %xmm1
movsd -0x68(%rbp), %xmm0
movsd -0x580(%rbp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xd8(%rbp)
movq -0xf8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
mulsd -0x70(%rbp), %xmm0
movsd -0x70(%rbp), %xmm2
movsd -0x78(%rbp), %xmm1
mulsd -0x70(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd -0xd8(%rbp), %xmm0
movsd %xmm0, -0xd0(%rbp)
xorps %xmm0, %xmm0
ucomisd -0xd0(%rbp), %xmm0
jb 0x10d20
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x10d1b
movsd -0xb8(%rbp), %xmm0
movq -0x100(%rbp), %rax
movsd 0x8(%rax), %xmm2
movq -0xf0(%rbp), %rax
movq -0x100(%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 -0x100(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x100(%rbp)
jmp 0x10cbf
jmp 0x11041
cmpl $0x0, -0x584(%rbp)
jne 0x10ebd
xorps %xmm0, %xmm0
movsd %xmm0, -0xc0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x10eb8
movq -0x100(%rbp), %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x588(%rbp)
movq -0xf0(%rbp), %rax
movslq -0x588(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10df6
movq -0xe8(%rbp), %rax
movslq -0x588(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0x130(%rbp,%rax,8), %xmm0
movq -0xf0(%rbp), %rax
movslq -0x588(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movq -0xf0(%rbp), %rax
movslq -0x588(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0xc0(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xc0(%rbp)
movq -0xf0(%rbp), %rax
movslq -0x588(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0xb8(%rbp), %xmm0
movq -0x100(%rbp), %rax
movsd 0x8(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x590(%rbp)
movsd -0x590(%rbp), %xmm0
movq -0xf0(%rbp), %rax
movslq -0x588(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x590(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10ea1
movq -0xe8(%rbp), %rax
movslq -0x588(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0x130(%rbp,%rax,8), %xmm0
mulsd -0x590(%rbp), %xmm0
movsd -0x590(%rbp), %xmm2
movsd -0xc8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0x100(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x100(%rbp)
jmp 0x10d5a
jmp 0x10fc5
xorps %xmm0, %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x10fc3
movq -0x100(%rbp), %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x594(%rbp)
movq -0xf0(%rbp), %rax
movslq -0x594(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0xb8(%rbp), %xmm0
movq -0x100(%rbp), %rax
movsd 0x8(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x5a0(%rbp)
movsd -0x5a0(%rbp), %xmm0
movq -0xf0(%rbp), %rax
movslq -0x594(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x5a0(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10fac
movq -0xe8(%rbp), %rax
movslq -0x594(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0x130(%rbp,%rax,8), %xmm0
mulsd -0x5a0(%rbp), %xmm0
movsd -0x5a0(%rbp), %xmm2
movsd -0xc8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0x100(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x100(%rbp)
jmp 0x10edf
jmp 0x10fc5
movsd -0xd8(%rbp), %xmm0
addsd -0xc8(%rbp), %xmm0
subsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0xd8(%rbp)
xorps %xmm0, %xmm0
ucomisd -0xd8(%rbp), %xmm0
jb 0x10ff4
jmp 0x11041
movsd -0x70(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd 0x13017(%rip), %xmm0    # 0x24020
mulsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd 0x13005(%rip), %xmm0    # 0x24020
mulsd -0x580(%rbp), %xmm0
movsd %xmm0, -0x580(%rbp)
jmp 0x1102d
movl -0x584(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x584(%rbp)
jmp 0x10bce
movsd -0x70(%rbp), %xmm0
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x584(%rbp), %eax
cmpl -0x60(%rbp), %eax
jl 0x1119c
leaq 0x145e3(%rip), %rdi     # 0x25651
movb $0x0, %al
callq 0x9490
movl $0x0, -0x5a4(%rbp)
movl -0x5a4(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x110b6
movq -0xf0(%rbp), %rax
movslq -0x5a4(%rbp), %rcx
movsd 0x12f88(%rip), %xmm0    # 0x24028
movsd %xmm0, (%rax,%rcx,8)
movl -0x5a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5a4(%rbp)
jmp 0x1107f
movl $0x0, -0x5a8(%rbp)
movl -0x5a8(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x1119a
movq -0x10(%rbp), %rax
movslq -0x5a8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x110ef
jp 0x110ef
jmp 0x11186
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x5a8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x11184
movq -0x10(%rbp), %rax
movslq -0x5a8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x100(%rbp), %rax
movsd 0x8(%rax), %xmm2
movq -0xf0(%rbp), %rax
movq -0x100(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq %xmm0, %rdx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
xorq %rsi, %rdx
movq %rdx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x100(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x100(%rbp)
jmp 0x11109
jmp 0x11186
movl -0x5a8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5a8(%rbp)
jmp 0x110c0
jmp 0x1119c
jmp 0x1119e
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x106fd
cmpl $0x0, -0x54(%rbp)
jne 0x111c2
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x11206
leaq -0x9b0(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rdx
movl -0x54(%rbp), %ecx
leaq 0x13f41(%rip), %rsi     # 0x25130
movb $0x0, %al
callq 0x30a0
leaq -0x9b0(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0xe810
movq -0x30(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jle 0x1142e
callq 0x3180
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rax
subq -0x40(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x12dd0(%rip), %xmm1    # 0x24008
divsd %xmm1, %xmm0
movsd %xmm0, -0x110(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x9b8(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x112ad
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x11278
jp 0x11278
jmp 0x112a0
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movaps 0x13e94(%rip), %xmm1    # 0x25120
pand %xmm1, %xmm0
addsd -0x9b8(%rbp), %xmm0
movsd %xmm0, -0x9b8(%rbp)
jmp 0x112a2
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x11256
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x1133a
movq -0xf0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1132a
movq -0xe8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0x130(%rbp,%rax,8), %xmm0
movq -0xf0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movq -0xf0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x9b8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x9b8(%rbp)
jmp 0x1132c
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x112b4
movq -0x30(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jle 0x1141a
movl -0x54(%rbp), %esi
movsd -0x110(%rbp), %xmm0
leaq 0x13de1(%rip), %rdi     # 0x2513b
movb $0x1, %al
callq 0x9490
movq -0x30(%rbp), %rax
cmpl $0x1, 0x40(%rax)
jle 0x1140c
movq -0x30(%rbp), %rax
cmpl $0x2, 0x40(%rax)
jle 0x1140a
movsd -0x9b8(%rbp), %xmm0
leaq 0x13dc7(%rip), %rdi     # 0x25153
movb $0x1, %al
callq 0x9490
movq -0x30(%rbp), %rax
cmpl $0x3, 0x40(%rax)
jle 0x11408
movq -0x30(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x113ca
movq 0x19c29(%rip), %rax     # 0x2afd8
movq (%rax), %rdi
leaq 0x13daf(%rip), %rsi     # 0x25168
movb $0x0, %al
callq 0x3400
movl $0x1, %edi
callq 0x3380
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x38(%rbp), %rsi
callq 0x20fa0
leaq 0x13dc0(%rip), %rdi     # 0x251a2
movb $0x1, %al
callq 0x9490
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x38(%rbp), %rsi
callq 0x20fa0
leaq 0x13db1(%rip), %rdi     # 0x251b2
movb $0x1, %al
callq 0x9490
jmp 0x1140a
jmp 0x1140c
leaq 0x13c1a(%rip), %rdi     # 0x2502d
movb $0x0, %al
callq 0x9490
callq 0x3180
subq -0x108(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movsd -0xa0(%rbp), %xmm1
movsd -0x18(%rbp), %xmm0
mulsd -0xa8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x1147c
movl -0x5c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jne 0x11453
jmp 0x11491
movl -0x48(%rbp), %eax
movl %eax, -0x5c(%rbp)
leaq 0x13f98(%rip), %rdi     # 0x253f8
movb $0x0, %al
callq 0x9490
movsd 0x12bd1(%rip), %xmm0    # 0x24040
movsd %xmm0, -0x90(%rbp)
jmp 0x10669
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
jmp 0x10669
movl -0x54(%rbp), %esi
leaq 0x13f5f(%rip), %rdi     # 0x253fa
movb $0x0, %al
callq 0x9490
movl -0x54(%rbp), %eax
cmpl -0x58(%rbp), %eax
jl 0x114b8
leaq 0x13f6d(%rip), %rdi     # 0x2541e
movb $0x0, %al
callq 0x9490
xorps %xmm0, %xmm0
movsd %xmm0, -0x9c0(%rbp)
movl $0x0, -0x9c4(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x115a5
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x11544
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x100(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x100(%rbp), %rax
mulsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
movq -0x100(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x100(%rbp)
jmp 0x114f7
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1155e
jp 0x1155e
jmp 0x11595
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movaps 0x13bae(%rip), %xmm1    # 0x25120
pand %xmm1, %xmm0
addsd -0x9c0(%rbp), %xmm0
movsd %xmm0, -0x9c0(%rbp)
movl -0x9c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c4(%rbp)
jmp 0x11597
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x114d4
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x11632
movq -0xf0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x11622
movq -0xe8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
cltq
movsd -0x130(%rbp,%rax,8), %xmm0
movq -0xf0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movq -0xf0(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x9c0(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x9c0(%rbp)
jmp 0x11624
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x115ac
movsd -0x9c0(%rbp), %xmm0
leaq 0x13e0a(%rip), %rdi     # 0x2544b
movb $0x1, %al
callq 0x9490
movl -0x9c4(%rbp), %esi
movl -0x48(%rbp), %edx
leaq 0x13ffb(%rip), %rdi     # 0x25653
movb $0x0, %al
callq 0x9490
movq -0xe0(%rbp), %rax
movq %rax, -0x9d0(%rbp)
cmpq $0x0, %rax
je 0x1167f
movq -0x9d0(%rbp), %rdi
callq 0x33b0
movq -0xe8(%rbp), %rax
movq %rax, -0x9d8(%rbp)
cmpq $0x0, %rax
je 0x1169f
movq -0x9d8(%rbp), %rdi
callq 0x33b0
movq -0xf0(%rbp), %rax
movq %rax, -0x9e0(%rbp)
cmpq $0x0, %rax
je 0x116bf
movq -0x9e0(%rbp), %rdi
callq 0x33b0
movq -0xf8(%rbp), %rax
movq %rax, -0x9e8(%rbp)
cmpq $0x0, %rax
je 0x116df
movq -0x9e8(%rbp), %rdi
callq 0x33b0
addq $0x9f0, %rsp            # imm = 0x9F0
popq %rbp
retq
nopl (%rax,%rax)