// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/arrays.c
// Function: array_interpolate_parabola
int array_interpolate_parabola(double x1,
			       double x2,
			       double x3,
			       double x,
			       double y1,
			       double y2,
			       double y3,
			       double * y,
			       double * dy,
			       double * ddy,
			       ErrorMsg errmsg) {

  double a,b,c;

  /*
    a x_i**2 + b x_i + c = y_i

    a (x1**2-x2**2) + b (x1-x2) = y1-y2
    a (x3**2-x2**2) + b (x3-x2) = y3-y2

    a (x1**2-x2**2)(x3**2-x2**2) + b (x1-x2)(x3**2-x2**2) = (y1-y2)(x3**2-x2**2)
    a (x3**2-x2**2)(x1**2-x2**2) + b (x3-x2)(x1**2-x2**2) = (y3-y2)(x1**2-x2**2)

    b = [(y1-y2)(x3**2-x2**2) - (y3-y2)(x1**2-x2**2)]/(x1-x2)(x3-x2)(x3-x1)

  */

  b = ((y1-y2)*(x3-x2)*(x3+x2) - (y3-y2)*(x1-x2)*(x1+x2))/(x1-x2)/(x3-x2)/(x3-x1);

  a = (y1-y2-b*(x1-x2))/(x1-x2)/(x1+x2);

  c = y2 - b*x2 - a*x2*x2;

  *y = a*x*x + b*x + c;
  *dy = 2.*a*x + b;
  *ddy = 2.*a;

  return _SUCCESS_;

}

// Assembly:
movsd %xmm0, -0x8(%rsp)
movsd %xmm1, -0x10(%rsp)
movsd %xmm2, -0x18(%rsp)
movsd %xmm3, -0x20(%rsp)
movsd %xmm4, -0x28(%rsp)
movsd %xmm5, -0x30(%rsp)
movsd %xmm6, -0x38(%rsp)
movq %rdi, -0x40(%rsp)
movq %rsi, -0x48(%rsp)
movq %rdx, -0x50(%rsp)
movq %rcx, -0x58(%rsp)
movsd -0x28(%rsp), %xmm0
subsd -0x30(%rsp), %xmm0
movsd -0x18(%rsp), %xmm1
subsd -0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd -0x18(%rsp), %xmm2
addsd -0x10(%rsp), %xmm2
movsd -0x38(%rsp), %xmm1
subsd -0x30(%rsp), %xmm1
movsd -0x8(%rsp), %xmm3
subsd -0x10(%rsp), %xmm3
mulsd %xmm3, %xmm1
movsd -0x8(%rsp), %xmm3
addsd -0x10(%rsp), %xmm3
mulsd %xmm3, %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x8(%rsp), %xmm1
subsd -0x10(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd -0x18(%rsp), %xmm1
subsd -0x10(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd -0x18(%rsp), %xmm1
subsd -0x8(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rsp)
movsd -0x28(%rsp), %xmm1
subsd -0x30(%rsp), %xmm1
movsd -0x68(%rsp), %xmm0
movsd -0x8(%rsp), %xmm2
subsd -0x10(%rsp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x8(%rsp), %xmm1
subsd -0x10(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd -0x8(%rsp), %xmm1
addsd -0x10(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rsp)
movsd -0x30(%rsp), %xmm0
movsd -0x68(%rsp), %xmm1
movsd -0x10(%rsp), %xmm2
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x60(%rsp), %xmm0
mulsd -0x10(%rsp), %xmm0
movsd -0x10(%rsp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rsp)
movsd -0x60(%rsp), %xmm0
mulsd -0x20(%rsp), %xmm0
movsd -0x20(%rsp), %xmm2
movsd -0x68(%rsp), %xmm1
mulsd -0x20(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd -0x70(%rsp), %xmm0
movq -0x40(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0x1a9051(%rip), %xmm0   # 0x1d2c80
mulsd -0x60(%rsp), %xmm0
movsd -0x20(%rsp), %xmm2
movsd -0x68(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x48(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0x1a9026(%rip), %xmm0   # 0x1d2c80
mulsd -0x60(%rsp), %xmm0
movq -0x50(%rsp), %rax
movsd %xmm0, (%rax)
xorl %eax, %eax
retq
nopl (%rax)