// File: pitzl[P]bobyqa/bobyqa.cc
// Function: prelim(long, long, double (*)(long, double const*, void*), void*, double*, double const*, double const*, double, long, long, double*, double*, double*, double*, double*, double*, double*, double*, long, double*, double*, long*, long*)
static void
prelim(const INTEGER n, const INTEGER npt,
       bobyqa_objfun* objfun, void* data,
       REAL* x, const REAL* xl, const REAL* xu,
       const REAL rhobeg, const INTEGER iprint,
       const INTEGER maxfun, REAL* xbase, REAL* xpt, REAL* fval,
       REAL* gopt, REAL* hq, REAL* pq, REAL* bmat,
       REAL* zmat, const INTEGER ndim, REAL* sl, REAL* su,
       INTEGER* nf, INTEGER* kopt)
{
  /* The arguments N, NPT, X, XL, XU, RHOBEG, IPRINT and MAXFUN are the same as
     the corresponding arguments in SUBROUTINE BOBYQA.  The arguments XBASE,
     XPT, FVAL, HQ, PQ, BMAT, ZMAT, NDIM, SL and SU are the same as the
     corresponding arguments in BOBYQB, the elements of SL and SU being set in
     BOBYQA.

     GOPT is usually the gradient of the quadratic model at XOPT+XBASE, but it
     is set by PRELIM to the gradient of the quadratic model at XBASE.

     If XOPT is nonzero, BOBYQB will change it to its usual value later.

     NF is maintaned as the number of calls of OBJFUN so far.

     KOPT will be such that the least calculated value of F so far is at the
     point XPT(KOPT,.)+XBASE in the space of the variables.

     SUBROUTINE PRELIM sets the elements of XBASE, XPT, FVAL, GOPT, HQ, PQ,
     BMAT and ZMAT for the first iteration, and it maintains the values of NF
     and KOPT.  The vector X is also changed by PRELIM. */

  /* Constants. */
  const REAL half = 0.5;
  const REAL one = 1.0;
  const REAL two = 2.0;
  const REAL zero = 0.0;

  /* Local variables. */
  REAL diff, f, fbeg, recip, rhosq, stepa, stepb, temp;
  INTEGER i, i1, ih, ipt, itemp, j, jpt, k, nfm, nfx, np;

  /* Parameter adjustments to comply with FORTRAN indexing. */
  x     -= 1;
  xl    -= 1;
  xu    -= 1;
  xbase -= 1;
  xpt   -= 1 + npt;
  fval  -= 1;
  gopt  -= 1;
  hq    -= 1;
  pq    -= 1;
  bmat  -= 1 + ndim;
  zmat  -= 1 + npt;
  sl    -= 1;
  su    -= 1;
#define XPT(a1,a2) xpt[(a2)*npt + a1]
#define BMAT(a1,a2) bmat[(a2)*ndim + a1]
#define ZMAT(a1,a2) zmat[(a2)*npt + a1]

  /* FIXME: Set uninitialized variables. */
  stepa = zero;
  stepb = zero;
  fbeg = zero;
  ipt = 0;
  jpt = 0;

  /* Set some constants. */
  rhosq = rhobeg*rhobeg;
  recip = one/rhosq;
  np = n + 1;

  /* Set XBASE to the initial vector of variables, and set the initial elements
     of XPT, BMAT, HQ, PQ and ZMAT to zero. */
  LOOP(j,n ) {
    xbase[j] = x[j];
    LOOP(k,npt ) {
      XPT(k,j) = zero;
    }
    LOOP(i,ndim ) {
      BMAT(i,j) = zero;
    }
  }
  i1 = n*np/2;
  LOOP(ih,i1 ) {
    hq[ih] = zero;
  }
  LOOP(k,npt ) {
    pq[k] = zero;
    i1 = npt - np;
    LOOP(j,i1 ) {
      ZMAT(k,j) = zero;
    }
  }

  /* Begin the initialization procedure.  NF becomes one more than the number
     of function values so far.  The coordinates of the displacement of the
     next initial interpolation point from XBASE are set in XPT(NF+1,.). */
  *nf = 0;
  do {
    nfm = *nf;
    nfx = *nf - n;
    ++(*nf);
    if( nfm <= 2*n ) {
      if( nfm >= 1 && nfm <= n ) {
        stepa = rhobeg;
        if( su[nfm] == zero ) {
          stepa = -stepa;
        }
        XPT(*nf, nfm) = stepa;
      }
      else if( nfm > n ) {
        stepa = XPT(*nf - n, nfx);
        stepb = -rhobeg;
        if( sl[nfx] == zero ) {
          stepb = two*rhobeg;
          stepb = MIN(stepb,su[nfx]);
        }
        if( su[nfx] == zero ) {
          stepb = -two*rhobeg;
          stepb = MAX(stepb,sl[nfx]);
        }
        XPT(*nf, nfx) = stepb;
      }
    }
    else {
      itemp = (nfm - np)/n;
      jpt = nfm - itemp*n - n;
      ipt = jpt + itemp;
      if( ipt > n ) {
        itemp = jpt;
        jpt = ipt - n;
        ipt = itemp;
      }
      XPT(*nf, ipt) = XPT(ipt + 1, ipt);
      XPT(*nf, jpt) = XPT(jpt + 1, jpt);
    }

    /* Calculate the next value of F.  The least function value so far and its
       index are required. */
    LOOP(j,n ) {
      temp = xbase[j] + XPT(*nf, j);
      temp = MAX(temp,xl[j]);
      x[j] = MIN(temp,xu[j]);
      if( XPT(*nf, j) == sl[j] ) {
        x[j] = xl[j];
      }
      if( XPT(*nf, j) == su[j] ) {
        x[j] = xu[j];
      }
    }
    f = objfun(n, &x[1], data);
    if( iprint == 3 ) {
      fprintf(OUTPUT, "Function number%6ld    F = %.18G"
              "    The corresponding X is: ", (long)*nf, (double)f);
      LOOP(i,n ) {
        fprintf(OUTPUT, " %15.6E", x[i]);
      }
      fprintf(OUTPUT, "\n");
    }
    fval[*nf] = f;
    if( *nf == 1 ) {
      fbeg = f;
      *kopt = 1;
    }
    else if( f < fval[*kopt] ) {
      *kopt = *nf;
    }

    /* Set the nonzero initial elements of BMAT and the quadratic model in the
       cases when NF is at most 2*N+1.  If NF exceeds N+1, then the positions
       of the NF-th and (NF-N)-th interpolation points may be switched, in
       order that the function value at the first of them contributes to the
       off-diagonal second derivative terms of the initial quadratic model. */
    if( *nf <= 2*n + 1 ) {
      if( *nf >= 2 && *nf <= n + 1 ) {
        gopt[nfm] = (f - fbeg)/stepa;
        if( npt < *nf + n ) {
          BMAT(1,nfm) = -one/stepa;
          BMAT(*nf, nfm) = one/stepa;
          BMAT(npt + nfm, nfm) = -half*rhosq;
        }
      }
      else if( *nf >= n + 2 ) {
        ih = nfx*(nfx + 1)/2;
        temp = (f - fbeg)/stepb;
        diff = stepb - stepa;
        hq[ih] = two*(temp - gopt[nfx])/diff;
        gopt[nfx] = (gopt[nfx]*stepb - temp*stepa)/diff;
        if( stepa*stepb < zero ) {
          if( f < fval[*nf - n] ) {
            fval[*nf] = fval[*nf - n];
            fval[*nf - n] = f;
            if( *kopt == *nf ) {
              *kopt = *nf - n;
            }
            XPT(*nf - n, nfx) = stepb;
            XPT(*nf, nfx) = stepa;
          }
        }
        BMAT(1,nfx) = -(stepa + stepb)/(stepa*stepb);
        BMAT(*nf, nfx) = -half/XPT(*nf - n, nfx);
        BMAT(*nf - n, nfx) = -BMAT(1,nfx) - BMAT(*nf, nfx);
        ZMAT(1,nfx) = SQRT(two)/(stepa*stepb);
        ZMAT(*nf, nfx) = SQRT(half)/rhosq;
        ZMAT(*nf - n, nfx) = -ZMAT(1,nfx) - ZMAT(*nf, nfx);
      }
    }
    else {
      /* Set the off-diagonal second derivatives of the Lagrange functions and
         the initial quadratic model. */
      ih = ipt*(ipt - 1)/2 + jpt;
      ZMAT(1,nfx) = recip;
      ZMAT(*nf, nfx) = recip;
      ZMAT(ipt + 1, nfx) = -recip;
      ZMAT(jpt + 1, nfx) = -recip;
      temp = XPT(*nf, ipt)*XPT(*nf, jpt);
      hq[ih] = (fbeg - fval[ipt + 1] - fval[jpt + 1] + f)/temp;
    }
  } while (*nf < npt && *nf < maxfun);

}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq 0x198(%rsp), %rax
movq 0x190(%rsp), %rax
movq 0x188(%rsp), %rax
movq 0x180(%rsp), %rax
movq 0x178(%rsp), %rax
movq 0x170(%rsp), %rax
movq 0x168(%rsp), %rax
movq 0x160(%rsp), %rax
movq 0x158(%rsp), %rax
movq 0x150(%rsp), %rax
movq 0x148(%rsp), %rax
movq 0x140(%rsp), %rax
movq 0x138(%rsp), %rax
movq 0x130(%rsp), %rax
movq 0x128(%rsp), %rax
movq 0x120(%rsp), %rax
movq %rdi, 0x110(%rsp)
movq %rsi, 0x108(%rsp)
movq %rdx, 0x100(%rsp)
movq %rcx, 0xf8(%rsp)
movq %r8, 0xf0(%rsp)
movq %r9, 0xe8(%rsp)
movsd %xmm0, 0xe0(%rsp)
movsd 0x9be8(%rip), %xmm0     # 0x11020
movsd %xmm0, 0xd8(%rsp)
movsd 0x9bcf(%rip), %xmm0     # 0x11018
movsd %xmm0, 0xd0(%rsp)
movsd 0x9ba6(%rip), %xmm0     # 0x11000
movsd %xmm0, 0xc8(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0xc0(%rsp)
movq 0xf0(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0xf0(%rsp)
movq 0xe8(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0xe8(%rsp)
movq 0x120(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0x120(%rsp)
movq 0x138(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0x138(%rsp)
movq 0x108(%rsp), %rdx
addq $0x1, %rdx
movq 0x140(%rsp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x140(%rsp)
movq 0x148(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0x148(%rsp)
movq 0x150(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0x150(%rsp)
movq 0x158(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0x158(%rsp)
movq 0x160(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0x160(%rsp)
movq 0x178(%rsp), %rdx
addq $0x1, %rdx
movq 0x168(%rsp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x168(%rsp)
movq 0x108(%rsp), %rdx
addq $0x1, %rdx
movq 0x170(%rsp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x170(%rsp)
movq 0x180(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0x180(%rsp)
movq 0x188(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0x188(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x90(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x88(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0xa8(%rsp)
movq $0x0, 0x60(%rsp)
movq $0x0, 0x48(%rsp)
movsd 0xe0(%rsp), %xmm0
mulsd 0xe0(%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
movsd 0x9a10(%rip), %xmm0     # 0x11018
divsd 0x98(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movq 0x110(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq $0x1, 0x50(%rsp)
movq 0x50(%rsp), %rax
cmpq 0x110(%rsp), %rax
jg 0x7716
movq 0xf0(%rsp), %rax
movq 0x50(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x138(%rsp), %rax
movq 0x50(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq $0x1, 0x40(%rsp)
movq 0x40(%rsp), %rax
cmpq 0x108(%rsp), %rax
jg 0x76b6
movq 0x140(%rsp), %rax
movq 0x50(%rsp), %rcx
imulq 0x108(%rsp), %rcx
addq 0x40(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x7674
movq $0x1, 0x78(%rsp)
movq 0x78(%rsp), %rax
cmpq 0x178(%rsp), %rax
jg 0x7701
movq 0x168(%rsp), %rax
movq 0x50(%rsp), %rcx
imulq 0x178(%rsp), %rcx
addq 0x78(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq 0x78(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x78(%rsp)
jmp 0x76bf
jmp 0x7703
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x7634
movq 0x110(%rsp), %rax
imulq 0x28(%rsp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, 0x70(%rsp)
movq $0x1, 0x68(%rsp)
movq 0x68(%rsp), %rax
cmpq 0x70(%rsp), %rax
jg 0x776d
movq 0x158(%rsp), %rax
movq 0x68(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
jmp 0x773c
movq $0x1, 0x40(%rsp)
movq 0x40(%rsp), %rax
cmpq 0x108(%rsp), %rax
jg 0x780d
movq 0x160(%rsp), %rax
movq 0x40(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq 0x108(%rsp), %rax
subq 0x28(%rsp), %rax
movq %rax, 0x70(%rsp)
movq $0x1, 0x50(%rsp)
movq 0x50(%rsp), %rax
cmpq 0x70(%rsp), %rax
jg 0x77f8
movq 0x170(%rsp), %rax
movq 0x50(%rsp), %rcx
imulq 0x108(%rsp), %rcx
addq 0x40(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x77b9
jmp 0x77fa
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x7776
movq 0x190(%rsp), %rax
movq $0x0, (%rax)
movq 0x190(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x190(%rsp), %rax
movq (%rax), %rax
subq 0x110(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x190(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq 0x38(%rsp), %rax
movq 0x110(%rsp), %rcx
shlq %rcx
cmpq %rcx, %rax
jg 0x7adf
cmpq $0x1, 0x38(%rsp)
jl 0x791a
movq 0x38(%rsp), %rax
cmpq 0x110(%rsp), %rax
jg 0x791a
movsd 0xe0(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
movq 0x188(%rsp), %rax
movq 0x38(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x78e6
jp 0x78e6
movsd 0x90(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x90(%rsp)
movsd 0x90(%rsp), %xmm0
movq 0x140(%rsp), %rax
movq 0x38(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x7ada
movq 0x38(%rsp), %rax
cmpq 0x110(%rsp), %rax
jle 0x7ad8
movq 0x140(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
subq 0x110(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x90(%rsp)
movsd 0xe0(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0x180(%rsp), %rax
movq 0x30(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7a1d
jp 0x7a1d
movsd 0x964e(%rip), %xmm0     # 0x11000
mulsd 0xe0(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0x88(%rsp), %xmm1
movq 0x188(%rsp), %rax
movq 0x30(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jb 0x79f6
movsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
jmp 0x7a0e
movq 0x188(%rsp), %rax
movq 0x30(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0x188(%rsp), %rax
movq 0x30(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7aa9
jp 0x7aa9
movsd 0x9626(%rip), %xmm0     # 0x11068
mulsd 0xe0(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0x88(%rsp), %xmm0
movq 0x180(%rsp), %rax
movq 0x30(%rsp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jb 0x7a82
movsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
jmp 0x7a9a
movq 0x180(%rsp), %rax
movq 0x30(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0x88(%rsp), %xmm0
movq 0x140(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x7ada
jmp 0x7bed
movq 0x38(%rsp), %rax
subq 0x28(%rsp), %rax
cqto
idivq 0x110(%rsp)
movq %rax, 0x58(%rsp)
movq 0x38(%rsp), %rax
movq 0x58(%rsp), %rcx
imulq 0x110(%rsp), %rcx
subq %rcx, %rax
subq 0x110(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
addq 0x58(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
cmpq 0x110(%rsp), %rax
jle 0x7b5f
movq 0x48(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x60(%rsp), %rax
subq 0x110(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x140(%rsp), %rax
movq 0x60(%rsp), %rcx
imulq 0x108(%rsp), %rcx
addq 0x60(%rsp), %rcx
movsd 0x8(%rax,%rcx,8), %xmm0
movq 0x140(%rsp), %rax
movq 0x60(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x140(%rsp), %rax
movq 0x48(%rsp), %rcx
imulq 0x108(%rsp), %rcx
addq 0x48(%rsp), %rcx
movsd 0x8(%rax,%rcx,8), %xmm0
movq 0x140(%rsp), %rax
movq 0x48(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq $0x1, 0x50(%rsp)
movq 0x50(%rsp), %rax
cmpq 0x110(%rsp), %rax
jg 0x7dd6
movq 0x138(%rsp), %rax
movq 0x50(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x140(%rsp), %rax
movq 0x50(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x80(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movq 0x50(%rsp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jb 0x7c78
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
jmp 0x7c90
movq 0xe8(%rsp), %rax
movq 0x50(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x80(%rsp), %xmm1
movq 0x120(%rsp), %rax
movq 0x50(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jb 0x7cd1
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x7ce9
movq 0x120(%rsp), %rax
movq 0x50(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
movq 0xf0(%rsp), %rax
movq 0x50(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x140(%rsp), %rax
movq 0x50(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x180(%rsp), %rax
movq 0x50(%rsp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jne 0x7d61
jp 0x7d61
movq 0xe8(%rsp), %rax
movq 0x50(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0xf0(%rsp), %rax
movq 0x50(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x140(%rsp), %rax
movq 0x50(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x188(%rsp), %rax
movq 0x50(%rsp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jne 0x7dc1
jp 0x7dc1
movq 0x120(%rsp), %rax
movq 0x50(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0xf0(%rsp), %rax
movq 0x50(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x7dc3
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x7bf6
movq 0x100(%rsp), %rax
movq 0x110(%rsp), %rdi
movq 0xf0(%rsp), %rsi
addq $0x8, %rsi
movq 0xf8(%rsp), %rdx
callq *%rax
movsd %xmm0, 0xb0(%rsp)
cmpq $0x3, 0x128(%rsp)
jne 0x7eaa
movq 0xb1b5(%rip), %rax      # 0x12fd0
movq (%rax), %rdi
movq 0x190(%rsp), %rax
movq (%rax), %rdx
movsd 0xb0(%rsp), %xmm0
leaq 0x9495(%rip), %rsi      # 0x112ce
movb $0x1, %al
callq 0x1040
movq $0x1, 0x78(%rsp)
movq 0x78(%rsp), %rax
cmpq 0x110(%rsp), %rax
jg 0x7e92
movq 0xb171(%rip), %rax      # 0x12fd0
movq (%rax), %rdi
movq 0xf0(%rsp), %rax
movq 0x78(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x9490(%rip), %rsi      # 0x1130b
movb $0x1, %al
callq 0x1040
movq 0x78(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x78(%rsp)
jmp 0x7e49
movq 0xb137(%rip), %rax      # 0x12fd0
movq (%rax), %rdi
leaq 0x9496(%rip), %rsi      # 0x11339
movb $0x0, %al
callq 0x1040
movsd 0xb0(%rsp), %xmm0
movq 0x148(%rsp), %rax
movq 0x190(%rsp), %rcx
movq (%rcx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x190(%rsp), %rax
cmpq $0x1, (%rax)
jne 0x7efc
movsd 0xb0(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
movq 0x198(%rsp), %rax
movq $0x1, (%rax)
jmp 0x7f3b
movsd 0xb0(%rsp), %xmm1
movq 0x148(%rsp), %rax
movq 0x198(%rsp), %rcx
movq (%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x7f39
movq 0x190(%rsp), %rax
movq (%rax), %rcx
movq 0x198(%rsp), %rax
movq %rcx, (%rax)
jmp 0x7f3b
movq 0x190(%rsp), %rax
movq (%rax), %rax
movq 0x110(%rsp), %rcx
shlq %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jg 0x8544
movq 0x190(%rsp), %rax
cmpq $0x2, (%rax)
jl 0x8083
movq 0x190(%rsp), %rax
movq (%rax), %rax
movq 0x110(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jg 0x8083
movsd 0xb0(%rsp), %xmm0
subsd 0xa8(%rsp), %xmm0
divsd 0x90(%rsp), %xmm0
movq 0x150(%rsp), %rax
movq 0x38(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x108(%rsp), %rax
movq 0x190(%rsp), %rcx
movq (%rcx), %rcx
addq 0x110(%rsp), %rcx
cmpq %rcx, %rax
jge 0x807e
movsd 0x9087(%rip), %xmm0     # 0x11070
divsd 0x90(%rsp), %xmm0
movq 0x168(%rsp), %rax
movq 0x38(%rsp), %rcx
imulq 0x178(%rsp), %rcx
movsd %xmm0, 0x8(%rax,%rcx,8)
movsd 0x9002(%rip), %xmm0     # 0x11018
divsd 0x90(%rsp), %xmm0
movq 0x168(%rsp), %rax
movq 0x38(%rsp), %rcx
imulq 0x178(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x9013(%rip), %xmm0     # 0x11060
mulsd 0x98(%rsp), %xmm0
movq 0x168(%rsp), %rax
movq 0x38(%rsp), %rcx
imulq 0x178(%rsp), %rcx
addq 0x108(%rsp), %rcx
addq 0x38(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x853f
movq 0x190(%rsp), %rax
movq (%rax), %rax
movq 0x110(%rsp), %rcx
addq $0x2, %rcx
cmpq %rcx, %rax
jl 0x853d
movq 0x30(%rsp), %rax
movq 0x30(%rsp), %rcx
addq $0x1, %rcx
imulq %rcx, %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, 0x68(%rsp)
movsd 0xb0(%rsp), %xmm0
subsd 0xa8(%rsp), %xmm0
divsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x88(%rsp), %xmm0
subsd 0x90(%rsp), %xmm0
movsd %xmm0, 0xb8(%rsp)
movsd 0x80(%rsp), %xmm1
movq 0x150(%rsp), %rax
movq 0x30(%rsp), %rcx
subsd (%rax,%rcx,8), %xmm1
movsd 0x8eda(%rip), %xmm0     # 0x11000
mulsd %xmm1, %xmm0
divsd 0xb8(%rsp), %xmm0
movq 0x158(%rsp), %rax
movq 0x68(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x150(%rsp), %rax
movq 0x30(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x88(%rsp), %xmm2
movsd 0x80(%rsp), %xmm1
mulsd 0x90(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
divsd 0xb8(%rsp), %xmm0
movq 0x150(%rsp), %rax
movq 0x30(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x90(%rsp), %xmm1
mulsd 0x88(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x82fd
movsd 0xb0(%rsp), %xmm1
movq 0x148(%rsp), %rax
movq 0x190(%rsp), %rcx
movq (%rcx), %rcx
subq 0x110(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x82fb
movq 0x148(%rsp), %rax
movq 0x190(%rsp), %rcx
movq (%rcx), %rcx
subq 0x110(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x148(%rsp), %rax
movq 0x190(%rsp), %rcx
movq (%rcx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0xb0(%rsp), %xmm0
movq 0x148(%rsp), %rax
movq 0x190(%rsp), %rcx
movq (%rcx), %rcx
subq 0x110(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x198(%rsp), %rax
movq (%rax), %rax
movq 0x190(%rsp), %rcx
cmpq (%rcx), %rax
jne 0x8295
movq 0x190(%rsp), %rax
movq (%rax), %rcx
subq 0x110(%rsp), %rcx
movq 0x198(%rsp), %rax
movq %rcx, (%rax)
movsd 0x88(%rsp), %xmm0
movq 0x140(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
subq 0x110(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x90(%rsp), %xmm0
movq 0x140(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x82fd
movsd 0x90(%rsp), %xmm0
addsd 0x88(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x90(%rsp), %xmm1
mulsd 0x88(%rsp), %xmm1
divsd %xmm1, %xmm0
movq 0x168(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x178(%rsp), %rcx
movsd %xmm0, 0x8(%rax,%rcx,8)
movq 0x140(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
subq 0x110(%rsp), %rcx
movsd 0x8cd7(%rip), %xmm0     # 0x11060
divsd (%rax,%rcx,8), %xmm0
movq 0x168(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x178(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x168(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x178(%rsp), %rcx
movsd 0x8(%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq 0x168(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x178(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
subsd (%rax,%rcx,8), %xmm0
movq 0x168(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x178(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
subq 0x110(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x8bbd(%rip), %xmm0     # 0x11000
callq 0x1030
movsd 0x90(%rsp), %xmm1
mulsd 0x88(%rsp), %xmm1
divsd %xmm1, %xmm0
movq 0x170(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movsd %xmm0, 0x8(%rax,%rcx,8)
movsd 0x8b9e(%rip), %xmm0     # 0x11020
callq 0x1030
divsd 0x98(%rsp), %xmm0
movq 0x170(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x170(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movsd 0x8(%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq 0x170(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
subsd (%rax,%rcx,8), %xmm0
movq 0x170(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
subq 0x110(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x853f
jmp 0x86e8
movq 0x60(%rsp), %rax
movq 0x60(%rsp), %rcx
subq $0x1, %rcx
imulq %rcx, %rax
movl $0x2, %ecx
cqto
idivq %rcx
addq 0x48(%rsp), %rax
movq %rax, 0x68(%rsp)
movsd 0xa0(%rsp), %xmm0
movq 0x170(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movsd %xmm0, 0x8(%rax,%rcx,8)
movsd 0xa0(%rsp), %xmm0
movq 0x170(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0xa0(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq 0x170(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
addq 0x60(%rsp), %rcx
movsd %xmm0, 0x8(%rax,%rcx,8)
movsd 0xa0(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq 0x170(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq 0x108(%rsp), %rcx
addq 0x48(%rsp), %rcx
movsd %xmm0, 0x8(%rax,%rcx,8)
movq 0x140(%rsp), %rax
movq 0x60(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x140(%rsp), %rax
movq 0x48(%rsp), %rcx
imulq 0x108(%rsp), %rcx
movq 0x190(%rsp), %rdx
addq (%rdx), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0xa8(%rsp), %xmm0
movq 0x148(%rsp), %rax
movq 0x60(%rsp), %rcx
subsd 0x8(%rax,%rcx,8), %xmm0
movq 0x148(%rsp), %rax
movq 0x48(%rsp), %rcx
subsd 0x8(%rax,%rcx,8), %xmm0
addsd 0xb0(%rsp), %xmm0
divsd 0x80(%rsp), %xmm0
movq 0x158(%rsp), %rax
movq 0x68(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x86ea
movq 0x190(%rsp), %rax
movq (%rax), %rcx
xorl %eax, %eax
cmpq 0x108(%rsp), %rcx
movb %al, 0x7(%rsp)
jge 0x871f
movq 0x190(%rsp), %rax
movq (%rax), %rax
cmpq 0x130(%rsp), %rax
setl %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x781c
addq $0x118, %rsp            # imm = 0x118
retq
nopw %cs:(%rax,%rax)