// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/arrays.c
// Function: array_interpolate_two
int array_interpolate_two(
		   double * array_x,
		   int n_columns_x,
		   int index_x,   /** from 0 to (n_columns_x-1) */
		   double * array_y,
		   int n_columns_y,
		   int n_lines,  /** must be the same for array_x and array_y */
		   double x,
		   double * result,
		   int result_size, /** from 1 to n_columns_y */
		   ErrorMsg errmsg) {

  int inf,sup,mid,i;
  double weight;

  inf=0;
  sup=n_lines-1;

  if (array_x[inf*n_columns_x+index_x] < array_x[sup*n_columns_x+index_x]){

    if (x < array_x[inf*n_columns_x+index_x]) {

      class_sprintf(errmsg,"%s(L:%d) : x=%e < x_min=%e",__func__,__LINE__,x,array_x[inf*n_columns_x+index_x]);
      return _FAILURE_;
    }

    if (x > array_x[sup*n_columns_x+index_x]) {
      class_sprintf(errmsg,"%s(L:%d) : x=%e > x_max=%e",__func__,__LINE__,x,array_x[sup*n_columns_x+index_x]);
      return _FAILURE_;
    }

    while (sup-inf > 1) {

      mid=(int)(0.5*(inf+sup));
      if (x < array_x[mid*n_columns_x+index_x]) {sup=mid;}
      else {inf=mid;}

    }

  }

  else {

    if (x < *(array_x+sup*n_columns_x+index_x)) {
      class_sprintf(errmsg,"%s(L:%d) : x=%e < x_min=%e",__func__,__LINE__,x,*(array_x+sup*n_columns_x+index_x));
      return _FAILURE_;
    }

    if (x > *(array_x+inf*n_columns_x+index_x)) {
      class_sprintf(errmsg,"%s(L:%d) : x=%e > x_max=%e",__func__,__LINE__,x,*(array_x+inf*n_columns_x+index_x));
      return _FAILURE_;
    }

    while (sup-inf > 1) {

      mid=(int)(0.5*(inf+sup));
      if (x > *(array_x+mid*n_columns_x+index_x)) {sup=mid;}
      else {inf=mid;}

    }

  }

  weight=(x-*(array_x+inf*n_columns_x+index_x))/(*(array_x+sup*n_columns_x+index_x)-*(array_x+inf*n_columns_x+index_x));

  for (i=0; i<result_size; i++)
    *(result+i) = *(array_y+i*n_lines+inf) * (1.-weight)
      + weight * *(array_y+i*n_lines+sup) ;

  return _SUCCESS_;
}

// Assembly:
subq $0x58, %rsp
movq 0x70(%rsp), %rax
movl 0x68(%rsp), %eax
movq 0x60(%rsp), %rax
movq %rdi, 0x48(%rsp)
movl %esi, 0x44(%rsp)
movl %edx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movl %r8d, 0x34(%rsp)
movl %r9d, 0x30(%rsp)
movsd %xmm0, 0x28(%rsp)
movl $0x0, 0x24(%rsp)
movl 0x30(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x20(%rsp)
movq 0x48(%rsp), %rax
movl 0x24(%rsp), %ecx
imull 0x44(%rsp), %ecx
addl 0x40(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0x48(%rsp), %rax
movl 0x20(%rsp), %ecx
imull 0x44(%rsp), %ecx
addl 0x40(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x28481
movsd 0x28(%rsp), %xmm1
movq 0x48(%rsp), %rax
movl 0x24(%rsp), %ecx
imull 0x44(%rsp), %ecx
addl 0x40(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2834e
jmp 0x282b1
movsd 0x28(%rsp), %xmm0
movq 0x48(%rsp), %rax
movl 0x24(%rsp), %ecx
imull 0x44(%rsp), %ecx
addl 0x40(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
xorl %eax, %eax
movl %eax, %esi
leaq 0x1abe2a(%rip), %rdx    # 0x1d4106
leaq 0x1ac0be(%rip), %rcx    # 0x1d43a1
movl $0xae1, %r8d            # imm = 0xAE1
movq %rsi, %rdi
movb $0x2, %al
callq 0x8540
movl %eax, 0xc(%rsp)
movq 0x70(%rsp), %rdi
movl 0xc(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movsd 0x28(%rsp), %xmm0
movq 0x48(%rsp), %rax
movl 0x24(%rsp), %ecx
imull 0x44(%rsp), %ecx
addl 0x40(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x1abdd9(%rip), %rdx    # 0x1d4106
leaq 0x1ac06d(%rip), %rcx    # 0x1d43a1
movl $0xae1, %r8d            # imm = 0xAE1
movb $0x2, %al
callq 0x8540
movl $0x1, 0x54(%rsp)
jmp 0x287bb
movsd 0x28(%rsp), %xmm0
movq 0x48(%rsp), %rax
movl 0x20(%rsp), %ecx
imull 0x44(%rsp), %ecx
addl 0x40(%rsp), %ecx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x28413
jmp 0x28376
movsd 0x28(%rsp), %xmm0
movq 0x48(%rsp), %rax
movl 0x20(%rsp), %ecx
imull 0x44(%rsp), %ecx
addl 0x40(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
xorl %eax, %eax
movl %eax, %esi
leaq 0x1abd92(%rip), %rdx    # 0x1d4133
leaq 0x1abff9(%rip), %rcx    # 0x1d43a1
movl $0xae6, %r8d            # imm = 0xAE6
movq %rsi, %rdi
movb $0x2, %al
callq 0x8540
movl %eax, 0x8(%rsp)
movq 0x70(%rsp), %rdi
movl 0x8(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movsd 0x28(%rsp), %xmm0
movq 0x48(%rsp), %rax
movl 0x20(%rsp), %ecx
imull 0x44(%rsp), %ecx
addl 0x40(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x1abd41(%rip), %rdx    # 0x1d4133
leaq 0x1abfa8(%rip), %rcx    # 0x1d43a1
movl $0xae6, %r8d            # imm = 0xAE6
movb $0x2, %al
callq 0x8540
movl $0x1, 0x54(%rsp)
jmp 0x287bb
jmp 0x28415
movl 0x20(%rsp), %eax
subl 0x24(%rsp), %eax
cmpl $0x1, %eax
jle 0x2847c
movl 0x24(%rsp), %eax
addl 0x20(%rsp), %eax
cvtsi2sd %eax, %xmm1
movsd 0x1aa852(%rip), %xmm0   # 0x1d2c88
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x1c(%rsp)
movsd 0x28(%rsp), %xmm1
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
imull 0x44(%rsp), %ecx
addl 0x40(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x28472
movl 0x1c(%rsp), %eax
movl %eax, 0x20(%rsp)
jmp 0x2847a
movl 0x1c(%rsp), %eax
movl %eax, 0x24(%rsp)
jmp 0x28415
jmp 0x286ac
movsd 0x28(%rsp), %xmm1
movq 0x48(%rsp), %rax
movl 0x20(%rsp), %ecx
imull 0x44(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x40(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x28562
jmp 0x284b5
movsd 0x28(%rsp), %xmm0
movq 0x48(%rsp), %rax
movl 0x20(%rsp), %ecx
imull 0x44(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x40(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
xorl %eax, %eax
movl %eax, %esi
leaq 0x1abc1e(%rip), %rdx    # 0x1d4106
leaq 0x1abeb2(%rip), %rcx    # 0x1d43a1
movl $0xaf7, %r8d            # imm = 0xAF7
movq %rsi, %rdi
movb $0x2, %al
callq 0x8540
movl %eax, 0x4(%rsp)
movq 0x70(%rsp), %rdi
movl 0x4(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movsd 0x28(%rsp), %xmm0
movq 0x48(%rsp), %rax
movl 0x20(%rsp), %ecx
imull 0x44(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x40(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x1abbc5(%rip), %rdx    # 0x1d4106
leaq 0x1abe59(%rip), %rcx    # 0x1d43a1
movl $0xaf7, %r8d            # imm = 0xAF7
movb $0x2, %al
callq 0x8540
movl $0x1, 0x54(%rsp)
jmp 0x287bb
movsd 0x28(%rsp), %xmm0
movq 0x48(%rsp), %rax
movl 0x24(%rsp), %ecx
imull 0x44(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x40(%rsp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x2863d
jmp 0x28592
movsd 0x28(%rsp), %xmm0
movq 0x48(%rsp), %rax
movl 0x24(%rsp), %ecx
imull 0x44(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x40(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
xorl %eax, %eax
movl %eax, %esi
leaq 0x1abb6e(%rip), %rdx    # 0x1d4133
leaq 0x1abdd5(%rip), %rcx    # 0x1d43a1
movl $0xafc, %r8d            # imm = 0xAFC
movq %rsi, %rdi
movb $0x2, %al
callq 0x8540
movl %eax, (%rsp)
movq 0x70(%rsp), %rdi
movl (%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movsd 0x28(%rsp), %xmm0
movq 0x48(%rsp), %rax
movl 0x24(%rsp), %ecx
imull 0x44(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x40(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x1abb17(%rip), %rdx    # 0x1d4133
leaq 0x1abd7e(%rip), %rcx    # 0x1d43a1
movl $0xafc, %r8d            # imm = 0xAFC
movb $0x2, %al
callq 0x8540
movl $0x1, 0x54(%rsp)
jmp 0x287bb
jmp 0x2863f
movl 0x20(%rsp), %eax
subl 0x24(%rsp), %eax
cmpl $0x1, %eax
jle 0x286aa
movl 0x24(%rsp), %eax
addl 0x20(%rsp), %eax
cvtsi2sd %eax, %xmm1
movsd 0x1aa628(%rip), %xmm0   # 0x1d2c88
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x1c(%rsp)
movsd 0x28(%rsp), %xmm0
movq 0x48(%rsp), %rax
movl 0x1c(%rsp), %ecx
imull 0x44(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x40(%rsp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x286a0
movl 0x1c(%rsp), %eax
movl %eax, 0x20(%rsp)
jmp 0x286a8
movl 0x1c(%rsp), %eax
movl %eax, 0x24(%rsp)
jmp 0x2863f
jmp 0x286ac
movsd 0x28(%rsp), %xmm0
movq 0x48(%rsp), %rax
movl 0x24(%rsp), %ecx
imull 0x44(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x40(%rsp), %rcx
subsd (%rax,%rcx,8), %xmm0
movq 0x48(%rsp), %rax
movl 0x20(%rsp), %ecx
imull 0x44(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x40(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0x48(%rsp), %rax
movl 0x24(%rsp), %ecx
imull 0x44(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x40(%rsp), %rcx
subsd (%rax,%rcx,8), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x68(%rsp), %eax
jge 0x287b3
movq 0x38(%rsp), %rax
movl 0x18(%rsp), %ecx
imull 0x30(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x24(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x1a9aea(%rip), %xmm2   # 0x1d2248
subsd 0x10(%rsp), %xmm2
movsd 0x10(%rsp), %xmm1
movq 0x38(%rsp), %rax
movl 0x18(%rsp), %ecx
imull 0x30(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x20(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x60(%rsp), %rax
movslq 0x18(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x2872a
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)