// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSlicedA.cpp
// Function: HMMProblemSlicedA::doConjugateLinearStep(FitBitSlicedA*)
NUMBER HMMProblemSlicedA::doConjugateLinearStep(FitBitSlicedA *fb) {
	NPAR i=0, j=0, m=0, z=0;
    NPAR nS = this->p->nS, nO = this->p->nO, nZ = this->p->nZ;
	// first scale down gradients
    fb->doLog10ScaleGentle(FBS_GRAD);
    
    // compute beta_gradient_direction
    NUMBER beta_grad = 0, beta_grad_num = 0, beta_grad_den = 0;
    
    switch (this->p->solver_setting) {
        case 1: // Fletcher-Reeves
            for(i=0; i<nS; i++)
            {
                if(fb->pi != NULL) {
                    beta_grad_num += fb->gradPI  [i]*fb->gradPI   [i];
                    beta_grad_den += fb->gradPIm1[i]*fb->gradPIm1[i];
                }
                if(fb->A  != NULL)
                    for(z=0; z<nZ; z++)
                        for(j=0; j<nS; j++) {
                            beta_grad_num += fb->gradA  [z][i][j]*fb->gradA  [z][i][j];
                            beta_grad_den += fb->gradAm1[z][i][j]*fb->gradAm1[z][i][j];
                        }
                if(fb->B  != NULL)
                    for(m=0; m<nO; m++) {
                        beta_grad_num += fb->gradB  [i][m]*fb->gradB  [i][m];
                        beta_grad_den += fb->gradBm1[i][m]*fb->gradBm1[i][m];
                    }
            }
            break;
        case 2: // Polak–Ribiere
            for(i=0; i<nS; i++)
            {
                if(fb->pi != NULL) {
                    beta_grad_num += -fb->gradPI  [i]*(-fb->gradPI  [i] + fb->gradPIm1[i]);
                    beta_grad_den +=  fb->gradPIm1[i]*  fb->gradPIm1[i];
                }
                if(fb->A != NULL)
                    for(z=0; z<nZ; z++)
                        for(j=0; j<nS; j++) {
                            beta_grad_num += -fb->gradA  [z][i][j]*(-fb->gradA[z][i][j] + fb->gradAm1[z][i][j]);
                            beta_grad_den +=  fb->gradAm1[z][i][j]*fb->gradAm1[z][i][j];
                        }
                if(fb->B  != NULL)
                    for(m=0; m<nO; m++) {
                        beta_grad_num += -fb->gradB  [i][j]*(-fb->gradB  [i][j] + fb->gradBm1[i][j]);
                        beta_grad_den +=  fb->gradBm1[i][m]*  fb->gradBm1[i][m];
                    }
            }
            break;
        case 3: // Hestenes-Stiefel
            for(i=0; i<nS; i++)
            {
                if(fb->pi != NULL) {
                    beta_grad_num += -fb->gradPI [i]*(-fb->gradPI[i] + fb->gradPIm1[i]);
                    beta_grad_den +=  fb->dirPIm1[i]*(-fb->gradPI[i] + fb->gradPIm1[i]);
                }
                if(fb->A  != NULL)
                    for(z=0; z<nZ; z++)
                        for(j=0; j<nS; j++) {
                            beta_grad_num += -fb->gradA [z][i][j]*(-fb->gradA[z][i][j] + fb->gradAm1[z][i][j]);
                            beta_grad_den +=  fb->dirAm1[z][i][j]*(-fb->gradA[z][i][j] + fb->gradAm1[z][i][j]);
                        }
                if(fb->B  != NULL)
                    for(m=0; m<nO; m++) {
                        beta_grad_num += -fb->gradB [i][j]*(-fb->gradB[i][j] + fb->gradBm1[i][j]);
                        beta_grad_den +=  fb->dirBm1[i][m]*(-fb->gradB[i][j] + fb->gradBm1[i][j]);
                    }
            }
            break;
        case 4: // Dai-Yuan
            for(i=0; i<nS; i++)
            {
                if(fb->pi != NULL) {
                    beta_grad_num += -fb->gradPI  [i]*fb->gradPI  [i];
                    beta_grad_den +=  fb->dirPIm1[i]*(-fb->gradPI[i] + fb->gradPIm1[i]);
                }
                if(fb->A  != NULL)
                    for(j=0; j<nS; j++)
                        for(z=0; z<nZ; z++){
                            beta_grad_num += -fb->gradA [z][i][j]*fb->gradA  [z][i][j];
                            beta_grad_den +=  fb->dirAm1[z][i][j]*(-fb->gradA[z][i][j] + fb->gradAm1[z][i][j]);
                        }
                if(fb->B  != NULL)
                    for(m=0; m<nO; m++) {
                        beta_grad_num += -fb->gradB [i][m]*fb->gradB  [i][m];
                        beta_grad_den +=  fb->dirBm1[i][m]*(-fb->gradB[i][j] + fb->gradBm1[i][j]);
                    }
            }
            break;
        default:
            fprintf(stderr,"Wrong stepping algorithm (%d) specified for Conjugate Gradient Descent\n",this->p->solver_setting);
            break;
    }
    beta_grad = beta_grad_num / safe0num(beta_grad_den);
    beta_grad = (beta_grad>=0)?beta_grad:0;
	
    // compute new direction (in place of old)
	for(i=0; i<nS; i++)
	{
        if(fb->pi != NULL) {
            fb->dirPIm1[i] = -fb->gradPI[i] + beta_grad * fb->dirPIm1[i];
        }
        if(fb->A  != NULL) {
            for(z=0; z<nZ; z++) {
                for(j=0; j<nS; j++) {
                    fb->dirAm1[z][i][j] = -fb->gradA[z][i][j] + beta_grad * fb->dirAm1[z][i][j];
                }
            }
        }
        if(fb->B  != NULL) {
            for(m=0; m<nO; m++) {
                fb->dirBm1[i][m] = -fb->gradB[i][m] + beta_grad * fb->dirBm1[i][m];
            }
        }
	}
	// scale down direction
    fb->doLog10ScaleGentle(FBS_DIRm1);
    
    fb->init(FBS_PARcopy);
    
	NUMBER e = this->p->ArmijoSeed; // step seed
	bool compliesArmijo = false;
	NUMBER f_xk = HMMProblemSlicedA::getSumLogPOPara(fb->xndat, fb->x_data);
	NUMBER f_xkplus1 = 0;
	
    fb->copy(FBS_PAR, FBS_PARcopy);
	// compute p_k * -p_k >>>> now current gradient by current direction
	NUMBER p_k_by_neg_p_k = 0;
	for(i=0; i<nS; i++)
	{
        if(fb->pi != NULL) {
            p_k_by_neg_p_k = fb->gradPI[i]*fb->dirPIm1[i];
        }
        if(fb->A  != NULL) {
            for(z=0; z<nZ; z++) {
                for(j=0; j<nS; j++) {
                    p_k_by_neg_p_k = fb->gradA[z][i][j]*fb->dirAm1[z][i][j];
                }
            }
        }
        if(fb->B  != NULL) {
            for(m=0; m<nO; m++) {
                p_k_by_neg_p_k = fb->gradB[i][m]*fb->dirBm1[i][m];
            }
        }
	}
	int iter = 0; // limit iter steps to 20, actually now 10, via ArmijoMinStep
	while( !compliesArmijo && e > this->p->ArmijoMinStep) {
		// update
		for(i=0; i<nS; i++) {
            if(fb->pi != NULL) {
                fb->pi[i] = fb->PIcopy[i] + e * fb->dirPIm1[i];
            }
            if(fb->A  != NULL) {
                for(z=0; z<nZ; z++) {
                    for(j=0; j<nS; j++) {
                        fb->A[z][i][j] = fb->Acopy[z][i][j] + e * fb->dirAm1[z][i][j];
                    }
                }
            }
            if(fb->B  != NULL) {
                for(m=0; m<nO; m++) {
                    fb->B[i][m] = fb->Bcopy[i][m] + e * fb->dirBm1[i][m];
                }
            }
		}
		// scale
		if( !this->hasNon01Constraints() ) {
            if(fb->pi != NULL) {
                projectsimplex(fb->pi, nS);
            }
            for(i=0; i<nS; i++) {
                if(fb->A != NULL) {
                    for(z=0; z<nZ; z++) {
                        projectsimplex(fb->A[z][i], nS);
                    }
                }
                if(fb->B != NULL) {
                    projectsimplex(fb->B[i], nS);
                }
			}
		} else {
            if(fb->pi != NULL) {
                projectsimplexbounded(fb->pi, this->getLbPI(), this->getUbPI(), nS);
            }
            for(i=0; i<nS; i++) {
                if(fb->A != NULL) {
                    for(z=0; z<nZ; z++) {
                        projectsimplexbounded(fb->A[z][i], this->getLbA()[z][i], this->getUbA()[z][i], nS); // tag is currently fit slice
                    }
                }
                if(fb->B != NULL) {
                    projectsimplexbounded(fb->B[i], this->getLbB()[i], this->getUbB()[i], nS);
                }
            }
		}
		// recompute alpha and p(O|param)
		computeAlphaAndPOParam(fb->xndat, fb->x_data);
		// compute f(x_{k+1})
		f_xkplus1 = HMMProblemSlicedA::getSumLogPOPara(fb->xndat, fb->x_data);
		// compute Armijo compliance
		compliesArmijo = (f_xkplus1 <= (f_xk + (this->p->ArmijoC1 * e * p_k_by_neg_p_k)));
		e /= (compliesArmijo)?1:this->p->ArmijoReduceFactor;
		iter++;
	} // armijo loop
    if(!compliesArmijo) { // failed to step away from initial, reinstate the inital parameters
        e = 0;
        fb->copy(FBS_PARcopy, FBS_PAR);
    }
    //    RecycleFitData(xndat, x_data, this->p);
    fb->destroy(FBS_PARcopy);
    return f_xkplus1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r12
movq %rdi, %rbx
movq 0x88(%rdi), %rax
movb 0x8b8(%rax), %cl
movq %rcx, 0x8(%rsp)
movzbl %cl, %r13d
movzbl 0x8b9(%rax), %r15d
movzbl 0x8c8(%rax), %ebp
movq %rsi, %rdi
movl $0x3, %esi
callq 0xc728
movq 0x88(%rbx), %rax
movzbl 0x40(%rax), %eax
leal -0x1(%rax), %ecx
cmpl $0x3, %ecx
movq %r12, 0x20(%rsp)
movq %rbx, 0x10(%rsp)
ja 0x2e135
leaq 0x70b0(%rip), %rax      # 0x34cc8
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpb $0x0, 0x8(%rsp)
jle 0x2e150
cmpq $0x0, 0x18(%r12)
sete %sil
testb %bpl, %bpl
setle %al
cmpq $0x0, 0x20(%r12)
movq 0x10(%r12), %rcx
sete %dil
testb %r15b, %r15b
setle %dl
orb %sil, %al
orb %dil, %dl
xorpd %xmm6, %xmm6
xorl %esi, %esi
testq %rcx, %rcx
je 0x2dc7f
movq 0x58(%r12), %rdi
movq 0x70(%r12), %r8
movsd (%rdi,%rsi,8), %xmm0
movhpd (%r8,%rsi,8), %xmm0     # xmm0 = xmm0[0],mem[0]
mulpd %xmm0, %xmm0
addpd %xmm0, %xmm6
testb %al, %al
jne 0x2dcc6
movq 0x60(%r12), %rdi
movq 0x78(%r12), %r8
xorl %r9d, %r9d
movq (%rdi,%r9,8), %r10
movq (%r10,%rsi,8), %r10
movq (%r8,%r9,8), %r11
movq (%r11,%rsi,8), %r11
xorl %ebx, %ebx
movsd (%r10,%rbx,8), %xmm0
movhpd (%r11,%rbx,8), %xmm0    # xmm0 = xmm0[0],mem[0]
mulpd %xmm0, %xmm0
addpd %xmm0, %xmm6
incq %rbx
cmpq %rbx, %r13
jne 0x2dca2
incq %r9
cmpq %rbp, %r9
jne 0x2dc90
testb %dl, %dl
je 0x2dcd1
movq 0x10(%rsp), %rbx
jmp 0x2dd0a
movq 0x68(%r12), %rdi
movq 0x80(%r12), %r8
movq (%rdi,%rsi,8), %rdi
movq (%r8,%rsi,8), %r8
xorl %r9d, %r9d
movq 0x10(%rsp), %rbx
movsd (%rdi,%r9,8), %xmm0
movhpd (%r8,%r9,8), %xmm0      # xmm0 = xmm0[0],mem[0]
mulpd %xmm0, %xmm0
addpd %xmm0, %xmm6
incq %r9
cmpq %r9, %r15
jne 0x2dcee
incq %rsi
cmpq %r13, %rsi
jne 0x2dc5d
jmp 0x2e154
cmpb $0x0, 0x8(%rsp)
jle 0x2e150
movq 0x10(%r12), %rax
cmpq $0x0, 0x18(%r12)
sete %sil
testb %bpl, %bpl
setle %cl
cmpq $0x0, 0x20(%r12)
sete %dil
testb %r15b, %r15b
setle %dl
orb %sil, %cl
orb %dil, %dl
xorpd %xmm6, %xmm6
xorl %esi, %esi
movapd 0x5be1(%rip), %xmm0     # 0x33940
xorl %edi, %edi
testq %rax, %rax
je 0x2dd9e
movq 0x58(%r12), %r8
movq 0x70(%r12), %r9
movsd (%r8,%rsi,8), %xmm1
movsd (%r9,%rsi,8), %xmm2
subsd %xmm1, %xmm2
xorpd %xmm0, %xmm1
movq 0xb8(%r12), %r8
movhpd (%r8,%rsi,8), %xmm1     # xmm1 = xmm1[0],mem[0]
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm1, %xmm2
addpd %xmm2, %xmm6
testb %cl, %cl
jne 0x2de17
movq 0x60(%r12), %rdi
movq 0x78(%r12), %r8
movq 0xc0(%r12), %r9
xorl %r10d, %r10d
movq (%rdi,%r10,8), %r11
movq (%r11,%rsi,8), %r11
movq (%r8,%r10,8), %rbx
movq (%rbx,%rsi,8), %rbx
movq (%r9,%r10,8), %r14
movq (%r14,%rsi,8), %r14
xorl %r12d, %r12d
movsd (%r11,%r12,8), %xmm1
movsd (%rbx,%r12,8), %xmm2
subsd %xmm1, %xmm2
xorpd %xmm0, %xmm1
movhpd (%r14,%r12,8), %xmm1    # xmm1 = xmm1[0],mem[0]
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm1, %xmm2
addpd %xmm2, %xmm6
incq %r12
cmpq %r12, %r13
jne 0x2ddd2
incq %r10
cmpq %rbp, %r10
jne 0x2ddb7
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %r12
movq 0x10(%rsp), %rbx
testb %dl, %dl
jne 0x2de75
movq 0x68(%r12), %r8
movq 0x80(%r12), %r9
movq (%r8,%rsi,8), %r8
movsbq %dil, %r10
movsd (%r8,%r10,8), %xmm1
movq (%r9,%rsi,8), %r8
movsd (%r8,%r10,8), %xmm2
subsd %xmm1, %xmm2
xorpd %xmm0, %xmm1
movq 0xc8(%r12), %r8
movq (%r8,%rsi,8), %r8
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
xorl %r9d, %r9d
movapd %xmm1, %xmm3
movhpd (%r8,%r9,8), %xmm3      # xmm3 = xmm3[0],mem[0]
mulpd %xmm2, %xmm3
addpd %xmm3, %xmm6
incq %r9
cmpq %r9, %r15
jne 0x2de5b
incq %rsi
cmpq %r13, %rsi
jne 0x2dd61
jmp 0x2e154
cmpb $0x0, 0x8(%rsp)
jle 0x2e150
movq 0x10(%r12), %rax
movq 0x18(%r12), %rcx
cmpq $0x0, 0x20(%r12)
sete %sil
testb %r15b, %r15b
setle %dl
orb %sil, %dl
xorpd %xmm6, %xmm6
xorl %esi, %esi
movapd 0x5a84(%rip), %xmm0     # 0x33940
xorl %edi, %edi
testq %rax, %rax
je 0x2deff
movq 0x58(%r12), %r8
movq 0x70(%r12), %r9
movsd (%r8,%rsi,8), %xmm1
movapd %xmm1, %xmm2
xorpd %xmm0, %xmm2
movq 0xb8(%r12), %r8
movsd (%r9,%rsi,8), %xmm3
movhpd (%r8,%rsi,8), %xmm2     # xmm2 = xmm2[0],mem[0]
subsd %xmm1, %xmm3
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
mulpd %xmm2, %xmm1
addpd %xmm1, %xmm6
testq %rcx, %rcx
je 0x2df7a
xorl %edi, %edi
testb %bpl, %bpl
jle 0x2df68
movq 0x60(%r12), %r8
movq 0x78(%r12), %r9
movq 0xc0(%r12), %r10
xorl %r11d, %r11d
movq (%r8,%r11,8), %rbx
movq (%rbx,%rsi,8), %rbx
movsd (%rbx,%rdi,8), %xmm1
movapd %xmm1, %xmm2
xorpd %xmm0, %xmm2
movq (%r10,%r11,8), %rbx
movq (%rbx,%rsi,8), %rbx
movq (%r9,%r11,8), %r14
movq (%r14,%rsi,8), %r14
movsd (%r14,%rdi,8), %xmm3
subsd %xmm1, %xmm3
movhpd (%rbx,%rdi,8), %xmm2    # xmm2 = xmm2[0],mem[0]
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
mulpd %xmm2, %xmm1
addpd %xmm1, %xmm6
incq %r11
cmpq %r11, %rbp
jne 0x2df20
incq %rdi
cmpq %r13, %rdi
jne 0x2df06
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rbx
testb %dl, %dl
jne 0x2dfda
movq 0x68(%r12), %r8
movq 0x80(%r12), %r10
movq (%r8,%rsi,8), %r8
movq 0xc8(%r12), %r9
movq (%r9,%rsi,8), %r9
movsbq %dil, %r11
movq (%r10,%rsi,8), %r10
movsd (%r10,%r11,8), %xmm1
subsd (%r8,%r11,8), %xmm1
xorl %r10d, %r10d
movsd (%r8,%r10,8), %xmm2
movapd %xmm2, %xmm3
xorpd %xmm0, %xmm3
movhpd (%r9,%r10,8), %xmm3     # xmm3 = xmm3[0],mem[0]
unpcklpd %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
mulpd %xmm3, %xmm2
addpd %xmm2, %xmm6
incq %r10
cmpq %r10, %r15
jne 0x2dfb2
incq %rsi
cmpq %r13, %rsi
jne 0x2debe
jmp 0x2e154
cmpb $0x0, 0x8(%rsp)
jle 0x2e150
movq 0x10(%r12), %rax
cmpq $0x0, 0x18(%r12)
sete %sil
testb %bpl, %bpl
setle %cl
cmpq $0x0, 0x20(%r12)
sete %dil
testb %r15b, %r15b
setle %dl
orb %sil, %cl
orb %dil, %dl
xorpd %xmm6, %xmm6
xorl %esi, %esi
movapd 0x5911(%rip), %xmm0     # 0x33940
xorl %edi, %edi
testq %rax, %rax
je 0x2e068
movq 0x58(%r12), %r8
movq 0x70(%r12), %r9
movsd (%r8,%rsi,8), %xmm1
movsd (%r9,%rsi,8), %xmm2
movapd %xmm2, %xmm3
subsd %xmm1, %xmm3
xorpd %xmm0, %xmm1
unpcklpd %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0]
unpcklpd %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0]
mulpd %xmm1, %xmm3
addpd %xmm3, %xmm6
testb %cl, %cl
jne 0x2e0cd
movq 0x60(%r12), %rdi
movq 0x78(%r12), %r8
xorl %r9d, %r9d
movq (%rdi,%r9,8), %r10
movq (%r10,%rsi,8), %r10
movq (%r8,%r9,8), %r11
movq (%r11,%rsi,8), %r11
xorl %ebx, %ebx
movsd (%r10,%rbx,8), %xmm1
movsd (%r11,%rbx,8), %xmm2
movapd %xmm2, %xmm3
subsd %xmm1, %xmm3
xorpd %xmm0, %xmm1
unpcklpd %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0]
unpcklpd %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0]
mulpd %xmm1, %xmm3
addpd %xmm3, %xmm6
incq %rbx
cmpq %rbx, %r13
jne 0x2e08b
incq %r9
cmpq %rbp, %r9
jne 0x2e079
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rbx
testb %dl, %dl
jne 0x2e127
movq 0x68(%r12), %r8
movq 0x80(%r12), %r9
movq (%r8,%rsi,8), %r8
movsbq %dil, %r10
movsd (%r8,%r10,8), %xmm1
movq (%r9,%rsi,8), %r8
movsd (%r8,%r10,8), %xmm2
subsd %xmm1, %xmm2
xorpd %xmm0, %xmm1
xorl %r9d, %r9d
movsd (%r8,%r9,8), %xmm3
movapd %xmm1, %xmm4
unpcklpd %xmm3, %xmm4            # xmm4 = xmm4[0],xmm3[0]
movapd %xmm2, %xmm5
unpcklpd %xmm3, %xmm5            # xmm5 = xmm5[0],xmm3[0]
mulpd %xmm4, %xmm5
addpd %xmm5, %xmm6
incq %r9
cmpq %r9, %r15
jne 0x2e101
incq %rsi
cmpq %r13, %rsi
jne 0x2e031
jmp 0x2e154
movsbl %al, %edx
movq 0x10e99(%rip), %rax     # 0x3efd8
movq (%rax), %rdi
leaq 0x66cc(%rip), %rsi      # 0x34815
xorl %eax, %eax
callq 0x4330
xorpd %xmm6, %xmm6
movapd %xmm6, 0x30(%rsp)
movapd %xmm6, %xmm0
unpckhpd %xmm6, %xmm0            # xmm0 = xmm0[1],xmm6[1]
callq 0x8df8
cmpb $0x0, 0x8(%rsp)
jle 0x2e274
movapd 0x30(%rsp), %xmm1
divsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
cmplesd %xmm1, %xmm0
andpd %xmm1, %xmm0
cmpq $0x0, 0x18(%r12)
movq 0x10(%r12), %rax
sete %sil
testb %bpl, %bpl
setle %cl
cmpq $0x0, 0x20(%r12)
sete %dil
testb %r15b, %r15b
setle %dl
orb %sil, %cl
orb %dil, %dl
xorl %esi, %esi
testq %rax, %rax
je 0x2e1dd
movq 0x58(%r12), %rdi
movq 0xb8(%r12), %r8
movsd (%r8,%rsi,8), %xmm1
mulsd %xmm0, %xmm1
subsd (%rdi,%rsi,8), %xmm1
movsd %xmm1, (%r8,%rsi,8)
testb %cl, %cl
jne 0x2e229
movq 0x60(%r12), %rdi
movq 0xc0(%r12), %r8
xorl %r9d, %r9d
movq (%rdi,%r9,8), %r10
movq (%r10,%rsi,8), %r10
movq (%r8,%r9,8), %r11
movq (%r11,%rsi,8), %r11
xorl %ebx, %ebx
movsd (%r11,%rbx,8), %xmm1
mulsd %xmm0, %xmm1
subsd (%r10,%rbx,8), %xmm1
movsd %xmm1, (%r11,%rbx,8)
incq %rbx
cmpq %rbx, %r13
jne 0x2e203
incq %r9
cmpq %rbp, %r9
jne 0x2e1f1
testb %dl, %dl
jne 0x2e263
movq 0x68(%r12), %rdi
movq 0xc8(%r12), %r8
movq (%rdi,%rsi,8), %rdi
movq (%r8,%rsi,8), %r8
xorl %r9d, %r9d
movsd (%r8,%r9,8), %xmm1
mulsd %xmm0, %xmm1
subsd (%rdi,%r9,8), %xmm1
movsd %xmm1, (%r8,%r9,8)
incq %r9
cmpq %r9, %r15
jne 0x2e245
incq %rsi
cmpq %r13, %rsi
movq 0x10(%rsp), %rbx
jne 0x2e1b6
movq %r12, %rdi
movl $0x6, %esi
callq 0xc728
movq %r12, %rdi
movl $0x5, %esi
callq 0xc33a
movq 0x88(%rbx), %rax
movsd 0x968(%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movl 0xd0(%r12), %esi
movq 0xd8(%r12), %rdx
movq %rbx, %rdi
callq 0x114ae
movsd %xmm0, 0x50(%rsp)
movq %r12, %rdi
movl $0x1, %esi
movl $0x5, %edx
callq 0xc464
cmpb $0x0, 0x8(%rsp)
xorpd %xmm1, %xmm1
jle 0x2e3b3
movq 0x10(%r12), %rax
cmpq $0x0, 0x18(%r12)
sete %sil
testb %bpl, %bpl
setle %cl
cmpq $0x0, 0x20(%r12)
sete %dil
testb %r15b, %r15b
setle %dl
movq 0x8(%rsp), %r8
decl %r8d
leal -0x1(%r15), %r9d
orb %sil, %cl
movzbl %r8b, %esi
orb %dil, %dl
movzbl %r9b, %edi
xorl %r8d, %r8d
shll $0x3, %edi
shll $0x3, %esi
testq %rax, %rax
je 0x2e348
movq 0x58(%r12), %r9
movq 0xb8(%r12), %r10
movsd (%r9,%r8,8), %xmm1
mulsd (%r10,%r8,8), %xmm1
testb %cl, %cl
jne 0x2e382
xorl %r9d, %r9d
incq %r9
cmpq %r9, %rbp
jne 0x2e34f
movq 0x60(%r12), %r10
movq 0xc0(%r12), %r11
movq -0x8(%r10,%r9,8), %r10
movq (%r10,%r8,8), %r10
movsd (%r10,%rsi), %xmm1
movq -0x8(%r11,%r9,8), %r9
movq (%r9,%r8,8), %r9
mulsd (%r9,%rsi), %xmm1
testb %dl, %dl
jne 0x2e3a7
movq 0x68(%r12), %r9
movq 0xc8(%r12), %r10
movq (%r9,%r8,8), %r9
movsd (%r9,%rdi), %xmm1
movq (%r10,%r8,8), %r9
mulsd (%r9,%rdi), %xmm1
incq %r8
cmpq %r13, %r8
jne 0x2e32a
movq 0x88(%rbx), %rax
xorpd %xmm0, %xmm0
movsd 0x28(%rsp), %xmm2
ucomisd 0x970(%rax), %xmm2
jbe 0x2e72c
movq %rbp, 0x18(%rsp)
movq %r15, 0x40(%rsp)
movsd %xmm1, 0x48(%rsp)
cmpb $0x0, 0x8(%rsp)
jle 0x2e4fc
testb %r15b, %r15b
setle %sil
testb %bpl, %bpl
setle %r8b
movq 0x10(%r12), %rax
movq 0x18(%r12), %rcx
testq %rcx, %rcx
sete %dl
movq 0x20(%r12), %rdi
movq %rdi, %rbx
testq %rdi, %rdi
sete %dil
orb %r8b, %dl
orb %sil, %dil
xorl %r8d, %r8d
testq %rax, %rax
je 0x2e44e
movq 0x88(%r12), %rsi
movq 0xb8(%r12), %r9
movsd (%r9,%r8,8), %xmm0
mulsd %xmm2, %xmm0
addsd (%rsi,%r8,8), %xmm0
movsd %xmm0, (%rax,%r8,8)
testb %dl, %dl
jne 0x2e4aa
movq 0x20(%rsp), %rsi
movq 0x90(%rsi), %r9
movq 0xc0(%rsi), %r10
xorl %r11d, %r11d
movq (%r9,%r11,8), %rsi
movq (%rsi,%r8,8), %r14
movq (%r10,%r11,8), %rsi
movq (%rsi,%r8,8), %r12
movq (%rcx,%r11,8), %rsi
movq (%rsi,%r8,8), %rbp
xorl %esi, %esi
movsd (%r12,%rsi,8), %xmm0
mulsd %xmm2, %xmm0
addsd (%r14,%rsi,8), %xmm0
movsd %xmm0, (%rbp,%rsi,8)
incq %rsi
cmpq %rsi, %r13
jne 0x2e482
incq %r11
cmpq 0x18(%rsp), %r11
jne 0x2e468
testb %dil, %dil
movq 0x20(%rsp), %r12
jne 0x2e4f0
movq 0x98(%r12), %rsi
movq 0xc8(%r12), %r10
movq (%rsi,%r8,8), %r9
movq (%r10,%r8,8), %r10
movq (%rbx,%r8,8), %r11
xorl %esi, %esi
movsd (%r10,%rsi,8), %xmm0
mulsd %xmm2, %xmm0
addsd (%r9,%rsi,8), %xmm0
movsd %xmm0, (%r11,%rsi,8)
incq %rsi
cmpq %rsi, %r15
jne 0x2e4d2
incq %r8
cmpq %r13, %r8
jne 0x2e423
movsd %xmm2, 0x28(%rsp)
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x1133a
movq 0x10(%r12), %r12
movsbl 0x8(%rsp), %ebp
testb %al, %al
movl %ebp, 0x30(%rsp)
je 0x2e630
testq %r12, %r12
je 0x2e54d
movq %rbx, %rdi
callq 0x113a8
movq %rax, %r14
movq %rbx, %rdi
callq 0x113de
movq %r12, %rdi
movq %r14, %rsi
movq %rax, %rdx
movl %ebp, %ecx
callq 0x7997
cmpb $0x0, 0x8(%rsp)
movq 0x20(%rsp), %r12
jle 0x2e6ad
xorl %ebp, %ebp
cmpq $0x0, 0x18(%r12)
movq %r12, %rbx
movq 0x10(%rsp), %r14
movq 0x18(%rsp), %rax
movl $0x0, %edx
movl 0x30(%rsp), %ecx
je 0x2e5dc
testb %al, %al
jle 0x2e5dc
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
cmpb $0x0, 0x80(%r14)
movq (%rax,%r12,8), %rax
movq 0x98(%r14), %rsi
cmoveq %rdx, %rsi
movq (%rax,%rbp,8), %rdi
movq (%rsi,%r12,8), %rax
movq (%rax,%rbp,8), %rsi
movq 0xa0(%r14), %rax
cmoveq %rdx, %rax
movq (%rax,%r12,8), %rax
movq (%rax,%rbp,8), %rdx
movq %rbp, %r15
movl %ecx, %ebp
callq 0x7997
movq 0x18(%rsp), %rax
movl %ebp, %ecx
movq %r15, %rbp
xorl %edx, %edx
incq %r12
cmpq %r12, %rax
jne 0x2e584
movq 0x20(%rbx), %rax
testq %rax, %rax
movq %rbx, %r12
je 0x2e61d
movq (%rax,%rbp,8), %r14
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x113cc
movq (%rax,%rbp,8), %r12
movq %rbx, %rdi
callq 0x11402
movq (%rax,%rbp,8), %rdx
movq %r14, %rdi
movq %r12, %rsi
movq 0x20(%rsp), %r12
movl 0x30(%rsp), %ecx
callq 0x7997
incq %rbp
cmpq %r13, %rbp
movq 0x40(%rsp), %r15
jne 0x2e55f
jmp 0x2e6ad
testq %r12, %r12
je 0x2e63f
movq %r12, %rdi
movl %ebp, %esi
callq 0x6836
cmpb $0x0, 0x8(%rsp)
movq 0x20(%rsp), %r12
jle 0x2e6ad
xorl %r14d, %r14d
cmpq $0x0, 0x18(%r12)
movq %r12, %rbx
movq 0x18(%rsp), %rbp
movl 0x30(%rsp), %r15d
je 0x2e687
testb %bpl, %bpl
jle 0x2e687
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %rax
movq (%rax,%r14,8), %rdi
movl %r15d, %esi
callq 0x6836
incq %r12
cmpq %r12, %rbp
jne 0x2e66b
movq 0x20(%rbx), %rax
testq %rax, %rax
movq %rbx, %r12
je 0x2e6a0
movq (%rax,%r14,8), %rdi
movl 0x30(%rsp), %esi
callq 0x6836
incq %r14
cmpq %r13, %r14
movq 0x40(%rsp), %r15
jne 0x2e64e
movl 0xd0(%r12), %esi
movq 0xd8(%r12), %rdx
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x2bba0
movl 0xd0(%r12), %esi
movq 0xd8(%r12), %rdx
movq %rbx, %rdi
callq 0x114ae
movq 0x88(%rbx), %rax
movsd 0x950(%rax), %xmm3
movsd 0x28(%rsp), %xmm2
mulsd %xmm2, %xmm3
movsd 0x48(%rsp), %xmm1
mulsd %xmm1, %xmm3
addsd 0x50(%rsp), %xmm3
ucomisd %xmm0, %xmm3
jae 0x2e746
divsd 0x960(%rax), %xmm2
ucomisd 0x970(%rax), %xmm2
movq 0x18(%rsp), %rbp
ja 0x2e3e2
movsd %xmm0, 0x18(%rsp)
movq %r12, %rdi
movl $0x5, %esi
movl $0x1, %edx
callq 0xc464
jmp 0x2e74c
movsd %xmm0, 0x18(%rsp)
movq %r12, %rdi
movl $0x5, %esi
callq 0xc3ea
movsd 0x18(%rsp), %xmm0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq