// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/arrays.c
// Function: array_interpolate_two_bis
int array_interpolate_two_bis(
		   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+inf*n_columns_y+i) * (1.-weight)
      + weight * *(array_y+sup*n_columns_y+i) ;

  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 0x28a51
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 0x2891e
jmp 0x28881
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 0x1ab85a(%rip), %rdx    # 0x1d4106
leaq 0x1abb04(%rip), %rcx    # 0x1d43b7
movl $0xb2c, %r8d            # imm = 0xB2C
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 0x1ab809(%rip), %rdx    # 0x1d4106
leaq 0x1abab3(%rip), %rcx    # 0x1d43b7
movl $0xb2c, %r8d            # imm = 0xB2C
movb $0x2, %al
callq 0x8540
movl $0x1, 0x54(%rsp)
jmp 0x28d8b
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 0x289e3
jmp 0x28946
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 0x1ab7c2(%rip), %rdx    # 0x1d4133
leaq 0x1aba3f(%rip), %rcx    # 0x1d43b7
movl $0xb31, %r8d            # imm = 0xB31
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 0x1ab771(%rip), %rdx    # 0x1d4133
leaq 0x1ab9ee(%rip), %rcx    # 0x1d43b7
movl $0xb31, %r8d            # imm = 0xB31
movb $0x2, %al
callq 0x8540
movl $0x1, 0x54(%rsp)
jmp 0x28d8b
jmp 0x289e5
movl 0x20(%rsp), %eax
subl 0x24(%rsp), %eax
cmpl $0x1, %eax
jle 0x28a4c
movl 0x24(%rsp), %eax
addl 0x20(%rsp), %eax
cvtsi2sd %eax, %xmm1
movsd 0x1aa282(%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 0x28a42
movl 0x1c(%rsp), %eax
movl %eax, 0x20(%rsp)
jmp 0x28a4a
movl 0x1c(%rsp), %eax
movl %eax, 0x24(%rsp)
jmp 0x289e5
jmp 0x28c7c
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 0x28b32
jmp 0x28a85
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 0x1ab64e(%rip), %rdx    # 0x1d4106
leaq 0x1ab8f8(%rip), %rcx    # 0x1d43b7
movl $0xb42, %r8d            # imm = 0xB42
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 0x1ab5f5(%rip), %rdx    # 0x1d4106
leaq 0x1ab89f(%rip), %rcx    # 0x1d43b7
movl $0xb42, %r8d            # imm = 0xB42
movb $0x2, %al
callq 0x8540
movl $0x1, 0x54(%rsp)
jmp 0x28d8b
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 0x28c0d
jmp 0x28b62
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 0x1ab59e(%rip), %rdx    # 0x1d4133
leaq 0x1ab81b(%rip), %rcx    # 0x1d43b7
movl $0xb47, %r8d            # imm = 0xB47
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 0x1ab547(%rip), %rdx    # 0x1d4133
leaq 0x1ab7c4(%rip), %rcx    # 0x1d43b7
movl $0xb47, %r8d            # imm = 0xB47
movb $0x2, %al
callq 0x8540
movl $0x1, 0x54(%rsp)
jmp 0x28d8b
jmp 0x28c0f
movl 0x20(%rsp), %eax
subl 0x24(%rsp), %eax
cmpl $0x1, %eax
jle 0x28c7a
movl 0x24(%rsp), %eax
addl 0x20(%rsp), %eax
cvtsi2sd %eax, %xmm1
movsd 0x1aa058(%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 0x28c70
movl 0x1c(%rsp), %eax
movl %eax, 0x20(%rsp)
jmp 0x28c78
movl 0x1c(%rsp), %eax
movl %eax, 0x24(%rsp)
jmp 0x28c0f
jmp 0x28c7c
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 0x28d83
movq 0x38(%rsp), %rax
movl 0x24(%rsp), %ecx
imull 0x34(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x18(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x1a951a(%rip), %xmm2   # 0x1d2248
subsd 0x10(%rsp), %xmm2
movsd 0x10(%rsp), %xmm1
movq 0x38(%rsp), %rax
movl 0x20(%rsp), %ecx
imull 0x34(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x18(%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 0x28cfa
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)