// File: qmmlib[P]QmmLibrary/tron.cpp
// Function: TRON::tron(double*, parameter const*, model const*, long)
void TRON::tron(double *w, const parameter *param, const struct model* model_, clock_t cpu_begin)
{
	// Parameters for updating the iterates.
	double eta0 = 1e-4, eta1 = 0.25, eta2 = 0.75;

	// Parameters for updating the trust region size delta.
	double sigma1 = 0.25, sigma2 = 0.5, sigma3 = 4;

	int n = fun_obj->get_nr_variable();
	int i, cg_iter;
	double delta, snorm, one=1.0;
	double alpha, f, fnew, prered, actred, gs;
	int search = 1, iter = 1, inc = 1;
	double *s = new double[n];
	double *r = new double[n];
	double *w_new = new double[n];
	double *g = new double[n];

	clock_t cpu_now;
	double cpu_time_elapsed;

	for (i=0; i<n; i++)
		w[i] = 0;

        f = fun_obj->fun(w);
	fun_obj->grad(w, g);
	delta = dnrm2_(&n, g, &inc);
	double gnorm1 = delta;
	double gnorm = gnorm1;

	if (gnorm <= eps*gnorm1)
		search = 0;

	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);																					
		iter = 0;
		double objective_value = fun_obj->fun(w);
		__QMMCHAT__
		cpu_begin += (clock() - cpu_now);
	}
	
	iter = 1;

	while (iter <= max_iter && search)
	{
		cg_iter = trcg(delta, g, s, r);

		memcpy(w_new, w, sizeof(double)*n);
		daxpy_(&n, &one, s, &inc, w_new, &inc);

		gs = ddot_(&n, g, &inc, s, &inc);
		prered = -0.5*(gs-ddot_(&n, s, &inc, r, &inc));
                fnew = fun_obj->fun(w_new);

		// Compute the actual reduction.
	        actred = f - fnew;

		// On the first iteration, adjust the initial step bound.
		snorm = dnrm2_(&n, s, &inc);
		if (iter == 1)
			delta = min(delta, snorm);

		// Compute prediction alpha*snorm of the step.
		if (fnew - f - gs <= 0)
			alpha = sigma3;
		else
			alpha = max(sigma1, -0.5*(gs/(fnew - f - gs)));

		// Update the trust region bound according to the ratio of actual to predicted reduction.
		if (actred < eta0*prered)
			delta = min(max(alpha, sigma1)*snorm, sigma2*delta);
		else if (actred < eta1*prered)
			delta = max(sigma1*delta, min(alpha*snorm, sigma2*delta));
		else if (actred < eta2*prered)
			delta = max(sigma1*delta, min(alpha*snorm, sigma3*delta));
		else
			delta = max(delta, min(alpha*snorm, sigma3*delta));

		if (param->chat_level == 0) {
			info("iter %2d act %5.3e pre %5.3e delta %5.3e f %5.3e |g| %5.3e CG %3d\n", iter, actred, prered, delta, f, gnorm, cg_iter);
		}
				
		if (actred > eta0*prered)
		{
			iter++;
			memcpy(w, w_new, sizeof(double)*n);
			f = fnew;
		        fun_obj->grad(w, g);

			gnorm = dnrm2_(&n, g, &inc);

			if(param->save_each_iter!=0) {char filenametosave[1024]; sprintf(filenametosave,"%s%d.model",param->save_each_iter,iter-1); 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 = f;
				iter--;
				__QMMCHAT__
				iter++;
				cpu_begin += (clock() - cpu_now);
			}

			if (gnorm <= eps*gnorm1)
				break;
		}
		if (f < -1.0e+32)
		{
			info("WARNING: f < -1.0e+32\n");
			break;
		}
		if (fabs(actred) <= 0 && prered <= 0)
		{
			info("WARNING: actred and prered <= 0\n");
			break;
		}
		if (fabs(actred) <= 1.0e-12*fabs(f) &&
		    fabs(prered) <= 1.0e-12*fabs(f))
		{
			info("WARNING: actred and prered too small\n");
			break;
		}
	}

	delete[] g;
	delete[] r;
	delete[] w_new;
	delete[] s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x970, %rsp            # imm = 0x970
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x920(%rbp)
movsd 0x1f736(%rip), %xmm0    # 0x250f8
movsd %xmm0, -0x30(%rbp)
movsd 0x1f719(%rip), %xmm0    # 0x250e8
movsd %xmm0, -0x38(%rbp)
movsd 0x1f714(%rip), %xmm0    # 0x250f0
movsd %xmm0, -0x40(%rbp)
movsd 0x1f6ff(%rip), %xmm0    # 0x250e8
movsd %xmm0, -0x48(%rbp)
movsd 0x1e62a(%rip), %xmm0    # 0x24020
movsd %xmm0, -0x50(%rbp)
movsd 0x1f6dd(%rip), %xmm0    # 0x250e0
movsd %xmm0, -0x58(%rbp)
movq 0x10(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movl %eax, -0x5c(%rbp)
movsd 0x1e60b(%rip), %xmm0    # 0x24028
movsd %xmm0, -0x80(%rbp)
movl $0x1, -0xb4(%rbp)
movl $0x1, -0xb8(%rbp)
movl $0x1, -0xbc(%rbp)
movslq -0x5c(%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, -0xc8(%rbp)
movslq -0x5c(%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, -0xd0(%rbp)
movslq -0x5c(%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, -0xd8(%rbp)
movslq -0x5c(%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, -0xe0(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x5b1a
movq -0x10(%rbp), %rax
movslq -0x60(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x5af7
movq -0x920(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
movq -0x920(%rbp), %rax
movsd %xmm0, -0x90(%rbp)
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0xe0(%rbp), %rdx
movq (%rdi), %rax
callq *0x8(%rax)
movq -0xe0(%rbp), %rsi
leaq -0x5c(%rbp), %rdi
leaq -0xbc(%rbp), %rdx
callq 0x22df0
movq -0x920(%rbp), %rax
movsd %xmm0, -0x70(%rbp)
movsd -0x70(%rbp), %xmm0
movsd %xmm0, -0xf8(%rbp)
movsd -0xf8(%rbp), %xmm0
movsd %xmm0, -0x100(%rbp)
movsd -0x100(%rbp), %xmm1
movsd (%rax), %xmm0
mulsd -0xf8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x5bb6
movl $0x0, -0xb4(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x5bf0
leaq -0x500(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdx
leaq 0x1f559(%rip), %rsi     # 0x25130
xorl %ecx, %ecx
movb $0x0, %al
callq 0x30a0
leaq -0x500(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xe810
movq -0x18(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jle 0x5d71
callq 0x3180
movq %rax, %rcx
movq -0x920(%rbp), %rax
movq %rcx, -0xe8(%rbp)
movq -0xe8(%rbp), %rcx
subq -0x28(%rbp), %rcx
cvtsi2sd %rcx, %xmm0
movsd 0x1e3dc(%rip), %xmm1    # 0x24008
divsd %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
movl $0x0, -0xb8(%rbp)
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
movsd %xmm0, -0x508(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jle 0x5d5d
movq -0x920(%rbp), %rdi
movl -0xb8(%rbp), %edx
movsd -0xf0(%rbp), %xmm0
leaq 0x1f4ba(%rip), %rsi     # 0x2513b
movb $0x1, %al
callq 0x5820
movq -0x18(%rbp), %rax
cmpl $0x1, 0x40(%rax)
jle 0x5d48
movq -0x18(%rbp), %rax
cmpl $0x2, 0x40(%rax)
jle 0x5d46
movq -0x920(%rbp), %rdi
movsd -0x508(%rbp), %xmm0
leaq 0x1f499(%rip), %rsi     # 0x25153
movb $0x1, %al
callq 0x5820
movq -0x18(%rbp), %rax
cmpl $0x3, 0x40(%rax)
jle 0x5d44
movq -0x18(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x5cf8
movq 0x252fb(%rip), %rax     # 0x2afd8
movq (%rax), %rdi
leaq 0x1f481(%rip), %rsi     # 0x25168
movb $0x0, %al
callq 0x3400
movl $0x1, %edi
callq 0x3380
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x20fa0
movq -0x920(%rbp), %rdi
leaq 0x1f48b(%rip), %rsi     # 0x251a2
movb $0x1, %al
callq 0x5820
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x20fa0
movq -0x920(%rbp), %rdi
leaq 0x1f475(%rip), %rsi     # 0x251b2
movb $0x1, %al
callq 0x5820
jmp 0x5d46
jmp 0x5d48
movq -0x920(%rbp), %rdi
leaq 0x1f2d7(%rip), %rsi     # 0x2502d
movb $0x0, %al
callq 0x5820
callq 0x3180
subq -0xe8(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x1, -0xb8(%rbp)
movq -0x920(%rbp), %rdx
movl -0xb8(%rbp), %ecx
xorl %eax, %eax
cmpl 0x8(%rdx), %ecx
movb %al, -0x921(%rbp)
jg 0x5da5
cmpl $0x0, -0xb4(%rbp)
setne %al
movb %al, -0x921(%rbp)
movb -0x921(%rbp), %al
testb $0x1, %al
jne 0x5db4
jmp 0x648e
movq -0x920(%rbp), %rdi
movsd -0x70(%rbp), %xmm0
movq -0xe0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
movq -0xd0(%rbp), %rcx
callq 0x6520
movl %eax, -0x64(%rbp)
movq -0xd8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x5c(%rbp), %rdx
shlq $0x3, %rdx
callq 0x3230
movq -0xc8(%rbp), %rdx
movq -0xd8(%rbp), %r8
leaq -0x5c(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0xbc(%rbp), %r9
movq %r9, %rcx
callq 0x22f90
movq -0xe0(%rbp), %rsi
movq -0xc8(%rbp), %rcx
leaq -0x5c(%rbp), %rdi
leaq -0xbc(%rbp), %r8
movq %r8, %rdx
callq 0x23210
movsd %xmm0, -0xb0(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0x930(%rbp)
movq -0xc8(%rbp), %rsi
movq -0xd0(%rbp), %rcx
leaq -0x5c(%rbp), %rdi
leaq -0xbc(%rbp), %r8
movq %r8, %rdx
callq 0x23210
movsd -0x930(%rbp), %xmm1
movq -0x920(%rbp), %rax
subsd %xmm0, %xmm1
movsd 0x1f271(%rip), %xmm0    # 0x25100
mulsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
movq 0x10(%rax), %rdi
movq -0xd8(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
movsd %xmm0, -0x98(%rbp)
movsd -0x90(%rbp), %xmm0
subsd -0x98(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
movq -0xc8(%rbp), %rsi
leaq -0x5c(%rbp), %rdi
leaq -0xbc(%rbp), %rdx
callq 0x22df0
movsd %xmm0, -0x78(%rbp)
cmpl $0x1, -0xb8(%rbp)
jne 0x5f04
movsd -0x70(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
callq 0x69e0
movsd %xmm0, -0x70(%rbp)
movsd -0x98(%rbp), %xmm1
subsd -0x90(%rbp), %xmm1
subsd -0xb0(%rbp), %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x5f34
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
jmp 0x5f76
movsd -0x48(%rbp), %xmm0
movsd -0xb0(%rbp), %xmm2
movsd -0x98(%rbp), %xmm1
subsd -0x90(%rbp), %xmm1
subsd -0xb0(%rbp), %xmm1
divsd %xmm1, %xmm2
movsd 0x1f19b(%rip), %xmm1    # 0x25100
mulsd %xmm2, %xmm1
callq 0x6a20
movsd %xmm0, -0x88(%rbp)
movsd -0xa8(%rbp), %xmm1
movsd -0x30(%rbp), %xmm0
mulsd -0xa0(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x5fc1
movsd -0x88(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
callq 0x6a20
mulsd -0x78(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
mulsd -0x70(%rbp), %xmm1
callq 0x69e0
movsd %xmm0, -0x70(%rbp)
jmp 0x60c6
movsd -0xa8(%rbp), %xmm1
movsd -0x38(%rbp), %xmm0
mulsd -0xa0(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x6024
movsd -0x48(%rbp), %xmm0
mulsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x938(%rbp)
movsd -0x88(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
mulsd -0x70(%rbp), %xmm1
callq 0x69e0
movaps %xmm0, %xmm1
movsd -0x938(%rbp), %xmm0
callq 0x6a20
movsd %xmm0, -0x70(%rbp)
jmp 0x60c4
movsd -0xa8(%rbp), %xmm1
movsd -0x40(%rbp), %xmm0
mulsd -0xa0(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x6084
movsd -0x48(%rbp), %xmm0
mulsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x940(%rbp)
movsd -0x88(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd -0x58(%rbp), %xmm1
mulsd -0x70(%rbp), %xmm1
callq 0x69e0
movaps %xmm0, %xmm1
movsd -0x940(%rbp), %xmm0
callq 0x6a20
movsd %xmm0, -0x70(%rbp)
jmp 0x60c2
movsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x948(%rbp)
movsd -0x88(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd -0x58(%rbp), %xmm1
mulsd -0x70(%rbp), %xmm1
callq 0x69e0
movaps %xmm0, %xmm1
movsd -0x948(%rbp), %xmm0
callq 0x6a20
movsd %xmm0, -0x70(%rbp)
jmp 0x60c4
jmp 0x60c6
movq -0x18(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jne 0x6113
movq -0x920(%rbp), %rdi
movl -0xb8(%rbp), %edx
movsd -0xa8(%rbp), %xmm0
movsd -0xa0(%rbp), %xmm1
movsd -0x70(%rbp), %xmm2
movsd -0x90(%rbp), %xmm3
movsd -0x100(%rbp), %xmm4
movl -0x64(%rbp), %ecx
leaq 0x1f0b5(%rip), %rsi     # 0x251c1
movb $0x5, %al
callq 0x5820
movsd -0xa8(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd -0xa0(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x6393
movl -0xb8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb8(%rbp)
movq -0x10(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movslq -0x5c(%rbp), %rdx
shlq $0x3, %rdx
callq 0x3230
movq -0x920(%rbp), %rax
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0xe0(%rbp), %rdx
movq (%rdi), %rax
callq *0x8(%rax)
movq -0xe0(%rbp), %rsi
leaq -0x5c(%rbp), %rdi
leaq -0xbc(%rbp), %rdx
callq 0x22df0
movsd %xmm0, -0x100(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x61e5
leaq -0x910(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdx
movl -0xb8(%rbp), %ecx
subl $0x1, %ecx
leaq 0x1ef62(%rip), %rsi     # 0x25130
movb $0x0, %al
callq 0x30a0
leaq -0x910(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xe810
movq -0x18(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jle 0x636b
callq 0x3180
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
subq -0x28(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x1ddf1(%rip), %xmm1    # 0x24008
divsd %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x918(%rbp)
movl -0xb8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xb8(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jle 0x6348
movq -0x920(%rbp), %rdi
movl -0xb8(%rbp), %edx
movsd -0xf0(%rbp), %xmm0
leaq 0x1eecf(%rip), %rsi     # 0x2513b
movb $0x1, %al
callq 0x5820
movq -0x18(%rbp), %rax
cmpl $0x1, 0x40(%rax)
jle 0x6333
movq -0x18(%rbp), %rax
cmpl $0x2, 0x40(%rax)
jle 0x6331
movq -0x920(%rbp), %rdi
movsd -0x918(%rbp), %xmm0
leaq 0x1eeae(%rip), %rsi     # 0x25153
movb $0x1, %al
callq 0x5820
movq -0x18(%rbp), %rax
cmpl $0x3, 0x40(%rax)
jle 0x632f
movq -0x18(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x62e3
movq 0x24d10(%rip), %rax     # 0x2afd8
movq (%rax), %rdi
leaq 0x1ee96(%rip), %rsi     # 0x25168
movb $0x0, %al
callq 0x3400
movl $0x1, %edi
callq 0x3380
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x20fa0
movq -0x920(%rbp), %rdi
leaq 0x1eea0(%rip), %rsi     # 0x251a2
movb $0x1, %al
callq 0x5820
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x20fa0
movq -0x920(%rbp), %rdi
leaq 0x1ee8a(%rip), %rsi     # 0x251b2
movb $0x1, %al
callq 0x5820
jmp 0x6331
jmp 0x6333
movq -0x920(%rbp), %rdi
leaq 0x1ecec(%rip), %rsi     # 0x2502d
movb $0x0, %al
callq 0x5820
movl -0xb8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb8(%rbp)
callq 0x3180
subq -0xe8(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x920(%rbp), %rax
movsd -0x100(%rbp), %xmm1
movsd (%rax), %xmm0
mulsd -0xf8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x6391
jmp 0x648e
jmp 0x6393
movsd 0x1ed6d(%rip), %xmm0    # 0x25108
ucomisd -0x90(%rbp), %xmm0
jbe 0x63bf
movq -0x920(%rbp), %rdi
leaq 0x1ee51(%rip), %rsi     # 0x25204
movb $0x0, %al
callq 0x5820
jmp 0x648e
movsd -0xa8(%rbp), %xmm1
movaps 0x1ed52(%rip), %xmm0    # 0x25120
pand %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x6402
xorps %xmm0, %xmm0
ucomisd -0xa0(%rbp), %xmm0
jb 0x6402
movq -0x920(%rbp), %rdi
leaq 0x1ee25(%rip), %rsi     # 0x2521b
movb $0x0, %al
callq 0x5820
jmp 0x648e
movsd -0xa8(%rbp), %xmm1
movaps 0x1ed0f(%rip), %xmm0    # 0x25120
pand %xmm0, %xmm1
movsd -0x90(%rbp), %xmm2
movaps 0x1ecfc(%rip), %xmm0    # 0x25120
pand %xmm0, %xmm2
movsd 0x1ece0(%rip), %xmm0    # 0x25110
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x6489
movsd -0xa0(%rbp), %xmm1
movaps 0x1ecd7(%rip), %xmm0    # 0x25120
pand %xmm0, %xmm1
movsd -0x90(%rbp), %xmm2
movaps 0x1ecc4(%rip), %xmm0    # 0x25120
pand %xmm0, %xmm2
movsd 0x1eca8(%rip), %xmm0    # 0x25110
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x6489
movq -0x920(%rbp), %rdi
leaq 0x1edbc(%rip), %rsi     # 0x2523c
movb $0x0, %al
callq 0x5820
jmp 0x648e
jmp 0x5d7b
movq -0xe0(%rbp), %rax
movq %rax, -0x950(%rbp)
cmpq $0x0, %rax
je 0x64ae
movq -0x950(%rbp), %rdi
callq 0x33b0
movq -0xd0(%rbp), %rax
movq %rax, -0x958(%rbp)
cmpq $0x0, %rax
je 0x64ce
movq -0x958(%rbp), %rdi
callq 0x33b0
movq -0xd8(%rbp), %rax
movq %rax, -0x960(%rbp)
cmpq $0x0, %rax
je 0x64ee
movq -0x960(%rbp), %rdi
callq 0x33b0
movq -0xc8(%rbp), %rax
movq %rax, -0x968(%rbp)
cmpq $0x0, %rax
je 0x650e
movq -0x968(%rbp), %rdi
callq 0x33b0
addq $0x970, %rsp            # imm = 0x970
popq %rbp
retq
nopw (%rax,%rax)