// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../tools/evolver_ndf15.c
// Function: numjac
int numjac(
       int (*derivs)(double x, double * y,double * dy,
             void * parameters_and_workspace, ErrorMsg error_message),
       double t, double *y, double *fval,
       struct jacobian *jac, struct numjac_workspace *nj_ws,
       double thresh, int neq, int *nfe, void * parameters_and_workspace_for_derivs,
       ErrorMsg error_message){
  /*    Routine that computes the jacobian numerically. It is based on the numjac
    implementation in MATLAB, but a feature for recognising sparsity in the
    jacobian and taking advantage of that has been added.
  */
  double eps=1e-16, br=pow(eps,0.875),bl=pow(eps,0.75),bu=pow(eps,0.25);
  double facmin=pow(eps,0.78),facmax=0.1;
  int logjpos, pattern_broken;
  double tmpfac,difmax2=0.,del2,ffscale;
  int i,j,rowmax2;
  double maxval1,maxval2;
  int colmax,group,row,nz,nz2;
  double Fdiff_absrm,Fdiff_new;
  double **dFdy,*fac;
  int *Ap=NULL, *Ai=NULL;

  dFdy = jac->dfdy; /* Assign pointer to dfdy directly for easier notation. */
  fac = jac->jacvec;
  if (jac->use_sparse){
    Ap = jac->spJ->Ap;
    Ai = jac->spJ->Ai;
  }

  /* Set new_jacobian flag: */
  jac->new_jacobian = _TRUE_;

  for(j=1;j<=neq;j++){
    nj_ws->yscale[j] = MAX(fabs(y[j]),thresh);
    nj_ws->del[j] = (y[j] + fac[j] * nj_ws->yscale[j]) - y[j];
  }

  /*Select an increment del for a difference approximation to
    column j of dFdy.  The vector fac accounts for experience
    gained in previous calls to numjac.
  */
  for(j=1;j<=neq;j++){
    if (nj_ws->del[j]==0.0){
      for(;;){
    if (fac[j] < facmax){
      fac[j] = MIN(100*fac[j],facmax);
      nj_ws->del[j] = (y[j] + fac[j]*nj_ws->yscale[j]) - y[j];
      if(nj_ws->del[j]==0.0){
        break;
      }
    }
    else{
      nj_ws->del[j] = thresh;
      break;
    }
      }
    }
  }

  /* keep del pointing into region: */
  for(j=1;j<=neq;j++){
    if (fval[j]>=0.0){
      nj_ws->del[j] = fabs(nj_ws->del[j]);
    }
    else{
      nj_ws->del[j] = -fabs(nj_ws->del[j]);
    }
  }

  /* Sparse calculation?*/
  if ((jac->use_sparse)&&(jac->repeated_pattern >= jac->trust_sparse)){
    /* printf("\n Sparse calculation..neq=%d, has grouping=%d",neq,jac->has_grouping);*/
    /* Everything done sparse'ly. Do we have a grouping? */
    if (jac->has_grouping==0){
      jac->max_group = column_grouping(jac->spJ,jac->col_group,jac->col_wi);
      jac->has_grouping = 1;
    }
    colmax = jac->max_group+1;
    /*    printf("\n                ->groups=%d/%d.",colmax,neq);  */
    for(j=1;j<=colmax;j++){
      /*loop over groups */
      group = j-1;
      for(i=1;i<=neq;i++){
        /*Add y-vector.. */
        nj_ws->ydel_Fdel[i][j] = y[i];
        /*Add del of all groupmembers:*/
        if(jac->col_group[i-1]==group) nj_ws->ydel_Fdel[i][j] +=nj_ws->del[i];
      }
    }
  }
  else{
    /*printf("\n Normal calculation..."); */
    /*Normal calculation: */
    colmax = neq;
    for(j=1;j<=neq;j++){
      for(i=1;i<=neq;i++){
        nj_ws->ydel_Fdel[i][j] = y[i];
      }
      nj_ws->ydel_Fdel[j][j] += nj_ws->del[j];
    }
  }

  /* The next section should work regardless of sparse...*/
  /* Evaluate the function at y+delta vectors:*/
  for(j=1;j<=colmax;j++){
    for(i=1;i<=neq;i++){
      nj_ws->yydel[i] = nj_ws->ydel_Fdel[i][j];
    }
    class_call((*derivs)(t,nj_ws->yydel+1,nj_ws->ffdel+1,
               parameters_and_workspace_for_derivs,error_message),
               error_message,error_message);

    *nfe+=1;
    for(i=1;i<=neq;i++) nj_ws->ydel_Fdel[i][j] = nj_ws->ffdel[i];
  }


  /*Using the Fdel array, form the jacobian and construct max-value arrays.
    First we do it for the sparse case, then for the normal case:*/
  if ((jac->use_sparse)&&(jac->repeated_pattern >= jac->trust_sparse)){
    /* Sparse case:*/
    for(j=0;j<neq;j++){
      /*Loop over columns, and assign corresponding group:*/
      group = jac->col_group[j];
      Fdiff_new = 0.0;
      Fdiff_absrm = 0.0;
      for(i=Ap[j];i<Ap[j+1];i++){
        /* Loop over rows in the sparse matrix */
        row = Ai[i]+1;
        /* Do I want to construct the full jacobian? No, that is ugly..*/
        Fdiff_absrm = MAX(Fdiff_absrm,fabs(Fdiff_new));
        Fdiff_new = nj_ws->ydel_Fdel[row][group+1]-fval[row]; /*Remember to access the column of the corresponding group */
        if (fabs(Fdiff_new)>=Fdiff_absrm){
          nj_ws->Rowmax[j+1] = row;
          nj_ws->Difmax[j+1] = Fdiff_new;
        }
        /* Assign value to sparse rep of jacobian: */
        jac->xjac[i] = Fdiff_new/nj_ws->del[j+1];
      }
      /* The maximum numerical value of Fdel in true column j+1*/
      nj_ws->absFdelRm[j+1] = fabs(nj_ws->ydel_Fdel[nj_ws->Rowmax[j+1]][group+1]);
    }
  }
  else{
    /*Normal case:*/
    for(j=1;j<=neq;j++){
      Fdiff_new = 0.0;
      Fdiff_absrm = 0.0;
      for(i=1;i<=neq;i++){
        Fdiff_absrm = MAX(fabs(Fdiff_new),Fdiff_absrm);
        Fdiff_new = nj_ws->ydel_Fdel[i][j] - fval[i];
        dFdy[i][j] = Fdiff_new/nj_ws->del[j];
        /*Find row maximums:*/
        if(fabs(Fdiff_new)>=Fdiff_absrm){
          /* Found new max location in column */
          nj_ws->Rowmax[j] = i;
          nj_ws->Difmax[j] = fabs(Fdiff_new);
        }
      }
      nj_ws->absFdelRm[j] = fabs(nj_ws->ydel_Fdel[nj_ws->Rowmax[j]][j]);
    }
  }

  /* Adjust fac for next call to numjac. */
  for(i=1;i<=neq;i++){
    nj_ws->absFvalue[i] = fabs(fval[i]);
  }
  for(j=1;j<=neq;j++){
    nj_ws->absFvalueRm[j] = nj_ws->absFvalue[nj_ws->Rowmax[j]];
  }

  logjpos = 0;
  for(j=1;j<=neq;j++){
    if (((nj_ws->absFdelRm[j]<TINY)&&(nj_ws->absFvalueRm[j] < TINY))||(fabs(nj_ws->Difmax[j])<TINY)){
      nj_ws->logj[j] = 1;/*.true.*/
      logjpos = 1;
    }
    else{
      nj_ws->logj[j] = 0;
    }
  }

  if (logjpos ==1){
    for(i=1;i<=neq;i++){
      nj_ws->yydel[i] = y[i];
      nj_ws->Fscale[i] = MAX(nj_ws->absFdelRm[i],nj_ws->absFvalueRm[i]);
    }
    /* If the difference in f values is so small that the column might be just
       ! roundoff error, try a bigger increment. */
    for(j=1;j<=neq;j++){
      if ((nj_ws->logj[j]==1)&&(nj_ws->Difmax[j]<=(br*nj_ws->Fscale[j]))){
        tmpfac = MIN(sqrt(fac[j]),facmax);
        del2 = (y[j] + tmpfac*nj_ws->yscale[j]) - y[j];
        if ((tmpfac!=fac[j])&&(del2!=0.0)){
          if (fval[j] >= 0.0){
            /*! keep del pointing into region */
            del2 = fabs(del2);
          }
          else{
            del2 = -fabs(del2);
          }
          nj_ws->yydel[j] = y[j] + del2;
          class_call((*derivs)(t,nj_ws->yydel+1,nj_ws->ffdel+1,
                     parameters_and_workspace_for_derivs,error_message),
                     error_message,error_message);
          *nfe+=1;
          nj_ws->yydel[j] = y[j];
          rowmax2 = 1;
          Fdiff_new=0.0;
          Fdiff_absrm = 0.0;
          for(i=1;i<=neq;i++){
            Fdiff_absrm = MAX(Fdiff_absrm,fabs(Fdiff_new));
            Fdiff_new = nj_ws->ffdel[i]-fval[i];
            nj_ws->tmp[i] = Fdiff_new/del2;
            if(fabs(Fdiff_new)>=Fdiff_absrm){
              rowmax2 = i;
              difmax2 = fabs(Fdiff_new);
            }
          }
          maxval1 = difmax2*fabs(del2)*tmpfac;
          maxval2 = nj_ws->Difmax[j]*fabs(nj_ws->del[j]);
          if(maxval1>=maxval2){
            /* The new difference is more significant, so
               use the column computed with this increment.
               This depends on wether we are in sparse mode or not: */
            if ((jac->use_sparse)&&(jac->repeated_pattern >= jac->trust_sparse)){
              for(i=Ap[j-1];i<Ap[j];i++) jac->xjac[i]=nj_ws->tmp[Ai[i]+1];
            }
            else{
              for(i=1;i<=neq;i++) dFdy[i][j]=nj_ws->tmp[i];
            }
            /* Adjust fac for the next call to numjac. */
            ffscale = MAX(fabs(nj_ws->ffdel[rowmax2]),nj_ws->absFvalue[rowmax2]);
            if (difmax2 <= bl*ffscale){
              /* The difference is small, so increase the increment. */
              fac[j] = MIN(10*tmpfac, facmax);
            }
            else if(difmax2 > bu*ffscale){
              /* The difference is large, so reduce the increment. */
              fac[j] = MAX(0.1*tmpfac, facmin);
            }
            else{
              fac[j] = tmpfac;
            }
          }
        }
      }
    }
  }
  /* If use_sparse is true but I still don't trust the sparsity pattern, go through the full calculated jacobi-
     matrix, deduce the sparsity pattern, compare with the old pattern, and write the new sparse Jacobi matrix.
     If I do this cleverly, I only have to walk through the jacobian once, and I don't need any local storage.*/

  if ((jac->use_sparse)&&(jac->repeated_pattern < jac->trust_sparse)){
    nz=0; /*Number of non-zeros */
    Ap[0]=0; /*<-Always is.. */
    pattern_broken = _FALSE_;
    for(j=1;j<=neq;j++){
      for(i=1;i<=neq;i++){
        if ((i==j)||(fabs(dFdy[i][j])!=0.0)){
          /* Diagonal or non-zero index found. */
          if (nz>=jac->max_nonzero){
            /* Too many non-zero points to take advantage of sparsity.*/
            jac->use_sparse = 0;
            break;
          }
          /* Test pattern if it is still unbroken: */
          /* Two conditions must be met if the pattern is intact: Ap[j-1]<=nz<Ap[j],
             so that we are in the right column, and (i-1) must exist in column. Ai[nz]*/
          /* We should first test if nz is in the column, otherwise pattern is dead:*/
          if ((pattern_broken==_FALSE_)&&(jac->has_pattern==_TRUE_)){
            if ((nz<Ap[j-1])||(nz>=Ap[j])){
              /* If we are no longer in the right column, pattern is broken for sure. */
              pattern_broken = _TRUE_;
            }
          }
          if ((pattern_broken==_FALSE_)&&(jac->has_pattern==_TRUE_)){
            /* Up to this point, the new jacobian has managed to fit in the old
               sparsity pattern..*/
            if (Ai[nz]!=(i-1)){
              /* The current non-zero rownumber does not fit the current entry in the
             sparse matrix. Pattern MIGHT be broken. Scan ahead in the sparse matrix
             to search for the row entry: (Remember: the indices are sorted..)*/
              pattern_broken = _TRUE_;
              for(nz2=nz; (nz2<Ap[j])&&(Ai[nz2]<=(i-1)); nz2++){
            /* Go through the rest of the column with the added constraint that
               the row index in the sparse matrix should be smaller than the current
               row index i-1:*/
            if (Ai[nz2]==(i-1)){
              /* sparsity pattern recovered.. */
              pattern_broken = _FALSE_;
              nz = nz2;
              break;
            }
            /* Write a zero entry in the sparse matrix, in case we recover pattern. */
            jac->xjac[nz2] = 0.0;
              }
            }
          }
          /* The following works no matter the status of the pattern: */
          /* Write row_number: */
          Ai[nz] = i-1;
          /* Write value: */
          jac->xjac[nz] = dFdy[i][j];
          nz++;
        }
      }
      /* Break this loop too if I have hit max non-zero points: */
      if (jac->use_sparse==_FALSE_) break;
      Ap[j]=nz;
    }
    if (jac->use_sparse==_TRUE_){
      if ((jac->has_pattern==_TRUE_)&&(pattern_broken==_FALSE_)){
        /*New jacobian fitted into the current sparsity pattern:*/
        jac->repeated_pattern++;
        /* printf("\n Found repeated pattern. nz=%d/%d and
           rep.pat=%d.",nz,neq*neq,jac->repeated_pattern); */
      }
      else{
        /*Something has changed (or first run), better still do the full calculation..*/
        jac->repeated_pattern = 0;
      }
      jac->has_pattern = 1;
    }
  }
  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x878, %rsp            # imm = 0x878
movq %r8, %r15
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r13
movsd %xmm0, 0x40(%rsp)
movq %rdi, 0x38(%rsp)
movl 0x28(%rcx), %eax
testl %eax, %eax
je 0x1076f
movq 0x68(%rbx), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rsp)
jmp 0x10781
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq (%rbx), %r14
movq 0x8(%rbx), %r8
movl $0x1, 0x44(%rbx)
testl %r9d, %r9d
jle 0x108b5
movq (%r15), %rdx
movq 0x8(%r15), %rsi
leal 0x1(%r9), %ecx
movl $0x1, %edi
movapd 0xdda90(%rip), %xmm0    # 0xee240
movsd (%r13,%rdi,8), %xmm2
andpd %xmm0, %xmm2
movapd %xmm1, %xmm3
maxsd %xmm2, %xmm3
movsd %xmm3, (%rdx,%rdi,8)
movsd (%r13,%rdi,8), %xmm2
mulsd (%r8,%rdi,8), %xmm3
addsd %xmm2, %xmm3
subsd %xmm2, %xmm3
movsd %xmm3, (%rsi,%rdi,8)
incq %rdi
cmpq %rdi, %rcx
jne 0x107b0
testl %r9d, %r9d
jle 0x108b5
movq 0x8(%r15), %rdx
movl $0x1, %esi
xorpd %xmm2, %xmm2
movsd 0xdda88(%rip), %xmm3    # 0xee290
movsd 0xde510(%rip), %xmm4    # 0xeed20
movsd (%rdx,%rsi,8), %xmm5
ucomisd %xmm2, %xmm5
jne 0x10862
jp 0x10862
movsd (%r8,%rsi,8), %xmm5
ucomisd %xmm5, %xmm3
jbe 0x1085d
mulsd %xmm4, %xmm5
minsd %xmm3, %xmm5
movsd %xmm5, (%r8,%rsi,8)
movsd (%r13,%rsi,8), %xmm6
movq (%r15), %rdi
mulsd (%rdi,%rsi,8), %xmm5
addsd %xmm6, %xmm5
subsd %xmm6, %xmm5
movsd %xmm5, (%rdx,%rsi,8)
ucomisd %xmm2, %xmm5
jne 0x1081d
jp 0x1081d
jmp 0x10862
movsd %xmm1, (%rdx,%rsi,8)
incq %rsi
cmpq %rcx, %rsi
jne 0x10810
testl %r9d, %r9d
jle 0x108b5
movq 0x8(%r15), %rdx
movl $0x1, %esi
movapd 0xdd9b0(%rip), %xmm1    # 0xee230
movsd (%rdx,%rsi,8), %xmm2
movapd %xmm2, %xmm3
andpd %xmm0, %xmm3
orpd %xmm1, %xmm2
xorpd %xmm4, %xmm4
cmpnlesd (%r12,%rsi,8), %xmm4
andpd %xmm4, %xmm2
andnpd %xmm3, %xmm4
orpd %xmm2, %xmm4
movlpd %xmm4, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x10880
testl %eax, %eax
movq %rbx, 0x30(%rsp)
movq %r9, 0x8(%rsp)
movq %r8, 0x28(%rsp)
je 0x108d0
movl 0x34(%rbx), %eax
cmpl 0x38(%rbx), %eax
jge 0x1092b
testl %r9d, %r9d
jle 0x10a82
movq 0x8(%r15), %rax
movq 0x50(%r15), %rcx
leal 0x1(%r9), %edx
movl $0x1, %esi
movl $0x1, %edi
movsd (%r13,%rdi,8), %xmm0
movq (%rcx,%rdi,8), %r8
movsd %xmm0, (%r8,%rsi,8)
incq %rdi
cmpq %rdi, %rdx
jne 0x108ef
movsd (%rax,%rsi,8), %xmm0
movq (%rcx,%rsi,8), %rdi
addsd (%rdi,%rsi,8), %xmm0
movsd %xmm0, (%rdi,%rsi,8)
incq %rsi
cmpq %rdx, %rsi
jne 0x108ea
movl %r9d, %eax
jmp 0x109cd
cmpl $0x0, 0x3c(%rbx)
je 0x10936
movl 0x60(%rbx), %eax
jmp 0x10956
movq 0x68(%rbx), %rdi
movq 0x50(%rbx), %rsi
movq 0x58(%rbx), %rdx
callq 0xc0c0
movq 0x8(%rsp), %r9
movl %eax, 0x60(%rbx)
movl $0x1, 0x3c(%rbx)
testl %eax, %eax
js 0x10a82
leal 0x1(%rax), %ebp
leal 0x1(%r9), %ecx
addl $0x2, %eax
decq %rcx
movl $0x1, %edx
movq 0x30(%rsp), %rbx
testl %r9d, %r9d
jle 0x109bd
leaq -0x1(%rdx), %rsi
movq 0x50(%r15), %rdi
movq 0x50(%rbx), %r8
xorl %r9d, %r9d
movsd 0x8(%r13,%r9,8), %xmm0
movq 0x8(%rdi,%r9,8), %r10
movsd %xmm0, (%r10,%rdx,8)
movl (%r8,%r9,4), %r11d
cmpq %r11, %rsi
jne 0x109b5
movq 0x8(%r15), %r11
addsd 0x8(%r11,%r9,8), %xmm0
movsd %xmm0, (%r10,%rdx,8)
incq %r9
cmpq %r9, %rcx
jne 0x10989
incq %rdx
cmpq %rax, %rdx
movq 0x8(%rsp), %r9
jne 0x10975
movq %rbp, %rax
testl %eax, %eax
jle 0x10a82
leal 0x1(%r9), %ebx
incl %eax
movl $0x1, %ebp
movq %rax, (%rsp)
movq 0x40(%r15), %rdi
testl %r9d, %r9d
jle 0x10a0c
movq 0x50(%r15), %rax
movl $0x1, %ecx
movq (%rax,%rcx,8), %rdx
movsd (%rdx,%rbp,8), %xmm0
movsd %xmm0, (%rdi,%rcx,8)
incq %rcx
cmpq %rcx, %rbx
jne 0x109f6
addq $0x8, %rdi
movq 0x38(%r15), %rsi
addq $0x8, %rsi
movsd 0x40(%rsp), %xmm0
movq 0x8b8(%rsp), %rdx
movq 0x8c0(%rsp), %rcx
callq *0x38(%rsp)
cmpl $0x1, %eax
je 0x10d5f
movq 0x8b0(%rsp), %rax
incl (%rax)
movq 0x8(%rsp), %r9
testl %r9d, %r9d
jle 0x10a72
movq 0x38(%r15), %rax
movq 0x50(%r15), %rcx
movl $0x1, %edx
movsd (%rax,%rdx,8), %xmm0
movq (%rcx,%rdx,8), %rsi
movsd %xmm0, (%rsi,%rbp,8)
incq %rdx
cmpq %rdx, %rbx
jne 0x10a5c
incq %rbp
movq (%rsp), %rax
cmpq %rax, %rbp
jne 0x109e4
movq 0x30(%rsp), %rbx
cmpl $0x0, 0x28(%rbx)
je 0x10a99
movl 0x34(%rbx), %eax
cmpl 0x38(%rbx), %eax
jge 0x10b4f
testl %r9d, %r9d
jle 0x11153
movq 0x50(%r15), %rax
movq 0x60(%r15), %rcx
movq 0x8(%r15), %rdx
movq 0x18(%r15), %rsi
leal 0x1(%r9), %edi
movl $0x1, %r8d
movapd 0xdd77c(%rip), %xmm0    # 0xee240
movapd 0xdd774(%rip), %xmm1    # 0xee240
xorpd %xmm2, %xmm2
movl $0x1, %r9d
xorpd %xmm3, %xmm3
andpd %xmm0, %xmm2
maxsd %xmm2, %xmm3
movq (%rax,%r9,8), %r10
movsd (%r10,%r8,8), %xmm2
subsd (%r12,%r9,8), %xmm2
movapd %xmm2, %xmm4
divsd (%rdx,%r8,8), %xmm4
movq (%r14,%r9,8), %r10
movsd %xmm4, (%r10,%r8,8)
movapd %xmm2, %xmm4
andpd %xmm0, %xmm4
ucomisd %xmm3, %xmm4
jb 0x10b22
movl %r9d, (%rcx,%r8,4)
movq 0x10(%r15), %r10
movsd %xmm4, (%r10,%r8,8)
incq %r9
cmpq %r9, %rdi
jne 0x10ada
movslq (%rcx,%r8,4), %r9
movq (%rax,%r9,8), %r9
movsd (%r9,%r8,8), %xmm2
andpd %xmm1, %xmm2
movlpd %xmm2, (%rsi,%r8,8)
incq %r8
cmpq %rdi, %r8
jne 0x10acc
jmp 0x10c5c
testl %r9d, %r9d
jle 0x11153
movq 0x50(%rbx), %rax
movq %rax, (%rsp)
movq 0x18(%r15), %rax
movq %rax, 0x20(%rsp)
movq 0x50(%r15), %rdx
movq 0x60(%r15), %rsi
movl %r9d, %edi
movq 0x10(%rsp), %rax
movl (%rax), %ebp
xorl %r8d, %r8d
movapd 0xdd6ba(%rip), %xmm0    # 0xee240
movapd 0xdd6b2(%rip), %xmm1    # 0xee240
movq (%rsp), %rax
movslq (%rax,%r8,4), %r9
movq 0x10(%rsp), %rax
movl 0x4(%rax,%r8,4), %r10d
incq %r8
cmpl %r10d, %ebp
jge 0x10c32
movq 0x8(%r15), %r11
movq 0x30(%rsp), %rax
movq 0x70(%rax), %rbx
movslq %ebp, %rbp
xorpd %xmm2, %xmm2
xorpd %xmm3, %xmm3
movapd %xmm3, %xmm4
movq 0x18(%rsp), %rax
movslq (%rax,%rbp,4), %rax
andpd %xmm0, %xmm2
movapd %xmm2, %xmm3
maxsd %xmm4, %xmm3
movq 0x8(%rdx,%rax,8), %rcx
movsd 0x8(%rcx,%r9,8), %xmm2
subsd 0x8(%r12,%rax,8), %xmm2
movapd %xmm2, %xmm4
andpd %xmm0, %xmm4
ucomisd %xmm3, %xmm4
jb 0x10c18
incq %rax
movl %eax, (%rsi,%r8,4)
movq 0x10(%r15), %rax
movsd %xmm2, (%rax,%r8,8)
movq 0x10(%rsp), %rax
movl (%rax,%r8,4), %r10d
movapd %xmm2, %xmm4
divsd (%r11,%r8,8), %xmm4
movsd %xmm4, (%rbx,%rbp,8)
incq %rbp
movslq %r10d, %rax
cmpq %rax, %rbp
jl 0x10bc4
movslq (%rsi,%r8,4), %rax
movq (%rdx,%rax,8), %rax
movsd 0x8(%rax,%r9,8), %xmm2
andpd %xmm1, %xmm2
movq 0x20(%rsp), %rax
movlpd %xmm2, (%rax,%r8,8)
movl %r10d, %ebp
cmpq %rdi, %r8
jne 0x10b8e
movq 0x8(%rsp), %r9
testl %r9d, %r9d
movq 0x30(%rsp), %rbx
movq 0x28(%rsp), %rbp
jle 0x11153
movq 0x20(%r15), %rax
leal 0x1(%r9), %r10d
movl $0x1, %ecx
movapd 0xdd5b7(%rip), %xmm2    # 0xee240
movsd (%r12,%rcx,8), %xmm0
andpd %xmm2, %xmm0
movlpd %xmm0, (%rax,%rcx,8)
incq %rcx
cmpq %rcx, %r10
jne 0x10c89
testl %r9d, %r9d
jle 0x11153
movq 0x20(%r15), %rax
movq 0x28(%r15), %rcx
movq 0x60(%r15), %rdx
movl $0x1, %esi
movslq (%rdx,%rsi,4), %rdi
movsd (%rax,%rdi,8), %xmm0
movsd %xmm0, (%rcx,%rsi,8)
incq %rsi
cmpq %rsi, %r10
jne 0x10cba
testl %r9d, %r9d
jle 0x11153
movq 0x18(%r15), %rax
movq %r10, %rcx
negq %rcx
movb $0x1, %dl
movl $0x1, %esi
movsd 0xde036(%rip), %xmm0    # 0xeed28
incq %rsi
ucomisd -0x8(%rax,%rsi,8), %xmm0
jbe 0x10d10
movq 0x28(%r15), %r8
movq 0x58(%r15), %rdi
ucomisd -0x8(%r8,%rsi,8), %xmm0
jbe 0x10d14
jmp 0x10d43
movq 0x58(%r15), %rdi
movq 0x10(%r15), %r8
movsd -0x8(%r8,%rsi,8), %xmm1
andpd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
ja 0x10d43
movl $0x0, -0x4(%rdi,%rsi,4)
leaq (%rcx,%rsi), %rdi
incq %rdi
incq %rsi
cmpq $0x1, %rdi
jne 0x10cf5
jmp 0x10db1
movl $0x1, -0x4(%rdi,%rsi,4)
xorl %edx, %edx
movq %rcx, %rdi
addq %rsi, %rdi
jne 0x10cf2
testl %r9d, %r9d
jg 0x10dc2
jmp 0x11153
leaq 0xdd68a(%rip), %rsi     # 0xee3f0
leaq 0xde5d9(%rip), %rdx     # 0xef346
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
movq 0x8c0(%rsp), %r14
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xdd2a6(%rip), %rsi     # 0xee034
leaq 0xde60f(%rip), %rdx     # 0xef3a4
movq %r14, %rdi
movl $0x51a, %ecx            # imm = 0x51A
movq %rbx, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
jmp 0x112af
testl %r9d, %r9d
setle %al
orb %al, %dl
testb $0x1, %dl
jne 0x11153
movq 0x40(%r15), %rax
movq 0x18(%r15), %rcx
movq 0x28(%r15), %rdx
movq 0x30(%r15), %rsi
movl $0x1, %edi
movsd (%r13,%rdi,8), %xmm0
movsd %xmm0, (%rax,%rdi,8)
movsd (%rdx,%rdi,8), %xmm0
maxsd (%rcx,%rdi,8), %xmm0
movsd %xmm0, (%rsi,%rdi,8)
incq %rdi
cmpq %rdi, %r10
jne 0x10dd7
testl %r9d, %r9d
jle 0x11153
movl $0x1, %r11d
xorpd %xmm4, %xmm4
movq %r10, 0x20(%rsp)
movq 0x58(%r15), %rax
cmpl $0x1, (%rax,%r11,4)
jne 0x10e3b
movq 0x10(%r15), %rax
movq 0x30(%r15), %rcx
movsd (%rcx,%r11,8), %xmm0
mulsd 0xddead(%rip), %xmm0    # 0xeece0
ucomisd (%rax,%r11,8), %xmm0
jae 0x10e48
incq %r11
cmpq %r10, %r11
jne 0x10e12
jmp 0x11153
movsd (%rbp,%r11,8), %xmm0
ucomisd 0xdd401(%rip), %xmm0    # 0xee258
movsd %xmm4, (%rsp)
jb 0x10e64
sqrtsd %xmm0, %xmm0
jmp 0x10e8b
movq %r11, %rbp
callq 0x82b0
movsd (%rsp), %xmm4
movq %rbp, %r11
movq 0x28(%rsp), %rbp
movapd 0xdd3bf(%rip), %xmm2    # 0xee240
movq 0x20(%rsp), %r10
movq 0x8(%rsp), %r9
movsd 0xdd3fd(%rip), %xmm1    # 0xee290
ucomisd %xmm0, %xmm1
movapd %xmm1, %xmm0
jbe 0x10edb
movsd (%rbp,%r11,8), %xmm0
ucomisd 0xdd3ac(%rip), %xmm0    # 0xee258
jb 0x10eb4
sqrtsd %xmm0, %xmm0
jmp 0x10edb
movq %r11, %rbp
callq 0x82b0
movsd (%rsp), %xmm4
movq %rbp, %r11
movq 0x28(%rsp), %rbp
movapd 0xdd36f(%rip), %xmm2    # 0xee240
movq 0x20(%rsp), %r10
movq 0x8(%rsp), %r9
ucomisd (%rbp,%r11,8), %xmm0
jne 0x10eea
jnp 0x10e3b
movsd (%r13,%r11,8), %xmm3
movq (%r15), %rax
movsd (%rax,%r11,8), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm3, %xmm1
subsd %xmm3, %xmm1
ucomisd 0xdd34a(%rip), %xmm1    # 0xee258
jne 0x10f16
jnp 0x10e3b
movsd %xmm0, 0x48(%rsp)
movapd %xmm1, %xmm0
andpd %xmm2, %xmm0
orpd 0xdd304(%rip), %xmm1    # 0xee230
xorpd %xmm2, %xmm2
cmpnlesd (%r12,%r11,8), %xmm2
andpd %xmm2, %xmm1
movapd %xmm0, 0x60(%rsp)
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
movapd %xmm2, 0x50(%rsp)
addsd %xmm2, %xmm3
movq 0x40(%r15), %rdi
movsd %xmm3, (%rdi,%r11,8)
addq $0x8, %rdi
movq 0x38(%r15), %rsi
addq $0x8, %rsi
movsd 0x40(%rsp), %xmm0
movq 0x8b8(%rsp), %rdx
movq 0x8c0(%rsp), %rcx
movq %r11, %rbp
callq *0x38(%rsp)
cmpl $0x1, %eax
je 0x112c1
movq 0x8b0(%rsp), %rax
incl (%rax)
movsd (%r13,%rbp,8), %xmm0
movq 0x40(%r15), %rax
movsd %xmm0, (%rax,%rbp,8)
movq 0x38(%r15), %rcx
movq 0x48(%r15), %rdx
movl $0x1, %eax
xorpd %xmm0, %xmm0
movl $0x1, %esi
xorpd %xmm1, %xmm1
movq 0x8(%rsp), %r9
movq 0x20(%rsp), %r10
movq %rbp, %r11
movq 0x28(%rsp), %rbp
movapd 0xdd263(%rip), %xmm3    # 0xee240
movsd (%rsp), %xmm4
movapd 0x50(%rsp), %xmm5
movapd %xmm1, %xmm2
andpd %xmm3, %xmm0
movapd %xmm0, %xmm1
movsd (%rcx,%rsi,8), %xmm0
subsd (%r12,%rsi,8), %xmm0
maxsd %xmm2, %xmm1
movapd %xmm0, %xmm2
divsd %xmm5, %xmm2
movsd %xmm2, (%rdx,%rsi,8)
movapd %xmm0, %xmm2
andpd %xmm3, %xmm2
ucomisd %xmm1, %xmm2
movl %eax, %edi
movl %esi, %eax
cmovbl %edi, %eax
jb 0x11029
movapd %xmm2, %xmm4
incq %rsi
cmpq %rsi, %r10
jne 0x10fe8
movapd 0x60(%rsp), %xmm1
mulsd %xmm4, %xmm1
movsd 0x48(%rsp), %xmm3
mulsd %xmm3, %xmm1
movq 0x8(%r15), %rcx
movq 0x10(%r15), %rdx
movsd (%rcx,%r11,8), %xmm0
movapd 0xdd1e5(%rip), %xmm2    # 0xee240
andpd %xmm2, %xmm0
mulsd (%rdx,%r11,8), %xmm0
ucomisd %xmm0, %xmm1
jb 0x10e3b
cmpl $0x0, 0x28(%rbx)
je 0x11081
movl 0x34(%rbx), %ecx
cmpl 0x38(%rbx), %ecx
jge 0x11113
movq 0x48(%r15), %rcx
movl $0x1, %edx
movsd (%rcx,%rdx,8), %xmm0
movq (%r14,%rdx,8), %rsi
movsd %xmm0, (%rsi,%r11,8)
incq %rdx
cmpq %rdx, %r10
jne 0x1108a
movq 0x20(%r15), %rcx
movq 0x38(%r15), %rdx
cltq
movsd (%rdx,%rax,8), %xmm1
andpd %xmm2, %xmm1
movsd (%rcx,%rax,8), %xmm0
maxsd %xmm1, %xmm0
movapd %xmm0, %xmm1
mulsd 0xddc67(%rip), %xmm1    # 0xeed30
ucomisd %xmm4, %xmm1
jae 0x110f7
mulsd 0xddc61(%rip), %xmm0    # 0xeed38
ucomisd %xmm0, %xmm4
jbe 0x11107
mulsd 0xdd1ab(%rip), %xmm3    # 0xee290
movsd 0xddc53(%rip), %xmm0    # 0xeed40
maxsd %xmm3, %xmm0
movapd %xmm0, %xmm3
jmp 0x11107
mulsd 0xdd6f1(%rip), %xmm3    # 0xee7f0
minsd 0xdd189(%rip), %xmm3    # 0xee290
movsd %xmm3, (%rbp,%r11,8)
jmp 0x10e3b
movq 0x10(%rsp), %rdx
movslq -0x4(%rdx,%r11,4), %rcx
movslq (%rdx,%r11,4), %rdx
cmpl %edx, %ecx
jge 0x110a1
movq 0x48(%r15), %rsi
movq 0x70(%rbx), %rdi
movq 0x18(%rsp), %r8
movslq (%r8,%rcx,4), %r8
movsd 0x8(%rsi,%r8,8), %xmm0
movsd %xmm0, (%rdi,%rcx,8)
incq %rcx
cmpq %rcx, %rdx
jne 0x11131
jmp 0x110a1
xorl %eax, %eax
cmpl $0x0, 0x28(%rbx)
je 0x112af
movl 0x34(%rbx), %ecx
cmpl 0x38(%rbx), %ecx
jge 0x112af
movq 0x10(%rsp), %r12
movl $0x0, (%r12)
testl %r9d, %r9d
jle 0x11283
incl %r9d
xorl %edx, %edx
movl $0x1, %ecx
xorpd %xmm0, %xmm0
xorl %esi, %esi
movl $0x1, %edi
cmpq %rcx, %rdi
je 0x111ad
movq (%r14,%rdi,8), %r8
movsd (%r8,%rcx,8), %xmm1
ucomisd %xmm0, %xmm1
jne 0x111ad
jnp 0x111e5
cmpl 0x30(%rbx), %edx
jge 0x11278
testl %esi, %esi
je 0x111ef
movl $0x1, %esi
movslq %edx, %rdx
leal -0x1(%rdi), %r8d
movq 0x18(%rsp), %r10
movl %r8d, (%r10,%rdx,4)
movq (%r14,%rdi,8), %r8
movsd (%r8,%rcx,8), %xmm1
movq 0x70(%rbx), %r8
movsd %xmm1, (%r8,%rdx,8)
incl %edx
incq %rdi
cmpq %r9, %rdi
jne 0x11196
jmp 0x1125b
xorl %esi, %esi
cmpl $0x1, 0x40(%rbx)
jne 0x111bf
cmpl -0x4(%r12,%rcx,4), %edx
jl 0x111ba
movl (%r12,%rcx,4), %r8d
cmpl %r8d, %edx
jge 0x111ba
movq %r9, %r15
movslq %edx, %r9
movq 0x18(%rsp), %r10
movl (%r10,%r9,4), %r11d
leaq -0x1(%rdi), %r10
cmpq %r11, %r10
je 0x11253
movq 0x18(%rsp), %r11
movslq (%r11,%r9,4), %r11
cmpq %r11, %rdi
jle 0x11249
movl %r11d, %r11d
cmpq %r11, %r10
je 0x11250
movq 0x70(%rbx), %r11
movq $0x0, (%r11,%r9,8)
incq %r9
cmpl %r9d, %r8d
jne 0x1121f
movl $0x1, %esi
jmp 0x11253
movl %r9d, %edx
movq %r15, %r9
jmp 0x111bf
cmpl $0x0, 0x28(%rbx)
je 0x1127f
movl %edx, (%r12,%rcx,4)
incq %rcx
cmpq %r9, %rcx
jne 0x11191
testl %esi, %esi
sete %cl
jmp 0x11285
movl $0x0, 0x28(%rbx)
xorl %eax, %eax
jmp 0x112af
movb $0x1, %cl
cmpl $0x1, 0x28(%rbx)
jne 0x112af
cmpl $0x1, 0x40(%rbx)
sete %dl
andb %cl, %dl
xorl %eax, %eax
movl $0x0, %ecx
cmpb $0x1, %dl
jne 0x112a5
movl 0x34(%rbx), %ecx
incl %ecx
movl %ecx, 0x34(%rbx)
movl $0x1, 0x40(%rbx)
addq $0x878, %rsp            # imm = 0x878
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xdd128(%rip), %rsi     # 0xee3f0
leaq 0xde077(%rip), %rdx     # 0xef346
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
movq 0x8c0(%rsp), %r14
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xdcd44(%rip), %rsi     # 0xee034
leaq 0xde0ad(%rip), %rdx     # 0xef3a4
movq %r14, %rdi
movl $0x578, %ecx            # imm = 0x578
jmp 0x10d9d