// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/evolver_ndf15.c
// Function: interp_from_dif
int interp_from_dif(double tinterp,
                    double tnew,
                    double *ynew,
                    double h,
                    double **dif,
                    int k,
                    double *yinterp,
                    double *ypinterp,
                    double *yppinterp,
                    int* mask,
                    int neq,
                    int output){
  /* Output=1: only y_vector. Output=2: y and y prime. Output=3: y, yp and ypp*/
  double fact,prod,sumfrac;
  double vecy[5]={0.,0.,0.,0.,0.};
  double vecdy[5]={0.,0.,0.,0.,0.};
  int j, index_x;
  double s, sumtmp, sumtmp2;

  s = (tinterp - tnew)/h;

  prod = 1.0;
  sumfrac = 0.;
  fact = 1.0;
  for (j=0; j<k; j++){
    prod *= (s+j);
    fact *= (j+1);
    sumfrac += 1.0/(s+j);
    vecy[j] = prod/fact;
    vecdy[j] = prod*sumfrac/(h*fact);
  }

  for (index_x=1; index_x<=neq; index_x++){
    if (mask[index_x]==_TRUE_){
      sumtmp = 0;
      sumtmp2 = 0;
      for (j=0; j<k; j++){
        sumtmp += vecy[j]*dif[index_x][j+1];
        sumtmp2 += vecdy[j]*dif[index_x][j+1];
      }
      yinterp[index_x] = ynew[index_x] + sumtmp;
      ypinterp[index_x] = sumtmp2;
    }
  }
  return _SUCCESS_;
}

// Assembly:
subq $0xd8, %rsp
movl 0xf0(%rsp), %eax
movl 0xe8(%rsp), %eax
movq 0xe0(%rsp), %rax
movsd %xmm0, 0xd0(%rsp)
movsd %xmm1, 0xc8(%rsp)
movq %rdi, 0xc0(%rsp)
movsd %xmm2, 0xb8(%rsp)
movq %rsi, 0xb0(%rsp)
movl %edx, 0xac(%rsp)
movq %rcx, 0xa0(%rsp)
movq %r8, 0x98(%rsp)
movq %r9, 0x90(%rsp)
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x8210
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x8210
movsd 0xd0(%rsp), %xmm0
subsd 0xc8(%rsp), %xmm0
divsd 0xb8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x1bae96(%rip), %xmm0   # 0x1d2248
movsd %xmm0, 0x80(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0x1bae7c(%rip), %xmm0   # 0x1d2248
movsd %xmm0, 0x88(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0xac(%rsp), %eax
jge 0x174b2
movsd 0x10(%rsp), %xmm0
cvtsi2sdl 0x1c(%rsp), %xmm1
addsd %xmm1, %xmm0
mulsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
cvtsi2sd %eax, %xmm0
mulsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0x10(%rsp), %xmm1
cvtsi2sdl 0x1c(%rsp), %xmm0
addsd %xmm0, %xmm1
movsd 0x1bae03(%rip), %xmm0   # 0x1d2248
divsd %xmm1, %xmm0
addsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0x80(%rsp), %xmm0
divsd 0x88(%rsp), %xmm0
movslq 0x1c(%rsp), %rax
movsd %xmm0, 0x50(%rsp,%rax,8)
movsd 0x80(%rsp), %xmm0
mulsd 0x78(%rsp), %xmm0
movsd 0xb8(%rsp), %xmm1
mulsd 0x88(%rsp), %xmm1
divsd %xmm1, %xmm0
movslq 0x1c(%rsp), %rax
movsd %xmm0, 0x20(%rsp,%rax,8)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x173dd
movl $0x1, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0xe8(%rsp), %eax
jg 0x175eb
movq 0xe0(%rsp), %rax
movslq 0x18(%rsp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x175d9
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, (%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0xac(%rsp), %eax
jge 0x17598
movslq 0x1c(%rsp), %rax
movsd 0x50(%rsp,%rax,8), %xmm0
movq 0xb0(%rsp), %rax
movslq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x1c(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
movsd 0x8(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movslq 0x1c(%rsp), %rax
movsd 0x20(%rsp,%rax,8), %xmm0
movq 0xb0(%rsp), %rax
movslq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x1c(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
movsd (%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x174fb
movq 0xc0(%rsp), %rax
movslq 0x18(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd 0x8(%rsp), %xmm0
movq 0xa0(%rsp), %rax
movslq 0x18(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd (%rsp), %xmm0
movq 0x98(%rsp), %rax
movslq 0x18(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x175db
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x174ba
xorl %eax, %eax
addq $0xd8, %rsp
retq
nopw %cs:(%rax,%rax)