// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/HMMProblemSlicedAB.cpp
// Function: HMMProblemSlicedAB::doConjugateLinearStep(FitBitSlicedAB*)
NUMBER HMMProblemSlicedAB::doConjugateLinearStep(FitBitSlicedAB *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(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->gradAm1[z][i][j]*fb->gradAm1[z][i][j];
                        }
                    }
                if(fb->B  != NULL)
                    for(m=0; m<nO; m++) {
                        for(z=0; z<nZ; z++){
                            beta_grad_num += fb->gradB  [z][i][m]*fb->gradB  [z][i][m];
                            beta_grad_den += fb->gradBm1[z][i][m]*fb->gradBm1[z][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(j=0; j<nS; j++) {
                        for(z=0; z<nZ; z++){
                            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++) {
                        for(z=0; z<nZ; z++){
                            beta_grad_num += -fb->gradB  [z][i][j]*(-fb->gradB  [z][i][j] + fb->gradBm1[z][i][j]);
                            beta_grad_den +=  fb->gradBm1[z][i][m]*  fb->gradBm1[z][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(j=0; j<nS; j++) {
                        for(z=0; z<nZ; z++){
                            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++) {
                        for(z=0; z<nZ; z++){
                            beta_grad_num += -fb->gradB [z][i][j]*(-fb->gradB[z][i][j] + fb->gradBm1[z][i][j]);
                            beta_grad_den +=  fb->dirBm1[z][i][m]*(-fb->gradB[z][i][j] + fb->gradBm1[z][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++) {
                        for(z=0; z<nZ; z++){
                            beta_grad_num += -fb->gradB [z][i][m]*fb->gradB  [z][i][m];
                            beta_grad_den +=  fb->dirBm1[z][i][m]*(-fb->gradB[z][i][j] + fb->gradBm1[z][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(j=0; j<nS; j++) {
                for(z=0; z<nZ; z++) {
                    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++) {
                for(z=0; z<nZ; z++) {
                    fb->dirBm1[z][i][m] = -fb->gradB[z][i][m] + beta_grad * fb->dirBm1[z][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 = HMMProblemSlicedAB::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(j=0; j<nS; j++) {
                for(z=0; z<nZ; z++) {
                    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++) {
                for(z=0; z<nZ; z++) {
                    p_k_by_neg_p_k = fb->gradB[z][i][m]*fb->dirBm1[z][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(j=0; j<nS; j++) {
                    for(z=0; z<nZ; z++) {
                        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++) {
                    for(z=0; z<nZ; z++) {
                        fb->B[z][i][m] = fb->Bcopy[z][i][m] + e * fb->dirBm1[z][i][m];
                    }
                }
            }
		}
		// scale
		if( !this->hasNon01Constraints() ) {
            if(fb->pi != NULL) {
                projectsimplex(fb->pi, nS);
            }
            for(i=0; i<nS; i++) {
                for(z=0; z<nZ; z++) {
                    if(fb->A != NULL) {
                        projectsimplex(fb->A[z][i], nS);
                    }
                    if(fb->B != NULL) {
                        projectsimplex(fb->B[z][i], nS);
                    }
                }
			}
		} else {
			if(fb->pi != NULL) projectsimplexbounded(fb->pi, this->getLbPI(), this->getUbPI(), nS);
            for(i=0; i<nS; i++) {
                for(z=0; z<nZ; z++){
                    if(fb->A != NULL) 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[z][i], this->getLbB()[z][i], this->getUbB()[z][i], nS);
                }
            }
		}
		// recompute alpha and p(O|param)
		computeAlphaAndPOParam(fb->xndat, fb->x_data);
		// compute f(x_{k+1})
		f_xkplus1 = HMMProblemSlicedAB::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 $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %rbp
movq 0x88(%rdi), %rax
movb 0x8b8(%rax), %cl
movb %cl, 0x7(%rsp)
movzbl %cl, %ecx
movq %rcx, 0x8(%rsp)
movzbl 0x8b9(%rax), %ecx
movq %rcx, 0x10(%rsp)
movzbl 0x8c8(%rax), %r15d
movq %rsi, %rdi
movl $0x3, %esi
callq 0xd7be
movq 0x88(%rbp), %rax
movzbl 0x40(%rax), %eax
leal -0x1(%rax), %ecx
cmpl $0x3, %ecx
movq %rbp, 0x18(%rsp)
ja 0x28032
leaq 0xd171(%rip), %rax      # 0x34c54
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpb $0x0, 0x7(%rsp)
jle 0x2804d
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpq $0x0, 0x20(%rbx)
sete %sil
cmpb $0x0, 0x10(%rsp)
setle %dl
orb %sil, %dl
xorpd %xmm4, %xmm4
xorl %esi, %esi
testq %rax, %rax
je 0x27b39
movq 0x58(%rbx), %rdi
movq 0x70(%rbx), %r8
movsd (%rdi,%rsi,8), %xmm0
movhpd (%r8,%rsi,8), %xmm0     # xmm0 = xmm0[0],mem[0]
mulpd %xmm0, %xmm0
addpd %xmm0, %xmm4
testq %rcx, %rcx
je 0x27b86
xorl %edi, %edi
testb %r15b, %r15b
jle 0x27b7c
movq 0x60(%rbx), %r8
movq 0x78(%rbx), %r9
xorl %r10d, %r10d
movq (%r8,%r10,8), %r11
movq (%r11,%rsi,8), %r11
movq (%r9,%r10,8), %r14
movq (%r14,%rsi,8), %r14
movsd (%r11,%rdi,8), %xmm0
movhpd (%r14,%rdi,8), %xmm0    # xmm0 = xmm0[0],mem[0]
mulpd %xmm0, %xmm0
addpd %xmm0, %xmm4
incq %r10
cmpq %r10, %r15
jne 0x27b50
incq %rdi
cmpq 0x8(%rsp), %rdi
jne 0x27b40
testb %dl, %dl
jne 0x27bd5
xorl %edi, %edi
testb %r15b, %r15b
jle 0x27bcb
movq 0x68(%rbx), %r8
movq 0x80(%rbx), %r9
xorl %r10d, %r10d
movq (%r8,%r10,8), %r11
movq (%r11,%rsi,8), %r11
movq (%r9,%r10,8), %r14
movq (%r14,%rsi,8), %r14
movsd (%r11,%rdi,8), %xmm0
movhpd (%r14,%rdi,8), %xmm0    # xmm0 = xmm0[0],mem[0]
mulpd %xmm0, %xmm0
addpd %xmm0, %xmm4
incq %r10
cmpq %r10, %r15
jne 0x27b9f
incq %rdi
cmpq 0x10(%rsp), %rdi
jne 0x27b8c
incq %rsi
cmpq 0x8(%rsp), %rsi
jne 0x27b19
jmp 0x28051
cmpb $0x0, 0x7(%rsp)
jle 0x2804d
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpq $0x0, 0x20(%rbx)
sete %sil
cmpb $0x0, 0x10(%rsp)
setle %dl
orb %sil, %dl
xorpd %xmm4, %xmm4
xorl %esi, %esi
movapd 0xbd23(%rip), %xmm0     # 0x33940
xorl %edi, %edi
testq %rax, %rax
je 0x27c59
movq 0x58(%rbx), %r8
movq 0x70(%rbx), %r9
movsd (%r8,%rsi,8), %xmm1
movsd (%r9,%rsi,8), %xmm2
subsd %xmm1, %xmm2
xorpd %xmm0, %xmm1
movq 0xb8(%rbx), %r8
movhpd (%r8,%rsi,8), %xmm1     # xmm1 = xmm1[0],mem[0]
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm1, %xmm2
addpd %xmm2, %xmm4
testq %rcx, %rcx
je 0x27ccc
xorl %edi, %edi
testb %r15b, %r15b
jle 0x27cbd
movq 0x60(%rbx), %r8
movq 0x78(%rbx), %r9
movq 0xc0(%rbx), %r10
xorl %r11d, %r11d
movq (%r8,%r11,8), %r14
movq (%r14,%rsi,8), %r14
movsd (%r14,%rdi,8), %xmm1
movq (%r9,%r11,8), %r14
movq (%r14,%rsi,8), %r14
movsd (%r14,%rdi,8), %xmm2
subsd %xmm1, %xmm2
xorpd %xmm0, %xmm1
movq (%r10,%r11,8), %r14
movq (%r14,%rsi,8), %r14
movhpd (%r14,%rdi,8), %xmm1    # xmm1 = xmm1[0],mem[0]
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm1, %xmm2
addpd %xmm2, %xmm4
incq %r11
cmpq %r11, %r15
jne 0x27c77
incq %rdi
cmpq 0x8(%rsp), %rdi
jne 0x27c60
movb 0x7(%rsp), %dil
testb %dl, %dl
jne 0x27d47
movsbq %dil, %r8
xorl %r9d, %r9d
testb %r15b, %r15b
jle 0x27d3d
movq 0x68(%rbx), %r10
movq 0x80(%rbx), %r11
movq 0xc8(%rbx), %r14
xorl %r12d, %r12d
movq (%r10,%r12,8), %r13
movq (%r13,%rsi,8), %r13
movsd (%r13,%r8,8), %xmm1
movq (%r11,%r12,8), %r13
movq (%r13,%rsi,8), %r13
movsd (%r13,%r8,8), %xmm2
subsd %xmm1, %xmm2
xorpd %xmm0, %xmm1
movq (%r14,%r12,8), %r13
movq (%r13,%rsi,8), %r13
movhpd (%r13,%r9,8), %xmm1     # xmm1 = xmm1[0],mem[0]
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm1, %xmm2
addpd %xmm2, %xmm4
incq %r12
cmpq %r12, %r15
jne 0x27cf1
incq %r9
cmpq 0x10(%rsp), %r9
jne 0x27cd7
incq %rsi
cmpq 0x8(%rsp), %rsi
jne 0x27c1f
jmp 0x28051
cmpb $0x0, 0x7(%rsp)
jle 0x2804d
movq 0x10(%rbx), %rax
movq %rax, 0x20(%rsp)
movq 0x18(%rbx), %rcx
cmpq $0x0, 0x20(%rbx)
sete %sil
cmpb $0x0, 0x10(%rsp)
setle %dl
orb %sil, %dl
xorpd %xmm4, %xmm4
xorl %esi, %esi
movapd 0xbbac(%rip), %xmm0     # 0x33940
xorl %edi, %edi
cmpq $0x0, 0x20(%rsp)
je 0x27dd7
movq 0x58(%rbx), %r8
movq 0x70(%rbx), %r9
movsd (%r8,%rsi,8), %xmm1
movapd %xmm1, %xmm2
xorpd %xmm0, %xmm2
movq 0xb8(%rbx), %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, %xmm4
testq %rcx, %rcx
je 0x27e4f
xorl %edi, %edi
testb %r15b, %r15b
jle 0x27e3f
movq 0x60(%rbx), %r8
movq 0x78(%rbx), %r9
movq 0xc0(%rbx), %r10
xorl %r11d, %r11d
movq (%r8,%r11,8), %r14
movq (%r14,%rsi,8), %r14
movsd (%r14,%rdi,8), %xmm1
movapd %xmm1, %xmm2
xorpd %xmm0, %xmm2
movq (%r10,%r11,8), %r14
movq (%r14,%rsi,8), %r14
movq (%r9,%r11,8), %r12
movq (%r12,%rsi,8), %r12
movsd (%r12,%rdi,8), %xmm3
subsd %xmm1, %xmm3
movhpd (%r14,%rdi,8), %xmm2    # xmm2 = xmm2[0],mem[0]
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
mulpd %xmm2, %xmm1
addpd %xmm1, %xmm4
incq %r11
cmpq %r11, %r15
jne 0x27df5
incq %rdi
cmpq 0x8(%rsp), %rdi
jne 0x27dde
movb 0x7(%rsp), %al
movl %eax, %edi
testb %dl, %dl
jne 0x27ece
movsbq %dil, %r8
xorl %r9d, %r9d
testb %r15b, %r15b
jle 0x27ec4
movq 0x68(%rbx), %r10
movq 0x80(%rbx), %r11
movq 0xc8(%rbx), %r14
xorl %r12d, %r12d
movq (%r10,%r12,8), %r13
movq (%r13,%rsi,8), %r13
movsd (%r13,%r9,8), %xmm1
movapd %xmm1, %xmm2
xorpd %xmm0, %xmm2
movq (%r14,%r12,8), %rbp
movq (%r11,%r12,8), %rax
movq (%rax,%rsi,8), %rax
movsd (%rax,%r8,8), %xmm3
subsd (%r13,%r8,8), %xmm3
movq (%rbp,%rsi,8), %rax
movhpd (%rax,%r9,8), %xmm2     # xmm2 = xmm2[0],mem[0]
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
mulpd %xmm2, %xmm1
addpd %xmm1, %xmm4
incq %r12
cmpq %r12, %r15
jne 0x27e74
incq %r9
cmpq 0x10(%rsp), %r9
jne 0x27e5a
incq %rsi
cmpq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rbp
jne 0x27d96
jmp 0x28051
cmpb $0x0, 0x7(%rsp)
jle 0x2804d
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpq $0x0, 0x20(%rbx)
sete %sil
cmpb $0x0, 0x10(%rsp)
setle %dl
orb %sil, %dl
xorpd %xmm4, %xmm4
xorl %esi, %esi
movapd 0xba25(%rip), %xmm0     # 0x33940
xorl %edi, %edi
testq %rax, %rax
je 0x27f52
movq 0x58(%rbx), %r8
movq 0x70(%rbx), %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, %xmm4
testq %rcx, %rcx
je 0x27fb8
xorl %edi, %edi
testb %r15b, %r15b
jle 0x27fa9
movq 0x60(%rbx), %r8
movq 0x78(%rbx), %r9
xorl %r10d, %r10d
movq (%r8,%r10,8), %r11
movq (%r11,%rsi,8), %r11
movsd (%r11,%rdi,8), %xmm1
movq (%r9,%r10,8), %r11
movq (%r11,%rsi,8), %r11
movsd (%r11,%rdi,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, %xmm4
incq %r10
cmpq %r10, %r15
jne 0x27f69
incq %rdi
cmpq 0x8(%rsp), %rdi
jne 0x27f59
movb 0x7(%rsp), %dil
testb %dl, %dl
jne 0x28022
movsbq %dil, %r8
xorl %r9d, %r9d
testb %r15b, %r15b
jle 0x28018
movq 0x68(%rbx), %r10
movq 0x80(%rbx), %r11
xorl %r14d, %r14d
movq (%r10,%r14,8), %r12
movq (%r12,%rsi,8), %r12
movsd (%r12,%r8,8), %xmm1
movq (%r11,%r14,8), %r12
movq (%r12,%rsi,8), %r12
movsd (%r12,%r8,8), %xmm2
subsd %xmm1, %xmm2
xorpd %xmm0, %xmm1
movsd (%r12,%r9,8), %xmm3
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
unpcklpd %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0]
mulpd %xmm1, %xmm2
addpd %xmm2, %xmm4
incq %r14
cmpq %r14, %r15
jne 0x27fd6
incq %r9
cmpq 0x10(%rsp), %r9
jne 0x27fc3
incq %rsi
cmpq 0x8(%rsp), %rsi
jne 0x27f1d
jmp 0x28051
movsbl %al, %edx
movq 0x16f9c(%rip), %rax     # 0x3efd8
movq (%rax), %rdi
leaq 0xc7cf(%rip), %rsi      # 0x34815
xorl %eax, %eax
callq 0x4330
xorpd %xmm4, %xmm4
movapd %xmm4, 0x20(%rsp)
movapd %xmm4, %xmm0
unpckhpd %xmm4, %xmm0            # xmm0 = xmm0[1],xmm4[1]
callq 0x8df8
cmpb $0x0, 0x7(%rsp)
jle 0x2817a
movapd 0x20(%rsp), %xmm1
divsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
cmplesd %xmm1, %xmm0
andpd %xmm1, %xmm0
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpq $0x0, 0x20(%rbx)
sete %sil
cmpb $0x0, 0x10(%rsp)
setle %dl
orb %sil, %dl
xorl %esi, %esi
testq %rax, %rax
je 0x280c9
movq 0x58(%rbx), %rdi
movq 0xb8(%rbx), %r8
movsd (%r8,%rsi,8), %xmm1
mulsd %xmm0, %xmm1
subsd (%rdi,%rsi,8), %xmm1
movsd %xmm1, (%r8,%rsi,8)
testq %rcx, %rcx
je 0x2811b
xorl %edi, %edi
testb %r15b, %r15b
jle 0x28111
movq 0x60(%rbx), %r8
movq 0xc0(%rbx), %r9
xorl %r10d, %r10d
movq (%r8,%r10,8), %r11
movq (%r11,%rsi,8), %r11
movq (%r9,%r10,8), %r14
movq (%r14,%rsi,8), %r14
movsd (%r14,%rdi,8), %xmm1
mulsd %xmm0, %xmm1
subsd (%r11,%rdi,8), %xmm1
movsd %xmm1, (%r14,%rdi,8)
incq %r10
cmpq %r10, %r15
jne 0x280e3
incq %rdi
cmpq 0x8(%rsp), %rdi
jne 0x280d0
testb %dl, %dl
jne 0x2816c
xorl %edi, %edi
testb %r15b, %r15b
jle 0x28162
movq 0x68(%rbx), %r8
movq 0xc8(%rbx), %r9
xorl %r10d, %r10d
movq (%r8,%r10,8), %r11
movq (%r11,%rsi,8), %r11
movq (%r9,%r10,8), %r14
movq (%r14,%rsi,8), %r14
movsd (%r14,%rdi,8), %xmm1
mulsd %xmm0, %xmm1
subsd (%r11,%rdi,8), %xmm1
movsd %xmm1, (%r14,%rdi,8)
incq %r10
cmpq %r10, %r15
jne 0x28134
incq %rdi
cmpq 0x10(%rsp), %rdi
jne 0x28121
incq %rsi
cmpq 0x8(%rsp), %rsi
jne 0x280a4
movq %rbx, %rdi
movl $0x6, %esi
callq 0xd7be
movq %rbx, %rdi
movl $0x5, %esi
callq 0xd3be
movq 0x88(%rbp), %rax
movsd 0x968(%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movl 0xd0(%rbx), %esi
movq 0xd8(%rbx), %rdx
movq %rbp, %rdi
callq 0x114ae
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
movl $0x1, %esi
movl $0x5, %edx
callq 0xd4e8
cmpb $0x0, 0x7(%rsp)
xorpd %xmm1, %xmm1
jle 0x282c0
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpq $0x0, 0x20(%rbx)
sete %dil
cmpb $0x0, 0x10(%rsp)
setle %dl
leal -0x1(%r15), %esi
movzbl %sil, %esi
orb %dil, %dl
xorl %edi, %edi
leal (,%rsi,8), %r8d
testq %rax, %rax
je 0x2822f
movq 0x58(%rbx), %r9
movq 0xb8(%rbx), %r10
movsd (%r9,%rdi,8), %xmm1
mulsd (%r10,%rdi,8), %xmm1
testq %rcx, %rcx
je 0x2826d
xorl %r9d, %r9d
testb %r15b, %r15b
jle 0x28263
movq 0x60(%rbx), %r10
movq 0xc0(%rbx), %r11
movq (%r10,%r8), %r10
movq (%r10,%rdi,8), %r10
movsd (%r10,%r9,8), %xmm1
movq (%r11,%r8), %r10
movq (%r10,%rdi,8), %r10
mulsd (%r10,%r9,8), %xmm1
incq %r9
cmpq %r9, 0x8(%rsp)
jne 0x28237
testb %dl, %dl
jne 0x282b2
xorl %r9d, %r9d
testb %r15b, %r15b
jle 0x282a8
leal (,%rsi,8), %r10d
movq 0x68(%rbx), %r11
movq 0xc8(%rbx), %r14
movq (%r11,%r10), %r11
movq (%r11,%rdi,8), %r11
movsd (%r11,%r9,8), %xmm1
movq (%r14,%r10), %r10
movq (%r10,%rdi,8), %r10
mulsd (%r10,%r9,8), %xmm1
incq %r9
cmpq %r9, 0x10(%rsp)
jne 0x28274
incq %rdi
cmpq 0x8(%rsp), %rdi
jne 0x28213
movq 0x88(%rbp), %rax
xorpd %xmm0, %xmm0
movsd 0x20(%rsp), %xmm2
ucomisd 0x970(%rax), %xmm2
jbe 0x285f8
xorl %r13d, %r13d
movsd %xmm1, 0x38(%rsp)
cmpb $0x0, 0x7(%rsp)
jle 0x28406
cmpb $0x0, 0x10(%rsp)
setle %dil
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %rdx
testq %rdx, %rdx
sete %sil
orb %dil, %sil
xorl %edi, %edi
testq %rax, %rax
je 0x2833c
movq 0x88(%rbx), %r8
movq 0xb8(%rbx), %r9
movsd (%r9,%rdi,8), %xmm0
mulsd %xmm2, %xmm0
addsd (%r8,%rdi,8), %xmm0
movsd %xmm0, (%rax,%rdi,8)
testq %rcx, %rcx
je 0x2839a
xorl %r8d, %r8d
testb %r15b, %r15b
jle 0x28390
movq 0x90(%rbx), %r9
movq 0xc0(%rbx), %r10
xorl %r11d, %r11d
movq (%r9,%r11,8), %r14
movq (%r14,%rdi,8), %r14
movq (%r10,%r11,8), %r12
movq (%r12,%rdi,8), %r12
movsd (%r12,%r8,8), %xmm0
mulsd %xmm2, %xmm0
addsd (%r14,%r8,8), %xmm0
movq (%rcx,%r11,8), %r14
movq (%r14,%rdi,8), %r14
movsd %xmm0, (%r14,%r8,8)
incq %r11
cmpq %r11, %r15
jne 0x2835a
incq %r8
cmpq 0x8(%rsp), %r8
jne 0x28344
testb %sil, %sil
jne 0x283f8
xorl %r8d, %r8d
testb %r15b, %r15b
jle 0x283ee
movq 0x98(%rbx), %r9
movq 0xc8(%rbx), %r10
xorl %r11d, %r11d
movq (%r9,%r11,8), %r14
movq (%r14,%rdi,8), %r14
movq (%r10,%r11,8), %r12
movq (%r12,%rdi,8), %r12
movsd (%r12,%r8,8), %xmm0
mulsd %xmm2, %xmm0
addsd (%r14,%r8,8), %xmm0
movq (%rdx,%r11,8), %r14
movq (%r14,%rdi,8), %r14
movsd %xmm0, (%r14,%r8,8)
incq %r11
cmpq %r11, %r15
jne 0x283b8
incq %r8
cmpq 0x10(%rsp), %r8
jne 0x283a2
incq %rdi
cmpq 0x8(%rsp), %rdi
jne 0x28314
movsd %xmm2, 0x20(%rsp)
movq %rbp, %rdi
callq 0x1133a
movq 0x10(%rbx), %rdi
movsbl 0x7(%rsp), %ebp
testb %al, %al
je 0x28448
testq %rdi, %rdi
je 0x284bc
movq 0x18(%rsp), %rax
cmpb $0x0, 0x80(%rax)
je 0x284b1
movq 0xa0(%rax), %rsi
movq 0xb8(%rax), %rdx
jmp 0x284b5
testq %rdi, %rdi
je 0x28454
movl %ebp, %esi
callq 0x6836
cmpb $0x0, 0x7(%rsp)
jle 0x28584
xorl %r14d, %r14d
testb %r15b, %r15b
jle 0x284a2
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x28482
movq (%rax,%r12,8), %rax
movq (%rax,%r14,8), %rdi
movl %ebp, %esi
callq 0x6836
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x2849a
movq (%rax,%r12,8), %rax
movq (%rax,%r14,8), %rdi
movl %ebp, %esi
callq 0x6836
incq %r12
cmpq %r12, %r15
jne 0x2846a
incq %r14
cmpq 0x8(%rsp), %r14
jne 0x28462
jmp 0x28584
xorl %esi, %esi
xorl %edx, %edx
movl %ebp, %ecx
callq 0x7997
cmpb $0x0, 0x7(%rsp)
jle 0x28584
xorl %r12d, %r12d
testb %r15b, %r15b
jle 0x28576
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x28520
movq 0x18(%rsp), %rdx
cmpb $0x0, 0x80(%rdx)
movq (%rax,%r14,8), %rax
movq 0xa8(%rdx), %rcx
cmoveq %r13, %rcx
movq (%rax,%r12,8), %rdi
movq (%rcx,%r14,8), %rax
movq (%rax,%r12,8), %rsi
movq 0xc0(%rdx), %rax
cmoveq %r13, %rax
movq (%rax,%r14,8), %rax
movq (%rax,%r12,8), %rdx
movl %ebp, %ecx
callq 0x7997
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x2856a
movq 0x18(%rsp), %rdx
cmpb $0x0, 0x80(%rdx)
movq (%rax,%r14,8), %rax
movq 0xb0(%rdx), %rcx
cmoveq %r13, %rcx
movq (%rax,%r12,8), %rdi
movq (%rcx,%r14,8), %rax
movq (%rax,%r12,8), %rsi
movq 0xc8(%rdx), %rax
cmoveq %r13, %rax
movq (%rax,%r14,8), %rax
movq (%rax,%r12,8), %rdx
movl %ebp, %ecx
callq 0x7997
incq %r14
cmpq %r14, %r15
jne 0x284d6
incq %r12
cmpq 0x8(%rsp), %r12
jne 0x284ca
movl 0xd0(%rbx), %esi
movq 0xd8(%rbx), %rdx
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq 0x25910
movl 0xd0(%rbx), %esi
movq 0xd8(%rbx), %rdx
movq %rbp, %rdi
callq 0x114ae
movq 0x88(%rbp), %rax
movsd 0x950(%rax), %xmm3
movsd 0x20(%rsp), %xmm2
mulsd %xmm2, %xmm3
movsd 0x38(%rsp), %xmm1
mulsd %xmm1, %xmm3
addsd 0x40(%rsp), %xmm3
ucomisd %xmm0, %xmm3
jae 0x28612
divsd 0x960(%rax), %xmm2
ucomisd 0x970(%rax), %xmm2
ja 0x282e8
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
movl $0x5, %esi
movl $0x1, %edx
callq 0xd4e8
jmp 0x28618
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
movl $0x5, %esi
callq 0xd46e
movsd 0x8(%rsp), %xmm0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq