// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../tools/arrays.c
// Function: array_derive2_order2_table_line_to_line
int array_derive2_order2_table_line_to_line(
				       double * x_array,
				       int n_lines,
				       double * array,
				       int n_columns,
				       int index_y,
				       int index_dy,
				       int index_ddy,
				       ErrorMsg errmsg) {

  int i;
  double dxp,dxm,dyp,dym;

  for (i=1; i<n_lines-1; i++) {

    dxp = x_array[i+1] - x_array[i];
    dxm = x_array[i-1] - x_array[i];
    dyp = *(array+(i+1)*n_columns+index_y) - *(array+i*n_columns+index_y);
    dym = *(array+(i-1)*n_columns+index_y) - *(array+i*n_columns+index_y);

    if ((dxp*dxm*(dxm-dxp)) == 0.) {
      class_sprintf(errmsg,"%s(L:%d) stop to avoid division by zero",__func__,__LINE__);
      return _FAILURE_;
    }

    *(array+i*n_columns+index_dy) = (dyp*dxm*dxm-dym*dxp*dxp)/(dxp*dxm*(dxm-dxp));
    *(array+i*n_columns+index_ddy) = 2.*(dyp*dxm-dym*dxp)/(dxp*dxm*(dxp-dxm));

  }

  *(array+0*n_columns+index_dy) = *(array+1*n_columns+index_dy)
    - (x_array[1] - x_array[0]) * *(array+1*n_columns+index_ddy);
  *(array+0*n_columns+index_ddy) = *(array+1*n_columns+index_ddy);

  *(array+(n_lines-1)*n_columns+index_dy) = *(array+(n_lines-2)*n_columns+index_dy)
    + (x_array[n_lines-1] - x_array[n_lines-2]) * *(array+(n_lines-2)*n_columns+index_ddy);
  *(array+(n_lines-1)*n_columns+index_ddy) = *(array+(n_lines-2)*n_columns+index_ddy);

  return _SUCCESS_;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r10
leal -0x1(%rsi), %eax
movl %eax, 0x4(%rsp)
movslq %r9d, %r9
movslq 0x40(%rsp), %rax
movslq %ecx, %rcx
cmpl $0x3, %esi
jl 0x132ab
movslq %r8d, %rdx
movl 0x4(%rsp), %r8d
leaq (,%rcx,8), %r11
leaq (,%rax,8), %rbx
leaq (%rbx,%rcx,8), %r14
leaq (,%r9,8), %rbx
leaq (%rbx,%rcx,8), %r15
leaq (,%rdx,8), %r12
leaq (%r12,%rcx,8), %r13
movq %rcx, %rbx
shlq $0x4, %rbx
leaq (%rbx,%rdx,8), %rbp
movl $0x1, %ebx
xorpd %xmm0, %xmm0
movapd 0xde030(%rip), %xmm1    # 0xf1230
movq %r10, %rdx
movsd 0x8(%rdi,%rbx,8), %xmm2
movsd -0x8(%rdi,%rbx,8), %xmm3
movsd (%rdi,%rbx,8), %xmm4
subsd %xmm4, %xmm2
subsd %xmm4, %xmm3
movapd %xmm2, %xmm4
mulsd %xmm3, %xmm4
movapd %xmm3, %xmm5
subsd %xmm2, %xmm5
mulsd %xmm4, %xmm5
ucomisd %xmm0, %xmm5
jne 0x1323c
jnp 0x13326
incq %rbx
movsd (%rdx,%r12), %xmm6
movsd (%rdx,%r13), %xmm7
subsd %xmm7, %xmm6
xorpd %xmm1, %xmm6
movsd (%rdx,%rbp), %xmm8
subsd %xmm7, %xmm8
mulsd %xmm3, %xmm8
mulsd %xmm2, %xmm6
movapd %xmm2, %xmm7
mulsd %xmm6, %xmm7
addsd %xmm8, %xmm6
mulsd %xmm3, %xmm8
addsd %xmm7, %xmm8
divsd %xmm5, %xmm8
movsd %xmm8, (%rdx,%r15)
addsd %xmm6, %xmm6
subsd %xmm3, %xmm2
mulsd %xmm2, %xmm4
divsd %xmm4, %xmm6
movsd %xmm6, (%rdx,%r14)
addq %r11, %rdx
cmpq %rbx, %r8
jne 0x13203
leaq (%r10,%rcx,8), %rdx
movsd 0x8(%rdi), %xmm0
subsd (%rdi), %xmm0
movsd (%rdx,%r9,8), %xmm1
mulsd (%rdx,%rax,8), %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, (%r10,%r9,8)
movsd (%rdx,%rax,8), %xmm0
movsd %xmm0, (%r10,%rax,8)
leal -0x2(%rsi), %edx
imull %ecx, %edx
movslq %edx, %rdx
leaq (%r10,%rdx,8), %rdx
movl 0x4(%rsp), %r11d
movslq %r11d, %r8
movsd (%rdi,%r8,8), %xmm0
movslq %esi, %rsi
subsd -0x10(%rdi,%rsi,8), %xmm0
mulsd (%rdx,%rax,8), %xmm0
addsd (%rdx,%r9,8), %xmm0
imull %ecx, %r11d
movslq %r11d, %rcx
leaq (%r10,%rcx,8), %rcx
movsd %xmm0, (%rcx,%r9,8)
movsd (%rdx,%rax,8), %xmm0
movsd %xmm0, (%rcx,%rax,8)
xorl %eax, %eax
jmp 0x1336d
leaq 0xdf9f7(%rip), %r14     # 0xf2d24
leaq 0xdfa18(%rip), %r15     # 0xf2d4c
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
movq %r15, %rcx
movl $0xe7, %r8d
xorl %eax, %eax
callq 0x8550
incl %eax
movslq %eax, %rsi
movq 0x48(%rsp), %rdi
movq %r14, %rdx
movq %r15, %rcx
movl $0xe7, %r8d
xorl %eax, %eax
callq 0x8550
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq