// File: /workspace/github_cpp_makefile_star2_O1/cjlin1[P]liblinear/linear.cpp
// Function: train
model* train(const problem *prob, const parameter *param)
{
	int i,j;
	int l = prob->l;
	int n = prob->n;
	int w_size = prob->n;
	model *model_ = Malloc(model,1);

	if(prob->bias>=0)
		model_->nr_feature=n-1;
	else
		model_->nr_feature=n;
	model_->param = *param;
	model_->bias = prob->bias;

	if(check_regression_model(model_))
	{
		model_->w = Malloc(double, w_size);

		if(param->init_sol != NULL)
			for(i=0;i<w_size;i++)
				model_->w[i] = param->init_sol[i];
		else
			for(i=0;i<w_size;i++)
				model_->w[i] = 0;

		model_->nr_class = 2;
		model_->label = NULL;
		train_one(prob, param, model_->w, 0, 0);
	}
	else if(check_oneclass_model(model_))
	{
		model_->w = Malloc(double, w_size);
		model_->nr_class = 2;
		model_->label = NULL;
		solve_oneclass_svm(prob, param, model_->w, &(model_->rho));
	}
	else
	{
		int nr_class;
		int *label = NULL;
		int *start = NULL;
		int *count = NULL;
		int *perm = Malloc(int,l);

		// group training data of the same class
		group_classes(prob,&nr_class,&label,&start,&count,perm);

		model_->nr_class=nr_class;
		model_->label = Malloc(int,nr_class);
		for(i=0;i<nr_class;i++)
			model_->label[i] = label[i];

		// calculate weighted C
		double *weighted_C = Malloc(double, nr_class);
		for(i=0;i<nr_class;i++)
			weighted_C[i] = param->C;
		for(i=0;i<param->nr_weight;i++)
		{
			for(j=0;j<nr_class;j++)
				if(param->weight_label[i] == label[j])
					break;
			if(j == nr_class)
				fprintf(stderr,"WARNING: class label %d specified in weight is not found\n", param->weight_label[i]);
			else
				weighted_C[j] *= param->weight[i];
		}

		// constructing the subproblem
		feature_node **x = Malloc(feature_node *,l);
		for(i=0;i<l;i++)
			x[i] = prob->x[perm[i]];

		int k;
		problem sub_prob;
		sub_prob.l = l;
		sub_prob.n = n;
		sub_prob.x = Malloc(feature_node *,sub_prob.l);
		sub_prob.y = Malloc(double,sub_prob.l);

		for(k=0; k<sub_prob.l; k++)
			sub_prob.x[k] = x[k];

		// multi-class svm by Crammer and Singer
		if(param->solver_type == MCSVM_CS)
		{
			model_->w=Malloc(double, n*nr_class);
			for(i=0;i<nr_class;i++)
				for(j=start[i];j<start[i]+count[i];j++)
					sub_prob.y[j] = i;
			Solver_MCSVM_CS Solver(&sub_prob, nr_class, weighted_C, param->eps);
			Solver.Solve(model_->w);
		}
		else
		{
			if(nr_class == 2)
			{
				model_->w=Malloc(double, w_size);

				int e0 = start[0]+count[0];
				k=0;
				for(; k<e0; k++)
					sub_prob.y[k] = +1;
				for(; k<sub_prob.l; k++)
					sub_prob.y[k] = -1;

				if(param->init_sol != NULL)
					for(i=0;i<w_size;i++)
						model_->w[i] = param->init_sol[i];
				else
					for(i=0;i<w_size;i++)
						model_->w[i] = 0;

				train_one(&sub_prob, param, model_->w, weighted_C[0], weighted_C[1]);
			}
			else
			{
				model_->w=Malloc(double, w_size*nr_class);
				double *w=Malloc(double, w_size);
				for(i=0;i<nr_class;i++)
				{
					int si = start[i];
					int ei = si+count[i];

					k=0;
					for(; k<si; k++)
						sub_prob.y[k] = -1;
					for(; k<ei; k++)
						sub_prob.y[k] = +1;
					for(; k<sub_prob.l; k++)
						sub_prob.y[k] = -1;

					if(param->init_sol != NULL)
						for(j=0;j<w_size;j++)
							w[j] = param->init_sol[j*nr_class+i];
					else
						for(j=0;j<w_size;j++)
							w[j] = 0;

					train_one(&sub_prob, param, w, weighted_C[i], param->C);

					for(j=0;j<w_size;j++)
						model_->w[j*nr_class+i] = w[j];
				}
				free(w);
			}

		}

		free(x);
		free(label);
		free(start);
		free(count);
		free(perm);
		free(sub_prob.x);
		free(sub_prob.y);
		free(weighted_C);
	}
	return model_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r12
movq %rdi, %rbx
movl (%rdi), %r15d
movl 0x4(%rdi), %eax
movq %rax, 0x28(%rsp)
movslq %eax, %rbp
movl $0x78, %edi
callq 0x21f0
movq %rax, %r14
movq %rbx, 0x40(%rsp)
movsd 0x18(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl %ebp, %eax
adcl $-0x1, %eax
movl %eax, 0x54(%r14)
movl $0xa, %ecx
movq %r14, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movsd %xmm0, 0x68(%r14)
movl (%r14), %eax
leal -0xb(%rax), %ecx
cmpl $0x3, %ecx
movq %r12, 0x8(%rsp)
jae 0x5c10
shlq $0x3, %rbp
movq %rbp, %rdi
callq 0x21f0
movq %rax, %rbx
movq %rax, 0x58(%r14)
movq 0x40(%r12), %rax
testq %rax, %rax
je 0x5d2c
movq 0x28(%rsp), %rdx
testl %edx, %edx
jle 0x5d4c
xorl %ecx, %ecx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rbx,%rcx,8)
incq %rcx
cmpq %rcx, %rdx
jne 0x5bf9
jmp 0x5d4c
movslq %r15d, %rbx
cmpl $0x15, %eax
movq %r14, 0x60(%rsp)
movq %r15, 0x10(%rsp)
jne 0x5d79
movq %rbx, %rcx
shlq $0x4, %rcx
testl %ebx, %ebx
movq $-0x1, %rax
cmovsq %rax, %rcx
movq %rcx, 0x20(%rsp)
leaq (,%rbx,4), %r13
testl %ebx, %ebx
cmovsq %rax, %r13
movq %r14, %r12
movq %rbx, %r14
shlq $0x3, %r14
testl %ebx, %ebx
cmovsq %rax, %r14
shlq $0x3, %rbp
movq %rbp, %rdi
callq 0x21f0
movq %rax, %r15
movq %rax, 0x58(%r12)
movl $0x2, 0x50(%r12)
movq $0x0, 0x60(%r12)
movq 0x8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x38(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x58(%rsp)
movq %r14, %rdi
callq 0x2030
movq %rax, %r12
movq %r13, %rdi
callq 0x2030
movq %rax, %r13
movq %r14, %rdi
callq 0x2030
movq %rax, %rbp
movq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x18(%rsp)
movq %r14, %rdi
callq 0x2030
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %r8d
testl %r8d, %r8d
jle 0x5e85
movl %r8d, %edx
xorl %ecx, %ecx
movabsq $0x3ff0000000000000, %rsi # imm = 0x3FF0000000000000
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %r9
movq %rsi, (%rbp,%rcx,8)
incq %rcx
cmpq %rcx, %rdx
jne 0x5d1a
jmp 0x5e91
movq 0x28(%rsp), %rax
testl %eax, %eax
jle 0x5d4c
leaq (,%rax,8), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20c0
movq 0x8(%rsp), %r12
movl $0x2, 0x50(%r14)
movq $0x0, 0x60(%r14)
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movq 0x40(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x6ebb
jmp 0x6e74
movq %rbp, 0x58(%rsp)
movq %rbx, 0x30(%rsp)
leaq (,%rbx,4), %rbx
movq %rbx, %rdi
callq 0x21f0
movq %rax, 0x50(%rsp)
movl $0x40, %edi
callq 0x21f0
movq %rax, %rbp
movl $0x40, %edi
callq 0x21f0
movq %rax, %r14
movq %rbx, %rdi
callq 0x21f0
movq %rax, %rsi
testl %r15d, %r15d
movq %r15, %rdx
movq %rax, 0x18(%rsp)
jle 0x6828
xorl %r15d, %r15d
movl $0x10, %edi
xorl %r13d, %r13d
movq %r14, %r8
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
cvttsd2si (%rax,%r15,8), %r14d
movl $0x0, %eax
testl %r13d, %r13d
jle 0x5e11
movl %r13d, %ecx
xorl %eax, %eax
cmpl %r14d, (%rbp,%rax,4)
je 0x5e0d
incq %rax
cmpq %rax, %rcx
jne 0x5dfa
movl %ecx, %eax
jmp 0x5e11
incl (%r8,%rax,4)
movl %eax, (%rsi,%r15,4)
cmpl %r13d, %eax
jne 0x5e74
cmpl %edi, %r13d
jne 0x5e61
addl %edi, %edi
movslq %edi, %rbx
shlq $0x2, %rbx
movl %r13d, 0x38(%rsp)
movl %edi, %r13d
movq %rbp, %rdi
movq %rbx, %rsi
movq %r8, %r12
callq 0x2270
movq %rax, %rbp
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2270
movl %r13d, %edi
movl 0x38(%rsp), %r13d
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rax, %r8
movslq %r13d, %rax
movl %r14d, (%rbp,%rax,4)
movl $0x1, (%r8,%rax,4)
incl %r13d
incq %r15
cmpq %rdx, %r15
jne 0x5ddc
jmp 0x682e
xorl %ecx, %ecx
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %r9
movl %r9d, %edx
subl %r8d, %edx
movq 0x58(%rsp), %rbx
jle 0x5ead
cvtsi2sd %r8d, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, (%rbp,%rcx,8)
incl %r8d
cmpl %r9d, %r8d
movq %rax, 0x20(%rsp)
jge 0x5ee4
movslq %r8d, %rax
leaq (,%rax,8), %rdi
addq %rbp, %rdi
addl $-0x2, %edx
leaq 0x8(,%rdx,8), %rdx
xorl %esi, %esi
callq 0x20c0
movq 0x10(%rsp), %r9
movq 0x28(%rsp), %rdi
testl %edi, %edi
jle 0x5eff
leaq (,%rdi,8), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x20c0
movq 0x10(%rsp), %r9
testl %r9d, %r9d
jle 0x5f88
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
movl (%rdx), %esi
cmpl $-0x1, %esi
je 0x5f3e
leaq 0x10(%rdx), %rdi
xorpd %xmm0, %xmm0
movsd -0x8(%rdi), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
cmpl $-0x1, (%rdi)
leaq 0x10(%rdi), %rdi
jne 0x5f26
jmp 0x5f42
xorpd %xmm0, %xmm0
movsd %xmm0, (%rbx,%rcx,8)
cmpl $-0x1, %esi
je 0x5f7b
movsd (%rbp,%rcx,8), %xmm0
addq $0x10, %rdx
movslq %esi, %rsi
movsd -0x8(%rdx), %xmm1
mulsd %xmm0, %xmm1
addsd -0x8(%r15,%rsi,8), %xmm1
movsd %xmm1, -0x8(%r15,%rsi,8)
movl (%rdx), %esi
addq $0x10, %rdx
cmpl $-0x1, %esi
jne 0x5f56
movl %ecx, (%r13,%rcx,4)
incq %rcx
cmpq %r9, %rcx
jne 0x5f13
movb $0x1, %bl
movsd 0x7c86(%rip), %xmm5     # 0xdc18
movapd 0x7cb6(%rip), %xmm6     # 0xdc50
xorpd %xmm7, %xmm7
xorl %ecx, %ecx
movl %r9d, %r14d
movl %ecx, %eax
movq %rax, 0x48(%rsp)
movsd 0x7056(%rip), %xmm1     # 0xd008
movsd 0x7dee(%rip), %xmm0     # 0xdda8
testl %r14d, %r14d
jle 0x6055
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movl %r14d, %ecx
xorl %edx, %edx
movsd 0x7dcf(%rip), %xmm0     # 0xdda8
movsd 0x7027(%rip), %xmm1     # 0xd008
movslq (%r13,%rdx,4), %rsi
movq (%rax,%rsi,8), %rdi
movl (%rdi), %r8d
cmpl $-0x1, %r8d
je 0x601d
addq $0x10, %rdi
xorpd %xmm2, %xmm2
movslq %r8d, %r8
movsd -0x8(%r15,%r8,8), %xmm3
mulsd -0x8(%rdi), %xmm3
addsd %xmm3, %xmm2
movl (%rdi), %r8d
addq $0x10, %rdi
cmpl $-0x1, %r8d
jne 0x5ffb
jmp 0x6021
xorpd %xmm2, %xmm2
movsd %xmm2, (%r12,%rsi,8)
movsd (%rbp,%rsi,8), %xmm3
ucomisd %xmm3, %xmm5
jbe 0x603f
movapd %xmm2, %xmm4
xorpd %xmm6, %xmm4
maxsd %xmm4, %xmm0
ucomisd %xmm7, %xmm3
jbe 0x604d
xorpd %xmm6, %xmm2
minsd %xmm2, %xmm1
incq %rdx
cmpq %rcx, %rdx
jne 0x5fe1
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
movsd 0x38(%rsp), %xmm3
ucomisd %xmm2, %xmm3
jbe 0x60aa
cmpl %r9d, %r14d
je 0x6634
leaq 0x7e71(%rip), %rdi      # 0xdeea
xorl %eax, %eax
callq 0x5ab4
xorpd %xmm7, %xmm7
movapd 0x7bc4(%rip), %xmm6     # 0xdc50
movq 0x10(%rsp), %r9
movl %r9d, %r14d
testb $0x1, %bl
movsd 0x7b79(%rip), %xmm5     # 0xdc18
jne 0x5faa
jmp 0x6634
testl %r14d, %r14d
movq 0x20(%rsp), %r8
jle 0x6117
xorl %eax, %eax
movslq %eax, %rcx
movl (%r13,%rcx,4), %edx
movslq %edx, %rsi
movsd (%rbp,%rsi,8), %xmm2
ucomisd %xmm5, %xmm2
jne 0x60df
jp 0x60df
movsd (%r12,%rsi,8), %xmm3
xorpd %xmm6, %xmm3
ucomisd %xmm0, %xmm3
ja 0x60f7
ucomisd %xmm7, %xmm2
jne 0x6110
jp 0x6110
movsd (%r12,%rsi,8), %xmm2
xorpd %xmm6, %xmm2
ucomisd %xmm2, %xmm1
jbe 0x6110
movslq %r14d, %rax
decl %r14d
movl -0x4(%r13,%rax,4), %esi
movl %esi, (%r13,%rcx,4)
movl %edx, -0x4(%r13,%rax,4)
decl %ecx
movl %ecx, %eax
incl %eax
cmpl %r14d, %eax
jl 0x60b6
movslq %r14d, %rax
imulq $0x66666667, %rax, %r10 # imm = 0x66666667
movq %r10, %rcx
shrq $0x3f, %rcx
sarq $0x22, %r10
addl %ecx, %r10d
cmpl $0x2, %r10d
movl $0x1, %ecx
cmovll %ecx, %r10d
testl %eax, %eax
jle 0x61a7
movl %r14d, %eax
xorl %ecx, %ecx
xorl %ebx, %ebx
xorl %r9d, %r9d
movslq (%r13,%rcx,4), %rdx
movsd (%r12,%rdx,8), %xmm0
xorpd %xmm6, %xmm0
movsd (%rbp,%rdx,8), %xmm1
ucomisd %xmm1, %xmm5
jbe 0x6180
movslq %r9d, %r9
movq %r9, %rsi
shlq $0x4, %rsi
movq 0x18(%rsp), %rdi
movl %edx, (%rdi,%rsi)
movsd %xmm0, 0x8(%rdi,%rsi)
incl %r9d
ucomisd %xmm7, %xmm1
jbe 0x619d
movslq %ebx, %rbx
movq %rbx, %rsi
shlq $0x4, %rsi
movl %edx, (%r8,%rsi)
movsd %xmm0, 0x8(%r8,%rsi)
incl %ebx
incq %rcx
cmpq %rcx, %rax
jne 0x614a
jmp 0x61ac
xorl %r9d, %r9d
xorl %ebx, %ebx
movq %r9, 0x50(%rsp)
cmpl %ebx, %r9d
movl %ebx, %eax
cmovll %r9d, %eax
movl %eax, 0x8c(%rsp)
cmpl %eax, %r10d
cmovgel %eax, %r10d
movq %r10, 0x30(%rsp)
leal -0x1(%r9), %edx
movl %r9d, %ecx
subl %r10d, %ecx
movl %ecx, 0x8(%rsp)
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0xc1b7
movslq 0x8(%rsp), %rdi
shlq $0x4, %rdi
addq 0x18(%rsp), %rdi
movslq 0x30(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movl $0x10, %edx
leaq 0x60da(%rip), %rcx      # 0xc2e5
callq 0x22e0
decl %ebx
movq 0x20(%rsp), %rdi
xorl %esi, %esi
movl %ebx, %edx
movq 0x18(%rsp), %rbx
movq 0x8(%rsp), %rcx
callq 0xc1b7
movl $0x10, %edx
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x60a5(%rip), %rcx      # 0xc2e5
callq 0x22e0
movq 0x50(%rsp), %r11
xorpd %xmm7, %xmm7
movapd 0x79fa(%rip), %xmm6     # 0xdc50
movsd 0x79ba(%rip), %xmm5     # 0xdc18
movq 0x20(%rsp), %rdx
cmpl $0x0, 0x8c(%rsp)
jle 0x65d2
movl 0x30(%rsp), %r8d
xorl %ecx, %ecx
movq %r8, 0x30(%rsp)
movl %ecx, %eax
notl %eax
addl %r11d, %eax
cltq
shlq $0x4, %rax
movslq (%rbx,%rax), %rsi
movq %rcx, %rax
shlq $0x4, %rax
movslq (%rdx,%rax), %r9
movq %rsi, 0x8(%rsp)
movsd (%rbp,%rsi,8), %xmm0
ucomisd %xmm7, %xmm0
jne 0x62bf
jp 0x62bf
movsd (%rbp,%r9,8), %xmm1
ucomisd %xmm7, %xmm1
jne 0x62bf
jnp 0x65c6
ucomisd %xmm5, %xmm0
jne 0x62da
jp 0x62da
movsd (%rbp,%r9,8), %xmm1
ucomisd %xmm5, %xmm1
jne 0x62da
jnp 0x65c6
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x8(%rsp), %rax
movq (%rdi,%rax,8), %rsi
movl (%rsi), %eax
xorpd %xmm2, %xmm2
xorpd %xmm1, %xmm1
cmpl $-0x1, %eax
je 0x6323
leaq 0x10(%rsi), %r10
movl %eax, %r8d
movslq %r8d, %rdx
movsd -0x8(%r15,%rdx,8), %xmm3
mulsd -0x8(%r10), %xmm3
addsd %xmm3, %xmm1
movl (%r10), %r8d
addq $0x10, %r10
cmpl $-0x1, %r8d
jne 0x6302
movq (%rdi,%r9,8), %rdi
movl (%rdi), %r10d
cmpl $-0x1, %r10d
je 0x635c
leaq 0x10(%rdi), %r11
xorpd %xmm2, %xmm2
movl %r10d, %r8d
movslq %r8d, %rdx
movsd -0x8(%r15,%rdx,8), %xmm3
mulsd -0x8(%r11), %xmm3
addsd %xmm3, %xmm2
movl (%r11), %r8d
addq $0x10, %r11
cmpl $-0x1, %r8d
jne 0x633b
ucomisd %xmm0, %xmm5
movq 0x20(%rsp), %rdx
movq 0x50(%rsp), %r11
movq 0x30(%rsp), %r8
jbe 0x6398
movsd (%rbp,%r9,8), %xmm3
ucomisd %xmm7, %xmm3
jbe 0x6398
movsd 0x78a2(%rip), %xmm3     # 0xdc28
subsd %xmm2, %xmm3
movapd %xmm1, %xmm4
xorpd %xmm6, %xmm4
ucomisd %xmm3, %xmm4
ja 0x63cd
ucomisd %xmm7, %xmm0
jbe 0x65c6
ucomisd (%rbp,%r9,8), %xmm5
jbe 0x65c6
movsd 0x7871(%rip), %xmm3     # 0xdc28
subsd %xmm1, %xmm3
movapd %xmm2, %xmm4
xorpd %xmm6, %xmm4
ucomisd %xmm3, %xmm4
jbe 0x65c6
xorpd %xmm3, %xmm3
cmpl $-0x1, %eax
je 0x6416
movl %eax, %r8d
movq %rdi, %r11
movq %rsi, %rbx
movl (%r11), %edx
cmpl $-0x1, %edx
je 0x6416
cmpl %edx, %r8d
jne 0x6401
movsd 0x8(%rbx), %xmm4
mulsd 0x8(%r11), %xmm4
addsd %xmm4, %xmm3
addq $0x10, %rbx
jmp 0x6403
jle 0x6409
addq $0x10, %r11
jmp 0x640d
addq $0x10, %rbx
movl (%rbx), %r8d
cmpl $-0x1, %r8d
jne 0x63df
movq 0x58(%rsp), %rdx
movq 0x8(%rsp), %r8
movsd (%rdx,%r8,8), %xmm4
addsd (%rdx,%r9,8), %xmm4
addsd %xmm3, %xmm3
subsd %xmm3, %xmm4
movapd %xmm4, %xmm3
cmpnlesd %xmm7, %xmm3
andpd %xmm3, %xmm4
movsd 0x77de(%rip), %xmm8     # 0xdc28
andnpd %xmm8, %xmm3
orpd %xmm4, %xmm3
subsd %xmm2, %xmm1
divsd %xmm3, %xmm1
movsd (%rbp,%r9,8), %xmm2
movapd %xmm0, %xmm3
subsd %xmm1, %xmm3
movsd %xmm3, (%rbp,%r8,8)
addsd (%rbp,%r9,8), %xmm1
addsd %xmm0, %xmm2
movsd %xmm1, (%rbp,%r9,8)
ucomisd %xmm5, %xmm2
jbe 0x64d3
movsd (%rbp,%r8,8), %xmm1
ucomisd %xmm5, %xmm1
movq 0x20(%rsp), %rdx
movq 0x50(%rsp), %r11
movq 0x30(%rsp), %r8
jbe 0x64fc
movabsq $0x3ff0000000000000, %r8 # imm = 0x3FF0000000000000
movq 0x8(%rsp), %rbx
movq %r8, (%rbp,%rbx,8)
movq 0x30(%rsp), %r8
movapd %xmm2, %xmm1
addsd 0x6b4e(%rip), %xmm1     # 0xd018
movsd %xmm1, (%rbp,%r9,8)
jmp 0x64fc
ucomisd %xmm1, %xmm7
movq 0x20(%rsp), %rdx
movq 0x50(%rsp), %r11
movq 0x30(%rsp), %r8
jbe 0x64fc
movq $0x0, (%rbp,%r9,8)
movq 0x8(%rsp), %rbx
movsd %xmm2, (%rbp,%rbx,8)
ucomisd %xmm5, %xmm2
jbe 0x6538
movsd (%rbp,%r9,8), %xmm1
ucomisd %xmm5, %xmm1
movq 0x8(%rsp), %rbx
jbe 0x6555
movabsq $0x3ff0000000000000, %r8 # imm = 0x3FF0000000000000
movq %r8, (%rbp,%r9,8)
movq 0x30(%rsp), %r8
addsd 0x6ae8(%rip), %xmm2     # 0xd018
movsd %xmm2, (%rbp,%rbx,8)
jmp 0x6555
movq 0x8(%rsp), %rbx
ucomisd (%rbp,%rbx,8), %xmm7
jbe 0x6555
movq $0x0, (%rbp,%rbx,8)
movsd %xmm2, (%rbp,%r9,8)
movsd (%rbp,%rbx,8), %xmm1
subsd %xmm0, %xmm1
cmpl $-0x1, %eax
je 0x658c
addq $0x10, %rsi
cltq
movsd -0x8(%rsi), %xmm0
mulsd %xmm1, %xmm0
addsd -0x8(%r15,%rax,8), %xmm0
movsd %xmm0, -0x8(%r15,%rax,8)
movl (%rsi), %eax
addq $0x10, %rsi
cmpl $-0x1, %eax
jne 0x6568
cmpl $-0x1, %r10d
movq 0x18(%rsp), %rbx
je 0x65c6
xorpd %xmm6, %xmm1
addq $0x10, %rdi
movslq %r10d, %rax
movsd -0x8(%rdi), %xmm0
mulsd %xmm1, %xmm0
addsd -0x8(%r15,%rax,8), %xmm0
movsd %xmm0, -0x8(%r15,%rax,8)
movl (%rdi), %r10d
addq $0x10, %rdi
cmpl $-0x1, %r10d
jne 0x659f
incq %rcx
cmpq %r8, %rcx
jne 0x627d
movq 0x48(%rsp), %rbx
leal 0x1(%rbx), %ecx
imull $0xcccccccd, %ecx, %eax # imm = 0xCCCCCCCD
rorl %eax
cmpl $0x19999999, %eax       # imm = 0x19999999
ja 0x6613
leaq 0x78f8(%rip), %rdi      # 0xdee8
xorl %eax, %eax
movl %ecx, 0x8(%rsp)
callq 0x5ab4
movl 0x8(%rsp), %ecx
xorpd %xmm7, %xmm7
movapd 0x7645(%rip), %xmm6     # 0xdc50
movsd 0x7605(%rip), %xmm5     # 0xdc18
cmpl $0x3e7, %ebx            # imm = 0x3E7
setb %bl
cmpl $0x3e8, %ecx            # imm = 0x3E8
movq 0x10(%rsp), %r9
jne 0x5fa3
movl $0x3e8, %ebx            # imm = 0x3E8
jmp 0x6639
movq 0x48(%rsp), %rbx
leaq 0x78ac(%rip), %rdi      # 0xdeec
movl %ebx, %esi
xorl %eax, %eax
callq 0x5ab4
cmpl $0x3e8, %ebx            # imm = 0x3E8
movq 0x60(%rsp), %r14
jb 0x6664
leaq 0x7ee7(%rip), %rdi      # 0xe544
xorl %eax, %eax
callq 0x5ab4
movq 0x28(%rsp), %rcx
testl %ecx, %ecx
movq 0x10(%rsp), %rdx
xorpd %xmm0, %xmm0
jle 0x6696
xorl %eax, %eax
movsd (%r15,%rax,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rax
cmpq %rax, %rcx
jne 0x6678
mulsd 0x7572(%rip), %xmm0     # 0xdc08
testl %edx, %edx
jle 0x678f
xorl %eax, %eax
xorpd %xmm1, %xmm1
xorl %ebx, %ebx
movsd (%rbp,%rax,8), %xmm2
xorl %ecx, %ecx
ucomisd %xmm1, %xmm2
seta %cl
addl %ecx, %ebx
incq %rax
cmpq %rax, %rdx
jne 0x66a6
leaq 0x7877(%rip), %rdi      # 0xdf3d
movb $0x1, %al
callq 0x5ab4
leaq 0x7880(%rip), %rdi      # 0xdf54
movl %ebx, %esi
xorl %eax, %eax
callq 0x5ab4
movq 0x10(%rsp), %rdi
testl %edi, %edi
jle 0x67ad
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movsd 0x690d(%rip), %xmm1     # 0xd008
movsd 0x76a5(%rip), %xmm0     # 0xdda8
xorpd %xmm4, %xmm4
xorl %ecx, %ecx
xorpd %xmm2, %xmm2
xorpd %xmm3, %xmm3
movq 0x18(%rsp), %rbx
movsd 0x74fa(%rip), %xmm7     # 0xdc18
movq (%rax,%rcx,8), %rdx
movl (%rdx), %esi
xorpd %xmm5, %xmm5
cmpl $-0x1, %esi
je 0x674f
addq $0x10, %rdx
movslq %esi, %rsi
movsd -0x8(%r15,%rsi,8), %xmm6
mulsd -0x8(%rdx), %xmm6
addsd %xmm6, %xmm5
movl (%rdx), %esi
addq $0x10, %rdx
cmpl $-0x1, %esi
jne 0x6731
movsd (%rbp,%rcx,8), %xmm6
ucomisd %xmm7, %xmm6
jne 0x6763
jp 0x6763
maxsd %xmm5, %xmm0
jmp 0x6779
ucomisd %xmm4, %xmm6
jne 0x6771
jp 0x6771
minsd %xmm5, %xmm1
jmp 0x6779
addsd %xmm7, %xmm3
addsd %xmm5, %xmm2
incq %rcx
cmpq %rdi, %rcx
jne 0x671e
addsd %xmm0, %xmm1
mulsd 0x747b(%rip), %xmm1     # 0xdc08
jmp 0x67c2
leaq 0x77a7(%rip), %rdi      # 0xdf3d
movb $0x1, %al
callq 0x5ab4
leaq 0x77b0(%rip), %rdi      # 0xdf54
xorl %esi, %esi
xorl %eax, %eax
callq 0x5ab4
movsd 0x75fb(%rip), %xmm1     # 0xddb0
xorpd %xmm3, %xmm3
xorpd %xmm2, %xmm2
movq 0x18(%rsp), %rbx
divsd %xmm3, %xmm2
xorpd %xmm0, %xmm0
cmpltsd %xmm3, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm1, %xmm0
orpd %xmm2, %xmm0
movlpd %xmm0, 0x70(%r14)
leaq 0x7d8a(%rip), %rdi      # 0xe572
movb $0x1, %al
callq 0x5ab4
movq 0x58(%rsp), %rdi
callq 0x21e0
movq %r12, %rdi
callq 0x21e0
movq %r13, %rdi
callq 0x21e0
movq %rbp, %rdi
callq 0x21e0
movq %rbx, %rdi
callq 0x21e0
movq 0x20(%rsp), %rdi
callq 0x21e0
jmp 0x6e74
xorl %r13d, %r13d
movq %r14, %r8
cmpl $0x2, %r13d
jne 0x6868
movl (%rbp), %eax
cmpl $-0x1, %eax
jne 0x6868
movl 0x4(%rbp), %ecx
cmpl $0x1, %ecx
jne 0x6868
rolq $0x20, (%r8)
movl %ecx, (%rbp)
movl %eax, 0x4(%rbp)
testl %edx, %edx
jle 0x6868
xorl %eax, %eax
xorl %ecx, %ecx
cmpl $0x0, (%rsi,%rax,4)
sete %cl
movl %ecx, (%rsi,%rax,4)
incq %rax
cmpq %rax, %rdx
jne 0x6854
movl %r13d, %r12d
movslq %r13d, %r14
leaq (,%r14,4), %r15
movq %r15, %rdi
movq %r8, 0x38(%rsp)
callq 0x21f0
movq 0x38(%rsp), %r8
movl $0x0, (%rax)
cmpl $0x2, %r13d
movq 0x60(%rsp), %rbx
jl 0x68b2
movl (%rax), %esi
leaq -0x1(%r12), %rcx
xorl %edx, %edx
addl (%r8,%rdx,4), %esi
movl %esi, 0x4(%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x68a2
movq 0x10(%rsp), %rsi
testl %esi, %esi
movq 0x50(%rsp), %r10
movq 0x18(%rsp), %rdi
jle 0x68e1
xorl %r9d, %r9d
movslq (%rdi,%r9,4), %rcx
movslq (%rax,%rcx,4), %rdx
movl %r9d, (%r10,%rdx,4)
incl %edx
movl %edx, (%rax,%rcx,4)
incq %r9
cmpq %r9, %rsi
jne 0x68c8
movl $0x0, (%rax)
cmpl $0x2, %r13d
jl 0x6906
movl (%rax), %esi
leaq -0x1(%r12), %rcx
xorl %edx, %edx
addl (%r8,%rdx,4), %esi
movl %esi, 0x4(%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x68f6
movq %rax, 0x20(%rsp)
callq 0x21a0
movl %r13d, 0x50(%rbx)
movq %r15, %rdi
callq 0x21f0
movq %rax, 0x60(%rbx)
testl %r13d, %r13d
jle 0x6936
xorl %ecx, %ecx
movl (%rbp,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %r12
jne 0x6927
shlq $0x3, %r14
movq %r14, 0x48(%rsp)
movq %r14, %rdi
callq 0x21f0
testl %r13d, %r13d
movq 0x8(%rsp), %rdx
jle 0x6965
movsd 0x10(%rdx), %xmm0
xorl %ecx, %ecx
movsd %xmm0, (%rax,%rcx,8)
incq %rcx
cmpq %rcx, %r12
jne 0x6958
cmpl $0x0, 0x18(%rdx)
movq %rax, 0x18(%rsp)
jle 0x69f4
movq 0xb665(%rip), %rbx      # 0x11fe0
leaq 0x75dc(%rip), %r15      # 0xdf5e
xorl %r14d, %r14d
movl $0x0, %esi
testl %r13d, %r13d
jle 0x69aa
movq 0x20(%rdx), %rcx
movl (%rcx,%r14,4), %ecx
xorl %esi, %esi
cmpl (%rbp,%rsi,4), %ecx
je 0x69aa
incq %rsi
cmpq %rsi, %r12
jne 0x6999
movl %r12d, %esi
cmpl %r13d, %esi
je 0x69d3
movq 0x28(%rdx), %rcx
movsd (%rcx,%r14,8), %xmm0
movl %esi, %ecx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
incq %r14
movslq 0x18(%rdx), %rcx
cmpq %rcx, %r14
jl 0x6985
jmp 0x69f4
movq (%rbx), %rdi
movq 0x20(%rdx), %rax
movl (%rax,%r14,4), %edx
movq %r15, %rsi
xorl %eax, %eax
callq 0x2220
movq 0x18(%rsp), %rax
movq 0x8(%rsp), %rdx
jmp 0x69c5
movq 0x30(%rsp), %rbx
shlq $0x3, %rbx
movq %rbx, %rdi
callq 0x21f0
movq %rax, %r15
movq 0x10(%rsp), %rsi
testl %esi, %esi
movq 0x50(%rsp), %rdi
jle 0x6a35
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
xorl %ecx, %ecx
movslq (%rdi,%rcx,4), %rdx
movq (%rax,%rdx,8), %rdx
movq %rdx, (%r15,%rcx,8)
incq %rcx
cmpq %rcx, %rsi
jne 0x6a21
movl %esi, 0x68(%rsp)
movq 0x28(%rsp), %rax
movl %eax, 0x6c(%rsp)
movq %rbx, %rdi
callq 0x21f0
movq %rax, 0x78(%rsp)
movq %rbx, %rdi
callq 0x21f0
movq 0x10(%rsp), %rsi
movq %rax, 0x70(%rsp)
testl %esi, %esi
movq 0x60(%rsp), %r14
jle 0x6a81
xorl %eax, %eax
movq (%r15,%rax,8), %rcx
movq 0x78(%rsp), %rdx
movq %rcx, (%rdx,%rax,8)
incq %rax
cmpq %rax, %rsi
jne 0x6a6c
movq 0x8(%rsp), %rax
cmpl $0x4, (%rax)
jne 0x6b8a
movq %r15, %rbx
movl %r13d, %eax
imull 0x28(%rsp), %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x21f0
movq 0x10(%rsp), %rdi
movq %rax, %r15
movq %rax, 0x58(%r14)
testl %r13d, %r13d
movq 0x38(%rsp), %r8
movq 0x20(%rsp), %r9
jle 0x6af4
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
movslq (%r8,%rcx,4), %rdx
testq %rdx, %rdx
jle 0x6aec
movslq (%r9,%rcx,4), %rsi
addq %rsi, %rdx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, (%rax,%rsi,8)
incq %rsi
cmpq %rdx, %rsi
jl 0x6adf
incq %rcx
cmpq %r12, %rcx
jne 0x6ac8
movq 0x8(%rsp), %rax
movsd 0x8(%rax), %xmm0
leaq 0x90(%rsp), %r12
movq 0x28(%rsp), %rax
movl %eax, 0x18(%r12)
movl %edi, 0x1c(%r12)
movl %r13d, 0x20(%r12)
movsd %xmm0, 0x28(%r12)
movl $0x186a0, 0x24(%r12)    # imm = 0x186A0
leaq 0x68(%rsp), %rax
movq %rax, 0x30(%r12)
testl %r13d, %r13d
movq $-0x1, %rax
movq 0x48(%rsp), %r13
cmovsq %rax, %r13
movq %r13, %rdi
callq 0x2030
movq %rax, (%r12)
movq %r13, %rdi
callq 0x2030
movq %rax, 0x10(%r12)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%r12)
movq %r12, %rdi
movq %r15, %rsi
callq 0x5000
leaq 0x90(%rsp), %rdi
callq 0x4e1e
movq %rbx, %rdi
jmp 0x6e2b
movq %r15, 0x48(%rsp)
cmpl $0x2, %r13d
jne 0x6bec
movq 0x58(%rsp), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, %r15
movq %rax, 0x58(%r14)
movq 0x38(%rsp), %rax
movl (%rax), %eax
movq 0x20(%rsp), %rcx
addl (%rcx), %eax
jle 0x6d9a
movq 0x70(%rsp), %rcx
movl %eax, %edx
xorl %eax, %eax
movabsq $0x3ff0000000000000, %rsi # imm = 0x3FF0000000000000
movq 0x10(%rsp), %rdi
movq %rsi, (%rcx,%rax,8)
incq %rax
cmpq %rax, %rdx
jne 0x6bd6
movq 0x28(%rsp), %rsi
jmp 0x6da6
movl %r13d, %eax
movq 0x28(%rsp), %rbx
imull %ebx, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, 0x40(%rsp)
movq %rax, 0x58(%r14)
movq 0x58(%rsp), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, %r15
testl %r13d, %r13d
movq 0x38(%rsp), %rax
movq 0x20(%rsp), %rcx
jle 0x6d88
movq %rbx, %rdi
leaq (,%rbx,8), %rdx
movq %rdx, 0x30(%rsp)
leaq (,%r12,8), %r13
movq $0x0, 0x10(%rsp)
movabsq $-0x4010000000000000, %r14 # imm = 0xBFF0000000000000
movabsq $0x3ff0000000000000, %r8 # imm = 0x3FF0000000000000
xorl %ebx, %ebx
movslq (%rcx,%rbx,4), %rdx
movl (%rax,%rbx,4), %ecx
addl %edx, %ecx
movl $0x0, %eax
testq %rdx, %rdx
jle 0x6c8d
movq 0x70(%rsp), %rsi
xorl %eax, %eax
movq %r14, (%rsi,%rax,8)
incq %rax
cmpq %rax, %rdx
jne 0x6c81
cmpl %ecx, %eax
jge 0x6cad
movq 0x70(%rsp), %rdx
movl %eax, %eax
movl %ecx, %ecx
movq 0x8(%rsp), %rsi
movq %r8, (%rdx,%rax,8)
incq %rax
cmpq %rax, %rcx
jne 0x6c9f
jmp 0x6cb2
movq 0x8(%rsp), %rsi
movl 0x68(%rsp), %ecx
cmpl %ecx, %eax
jge 0x6cd2
movl %eax, %edx
shlq $0x3, %rdx
addq 0x70(%rsp), %rdx
movq %r14, (%rdx)
addq $0x8, %rdx
incl %eax
cmpl %eax, %ecx
jg 0x6cc5
movq 0x40(%rsi), %rax
testq %rax, %rax
je 0x6cfd
testl %edi, %edi
jle 0x6d15
addq 0x10(%rsp), %rax
xorl %ecx, %ecx
movsd (%rax), %xmm0
movsd %xmm0, (%r15,%rcx,8)
incq %rcx
addq %r13, %rax
cmpq %rcx, %rdi
jne 0x6ce6
jmp 0x6d15
testl %edi, %edi
jle 0x6d15
movq %r15, %rdi
xorl %esi, %esi
movq 0x30(%rsp), %rdx
callq 0x20c0
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rax
movsd (%rax,%rbx,8), %xmm0
movsd 0x10(%rsi), %xmm1
leaq 0x68(%rsp), %rdi
movq %r15, %rdx
callq 0x6ebb
movq 0x28(%rsp), %rdi
testl %edi, %edi
movq 0x40(%rsp), %rdx
jle 0x6d59
movq %rdx, %rax
xorl %ecx, %ecx
movsd (%r15,%rcx,8), %xmm0
movsd %xmm0, (%rax)
incq %rcx
addq %r13, %rax
cmpq %rcx, %rdi
jne 0x6d44
incq %rbx
addq $0x8, 0x10(%rsp)
addq $0x8, %rdx
movq %rdx, 0x40(%rsp)
cmpq %r12, %rbx
movq 0x38(%rsp), %rax
movq 0x20(%rsp), %rcx
movabsq $0x3ff0000000000000, %r8 # imm = 0x3FF0000000000000
jne 0x6c67
movq %r15, %rdi
callq 0x21a0
movq 0x60(%rsp), %r14
jmp 0x6e26
xorl %eax, %eax
movq 0x28(%rsp), %rsi
movq 0x10(%rsp), %rdi
cmpl %edi, %eax
jge 0x6dc7
movq 0x70(%rsp), %rcx
movl %eax, %eax
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movq %rdx, (%rcx,%rax,8)
incq %rax
cmpq %rax, %rdi
jne 0x6dbb
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rax
testq %rax, %rax
je 0x6df0
testl %esi, %esi
jle 0x6e06
xorl %ecx, %ecx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%r15,%rcx,8)
incq %rcx
cmpq %rcx, %rsi
jne 0x6ddb
jmp 0x6e06
testl %esi, %esi
jle 0x6e06
leaq (,%rsi,8), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x20c0
movq 0x18(%rsp), %rax
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
leaq 0x68(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x6ebb
movq 0x48(%rsp), %rdi
callq 0x21a0
movq %rbp, %rdi
callq 0x21a0
movq 0x20(%rsp), %rdi
callq 0x21a0
movq 0x38(%rsp), %rdi
callq 0x21a0
movq 0x50(%rsp), %rdi
callq 0x21a0
movq 0x78(%rsp), %rdi
callq 0x21a0
movq 0x70(%rsp), %rdi
callq 0x21a0
movq 0x18(%rsp), %rdi
callq 0x21a0
movq %r14, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x4e1e
movq %rbx, %rdi
callq 0x2290