// File: /workspace/github_cpp_makefile_star2_O2/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, %r15
movq 0x88(%rdi), %rax
movb 0x8b8(%rax), %r12b
movb 0x8b9(%rax), %r14b
movb 0x8c8(%rax), %bpl
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0xac12
movq %r15, 0x28(%rsp)
movq 0x88(%r15), %rax
movzbl 0x40(%rax), %eax
leal -0x1(%rax), %ecx
movzbl %bpl, %ebp
movb %r12b, 0xf(%rsp)
movzbl %r12b, %r12d
movzbl %r14b, %r13d
cmpl $0x3, %ecx
ja 0x222f7
leaq 0xbe63(%rip), %rax      # 0x2dc14
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
xorl %eax, %eax
testb %bpl, %bpl
cmovlel %eax, %ebp
testb %r12b, %r12b
cmovlel %eax, %r12d
testb %r13b, %r13b
cmovlel %eax, %r13d
movl $0xff, %esi
movl %r12d, %ecx
andl %esi, %ecx
movq %rcx, (%rsp)
movl %ebp, %ecx
andl %esi, %ecx
movl %r13d, %edx
andl %esi, %edx
xorpd %xmm4, %xmm4
cmpq (%rsp), %rax
je 0x22339
cmpq $0x0, 0x10(%rbx)
je 0x21e16
movq 0x58(%rbx), %rsi
movq 0x70(%rbx), %rdi
movsd (%rsi,%rax,8), %xmm0
movhpd (%rdi,%rax,8), %xmm0    # xmm0 = xmm0[0],mem[0]
mulpd %xmm0, %xmm0
addpd %xmm0, %xmm4
cmpq $0x0, 0x18(%rbx)
je 0x21e62
xorl %esi, %esi
cmpq (%rsp), %rsi
je 0x21e62
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x21e5d
movq 0x60(%rbx), %r8
movq 0x78(%rbx), %r9
movq (%r8,%rdi,8), %r8
movq (%r8,%rax,8), %r8
movq (%r9,%rdi,8), %r9
movq (%r9,%rax,8), %r9
movsd (%r8,%rsi,8), %xmm0
movhpd (%r9,%rsi,8), %xmm0     # xmm0 = xmm0[0],mem[0]
mulpd %xmm0, %xmm0
addpd %xmm0, %xmm4
incq %rdi
jmp 0x21e27
incq %rsi
jmp 0x21e1f
cmpq $0x0, 0x20(%rbx)
je 0x21eb0
xorl %esi, %esi
cmpq %rdx, %rsi
je 0x21eb0
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x21eab
movq 0x68(%rbx), %r8
movq 0x80(%rbx), %r9
movq (%r8,%rdi,8), %r8
movq (%r8,%rax,8), %r8
movq (%r9,%rdi,8), %r9
movq (%r9,%rax,8), %r9
movsd (%r8,%rsi,8), %xmm0
movhpd (%r9,%rsi,8), %xmm0     # xmm0 = xmm0[0],mem[0]
mulpd %xmm0, %xmm0
addpd %xmm0, %xmm4
incq %rdi
jmp 0x21e72
incq %rsi
jmp 0x21e6b
incq %rax
jmp 0x21deb
xorl %eax, %eax
testb %bpl, %bpl
cmovlel %eax, %ebp
testb %r12b, %r12b
cmovlel %eax, %r12d
movl $0xff, %esi
movl %r12d, %ecx
andl %esi, %ecx
movq %rcx, (%rsp)
testb %r13b, %r13b
cmovlel %eax, %r13d
movl %ebp, %ecx
andl %esi, %ecx
movl %r13d, %edx
andl %esi, %edx
xorpd %xmm4, %xmm4
movapd 0xaa4f(%rip), %xmm0     # 0x2c940
xorl %esi, %esi
cmpq (%rsp), %rax
je 0x22339
cmpq $0x0, 0x10(%rbx)
je 0x21f37
movq 0x58(%rbx), %rdi
movq 0x70(%rbx), %r8
movsd (%rdi,%rax,8), %xmm1
movsd (%r8,%rax,8), %xmm2
subsd %xmm1, %xmm2
xorpd %xmm0, %xmm1
movq 0xb8(%rbx), %rdi
movhpd (%rdi,%rax,8), %xmm1    # xmm1 = xmm1[0],mem[0]
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm1, %xmm2
addpd %xmm2, %xmm4
cmpq $0x0, 0x18(%rbx)
je 0x21fa7
xorl %esi, %esi
cmpq (%rsp), %rsi
je 0x21fa4
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x21f9f
movq 0x60(%rbx), %r8
movq 0x78(%rbx), %r9
movq (%r8,%rdi,8), %r8
movq (%r8,%rax,8), %r8
movsd (%r8,%rsi,8), %xmm1
movq (%r9,%rdi,8), %r8
movq (%r8,%rax,8), %r8
movsd (%r8,%rsi,8), %xmm2
subsd %xmm1, %xmm2
xorpd %xmm0, %xmm1
movq 0xc0(%rbx), %r8
movq (%r8,%rdi,8), %r8
movq (%r8,%rax,8), %r8
movhpd (%r8,%rsi,8), %xmm1     # xmm1 = xmm1[0],mem[0]
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm1, %xmm2
addpd %xmm2, %xmm4
incq %rdi
jmp 0x21f48
incq %rsi
jmp 0x21f40
movl %r12d, %esi
cmpq $0x0, 0x20(%rbx)
je 0x2201f
movzbl %sil, %edi
shll $0x3, %edi
xorl %r8d, %r8d
cmpq %rdx, %r8
je 0x2201f
xorl %r9d, %r9d
cmpq %r9, %rcx
je 0x2201a
movq 0x68(%rbx), %r10
movq 0x80(%rbx), %r11
movq (%r10,%r9,8), %r10
movq (%r10,%rax,8), %r10
movsd (%r10,%rdi), %xmm1
movq (%r11,%r9,8), %r10
movq (%r10,%rax,8), %r10
movsd (%r10,%rdi), %xmm2
subsd %xmm1, %xmm2
xorpd %xmm0, %xmm1
movq 0xc8(%rbx), %r10
movq (%r10,%r9,8), %r10
movq (%r10,%rax,8), %r10
movhpd (%r10,%r8,8), %xmm1     # xmm1 = xmm1[0],mem[0]
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm1, %xmm2
addpd %xmm2, %xmm4
incq %r9
jmp 0x21fc0
incq %r8
jmp 0x21fb8
incq %rax
jmp 0x21ef3
xorl %eax, %eax
testb %bpl, %bpl
cmovlel %eax, %ebp
testb %r12b, %r12b
cmovlel %eax, %r12d
movl $0xff, %esi
movl %r12d, %ecx
andl %esi, %ecx
movq %rcx, (%rsp)
testb %r13b, %r13b
cmovlel %eax, %r13d
movl %ebp, %ecx
andl %esi, %ecx
movl %r13d, %edx
andl %esi, %edx
xorpd %xmm4, %xmm4
movapd 0xa8e0(%rip), %xmm0     # 0x2c940
xorl %esi, %esi
cmpq (%rsp), %rax
je 0x22339
cmpq $0x0, 0x10(%rbx)
je 0x220aa
movq 0x58(%rbx), %rdi
movq 0x70(%rbx), %r8
movsd (%rdi,%rax,8), %xmm1
movapd %xmm1, %xmm2
xorpd %xmm0, %xmm2
movq 0xb8(%rbx), %rdi
movsd (%r8,%rax,8), %xmm3
movhpd (%rdi,%rax,8), %xmm2    # xmm2 = xmm2[0],mem[0]
subsd %xmm1, %xmm3
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
mulpd %xmm2, %xmm1
addpd %xmm1, %xmm4
cmpq $0x0, 0x18(%rbx)
je 0x2211e
xorl %esi, %esi
cmpq (%rsp), %rsi
je 0x2211b
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x22116
movq 0x60(%rbx), %r8
movq 0x78(%rbx), %r9
movq (%r8,%rdi,8), %r8
movq (%r8,%rax,8), %r8
movsd (%r8,%rsi,8), %xmm1
movapd %xmm1, %xmm2
xorpd %xmm0, %xmm2
movq 0xc0(%rbx), %r8
movq (%r8,%rdi,8), %r8
movq (%r8,%rax,8), %r8
movq (%r9,%rdi,8), %r9
movq (%r9,%rax,8), %r9
movsd (%r9,%rsi,8), %xmm3
subsd %xmm1, %xmm3
movhpd (%r8,%rsi,8), %xmm2     # xmm2 = xmm2[0],mem[0]
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
mulpd %xmm2, %xmm1
addpd %xmm1, %xmm4
incq %rdi
jmp 0x220bb
incq %rsi
jmp 0x220b3
movl %r12d, %esi
cmpq $0x0, 0x20(%rbx)
je 0x2219c
movzbl %sil, %edi
shll $0x3, %edi
xorl %r8d, %r8d
cmpq %rdx, %r8
je 0x2219c
xorl %r9d, %r9d
cmpq %r9, %rcx
je 0x22197
movq 0x68(%rbx), %r10
movq 0x80(%rbx), %r11
movq (%r10,%r9,8), %r10
movq (%r10,%rax,8), %r10
movsd (%r10,%r8,8), %xmm1
movapd %xmm1, %xmm2
xorpd %xmm0, %xmm2
movq 0xc8(%rbx), %r14
movq (%r14,%r9,8), %r14
movq (%r14,%rax,8), %r14
movq (%r11,%r9,8), %r11
movq (%r11,%rax,8), %r11
movsd (%r11,%rdi), %xmm3
subsd (%r10,%rdi), %xmm3
movhpd (%r14,%r8,8), %xmm2     # xmm2 = xmm2[0],mem[0]
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
mulpd %xmm2, %xmm1
addpd %xmm1, %xmm4
incq %r9
jmp 0x22137
incq %r8
jmp 0x2212f
incq %rax
jmp 0x22062
xorl %eax, %eax
testb %bpl, %bpl
cmovlel %eax, %ebp
testb %r12b, %r12b
cmovlel %eax, %r12d
movl $0xff, %esi
movl %r12d, %ecx
andl %esi, %ecx
movq %rcx, (%rsp)
testb %r13b, %r13b
cmovlel %eax, %r13d
movl %ebp, %ecx
andl %esi, %ecx
movl %r13d, %edx
andl %esi, %edx
xorpd %xmm4, %xmm4
movapd 0xa763(%rip), %xmm0     # 0x2c940
xorl %esi, %esi
cmpq (%rsp), %rax
je 0x22339
cmpq $0x0, 0x10(%rbx)
je 0x2221f
movq 0x58(%rbx), %rdi
movq 0x70(%rbx), %r8
movsd (%rdi,%rax,8), %xmm1
movsd (%r8,%rax,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
cmpq $0x0, 0x18(%rbx)
je 0x22282
xorl %esi, %esi
cmpq (%rsp), %rsi
je 0x2227f
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x2227a
movq 0x60(%rbx), %r8
movq 0x78(%rbx), %r9
movq (%r8,%rdi,8), %r8
movq (%r8,%rax,8), %r8
movsd (%r8,%rsi,8), %xmm1
movq (%r9,%rdi,8), %r8
movq (%r8,%rax,8), %r8
movsd (%r8,%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
incq %rdi
jmp 0x22230
incq %rsi
jmp 0x22228
movl %r12d, %esi
cmpq $0x0, 0x20(%rbx)
je 0x222ef
movzbl %sil, %edi
shll $0x3, %edi
xorl %r8d, %r8d
cmpq %rdx, %r8
je 0x222ef
xorl %r9d, %r9d
cmpq %r9, %rcx
je 0x222ea
movq 0x68(%rbx), %r10
movq 0x80(%rbx), %r11
movq (%r10,%r9,8), %r10
movq (%r10,%rax,8), %r10
movsd (%r10,%rdi), %xmm1
movq (%r11,%r9,8), %r10
movq (%r10,%rax,8), %r10
movsd (%r10,%rdi), %xmm2
subsd %xmm1, %xmm2
xorpd %xmm0, %xmm1
movsd (%r10,%r8,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 %r9
jmp 0x2229b
incq %r8
jmp 0x22293
incq %rax
jmp 0x221df
movsbl %al, %edx
movq 0x16cd7(%rip), %rax     # 0x38fd8
movq (%rax), %rdi
leaq 0xb50a(%rip), %rsi      # 0x2d815
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x4350
testb %bpl, %bpl
cmovlel %r14d, %ebp
testb %r12b, %r12b
cmovlel %r14d, %r12d
testb %r13b, %r13b
cmovgl %r13d, %r14d
movzbl %r12b, %eax
movq %rax, (%rsp)
xorpd %xmm4, %xmm4
movl %r14d, %r13d
movapd %xmm4, 0x10(%rsp)
movapd %xmm4, %xmm0
unpckhpd %xmm4, %xmm0            # xmm0 = xmm0[1],xmm4[1]
callq 0x67cb
movapd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
cmplesd %xmm1, %xmm0
andpd %xmm1, %xmm0
movzbl %bpl, %r12d
movzbl %r13b, %r8d
xorl %eax, %eax
movq 0x28(%rsp), %r14
movq (%rsp), %r13
cmpq %r13, %rax
je 0x22446
cmpq $0x0, 0x10(%rbx)
je 0x223a4
movq 0x58(%rbx), %rcx
movq 0xb8(%rbx), %rdx
movsd (%rdx,%rax,8), %xmm1
mulsd %xmm0, %xmm1
subsd (%rcx,%rax,8), %xmm1
movsd %xmm1, (%rdx,%rax,8)
cmpq $0x0, 0x18(%rbx)
je 0x223f1
xorl %ecx, %ecx
cmpq %r13, %rcx
je 0x223f1
xorl %edx, %edx
cmpq %rdx, %r12
je 0x223ec
movq 0x60(%rbx), %rsi
movq 0xc0(%rbx), %rdi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%rax,8), %rsi
movq (%rdi,%rdx,8), %rdi
movq (%rdi,%rax,8), %rdi
movsd (%rdi,%rcx,8), %xmm1
mulsd %xmm0, %xmm1
subsd (%rsi,%rcx,8), %xmm1
movsd %xmm1, (%rdi,%rcx,8)
incq %rdx
jmp 0x223b4
incq %rcx
jmp 0x223ad
cmpq $0x0, 0x20(%rbx)
je 0x2243e
xorl %ecx, %ecx
cmpq %r8, %rcx
je 0x2243e
xorl %edx, %edx
cmpq %rdx, %r12
je 0x22439
movq 0x68(%rbx), %rsi
movq 0xc8(%rbx), %rdi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%rax,8), %rsi
movq (%rdi,%rdx,8), %rdi
movq (%rdi,%rax,8), %rdi
movsd (%rdi,%rcx,8), %xmm1
mulsd %xmm0, %xmm1
subsd (%rsi,%rcx,8), %xmm1
movsd %xmm1, (%rdi,%rcx,8)
incq %rdx
jmp 0x22401
incq %rcx
jmp 0x223fa
incq %rax
jmp 0x22376
pushq $0x6
popq %rsi
movq %rbx, %rdi
movq %r8, 0x30(%rsp)
callq 0xac12
pushq $0x5
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xa854
movq 0x88(%r14), %rax
movsd 0x968(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0xd0(%rbx), %esi
movq 0xd8(%rbx), %rdx
movq %r14, %rdi
callq 0xe400
movsd %xmm0, 0x40(%rsp)
pushq $0x1
popq %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0xa97e
movq 0x30(%rsp), %r9
xorpd %xmm2, %xmm2
xorl %eax, %eax
cmpq %r13, %rax
je 0x22560
cmpq $0x0, 0x10(%rbx)
je 0x224d0
movq 0x58(%rbx), %rcx
movq 0xb8(%rbx), %rdx
movsd (%rcx,%rax,8), %xmm2
mulsd (%rdx,%rax,8), %xmm2
cmpq $0x0, 0x18(%rbx)
je 0x22514
xorl %ecx, %ecx
cmpq %r13, %rcx
je 0x22514
xorl %edx, %edx
cmpq %rdx, %r12
je 0x2250f
movq 0x60(%rbx), %rsi
movq 0xc0(%rbx), %rdi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%rax,8), %rsi
movsd (%rsi,%rcx,8), %xmm2
movq (%rdi,%rdx,8), %rsi
movq (%rsi,%rax,8), %rsi
mulsd (%rsi,%rcx,8), %xmm2
incq %rdx
jmp 0x224e0
incq %rcx
jmp 0x224d9
cmpq $0x0, 0x20(%rbx)
je 0x22558
xorl %ecx, %ecx
cmpq %r9, %rcx
je 0x22558
xorl %edx, %edx
cmpq %rdx, %r12
je 0x22553
movq 0x68(%rbx), %rsi
movq 0xc8(%rbx), %rdi
movq (%rsi,%rdx,8), %rsi
movq (%rsi,%rax,8), %rsi
movsd (%rsi,%rcx,8), %xmm2
movq (%rdi,%rdx,8), %rsi
movq (%rsi,%rax,8), %rsi
mulsd (%rsi,%rcx,8), %xmm2
incq %rdx
jmp 0x22524
incq %rcx
jmp 0x2251d
incq %rax
jmp 0x224ab
xorpd %xmm3, %xmm3
xorl %r15d, %r15d
movsbl 0xf(%rsp), %ebp
xorl %eax, %eax
movsd 0x10(%rsp), %xmm1
movsd %xmm2, 0x38(%rsp)
testb $0x1, %al
jne 0x2288a
movq 0x88(%r14), %rax
ucomisd 0x970(%rax), %xmm1
jbe 0x22870
xorl %eax, %eax
cmpq %r13, %rax
je 0x2268a
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x225cc
movq 0x88(%rbx), %rdx
movq 0xb8(%rbx), %rsi
movsd (%rsi,%rax,8), %xmm0
mulsd %xmm1, %xmm0
addsd (%rdx,%rax,8), %xmm0
movsd %xmm0, (%rcx,%rax,8)
movq 0x18(%rbx), %rcx
testq %rcx, %rcx
je 0x22627
xorl %edx, %edx
cmpq %r13, %rdx
je 0x22627
xorl %esi, %esi
cmpq %rsi, %r12
je 0x22622
movq 0x90(%rbx), %rdi
movq 0xc0(%rbx), %r8
movq (%rdi,%rsi,8), %rdi
movq (%rdi,%rax,8), %rdi
movq (%r8,%rsi,8), %r8
movq (%r8,%rax,8), %r8
movsd (%r8,%rdx,8), %xmm0
mulsd %xmm1, %xmm0
addsd (%rdi,%rdx,8), %xmm0
movq (%rcx,%rsi,8), %rdi
movq (%rdi,%rax,8), %rdi
movsd %xmm0, (%rdi,%rdx,8)
incq %rsi
jmp 0x225de
incq %rdx
jmp 0x225d7
movq 0x20(%rbx), %rcx
testq %rcx, %rcx
je 0x22682
xorl %edx, %edx
cmpq %r9, %rdx
je 0x22682
xorl %esi, %esi
cmpq %rsi, %r12
je 0x2267d
movq 0x98(%rbx), %rdi
movq 0xc8(%rbx), %r8
movq (%rdi,%rsi,8), %rdi
movq (%rdi,%rax,8), %rdi
movq (%r8,%rsi,8), %r8
movq (%r8,%rax,8), %r8
movsd (%r8,%rdx,8), %xmm0
mulsd %xmm1, %xmm0
addsd (%rdi,%rdx,8), %xmm0
movq (%rcx,%rsi,8), %rdi
movq (%rdi,%rax,8), %rdi
movsd %xmm0, (%rdi,%rdx,8)
incq %rsi
jmp 0x22639
incq %rdx
jmp 0x22632
incq %rax
jmp 0x22599
movsd %xmm1, 0x10(%rsp)
movq %r14, %rdi
callq 0xe1de
movq 0x10(%rbx), %rdi
testb %al, %al
je 0x226c3
testq %rdi, %rdi
je 0x2272c
cmpb $0x0, 0x80(%r14)
je 0x22721
movq 0xa0(%r14), %rsi
movq 0xb8(%r14), %rdx
jmp 0x22725
testq %rdi, %rdi
je 0x226cf
movl %ebp, %esi
callq 0x5600
xorl %r14d, %r14d
cmpq %r13, %r14
je 0x227e9
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x22718
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x226fb
movq (%rax,%r13,8), %rax
movq (%rax,%r14,8), %rdi
movl %ebp, %esi
callq 0x5600
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x22713
movq (%rax,%r13,8), %rax
movq (%rax,%r14,8), %rdi
movl %ebp, %esi
callq 0x5600
incq %r13
jmp 0x226de
incq %r14
movq (%rsp), %r13
jmp 0x226d2
xorl %esi, %esi
xorl %edx, %edx
movl %ebp, %ecx
callq 0x5d80
xorl %r13d, %r13d
cmpq (%rsp), %r13
je 0x227e9
xorl %r14d, %r14d
cmpq %r14, %r12
je 0x227e1
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x2278f
movq 0x28(%rsp), %rdx
cmpb $0x0, 0x80(%rdx)
movq (%rax,%r14,8), %rax
movq 0xa8(%rdx), %rcx
cmoveq %r15, %rcx
movq (%rax,%r13,8), %rdi
movq (%rcx,%r14,8), %rax
movq (%rax,%r13,8), %rsi
movq 0xc0(%rdx), %rax
cmoveq %r15, %rax
movq (%rax,%r14,8), %rax
movq (%rax,%r13,8), %rdx
movl %ebp, %ecx
callq 0x5d80
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x227d9
movq 0x28(%rsp), %rdx
cmpb $0x0, 0x80(%rdx)
movq (%rax,%r14,8), %rax
movq 0xb0(%rdx), %rcx
cmoveq %r15, %rcx
movq (%rax,%r13,8), %rdi
movq (%rcx,%r14,8), %rax
movq (%rax,%r13,8), %rsi
movq 0xc8(%rdx), %rax
cmoveq %r15, %rax
movq (%rax,%r14,8), %rax
movq (%rax,%r13,8), %rdx
movl %ebp, %ecx
callq 0x5d80
incq %r14
jmp 0x2273c
incq %r13
jmp 0x2272f
movl 0xd0(%rbx), %esi
movq 0xd8(%rbx), %rdx
movq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x2012a
movl 0xd0(%rbx), %esi
movq 0xd8(%rbx), %rdx
movq %r14, %rdi
callq 0xe400
movapd %xmm0, %xmm3
movq 0x88(%r14), %rcx
movsd 0x950(%rcx), %xmm0
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x38(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd 0x40(%rsp), %xmm0
ucomisd %xmm3, %xmm0
setae %al
movsd 0xa09c(%rip), %xmm0     # 0x2c8f0
jae 0x2285e
movsd 0x960(%rcx), %xmm0
divsd %xmm0, %xmm1
movq (%rsp), %r13
movq 0x30(%rsp), %r9
jmp 0x2257a
pushq $0x5
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
movsd %xmm3, 0x10(%rsp)
callq 0xa97e
movsd 0x10(%rsp), %xmm3
movsd %xmm3, 0x10(%rsp)
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0xa904
movsd 0x10(%rsp), %xmm0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq