// File: /workspace/github_cpp_makefile_star2_O1/mouda[P]LTE_random_access-simulate/alglibinternal.cpp
// Function: alglib_impl::mcsrch(long, alglib_impl::ae_vector*, double*, alglib_impl::ae_vector*, alglib_impl::ae_vector*, double*, double, double, long*, long*, alglib_impl::ae_vector*, alglib_impl::linminstate*, long*, alglib_impl::ae_state*)
void mcsrch(ae_int_t n,
     /* Real    */ ae_vector* x,
     double* f,
     /* Real    */ ae_vector* g,
     /* Real    */ ae_vector* s,
     double* stp,
     double stpmax,
     double gtol,
     ae_int_t* info,
     ae_int_t* nfev,
     /* Real    */ ae_vector* wa,
     linminstate* state,
     ae_int_t* stage,
     ae_state *_state)
{
    double v;
    double p5;
    double p66;
    double zero;


    
    /*
     * init
     */
    p5 = 0.5;
    p66 = 0.66;
    state->xtrapf = 4.0;
    zero = 0;
    if( ae_fp_eq(stpmax,0) )
    {
        stpmax = linmin_defstpmax;
    }
    if( ae_fp_less(*stp,linmin_stpmin) )
    {
        *stp = linmin_stpmin;
    }
    if( ae_fp_greater(*stp,stpmax) )
    {
        *stp = stpmax;
    }
    
    /*
     * Main cycle
     */
    for(;;)
    {
        if( *stage==0 )
        {
            
            /*
             * NEXT
             */
            *stage = 2;
            continue;
        }
        if( *stage==2 )
        {
            state->infoc = 1;
            *info = 0;
            
            /*
             *     CHECK THE INPUT PARAMETERS FOR ERRORS.
             */
            if( ae_fp_less(stpmax,linmin_stpmin)&&ae_fp_greater(stpmax,0) )
            {
                *info = 5;
                *stp = 0.0;
                return;
            }
            if( ((((((n<=0||ae_fp_less_eq(*stp,0))||ae_fp_less(linmin_ftol,0))||ae_fp_less(gtol,zero))||ae_fp_less(linmin_xtol,zero))||ae_fp_less(linmin_stpmin,zero))||ae_fp_less(stpmax,linmin_stpmin))||linmin_maxfev<=0 )
            {
                *stage = 0;
                return;
            }
            
            /*
             *     COMPUTE THE INITIAL GRADIENT IN THE SEARCH DIRECTION
             *     AND CHECK THAT S IS A DESCENT DIRECTION.
             */
            v = ae_v_dotproduct(&g->ptr.p_double[0], 1, &s->ptr.p_double[0], 1, ae_v_len(0,n-1));
            state->dginit = v;
            if( ae_fp_greater_eq(state->dginit,0) )
            {
                *stage = 0;
                return;
            }
            
            /*
             *     INITIALIZE LOCAL VARIABLES.
             */
            state->brackt = ae_false;
            state->stage1 = ae_true;
            *nfev = 0;
            state->finit = *f;
            state->dgtest = linmin_ftol*state->dginit;
            state->width = stpmax-linmin_stpmin;
            state->width1 = state->width/p5;
            ae_v_move(&wa->ptr.p_double[0], 1, &x->ptr.p_double[0], 1, ae_v_len(0,n-1));
            
            /*
             *     THE VARIABLES STX, FX, DGX CONTAIN THE VALUES OF THE STEP,
             *     FUNCTION, AND DIRECTIONAL DERIVATIVE AT THE BEST STEP.
             *     THE VARIABLES STY, FY, DGY CONTAIN THE VALUE OF THE STEP,
             *     FUNCTION, AND DERIVATIVE AT THE OTHER ENDPOINT OF
             *     THE INTERVAL OF UNCERTAINTY.
             *     THE VARIABLES STP, F, DG CONTAIN THE VALUES OF THE STEP,
             *     FUNCTION, AND DERIVATIVE AT THE CURRENT STEP.
             */
            state->stx = 0;
            state->fx = state->finit;
            state->dgx = state->dginit;
            state->sty = 0;
            state->fy = state->finit;
            state->dgy = state->dginit;
            
            /*
             * NEXT
             */
            *stage = 3;
            continue;
        }
        if( *stage==3 )
        {
            
            /*
             *     START OF ITERATION.
             *
             *     SET THE MINIMUM AND MAXIMUM STEPS TO CORRESPOND
             *     TO THE PRESENT INTERVAL OF UNCERTAINTY.
             */
            if( state->brackt )
            {
                if( ae_fp_less(state->stx,state->sty) )
                {
                    state->stmin = state->stx;
                    state->stmax = state->sty;
                }
                else
                {
                    state->stmin = state->sty;
                    state->stmax = state->stx;
                }
            }
            else
            {
                state->stmin = state->stx;
                state->stmax = *stp+state->xtrapf*(*stp-state->stx);
            }
            
            /*
             *        FORCE THE STEP TO BE WITHIN THE BOUNDS STPMAX AND STPMIN.
             */
            if( ae_fp_greater(*stp,stpmax) )
            {
                *stp = stpmax;
            }
            if( ae_fp_less(*stp,linmin_stpmin) )
            {
                *stp = linmin_stpmin;
            }
            
            /*
             *        IF AN UNUSUAL TERMINATION IS TO OCCUR THEN LET
             *        STP BE THE LOWEST POINT OBTAINED SO FAR.
             */
            if( (((state->brackt&&(ae_fp_less_eq(*stp,state->stmin)||ae_fp_greater_eq(*stp,state->stmax)))||*nfev>=linmin_maxfev-1)||state->infoc==0)||(state->brackt&&ae_fp_less_eq(state->stmax-state->stmin,linmin_xtol*state->stmax)) )
            {
                *stp = state->stx;
            }
            
            /*
             *        EVALUATE THE FUNCTION AND GRADIENT AT STP
             *        AND COMPUTE THE DIRECTIONAL DERIVATIVE.
             */
            ae_v_move(&x->ptr.p_double[0], 1, &wa->ptr.p_double[0], 1, ae_v_len(0,n-1));
            ae_v_addd(&x->ptr.p_double[0], 1, &s->ptr.p_double[0], 1, ae_v_len(0,n-1), *stp);
            
            /*
             * NEXT
             */
            *stage = 4;
            return;
        }
        if( *stage==4 )
        {
            *info = 0;
            *nfev = *nfev+1;
            v = ae_v_dotproduct(&g->ptr.p_double[0], 1, &s->ptr.p_double[0], 1, ae_v_len(0,n-1));
            state->dg = v;
            state->ftest1 = state->finit+*stp*state->dgtest;
            
            /*
             *        TEST FOR CONVERGENCE.
             */
            if( (state->brackt&&(ae_fp_less_eq(*stp,state->stmin)||ae_fp_greater_eq(*stp,state->stmax)))||state->infoc==0 )
            {
                *info = 6;
            }
            if( (ae_fp_eq(*stp,stpmax)&&ae_fp_less_eq(*f,state->ftest1))&&ae_fp_less_eq(state->dg,state->dgtest) )
            {
                *info = 5;
            }
            if( ae_fp_eq(*stp,linmin_stpmin)&&(ae_fp_greater(*f,state->ftest1)||ae_fp_greater_eq(state->dg,state->dgtest)) )
            {
                *info = 4;
            }
            if( *nfev>=linmin_maxfev )
            {
                *info = 3;
            }
            if( state->brackt&&ae_fp_less_eq(state->stmax-state->stmin,linmin_xtol*state->stmax) )
            {
                *info = 2;
            }
            if( ae_fp_less_eq(*f,state->ftest1)&&ae_fp_less_eq(ae_fabs(state->dg, _state),-gtol*state->dginit) )
            {
                *info = 1;
            }
            
            /*
             *        CHECK FOR TERMINATION.
             */
            if( *info!=0 )
            {
                *stage = 0;
                return;
            }
            
            /*
             *        IN THE FIRST STAGE WE SEEK A STEP FOR WHICH THE MODIFIED
             *        FUNCTION HAS A NONPOSITIVE VALUE AND NONNEGATIVE DERIVATIVE.
             */
            if( (state->stage1&&ae_fp_less_eq(*f,state->ftest1))&&ae_fp_greater_eq(state->dg,ae_minreal(linmin_ftol, gtol, _state)*state->dginit) )
            {
                state->stage1 = ae_false;
            }
            
            /*
             *        A MODIFIED FUNCTION IS USED TO PREDICT THE STEP ONLY IF
             *        WE HAVE NOT OBTAINED A STEP FOR WHICH THE MODIFIED
             *        FUNCTION HAS A NONPOSITIVE FUNCTION VALUE AND NONNEGATIVE
             *        DERIVATIVE, AND IF A LOWER FUNCTION VALUE HAS BEEN
             *        OBTAINED BUT THE DECREASE IS NOT SUFFICIENT.
             */
            if( (state->stage1&&ae_fp_less_eq(*f,state->fx))&&ae_fp_greater(*f,state->ftest1) )
            {
                
                /*
                 *           DEFINE THE MODIFIED FUNCTION AND DERIVATIVE VALUES.
                 */
                state->fm = *f-*stp*state->dgtest;
                state->fxm = state->fx-state->stx*state->dgtest;
                state->fym = state->fy-state->sty*state->dgtest;
                state->dgm = state->dg-state->dgtest;
                state->dgxm = state->dgx-state->dgtest;
                state->dgym = state->dgy-state->dgtest;
                
                /*
                 *           CALL CSTEP TO UPDATE THE INTERVAL OF UNCERTAINTY
                 *           AND TO COMPUTE THE NEW STEP.
                 */
                linmin_mcstep(&state->stx, &state->fxm, &state->dgxm, &state->sty, &state->fym, &state->dgym, stp, state->fm, state->dgm, &state->brackt, state->stmin, state->stmax, &state->infoc, _state);
                
                /*
                 *           RESET THE FUNCTION AND GRADIENT VALUES FOR F.
                 */
                state->fx = state->fxm+state->stx*state->dgtest;
                state->fy = state->fym+state->sty*state->dgtest;
                state->dgx = state->dgxm+state->dgtest;
                state->dgy = state->dgym+state->dgtest;
            }
            else
            {
                
                /*
                 *           CALL MCSTEP TO UPDATE THE INTERVAL OF UNCERTAINTY
                 *           AND TO COMPUTE THE NEW STEP.
                 */
                linmin_mcstep(&state->stx, &state->fx, &state->dgx, &state->sty, &state->fy, &state->dgy, stp, *f, state->dg, &state->brackt, state->stmin, state->stmax, &state->infoc, _state);
            }
            
            /*
             *        FORCE A SUFFICIENT DECREASE IN THE SIZE OF THE
             *        INTERVAL OF UNCERTAINTY.
             */
            if( state->brackt )
            {
                if( ae_fp_greater_eq(ae_fabs(state->sty-state->stx, _state),p66*state->width1) )
                {
                    *stp = state->stx+p5*(state->sty-state->stx);
                }
                state->width1 = state->width;
                state->width = ae_fabs(state->sty-state->stx, _state);
            }
            
            /*
             *  NEXT.
             */
            *stage = 3;
            continue;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movaps %xmm1, 0x50(%rsp)
movq %r9, %rbx
movq %r8, 0x18(%rsp)
movq %rcx, 0x48(%rsp)
movq %rdx, %rbp
movq %rsi, 0x20(%rsp)
movq %rdi, 0x40(%rsp)
movq 0x128(%rsp), %r13
movabsq $0x4010000000000000, %rax # imm = 0x4010000000000000
movq %rax, 0xb8(%r13)
xorps %xmm1, %xmm1
movsd %xmm0, 0x8(%rsp)
callq 0x262ba
testb %al, %al
je 0x2063d
movsd 0x162d1(%rip), %xmm0    # 0x36908
movsd %xmm0, 0x8(%rsp)
movsd (%rbx), %xmm0
movsd 0x162c7(%rip), %xmm1    # 0x36910
callq 0x262fe
testb %al, %al
je 0x2065f
movabsq $0x358dee7a4ad4b81f, %rax # imm = 0x358DEE7A4AD4B81F
movq %rax, (%rbx)
movsd (%rbx), %xmm0
movsd 0x8(%rsp), %xmm1
callq 0x2633e
movsd 0x8(%rsp), %xmm3
testb %al, %al
je 0x2067c
movsd %xmm3, (%rbx)
movq 0x130(%rsp), %r15
movq 0x118(%rsp), %r12
movq 0x40(%rsp), %rax
decq %rax
movq %rax, 0x10(%rsp)
movaps 0x13b40(%rip), %xmm0    # 0x341e0
xorps 0x50(%rsp), %xmm0
movaps %xmm0, 0xc0(%rsp)
leaq 0x88(%r13), %rax
movq %rax, 0x38(%rsp)
leaq 0x68(%r13), %rax
movq %rax, 0xb8(%rsp)
leaq 0x30(%r13), %rax
movq %rax, 0xb0(%rsp)
leaq 0x90(%r13), %rax
movq %rax, 0x30(%rsp)
leaq 0x78(%r13), %rax
movq %rax, 0xa8(%rsp)
leaq 0x40(%r13), %rax
movq %rax, 0xa0(%rsp)
leaq 0x8(%r13), %rax
movq %rax, 0x28(%rsp)
leaq 0x70(%r13), %rax
movq %rax, 0x78(%rsp)
leaq 0x80(%r13), %rax
movq %rax, 0x70(%rsp)
movsd 0x161fd(%rip), %xmm0    # 0x36918
addsd %xmm3, %xmm0
movsd %xmm0, 0x90(%rsp)
addsd %xmm0, %xmm0
movsd %xmm0, 0x88(%rsp)
leaq 0x38(%r13), %rax
movq %rax, 0x68(%rsp)
leaq 0x48(%r13), %rax
movq %rax, 0x60(%rsp)
leaq 0x16302(%rip), %rcx     # 0x36a50
movq %rbx, 0x98(%rsp)
movsd %xmm3, 0x8(%rsp)
movq (%r15), %rax
cmpq $0x4, %rax
ja 0x2075c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2, %r14d
jmp 0x20e6e
movq $0x1, 0x8(%r13)
movq 0x110(%rsp), %rax
movq $0x0, (%rax)
movapd %xmm3, %xmm0
movsd 0x16174(%rip), %xmm1    # 0x36910
callq 0x262fe
testb %al, %al
je 0x207bc
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
callq 0x2633e
testb %al, %al
jne 0x20f10
cmpq $0x0, 0x40(%rsp)
jle 0x20e76
movsd (%rbx), %xmm0
xorpd %xmm1, %xmm1
callq 0x2631e
testb %al, %al
jne 0x20e76
xorpd %xmm1, %xmm1
movsd 0x1538f(%rip), %xmm0    # 0x35b78
callq 0x262fe
testb %al, %al
jne 0x20e76
xorpd %xmm1, %xmm1
movapd 0x50(%rsp), %xmm0
callq 0x262fe
testb %al, %al
jne 0x20e76
xorpd %xmm1, %xmm1
movsd 0x16107(%rip), %xmm0    # 0x36920
callq 0x262fe
testb %al, %al
jne 0x20e76
xorpd %xmm1, %xmm1
movsd 0x160de(%rip), %xmm0    # 0x36910
callq 0x262fe
testb %al, %al
jne 0x20e76
movsd 0x8(%rsp), %xmm0
movsd 0x160c3(%rip), %xmm1    # 0x36910
callq 0x262fe
testb %al, %al
jne 0x20e76
movq %rbp, %rbx
movq %r12, %rbp
movq 0x48(%rsp), %rax
movq 0x28(%rax), %r15
movq 0x18(%rsp), %rax
movq 0x28(%rax), %r14
xorl %edi, %edi
movq 0x10(%rsp), %r12
movq %r12, %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %r15, %rdi
movq %r14, %rdx
movq %rax, %r8
callq 0x28ddc
movsd %xmm0, 0x20(%r13)
xorpd %xmm1, %xmm1
callq 0x2635a
testb %al, %al
jne 0x20ecd
movw $0x100, (%r13)          # imm = 0x100
movq $0x0, (%rbp)
movsd (%rbx), %xmm0
movsd %xmm0, 0x50(%r13)
movsd 0x20(%r13), %xmm0
mulsd 0x152a1(%rip), %xmm0    # 0x35b78
movsd %xmm0, 0x28(%r13)
movsd 0x90(%rsp), %xmm0
movsd %xmm0, 0xa8(%r13)
movsd 0x88(%rsp), %xmm0
movsd %xmm0, 0xb0(%r13)
movq 0x120(%rsp), %rax
movq 0x28(%rax), %r14
movq 0x20(%rsp), %rax
movq 0x28(%rax), %r15
xorl %edi, %edi
movq %r12, %rsi
movq %rbp, %r12
movq %rbx, %rbp
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %r8
callq 0x28ecd
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%r13)
movsd 0x20(%r13), %xmm0
movsd 0x50(%r13), %xmm1
movsd %xmm1, 0x68(%r13)
movsd %xmm0, 0x30(%r13)
movsd %xmm1, 0x78(%r13)
movsd %xmm0, 0x40(%r13)
movl $0x3, %r14d
movq 0x130(%rsp), %r15
movsd 0x8(%rsp), %xmm3
movq 0x98(%rsp), %rbx
jmp 0x20e67
movq 0x110(%rsp), %rax
movq $0x0, (%rax)
incq (%r12)
movq 0x48(%rsp), %rax
movq 0x28(%rax), %r14
movq 0x18(%rsp), %rax
movq 0x28(%rax), %r15
xorl %edi, %edi
movq 0x10(%rsp), %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %r8
callq 0x28ddc
movsd %xmm0, 0x10(%r13)
movsd (%rbx), %xmm0
mulsd 0x28(%r13), %xmm0
addsd 0x50(%r13), %xmm0
movsd %xmm0, 0x58(%r13)
cmpb $0x1, (%r13)
jne 0x20a26
movsd (%rbx), %xmm0
movsd 0x98(%r13), %xmm1
callq 0x2631e
testb %al, %al
jne 0x20a2d
movsd (%rbx), %xmm0
movsd 0xa0(%r13), %xmm1
callq 0x2635a
testb %al, %al
jne 0x20a2d
cmpq $0x0, 0x8(%r13)
jne 0x20a3c
movq 0x110(%rsp), %rax
movq $0x6, (%rax)
movsd (%rbx), %xmm0
movsd 0x8(%rsp), %xmm1
callq 0x262ba
testb %al, %al
je 0x20a87
movsd (%rbp), %xmm0
movsd 0x58(%r13), %xmm1
callq 0x2631e
testb %al, %al
je 0x20a87
movsd 0x10(%r13), %xmm0
movsd 0x28(%r13), %xmm1
callq 0x2631e
testb %al, %al
je 0x20a87
movq 0x110(%rsp), %rax
movq $0x5, (%rax)
movsd (%rbx), %xmm0
movsd 0x15e7d(%rip), %xmm1    # 0x36910
callq 0x262ba
testb %al, %al
movq 0x130(%rsp), %r15
je 0x20adc
movsd (%rbp), %xmm0
movsd 0x58(%r13), %xmm1
callq 0x2633e
testb %al, %al
jne 0x20acd
movsd 0x10(%r13), %xmm0
movsd 0x28(%r13), %xmm1
callq 0x2635a
testb %al, %al
je 0x20adc
movq 0x110(%rsp), %rax
movq $0x4, (%rax)
cmpq $0x14, (%r12)
jl 0x20af2
movq 0x110(%rsp), %rax
movq $0x3, (%rax)
cmpb $0x1, (%r13)
jne 0x20b2f
movsd 0xa0(%r13), %xmm1
movapd %xmm1, %xmm0
subsd 0x98(%r13), %xmm0
mulsd 0x15e09(%rip), %xmm1    # 0x36920
callq 0x2631e
testb %al, %al
je 0x20b2f
movq 0x110(%rsp), %rax
movq $0x2, (%rax)
movsd (%rbp), %xmm0
movsd 0x58(%r13), %xmm1
callq 0x2631e
testb %al, %al
je 0x20b7d
movsd 0x10(%r13), %xmm0
movq 0x138(%rsp), %rdi
callq 0x26575
movsd 0x20(%r13), %xmm1
mulsd 0xc0(%rsp), %xmm1
callq 0x2631e
testb %al, %al
je 0x20b7d
movq 0x110(%rsp), %rax
movq $0x1, (%rax)
movq 0x110(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x20e76
cmpb $0x1, 0x1(%r13)
jne 0x20bf4
movsd (%rbp), %xmm0
movsd 0x58(%r13), %xmm1
callq 0x2631e
testb %al, %al
je 0x20bf4
movsd 0x10(%r13), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x14fb7(%rip), %xmm0    # 0x35b78
movaps 0x50(%rsp), %xmm1
movq 0x138(%rsp), %rdi
callq 0x26626
movapd %xmm0, %xmm1
mulsd 0x20(%r13), %xmm1
movsd 0x80(%rsp), %xmm0
callq 0x2635a
testb %al, %al
je 0x20bf4
movb $0x0, 0x1(%r13)
cmpb $0x1, 0x1(%r13)
jne 0x20d59
movsd (%rbp), %xmm0
movsd 0x68(%r13), %xmm1
callq 0x2631e
testb %al, %al
je 0x20d59
movsd (%rbp), %xmm0
movsd 0x58(%r13), %xmm1
callq 0x2633e
testb %al, %al
je 0x20d59
movsd (%rbp), %xmm0
movsd 0x10(%r13), %xmm1
movsd 0x28(%r13), %xmm2
movsd (%rbx), %xmm3
mulsd %xmm2, %xmm3
subsd %xmm3, %xmm0
movsd %xmm0, 0x60(%r13)
movsd 0x68(%r13), %xmm3
movsd 0x88(%r13), %xmm4
mulsd %xmm2, %xmm4
subsd %xmm4, %xmm3
movsd %xmm3, 0x70(%r13)
movsd 0x78(%r13), %xmm3
movsd 0x90(%r13), %xmm4
mulsd %xmm2, %xmm4
subsd %xmm4, %xmm3
movsd %xmm3, 0x80(%r13)
subsd %xmm2, %xmm1
movsd %xmm1, 0x18(%r13)
movsd 0x30(%r13), %xmm3
subsd %xmm2, %xmm3
movsd %xmm3, 0x38(%r13)
movsd 0x40(%r13), %xmm3
subsd %xmm2, %xmm3
movsd %xmm3, 0x48(%r13)
movsd 0x98(%r13), %xmm2
movsd 0xa0(%r13), %xmm3
movq 0x38(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq 0x70(%rsp), %r8
movq 0x60(%rsp), %r9
pushq 0x138(%rsp)
pushq 0x30(%rsp)
pushq %r13
pushq %rbx
callq 0x2108e
addq $0x20, %rsp
movsd 0x28(%r13), %xmm0
movsd 0x88(%r13), %xmm1
mulsd %xmm0, %xmm1
addsd 0x70(%r13), %xmm1
movsd %xmm1, 0x68(%r13)
movsd 0x90(%r13), %xmm1
mulsd %xmm0, %xmm1
addsd 0x80(%r13), %xmm1
movsd %xmm1, 0x78(%r13)
movsd 0x38(%r13), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x30(%r13)
addsd 0x48(%r13), %xmm0
movsd %xmm0, 0x40(%r13)
jmp 0x20db7
movsd (%rbp), %xmm0
movsd 0x10(%r13), %xmm1
movsd 0x98(%r13), %xmm2
movsd 0xa0(%r13), %xmm3
movq 0x38(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq 0xa8(%rsp), %r8
movq 0xa0(%rsp), %r9
pushq 0x138(%rsp)
pushq 0x30(%rsp)
pushq %r13
pushq %rbx
callq 0x2108e
addq $0x20, %rsp
movl $0x3, %r14d
cmpb $0x1, (%r13)
jne 0x20e61
movsd 0x90(%r13), %xmm0
subsd 0x88(%r13), %xmm0
movq 0x138(%rsp), %rdi
callq 0x26575
movsd 0xb0(%r13), %xmm1
mulsd 0x15b30(%rip), %xmm1    # 0x36928
callq 0x2635a
testb %al, %al
je 0x20e27
movsd 0x88(%r13), %xmm0
movsd 0x90(%r13), %xmm1
subsd %xmm0, %xmm1
mulsd 0x13649(%rip), %xmm1    # 0x34468
addsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
movsd 0x90(%r13), %xmm0
movsd 0xa8(%r13), %xmm1
movsd %xmm1, 0xb0(%r13)
subsd 0x88(%r13), %xmm0
movq 0x138(%rsp), %rdi
callq 0x26575
movsd %xmm0, 0xa8(%r13)
movsd 0x8(%rsp), %xmm3
leaq 0x15be2(%rip), %rcx     # 0x36a50
movq %r14, (%r15)
jmp 0x2075c
movq $0x0, (%r15)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x88(%r13), %xmm0
cmpb $0x1, (%r13)
jne 0x20ede
movsd 0x90(%r13), %xmm1
callq 0x262fe
testb %al, %al
movq 0x10(%rsp), %rbp
je 0x20f2b
movupd 0x88(%r13), %xmm0
movupd %xmm0, 0x98(%r13)
jmp 0x20f4f
movq 0x130(%rsp), %rax
movq $0x0, (%rax)
jmp 0x20e7d
movsd %xmm0, 0x98(%r13)
movsd (%rbx), %xmm1
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
mulsd 0xb8(%r13), %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, 0xa0(%r13)
movq 0x10(%rsp), %rbp
jmp 0x20f55
movq 0x110(%rsp), %rax
movq $0x5, (%rax)
movq $0x0, (%rbx)
jmp 0x20e7d
movsd 0x88(%r13), %xmm0
movsd 0x90(%r13), %xmm1
movsd %xmm1, 0x98(%r13)
movsd %xmm0, 0xa0(%r13)
movsd 0x8(%rsp), %xmm3
movsd (%rbx), %xmm0
movapd %xmm3, %xmm1
callq 0x2633e
testb %al, %al
je 0x20f70
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rbx)
movsd (%rbx), %xmm0
movsd 0x15994(%rip), %xmm1    # 0x36910
callq 0x262fe
testb %al, %al
je 0x20f92
movabsq $0x358dee7a4ad4b81f, %rax # imm = 0x358DEE7A4AD4B81F
movq %rax, (%rbx)
cmpb $0x1, (%r13)
jne 0x20fc5
movsd (%rbx), %xmm0
movsd 0x98(%r13), %xmm1
callq 0x2631e
testb %al, %al
jne 0x21001
movsd (%rbx), %xmm0
movsd 0xa0(%r13), %xmm1
callq 0x2635a
testb %al, %al
jne 0x21001
cmpq $0x12, (%r12)
jg 0x21001
cmpq $0x0, 0x8(%r13)
je 0x21001
cmpb $0x1, (%r13)
jne 0x2100e
movsd 0xa0(%r13), %xmm1
movapd %xmm1, %xmm0
subsd 0x98(%r13), %xmm0
mulsd 0x15928(%rip), %xmm1    # 0x36920
callq 0x2631e
testb %al, %al
je 0x2100e
movsd 0x88(%r13), %xmm0
movsd %xmm0, (%rbx)
movq 0x20(%rsp), %r12
movq 0x28(%r12), %r14
movq 0x120(%rsp), %rax
movq 0x28(%rax), %r15
xorl %edi, %edi
movq %rbp, %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %r8
callq 0x28ecd
movq 0x28(%r12), %r14
movq 0x18(%rsp), %rax
movq 0x28(%rax), %r15
xorl %edi, %edi
movq %rbp, %rsi
callq 0x2923f
movsd (%rbx), %xmm0
movl $0x1, %esi
movl $0x1, %ecx
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %r8
callq 0x290d8
movq 0x130(%rsp), %rax
movq $0x4, (%rax)
jmp 0x20e7d