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

  int i;

  double h;

  class_test(index_ddy == index_y,
	     errmsg,
	     "Output column %d must differ from input columns %d",
	     index_ddy,
	     index_y);

  class_test(index_ddy == index_dy,
	     errmsg,
	     "Output column %d must differ from input columns %d",
	     index_ddy,
	     index_dy);

  class_test(n_lines<2,
	     errmsg,
	     "no possible derivation with less than two lines");

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

    h = x_array[i+1] - x_array[i];
    if (h == 0) {
      class_sprintf(errmsg,"%s(L:%d) h=0, stop to avoid division by zero",__func__,__LINE__);
      return _FAILURE_;
    }

    array[i*n_columns+index_dy] =
      (array[(i+1)*n_columns+index_y] - array[i*n_columns+index_y])/h
      - h / 6. * (array[(i+1)*n_columns+index_ddy] + 2. * array[i*n_columns+index_ddy]);

  }

  h = x_array[n_lines-1] - x_array[n_lines-2];

  array[(n_lines-1)*n_columns+index_dy] =
    (array[(n_lines-1)*n_columns+index_y] - array[(n_lines-2)*n_columns+index_y])/h
    + h / 6. * (2. * 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
subq $0x1018, %rsp           # imm = 0x1018
movq 0x1058(%rsp), %rbx
cmpl %r8d, %r9d
jne 0x12c5e
leaq 0xdff9d(%rip), %rsi     # 0xf2ba8
leaq 0x810(%rsp), %r14
movq %r14, %rdi
movl %r9d, %edx
movl %r8d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xde458(%rip), %rsi     # 0xf1082
leaq 0xe003b(%rip), %rdx     # 0xf2c6c
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xde3ea(%rip), %rsi     # 0xf1034
leaq 0xe0030(%rip), %rdx     # 0xf2c81
movq %rbx, %rdi
movl $0x78, %ecx
jmp 0x12d14
movl %ecx, %eax
movl 0x1050(%rsp), %ecx
cmpl %ecx, %r9d
jne 0x12cc0
leaq 0xdff35(%rip), %rsi     # 0xf2ba8
leaq 0x810(%rsp), %r14
movq %r14, %rdi
movl %r9d, %edx
xorl %eax, %eax
callq 0x30c2c
leaq 0xde3f3(%rip), %rsi     # 0xf1082
leaq 0xe0012(%rip), %rdx     # 0xf2ca8
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xde385(%rip), %rsi     # 0xf1034
leaq 0xdffcb(%rip), %rdx     # 0xf2c81
movq %rbx, %rdi
movl $0x7e, %ecx
jmp 0x12d14
cmpl $0x2, %esi
jge 0x12d35
leaq 0xdff39(%rip), %rsi     # 0xf2c05
leaq 0x810(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0xde39d(%rip), %rsi     # 0xf1082
leaq 0xdff49(%rip), %rdx     # 0xf2c35
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xde32f(%rip), %rsi     # 0xf1034
leaq 0xdff75(%rip), %rdx     # 0xf2c81
movq %rbx, %rdi
movl $0x82, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leal -0x1(%rsi), %r10d
movq %rdx, 0x8(%rsp)
movslq %eax, %rdx
movslq %r8d, %r11
movslq %r9d, %r14
movslq %ecx, %r15
leaq (,%rdx,8), %r12
shlq $0x3, %r14
shlq $0x3, %r11
leaq (%r14,%rdx,8), %r13
leaq (%r11,%rdx,8), %rbp
xorl %ebx, %ebx
xorpd %xmm0, %xmm0
movsd 0xdf8f8(%rip), %xmm1    # 0xf2668
movq 0x8(%rsp), %rdx
movq %rdx, %rcx
movsd 0x8(%rdi,%rbx,8), %xmm2
subsd (%rdi,%rbx,8), %xmm2
ucomisd %xmm0, %xmm2
jne 0x12d8f
jnp 0x12e3c
movsd (%rdx,%rbp), %xmm3
subsd (%rdx,%r11), %xmm3
incq %rbx
divsd %xmm2, %xmm3
movsd (%rdx,%r14), %xmm4
addsd %xmm4, %xmm4
addsd (%rdx,%r13), %xmm4
divsd %xmm1, %xmm2
mulsd %xmm4, %xmm2
addsd %xmm3, %xmm2
movsd %xmm2, (%rdx,%r15,8)
addq %r12, %rdx
cmpq %rbx, %r10
jne 0x12d78
movsd (%rdi,%r10,8), %xmm0
addl $-0x2, %esi
subsd (%rdi,%rsi,8), %xmm0
imull %eax, %r10d
leal (%r10,%r8), %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm1
imull %eax, %esi
addl %esi, %r8d
movslq %r8d, %rax
subsd (%rcx,%rax,8), %xmm1
divsd %xmm0, %xmm1
divsd 0xdf86d(%rip), %xmm0    # 0xf2670
leal (%r10,%r9), %eax
cltq
movsd (%rcx,%rax,8), %xmm2
addl %r9d, %esi
movslq %esi, %rax
addsd %xmm2, %xmm2
addsd (%rcx,%rax,8), %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
addl 0x1050(%rsp), %r10d
movslq %r10d, %rax
movsd %xmm2, (%rcx,%rax,8)
xorl %eax, %eax
jmp 0x12d23
leaq 0xdfdfc(%rip), %r14     # 0xf2c3f
leaq 0xdfe37(%rip), %r15     # 0xf2c81
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
movq %r15, %rcx
movl $0x88, %r8d
xorl %eax, %eax
callq 0x8550
incl %eax
movslq %eax, %rsi
movq 0x1058(%rsp), %rdi
movq %r14, %rdx
movq %r15, %rcx
movl $0x88, %r8d
xorl %eax, %eax
callq 0x8550
jmp 0x12d1e