// File: /workspace/github_cpp_makefile_star2_O3/mouda[P]LTE_random_access-simulate/alglibinternal.cpp
// Function: alglib_impl::linmin_mcstep(double*, double*, double*, double*, double*, double*, double*, double, double, bool*, double, double, long*, alglib_impl::ae_state*)
static void linmin_mcstep(double* stx,
     double* fx,
     double* dx,
     double* sty,
     double* fy,
     double* dy,
     double* stp,
     double fp,
     double dp,
     ae_bool* brackt,
     double stmin,
     double stmax,
     ae_int_t* info,
     ae_state *_state)
{
    ae_bool bound;
    double gamma;
    double p;
    double q;
    double r;
    double s;
    double sgnd;
    double stpc;
    double stpf;
    double stpq;
    double theta;


    *info = 0;
    
    /*
     *     CHECK THE INPUT PARAMETERS FOR ERRORS.
     */
    if( ((*brackt&&(ae_fp_less_eq(*stp,ae_minreal(*stx, *sty, _state))||ae_fp_greater_eq(*stp,ae_maxreal(*stx, *sty, _state))))||ae_fp_greater_eq(*dx*(*stp-(*stx)),0))||ae_fp_less(stmax,stmin) )
    {
        return;
    }
    
    /*
     *     DETERMINE IF THE DERIVATIVES HAVE OPPOSITE SIGN.
     */
    sgnd = dp*(*dx/ae_fabs(*dx, _state));
    
    /*
     *     FIRST CASE. A HIGHER FUNCTION VALUE.
     *     THE MINIMUM IS BRACKETED. IF THE CUBIC STEP IS CLOSER
     *     TO STX THAN THE QUADRATIC STEP, THE CUBIC STEP IS TAKEN,
     *     ELSE THE AVERAGE OF THE CUBIC AND QUADRATIC STEPS IS TAKEN.
     */
    if( ae_fp_greater(fp,*fx) )
    {
        *info = 1;
        bound = ae_true;
        theta = 3*(*fx-fp)/(*stp-(*stx))+(*dx)+dp;
        s = ae_maxreal(ae_fabs(theta, _state), ae_maxreal(ae_fabs(*dx, _state), ae_fabs(dp, _state), _state), _state);
        gamma = s*ae_sqrt(ae_sqr(theta/s, _state)-*dx/s*(dp/s), _state);
        if( ae_fp_less(*stp,*stx) )
        {
            gamma = -gamma;
        }
        p = gamma-(*dx)+theta;
        q = gamma-(*dx)+gamma+dp;
        r = p/q;
        stpc = *stx+r*(*stp-(*stx));
        stpq = *stx+*dx/((*fx-fp)/(*stp-(*stx))+(*dx))/2*(*stp-(*stx));
        if( ae_fp_less(ae_fabs(stpc-(*stx), _state),ae_fabs(stpq-(*stx), _state)) )
        {
            stpf = stpc;
        }
        else
        {
            stpf = stpc+(stpq-stpc)/2;
        }
        *brackt = ae_true;
    }
    else
    {
        if( ae_fp_less(sgnd,0) )
        {
            
            /*
             *     SECOND CASE. A LOWER FUNCTION VALUE AND DERIVATIVES OF
             *     OPPOSITE SIGN. THE MINIMUM IS BRACKETED. IF THE CUBIC
             *     STEP IS CLOSER TO STX THAN THE QUADRATIC (SECANT) STEP,
             *     THE CUBIC STEP IS TAKEN, ELSE THE QUADRATIC STEP IS TAKEN.
             */
            *info = 2;
            bound = ae_false;
            theta = 3*(*fx-fp)/(*stp-(*stx))+(*dx)+dp;
            s = ae_maxreal(ae_fabs(theta, _state), ae_maxreal(ae_fabs(*dx, _state), ae_fabs(dp, _state), _state), _state);
            gamma = s*ae_sqrt(ae_sqr(theta/s, _state)-*dx/s*(dp/s), _state);
            if( ae_fp_greater(*stp,*stx) )
            {
                gamma = -gamma;
            }
            p = gamma-dp+theta;
            q = gamma-dp+gamma+(*dx);
            r = p/q;
            stpc = *stp+r*(*stx-(*stp));
            stpq = *stp+dp/(dp-(*dx))*(*stx-(*stp));
            if( ae_fp_greater(ae_fabs(stpc-(*stp), _state),ae_fabs(stpq-(*stp), _state)) )
            {
                stpf = stpc;
            }
            else
            {
                stpf = stpq;
            }
            *brackt = ae_true;
        }
        else
        {
            if( ae_fp_less(ae_fabs(dp, _state),ae_fabs(*dx, _state)) )
            {
                
                /*
                 *     THIRD CASE. A LOWER FUNCTION VALUE, DERIVATIVES OF THE
                 *     SAME SIGN, AND THE MAGNITUDE OF THE DERIVATIVE DECREASES.
                 *     THE CUBIC STEP IS ONLY USED IF THE CUBIC TENDS TO INFINITY
                 *     IN THE DIRECTION OF THE STEP OR IF THE MINIMUM OF THE CUBIC
                 *     IS BEYOND STP. OTHERWISE THE CUBIC STEP IS DEFINED TO BE
                 *     EITHER STPMIN OR STPMAX. THE QUADRATIC (SECANT) STEP IS ALSO
                 *     COMPUTED AND IF THE MINIMUM IS BRACKETED THEN THE THE STEP
                 *     CLOSEST TO STX IS TAKEN, ELSE THE STEP FARTHEST AWAY IS TAKEN.
                 */
                *info = 3;
                bound = ae_true;
                theta = 3*(*fx-fp)/(*stp-(*stx))+(*dx)+dp;
                s = ae_maxreal(ae_fabs(theta, _state), ae_maxreal(ae_fabs(*dx, _state), ae_fabs(dp, _state), _state), _state);
                
                /*
                 *        THE CASE GAMMA = 0 ONLY ARISES IF THE CUBIC DOES NOT TEND
                 *        TO INFINITY IN THE DIRECTION OF THE STEP.
                 */
                gamma = s*ae_sqrt(ae_maxreal(0, ae_sqr(theta/s, _state)-*dx/s*(dp/s), _state), _state);
                if( ae_fp_greater(*stp,*stx) )
                {
                    gamma = -gamma;
                }
                p = gamma-dp+theta;
                q = gamma+(*dx-dp)+gamma;
                r = p/q;
                if( ae_fp_less(r,0)&&ae_fp_neq(gamma,0) )
                {
                    stpc = *stp+r*(*stx-(*stp));
                }
                else
                {
                    if( ae_fp_greater(*stp,*stx) )
                    {
                        stpc = stmax;
                    }
                    else
                    {
                        stpc = stmin;
                    }
                }
                stpq = *stp+dp/(dp-(*dx))*(*stx-(*stp));
                if( *brackt )
                {
                    if( ae_fp_less(ae_fabs(*stp-stpc, _state),ae_fabs(*stp-stpq, _state)) )
                    {
                        stpf = stpc;
                    }
                    else
                    {
                        stpf = stpq;
                    }
                }
                else
                {
                    if( ae_fp_greater(ae_fabs(*stp-stpc, _state),ae_fabs(*stp-stpq, _state)) )
                    {
                        stpf = stpc;
                    }
                    else
                    {
                        stpf = stpq;
                    }
                }
            }
            else
            {
                
                /*
                 *     FOURTH CASE. A LOWER FUNCTION VALUE, DERIVATIVES OF THE
                 *     SAME SIGN, AND THE MAGNITUDE OF THE DERIVATIVE DOES
                 *     NOT DECREASE. IF THE MINIMUM IS NOT BRACKETED, THE STEP
                 *     IS EITHER STPMIN OR STPMAX, ELSE THE CUBIC STEP IS TAKEN.
                 */
                *info = 4;
                bound = ae_false;
                if( *brackt )
                {
                    theta = 3*(fp-(*fy))/(*sty-(*stp))+(*dy)+dp;
                    s = ae_maxreal(ae_fabs(theta, _state), ae_maxreal(ae_fabs(*dy, _state), ae_fabs(dp, _state), _state), _state);
                    gamma = s*ae_sqrt(ae_sqr(theta/s, _state)-*dy/s*(dp/s), _state);
                    if( ae_fp_greater(*stp,*sty) )
                    {
                        gamma = -gamma;
                    }
                    p = gamma-dp+theta;
                    q = gamma-dp+gamma+(*dy);
                    r = p/q;
                    stpc = *stp+r*(*sty-(*stp));
                    stpf = stpc;
                }
                else
                {
                    if( ae_fp_greater(*stp,*stx) )
                    {
                        stpf = stmax;
                    }
                    else
                    {
                        stpf = stmin;
                    }
                }
            }
        }
    }
    
    /*
     *     UPDATE THE INTERVAL OF UNCERTAINTY. THIS UPDATE DOES NOT
     *     DEPEND ON THE NEW STEP OR THE CASE ANALYSIS ABOVE.
     */
    if( ae_fp_greater(fp,*fx) )
    {
        *sty = *stp;
        *fy = fp;
        *dy = dp;
    }
    else
    {
        if( ae_fp_less(sgnd,0.0) )
        {
            *sty = *stx;
            *fy = *fx;
            *dy = *dx;
        }
        *stx = *stp;
        *fx = fp;
        *dx = dp;
    }
    
    /*
     *     COMPUTE THE NEW STEP AND SAFEGUARD IT.
     */
    stpf = ae_minreal(stmax, stpf, _state);
    stpf = ae_maxreal(stmin, stpf, _state);
    *stp = stpf;
    if( *brackt&&bound )
    {
        if( ae_fp_greater(*sty,*stx) )
        {
            *stp = ae_minreal(*stx+0.66*(*sty-(*stx)), *stp, _state);
        }
        else
        {
            *stp = ae_maxreal(*stx+0.66*(*sty-(*stx)), *stp, _state);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movsd %xmm3, 0x48(%rsp)
movsd %xmm2, 0x40(%rsp)
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, 0x28(%rsp)
movq %r9, 0x38(%rsp)
movq %r8, 0x50(%rsp)
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
movq 0xa0(%rsp), %rbp
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rbx
movq $0x0, (%rbp)
cmpb $0x1, (%rax)
jne 0x20b0e
movsd (%rbx), %xmm0
movsd %xmm0, (%rsp)
movsd (%r15), %xmm0
movsd (%r14), %xmm1
movq 0xa8(%rsp), %rdi
callq 0x25ee1
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
callq 0x25bd9
testb %al, %al
jne 0x211c3
movsd (%rbx), %xmm0
movsd %xmm0, (%rsp)
movsd (%r15), %xmm0
movsd (%r14), %xmm1
movq 0xa8(%rsp), %rdi
callq 0x25edc
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
callq 0x25c15
testb %al, %al
jne 0x211c3
movsd (%rbx), %xmm0
subsd (%r15), %xmm0
mulsd (%r12), %xmm0
xorps %xmm1, %xmm1
callq 0x25c15
testb %al, %al
jne 0x211c3
movsd 0x48(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
callq 0x25bb9
testb %al, %al
jne 0x211c3
movsd (%r12), %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0xa8(%rsp), %rbx
movq %rbx, %rdi
callq 0x25e30
movsd 0x30(%rsp), %xmm1
divsd %xmm0, %xmm1
mulsd 0x8(%rsp), %xmm1
movsd %xmm1, 0x30(%rsp)
movsd (%r13), %xmm1
movsd 0x28(%rsp), %xmm0
callq 0x25bf9
testb %al, %al
je 0x20c99
movq $0x1, (%rbp)
movsd (%r13), %xmm0
subsd 0x28(%rsp), %xmm0
mulsd 0x1263b(%rip), %xmm0    # 0x331e8
movq 0x90(%rsp), %rbp
movsd (%rbp), %xmm1
subsd (%r15), %xmm1
divsd %xmm1, %xmm0
addsd (%r12), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x25e30
movsd %xmm0, 0x10(%rsp)
movsd (%r12), %xmm0
movq %rbx, %rdi
callq 0x25e30
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25e30
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25edc
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25edc
movapd %xmm0, %xmm1
movsd %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm0
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x25e43
movsd (%r12), %xmm1
movsd 0x8(%rsp), %xmm2
movsd 0x10(%rsp), %xmm3
divsd %xmm3, %xmm2
divsd %xmm3, %xmm1
mulsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x25e48
mulsd 0x10(%rsp), %xmm0
movapd %xmm0, 0x10(%rsp)
movsd (%rbp), %xmm0
movsd (%r15), %xmm1
callq 0x25bb9
testb %al, %al
jne 0x20db7
movapd 0x10(%rsp), %xmm1
jmp 0x20dc5
xorps %xmm1, %xmm1
movsd 0x30(%rsp), %xmm0
callq 0x25bb9
testb %al, %al
je 0x20ea2
movq $0x2, (%rbp)
movsd (%r13), %xmm0
subsd 0x28(%rsp), %xmm0
mulsd 0x1251d(%rip), %xmm0    # 0x331e8
movq 0x90(%rsp), %rbp
movsd (%rbp), %xmm1
subsd (%r15), %xmm1
divsd %xmm1, %xmm0
addsd (%r12), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x25e30
movsd %xmm0, 0x10(%rsp)
movsd (%r12), %xmm0
movq %rbx, %rdi
callq 0x25e30
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25e30
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25edc
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25edc
movapd %xmm0, %xmm1
movsd %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm0
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x25e43
movsd (%r12), %xmm1
movsd 0x8(%rsp), %xmm2
movsd 0x10(%rsp), %xmm3
divsd %xmm3, %xmm2
divsd %xmm3, %xmm1
mulsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x25e48
mulsd 0x10(%rsp), %xmm0
movapd %xmm0, 0x10(%rsp)
movsd (%rbp), %xmm0
movsd (%r15), %xmm1
callq 0x25bf9
testb %al, %al
jne 0x20ff0
movapd 0x10(%rsp), %xmm1
jmp 0x20ffe
movapd 0x10(%rsp), %xmm1
xorpd 0x123eb(%rip), %xmm1    # 0x331b0
movsd (%r12), %xmm4
movapd %xmm1, %xmm0
subsd %xmm4, %xmm0
movsd (%rsp), %xmm3
addsd %xmm0, %xmm3
addsd %xmm1, %xmm0
addsd 0x8(%rsp), %xmm0
divsd %xmm0, %xmm3
movsd (%r15), %xmm1
movsd (%rbp), %xmm0
subsd %xmm1, %xmm0
mulsd %xmm0, %xmm3
addsd %xmm1, %xmm3
movsd (%r13), %xmm2
subsd 0x28(%rsp), %xmm2
divsd %xmm0, %xmm2
addsd %xmm4, %xmm2
divsd %xmm2, %xmm4
mulsd 0x12668(%rip), %xmm4    # 0x33488
mulsd %xmm0, %xmm4
addsd %xmm1, %xmm4
movsd %xmm4, 0x10(%rsp)
movsd %xmm3, (%rsp)
movapd %xmm3, %xmm0
subsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x25e30
movsd %xmm0, 0x20(%rsp)
movsd 0x10(%rsp), %xmm0
subsd (%r15), %xmm0
movq %rbx, %rdi
callq 0x25e30
movapd %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
callq 0x25bb9
testb %al, %al
jne 0x20e8f
movsd 0x10(%rsp), %xmm0
movsd (%rsp), %xmm1
subsd %xmm1, %xmm0
mulsd 0x12602(%rip), %xmm0    # 0x33488
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movq 0x98(%rsp), %rax
movb $0x1, (%rax)
movb $0x1, %bpl
jmp 0x210b0
movsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25e30
movsd %xmm0, (%rsp)
movsd (%r12), %xmm0
movq %rbx, %rdi
callq 0x25e30
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
callq 0x25bb9
testb %al, %al
je 0x211d2
movq $0x3, (%rbp)
movsd (%r13), %xmm0
subsd 0x28(%rsp), %xmm0
mulsd 0x122f4(%rip), %xmm0    # 0x331e8
movq 0x90(%rsp), %rbp
movsd (%rbp), %xmm1
subsd (%r15), %xmm1
divsd %xmm1, %xmm0
addsd (%r12), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x25e30
movsd %xmm0, 0x10(%rsp)
movsd (%r12), %xmm0
movq %rbx, %rdi
callq 0x25e30
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25e30
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25edc
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25edc
movapd %xmm0, %xmm1
movsd %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm0
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x25e43
movapd %xmm0, %xmm1
movsd (%r12), %xmm0
movsd 0x8(%rsp), %xmm2
movsd 0x10(%rsp), %xmm3
divsd %xmm3, %xmm2
divsd %xmm3, %xmm0
mulsd %xmm2, %xmm0
subsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x25edc
movq %rbx, %rdi
callq 0x25e48
mulsd 0x10(%rsp), %xmm0
movapd %xmm0, 0x10(%rsp)
movsd (%rbp), %xmm0
movsd (%r15), %xmm1
callq 0x25bf9
testb %al, %al
jne 0x212f7
movapd 0x10(%rsp), %xmm3
jmp 0x21305
movapd 0x10(%rsp), %xmm1
xorpd 0x121b2(%rip), %xmm1    # 0x331b0
movapd %xmm1, %xmm0
movsd 0x8(%rsp), %xmm4
subsd %xmm4, %xmm0
movsd (%rsp), %xmm5
addsd %xmm0, %xmm5
addsd %xmm1, %xmm0
movsd (%r12), %xmm1
addsd %xmm1, %xmm0
divsd %xmm0, %xmm5
movsd (%rbp), %xmm2
movsd (%r15), %xmm0
subsd %xmm2, %xmm0
mulsd %xmm0, %xmm5
addsd %xmm2, %xmm5
movapd %xmm4, %xmm3
subsd %xmm1, %xmm3
divsd %xmm3, %xmm4
mulsd %xmm0, %xmm4
addsd %xmm2, %xmm4
movsd %xmm4, 0x10(%rsp)
movsd %xmm5, (%rsp)
movapd %xmm5, %xmm0
subsd %xmm2, %xmm0
movq %rbx, %rdi
callq 0x25e30
movsd %xmm0, 0x20(%rsp)
movsd 0x10(%rsp), %xmm0
subsd (%rbp), %xmm0
movq %rbx, %rdi
callq 0x25e30
movapd %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
callq 0x25bf9
testb %al, %al
jne 0x210a3
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsp)
movq 0x98(%rsp), %rax
movb $0x1, (%rax)
xorl %ebp, %ebp
movsd 0x28(%rsp), %xmm0
movsd (%r13), %xmm1
callq 0x25bf9
testb %al, %al
je 0x210d4
movq %r14, %rax
movq 0x50(%rsp), %r13
movq 0x38(%rsp), %r12
jmp 0x21111
xorps %xmm1, %xmm1
movsd 0x30(%rsp), %xmm0
callq 0x25bb9
testb %al, %al
je 0x2110e
movsd (%r15), %xmm0
movsd %xmm0, (%r14)
movsd (%r13), %xmm0
movq 0x50(%rsp), %rax
movsd %xmm0, (%rax)
movsd (%r12), %xmm0
movq 0x38(%rsp), %rax
movsd %xmm0, (%rax)
movq %r15, %rax
movsd 0x8(%rsp), %xmm2
movsd (%rsp), %xmm1
movq 0x90(%rsp), %rbx
movsd (%rbx), %xmm0
movsd %xmm0, (%rax)
movsd 0x28(%rsp), %xmm0
movsd %xmm0, (%r13)
movsd %xmm2, (%r12)
movsd 0x48(%rsp), %xmm0
movq 0xa8(%rsp), %r12
movq %r12, %rdi
callq 0x25ee1
movaps %xmm0, %xmm1
movsd 0x40(%rsp), %xmm0
movq %r12, %rdi
callq 0x25edc
movsd %xmm0, (%rbx)
movq 0x98(%rsp), %rax
andb (%rax), %bpl
cmpb $0x1, %bpl
jne 0x211c3
movsd (%r14), %xmm0
movsd (%r15), %xmm1
callq 0x25bf9
movsd (%r15), %xmm1
movsd (%r14), %xmm0
subsd %xmm1, %xmm0
mulsd 0x14929(%rip), %xmm0    # 0x35ac8
addsd %xmm1, %xmm0
movsd (%rbx), %xmm1
movq 0xa8(%rsp), %rdi
testb %al, %al
je 0x211ba
callq 0x25ee1
jmp 0x211bf
callq 0x25edc
movsd %xmm0, (%rbx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x4, (%rbp)
movq 0x98(%rsp), %rax
cmpb $0x1, (%rax)
jne 0x21424
movsd 0x28(%rsp), %xmm0
movq 0x50(%rsp), %rax
subsd (%rax), %xmm0
mulsd 0x11fe6(%rip), %xmm0    # 0x331e8
movsd (%r14), %xmm1
movq 0x90(%rsp), %rbp
subsd (%rbp), %xmm1
divsd %xmm1, %xmm0
movq 0x38(%rsp), %rbp
addsd (%rbp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x25e30
movsd %xmm0, 0x10(%rsp)
movsd (%rbp), %xmm0
movq %rbx, %rdi
callq 0x25e30
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25e30
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25edc
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25edc
movapd %xmm0, %xmm1
movsd %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm0
divsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x25e43
movsd (%rbp), %xmm1
movsd 0x8(%rsp), %xmm2
movsd 0x10(%rsp), %xmm3
divsd %xmm3, %xmm2
divsd %xmm3, %xmm1
mulsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movq %rbx, %rdi
movq 0x90(%rsp), %rbx
callq 0x25e48
mulsd 0x10(%rsp), %xmm0
movapd %xmm0, 0x10(%rsp)
movsd (%rbx), %xmm0
movsd (%r14), %xmm1
callq 0x25bf9
testb %al, %al
jne 0x21477
movapd 0x10(%rsp), %xmm1
jmp 0x21485
movapd 0x10(%rsp), %xmm3
xorpd 0x11eab(%rip), %xmm3    # 0x331b0
movapd %xmm3, 0x10(%rsp)
movapd %xmm3, %xmm2
movsd 0x8(%rsp), %xmm1
subsd %xmm1, %xmm2
movsd (%rsp), %xmm0
addsd %xmm2, %xmm0
movsd (%r12), %xmm2
subsd %xmm1, %xmm2
addsd %xmm3, %xmm2
addsd %xmm3, %xmm2
divsd %xmm2, %xmm0
xorpd %xmm1, %xmm1
movsd %xmm0, (%rsp)
callq 0x25bb9
testb %al, %al
je 0x2137a
xorpd %xmm1, %xmm1
movapd 0x10(%rsp), %xmm0
callq 0x25b97
testb %al, %al
je 0x2137a
movsd (%rbp), %xmm0
movsd (%r15), %xmm1
subsd %xmm0, %xmm1
movsd (%rsp), %xmm4
mulsd %xmm1, %xmm4
addsd %xmm0, %xmm4
jmp 0x213a7
movsd (%rbp), %xmm0
movsd (%r15), %xmm1
callq 0x25bf9
movsd 0x48(%rsp), %xmm4
testb %al, %al
jne 0x21399
movsd 0x40(%rsp), %xmm4
movsd (%rbp), %xmm0
movsd (%r15), %xmm1
subsd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm3
movapd %xmm3, %xmm2
subsd (%r12), %xmm2
divsd %xmm2, %xmm3
mulsd %xmm1, %xmm3
addsd %xmm0, %xmm3
movsd %xmm3, 0x10(%rsp)
movq 0x98(%rsp), %rax
movb (%rax), %bpl
movsd %xmm4, (%rsp)
subsd %xmm4, %xmm0
movq 0xa8(%rsp), %rbx
movq %rbx, %rdi
callq 0x25e30
movsd %xmm0, 0x20(%rsp)
movq 0x90(%rsp), %rax
movsd (%rax), %xmm0
subsd 0x10(%rsp), %xmm0
movq %rbx, %rdi
callq 0x25e30
movapd %xmm0, %xmm1
cmpb $0x1, %bpl
jne 0x21454
movsd 0x20(%rsp), %xmm0
callq 0x25bb9
jmp 0x2145f
movq 0x90(%rsp), %rax
movsd (%rax), %xmm0
movsd (%r15), %xmm1
callq 0x25bf9
movsd 0x48(%rsp), %xmm0
testb %al, %al
jne 0x2144a
movsd 0x40(%rsp), %xmm0
movsd %xmm0, (%rsp)
jmp 0x210ae
movsd 0x20(%rsp), %xmm0
callq 0x25bf9
testb %al, %al
jne 0x20e9a
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsp)
jmp 0x20e9a
movapd 0x10(%rsp), %xmm1
xorpd 0x11d2b(%rip), %xmm1    # 0x331b0
movapd %xmm1, %xmm0
subsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm2
addsd %xmm0, %xmm2
addsd %xmm1, %xmm0
movq 0x38(%rsp), %rax
addsd (%rax), %xmm0
divsd %xmm0, %xmm2
movsd (%rbx), %xmm0
movsd (%r14), %xmm1
subsd %xmm0, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
jmp 0x210ae