// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../tools/arrays.c
// Function: array_interpolate_cubic_equal
int array_interpolate_cubic_equal(
				  double x0,
				  double dx,
				  double *yarray,
				  int Nx,
				  double x,
				  double * result,
				  ErrorMsg errmsg) {

  int i;
  double frac;

  class_test((dx > 0 && (x<x0 || x>x0+dx*(Nx-1))),
	     errmsg,
	     "x=%e out of range [%e %e]",x,x0,x0+dx*(Nx-1));

  class_test((dx < 0 && (x>x0 || x<x0+dx*(Nx-1))),
	     errmsg,
	     "x=%e out of range [%e %e]",x,x0+dx*(Nx-1),x0);

  i = (int)floor((x-x0)/dx);
  if (i<1) i=1;
  if (i>Nx-3) i=Nx-3;
  frac = (x-x0)/dx-i;
  yarray += i-1;

  *result=-yarray[0]*frac*(1.-frac)*(2.-frac)/6.
    +yarray[1]*(1.+frac)*(1.-frac)*(2.-frac)/2.
    +yarray[2]*(1.+frac)*frac*(2.-frac)/2.
    +yarray[3]*(1.+frac)*frac*(frac-1.)/6.;

  return _SUCCESS_;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %rcx, %r15
movq %rdx, %rbx
movapd %xmm2, %xmm4
movl %esi, %r12d
movq %rdi, %r14
movapd %xmm0, %xmm3
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x1aad8
leal -0x1(%r12), %eax
ucomisd %xmm4, %xmm3
xorps %xmm2, %xmm2
cvtsi2sd %eax, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm3, %xmm2
ja 0x1abf6
ucomisd %xmm2, %xmm4
ja 0x1abf6
ucomisd %xmm1, %xmm0
jbe 0x1ab06
leal -0x1(%r12), %eax
ucomisd %xmm3, %xmm4
xorps %xmm2, %xmm2
cvtsi2sd %eax, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm3, %xmm2
ja 0x1ac4f
ucomisd %xmm4, %xmm2
ja 0x1ac4f
subsd %xmm3, %xmm4
divsd %xmm1, %xmm4
movsd %xmm4, 0x8(%rsp)
movapd %xmm4, %xmm0
callq 0x85e0
cvttsd2si %xmm0, %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
addl $-0x3, %r12d
cmpl %r12d, %ecx
cmovll %ecx, %r12d
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
movsd 0x8(%rsp), %xmm6
subsd %xmm0, %xmm6
movslq %r12d, %rax
movsd -0x8(%r14,%rax,8), %xmm2
mulsd %xmm6, %xmm2
movsd 0xd3701(%rip), %xmm0    # 0xee260
movapd %xmm0, %xmm3
subsd %xmm6, %xmm3
mulsd %xmm3, %xmm2
movsd 0xd418d(%rip), %xmm4    # 0xeed00
subsd %xmm6, %xmm4
mulsd %xmm4, %xmm2
movsd 0xd4aed(%rip), %xmm1    # 0xef670
divsd %xmm1, %xmm2
addsd %xmm6, %xmm0
movsd (%r14,%rax,8), %xmm5
mulsd %xmm0, %xmm5
mulsd %xmm3, %xmm5
mulsd %xmm4, %xmm5
movsd 0xd412b(%rip), %xmm3    # 0xeecd0
mulsd %xmm3, %xmm5
subsd %xmm2, %xmm5
movsd 0x8(%r14,%rax,8), %xmm2
mulsd %xmm0, %xmm2
mulsd %xmm6, %xmm2
mulsd %xmm4, %xmm2
mulsd %xmm3, %xmm2
addsd %xmm5, %xmm2
mulsd 0x10(%r14,%rax,8), %xmm0
movapd %xmm6, %xmm3
mulsd %xmm6, %xmm0
addsd 0xd3c09(%rip), %xmm3    # 0xee7e8
mulsd %xmm0, %xmm3
divsd %xmm1, %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, (%rbx)
xorl %eax, %eax
jmp 0x1acb9
leaq 0xd58e5(%rip), %rsi     # 0xf04e2
leaq 0x810(%rsp), %rbx
movq %rbx, %rdi
movapd %xmm4, %xmm0
movapd %xmm3, %xmm1
movb $0x3, %al
callq 0x30af0
leaq 0xd3464(%rip), %rsi     # 0xee082
leaq 0xd58d7(%rip), %rdx     # 0xf04fc
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xd33f6(%rip), %rsi     # 0xee034
leaq 0xd58dc(%rip), %rdx     # 0xf0521
movq %r15, %rdi
movl $0xbde, %ecx            # imm = 0xBDE
jmp 0x1acaa
leaq 0xd588c(%rip), %rsi     # 0xf04e2
leaq 0x810(%rsp), %rbx
movq %rbx, %rdi
movapd %xmm4, %xmm0
movapd %xmm2, %xmm1
movapd %xmm3, %xmm2
movb $0x3, %al
callq 0x30af0
leaq 0xd3407(%rip), %rsi     # 0xee082
leaq 0xd58bd(%rip), %rdx     # 0xf053f
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xd3399(%rip), %rsi     # 0xee034
leaq 0xd587f(%rip), %rdx     # 0xf0521
movq %r15, %rdi
movl $0xbe2, %ecx            # imm = 0xBE2
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r14
popq %r15
retq