// File: /workspace/github_c_makefile_star2_O3/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 $0x1008, %rsp           # imm = 0x1008
movq 0x1048(%rsp), %r12
cmpl %r8d, %r9d
jne 0x12dd3
leaq 0xdce36(%rip), %rsi     # 0xefbb8
leaq 0x800(%rsp), %r14
movq %r14, %rdi
movl %r9d, %edx
movl %r9d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0xdb2e1(%rip), %rsi     # 0xee082
leaq 0xdced4(%rip), %rdx     # 0xefc7c
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xdb275(%rip), %rsi     # 0xee034
leaq 0xdcecb(%rip), %rdx     # 0xefc91
movq %r12, %rdi
movl $0x78, %ecx
jmp 0x12e89
movq %rdx, %rbx
movl 0x1040(%rsp), %edx
cmpl %edx, %r9d
jne 0x12e37
leaq 0xdcdcf(%rip), %rsi     # 0xefbb8
leaq 0x800(%rsp), %r14
movq %r14, %rdi
movl %r9d, %edx
movl %r9d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0xdb27a(%rip), %rsi     # 0xee082
leaq 0xdcea9(%rip), %rdx     # 0xefcb8
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xdb20e(%rip), %rsi     # 0xee034
leaq 0xdce64(%rip), %rdx     # 0xefc91
movq %r12, %rdi
movl $0x7e, %ecx
jmp 0x12e89
cmpl $0x2, %esi
jge 0x12eaa
leaq 0xdcdd2(%rip), %rsi     # 0xefc15
leaq 0x800(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0xdb226(%rip), %rsi     # 0xee082
leaq 0xdcde2(%rip), %rdx     # 0xefc45
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0xdb1ba(%rip), %rsi     # 0xee034
leaq 0xdce10(%rip), %rdx     # 0xefc91
movq %r12, %rdi
movl $0x82, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leal -0x1(%rsi), %r10d
movslq %ecx, %rax
movslq %r8d, %r11
movslq %r9d, %r14
movslq %edx, %r15
leaq (,%rax,8), %r12
shlq $0x3, %r14
shlq $0x3, %r11
leaq (%r14,%rax,8), %r13
leaq (%r11,%rax,8), %rbp
xorl %eax, %eax
xorpd %xmm0, %xmm0
movsd 0xdc788(%rip), %xmm1    # 0xef668
movq %rbx, %rdx
movsd 0x8(%rdi,%rax,8), %xmm2
subsd (%rdi,%rax,8), %xmm2
ucomisd %xmm0, %xmm2
jne 0x12efa
jnp 0x12fa6
movsd (%rdx,%rbp), %xmm3
subsd (%rdx,%r11), %xmm3
incq %rax
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 %rax, %r10
jne 0x12ee3
movsd (%rdi,%r10,8), %xmm0
addl $-0x2, %esi
subsd (%rdi,%rsi,8), %xmm0
imull %ecx, %r10d
leal (%r10,%r8), %eax
cltq
movsd (%rbx,%rax,8), %xmm1
imull %ecx, %esi
addl %esi, %r8d
movslq %r8d, %rax
subsd (%rbx,%rax,8), %xmm1
divsd %xmm0, %xmm1
divsd 0xdc703(%rip), %xmm0    # 0xef670
leal (%r10,%r9), %eax
cltq
movsd (%rbx,%rax,8), %xmm2
addl %r9d, %esi
movslq %esi, %rax
addsd %xmm2, %xmm2
addsd (%rbx,%rax,8), %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
addl 0x1040(%rsp), %r10d
movslq %r10d, %rax
movsd %xmm2, (%rbx,%rax,8)
xorl %eax, %eax
jmp 0x12e98
leaq 0xdcca2(%rip), %r14     # 0xefc4f
leaq 0xdccdd(%rip), %r15     # 0xefc91
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 0x1048(%rsp), %rdi
movq %r14, %rdx
movq %r15, %rcx
movl $0x88, %r8d
xorl %eax, %eax
callq 0x8550
jmp 0x12e93