// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblem.cpp
// Function: HMMProblem::doConjugateLinearStepBig(FitBit**, int)
NUMBER HMMProblem::doConjugateLinearStepBig(FitBit **fbs, NCAT nfbs) {
	NPAR i=0, j=0, m=0;
    NPAR nS = this->p->nS, nO = this->p->nO;
    NCAT q=0;
    
    // compute beta_gradient_direction
    NUMBER beta_grad = 0, beta_grad_num = 0, beta_grad_den = 0;

    for(q=0;q<nfbs;q++) {
	// first scale down gradients
        fbs[q]->doLog10ScaleGentleByRow(FBS_GRAD);
    
        
        switch (this->p->solver_setting) {
            case 1: // Fletcher-Reeves
                for(i=0; i<nS; i++)
                {
                    if(fbs[q]->pi != NULL) {
                        beta_grad_num += fbs[q]->gradPI  [i]*fbs[q]->gradPI  [i];
                        beta_grad_den += fbs[q]->gradPIm1[i]*fbs[q]->gradPIm1[i];
                    }
                    if(fbs[q]->A  != NULL)
                        for(j=0; j<nS; j++) {
                            beta_grad_num += fbs[q]->gradA  [i][j]*fbs[q]->gradA  [i][j];
                            beta_grad_den += fbs[q]->gradAm1[i][j]*fbs[q]->gradAm1[i][j];
                        }
                    if(fbs[q]->B  != NULL)
                        for(m=0; m<nO; m++) {
                            beta_grad_num += fbs[q]->gradB  [i][m]*fbs[q]->gradB  [i][m];
                            beta_grad_den += fbs[q]->gradBm1[i][m]*fbs[q]->gradBm1[i][m];
                        }
                }
                break;
            case 2: // Polak–Ribiere
                for(i=0; i<nS; i++)
                {
                    if(fbs[q]->pi != NULL) {
                        beta_grad_num += -fbs[q]->gradPI[i]*(-fbs[q]->gradPI[i] + fbs[q]->gradPIm1[i]);
                        beta_grad_den +=  fbs[q]->gradPIm1[i]*fbs[q]->gradPIm1[i];
                    }
                    if(fbs[q]->A != NULL)
                        for(j=0; j<nS; j++) {
                            beta_grad_num += -fbs[q]->gradA[i][j]*(-fbs[q]->gradA[i][j] + fbs[q]->gradAm1[i][j]);
                            beta_grad_den +=  fbs[q]->gradAm1[i][j]*fbs[q]->gradAm1[i][j];
                        }
                    if(fbs[q]->B  != NULL)
                        for(m=0; m<nO; m++) {
                            beta_grad_num += -fbs[q]->gradB[i][j]*(-fbs[q]->gradB[i][j] + fbs[q]->gradBm1[i][j]);
                            beta_grad_den +=  fbs[q]->gradBm1[i][m]*fbs[q]->gradBm1[i][m];
                        }
                }
                break;
            case 3: // Hestenes-Stiefel
                for(i=0; i<nS; i++)
                {
                    if(fbs[q]->pi != NULL) {
                        beta_grad_num += -fbs[q]->gradPI[i]*( -fbs[q]->gradPI[i] + fbs[q]->gradPIm1[i]);
                        beta_grad_den +=  fbs[q]->dirPIm1[i]*(-fbs[q]->gradPI[i] + fbs[q]->gradPIm1[i]);
                    }
                    if(fbs[q]->A  != NULL)
                        for(j=0; j<nS; j++) {
                            beta_grad_num += -fbs[q]->gradA[i][j]*( -fbs[q]->gradA[i][j] + fbs[q]->gradAm1[i][j]);
                            beta_grad_den +=  fbs[q]->dirAm1[i][j]*(-fbs[q]->gradA[i][j] + fbs[q]->gradAm1[i][j]);
                        }
                    if(fbs[q]->B  != NULL)
                        for(m=0; m<nO; m++) {
                            beta_grad_num += -fbs[q]->gradB[i][j]*( -fbs[q]->gradB[i][j] + fbs[q]->gradBm1[i][j]);
                            beta_grad_den +=  fbs[q]->dirBm1[i][m]*(-fbs[q]->gradB[i][j] + fbs[q]->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(fbs[q]->pi != NULL) fbs[q]->dirPIm1[i] = -fbs[q]->gradPI[i] + beta_grad * fbs[q]->dirPIm1[i];
            if(fbs[q]->A  != NULL) for(j=0; j<nS; j++) fbs[q]->dirAm1[i][j] = -fbs[q]->gradA[i][j] + beta_grad * fbs[q]->dirAm1[i][j];
            if(fbs[q]->B  != NULL) for(m=0; m<nO; m++) fbs[q]->dirBm1[i][m] = -fbs[q]->gradB[i][m] + beta_grad * fbs[q]->dirBm1[i][m];
        }
        // scale down direction
        fbs[q]->doLog10ScaleGentleByRow(FBS_DIRm1);
        
        fbs[q]->init(FBS_PARcopy);
    }// all fbs
        
	NUMBER e = this->p->ArmijoSeed; // step seed
	bool compliesArmijo = false;
	NUMBER f_xk = HMMProblem::getSumLogPOPara(this->p->nSeq, this->p->k_data);
	NUMBER f_xkplus1 = 0;
	
	NUMBER p_k_by_neg_p_k = 0;
    for(q=0;q<nfbs;q++) {
        fbs[q]->copy(FBS_PAR, FBS_PARcopy);
        // compute p_k * -p_k >>>> now current gradient by current direction
        for(i=0; i<nS; i++)
        {
            if(fbs[q]->pi != NULL) p_k_by_neg_p_k = fbs[q]->gradPI[i]*fbs[q]->dirPIm1[i];
            if(fbs[q]->A  != NULL) for(j=0; j<nS; j++) p_k_by_neg_p_k = fbs[q]->gradA[i][j]*fbs[q]->dirAm1[i][j];
            if(fbs[q]->B  != NULL) for(m=0; m<nO; m++) p_k_by_neg_p_k = fbs[q]->gradB[i][m]*fbs[q]->dirBm1[i][m];
        }
    }
    
	int iter = 0; // limit iter steps to 20, actually now 10, via ArmijoMinStep
	while( !compliesArmijo && e > this->p->ArmijoMinStep) {
        for(q=0;q<nfbs;q++) {
            // update
            for(i=0; i<nS; i++) {
                if(fbs[q]->pi != NULL) fbs[q]->pi[i] = fbs[q]->PIcopy[i] + e * fbs[q]->dirPIm1[i];
                if(fbs[q]->A  != NULL)
                    for(j=0; j<nS; j++)
                        fbs[q]->A[i][j] = fbs[q]->Acopy[i][j] + e * fbs[q]->dirAm1[i][j];
                if(fbs[q]->B  != NULL)
                    for(m=0; m<nO; m++)
                        fbs[q]->B[i][m] = fbs[q]->Bcopy[i][m] + e * fbs[q]->dirBm1[i][m];
            }
            // scale
            if( !this->hasNon01Constraints() || fbs[q]->observe_non01_boundaries==0 ) {
                if(fbs[q]->pi != NULL) projectsimplex(fbs[q]->pi, nS);
                for(i=0; i<nS; i++) {
                    if(fbs[q]->A != NULL) projectsimplex(fbs[q]->A[i], nS);
                    if(fbs[q]->B != NULL) projectsimplex(fbs[q]->B[i], nO);
                }
            } else {
                if(fbs[q]->pi != NULL) projectsimplexbounded(fbs[q]->pi, this->getLbPI(), this->getUbPI(), nS);
                for(i=0; i<nS; i++) {
                    if(fbs[q]->A != NULL) projectsimplexbounded(fbs[q]->A[i], this->getLbA()[i], this->getUbA()[i], nS);
                    if(fbs[q]->B != NULL) projectsimplexbounded(fbs[q]->B[i], this->getLbB()[i], this->getUbB()[i], nO);
                }
            }
        }
		// recompute alpha and p(O|param)
		computeAlphaAndPOParam(this->p->nSeq, this->p->k_data);
		// compute f(x_{k+1})
		f_xkplus1 = HMMProblem::getSumLogPOPara(this->p->nSeq, this->p->k_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;
        for(q=0;q<nfbs;q++) fbs[q]->copy(FBS_PARcopy, FBS_PAR);
    }
    //    RecycleFitData(xndat, x_data, this->p);
    return f_xkplus1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, 0x20(%rsp)
movq 0x88(%rdi), %rax
movzbl 0x8b8(%rax), %r15d
movzbl 0x8b9(%rax), %r13d
movl %edx, 0x14(%rsp)
testl %edx, %edx
jle 0x17012
movl 0x14(%rsp), %r14d
xorpd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
xorl %ebp, %ebp
movsd %xmm0, 0x8(%rsp)
xorl %r12d, %r12d
movq (%rbx,%rbp,8), %rdi
movl $0x3, %esi
callq 0xb768
movq 0x20(%rsp), %rax
movq 0x88(%rax), %rax
movzbl 0x40(%rax), %eax
cmpl $0x1, %eax
je 0x16cb3
cmpl $0x2, %eax
je 0x16da1
cmpl $0x3, %eax
movsd 0x18(%rsp), %xmm3
movapd 0x1ddb6(%rip), %xmm4    # 0x34940
movsd 0x8(%rsp), %xmm5
jne 0x16fe6
testb %r15b, %r15b
jle 0x16ec2
testb %r13b, %r13b
setle %dil
movq (%rbx,%rbp,8), %rax
movq 0x10(%rax), %rcx
cmpq $0x0, 0x20(%rax)
movq 0x18(%rax), %rdx
sete %sil
orb %dil, %sil
xorl %edi, %edi
testq %rcx, %rcx
je 0x16bf6
movq 0x58(%rax), %r8
movq 0x70(%rax), %r9
movsd (%r8,%rdi,8), %xmm0
movsd (%r9,%rdi,8), %xmm1
subsd %xmm0, %xmm1
mulsd %xmm1, %xmm0
subsd %xmm0, %xmm5
movq 0xd0(%rax), %r8
mulsd (%r8,%rdi,8), %xmm1
addsd %xmm1, %xmm3
testq %rdx, %rdx
je 0x16c46
movq 0x60(%rax), %r8
movq 0x78(%rax), %r9
movq (%r8,%rdi,8), %r8
movq (%r9,%rdi,8), %r9
movq 0xd8(%rax), %r10
movq (%r10,%rdi,8), %r10
xorl %r11d, %r11d
movsd (%r8,%r11,8), %xmm0
movsd (%r9,%r11,8), %xmm1
subsd %xmm0, %xmm1
mulsd %xmm1, %xmm0
mulsd (%r10,%r11,8), %xmm1
subsd %xmm0, %xmm5
addsd %xmm1, %xmm3
incq %r11
cmpq %r11, %r15
jne 0x16c19
movl %r15d, %r12d
testb %sil, %sil
jne 0x16ca2
movq 0x68(%rax), %r8
movq 0x80(%rax), %r9
movq (%r8,%rdi,8), %r8
movsbq %r12b, %r10
movsd (%r8,%r10,8), %xmm0
movq (%r9,%rdi,8), %r8
movsd (%r8,%r10,8), %xmm1
subsd %xmm0, %xmm1
xorpd %xmm4, %xmm0
movq 0xe0(%rax), %r8
movq (%r8,%rdi,8), %r8
mulsd %xmm1, %xmm0
xorl %r9d, %r9d
addsd %xmm0, %xmm5
movsd (%r8,%r9,8), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm2, %xmm3
incq %r9
cmpq %r9, %r13
jne 0x16c88
incq %rdi
cmpq %r15, %rdi
jne 0x16bc0
jmp 0x16ec2
testb %r15b, %r15b
jle 0x16eb6
testb %r13b, %r13b
setle %dil
movq (%rbx,%rbp,8), %rax
movq 0x10(%rax), %rcx
cmpq $0x0, 0x20(%rax)
movq 0x18(%rax), %rdx
sete %sil
orb %dil, %sil
xorl %edi, %edi
movsd 0x18(%rsp), %xmm3
movsd 0x8(%rsp), %xmm5
testq %rcx, %rcx
je 0x16d12
movq 0x58(%rax), %r8
movq 0x70(%rax), %r9
movsd (%r8,%rdi,8), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm5
movsd (%r9,%rdi,8), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm3
testq %rdx, %rdx
je 0x16d51
movq 0x60(%rax), %r8
movq 0x78(%rax), %r9
movq (%r8,%rdi,8), %r8
movq (%r9,%rdi,8), %r9
xorl %r10d, %r10d
movsd (%r8,%r10,8), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm5
movsd (%r9,%r10,8), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm3
incq %r10
cmpq %r10, %r15
jne 0x16d2a
movl %r15d, %r12d
testb %sil, %sil
jne 0x16d90
movq 0x68(%rax), %r8
movq 0x80(%rax), %r9
movq (%r8,%rdi,8), %r8
movq (%r9,%rdi,8), %r9
xorl %r10d, %r10d
movsd (%r8,%r10,8), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm5
movsd (%r9,%r10,8), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm3
incq %r10
cmpq %r10, %r13
jne 0x16d6c
incq %rdi
cmpq %r15, %rdi
jne 0x16ce9
jmp 0x16ec2
testb %r15b, %r15b
movsd 0x18(%rsp), %xmm3
movapd 0x1db8e(%rip), %xmm4    # 0x34940
movsd 0x8(%rsp), %xmm5
jle 0x16ec2
testb %r13b, %r13b
setle %dil
movq (%rbx,%rbp,8), %rax
movq 0x10(%rax), %rcx
cmpq $0x0, 0x20(%rax)
movq 0x18(%rax), %rdx
sete %sil
orb %dil, %sil
xorl %edi, %edi
testq %rcx, %rcx
je 0x16e10
movq 0x58(%rax), %r8
movq 0x70(%rax), %r9
movsd (%r8,%rdi,8), %xmm0
movsd (%r9,%rdi,8), %xmm1
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
subsd %xmm2, %xmm5
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm3
testq %rdx, %rdx
je 0x16e57
movq 0x60(%rax), %r8
movq 0x78(%rax), %r9
movq (%r8,%rdi,8), %r8
movq (%r9,%rdi,8), %r9
xorl %r10d, %r10d
movsd (%r8,%r10,8), %xmm0
movsd (%r9,%r10,8), %xmm1
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
subsd %xmm2, %xmm5
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm3
incq %r10
cmpq %r10, %r15
jne 0x16e28
movl %r15d, %r12d
testb %sil, %sil
jne 0x16ea8
movq 0x68(%rax), %r8
movq 0x80(%rax), %r9
movq (%r8,%rdi,8), %r8
movsbq %r12b, %r10
movsd (%r8,%r10,8), %xmm0
movq (%r9,%rdi,8), %r8
movsd (%r8,%r10,8), %xmm1
subsd %xmm0, %xmm1
xorpd %xmm4, %xmm0
mulsd %xmm1, %xmm0
xorl %r9d, %r9d
addsd %xmm0, %xmm5
movsd (%r8,%r9,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm3
incq %r9
cmpq %r9, %r13
jne 0x16e8e
incq %rdi
cmpq %r15, %rdi
jne 0x16ddf
jmp 0x16ec2
movsd 0x18(%rsp), %xmm3
movsd 0x8(%rsp), %xmm5
movsd %xmm5, 0x8(%rsp)
movsd %xmm3, 0x18(%rsp)
movapd %xmm3, %xmm0
callq 0x8d88
testb %r15b, %r15b
jle 0x16fbc
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
cmplesd %xmm1, %xmm0
andpd %xmm1, %xmm0
testb %r13b, %r13b
setle %dil
movq (%rbx,%rbp,8), %rax
movq 0x10(%rax), %rcx
cmpq $0x0, 0x20(%rax)
movq 0x18(%rax), %rdx
sete %sil
orb %dil, %sil
xorl %edi, %edi
testq %rcx, %rcx
je 0x16f3e
movq 0x58(%rax), %r8
movq 0xd0(%rax), %r9
movsd (%r9,%rdi,8), %xmm1
mulsd %xmm0, %xmm1
subsd (%r8,%rdi,8), %xmm1
movsd %xmm1, (%r9,%rdi,8)
testq %rdx, %rdx
je 0x16f77
movq 0x60(%rax), %r8
movq 0xd8(%rax), %r9
movq (%r8,%rdi,8), %r8
movq (%r9,%rdi,8), %r9
xorl %r12d, %r12d
movsd (%r9,%r12,8), %xmm1
mulsd %xmm0, %xmm1
subsd (%r8,%r12,8), %xmm1
movsd %xmm1, (%r9,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x16f59
testb %sil, %sil
jne 0x16fb0
movq 0x68(%rax), %r8
movq 0xe0(%rax), %r9
movq (%r8,%rdi,8), %r8
movq (%r9,%rdi,8), %r9
xorl %r10d, %r10d
movsd (%r9,%r10,8), %xmm1
mulsd %xmm0, %xmm1
subsd (%r8,%r10,8), %xmm1
movsd %xmm1, (%r9,%r10,8)
incq %r10
cmpq %r10, %r13
jne 0x16f92
incq %rdi
cmpq %r15, %rdi
jne 0x16f18
movq (%rbx,%rbp,8), %rdi
movl $0x6, %esi
callq 0xb768
movq (%rbx,%rbp,8), %rdi
movl $0x5, %esi
callq 0xaf08
incq %rbp
cmpq %r14, %rbp
jne 0x16b49
jmp 0x17012
movsbl %al, %edx
movq 0x28fe8(%rip), %rax     # 0x3ffd8
movq (%rax), %rdi
leaq 0x1e78b(%rip), %rsi     # 0x35785
xorl %eax, %eax
callq 0x4330
movsd 0x8(%rsp), %xmm5
movsd 0x18(%rsp), %xmm3
jmp 0x16ec2
movq 0x20(%rsp), %rax
movq 0x88(%rax), %rax
movslq 0x8dc(%rax), %rcx
xorpd %xmm2, %xmm2
xorpd %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
testq %rcx, %rcx
jle 0x17072
movq 0x8f0(%rax), %rdx
movsd %xmm0, 0x30(%rsp)
xorl %esi, %esi
movq (%rdx,%rsi,8), %rdi
cmpl $0x0, 0x4(%rdi)
xorpd %xmm0, %xmm0
jne 0x1705a
movsd 0x50(%rdi), %xmm0
movsd 0x30(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x30(%rsp)
incq %rsi
cmpq %rsi, %rcx
jne 0x17047
movsd 0x968(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
cmpl $0x0, 0x14(%rsp)
jle 0x17176
leal -0x1(%r15), %eax
leal -0x1(%r13), %ecx
movl 0x14(%rsp), %edx
movq %rdx, 0x18(%rsp)
movsbq %al, %rbp
movsbq %cl, %r12
xorpd %xmm2, %xmm2
xorl %r14d, %r14d
movsd %xmm2, 0x28(%rsp)
movq (%rbx,%r14,8), %rdi
movl $0x1, %esi
movl $0x5, %edx
callq 0xb032
testb %r15b, %r15b
jle 0x17162
testb %r13b, %r13b
setle %dil
movq (%rbx,%r14,8), %rax
movq 0x10(%rax), %rcx
cmpq $0x0, 0x20(%rax)
movq 0x18(%rax), %rdx
sete %sil
orb %dil, %sil
xorl %edi, %edi
movsd 0x28(%rsp), %xmm2
testq %rcx, %rcx
je 0x17110
movq 0x58(%rax), %r8
movq 0xd0(%rax), %r9
movsd (%r8,%rdi,8), %xmm2
mulsd (%r9,%rdi,8), %xmm2
testq %rdx, %rdx
je 0x17134
movq 0x60(%rax), %r8
movq 0xd8(%rax), %r9
movq (%r8,%rdi,8), %r8
movsd (%r8,%rbp,8), %xmm2
movq (%r9,%rdi,8), %r8
mulsd (%r8,%rbp,8), %xmm2
testb %sil, %sil
jne 0x17158
movq 0x68(%rax), %r8
movq 0xe0(%rax), %r9
movq (%r8,%rdi,8), %r8
movsd (%r8,%r12,8), %xmm2
movq (%r9,%rdi,8), %r8
mulsd (%r8,%r12,8), %xmm2
incq %rdi
cmpq %rdi, %r15
jne 0x170f4
jmp 0x17168
movsd 0x28(%rsp), %xmm2
incq %r14
cmpq 0x18(%rsp), %r14
jne 0x170ab
movq 0x20(%rsp), %rax
movq 0x88(%rax), %rax
movsd 0x8(%rsp), %xmm0
ucomisd 0x970(%rax), %xmm0
jbe 0x174d6
movl 0x14(%rsp), %eax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
movsd %xmm2, 0x28(%rsp)
cmpl $0x0, 0x14(%rsp)
movsd 0x8(%rsp), %xmm1
jle 0x17401
xorl %r12d, %r12d
testb %r15b, %r15b
jle 0x1729d
testb %r13b, %r13b
setle %r8b
movq (%rbx,%r12,8), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rsi
testq %rsi, %rsi
sete %dil
orb %r8b, %dil
xorl %r8d, %r8d
testq %rcx, %rcx
je 0x17211
movq 0xa0(%rax), %r9
movq 0xd0(%rax), %r10
movsd (%r10,%r8,8), %xmm0
mulsd %xmm1, %xmm0
addsd (%r9,%r8,8), %xmm0
movsd %xmm0, (%rcx,%r8,8)
testq %rdx, %rdx
je 0x17251
movq 0xa8(%rax), %r9
movq 0xd8(%rax), %r10
movq (%r9,%r8,8), %r9
movq (%r10,%r8,8), %r10
movq (%rdx,%r8,8), %r11
xorl %r14d, %r14d
movsd (%r10,%r14,8), %xmm0
mulsd %xmm1, %xmm0
addsd (%r9,%r14,8), %xmm0
movsd %xmm0, (%r11,%r14,8)
incq %r14
cmpq %r14, %r15
jne 0x17233
testb %dil, %dil
jne 0x17291
movq 0xb0(%rax), %r9
movq 0xe0(%rax), %r10
movq (%r9,%r8,8), %r9
movq (%r10,%r8,8), %r10
movq (%rsi,%r8,8), %r11
xorl %r14d, %r14d
movsd (%r10,%r14,8), %xmm0
mulsd %xmm1, %xmm0
addsd (%r9,%r14,8), %xmm0
movsd %xmm0, (%r11,%r14,8)
incq %r14
cmpq %r14, %r13
jne 0x17273
incq %r8
cmpq %r15, %r8
jne 0x171e8
movq 0x20(%rsp), %rax
cmpb $0x1, 0x80(%rax)
jne 0x17387
movq (%rbx,%r12,8), %rax
cmpb $0x0, 0xf9(%rax)
je 0x17387
movq 0x10(%rax), %rdi
testq %rdi, %rdi
je 0x172e5
movq 0x20(%rsp), %rax
movq 0x50(%rax), %rsi
movq 0x68(%rax), %rdx
movsbl %r15b, %ecx
callq 0x79f5
movsd 0x8(%rsp), %xmm1
testb %r15b, %r15b
jle 0x173f3
xorl %r14d, %r14d
movq (%rbx,%r12,8), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x17335
movq (%rax,%r14,8), %rdi
movq 0x20(%rsp), %rcx
cmpb $0x0, 0x80(%rcx)
movq 0x58(%rcx), %rax
cmoveq %rbp, %rax
movq (%rax,%r14,8), %rsi
movq 0x70(%rcx), %rax
cmoveq %rbp, %rax
movq (%rax,%r14,8), %rdx
movsbl %r15b, %ecx
callq 0x79f5
movsd 0x8(%rsp), %xmm1
movq (%rbx,%r12,8), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x17379
movq (%rax,%r14,8), %rdi
movq 0x20(%rsp), %rcx
cmpb $0x0, 0x80(%rcx)
movq 0x60(%rcx), %rax
cmoveq %rbp, %rax
movq (%rax,%r14,8), %rsi
movq 0x78(%rcx), %rax
cmoveq %rbp, %rax
movq (%rax,%r14,8), %rdx
movsbl %r13b, %ecx
callq 0x79f5
movsd 0x8(%rsp), %xmm1
incq %r14
cmpq %r14, %r15
jne 0x172f1
jmp 0x173f3
movq (%rbx,%r12,8), %rax
movq 0x10(%rax), %rdi
testq %rdi, %rdi
je 0x173a3
movsbl %r15b, %esi
callq 0x692d
movsd 0x8(%rsp), %xmm1
testb %r15b, %r15b
jle 0x173f3
xorl %r14d, %r14d
movq (%rbx,%r12,8), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x173cb
movq (%rax,%r14,8), %rdi
movsbl %r15b, %esi
callq 0x692d
movsd 0x8(%rsp), %xmm1
movq (%rbx,%r12,8), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x173eb
movq (%rax,%r14,8), %rdi
movsbl %r13b, %esi
callq 0x692d
movsd 0x8(%rsp), %xmm1
incq %r14
cmpq %r14, %r15
jne 0x173ab
incq %r12
cmpq 0x18(%rsp), %r12
jne 0x171bb
movq 0x20(%rsp), %r14
movq 0x88(%r14), %rax
movl 0x8dc(%rax), %esi
movq 0x8f0(%rax), %rdx
movq %r14, %rdi
callq 0x11a86
movq 0x88(%r14), %rax
movslq 0x8dc(%rax), %rcx
testq %rcx, %rcx
jle 0x17469
movq 0x8f0(%rax), %rdx
xorpd %xmm0, %xmm0
xorl %esi, %esi
movsd 0x28(%rsp), %xmm2
movq (%rdx,%rsi,8), %rdi
cmpl $0x0, 0x4(%rdi)
xorpd %xmm1, %xmm1
jne 0x1745b
movsd 0x50(%rdi), %xmm1
addsd %xmm1, %xmm0
incq %rsi
cmpq %rsi, %rcx
jne 0x17448
jmp 0x17473
xorpd %xmm0, %xmm0
movsd 0x28(%rsp), %xmm2
movsd 0x950(%rax), %xmm3
mulsd 0x8(%rsp), %xmm3
mulsd %xmm2, %xmm3
addsd 0x30(%rsp), %xmm3
ucomisd %xmm0, %xmm3
setae %cl
movsd 0x1d456(%rip), %xmm1    # 0x348f0
jae 0x174a4
movsd 0x960(%rax), %xmm1
ucomisd %xmm0, %xmm3
jae 0x17516
movsd 0x8(%rsp), %xmm3
divsd %xmm1, %xmm3
movq 0x20(%rsp), %rax
movq 0x88(%rax), %rax
movsd %xmm3, 0x8(%rsp)
ucomisd 0x970(%rax), %xmm3
ja 0x171a7
jmp 0x174dc
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
cmpl $0x0, 0x14(%rsp)
jle 0x17516
testb %cl, %cl
jne 0x17516
movsd %xmm0, 0x8(%rsp)
movl 0x14(%rsp), %r14d
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rdi
movl $0x5, %esi
movl $0x1, %edx
callq 0xb032
incq %r15
cmpq %r15, %r14
jne 0x174f5
movsd 0x8(%rsp), %xmm0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop