// File: myudelson[P]hmm-scalable/HMMProblem.cpp
// Function: HMMProblem::doLinearStepBig(FitBit**, int)
NUMBER HMMProblem::doLinearStepBig(FitBit **fbs, NCAT nfbs) {
	NPAR i,j,m;
    NCAT q;
    NUMBER e;
    NUMBER f_xk = 0;
    NUMBER f_xkplus1 = 0;
    NUMBER p_k_by_neg_p_k = 0;

    bool compliesArmijo = false;
    
    e = this->p->ArmijoSeed; // step seed
    f_xk = HMMProblem::getSumLogPOPara(this->p->nSeq, this->p->k_data);
    p_k_by_neg_p_k = 0;
    int iter = 0; // limit iter steps to 20, via ArmijoMinStep (now 10)
    for(q=0; q<nfbs; q++) {
        fbs[q]->doLog10ScaleGentleByRow(FBS_GRAD);
        fbs[q]->init(FBS_PARcopy);
        fbs[q]->copy(FBS_PAR, FBS_PARcopy);
        for(i=0; i<fbs[q]->nS; i++)
        {
            if(fbs[q]->pi != NULL) p_k_by_neg_p_k -= fbs[q]->gradPI[i]*fbs[q]->gradPI[i];
            if(fbs[q]->A  != NULL) for(j=0; j<fbs[q]->nS; j++) p_k_by_neg_p_k -= fbs[q]->gradA[i][j]*fbs[q]->gradA[i][j];
            if(fbs[q]->B  != NULL) for(m=0; m<fbs[q]->nO; m++) p_k_by_neg_p_k -= fbs[q]->gradB[i][m]*fbs[q]->gradB[i][m];
        }
    }
    
    while( !compliesArmijo && e > this->p->ArmijoMinStep) {
        for(q=0;q<nfbs;q++) { // apply step
            // update
            for(i=0; i<fbs[q]->nS; i++) {
                if(fbs[q]->pi != NULL) fbs[q]->pi[i] = fbs[q]->PIcopy[i] - e * fbs[q]->gradPI[i];
                if(fbs[q]->A  != NULL)
                    for(j=0; j<fbs[q]->nS; j++)
                        fbs[q]->A[i][j] = fbs[q]->Acopy[i][j] - e * fbs[q]->gradA[i][j];
                if(fbs[q]->B  != NULL)
                    for(m=0; m<fbs[q]->nO; m++)
                        fbs[q]->B[i][m] = fbs[q]->Bcopy[i][m] - e * fbs[q]->gradB[i][m];
            }
            // project parameters to simplex if needs be
            if(fbs[q]->projecttosimplex==1) {
                // scale
                if( !this->hasNon01Constraints() || fbs[q]->observe_non01_boundaries==0 ) {
                    if(fbs[q]->pi != NULL) projectsimplex(fbs[q]->pi, fbs[q]->nS);
                    for(i=0; i<fbs[q]->nS; i++) {
                        if(fbs[q]->A  != NULL) projectsimplex(fbs[q]->A[i], fbs[q]->nS);
                        if(fbs[q]->B  != NULL) projectsimplex(fbs[q]->B[i], fbs[q]->nO);
                    }
                } else {
                    if(fbs[q]->pi != NULL) projectsimplexbounded(fbs[q]->pi, this->getLbPI(), this->getUbPI(), fbs[q]->nS);
                    
                    for(i=0; i<fbs[q]->nS; i++) {
                        if(fbs[q]->A  != NULL) projectsimplexbounded(fbs[q]->A[i], this->getLbA()[i], this->getUbA()[i], fbs[q]->nS);
                        if(fbs[q]->B  != NULL) projectsimplexbounded(fbs[q]->B[i], this->getLbB()[i], this->getUbB()[i], fbs[q]->nO);
                    }
                }
            }
        } // apply step
        
        // 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) { // we couldn't step away from current, copy the inital point back
        e = 0;
        for(q=0;q<nfbs;q++) { // apply step
            fbs[q]->copy(FBS_PARcopy, FBS_PAR);
        }
    }
    for(q=0;q<nfbs;q++) { // apply step
        fbs[q]->destroy(FBS_PARcopy);
    }

    return f_xkplus1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x50(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
movb $0x0, -0x41(%rbp)
movq 0x88(%rdi), %rax
movsd 0x968(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movq 0x88(%rdi), %rax
movl 0x8dc(%rax), %esi
movq 0x88(%rdi), %rax
movq 0x8f0(%rax), %rdx
callq 0x1a9f0
movsd %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x2248c
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl $0x3, %esi
callq 0xef90
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl $0x5, %esi
callq 0xdcb0
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl $0x1, %esi
movl $0x5, %edx
callq 0xe4d0
movb $0x0, -0x15(%rbp)
movsbl -0x15(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jge 0x2247c
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x10(%rax)
je 0x2230c
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x58(%rax), %rax
movsbq -0x15(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x58(%rax), %rax
movsbq -0x15(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x40(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x18(%rax)
je 0x223bd
movb $0x0, -0x16(%rbp)
movsbl -0x16(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jge 0x223bb
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x60(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x16(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x60(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x16(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x40(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movb -0x16(%rbp), %al
addb $0x1, %al
movb %al, -0x16(%rbp)
jmp 0x22327
jmp 0x223bd
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x20(%rax)
je 0x2246d
movb $0x0, -0x17(%rbp)
movsbl -0x17(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x2246b
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x17(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x17(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x40(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movb -0x17(%rbp), %al
addb $0x1, %al
movb %al, -0x17(%rbp)
jmp 0x223d8
jmp 0x2246d
jmp 0x2246f
movb -0x15(%rbp), %al
addb $0x1, %al
movb %al, -0x15(%rbp)
jmp 0x22280
jmp 0x2247e
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x22229
jmp 0x2248e
xorl %eax, %eax
testb $0x1, -0x41(%rbp)
movb %al, -0x51(%rbp)
jne 0x224b7
movq -0x50(%rbp), %rax
movsd -0x28(%rbp), %xmm0
movq 0x88(%rax), %rax
ucomisd 0x970(%rax), %xmm0
seta %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x224c3
jmp 0x22ada
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x229fb
movb $0x0, -0x15(%rbp)
movsbl -0x15(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jge 0x22738
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x10(%rax)
je 0x2257e
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0xa0(%rax), %rax
movsbq -0x15(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x58(%rax), %rax
movsbq -0x15(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movsbq -0x15(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x18(%rax)
je 0x22654
movb $0x0, -0x16(%rbp)
movsbl -0x16(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jge 0x22652
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0xa8(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x16(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x60(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x16(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x16(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movb -0x16(%rbp), %al
addb $0x1, %al
movb %al, -0x16(%rbp)
jmp 0x22599
jmp 0x22654
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x20(%rax)
je 0x22729
movb $0x0, -0x17(%rbp)
movsbl -0x17(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x22727
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0xb0(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x17(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x17(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbq -0x17(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movb -0x17(%rbp), %al
addb $0x1, %al
movb %al, -0x17(%rbp)
jmp 0x2266f
jmp 0x22729
jmp 0x2272b
movb -0x15(%rbp), %al
addb $0x1, %al
movb %al, -0x15(%rbp)
jmp 0x224da
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0xf8(%rax), %eax
cmpl $0x1, %eax
jne 0x229eb
movq -0x50(%rbp), %rdi
callq 0x1a4e0
testb $0x1, %al
jne 0x22763
jmp 0x2277f
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0xf9(%rax), %eax
cmpl $0x0, %eax
jne 0x2286c
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x10(%rax)
je 0x227b7
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %esi
callq 0x7980
movb $0x0, -0x15(%rbp)
movsbl -0x15(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jge 0x22867
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x18(%rax)
je 0x22818
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %esi
callq 0x7980
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x20(%rax)
je 0x22858
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %esi
callq 0x7980
jmp 0x2285a
movb -0x15(%rbp), %al
addb $0x1, %al
movb %al, -0x15(%rbp)
jmp 0x227bb
jmp 0x229e9
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x10(%rax)
je 0x228c9
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
callq 0x1a6b0
movq -0x50(%rbp), %rdi
movq %rax, -0x60(%rbp)
callq 0x1a770
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %rax, %rdx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %ecx
callq 0x87e0
movb $0x0, -0x15(%rbp)
movsbl -0x15(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jge 0x229e7
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x18(%rax)
je 0x2295e
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x78(%rbp)
callq 0x1a6f0
movq -0x50(%rbp), %rdi
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x70(%rbp)
callq 0x1a7b0
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %ecx
callq 0x87e0
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x20(%rax)
je 0x229d8
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x88(%rbp)
callq 0x1a730
movq -0x50(%rbp), %rdi
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
callq 0x1a7f0
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rsi
movsbq -0x15(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %ecx
callq 0x87e0
jmp 0x229da
movb -0x15(%rbp), %al
addb $0x1, %al
movb %al, -0x15(%rbp)
jmp 0x228cd
jmp 0x229e9
jmp 0x229eb
jmp 0x229ed
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x224ca
movq -0x50(%rbp), %rdi
movq 0x88(%rdi), %rax
movl 0x8dc(%rax), %esi
movq 0x88(%rdi), %rax
movq 0x8f0(%rax), %rdx
callq 0x1b0c0
movq -0x50(%rbp), %rdi
movq 0x88(%rdi), %rax
movl 0x8dc(%rax), %esi
movq 0x88(%rdi), %rax
movq 0x8f0(%rax), %rdx
callq 0x1a9f0
movq -0x50(%rbp), %rax
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
movq 0x88(%rax), %rax
movsd 0x950(%rax), %xmm0
mulsd -0x28(%rbp), %xmm0
movsd -0x40(%rbp), %xmm3
mulsd %xmm3, %xmm0
addsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
setae %al
andb $0x1, %al
movb %al, -0x41(%rbp)
testb $0x1, -0x41(%rbp)
je 0x22a9b
movsd 0x2cf77(%rip), %xmm0    # 0x4fa08
movsd %xmm0, -0x90(%rbp)
jmp 0x22ab6
movq -0x50(%rbp), %rax
movq 0x88(%rax), %rax
movsd 0x960(%rax), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x90(%rbp), %xmm1
movsd -0x28(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x2248e
testb $0x1, -0x41(%rbp)
jne 0x22b1f
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x22b1d
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl $0x5, %esi
movl $0x1, %edx
callq 0xe4d0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x22aef
jmp 0x22b1f
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x22b4f
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl $0x5, %esi
callq 0xe140
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x22b26
movsd -0x38(%rbp), %xmm0
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)