// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblem.cpp
// Function: HMMProblem::doLinearStep(FitBit*)
NUMBER HMMProblem::doLinearStep(FitBit *fb) {
	NPAR i,j,m;
    NPAR nS = fb->nS, nO = this->p->nO;
    fb->doLog10ScaleGentleByRow(FBS_GRAD);
	
    NCAT xndat = fb->xndat;
    struct data **x_data = fb->x_data;
    fb->init(FBS_PARcopy);
    fb->init(FBS_GRADcopy);
    
	NUMBER e = this->p->ArmijoSeed; // step seed
	bool compliesArmijo = false;
	bool compliesWolfe2 = false; // second wolfe condition is turned on, if satisfied - honored, if not, just the 1st is used
    NUMBER e_Armijo = -1; // e (step size) at which Armijo (Wolfe 1) criterion is satisfied, 'cos both criterions are sometimes not met.
    NUMBER f_xkplus1_Armijo = 0; // f_xkplus1_Armijo at which Armijo (Wolfe 1) criterion is satisfied, 'cos both criterions are sometimes not met.
	NUMBER f_xk = HMMProblem::getSumLogPOPara(xndat, x_data);
	NUMBER f_xkplus1 = 0;
	
    fb->copy(FBS_PAR, FBS_PARcopy); // save original parameters
    fb->copy(FBS_GRAD, FBS_GRADcopy); // save original gradient
	// compute p_k * -p_k
	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->gradPI[i];
		if(fb->A  != NULL) for(j=0; j<nS; j++) p_k_by_neg_p_k -= fb->gradA[i][j]*fb->gradA[i][j];
		if(fb->B  != NULL) for(m=0; m<nO; m++) p_k_by_neg_p_k -= fb->gradB[i][m]*fb->gradB[i][m];
	}
    
	int iter = 0; // limit iter steps to 20, via ArmijoMinStep (now 10)
    while( !(compliesArmijo && compliesWolfe2) && e > this->p->ArmijoMinStep) {
		// update
		for(i=0; i<nS; i++) {
            if(fb->pi != NULL) {
                fb->pi[i] = fb->PIcopy[i] - e * fb->gradPIcopy[i];
                if( (fb->pi[i]<0 || fb->pi[i] >1) && (fb->pi[i] > 0) && (fb->pi[i] < 1) ) {
                    fprintf(stderr, "ERROR! pi value is not within [0, 1] range!\n");
                }
            }
            
            if(fb->A  != NULL)
                for(j=0; j<nS; j++) {
                    fb->A[i][j] = fb->Acopy[i][j] - e * fb->gradAcopy[i][j];
                    if( (fb->A[i][j]<0 || fb->A[i][j] >1) && (fb->A[i][j] > 0) && (fb->A[i][j] < 1) ) {
                        fprintf(stderr, "ERROR! A value is not within [0, 1] range!\n");
                    }
                }
            
            if(fb->B  != NULL)
                for(m=0; m<nO; m++) {
                    fb->B[i][m] = fb->Bcopy[i][m] - e * fb->gradBcopy[i][m];
                    if( (fb->B[i][m]<0 || fb->B[i][m] >1) && (fb->B[i][m] > 0) && (fb->B[i][m] < 1) ) {
                        fprintf(stderr, "ERROR! B value is not within [0, 1] range!\n");
                    }
                }
		}
        // project parameters to simplex if needs be
        if(fb->projecttosimplex==1) {
            // scale
            if( !this->hasNon01Constraints() || fb->observe_non01_boundaries==0 ) {
                if(fb->pi != NULL) projectsimplex(fb->pi, nS);
                for(i=0; i<nS; i++) {
                    if(fb->A  != NULL) projectsimplex(fb->A[i], nS);
                    if(fb->B  != NULL) projectsimplex(fb->B[i], nO);
                }
            } else {
                if(fb->pi != NULL) projectsimplexbounded(fb->pi, this->getLbPI(), this->getUbPI(), nS);
                for(i=0; i<nS; i++) {
                    if(fb->A  != NULL) projectsimplexbounded(fb->A[i], this->getLbA()[i], this->getUbA()[i], nS);
                    if(fb->B  != NULL) projectsimplexbounded(fb->B[i], this->getLbB()[i], this->getUbB()[i], nO);
                }
            }
        }
        
		// recompute alpha and p(O|param)
		computeAlphaAndPOParam(xndat, x_data);
		// compute f(x_{k+1})
		f_xkplus1 = HMMProblem::getSumLogPOPara(xndat, x_data);
		// compute Armijo compliance
		compliesArmijo = (f_xkplus1 <= (f_xk + (this->p->ArmijoC1 * e * p_k_by_neg_p_k)));
        
        // compute Wolfe 2
        NUMBER p_k_by_neg_p_kp1 = 0;
        // NDAT ndat = computeGradients(fb);
        fb->doLog10ScaleGentleByRow(FBS_GRAD);
        for(i=0; i<nS; i++)
        {
            if(fb->pi != NULL) p_k_by_neg_p_kp1 -= fb->gradPIcopy[i]*fb->gradPI[i];
            if(fb->A  != NULL) for(j=0; j<nS; j++) p_k_by_neg_p_kp1 -= fb->gradAcopy[i][j]*fb->gradA[i][j];
            if(fb->B  != NULL) for(m=0; m<nO; m++) p_k_by_neg_p_kp1 -= fb->gradBcopy[i][m]*fb->gradB[i][m];
        }
        compliesWolfe2 = (p_k_by_neg_p_kp1 >= this->p->ArmijoC2 * p_k_by_neg_p_k);
        
        if( compliesArmijo && e_Armijo==-1 ){
            e_Armijo = e; // save the first time Armijo is statisfied, in case we'll roll back to it when Wolfe 2 is finnaly not satisfied
            f_xkplus1_Armijo = f_xkplus1;
        }
        
		e /= (compliesArmijo && compliesWolfe2)?1:this->p->ArmijoReduceFactor;
		iter++;
	} // armijo loop
    
//    fb->copy(FBS_GRADcopy, FBS_GRAD); // return the original gradient in its place // unnecessary
    
    if(!compliesArmijo) { // we couldn't step away from current, copy the inital point back
        e = 0;
        fb->copy(FBS_PARcopy, FBS_PAR);
        f_xkplus1 = f_xk;
    } else if(compliesArmijo && !compliesWolfe2) { // we couldn't step away from current, copy the inital point back
        e = e_Armijo; // return the first Armijo-compliant e
        f_xkplus1 = f_xkplus1_Armijo; // return the first Armijo-compliant f_xkplus1
        // create new versions of FBS_PAR using e_Armijo as a step
        fb->copy(FBS_GRADcopy, FBS_GRAD); // return the old gradient
        // update
        for(i=0; i<nS; i++) {
            if(fb->pi != NULL) {
                fb->pi[i] = fb->PIcopy[i] - e * fb->gradPIcopy[i];
                if( (fb->pi[i]<0 || fb->pi[i] >1) && (fb->pi[i] > 0) && (fb->pi[i] < 1) ) {
                    fprintf(stderr, "ERROR! pi value is not within [0, 1] range!\n");
                }
            }
            if(fb->A  != NULL)
                for(j=0; j<nS; j++) {
                    fb->A[i][j] = fb->Acopy[i][j] - e * fb->gradAcopy[i][j];
                    if( (fb->A[i][j]<0 || fb->A[i][j] >1) && (fb->A[i][j] > 0) && (fb->A[i][j] < 1) ) {
                        fprintf(stderr, "ERROR! A value is not within [0, 1] range!\n");
                    }
                }
            if(fb->B  != NULL)
                for(m=0; m<nO; m++) {
                    fb->B[i][m] = fb->Bcopy[i][m] - e * fb->gradBcopy[i][m];
                    if( (fb->B[i][m]<0 || fb->B[i][m] >1) && (fb->B[i][m] > 0) && (fb->B[i][m] < 1) ) {
                        fprintf(stderr, "ERROR! B value is not within [0, 1] range!\n");
                    }
                }
        }
        // project parameters to simplex if needs be
        if(fb->projecttosimplex==1) {
            // scale
            if( !this->hasNon01Constraints() || fb->observe_non01_boundaries==0 ) {
                if(fb->pi != NULL) projectsimplex(fb->pi, nS);
                for(i=0; i<nS; i++) {
                    if(fb->A  != NULL) projectsimplex(fb->A[i], nS);
                    if(fb->B  != NULL) projectsimplex(fb->B[i], nO);
                }
            } else {
                if(fb->pi != NULL) projectsimplexbounded(fb->pi, this->getLbPI(), this->getUbPI(), nS);
                for(i=0; i<nS; i++) {
                    if(fb->A  != NULL) projectsimplexbounded(fb->A[i], this->getLbA()[i], this->getUbA()[i], nS);
                    if(fb->B  != NULL) projectsimplexbounded(fb->B[i], this->getLbB()[i], this->getUbB()[i], nO);
                }
            }
        }
        // ^^^^^ end of create new versions of FBS_PAR using e_Armijo as a step
    }
    fb->destroy(FBS_PARcopy);
    fb->destroy(FBS_GRADcopy);
    return f_xkplus1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movzbl 0x1(%rsi), %r13d
movq 0x88(%rdi), %rax
movzbl 0x8b9(%rax), %ebp
movq %rsi, %rdi
movl $0x3, %esi
callq 0xb768
movl 0xe8(%rbx), %r15d
movq 0xf0(%rbx), %r12
movq %rbx, %rdi
movl $0x5, %esi
callq 0xaf08
movq %rbx, %rdi
movl $0x9, %esi
callq 0xaf08
movq %r14, (%rsp)
movq 0x88(%r14), %rax
movq %r12, %r14
xorpd %xmm1, %xmm1
testl %r15d, %r15d
jle 0x18496
xorl %ecx, %ecx
movq (%r14,%rcx,8), %rdx
cmpl $0x0, 0x4(%rdx)
xorpd %xmm0, %xmm0
jne 0x1848a
movsd 0x50(%rdx), %xmm0
addsd %xmm0, %xmm1
incq %rcx
cmpq %rcx, %r15
jne 0x18477
movsd %xmm1, 0x48(%rsp)
movsd 0x968(%rax), %xmm0
movapd %xmm0, 0x30(%rsp)
movq %rbx, %rdi
movl $0x1, %esi
movl $0x5, %edx
callq 0xb032
movq %rbx, %rdi
movl $0x3, %esi
movl $0x9, %edx
callq 0xb032
xorpd %xmm1, %xmm1
testb %r13b, %r13b
jle 0x18560
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpq $0x0, 0x20(%rbx)
sete %sil
testb %bpl, %bpl
setle %dl
orb %sil, %dl
xorl %esi, %esi
testq %rax, %rax
je 0x1850d
movq 0x58(%rbx), %rdi
movsd (%rdi,%rsi,8), %xmm0
mulsd %xmm0, %xmm0
subsd %xmm0, %xmm1
testq %rcx, %rcx
je 0x18533
movq 0x60(%rbx), %rdi
movq (%rdi,%rsi,8), %rdi
xorl %r8d, %r8d
movsd (%rdi,%r8,8), %xmm0
mulsd %xmm0, %xmm0
subsd %xmm0, %xmm1
incq %r8
cmpq %r8, %r13
jne 0x1851d
testb %dl, %dl
jne 0x18558
movq 0x68(%rbx), %rdi
movq (%rdi,%rsi,8), %rdi
xorl %r8d, %r8d
movsd (%rdi,%r8,8), %xmm0
mulsd %xmm0, %xmm0
subsd %xmm0, %xmm1
incq %r8
cmpq %r8, %rbp
jne 0x18542
incq %rsi
cmpq %r13, %rsi
jne 0x184f7
movq (%rsp), %rax
movq 0x88(%rax), %rax
movapd 0x30(%rsp), %xmm0
ucomisd 0x970(%rax), %xmm0
jbe 0x18a7c
movsd %xmm1, 0x50(%rsp)
xorpd %xmm1, %xmm1
movsd 0x1c357(%rip), %xmm2    # 0x348e8
movsd 0x1c357(%rip), %xmm3    # 0x348f0
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r14, 0x58(%rsp)
movapd %xmm2, 0x10(%rsp)
testb %r13b, %r13b
jle 0x18738
movapd 0x30(%rsp), %xmm2
xorpd 0x1c37b(%rip), %xmm2    # 0x34940
xorl %r14d, %r14d
movapd %xmm2, 0x20(%rsp)
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x18617
movq 0x88(%rbx), %rcx
movq 0xa0(%rbx), %rdx
movsd (%rcx,%r14,8), %xmm0
mulsd %xmm2, %xmm0
addsd (%rdx,%r14,8), %xmm0
movsd %xmm0, (%rax,%r14,8)
ucomisd %xmm0, %xmm1
ja 0x18607
ucomisd %xmm3, %xmm0
jbe 0x18617
ucomisd %xmm1, %xmm0
jbe 0x18617
ucomisd %xmm0, %xmm3
ja 0x1871c
cmpq $0x0, 0x18(%rbx)
je 0x18690
xorl %r12d, %r12d
movq 0xa8(%rbx), %rax
movq (%rax,%r14,8), %rax
movq 0x18(%rbx), %rcx
movq 0x90(%rbx), %rdx
movq (%rdx,%r14,8), %rdx
movsd (%rdx,%r12,8), %xmm0
mulsd %xmm2, %xmm0
addsd (%rax,%r12,8), %xmm0
movq (%rcx,%r14,8), %rax
movsd %xmm0, (%rax,%r12,8)
ucomisd %xmm0, %xmm1
ja 0x18661
ucomisd %xmm3, %xmm0
jbe 0x1866d
ucomisd %xmm1, %xmm0
jbe 0x1866d
ucomisd %xmm0, %xmm3
ja 0x18677
incq %r12
cmpq %r12, %r13
jne 0x18621
jmp 0x18690
callq 0x4caf
movapd 0x20(%rsp), %xmm2
movsd 0x1c266(%rip), %xmm3    # 0x348f0
xorpd %xmm1, %xmm1
jmp 0x1866d
cmpq $0x0, 0x20(%rbx)
je 0x1870e
testb %bpl, %bpl
jle 0x1870e
xorl %r12d, %r12d
movq 0xb0(%rbx), %rax
movq (%rax,%r14,8), %rax
movq 0x20(%rbx), %rcx
movq 0x98(%rbx), %rdx
movq (%rdx,%r14,8), %rdx
movsd (%rdx,%r12,8), %xmm0
mulsd %xmm2, %xmm0
addsd (%rax,%r12,8), %xmm0
movq (%rcx,%r14,8), %rax
movsd %xmm0, (%rax,%r12,8)
ucomisd %xmm0, %xmm1
ja 0x186df
ucomisd %xmm3, %xmm0
jbe 0x186eb
ucomisd %xmm1, %xmm0
jbe 0x186eb
ucomisd %xmm0, %xmm3
ja 0x186f5
incq %r12
cmpq %r12, %rbp
jne 0x1869f
jmp 0x1870e
callq 0x4ccb
movapd 0x20(%rsp), %xmm2
movsd 0x1c1e8(%rip), %xmm3    # 0x348f0
xorpd %xmm1, %xmm1
jmp 0x186eb
incq %r14
cmpq %r13, %r14
jne 0x185ce
jmp 0x18738
callq 0x4c93
movapd 0x20(%rsp), %xmm2
movsd 0x1c1c1(%rip), %xmm3    # 0x348f0
xorpd %xmm1, %xmm1
jmp 0x18617
cmpb $0x1, 0xf8(%rbx)
jne 0x18865
movq (%rsp), %rax
cmpb $0x1, 0x80(%rax)
jne 0x18817
cmpb $0x0, 0xf9(%rbx)
je 0x18817
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x18781
movq (%rsp), %rax
movq 0x50(%rax), %rsi
movq 0x68(%rax), %rdx
movsbl %r13b, %ecx
callq 0x79f5
testb %r13b, %r13b
jle 0x18865
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x187cb
movq (%rax,%r14,8), %rdi
movq (%rsp), %rcx
cmpb $0x0, 0x80(%rcx)
movq 0x58(%rcx), %rax
movl $0x0, %edx
cmoveq %rdx, %rax
movq (%rax,%r14,8), %rsi
movq 0x70(%rcx), %rax
cmoveq %rdx, %rax
movq (%rax,%r14,8), %rdx
movsbl %r13b, %ecx
callq 0x79f5
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x18809
movq (%rax,%r14,8), %rdi
movq (%rsp), %rcx
cmpb $0x0, 0x80(%rcx)
movq 0x60(%rcx), %rax
movl $0x0, %edx
cmoveq %rdx, %rax
movq (%rax,%r14,8), %rsi
movq 0x78(%rcx), %rax
cmoveq %rdx, %rax
movq (%rax,%r14,8), %rdx
movsbl %bpl, %ecx
callq 0x79f5
incq %r14
cmpq %r14, %r13
jne 0x1878d
jmp 0x18865
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x18829
movsbl %r13b, %esi
callq 0x692d
testb %r13b, %r13b
jle 0x18865
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x18847
movq (%rax,%r14,8), %rdi
movsbl %r13b, %esi
callq 0x692d
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x1885d
movq (%rax,%r14,8), %rdi
movsbl %bpl, %esi
callq 0x692d
incq %r14
cmpq %r14, %r13
jne 0x18831
movq (%rsp), %rdi
movl %r15d, %esi
movq 0x58(%rsp), %r14
movq %r14, %rdx
callq 0x11a86
xorpd %xmm3, %xmm3
testl %r15d, %r15d
movsd 0x48(%rsp), %xmm1
movsd 0x50(%rsp), %xmm2
jle 0x188af
xorl %eax, %eax
movq (%r14,%rax,8), %rcx
cmpl $0x0, 0x4(%rcx)
xorpd %xmm0, %xmm0
jne 0x188a3
movsd 0x50(%rcx), %xmm0
addsd %xmm0, %xmm3
incq %rax
cmpq %rax, %r15
jne 0x18890
movq (%rsp), %rax
movq 0x88(%rax), %rax
movsd 0x950(%rax), %xmm0
mulsd 0x30(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movapd %xmm3, 0x20(%rsp)
movapd %xmm0, 0x60(%rsp)
ucomisd %xmm3, %xmm0
setae %r12b
movq %rbx, %rdi
movl $0x3, %esi
callq 0xb768
xorpd %xmm5, %xmm5
testb %r13b, %r13b
movapd 0x10(%rsp), %xmm3
jle 0x189b0
testb %bpl, %bpl
setle %sil
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpq $0x0, 0x20(%rbx)
sete %dl
orb %sil, %dl
xorl %esi, %esi
testq %rax, %rax
je 0x1893f
movq 0x58(%rbx), %rdi
movq 0x88(%rbx), %r8
movsd (%r8,%rsi,8), %xmm0
mulsd (%rdi,%rsi,8), %xmm0
subsd %xmm0, %xmm5
testq %rcx, %rcx
je 0x18972
movq 0x60(%rbx), %r8
movq 0x90(%rbx), %rdi
movq (%rdi,%rsi,8), %rdi
movq (%r8,%rsi,8), %r8
xorl %r9d, %r9d
movsd (%rdi,%r9,8), %xmm0
mulsd (%r8,%r9,8), %xmm0
subsd %xmm0, %xmm5
incq %r9
cmpq %r9, %r13
jne 0x1895a
testb %dl, %dl
jne 0x189a4
movq 0x68(%rbx), %r8
movq 0x98(%rbx), %rdi
movq (%rdi,%rsi,8), %rdi
movq (%r8,%rsi,8), %r8
xorl %r9d, %r9d
movsd (%rdi,%r9,8), %xmm0
mulsd (%r8,%r9,8), %xmm0
subsd %xmm0, %xmm5
incq %r9
cmpq %r9, %rbp
jne 0x1898c
incq %rsi
cmpq %r13, %rsi
jne 0x18920
movq (%rsp), %rax
movq 0x88(%rax), %rcx
movsd 0x958(%rcx), %xmm0
mulsd 0x50(%rsp), %xmm0
ucomisd %xmm0, %xmm5
setae %al
movapd %xmm3, %xmm1
movsd 0x1bf0c(%rip), %xmm2    # 0x348e8
cmpeqpd %xmm2, %xmm1
movapd 0x20(%rsp), %xmm4
movapd %xmm4, %xmm2
movapd 0x60(%rsp), %xmm6
cmplepd %xmm6, %xmm2
andpd %xmm1, %xmm2
movd %xmm2, %edx
movapd 0x30(%rsp), %xmm1
movapd %xmm4, %xmm2
testb $0x1, %dl
jne 0x18a17
movapd %xmm3, %xmm1
movsd 0x8(%rsp), %xmm2
movsd %xmm2, 0x8(%rsp)
movapd %xmm1, %xmm2
ucomisd %xmm4, %xmm6
movsd 0x1bec3(%rip), %xmm3    # 0x348f0
jb 0x18a39
ucomisd %xmm0, %xmm5
movapd %xmm3, %xmm1
jae 0x18a41
movsd 0x960(%rcx), %xmm1
ucomisd %xmm4, %xmm6
jb 0x18a4d
ucomisd %xmm0, %xmm5
jae 0x18a97
movapd 0x30(%rsp), %xmm0
divsd %xmm1, %xmm0
movq (%rsp), %rcx
movq 0x88(%rcx), %rcx
movapd %xmm0, 0x30(%rsp)
ucomisd 0x970(%rcx), %xmm0
xorpd %xmm1, %xmm1
ja 0x185a8
jmp 0x18a97
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x1be5a(%rip), %xmm2    # 0x348e8
xorl %r12d, %r12d
xorl %eax, %eax
xorpd %xmm4, %xmm4
testb %r12b, %r12b
je 0x18c56
testb %al, %al
jne 0x18d9b
movq %rbx, %rdi
movl $0x9, %esi
movl $0x3, %edx
movapd %xmm2, 0x10(%rsp)
callq 0xb032
movapd 0x10(%rsp), %xmm1
testb %r13b, %r13b
jle 0x18c73
xorpd 0x1be69(%rip), %xmm1    # 0x34940
xorl %r15d, %r15d
xorpd %xmm2, %xmm2
movsd 0x1be0a(%rip), %xmm3    # 0x348f0
movapd %xmm1, 0x10(%rsp)
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x18b35
movq 0x88(%rbx), %rcx
movq 0xa0(%rbx), %rdx
movsd (%rcx,%r15,8), %xmm0
mulsd %xmm1, %xmm0
addsd (%rdx,%r15,8), %xmm0
movsd %xmm0, (%rax,%r15,8)
ucomisd %xmm0, %xmm2
ja 0x18b25
ucomisd %xmm3, %xmm0
jbe 0x18b35
ucomisd %xmm2, %xmm0
jbe 0x18b35
ucomisd %xmm0, %xmm3
ja 0x18c3a
cmpq $0x0, 0x18(%rbx)
je 0x18bae
xorl %r14d, %r14d
movq 0xa8(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x18(%rbx), %rcx
movq 0x90(%rbx), %rdx
movq (%rdx,%r15,8), %rdx
movsd (%rdx,%r14,8), %xmm0
mulsd %xmm1, %xmm0
addsd (%rax,%r14,8), %xmm0
movq (%rcx,%r15,8), %rax
movsd %xmm0, (%rax,%r14,8)
ucomisd %xmm0, %xmm2
ja 0x18b7f
ucomisd %xmm3, %xmm0
jbe 0x18b8b
ucomisd %xmm2, %xmm0
jbe 0x18b8b
ucomisd %xmm0, %xmm3
ja 0x18b95
incq %r14
cmpq %r14, %r13
jne 0x18b3f
jmp 0x18bae
callq 0x4d03
movsd 0x1bd4e(%rip), %xmm3    # 0x348f0
xorpd %xmm2, %xmm2
movapd 0x10(%rsp), %xmm1
jmp 0x18b8b
cmpq $0x0, 0x20(%rbx)
je 0x18c2c
testb %bpl, %bpl
jle 0x18c2c
xorl %r14d, %r14d
movq 0xb0(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x20(%rbx), %rcx
movq 0x98(%rbx), %rdx
movq (%rdx,%r15,8), %rdx
movsd (%rdx,%r14,8), %xmm0
mulsd %xmm1, %xmm0
addsd (%rax,%r14,8), %xmm0
movq (%rcx,%r15,8), %rax
movsd %xmm0, (%rax,%r14,8)
ucomisd %xmm0, %xmm2
ja 0x18bfd
ucomisd %xmm3, %xmm0
jbe 0x18c09
ucomisd %xmm2, %xmm0
jbe 0x18c09
ucomisd %xmm0, %xmm3
ja 0x18c13
incq %r14
cmpq %r14, %rbp
jne 0x18bbd
jmp 0x18c2c
callq 0x4d1f
movsd 0x1bcd0(%rip), %xmm3    # 0x348f0
xorpd %xmm2, %xmm2
movapd 0x10(%rsp), %xmm1
jmp 0x18c09
incq %r15
cmpq %r13, %r15
jne 0x18aec
jmp 0x18c73
callq 0x4ce7
movsd 0x1bca9(%rip), %xmm3    # 0x348f0
xorpd %xmm2, %xmm2
movapd 0x10(%rsp), %xmm1
jmp 0x18b35
movq %rbx, %rdi
movl $0x5, %esi
movl $0x1, %edx
callq 0xb032
movsd 0x48(%rsp), %xmm4
jmp 0x18d9b
cmpb $0x1, 0xf8(%rbx)
jne 0x18d95
movq (%rsp), %rax
cmpb $0x1, 0x80(%rax)
jne 0x18d47
cmpb $0x0, 0xf9(%rbx)
je 0x18d47
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x18cbc
movq (%rsp), %rax
movq 0x50(%rax), %rsi
movq 0x68(%rax), %rdx
movsbl %r13b, %ecx
callq 0x79f5
testb %r13b, %r13b
jle 0x18d95
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x18d04
movq (%rax,%r15,8), %rdi
movq (%rsp), %rcx
cmpb $0x0, 0x80(%rcx)
movq 0x58(%rcx), %rax
cmoveq %r14, %rax
movq (%rax,%r15,8), %rsi
movq 0x70(%rcx), %rax
cmoveq %r14, %rax
movq (%rax,%r15,8), %rdx
movsbl %r13b, %ecx
callq 0x79f5
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x18d3d
movq (%rax,%r15,8), %rdi
movq (%rsp), %rcx
cmpb $0x0, 0x80(%rcx)
movq 0x60(%rcx), %rax
cmoveq %r14, %rax
movq (%rax,%r15,8), %rsi
movq 0x78(%rcx), %rax
cmoveq %r14, %rax
movq (%rax,%r15,8), %rdx
movsbl %bpl, %ecx
callq 0x79f5
incq %r15
cmpq %r15, %r13
jne 0x18ccb
jmp 0x18d95
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x18d59
movsbl %r13b, %esi
callq 0x692d
testb %r13b, %r13b
jle 0x18d95
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x18d77
movq (%rax,%r14,8), %rdi
movsbl %r13b, %esi
callq 0x692d
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x18d8d
movq (%rax,%r14,8), %rdi
movsbl %bpl, %esi
callq 0x692d
incq %r14
cmpq %r14, %r13
jne 0x18d61
movsd 0x8(%rsp), %xmm4
movapd %xmm4, 0x20(%rsp)
movq %rbx, %rdi
movl $0x5, %esi
callq 0xafb8
movq %rbx, %rdi
movl $0x9, %esi
callq 0xafb8
movaps 0x20(%rsp), %xmm0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop