// File: /workspace/github_c_makefile_star2_O2/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 0x11110
leaq 0xd5ab0(%rip), %rsi     # 0xe6b78
leaq 0x800(%rsp), %r14
movq %r14, %rdi
movl %r9d, %edx
movl %r9d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0xd3f9b(%rip), %rsi     # 0xe5082
leaq 0xd5b4e(%rip), %rdx     # 0xe6c3c
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xd3f2f(%rip), %rsi     # 0xe5034
leaq 0xd5b45(%rip), %rdx     # 0xe6c51
pushq $0x78
jmp 0x1116c
movq %rdx, %rbx
movl 0x1040(%rsp), %edx
cmpl %edx, %r9d
jne 0x1118f
leaq 0xd5a52(%rip), %rsi     # 0xe6b78
leaq 0x800(%rsp), %r14
movq %r14, %rdi
movl %r9d, %edx
movl %r9d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0xd3f3d(%rip), %rsi     # 0xe5082
leaq 0xd5b2c(%rip), %rdx     # 0xe6c78
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xd3ed1(%rip), %rsi     # 0xe5034
leaq 0xd5ae7(%rip), %rdx     # 0xe6c51
pushq $0x7e
popq %rcx
movq %r12, %rdi
movq %r15, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, %esi
jge 0x111e3
leaq 0xd5a3a(%rip), %rsi     # 0xe6bd5
leaq 0x800(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0xd3ece(%rip), %rsi     # 0xe5082
leaq 0xd5a4a(%rip), %rdx     # 0xe6c05
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xd3e62(%rip), %rsi     # 0xe5034
leaq 0xd5a78(%rip), %rdx     # 0xe6c51
movq %r12, %rdi
movl $0x82, %ecx
jmp 0x11170
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 0xd542f(%rip), %xmm1    # 0xe6648
movq %rbx, %rdx
cmpq %rax, %r10
je 0x11271
movsd 0x8(%rdi,%rax,8), %xmm2
subsd (%rdi,%rax,8), %xmm2
ucomisd %xmm0, %xmm2
jne 0x11238
jnp 0x112e1
movsd (%rdx,%rbp), %xmm3
subsd (%rdx,%r11), %xmm3
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
incq %rax
jmp 0x1121c
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 0xd53a8(%rip), %xmm0    # 0xe6650
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 0x1117d
leaq 0xd5927(%rip), %r14     # 0xe6c0f
leaq 0xd5962(%rip), %r15     # 0xe6c51
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
movq %r15, %rcx
movl $0x88, %r8d
xorl %eax, %eax
callq 0x8580
incl %eax
movslq %eax, %rsi
movq 0x1048(%rsp), %rdi
movq %r14, %rdx
movq %r15, %rcx
movl $0x88, %r8d
xorl %eax, %eax
callq 0x8580
jmp 0x1117a