// File: /workspace/github_c_makefile_star2_O0/debbiemarkslab[P]plmc/src/lib/lbfgs.c
// Function: lbfgs
int lbfgs(
    int n,
    lbfgsfloatval_t *x,
    lbfgsfloatval_t *ptr_fx,
    lbfgs_evaluate_t proc_evaluate,
    lbfgs_progress_t proc_progress,
    void *instance,
    lbfgs_parameter_t *_param
    )
{
    int ret;
    int i, j, k, ls, end, bound;
    lbfgsfloatval_t step;

    /* Constant parameters and their default values. */
    lbfgs_parameter_t param = (_param != NULL) ? (*_param) : _defparam;
    const int m = param.m;

    lbfgsfloatval_t *xp = NULL;
    lbfgsfloatval_t *g = NULL, *gp = NULL, *pg = NULL;
    lbfgsfloatval_t *d = NULL, *w = NULL, *pf = NULL;
    iteration_data_t *lm = NULL, *it = NULL;
    lbfgsfloatval_t ys, yy;
    lbfgsfloatval_t xnorm, gnorm, beta;
    lbfgsfloatval_t fx = 0.;
    lbfgsfloatval_t rate = 0.;
    line_search_proc linesearch = line_search_morethuente;

    /* Construct a callback data. */
    callback_data_t cd;
    cd.n = n;
    cd.instance = instance;
    cd.proc_evaluate = proc_evaluate;
    cd.proc_progress = proc_progress;

#if     defined(USE_SSE) && (defined(__SSE__) || defined(__SSE2__))
    /* Round out the number of variables. */
    n = round_out_variables(n);
#endif/*defined(USE_SSE)*/

    /* Check the input parameters for errors. */
    if (n <= 0) {
        return LBFGSERR_INVALID_N;
    }
#if     defined(USE_SSE) && (defined(__SSE__) || defined(__SSE2__))
    if (n % 8 != 0) {
        return LBFGSERR_INVALID_N_SSE;
    }
    if ((uintptr_t)(const void*)x % 16 != 0) {
        return LBFGSERR_INVALID_X_SSE;
    }
#endif/*defined(USE_SSE)*/
    if (param.epsilon < 0.) {
        return LBFGSERR_INVALID_EPSILON;
    }
    if (param.past < 0) {
        return LBFGSERR_INVALID_TESTPERIOD;
    }
    if (param.delta < 0.) {
        return LBFGSERR_INVALID_DELTA;
    }
    if (param.min_step < 0.) {
        return LBFGSERR_INVALID_MINSTEP;
    }
    if (param.max_step < param.min_step) {
        return LBFGSERR_INVALID_MAXSTEP;
    }
    if (param.ftol < 0.) {
        return LBFGSERR_INVALID_FTOL;
    }
    if (param.linesearch == LBFGS_LINESEARCH_BACKTRACKING_WOLFE ||
        param.linesearch == LBFGS_LINESEARCH_BACKTRACKING_STRONG_WOLFE) {
        if (param.wolfe <= param.ftol || 1. <= param.wolfe) {
            return LBFGSERR_INVALID_WOLFE;
        }
    }
    if (param.gtol < 0.) {
        return LBFGSERR_INVALID_GTOL;
    }
    if (param.xtol < 0.) {
        return LBFGSERR_INVALID_XTOL;
    }
    if (param.max_linesearch <= 0) {
        return LBFGSERR_INVALID_MAXLINESEARCH;
    }
    if (param.orthantwise_c < 0.) {
        return LBFGSERR_INVALID_ORTHANTWISE;
    }
    if (param.orthantwise_start < 0 || n < param.orthantwise_start) {
        return LBFGSERR_INVALID_ORTHANTWISE_START;
    }
    if (param.orthantwise_end < 0) {
        param.orthantwise_end = n;
    }
    if (n < param.orthantwise_end) {
        return LBFGSERR_INVALID_ORTHANTWISE_END;
    }
    if (param.orthantwise_c != 0.) {
        switch (param.linesearch) {
        case LBFGS_LINESEARCH_BACKTRACKING:
            linesearch = line_search_backtracking_owlqn;
            break;
        default:
            /* Only the backtracking method is available. */
            return LBFGSERR_INVALID_LINESEARCH;
        }
    } else {
        switch (param.linesearch) {
        case LBFGS_LINESEARCH_MORETHUENTE:
            linesearch = line_search_morethuente;
            break;
        case LBFGS_LINESEARCH_BACKTRACKING_ARMIJO:
        case LBFGS_LINESEARCH_BACKTRACKING_WOLFE:
        case LBFGS_LINESEARCH_BACKTRACKING_STRONG_WOLFE:
            linesearch = line_search_backtracking;
            break;
        default:
            return LBFGSERR_INVALID_LINESEARCH;
        }
    }

    /* Allocate working space. */
    xp = (lbfgsfloatval_t*)vecalloc(n * sizeof(lbfgsfloatval_t));
    g = (lbfgsfloatval_t*)vecalloc(n * sizeof(lbfgsfloatval_t));
    gp = (lbfgsfloatval_t*)vecalloc(n * sizeof(lbfgsfloatval_t));
    d = (lbfgsfloatval_t*)vecalloc(n * sizeof(lbfgsfloatval_t));
    w = (lbfgsfloatval_t*)vecalloc(n * sizeof(lbfgsfloatval_t));
    if (xp == NULL || g == NULL || gp == NULL || d == NULL || w == NULL) {
        ret = LBFGSERR_OUTOFMEMORY;
        goto lbfgs_exit;
    }

    if (param.orthantwise_c != 0.) {
        /* Allocate working space for OW-LQN. */
        pg = (lbfgsfloatval_t*)vecalloc(n * sizeof(lbfgsfloatval_t));
        if (pg == NULL) {
            ret = LBFGSERR_OUTOFMEMORY;
            goto lbfgs_exit;
        }
    }

    /* Allocate limited memory storage. */
    lm = (iteration_data_t*)vecalloc(m * sizeof(iteration_data_t));
    if (lm == NULL) {
        ret = LBFGSERR_OUTOFMEMORY;
        goto lbfgs_exit;
    }

    /* Initialize the limited memory. */
    for (i = 0;i < m;++i) {
        it = &lm[i];
        it->alpha = 0;
        it->ys = 0;
        it->s = (lbfgsfloatval_t*)vecalloc(n * sizeof(lbfgsfloatval_t));
        it->y = (lbfgsfloatval_t*)vecalloc(n * sizeof(lbfgsfloatval_t));
        if (it->s == NULL || it->y == NULL) {
            ret = LBFGSERR_OUTOFMEMORY;
            goto lbfgs_exit;
        }
    }

    /* Allocate an array for storing previous values of the objective function. */
    if (0 < param.past) {
        pf = (lbfgsfloatval_t*)vecalloc(param.past * sizeof(lbfgsfloatval_t));
    }

    /* Evaluate the function value and its gradient. */
    fx = cd.proc_evaluate(cd.instance, x, g, cd.n, 0);
    if (0. != param.orthantwise_c) {
        /* Compute the L1 norm of the variable and add it to the object value. */
        xnorm = owlqn_x1norm(x, param.orthantwise_start, param.orthantwise_end);
        fx += xnorm * param.orthantwise_c;
        owlqn_pseudo_gradient(
            pg, x, g, n,
            param.orthantwise_c, param.orthantwise_start, param.orthantwise_end
            );
    }

    /* Store the initial value of the objective function. */
    if (pf != NULL) {
        pf[0] = fx;
    }

    /*
        Compute the direction;
        we assume the initial hessian matrix H_0 as the identity matrix.
     */
    if (param.orthantwise_c == 0.) {
        vecncpy(d, g, n);
    } else {
        vecncpy(d, pg, n);
    }

    /*
       Make sure that the initial variables are not a minimizer.
     */
    vec2norm(&xnorm, x, n);
    if (param.orthantwise_c == 0.) {
        vec2norm(&gnorm, g, n);
    } else {
        vec2norm(&gnorm, pg, n);
    }
    if (xnorm < 1.0) xnorm = 1.0;
    if (gnorm / xnorm <= param.epsilon) {
        ret = LBFGS_ALREADY_MINIMIZED;
        goto lbfgs_exit;
    }

    /* Compute the initial step:
        step = 1.0 / sqrt(vecdot(d, d, n))
     */
    vec2norminv(&step, d, n);

    k = 1;
    end = 0;
    for (;;) {
        /* Store the current position and gradient vectors. */
        veccpy(xp, x, n);
        veccpy(gp, g, n);

        /* Search for an optimal step. */
        if (param.orthantwise_c == 0.) {
            ls = linesearch(n, x, &fx, g, d, &step, xp, gp, w, &cd, &param);
        } else {
            ls = linesearch(n, x, &fx, g, d, &step, xp, pg, w, &cd, &param);
            owlqn_pseudo_gradient(
                pg, x, g, n,
                param.orthantwise_c, param.orthantwise_start, param.orthantwise_end
                );
        }
        if (ls < 0) {
            /* Revert to the previous point. */
            veccpy(x, xp, n);
            veccpy(g, gp, n);
            ret = ls;
            goto lbfgs_exit;
        }

        /* Compute x and g norms. */
        vec2norm(&xnorm, x, n);
        if (param.orthantwise_c == 0.) {
            vec2norm(&gnorm, g, n);
        } else {
            vec2norm(&gnorm, pg, n);
        }

        /* Report the progress. */
        if (cd.proc_progress) {
            if ((ret = cd.proc_progress(cd.instance, x, g, fx, xnorm, gnorm, step, cd.n, k, ls))) {
                goto lbfgs_exit;
            }
        }

        /*
            Convergence test.
            The criterion is given by the following formula:
                |g(x)| / \max(1, |x|) < \epsilon
         */
        if (xnorm < 1.0) xnorm = 1.0;
        if (gnorm / xnorm <= param.epsilon) {
            /* Convergence. */
            ret = LBFGS_SUCCESS;
            break;
        }

        /*
            Test for stopping criterion.
            The criterion is given by the following formula:
                (f(past_x) - f(x)) / f(x) < \delta
         */
        if (pf != NULL) {
            /* We don't test the stopping criterion while k < past. */
            if (param.past <= k) {
                /* Compute the relative improvement from the past. */
                rate = (pf[k % param.past] - fx) / fx;

                /* The stopping criterion. */
                if (rate < param.delta) {
                    ret = LBFGS_STOP;
                    break;
                }
            }

            /* Store the current value of the objective function. */
            pf[k % param.past] = fx;
        }

        if (param.max_iterations != 0 && param.max_iterations < k+1) {
            /* Maximum number of iterations. */
            ret = LBFGSERR_MAXIMUMITERATION;
            break;
        }

        /*
            Update vectors s and y:
                s_{k+1} = x_{k+1} - x_{k} = \step * d_{k}.
                y_{k+1} = g_{k+1} - g_{k}.
         */
        it = &lm[end];
        vecdiff(it->s, x, xp, n);
        vecdiff(it->y, g, gp, n);

        /*
            Compute scalars ys and yy:
                ys = y^t \cdot s = 1 / \rho.
                yy = y^t \cdot y.
            Notice that yy is used for scaling the hessian matrix H_0 (Cholesky factor).
         */
        vecdot(&ys, it->y, it->s, n);
        vecdot(&yy, it->y, it->y, n);
        it->ys = ys;

        /*
            Recursive formula to compute dir = -(H \cdot g).
                This is described in page 779 of:
                Jorge Nocedal.
                Updating Quasi-Newton Matrices with Limited Storage.
                Mathematics of Computation, Vol. 35, No. 151,
                pp. 773--782, 1980.
         */
        bound = (m <= k) ? m : k;
        ++k;
        end = (end + 1) % m;

        /* Compute the steepest direction. */
        if (param.orthantwise_c == 0.) {
            /* Compute the negative of gradients. */
            vecncpy(d, g, n);
        } else {
            vecncpy(d, pg, n);
        }

        j = end;
        for (i = 0;i < bound;++i) {
            j = (j + m - 1) % m;    /* if (--j == -1) j = m-1; */
            it = &lm[j];
            /* \alpha_{j} = \rho_{j} s^{t}_{j} \cdot q_{k+1}. */
            vecdot(&it->alpha, it->s, d, n);
            it->alpha /= it->ys;
            /* q_{i} = q_{i+1} - \alpha_{i} y_{i}. */
            vecadd(d, it->y, -it->alpha, n);
        }

        vecscale(d, ys / yy, n);

        for (i = 0;i < bound;++i) {
            it = &lm[j];
            /* \beta_{j} = \rho_{j} y^t_{j} \cdot \gamma_{i}. */
            vecdot(&beta, it->y, d, n);
            beta /= it->ys;
            /* \gamma_{i+1} = \gamma_{i} + (\alpha_{j} - \beta_{j}) s_{j}. */
            vecadd(d, it->s, it->alpha - beta, n);
            j = (j + 1) % m;        /* if (++j == m) j = 0; */
        }

        /*
            Constrain the search direction for orthant-wise updates.
         */
        if (param.orthantwise_c != 0.) {
            for (i = param.orthantwise_start;i < param.orthantwise_end;++i) {
                if (d[i] * pg[i] >= 0) {
                    d[i] = 0;
                }
            }
        }

        /*
            Now the search direction d is ready. We try step = 1 first.
         */
        step = 1.0;
    }

lbfgs_exit:
    /* Return the final value of the objective function. */
    if (ptr_fx != NULL) {
        *ptr_fx = fx;
    }

    vecfree(pf);

    /* Free memory blocks used by this function. */
    if (lm != NULL) {
        for (i = 0;i < m;++i) {
            vecfree(lm[i].s);
            vecfree(lm[i].y);
        }
        vecfree(lm);
    }
    vecfree(pg);
    vecfree(w);
    vecfree(d);
    vecfree(gp);
    vecfree(g);
    vecfree(xp);

    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1c0, %rsp            # imm = 0x1C0
movq 0x1e0(%rsp), %rax
movl %edi, 0x1b8(%rsp)
movq %rsi, 0x1b0(%rsp)
movq %rdx, 0x1a8(%rsp)
movq %rcx, 0x1a0(%rsp)
movq %r8, 0x198(%rsp)
movq %r9, 0x190(%rsp)
cmpq $0x0, 0x1e0(%rsp)
je 0x1b2a
movq 0x1e0(%rsp), %rsi
leaq 0xf8(%rsp), %rdi
movl $0x70, %edx
callq 0x1160
jmp 0x1b43
leaq 0xf8(%rsp), %rdi
leaq 0x17557(%rip), %rsi     # 0x19090
movl $0x70, %edx
callq 0x1160
movl 0xf8(%rsp), %eax
movl %eax, 0xf4(%rsp)
movq $0x0, 0xe8(%rsp)
movq $0x0, 0xe0(%rsp)
movq $0x0, 0xd8(%rsp)
movq $0x0, 0xd0(%rsp)
movq $0x0, 0xc8(%rsp)
movq $0x0, 0xc0(%rsp)
movq $0x0, 0xb8(%rsp)
movq $0x0, 0xb0(%rsp)
movq $0x0, 0xa8(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x78(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x70(%rsp)
leaq 0x108a(%rip), %rax      # 0x2c60
movq %rax, 0x68(%rsp)
movl 0x1b8(%rsp), %eax
movl %eax, 0x48(%rsp)
movq 0x190(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x1a0(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x198(%rsp), %rax
movq %rax, 0x60(%rsp)
cmpl $0x0, 0x1b8(%rsp)
jg 0x1c27
movl $0xfffffc04, 0x1bc(%rsp) # imm = 0xFFFFFC04
jmp 0x2c49
xorps %xmm0, %xmm0
ucomisd 0x100(%rsp), %xmm0
jbe 0x1c45
movl $0xfffffc07, 0x1bc(%rsp) # imm = 0xFFFFFC07
jmp 0x2c49
cmpl $0x0, 0x108(%rsp)
jge 0x1c5f
movl $0xfffffc08, 0x1bc(%rsp) # imm = 0xFFFFFC08
jmp 0x2c49
xorps %xmm0, %xmm0
ucomisd 0x110(%rsp), %xmm0
jbe 0x1c7d
movl $0xfffffc09, 0x1bc(%rsp) # imm = 0xFFFFFC09
jmp 0x2c49
xorps %xmm0, %xmm0
ucomisd 0x128(%rsp), %xmm0
jbe 0x1c9b
movl $0xfffffc0b, 0x1bc(%rsp) # imm = 0xFFFFFC0B
jmp 0x2c49
movsd 0x130(%rsp), %xmm1
movsd 0x128(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1cc3
movl $0xfffffc0c, 0x1bc(%rsp) # imm = 0xFFFFFC0C
jmp 0x2c49
xorps %xmm0, %xmm0
ucomisd 0x138(%rsp), %xmm0
jbe 0x1ce1
movl $0xfffffc0d, 0x1bc(%rsp) # imm = 0xFFFFFC0D
jmp 0x2c49
cmpl $0x2, 0x11c(%rsp)
je 0x1cf5
cmpl $0x3, 0x11c(%rsp)
jne 0x1d36
movsd 0x140(%rsp), %xmm1
movsd 0x138(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jae 0x1d24
movsd 0x140(%rsp), %xmm0
movsd 0x17332(%rip), %xmm1    # 0x19050
ucomisd %xmm1, %xmm0
jb 0x1d34
movl $0xfffffc0e, 0x1bc(%rsp) # imm = 0xFFFFFC0E
jmp 0x2c49
jmp 0x1d36
xorps %xmm0, %xmm0
ucomisd 0x148(%rsp), %xmm0
jbe 0x1d54
movl $0xfffffc0f, 0x1bc(%rsp) # imm = 0xFFFFFC0F
jmp 0x2c49
xorps %xmm0, %xmm0
ucomisd 0x150(%rsp), %xmm0
jbe 0x1d72
movl $0xfffffc10, 0x1bc(%rsp) # imm = 0xFFFFFC10
jmp 0x2c49
cmpl $0x0, 0x120(%rsp)
jg 0x1d8c
movl $0xfffffc11, 0x1bc(%rsp) # imm = 0xFFFFFC11
jmp 0x2c49
xorps %xmm0, %xmm0
ucomisd 0x158(%rsp), %xmm0
jbe 0x1daa
movl $0xfffffc12, 0x1bc(%rsp) # imm = 0xFFFFFC12
jmp 0x2c49
cmpl $0x0, 0x160(%rsp)
jl 0x1dc4
movl 0x1b8(%rsp), %eax
cmpl 0x160(%rsp), %eax
jge 0x1dd4
movl $0xfffffc13, 0x1bc(%rsp) # imm = 0xFFFFFC13
jmp 0x2c49
cmpl $0x0, 0x164(%rsp)
jge 0x1dec
movl 0x1b8(%rsp), %eax
movl %eax, 0x164(%rsp)
movl 0x1b8(%rsp), %eax
cmpl 0x164(%rsp), %eax
jge 0x1e0c
movl $0xfffffc14, 0x1bc(%rsp) # imm = 0xFFFFFC14
jmp 0x2c49
movsd 0x158(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1e22
jp 0x1e22
jmp 0x1e50
movl 0x11c(%rsp), %eax
subl $0x2, %eax
jne 0x1e3e
jmp 0x1e30
leaq 0x1899(%rip), %rax      # 0x36d0
movq %rax, 0x68(%rsp)
jmp 0x1e4e
movl $0xfffffc0a, 0x1bc(%rsp) # imm = 0xFFFFFC0A
jmp 0x2c49
jmp 0x1e9c
movl 0x11c(%rsp), %eax
movl %eax, 0x44(%rsp)
testl %eax, %eax
je 0x1e6e
jmp 0x1e61
movl 0x44(%rsp), %eax
decl %eax
subl $0x3, %eax
jb 0x1e7c
jmp 0x1e8a
leaq 0xdeb(%rip), %rax       # 0x2c60
movq %rax, 0x68(%rsp)
jmp 0x1e9a
leaq 0x1b9d(%rip), %rax      # 0x3a20
movq %rax, 0x68(%rsp)
jmp 0x1e9a
movl $0xfffffc0a, 0x1bc(%rsp) # imm = 0xFFFFFC0A
jmp 0x2c49
jmp 0x1e9c
movslq 0x1b8(%rsp), %rdi
shlq $0x3, %rdi
callq 0x1a40
movq %rax, 0xe8(%rsp)
movslq 0x1b8(%rsp), %rdi
shlq $0x3, %rdi
callq 0x1a40
movq %rax, 0xe0(%rsp)
movslq 0x1b8(%rsp), %rdi
shlq $0x3, %rdi
callq 0x1a40
movq %rax, 0xd8(%rsp)
movslq 0x1b8(%rsp), %rdi
shlq $0x3, %rdi
callq 0x1a40
movq %rax, 0xc8(%rsp)
movslq 0x1b8(%rsp), %rdi
shlq $0x3, %rdi
callq 0x1a40
movq %rax, 0xc0(%rsp)
cmpq $0x0, 0xe8(%rsp)
je 0x1f50
cmpq $0x0, 0xe0(%rsp)
je 0x1f50
cmpq $0x0, 0xd8(%rsp)
je 0x1f50
cmpq $0x0, 0xc8(%rsp)
je 0x1f50
cmpq $0x0, 0xc0(%rsp)
jne 0x1f60
movl $0xfffffc02, 0x18c(%rsp) # imm = 0xFFFFFC02
jmp 0x2b3d
movsd 0x158(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1f76
jp 0x1f76
jmp 0x1fac
movslq 0x1b8(%rsp), %rdi
shlq $0x3, %rdi
callq 0x1a40
movq %rax, 0xd0(%rsp)
cmpq $0x0, 0xd0(%rsp)
jne 0x1faa
movl $0xfffffc02, 0x18c(%rsp) # imm = 0xFFFFFC02
jmp 0x2b3d
jmp 0x1fac
movslq 0xf4(%rsp), %rdi
shlq $0x5, %rdi
callq 0x1a40
movq %rax, 0xb0(%rsp)
cmpq $0x0, 0xb0(%rsp)
jne 0x1fe0
movl $0xfffffc02, 0x18c(%rsp) # imm = 0xFFFFFC02
jmp 0x2b3d
movl $0x0, 0x188(%rsp)
movl 0x188(%rsp), %eax
cmpl 0xf4(%rsp), %eax
jge 0x20c3
movq 0xb0(%rsp), %rax
movslq 0x188(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movq 0xa8(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rax)
movslq 0x1b8(%rsp), %rdi
shlq $0x3, %rdi
callq 0x1a40
movq %rax, %rcx
movq 0xa8(%rsp), %rax
movq %rcx, 0x8(%rax)
movslq 0x1b8(%rsp), %rdi
shlq $0x3, %rdi
callq 0x1a40
movq %rax, %rcx
movq 0xa8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0xa8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x209b
movq 0xa8(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x20ab
movl $0xfffffc02, 0x18c(%rsp) # imm = 0xFFFFFC02
jmp 0x2b3d
jmp 0x20ad
movl 0x188(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x188(%rsp)
jmp 0x1feb
xorl %eax, %eax
cmpl 0x108(%rsp), %eax
jge 0x20e7
movslq 0x108(%rsp), %rdi
shlq $0x3, %rdi
callq 0x1a40
movq %rax, 0xb8(%rsp)
movq 0x58(%rsp), %rax
movq 0x50(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movl 0x48(%rsp), %ecx
xorps %xmm0, %xmm0
callq *%rax
movsd %xmm0, 0x78(%rsp)
xorps %xmm0, %xmm0
ucomisd 0x158(%rsp), %xmm0
jne 0x2125
jp 0x2125
jmp 0x21ac
movq 0x1b0(%rsp), %rdi
movl 0x160(%rsp), %esi
movl 0x164(%rsp), %edx
callq 0x3d20
movsd %xmm0, 0x90(%rsp)
movsd 0x90(%rsp), %xmm0
movsd 0x158(%rsp), %xmm2
movsd 0x78(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x78(%rsp)
movq 0xd0(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movl 0x1b8(%rsp), %ecx
movsd 0x158(%rsp), %xmm0
movl 0x160(%rsp), %r8d
movl 0x164(%rsp), %r9d
callq 0x3d90
cmpq $0x0, 0xb8(%rsp)
je 0x21c9
movsd 0x78(%rsp), %xmm0
movq 0xb8(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0x158(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x21fb
jp 0x21fb
movq 0xc8(%rsp), %rdi
movq 0xe0(%rsp), %rsi
movl 0x1b8(%rsp), %edx
callq 0x3f90
jmp 0x2217
movq 0xc8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movl 0x1b8(%rsp), %edx
callq 0x3f90
movq 0x1b0(%rsp), %rsi
movl 0x1b8(%rsp), %edx
leaq 0x90(%rsp), %rdi
callq 0x4000
movsd 0x158(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2265
jp 0x2265
movq 0xe0(%rsp), %rsi
movl 0x1b8(%rsp), %edx
leaq 0x88(%rsp), %rdi
callq 0x4000
jmp 0x2281
movq 0xd0(%rsp), %rsi
movl 0x1b8(%rsp), %edx
leaq 0x88(%rsp), %rdi
callq 0x4000
movsd 0x16dc7(%rip), %xmm0    # 0x19050
ucomisd 0x90(%rsp), %xmm0
jbe 0x22a5
movsd 0x16db4(%rip), %xmm0    # 0x19050
movsd %xmm0, 0x90(%rsp)
movsd 0x88(%rsp), %xmm1
divsd 0x90(%rsp), %xmm1
movsd 0x100(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x22d6
movl $0x2, 0x18c(%rsp)
jmp 0x2b3d
movq 0xc8(%rsp), %rsi
movl 0x1b8(%rsp), %edx
leaq 0x168(%rsp), %rdi
callq 0x4050
movl $0x1, 0x180(%rsp)
movl $0x0, 0x178(%rsp)
movq 0xe8(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
movl 0x1b8(%rsp), %edx
callq 0x40a0
movq 0xd8(%rsp), %rdi
movq 0xe0(%rsp), %rsi
movl 0x1b8(%rsp), %edx
callq 0x40a0
movsd 0x158(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x23d0
jp 0x23d0
movq 0x68(%rsp), %rax
movl 0x1b8(%rsp), %edi
movq 0x1b0(%rsp), %rsi
movq 0xe0(%rsp), %rcx
movq 0xc8(%rsp), %r8
movq 0xe8(%rsp), %r15
movq 0xd8(%rsp), %r14
movq 0xc0(%rsp), %rbx
leaq 0x78(%rsp), %rdx
leaq 0x168(%rsp), %r9
leaq 0x48(%rsp), %r11
leaq 0xf8(%rsp), %r10
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
callq *%rax
movl %eax, 0x17c(%rsp)
jmp 0x2484
movq 0x68(%rsp), %rax
movl 0x1b8(%rsp), %edi
movq 0x1b0(%rsp), %rsi
movq 0xe0(%rsp), %rcx
movq 0xc8(%rsp), %r8
movq 0xe8(%rsp), %r15
movq 0xd0(%rsp), %r14
movq 0xc0(%rsp), %rbx
leaq 0x78(%rsp), %rdx
leaq 0x168(%rsp), %r9
leaq 0x48(%rsp), %r11
leaq 0xf8(%rsp), %r10
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
callq *%rax
movl %eax, 0x17c(%rsp)
movq 0xd0(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movl 0x1b8(%rsp), %ecx
movsd 0x158(%rsp), %xmm0
movl 0x160(%rsp), %r8d
movl 0x164(%rsp), %r9d
callq 0x3d90
cmpl $0x0, 0x17c(%rsp)
jge 0x24d9
movq 0x1b0(%rsp), %rdi
movq 0xe8(%rsp), %rsi
movl 0x1b8(%rsp), %edx
callq 0x40a0
movq 0xe0(%rsp), %rdi
movq 0xd8(%rsp), %rsi
movl 0x1b8(%rsp), %edx
callq 0x40a0
movl 0x17c(%rsp), %eax
movl %eax, 0x18c(%rsp)
jmp 0x2b3d
movq 0x1b0(%rsp), %rsi
movl 0x1b8(%rsp), %edx
leaq 0x90(%rsp), %rdi
callq 0x4000
movsd 0x158(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2527
jp 0x2527
movq 0xe0(%rsp), %rsi
movl 0x1b8(%rsp), %edx
leaq 0x88(%rsp), %rdi
callq 0x4000
jmp 0x2543
movq 0xd0(%rsp), %rsi
movl 0x1b8(%rsp), %edx
leaq 0x88(%rsp), %rdi
callq 0x4000
cmpq $0x0, 0x60(%rsp)
je 0x25af
movq 0x60(%rsp), %rax
movq 0x50(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movsd 0x78(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
movsd 0x88(%rsp), %xmm2
movsd 0x168(%rsp), %xmm3
movl 0x48(%rsp), %ecx
movl 0x180(%rsp), %r8d
movl 0x17c(%rsp), %r9d
callq *%rax
movl %eax, 0x18c(%rsp)
cmpl $0x0, %eax
je 0x25ad
jmp 0x2b3d
jmp 0x25af
movsd 0x16a99(%rip), %xmm0    # 0x19050
ucomisd 0x90(%rsp), %xmm0
jbe 0x25d3
movsd 0x16a86(%rip), %xmm0    # 0x19050
movsd %xmm0, 0x90(%rsp)
movsd 0x88(%rsp), %xmm1
divsd 0x90(%rsp), %xmm1
movsd 0x100(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x2604
movl $0x0, 0x18c(%rsp)
jmp 0x2b3b
cmpq $0x0, 0xb8(%rsp)
je 0x26b4
movl 0x108(%rsp), %eax
cmpl 0x180(%rsp), %eax
jg 0x2685
movq 0xb8(%rsp), %rax
movq %rax, 0x38(%rsp)
movl 0x180(%rsp), %eax
cltd
idivl 0x108(%rsp)
movq 0x38(%rsp), %rax
movslq %edx, %rcx
movsd (%rax,%rcx,8), %xmm0
subsd 0x78(%rsp), %xmm0
divsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
movsd 0x70(%rsp), %xmm1
movsd 0x110(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2683
movl $0x1, 0x18c(%rsp)
jmp 0x2b3b
jmp 0x2685
movsd 0x78(%rsp), %xmm0
movq 0xb8(%rsp), %rax
movq %rax, 0x30(%rsp)
movl 0x180(%rsp), %eax
cltd
idivl 0x108(%rsp)
movq 0x30(%rsp), %rax
movslq %edx, %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpl $0x0, 0x118(%rsp)
je 0x26e3
movl 0x118(%rsp), %eax
movl 0x180(%rsp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x26e3
movl $0xfffffc1b, 0x18c(%rsp) # imm = 0xFFFFFC1B
jmp 0x2b3b
movq 0xb0(%rsp), %rax
movslq 0x178(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x1b0(%rsp), %rsi
movq 0xe8(%rsp), %rdx
movl 0x1b8(%rsp), %ecx
callq 0x40f0
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0xe0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
movl 0x1b8(%rsp), %ecx
callq 0x40f0
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rdx
movl 0x1b8(%rsp), %ecx
leaq 0xa0(%rsp), %rdi
callq 0x4150
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rdx
movl 0x1b8(%rsp), %ecx
leaq 0x98(%rsp), %rdi
callq 0x4150
movsd 0xa0(%rsp), %xmm0
movq 0xa8(%rsp), %rax
movsd %xmm0, 0x18(%rax)
movl 0xf4(%rsp), %eax
cmpl 0x180(%rsp), %eax
jg 0x27dd
movl 0xf4(%rsp), %eax
movl %eax, 0x2c(%rsp)
jmp 0x27e8
movl 0x180(%rsp), %eax
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0x174(%rsp)
movl 0x180(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x180(%rsp)
movl 0x178(%rsp), %eax
addl $0x1, %eax
cltd
idivl 0xf4(%rsp)
movl %edx, 0x178(%rsp)
movsd 0x158(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x284f
jp 0x284f
movq 0xc8(%rsp), %rdi
movq 0xe0(%rsp), %rsi
movl 0x1b8(%rsp), %edx
callq 0x3f90
jmp 0x286b
movq 0xc8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movl 0x1b8(%rsp), %edx
callq 0x3f90
movl 0x178(%rsp), %eax
movl %eax, 0x184(%rsp)
movl $0x0, 0x188(%rsp)
movl 0x188(%rsp), %eax
cmpl 0x174(%rsp), %eax
jge 0x2979
movl 0x184(%rsp), %eax
addl 0xf4(%rsp), %eax
subl $0x1, %eax
cltd
idivl 0xf4(%rsp)
movl %edx, 0x184(%rsp)
movq 0xb0(%rsp), %rax
movslq 0x184(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rdi
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0xc8(%rsp), %rdx
movl 0x1b8(%rsp), %ecx
callq 0x4150
movq 0xa8(%rsp), %rax
movsd 0x18(%rax), %xmm1
movq 0xa8(%rsp), %rax
movsd (%rax), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movq 0xc8(%rsp), %rdi
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0xa8(%rsp), %rax
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movl 0x1b8(%rsp), %edx
callq 0x41d0
movl 0x188(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x188(%rsp)
jmp 0x2884
movq 0xc8(%rsp), %rdi
movsd 0xa0(%rsp), %xmm0
divsd 0x98(%rsp), %xmm0
movl 0x1b8(%rsp), %esi
callq 0x4240
movl $0x0, 0x188(%rsp)
movl 0x188(%rsp), %eax
cmpl 0x174(%rsp), %eax
jge 0x2a8c
movq 0xb0(%rsp), %rax
movslq 0x184(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0xc8(%rsp), %rdx
movl 0x1b8(%rsp), %ecx
leaq 0x80(%rsp), %rdi
callq 0x4150
movq 0xa8(%rsp), %rax
movsd 0x18(%rax), %xmm1
movsd 0x80(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x80(%rsp)
movq 0xc8(%rsp), %rdi
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0xa8(%rsp), %rax
movsd (%rax), %xmm0
subsd 0x80(%rsp), %xmm0
movl 0x1b8(%rsp), %edx
callq 0x41d0
movl 0x184(%rsp), %eax
addl $0x1, %eax
cltd
idivl 0xf4(%rsp)
movl %edx, 0x184(%rsp)
movl 0x188(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x188(%rsp)
jmp 0x29aa
movsd 0x158(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2aa5
jp 0x2aa5
jmp 0x2b25
movl 0x160(%rsp), %eax
movl %eax, 0x188(%rsp)
movl 0x188(%rsp), %eax
cmpl 0x164(%rsp), %eax
jge 0x2b23
movq 0xc8(%rsp), %rax
movslq 0x188(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0xd0(%rsp), %rax
movslq 0x188(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x2b0e
movq 0xc8(%rsp), %rax
movslq 0x188(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x2b10
movl 0x188(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x188(%rsp)
jmp 0x2ab3
jmp 0x2b25
movsd 0x16523(%rip), %xmm0    # 0x19050
movsd %xmm0, 0x168(%rsp)
jmp 0x2308
jmp 0x2b3d
cmpq $0x0, 0x1a8(%rsp)
je 0x2b5a
movsd 0x78(%rsp), %xmm0
movq 0x1a8(%rsp), %rax
movsd %xmm0, (%rax)
movq 0xb8(%rsp), %rdi
callq 0x1a90
cmpq $0x0, 0xb0(%rsp)
je 0x2bed
movl $0x0, 0x188(%rsp)
movl 0x188(%rsp), %eax
cmpl 0xf4(%rsp), %eax
jge 0x2be0
movq 0xb0(%rsp), %rax
movslq 0x188(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x1a90
movq 0xb0(%rsp), %rax
movslq 0x188(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
callq 0x1a90
movl 0x188(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x188(%rsp)
jmp 0x2b7d
movq 0xb0(%rsp), %rdi
callq 0x1a90
movq 0xd0(%rsp), %rdi
callq 0x1a90
movq 0xc0(%rsp), %rdi
callq 0x1a90
movq 0xc8(%rsp), %rdi
callq 0x1a90
movq 0xd8(%rsp), %rdi
callq 0x1a90
movq 0xe0(%rsp), %rdi
callq 0x1a90
movq 0xe8(%rsp), %rdi
callq 0x1a90
movl 0x18c(%rsp), %eax
movl %eax, 0x1bc(%rsp)
movl 0x1bc(%rsp), %eax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)