// File: /workspace/github_cpp_makefile_star2_O1/mouda[P]LTE_random_access-simulate/alglibinternal.cpp
// Function: alglib_impl::internalschurdecomposition(alglib_impl::ae_matrix*, long, long, long, alglib_impl::ae_vector*, alglib_impl::ae_vector*, alglib_impl::ae_matrix*, long*, alglib_impl::ae_state*)
void internalschurdecomposition(/* Real    */ ae_matrix* h,
     ae_int_t n,
     ae_int_t tneeded,
     ae_int_t zneeded,
     /* Real    */ ae_vector* wr,
     /* Real    */ ae_vector* wi,
     /* Real    */ ae_matrix* z,
     ae_int_t* info,
     ae_state *_state)
{
    ae_frame _frame_block;
    ae_vector work;
    ae_int_t i;
    ae_int_t i1;
    ae_int_t i2;
    ae_int_t ierr;
    ae_int_t ii;
    ae_int_t itemp;
    ae_int_t itn;
    ae_int_t its;
    ae_int_t j;
    ae_int_t k;
    ae_int_t l;
    ae_int_t maxb;
    ae_int_t nr;
    ae_int_t ns;
    ae_int_t nv;
    double absw;
    double ovfl;
    double smlnum;
    double tau;
    double temp;
    double tst1;
    double ulp;
    double unfl;
    ae_matrix s;
    ae_vector v;
    ae_vector vv;
    ae_vector workc1;
    ae_vector works1;
    ae_vector workv3;
    ae_vector tmpwr;
    ae_vector tmpwi;
    ae_bool initz;
    ae_bool wantt;
    ae_bool wantz;
    double cnst;
    ae_bool failflag;
    ae_int_t p1;
    ae_int_t p2;
    double vt;

    ae_frame_make(_state, &_frame_block);
    ae_vector_clear(wr);
    ae_vector_clear(wi);
    *info = 0;
    ae_vector_init(&work, 0, DT_REAL, _state, ae_true);
    ae_matrix_init(&s, 0, 0, DT_REAL, _state, ae_true);
    ae_vector_init(&v, 0, DT_REAL, _state, ae_true);
    ae_vector_init(&vv, 0, DT_REAL, _state, ae_true);
    ae_vector_init(&workc1, 0, DT_REAL, _state, ae_true);
    ae_vector_init(&works1, 0, DT_REAL, _state, ae_true);
    ae_vector_init(&workv3, 0, DT_REAL, _state, ae_true);
    ae_vector_init(&tmpwr, 0, DT_REAL, _state, ae_true);
    ae_vector_init(&tmpwi, 0, DT_REAL, _state, ae_true);

    
    /*
     * Set the order of the multi-shift QR algorithm to be used.
     * If you want to tune algorithm, change this values
     */
    ns = 12;
    maxb = 50;
    
    /*
     * Now 2 < NS <= MAXB < NH.
     */
    maxb = ae_maxint(3, maxb, _state);
    ns = ae_minint(maxb, ns, _state);
    
    /*
     * Initialize
     */
    cnst = 1.5;
    ae_vector_set_length(&work, ae_maxint(n, 1, _state)+1, _state);
    ae_matrix_set_length(&s, ns+1, ns+1, _state);
    ae_vector_set_length(&v, ns+1+1, _state);
    ae_vector_set_length(&vv, ns+1+1, _state);
    ae_vector_set_length(wr, ae_maxint(n, 1, _state)+1, _state);
    ae_vector_set_length(wi, ae_maxint(n, 1, _state)+1, _state);
    ae_vector_set_length(&workc1, 1+1, _state);
    ae_vector_set_length(&works1, 1+1, _state);
    ae_vector_set_length(&workv3, 3+1, _state);
    ae_vector_set_length(&tmpwr, ae_maxint(n, 1, _state)+1, _state);
    ae_vector_set_length(&tmpwi, ae_maxint(n, 1, _state)+1, _state);
    ae_assert(n>=0, "InternalSchurDecomposition: incorrect N!", _state);
    ae_assert(tneeded==0||tneeded==1, "InternalSchurDecomposition: incorrect TNeeded!", _state);
    ae_assert((zneeded==0||zneeded==1)||zneeded==2, "InternalSchurDecomposition: incorrect ZNeeded!", _state);
    wantt = tneeded==1;
    initz = zneeded==2;
    wantz = zneeded!=0;
    *info = 0;
    
    /*
     * Initialize Z, if necessary
     */
    if( initz )
    {
        ae_matrix_set_length(z, n+1, n+1, _state);
        for(i=1; i<=n; i++)
        {
            for(j=1; j<=n; j++)
            {
                if( i==j )
                {
                    z->ptr.pp_double[i][j] = 1;
                }
                else
                {
                    z->ptr.pp_double[i][j] = 0;
                }
            }
        }
    }
    
    /*
     * Quick return if possible
     */
    if( n==0 )
    {
        ae_frame_leave(_state);
        return;
    }
    if( n==1 )
    {
        wr->ptr.p_double[1] = h->ptr.pp_double[1][1];
        wi->ptr.p_double[1] = 0;
        ae_frame_leave(_state);
        return;
    }
    
    /*
     * Set rows and columns 1 to N to zero below the first
     * subdiagonal.
     */
    for(j=1; j<=n-2; j++)
    {
        for(i=j+2; i<=n; i++)
        {
            h->ptr.pp_double[i][j] = 0;
        }
    }
    
    /*
     * Test if N is sufficiently small
     */
    if( (ns<=2||ns>n)||maxb>=n )
    {
        
        /*
         * Use the standard double-shift algorithm
         */
        hsschur_internalauxschur(wantt, wantz, n, 1, n, h, wr, wi, 1, n, z, &work, &workv3, &workc1, &works1, info, _state);
        
        /*
         * fill entries under diagonal blocks of T with zeros
         */
        if( wantt )
        {
            j = 1;
            while(j<=n)
            {
                if( ae_fp_eq(wi->ptr.p_double[j],0) )
                {
                    for(i=j+1; i<=n; i++)
                    {
                        h->ptr.pp_double[i][j] = 0;
                    }
                    j = j+1;
                }
                else
                {
                    for(i=j+2; i<=n; i++)
                    {
                        h->ptr.pp_double[i][j] = 0;
                        h->ptr.pp_double[i][j+1] = 0;
                    }
                    j = j+2;
                }
            }
        }
        ae_frame_leave(_state);
        return;
    }
    unfl = ae_minrealnumber;
    ovfl = 1/unfl;
    ulp = 2*ae_machineepsilon;
    smlnum = unfl*(n/ulp);
    
    /*
     * I1 and I2 are the indices of the first row and last column of H
     * to which transformations must be applied. If eigenvalues only are
     * being computed, I1 and I2 are set inside the main loop.
     */
    i1 = 1;
    i2 = n;
    
    /*
     * ITN is the total number of multiple-shift QR iterations allowed.
     */
    itn = 30*n;
    
    /*
     * The main loop begins here. I is the loop index and decreases from
     * IHI to ILO in steps of at most MAXB. Each iteration of the loop
     * works with the active submatrix in rows and columns L to I.
     * Eigenvalues I+1 to IHI have already converged. Either L = ILO or
     * H(L,L-1) is negligible so that the matrix splits.
     */
    i = n;
    for(;;)
    {
        l = 1;
        if( i<1 )
        {
            
            /*
             * fill entries under diagonal blocks of T with zeros
             */
            if( wantt )
            {
                j = 1;
                while(j<=n)
                {
                    if( ae_fp_eq(wi->ptr.p_double[j],0) )
                    {
                        for(i=j+1; i<=n; i++)
                        {
                            h->ptr.pp_double[i][j] = 0;
                        }
                        j = j+1;
                    }
                    else
                    {
                        for(i=j+2; i<=n; i++)
                        {
                            h->ptr.pp_double[i][j] = 0;
                            h->ptr.pp_double[i][j+1] = 0;
                        }
                        j = j+2;
                    }
                }
            }
            
            /*
             * Exit
             */
            ae_frame_leave(_state);
            return;
        }
        
        /*
         * Perform multiple-shift QR iterations on rows and columns ILO to I
         * until a submatrix of order at most MAXB splits off at the bottom
         * because a subdiagonal element has become negligible.
         */
        failflag = ae_true;
        for(its=0; its<=itn; its++)
        {
            
            /*
             * Look for a single small subdiagonal element.
             */
            for(k=i; k>=l+1; k--)
            {
                tst1 = ae_fabs(h->ptr.pp_double[k-1][k-1], _state)+ae_fabs(h->ptr.pp_double[k][k], _state);
                if( ae_fp_eq(tst1,0) )
                {
                    tst1 = upperhessenberg1norm(h, l, i, l, i, &work, _state);
                }
                if( ae_fp_less_eq(ae_fabs(h->ptr.pp_double[k][k-1], _state),ae_maxreal(ulp*tst1, smlnum, _state)) )
                {
                    break;
                }
            }
            l = k;
            if( l>1 )
            {
                
                /*
                 * H(L,L-1) is negligible.
                 */
                h->ptr.pp_double[l][l-1] = 0;
            }
            
            /*
             * Exit from loop if a submatrix of order <= MAXB has split off.
             */
            if( l>=i-maxb+1 )
            {
                failflag = ae_false;
                break;
            }
            
            /*
             * Now the active submatrix is in rows and columns L to I. If
             * eigenvalues only are being computed, only the active submatrix
             * need be transformed.
             */
            if( its==20||its==30 )
            {
                
                /*
                 * Exceptional shifts.
                 */
                for(ii=i-ns+1; ii<=i; ii++)
                {
                    wr->ptr.p_double[ii] = cnst*(ae_fabs(h->ptr.pp_double[ii][ii-1], _state)+ae_fabs(h->ptr.pp_double[ii][ii], _state));
                    wi->ptr.p_double[ii] = 0;
                }
            }
            else
            {
                
                /*
                 * Use eigenvalues of trailing submatrix of order NS as shifts.
                 */
                copymatrix(h, i-ns+1, i, i-ns+1, i, &s, 1, ns, 1, ns, _state);
                hsschur_internalauxschur(ae_false, ae_false, ns, 1, ns, &s, &tmpwr, &tmpwi, 1, ns, z, &work, &workv3, &workc1, &works1, &ierr, _state);
                for(p1=1; p1<=ns; p1++)
                {
                    wr->ptr.p_double[i-ns+p1] = tmpwr.ptr.p_double[p1];
                    wi->ptr.p_double[i-ns+p1] = tmpwi.ptr.p_double[p1];
                }
                if( ierr>0 )
                {
                    
                    /*
                     * If DLAHQR failed to compute all NS eigenvalues, use the
                     * unconverged diagonal elements as the remaining shifts.
                     */
                    for(ii=1; ii<=ierr; ii++)
                    {
                        wr->ptr.p_double[i-ns+ii] = s.ptr.pp_double[ii][ii];
                        wi->ptr.p_double[i-ns+ii] = 0;
                    }
                }
            }
            
            /*
             * Form the first column of (G-w(1)) (G-w(2)) . . . (G-w(ns))
             * where G is the Hessenberg submatrix H(L:I,L:I) and w is
             * the vector of shifts (stored in WR and WI). The result is
             * stored in the local array V.
             */
            v.ptr.p_double[1] = 1;
            for(ii=2; ii<=ns+1; ii++)
            {
                v.ptr.p_double[ii] = 0;
            }
            nv = 1;
            for(j=i-ns+1; j<=i; j++)
            {
                if( ae_fp_greater_eq(wi->ptr.p_double[j],0) )
                {
                    if( ae_fp_eq(wi->ptr.p_double[j],0) )
                    {
                        
                        /*
                         * real shift
                         */
                        p1 = nv+1;
                        ae_v_move(&vv.ptr.p_double[1], 1, &v.ptr.p_double[1], 1, ae_v_len(1,p1));
                        matrixvectormultiply(h, l, l+nv, l, l+nv-1, ae_false, &vv, 1, nv, 1.0, &v, 1, nv+1, -wr->ptr.p_double[j], _state);
                        nv = nv+1;
                    }
                    else
                    {
                        if( ae_fp_greater(wi->ptr.p_double[j],0) )
                        {
                            
                            /*
                             * complex conjugate pair of shifts
                             */
                            p1 = nv+1;
                            ae_v_move(&vv.ptr.p_double[1], 1, &v.ptr.p_double[1], 1, ae_v_len(1,p1));
                            matrixvectormultiply(h, l, l+nv, l, l+nv-1, ae_false, &v, 1, nv, 1.0, &vv, 1, nv+1, -2*wr->ptr.p_double[j], _state);
                            itemp = vectoridxabsmax(&vv, 1, nv+1, _state);
                            temp = 1/ae_maxreal(ae_fabs(vv.ptr.p_double[itemp], _state), smlnum, _state);
                            p1 = nv+1;
                            ae_v_muld(&vv.ptr.p_double[1], 1, ae_v_len(1,p1), temp);
                            absw = pythag2(wr->ptr.p_double[j], wi->ptr.p_double[j], _state);
                            temp = temp*absw*absw;
                            matrixvectormultiply(h, l, l+nv+1, l, l+nv, ae_false, &vv, 1, nv+1, 1.0, &v, 1, nv+2, temp, _state);
                            nv = nv+2;
                        }
                    }
                    
                    /*
                     * Scale V(1:NV) so that max(abs(V(i))) = 1. If V is zero,
                     * reset it to the unit vector.
                     */
                    itemp = vectoridxabsmax(&v, 1, nv, _state);
                    temp = ae_fabs(v.ptr.p_double[itemp], _state);
                    if( ae_fp_eq(temp,0) )
                    {
                        v.ptr.p_double[1] = 1;
                        for(ii=2; ii<=nv; ii++)
                        {
                            v.ptr.p_double[ii] = 0;
                        }
                    }
                    else
                    {
                        temp = ae_maxreal(temp, smlnum, _state);
                        vt = 1/temp;
                        ae_v_muld(&v.ptr.p_double[1], 1, ae_v_len(1,nv), vt);
                    }
                }
            }
            
            /*
             * Multiple-shift QR step
             */
            for(k=l; k<=i-1; k++)
            {
                
                /*
                 * The first iteration of this loop determines a reflection G
                 * from the vector V and applies it from left and right to H,
                 * thus creating a nonzero bulge below the subdiagonal.
                 *
                 * Each subsequent iteration determines a reflection G to
                 * restore the Hessenberg form in the (K-1)th column, and thus
                 * chases the bulge one step toward the bottom of the active
                 * submatrix. NR is the order of G.
                 */
                nr = ae_minint(ns+1, i-k+1, _state);
                if( k>l )
                {
                    p1 = k-1;
                    p2 = k+nr-1;
                    ae_v_move(&v.ptr.p_double[1], 1, &h->ptr.pp_double[k][p1], h->stride, ae_v_len(1,nr));
                }
                generatereflection(&v, nr, &tau, _state);
                if( k>l )
                {
                    h->ptr.pp_double[k][k-1] = v.ptr.p_double[1];
                    for(ii=k+1; ii<=i; ii++)
                    {
                        h->ptr.pp_double[ii][k-1] = 0;
                    }
                }
                v.ptr.p_double[1] = 1;
                
                /*
                 * Apply G from the left to transform the rows of the matrix in
                 * columns K to I2.
                 */
                applyreflectionfromtheleft(h, tau, &v, k, k+nr-1, k, i2, &work, _state);
                
                /*
                 * Apply G from the right to transform the columns of the
                 * matrix in rows I1 to min(K+NR,I).
                 */
                applyreflectionfromtheright(h, tau, &v, i1, ae_minint(k+nr, i, _state), k, k+nr-1, &work, _state);
                if( wantz )
                {
                    
                    /*
                     * Accumulate transformations in the matrix Z
                     */
                    applyreflectionfromtheright(z, tau, &v, 1, n, k, k+nr-1, &work, _state);
                }
            }
        }
        
        /*
         * Failure to converge in remaining number of iterations
         */
        if( failflag )
        {
            *info = i;
            ae_frame_leave(_state);
            return;
        }
        
        /*
         * A submatrix of order <= MAXB in rows and columns L to I has split
         * off. Use the double-shift QR algorithm to handle it.
         */
        hsschur_internalauxschur(wantt, wantz, n, l, i, h, wr, wi, 1, n, z, &work, &workv3, &workc1, &works1, info, _state);
        if( *info>0 )
        {
            ae_frame_leave(_state);
            return;
        }
        
        /*
         * Decrement number of remaining iterations, and return to start of
         * the main loop with a new value of I.
         */
        itn = itn-its;
        i = l-1;
    }
    ae_frame_leave(_state);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %r9, %rbx
movq %r8, %r15
movq %rcx, 0x40(%rsp)
movq %rdx, 0x30(%rsp)
movq %rsi, %rbp
movq %rdi, 0x18(%rsp)
movq 0x2f0(%rsp), %r12
movq 0x2e8(%rsp), %r14
leaq 0x290(%rsp), %rsi
movq %r12, %rdi
callq 0x2575d
movq %r15, %rdi
callq 0x25ac7
movq %rbx, %rdi
callq 0x25ac7
xorl %eax, %eax
movq %rax, (%r14)
leaq 0x130(%rsp), %r13
movl $0x3, %edx
movq %r13, %rdi
xorl %esi, %esi
movq %r12, %rcx
movl $0x1, %r8d
callq 0x25900
leaq 0x250(%rsp), %rdi
movl $0x3, %ecx
xorl %esi, %esi
xorl %edx, %edx
movq %r12, %r8
movl $0x1, %r9d
callq 0x25b46
leaq 0x90(%rsp), %rdi
movl $0x3, %edx
xorl %esi, %esi
movq %r12, %rcx
movl $0x1, %r8d
callq 0x25900
leaq 0x100(%rsp), %rdi
movl $0x3, %edx
xorl %esi, %esi
movq %r12, %rcx
movl $0x1, %r8d
callq 0x25900
leaq 0x1c0(%rsp), %rdi
movl $0x3, %edx
xorl %esi, %esi
movq %r12, %rcx
movl $0x1, %r8d
callq 0x25900
leaq 0x190(%rsp), %rdi
movl $0x3, %edx
xorl %esi, %esi
movq %r12, %rcx
movl $0x1, %r8d
callq 0x25900
leaq 0x160(%rsp), %rdi
movl $0x3, %edx
xorl %esi, %esi
movq %r12, %rcx
movl $0x1, %r8d
callq 0x25900
leaq 0x220(%rsp), %rdi
movl $0x3, %edx
xorl %esi, %esi
movq %r12, %rcx
movl $0x1, %r8d
callq 0x25900
leaq 0x1f0(%rsp), %rdi
movl $0x3, %edx
xorl %esi, %esi
movq %r12, %rcx
movl $0x1, %r8d
callq 0x25900
movl $0x3, %edi
movl $0x32, %esi
movq %r12, %rdx
callq 0x2660b
movl $0xc, %esi
movq %rax, 0x60(%rsp)
movq %rax, %rdi
movq %r12, %rdx
callq 0x26616
movq %rax, %r14
movl $0x1, %esi
movq %rbp, %rdi
movq %r12, %rdx
callq 0x2660b
leaq 0x1(%rax), %rsi
movq %r13, %rdi
movq %r12, %rdx
callq 0x25a42
leaq 0x1(%r14), %rdx
leaq 0x250(%rsp), %rdi
movq %rbx, %r13
movq %rdx, %rsi
movq %rdx, 0xf0(%rsp)
movq %r12, %rcx
callq 0x25df3
movq %r14, 0x38(%rsp)
leaq 0x2(%r14), %rbx
leaq 0x90(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x25a42
leaq 0x100(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x25a42
movl $0x1, %esi
movq %rbp, %rdi
movq %r12, %rdx
callq 0x2660b
leaq 0x1(%rax), %rsi
movq %r15, 0x10(%rsp)
movq %r15, %rdi
movq 0x2e0(%rsp), %r15
movq %r12, %rdx
callq 0x25a42
movl $0x1, %esi
movq %rbp, %rdi
movq %r12, %rdx
callq 0x2660b
leaq 0x1(%rax), %rsi
movq %r13, %rdi
movq %r12, %rdx
callq 0x25a42
movl $0x2, %esi
leaq 0x1c0(%rsp), %rdi
movq %r12, %rdx
callq 0x25a42
movl $0x2, %esi
leaq 0x190(%rsp), %rdi
movq %r12, %rdx
callq 0x25a42
movl $0x4, %esi
leaq 0x160(%rsp), %rdi
movq %r12, %rdx
callq 0x25a42
movl $0x1, %esi
movq %rbp, %rdi
movq %r12, %rdx
callq 0x2660b
leaq 0x1(%rax), %rsi
leaq 0x220(%rsp), %rdi
movq %r12, %rdx
callq 0x25a42
movl $0x1, %esi
movq %rbp, %rdi
movq %r12, %rdx
callq 0x2660b
leaq 0x1(%rax), %rsi
leaq 0x1f0(%rsp), %rdi
movq %r12, %rdx
callq 0x25a42
xorl %edi, %edi
testq %rbp, %rbp
setns %dil
leaq 0x1c175(%rip), %rsi     # 0x36e63
movq %r12, %rdx
callq 0x2581c
xorl %edi, %edi
cmpq $0x2, 0x30(%rsp)
setb %dil
leaq 0x1c183(%rip), %rsi     # 0x36e8c
movq %r12, %rdx
callq 0x2581c
xorl %edi, %edi
movq 0x40(%rsp), %rbx
cmpq $0x3, %rbx
setb %dil
leaq 0x1c194(%rip), %rsi     # 0x36ebb
movq %r12, %rdx
movq %rbp, %r12
callq 0x2581c
xorl %eax, %eax
movq 0x2e8(%rsp), %rcx
movq %rax, (%rcx)
cmpq $0x2, %rbx
jne 0x1ada5
leaq 0x1(%r12), %rdx
movq %r15, %rdi
movq %rdx, %rsi
movq 0x2f0(%rsp), %rcx
callq 0x25df3
testq %r12, %r12
jle 0x1ada5
movl $0x1, %ecx
xorl %eax, %eax
movsd 0x1942f(%rip), %xmm0    # 0x341a0
xorl %edx, %edx
movapd %xmm0, %xmm1
cmpq %rdx, %rax
je 0x1ad80
xorpd %xmm1, %xmm1
movq 0x38(%r15), %rsi
movq (%rsi,%rcx,8), %rsi
movsd %xmm1, 0x8(%rsi,%rdx,8)
incq %rdx
cmpq %rdx, %r12
jne 0x1ad73
leaq 0x1(%rcx), %rdx
incq %rax
cmpq %r12, %rcx
movq %rdx, %rcx
jne 0x1ad71
movq %r13, 0x8(%rsp)
testq %r12, %r12
movq 0x10(%rsp), %r14
movq 0x18(%rsp), %r13
je 0x1ade6
cmpq $0x1, %r12
jne 0x1ae05
movq 0x38(%r13), %rax
movq 0x8(%rax), %rax
movsd 0x8(%rax), %xmm0
movq 0x28(%r14), %rax
movsd %xmm0, 0x8(%rax)
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq $0x0, 0x8(%rax)
movq 0x2f0(%rsp), %rdi
callq 0x256fa
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x3, %r12
movq 0x2f0(%rsp), %r10
movq 0x8(%rsp), %r11
movq 0x38(%rsp), %r8
jl 0x1ae57
leaq -0x2(%r12), %rax
movl $0x1, %edx
movl $0x2, %ecx
movq %rcx, %rsi
movq 0x38(%r13), %rdi
movq 0x8(%rdi,%rsi,8), %rdi
movq $0x0, (%rdi,%rdx,8)
incq %rsi
cmpq %r12, %rsi
jl 0x1ae2f
leaq 0x1(%rdx), %rsi
incq %rcx
cmpq %rax, %rdx
movq %rsi, %rdx
jne 0x1ae2c
cmpq %r12, 0x60(%rsp)
jge 0x1b9d0
cmpq $0x3, %r8
jl 0x1b9d0
cmpq %r12, %r8
jg 0x1b9d0
movq %r12, 0x20(%rsp)
testq %r12, %r12
jle 0x1b927
movq 0x20(%rsp), %r12
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
divsd 0x19948(%rip), %xmm0    # 0x347e0
mulsd 0x1a5d8(%rip), %xmm0    # 0x35478
movsd %xmm0, 0x50(%rsp)
movq %r12, %rsi
shlq $0x5, %rsi
subq %r12, %rsi
subq %r12, %rsi
leaq (,%r8,8), %rax
movl $0x8, %ecx
subq %rax, %rcx
movq %rcx, 0xc8(%rsp)
movq %rsi, %rax
shrq $0x3f, %rax
testq %rsi, %rsi
movq %rsi, 0x68(%rsp)
js 0x1b878
movq %rax, 0x48(%rsp)
movq %r12, %rax
subq 0x60(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq %r12, %rax
subq %r8, %rax
movq %rax, 0x70(%rsp)
incq %rax
movq %rax, 0xd8(%rsp)
leaq 0x1(%r12), %rax
movq %rax, 0xe8(%rsp)
leaq 0x1(%rsi), %rax
movq %rax, 0xd0(%rsp)
movq 0xc8(%rsp), %rax
leaq (%rax,%r12,8), %rax
movq %rax, 0x80(%rsp)
movl $0x1, %r14d
xorl %eax, %eax
movq 0x2f0(%rsp), %r15
movq %r12, 0x88(%rsp)
movq %rax, 0x78(%rsp)
movq %r14, %rbx
movq %r12, %rcx
movq %rcx, %r14
cmpq %rbx, %rcx
jle 0x1b037
movq 0x38(%r13), %rax
movq -0x8(%rax,%r14,8), %rax
movsd -0x8(%rax,%r14,8), %xmm0
movq %r15, %rdi
callq 0x26575
movsd %xmm0, (%rsp)
movq 0x38(%r13), %rax
movq (%rax,%r14,8), %rax
movsd (%rax,%r14,8), %xmm0
movq 0x2f0(%rsp), %r15
movq %r15, %rdi
callq 0x26575
addsd (%rsp), %xmm0
xorpd %xmm1, %xmm1
movsd %xmm0, (%rsp)
callq 0x262ba
testb %al, %al
je 0x1afe4
subq $0x8, %rsp
movq %r13, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %rbx, %rcx
movq %r12, %r8
leaq 0x138(%rsp), %r9
pushq %r15
callq 0x16984
addq $0x10, %rsp
movsd %xmm0, (%rsp)
movq 0x38(%r13), %rax
movq (%rax,%r14,8), %rax
movsd -0x8(%rax,%r14,8), %xmm0
movq %r15, %rdi
callq 0x26575
movsd %xmm0, 0x58(%rsp)
movsd (%rsp), %xmm0
mulsd 0x197d2(%rip), %xmm0    # 0x347e0
movsd 0x50(%rsp), %xmm1
movq %r15, %rdi
callq 0x26621
movapd %xmm0, %xmm1
movsd 0x58(%rsp), %xmm0
callq 0x2631e
leaq -0x1(%r14), %rcx
testb %al, %al
je 0x1af5b
cmpq $0x2, %r14
jl 0x1b04e
movq 0x38(%r13), %rax
movq (%rax,%r14,8), %rax
movq $0x0, -0x8(%rax,%r14,8)
cmpq 0xe0(%rsp), %r14
movq 0x78(%rsp), %rbp
jg 0x1b871
cmpq $0x1e, %rbp
movq %r14, 0x28(%rsp)
je 0x1b076
cmpq $0x14, %rbp
jne 0x1b0f7
movq 0x70(%rsp), %rbx
movq %r13, %rbp
movq 0x2f0(%rsp), %r15
movq 0x10(%rsp), %r13
leaq 0x1(%rbx), %r14
movq 0x38(%rbp), %rax
movq 0x8(%rax,%rbx,8), %rax
movsd (%rax,%rbx,8), %xmm0
movq %r15, %rdi
callq 0x26575
movsd %xmm0, (%rsp)
movq 0x38(%rbp), %rax
movq 0x8(%rax,%rbx,8), %rax
movsd 0x8(%rax,%rbx,8), %xmm0
movq %r15, %rdi
callq 0x26575
addsd (%rsp), %xmm0
mulsd 0x1b80a(%rip), %xmm0    # 0x368d8
movq 0x28(%r13), %rax
movsd %xmm0, 0x8(%rax,%rbx,8)
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq $0x0, 0x8(%rax,%rbx,8)
movq %r14, %rbx
cmpq %r12, %r14
jl 0x1b08b
jmp 0x1b244
subq $0x8, %rsp
movq %r13, %rdi
movq 0xe0(%rsp), %rcx
movq %rcx, %rsi
movq %r12, %rdx
movq %r12, %r8
leaq 0x258(%rsp), %r14
movq %r14, %r9
movq 0x2f8(%rsp), %r15
pushq %r15
movq 0x48(%rsp), %rbx
pushq %rbx
movl $0x1, %eax
pushq %rax
pushq %rbx
pushq %rax
callq 0x16acb
addq $0x30, %rsp
movl $0x1, %ecx
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
movq %rbx, %r8
movq %r14, %r9
pushq %r15
leaq 0x100(%rsp), %rax
pushq %rax
leaq 0x1a0(%rsp), %rax
pushq %rax
leaq 0x1d8(%rsp), %rax
pushq %rax
leaq 0x180(%rsp), %rax
pushq %rax
leaq 0x158(%rsp), %rax
pushq %rax
pushq 0x310(%rsp)
pushq %rbx
leaq 0x230(%rsp), %rax
pushq %rax
leaq 0x268(%rsp), %rax
pushq %rax
callq 0x1bae2
addq $0x50, %rsp
testq %rbx, %rbx
movq 0x8(%rsp), %rdx
movq 0x80(%rsp), %rsi
movq 0x10(%rsp), %r8
jle 0x1b1f4
xorl %eax, %eax
movq 0x248(%rsp), %rcx
movsd 0x8(%rcx,%rax,8), %xmm0
movq 0x28(%r8), %rcx
addq %rsi, %rcx
movsd %xmm0, (%rcx,%rax,8)
movq 0x218(%rsp), %rcx
movsd 0x8(%rcx,%rax,8), %xmm0
movq 0x28(%rdx), %rcx
addq %rsi, %rcx
movsd %xmm0, (%rcx,%rax,8)
incq %rax
cmpq %rax, %rbx
jne 0x1b1b8
movq 0xf8(%rsp), %rax
testq %rax, %rax
jle 0x1b244
movq %rdx, %rsi
xorl %ecx, %ecx
movq 0x288(%rsp), %rdx
movq 0x8(%rdx,%rcx,8), %rdx
movsd 0x8(%rdx,%rcx,8), %xmm0
movq 0x28(%r8), %rdx
movq 0x80(%rsp), %rdi
addq %rdi, %rdx
movsd %xmm0, (%rdx,%rcx,8)
movq 0x28(%rsi), %rdx
addq %rdi, %rdx
movq $0x0, (%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x1b206
movq 0xb8(%rsp), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x8(%rax)
movq 0x38(%rsp), %rdx
testq %rdx, %rdx
jle 0x1b27f
xorl %eax, %eax
movq 0xb8(%rsp), %rcx
movq $0x0, 0x10(%rcx,%rax,8)
incq %rax
cmpq %rax, %rdx
jne 0x1b266
movl $0x1, %ebp
movq 0x70(%rsp), %r13
movq 0x8(%rsp), %rbx
movq 0x28(%rbx), %rax
movsd 0x8(%rax,%r13,8), %xmm0
incq %r13
xorpd %xmm1, %xmm1
callq 0x2635a
testb %al, %al
je 0x1b648
movq 0x28(%rbx), %rax
movsd (%rax,%r13,8), %xmm0
xorpd %xmm1, %xmm1
callq 0x262ba
testb %al, %al
je 0x1b37e
leaq 0x1(%rbp), %rbx
movq 0x128(%rsp), %r14
addq $0x8, %r14
movq 0xb8(%rsp), %r15
addq $0x8, %r15
movl $0x1, %edi
movq %rbx, %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %r14, %rdi
movq %r15, %rdx
movq 0x2f0(%rsp), %r15
movq %rax, %r8
callq 0x28ecd
movq 0x28(%rsp), %rcx
leaq (%rcx,%rbp), %rdx
leaq (%rcx,%rbp), %r8
decq %r8
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movsd (%rax,%r13,8), %xmm1
xorpd 0x18ea8(%rip), %xmm1    # 0x341e0
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
movq %rcx, %rsi
xorl %r9d, %r9d
movsd 0x18e51(%rip), %xmm0    # 0x341a0
pushq %r15
pushq %rbx
movl $0x1, %eax
pushq %rax
leaq 0xb0(%rsp), %r14
pushq %r14
pushq %rbp
pushq %rax
leaq 0x138(%rsp), %rax
pushq %rax
callq 0x16ea9
addq $0x40, %rsp
movq %rbx, %rbp
jmp 0x1b576
movq 0x28(%rbx), %rax
movsd (%rax,%r13,8), %xmm0
xorpd %xmm1, %xmm1
callq 0x2633e
testb %al, %al
je 0x1b566
leaq 0x1(%rbp), %r14
movq 0x128(%rsp), %rbx
addq $0x8, %rbx
movq 0xb8(%rsp), %r15
addq $0x8, %r15
movl $0x1, %edi
movq %r14, %rsi
callq 0x2923f
movl $0x1, %esi
movl $0x1, %ecx
movq %rbx, %rdi
movq %r15, %rdx
movq %rax, %r8
callq 0x28ecd
movq 0x28(%rsp), %r12
leaq (%r12,%rbp), %rdx
movq %rdx, 0x58(%rsp)
leaq (%r12,%rbp), %r8
decq %r8
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movsd (%rax,%r13,8), %xmm1
mulsd 0x18fea(%rip), %xmm1    # 0x343f0
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
movq %r12, %rsi
movq %r12, %rcx
xorl %r9d, %r9d
movsd 0x18d80(%rip), %xmm0    # 0x341a0
pushq 0x2f8(%rsp)
movq %r14, %rbx
pushq %r14
movl $0x1, %r10d
pushq %r10
leaq 0x120(%rsp), %r15
pushq %r15
pushq %rbp
pushq %r10
leaq 0xc8(%rsp), %r14
pushq %r14
callq 0x16ea9
addq $0x40, %rsp
movl $0x1, %esi
movq %r15, %rdi
movq %rbx, %rdx
movq 0x2f0(%rsp), %rcx
callq 0x16788
movq 0x128(%rsp), %rcx
movsd (%rcx,%rax,8), %xmm0
movq 0x2f0(%rsp), %rdi
callq 0x26575
movsd 0x50(%rsp), %xmm1
movq 0x2f0(%rsp), %rdi
callq 0x26621
movsd 0x18cff(%rip), %xmm1    # 0x341a0
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movq 0x128(%rsp), %r15
addq $0x8, %r15
movl $0x1, %edi
movq %rbx, %rsi
callq 0x2923f
movl $0x1, %esi
movq %r15, %rdi
movq 0x2f0(%rsp), %r15
movq %rax, %rdx
movsd (%rsp), %xmm0
callq 0x291fc
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movsd (%rax,%r13,8), %xmm0
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movsd (%rax,%r13,8), %xmm1
movq %r15, %rdi
callq 0x17254
movsd (%rsp), %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
leaq (%r12,%rbp), %rdx
incq %rdx
addq $0x2, %rbp
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
movq %r12, %rsi
movq %r12, %rcx
movq 0x60(%rsp), %r8
xorl %r9d, %r9d
movsd 0x18c63(%rip), %xmm0    # 0x341a0
pushq %r15
pushq %rbp
movl $0x1, %eax
pushq %rax
pushq %r14
pushq %rbx
pushq %rax
movq 0xc0(%rsp), %r12
leaq 0x138(%rsp), %rax
pushq %rax
callq 0x16ea9
addq $0x40, %rsp
jmp 0x1b576
leaq 0x90(%rsp), %r14
movq 0x2f0(%rsp), %r15
movl $0x1, %esi
movq %r14, %rdi
movq %rbp, %rdx
movq %r15, %rcx
callq 0x16788
movq 0xb8(%rsp), %rcx
movsd (%rcx,%rax,8), %xmm0
movq %r15, %rdi
callq 0x26575
xorpd %xmm1, %xmm1
movsd %xmm0, (%rsp)
callq 0x262ba
testb %al, %al
je 0x1b5f1
movq 0xb8(%rsp), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x8(%rax)
cmpq $0x2, %rbp
movq 0x8(%rsp), %rbx
jl 0x1b648
movl $0x1, %eax
movq 0xb8(%rsp), %rcx
movq $0x0, 0x8(%rcx,%rax,8)
incq %rax
cmpq %rax, %rbp
jne 0x1b5d6
jmp 0x1b648
movsd (%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
movq %r15, %rdi
callq 0x26621
movsd 0x18b94(%rip), %xmm1    # 0x341a0
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movq 0xb8(%rsp), %rbx
addq $0x8, %rbx
movl $0x1, %edi
movq %rbp, %rsi
callq 0x2923f
movl $0x1, %esi
movq %rbx, %rdi
movq %rax, %rdx
movsd (%rsp), %xmm0
callq 0x291fc
movq 0x8(%rsp), %rbx
cmpq %r12, %r13
jl 0x1b28e
movq 0x28(%rsp), %rax
movq %rax, %rbp
cmpq %r12, %rax
movq 0x18(%rsp), %r13
jge 0x1b840
movq 0xe8(%rsp), %rsi
subq %rbp, %rsi
movq 0xf0(%rsp), %rdi
movq 0x2f0(%rsp), %r14
movq %r14, %rdx
callq 0x26616
movq %rax, %rbx
cmpq 0x28(%rsp), %rbp
jle 0x1b740
movq 0xb8(%rsp), %r14
addq $0x8, %r14
movq 0x10(%r13), %r15
movq 0x38(%r13), %rax
movq (%rax,%rbp,8), %rax
leaq (%rax,%rbp,8), %r13
addq $-0x8, %r13
movl $0x1, %edi
movq %rbx, %rsi
callq 0x2923f
movl $0x1, %esi
movq %r14, %rdi
movq %r13, %rdx
movq 0x18(%rsp), %r13
movq %r15, %rcx
movq 0x2f0(%rsp), %r14
movq %rax, %r8
callq 0x28ecd
leaq 0x90(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
leaq 0xc0(%rsp), %rdx
movq %r14, %rcx
callq 0x185c3
movq 0xb8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x38(%r13), %rax
movq (%rax,%rbp,8), %rax
movsd %xmm0, -0x8(%rax,%rbp,8)
movq %rbp, %rax
movq 0x38(%r13), %rcx
movq 0x8(%rcx,%rax,8), %rcx
incq %rax
movq $0x0, -0x8(%rcx,%rbp,8)
cmpq %r12, %rax
jl 0x1b724
jmp 0x1b75e
leaq 0x90(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
leaq 0xc0(%rsp), %rdx
movq %r14, %rcx
callq 0x185c3
movq 0xb8(%rsp), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x8(%rax)
movsd 0xc0(%rsp), %xmm0
movsd %xmm0, (%rsp)
leaq (%rbx,%rbp), %r14
decq %r14
addq %rbp, %rbx
subq $0x8, %rsp
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r14, %rcx
movq %rbp, %r8
movq 0x28(%rsp), %r9
leaq 0x138(%rsp), %rax
pushq %rax
callq 0x188cf
addq $0x10, %rsp
movq %rbx, %rdi
movq %r12, %rsi
movq 0x2f0(%rsp), %rdx
callq 0x26616
subq $0x10, %rsp
movl $0x1, %edx
movq %r13, %rbx
movq %r13, %rdi
movsd 0x10(%rsp), %xmm0
movq %r15, %rsi
movq %rax, %rcx
movq %rbp, %r8
movq %r14, %r9
callq 0x18ad0
addq $0x10, %rsp
cmpq $0x0, 0x40(%rsp)
je 0x1b829
subq $0x10, %rsp
movl $0x1, %edx
movq 0x2f0(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
movq %r15, %rsi
movq 0x30(%rsp), %rcx
movq %rbp, %r8
movq %r14, %r9
callq 0x18ad0
addq $0x10, %rsp
incq %rbp
movq 0x88(%rsp), %r12
cmpq %r12, %rbp
movq %rbx, %r13
jne 0x1b667
movq 0x78(%rsp), %rcx
leaq 0x1(%rcx), %rax
cmpq 0x68(%rsp), %rcx
setge %cl
movq %rcx, 0x48(%rsp)
movq 0x28(%rsp), %r14
movq 0x2f0(%rsp), %r15
jne 0x1af50
movq 0xd0(%rsp), %rbp
movq 0x48(%rsp), %rax
jmp 0x1b880
xorl %ebp, %ebp
movl $0x1, %r14d
testb $0x1, %al
jne 0x1bad2
xorl %esi, %esi
cmpq $0x0, 0x40(%rsp)
setne %sil
xorl %edi, %edi
cmpq $0x1, 0x30(%rsp)
sete %dil
movq 0x20(%rsp), %rdx
movq %r14, %rcx
movq %r12, %r8
movq %r13, %r9
pushq 0x2f0(%rsp)
movq 0x2f0(%rsp), %rbx
pushq %rbx
leaq 0x1a0(%rsp), %r10
pushq %r10
leaq 0x1d8(%rsp), %r10
pushq %r10
leaq 0x180(%rsp), %r10
pushq %r10
leaq 0x158(%rsp), %r10
pushq %r10
movq 0x310(%rsp), %r10
pushq %r10
pushq %rdx
pushq 0x48(%rsp)
pushq 0x58(%rsp)
callq 0x1bae2
addq $0x50, %rsp
cmpq $0x0, (%rbx)
jg 0x1ade6
movq 0x68(%rsp), %rsi
subq %rbp, %rsi
leaq -0x1(%r14), %r12
cmpq $0x2, %r14
movq 0x38(%rsp), %r8
jge 0x1aecb
cmpq $0x1, 0x30(%rsp)
setne %al
movq 0x20(%rsp), %r12
testq %r12, %r12
setle %cl
orb %al, %cl
jne 0x1ade6
leaq -0x1(%r12), %rbx
movl $0x1, %r15d
xorl %r14d, %r14d
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movsd (%rax,%r15,8), %xmm0
xorpd %xmm1, %xmm1
callq 0x262ba
testb %al, %al
je 0x1b994
leaq 0x1(%r15), %rax
cmpq %r12, %r15
jge 0x1b9c3
movq %r15, %rcx
movq 0x38(%r13), %rdx
movq 0x8(%rdx,%rcx,8), %rdx
movq $0x0, (%rdx,%r15,8)
incq %rcx
cmpq %rcx, %r12
jne 0x1b979
jmp 0x1b9c3
leaq 0x2(%r15), %rax
cmpq %r12, %rax
jg 0x1b9c3
movq %r15, %rcx
movq 0x38(%r13), %rdx
movq 0x10(%rdx,%rcx,8), %rdx
movq %r14, (%rdx,%r15,8)
movq 0x38(%r13), %rdx
movq 0x10(%rdx,%rcx,8), %rdx
movq %r14, 0x8(%rdx,%r15,8)
incq %rcx
cmpq %rcx, %rbx
jne 0x1b9a0
movq %rax, %r15
cmpq %r12, %rax
jle 0x1b951
jmp 0x1ade6
xorl %esi, %esi
cmpq $0x0, 0x40(%rsp)
setne %sil
xorl %edi, %edi
cmpq $0x1, 0x30(%rsp)
setne %bpl
sete %dil
movl $0x1, %ebx
movl $0x1, %ecx
movq %r12, %rdx
movq %r12, %r8
movq %r13, %r9
pushq %r10
pushq 0x2f0(%rsp)
leaq 0x1a0(%rsp), %rax
pushq %rax
leaq 0x1d8(%rsp), %rax
pushq %rax
leaq 0x180(%rsp), %rax
pushq %rax
leaq 0x158(%rsp), %rax
pushq %rax
pushq %r15
pushq %r12
pushq %r11
pushq %r14
callq 0x1bae2
addq $0x50, %rsp
testq %r12, %r12
setle %al
orb %bpl, %al
jne 0x1ade6
leaq -0x1(%r12), %r14
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movsd (%rax,%rbx,8), %xmm0
xorpd %xmm1, %xmm1
callq 0x262ba
testb %al, %al
je 0x1ba96
leaq 0x1(%rbx), %rax
cmpq %r12, %rbx
jge 0x1bac5
movq %rbx, %rcx
movq 0x38(%r13), %rdx
movq 0x8(%rdx,%rcx,8), %rdx
movq $0x0, (%rdx,%rbx,8)
incq %rcx
cmpq %rcx, %r12
jne 0x1ba7b
jmp 0x1bac5
leaq 0x2(%rbx), %rax
cmpq %r12, %rax
jg 0x1bac5
movq %rbx, %rcx
movq 0x38(%r13), %rdx
movq 0x10(%rdx,%rcx,8), %rdx
movq %r15, (%rdx,%rbx,8)
movq 0x38(%r13), %rdx
movq 0x10(%rdx,%rcx,8), %rdx
movq %r15, 0x8(%rdx,%rbx,8)
incq %rcx
cmpq %rcx, %r14
jne 0x1baa2
movq %rax, %rbx
cmpq %r12, %rax
jle 0x1ba54
jmp 0x1ade6
movq 0x2e8(%rsp), %rax
movq %r12, (%rax)
jmp 0x1ade6