// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/evolver_ndf15.c
// Function: interp_from_difold
int interp_from_difold(double tinterp,double tnew,double *ynew,double h,double **dif,int k, double *yinterp,
            double *ypinterp, double *yppinterp, int* index, int neq, int output){
  /* Output=1: only y_vector. Output=2: y and y prime. Output=3: y, yp and ypp*/
  int i,j,m,l,p,factor;
  double sumj,suml,sump,prodm,s;
  s = (tinterp - tnew)/h;
  if (k==1){
    for(i=1;i<=neq;i++){
      if(index[i]==_TRUE_){
        yinterp[i] = ynew[i] + dif[i][1] * s;
        if (output>1) ypinterp[i] = dif[i][1]/h;
        if (output>2) yppinterp[i] = 0; /* No good estimate can be made of the second derivative */
      }
    }
  }
  else{
    /*This gets tricky */
    for(i=1;i<=neq;i++){
      if(index[i]==_TRUE_){
        /*First the value of the function:    */
        sumj=0.0;
        factor=1;
        for(j=1;j<=k;j++){
          prodm=1.0;
          factor*=j;
          for(m=0;m<j;m++) prodm*=(m+s);
          sumj+=dif[i][j]/factor*prodm;
        }
        yinterp[i] = ynew[i]+sumj;
        /* Now the first derivative: */
        if (output>1){
          factor = 1;
          sumj=0.0;
          for(j=1;j<=k;j++){
            suml = 0.0;
            factor *=j;
            for(l=0;l<j;l++){
              prodm=1.0;
              for(m=0;m<j;m++){
            if(m!=l) prodm*=(m+s);
              }
              suml+=prodm;
            }
            sumj+=dif[i][j]/factor*suml;
          }
          ypinterp[i] = sumj/h;
        }
        /* The second derivative: */
        if (output>2){
          factor=1;
          sumj=0.0;
          for(j=1;j<=k;j++){
            suml=0.0;
            factor*=j;
            for(l=0;l<j;l++){
              sump=0.0;
              for(p=0;p<j;p++){
                if(p!=l){
                  prodm=1.0;
                  for(m=0;m<j;m++){
                    if((m!=l)&&(m!=p)){
                      prodm*=(m+s);
                    }
                  }
                  sump+=prodm;
                }
              }
              suml+=sump;
            }
            sumj+=dif[i][j]/factor*suml;
          }
          yppinterp[i] = sumj/(h*h);
        }
      }
    }
  }
  return _SUCCESS_;
}

// Assembly:
pushq %rax
movl 0x20(%rsp), %eax
movl 0x18(%rsp), %eax
movq 0x10(%rsp), %rax
movsd %xmm0, (%rsp)
movsd %xmm1, -0x8(%rsp)
movq %rdi, -0x10(%rsp)
movsd %xmm2, -0x18(%rsp)
movq %rsi, -0x20(%rsp)
movl %edx, -0x24(%rsp)
movq %rcx, -0x30(%rsp)
movq %r8, -0x38(%rsp)
movq %r9, -0x40(%rsp)
movsd (%rsp), %xmm0
subsd -0x8(%rsp), %xmm0
divsd -0x18(%rsp), %xmm0
movsd %xmm0, -0x80(%rsp)
cmpl $0x1, -0x24(%rsp)
jne 0x17c38
movl $0x1, -0x44(%rsp)
movl -0x44(%rsp), %eax
cmpl 0x18(%rsp), %eax
jg 0x17c33
movq 0x10(%rsp), %rax
movslq -0x44(%rsp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x17c21
movq -0x10(%rsp), %rax
movslq -0x44(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x20(%rsp), %rax
movslq -0x44(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd 0x8(%rax), %xmm0
movsd -0x80(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x30(%rsp), %rax
movslq -0x44(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpl $0x1, 0x20(%rsp)
jle 0x17c06
movq -0x20(%rsp), %rax
movslq -0x44(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd 0x8(%rax), %xmm0
divsd -0x18(%rsp), %xmm0
movq -0x38(%rsp), %rax
movslq -0x44(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpl $0x2, 0x20(%rsp)
jle 0x17c1f
movq -0x40(%rsp), %rax
movslq -0x44(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x17c21
jmp 0x17c23
movl -0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rsp)
jmp 0x17b76
jmp 0x1802b
movl $0x1, -0x44(%rsp)
movl -0x44(%rsp), %eax
cmpl 0x18(%rsp), %eax
jg 0x18029
movq 0x10(%rsp), %rax
movslq -0x44(%rsp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x18017
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rsp)
movl $0x1, -0x58(%rsp)
movl $0x1, -0x48(%rsp)
movl -0x48(%rsp), %eax
cmpl -0x24(%rsp), %eax
jg 0x17d27
movsd 0x1ba5b7(%rip), %xmm0   # 0x1d2248
movsd %xmm0, -0x78(%rsp)
movl -0x48(%rsp), %eax
imull -0x58(%rsp), %eax
movl %eax, -0x58(%rsp)
movl $0x0, -0x4c(%rsp)
movl -0x4c(%rsp), %eax
cmpl -0x48(%rsp), %eax
jge 0x17cdb
cvtsi2sdl -0x4c(%rsp), %xmm0
addsd -0x80(%rsp), %xmm0
mulsd -0x78(%rsp), %xmm0
movsd %xmm0, -0x78(%rsp)
movl -0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rsp)
jmp 0x17cac
movq -0x20(%rsp), %rax
movslq -0x44(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x48(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
cvtsi2sdl -0x58(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd -0x78(%rsp), %xmm2
movsd -0x60(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rsp)
movl -0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rsp)
jmp 0x17c7b
movq -0x10(%rsp), %rax
movslq -0x44(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x60(%rsp), %xmm0
movq -0x30(%rsp), %rax
movslq -0x44(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpl $0x1, 0x20(%rsp)
jle 0x17e7c
movl $0x1, -0x58(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rsp)
movl $0x1, -0x48(%rsp)
movl -0x48(%rsp), %eax
cmpl -0x24(%rsp), %eax
jg 0x17e61
xorps %xmm0, %xmm0
movsd %xmm0, -0x68(%rsp)
movl -0x48(%rsp), %eax
imull -0x58(%rsp), %eax
movl %eax, -0x58(%rsp)
movl $0x0, -0x50(%rsp)
movl -0x50(%rsp), %eax
cmpl -0x48(%rsp), %eax
jge 0x17e15
movsd 0x1ba49b(%rip), %xmm0   # 0x1d2248
movsd %xmm0, -0x78(%rsp)
movl $0x0, -0x4c(%rsp)
movl -0x4c(%rsp), %eax
cmpl -0x48(%rsp), %eax
jge 0x17df6
movl -0x4c(%rsp), %eax
cmpl -0x50(%rsp), %eax
je 0x17de7
cvtsi2sdl -0x4c(%rsp), %xmm0
addsd -0x80(%rsp), %xmm0
mulsd -0x78(%rsp), %xmm0
movsd %xmm0, -0x78(%rsp)
jmp 0x17de9
movl -0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rsp)
jmp 0x17dbb
movsd -0x78(%rsp), %xmm0
addsd -0x68(%rsp), %xmm0
movsd %xmm0, -0x68(%rsp)
movl -0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rsp)
jmp 0x17d9b
movq -0x20(%rsp), %rax
movslq -0x44(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x48(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
cvtsi2sdl -0x58(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd -0x68(%rsp), %xmm2
movsd -0x60(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rsp)
movl -0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rsp)
jmp 0x17d6f
movsd -0x60(%rsp), %xmm0
divsd -0x18(%rsp), %xmm0
movq -0x38(%rsp), %rax
movslq -0x44(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpl $0x2, 0x20(%rsp)
jle 0x18015
movl $0x1, -0x58(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rsp)
movl $0x1, -0x48(%rsp)
movl -0x48(%rsp), %eax
cmpl -0x24(%rsp), %eax
jg 0x17ff0
xorps %xmm0, %xmm0
movsd %xmm0, -0x68(%rsp)
movl -0x48(%rsp), %eax
imull -0x58(%rsp), %eax
movl %eax, -0x58(%rsp)
movl $0x0, -0x50(%rsp)
movl -0x50(%rsp), %eax
cmpl -0x48(%rsp), %eax
jge 0x17fa4
xorps %xmm0, %xmm0
movsd %xmm0, -0x70(%rsp)
movl $0x0, -0x54(%rsp)
movl -0x54(%rsp), %eax
cmpl -0x48(%rsp), %eax
jge 0x17f82
movl -0x54(%rsp), %eax
cmpl -0x50(%rsp), %eax
je 0x17f70
movsd 0x1ba33d(%rip), %xmm0   # 0x1d2248
movsd %xmm0, -0x78(%rsp)
movl $0x0, -0x4c(%rsp)
movl -0x4c(%rsp), %eax
cmpl -0x48(%rsp), %eax
jge 0x17f5e
movl -0x4c(%rsp), %eax
cmpl -0x50(%rsp), %eax
je 0x17f4f
movl -0x4c(%rsp), %eax
cmpl -0x54(%rsp), %eax
je 0x17f4f
cvtsi2sdl -0x4c(%rsp), %xmm0
addsd -0x80(%rsp), %xmm0
mulsd -0x78(%rsp), %xmm0
movsd %xmm0, -0x78(%rsp)
jmp 0x17f51
movl -0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rsp)
jmp 0x17f19
movsd -0x78(%rsp), %xmm0
addsd -0x70(%rsp), %xmm0
movsd %xmm0, -0x70(%rsp)
jmp 0x17f72
movl -0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rsp)
jmp 0x17eeb
movsd -0x70(%rsp), %xmm0
addsd -0x68(%rsp), %xmm0
movsd %xmm0, -0x68(%rsp)
movl -0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rsp)
jmp 0x17ecc
movq -0x20(%rsp), %rax
movslq -0x44(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x48(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
cvtsi2sdl -0x58(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd -0x68(%rsp), %xmm2
movsd -0x60(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rsp)
movl -0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rsp)
jmp 0x17ea0
movsd -0x60(%rsp), %xmm0
movsd -0x18(%rsp), %xmm1
mulsd -0x18(%rsp), %xmm1
divsd %xmm1, %xmm0
movq -0x40(%rsp), %rax
movslq -0x44(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x18017
jmp 0x18019
movl -0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rsp)
jmp 0x17c40
jmp 0x1802b
xorl %eax, %eax
popq %rcx
retq
nop