#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int fabs(double);
int /*<<< orphan*/ gslpolyfit(double *, double *, int, int, double *);
int indexx(double, float *, int);
double interpxy(double, float *, float *, int);
int /*<<< orphan*/ willus_mem_alloc_warn(void **, int, char *, int);
int /*<<< orphan*/ willus_mem_free(double **, char *);
double interp_high_order_dxf(double x0, float *x, float *y, int n, int order,
                             double dx) {
  int i0, i1, j, nlocal;
  double c[16];
  double xx, y0;
  void *ptr;
  double *x1, *y1;
  static char *funcname = "interp_high_order_dxf";
  if (order > 15)
    order = 15;
  dx = fabs(dx) / 2.;
  if (x0 < x[0])
    x0 = x[0];
  else if (x0 > x[n - 1])
    x0 = x[n - 1];
  i0 = indexx(x0, x, n);
  if (i0 < 0)
    return (y[0]);
  if (i0 >= n - 1)
    return (y[n - 1]);
  for (i1 = i0; i0 >= 0 && x[i0] + dx >= x0; i0--)
    ;
  i0++;
  for (; i1 < n && x[i1] - dx <= x0; i1++)
    ;
  i1--;
  nlocal = (i1 - i0) + 1;
  if (nlocal < 2)
    return (interpxy(x0, x, y, n));
  if (nlocal < order + 1)
    order = nlocal - 1;
  willus_mem_alloc_warn(&ptr, sizeof(double) * 2 * nlocal, funcname, 10);
  x1 = (double *)ptr;
  y1 = &x1[nlocal];
  for (j = 0; j < nlocal; j++) {
    x1[j] = x[j + i0];
    y1[j] = y[j + i0];
  }
  gslpolyfit(x1, y1, nlocal, order, c);
  willus_mem_free(&x1, funcname);
  for (y0 = 0., xx = 1., j = 0; j <= order; y0 += xx * c[j], xx *= x0, j++)
    ;
  return (y0);
}


x86 assembly (clang, -O0):
<interp_high_order_dxf>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    %ecx,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
cmpl   $0xf,-0x28(%rbp)
jle    1194 <interp_high_order_dxf+0x34>
movl   $0xf,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1070 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe56(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    11e4 <interp_high_order_dxf+0x84>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1229 <interp_high_order_dxf+0xc9>
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1224 <interp_high_order_dxf+0xc4>
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1229 <interp_high_order_dxf+0xc9>
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1060 <indexx@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    125d <interp_high_order_dxf+0xfd>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    152c <interp_high_order_dxf+0x3cc>
mov    -0x34(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jl     128e <interp_high_order_dxf+0x12e>
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    152c <interp_high_order_dxf+0x3cc>
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x34(%rbp)
mov    %al,-0xe9(%rbp)
jl     12ca <interp_high_order_dxf+0x16a>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x30(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0xe9(%rbp)
mov    -0xe9(%rbp),%al
test   $0x1,%al
jne    12dd <interp_high_order_dxf+0x17d>
jmp    12f0 <interp_high_order_dxf+0x190>
jmp    12e2 <interp_high_order_dxf+0x182>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    1294 <interp_high_order_dxf+0x134>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%ecx
xor    %eax,%eax
cmp    -0x24(%rbp),%ecx
mov    %al,-0xea(%rbp)
jge    1335 <interp_high_order_dxf+0x1d5>
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm1
subsd  -0x30(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0xea(%rbp)
mov    -0xea(%rbp),%al
test   $0x1,%al
jne    1348 <interp_high_order_dxf+0x1e8>
jmp    135b <interp_high_order_dxf+0x1fb>
jmp    134d <interp_high_order_dxf+0x1ed>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    12f9 <interp_high_order_dxf+0x199>
mov    -0x38(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
sub    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x2,-0x40(%rbp)
jge    1399 <interp_high_order_dxf+0x239>
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1050 <interpxy@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    152c <interp_high_order_dxf+0x3cc>
mov    -0x40(%rbp),%eax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    13b3 <interp_high_order_dxf+0x253>
mov    -0x40(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
movslq -0x40(%rbp),%rax
shl    $0x4,%rax
mov    %eax,%esi
mov    0x2c8c(%rip),%rdx
lea    -0xd8(%rbp),%rdi
mov    $0xa,%ecx
call   1030 <willus_mem_alloc_warn@plt>
mov    -0xd8(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0xe0(%rbp),%rax
movslq -0x40(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xe8(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1469 <interp_high_order_dxf+0x309>
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0xe0(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0xe8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1403 <interp_high_order_dxf+0x2a3>
mov    -0xe0(%rbp),%rdi
mov    -0xe8(%rbp),%rsi
mov    -0x40(%rbp),%edx
mov    -0x28(%rbp),%ecx
lea    -0xc0(%rbp),%r8
call   1040 <gslpolyfit@plt>
mov    0x2bc0(%rip),%rsi
lea    -0xe0(%rbp),%rdi
call   1080 <willus_mem_free@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  0xb59(%rip),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jg     151f <interp_high_order_dxf+0x3bf>
jmp    14cf <interp_high_order_dxf+0x36f>
movsd  -0xc8(%rbp),%xmm0
ff
movslq -0x3c(%rbp),%rax
movsd  -0xc0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0xd0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
mulsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    14be <interp_high_order_dxf+0x35e>
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp_high_order_dxf>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %edx,%ebx
mov    %rsi,%r15
mov    %rdi,%r14
movsd  %xmm0,(%rsp)
cmp    $0xf,%ecx
mov    $0xf,%ebp
cmovl  %ecx,%ebp
movaps %xmm1,%xmm0
call   1070 <fabs@plt>
movsd  (%rsp),%xmm2
mov    %eax,%r13d
movss  (%r14),%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd %xmm2,%xmm0
ja     11c6 <interp_high_order_dxf+0x66>
movslq %ebx,%rax
movss  -0x4(%r14,%rax,4),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
ucomisd %xmm1,%xmm2
movapd %xmm2,%xmm0
jbe    11c6 <interp_high_order_dxf+0x66>
movaps %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
call   1060 <indexx@plt>
test   %eax,%eax
js     12c6 <interp_high_order_dxf+0x166>
mov    %eax,%r12d
lea    -0x1(%rbx),%eax
cmp    %eax,%r12d
jge    12cd <interp_high_order_dxf+0x16d>
mov    %ebp,%ecx
xorps  %xmm2,%xmm2
cvtsi2sd %r13d,%xmm2
mulsd  0xe02(%rip),%xmm2
mov    %r12d,%ebp
movsd  (%rsp),%xmm0
cs nopw 0x0(%rax,%rax,1)
movss  (%r14,%rbp,4),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm2,%xmm1
ucomisd %xmm0,%xmm1
jb     1235 <interp_high_order_dxf+0xd5>
lea    -0x1(%rbp),%rax
test   %rbp,%rbp
mov    %rax,%rbp
jg     1210 <interp_high_order_dxf+0xb0>
mov    $0xffffffff,%ebp
cmp    %ebx,%r12d
jge    1272 <interp_high_order_dxf+0x112>
movslq %r12d,%rax
lea    (%r14,%rax,4),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     1272 <interp_high_order_dxf+0x112>
add    $0x1,%r12d
add    $0x4,%rax
cmp    %r12d,%ebx
jne    1250 <interp_high_order_dxf+0xf0>
mov    %ebx,%r12d
sub    %ebp,%r12d
lea    -0x2(%r12),%eax
test   %eax,%eax
jle    12eb <interp_high_order_dxf+0x18b>
add    $0xffffffff,%r12d
cmp    %ecx,%eax
cmovl  %eax,%ecx
mov    %ecx,0xc(%rsp)
mov    %r12d,%r13d
mov    %r12d,%esi
shl    $0x4,%esi
lea    0xd75(%rip),%rdx
lea    0x18(%rsp),%rdi
mov    $0xa,%ecx
call   1030 <willus_mem_alloc_warn@plt>
mov    0x18(%rsp),%rdi
mov    %rdi,0x10(%rsp)
lea    (%rdi,%r13,8),%rsi
cmp    $0x4,%r12d
jae    1309 <interp_high_order_dxf+0x1a9>
xor    %r8d,%r8d
jmp    1382 <interp_high_order_dxf+0x222>
movss  (%r15),%xmm0
jmp    12d5 <interp_high_order_dxf+0x175>
cltq
movss  (%r15,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <interpxy@plt>
lea    -0x1(%r13),%rdx
lea    0x1(%rbp),%ecx
lea    (%rdx,%rbp,1),%ebx
add    $0x1,%ebx
xor    %r8d,%r8d
cmp    %ecx,%ebx
jl     1382 <interp_high_order_dxf+0x222>
shr    $0x20,%rdx
jne    1382 <interp_high_order_dxf+0x222>
mov    %r13d,%r8d
and    $0xfffffffc,%r8d
lea    0x10(%rdi),%rdx
mov    %r8,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq %ecx,%rcx
cvtps2pd (%r14,%rcx,4),%xmm0
cvtps2pd 0x8(%r14,%rcx,4),%xmm1
movups %xmm0,-0x10(%rdx)
movups %xmm1,(%rdx)
cvtps2pd (%r15,%rcx,4),%xmm0
cvtps2pd 0x8(%r15,%rcx,4),%xmm1
movupd %xmm0,-0x10(%rdx,%r13,8)
movups %xmm1,(%rdx,%r13,8)
add    $0x4,%ecx
add    $0x20,%rdx
add    $0xfffffffffffffffc,%rbx
jne    1340 <interp_high_order_dxf+0x1e0>
cmp    %r13,%r8
je     1430 <interp_high_order_dxf+0x2d0>
mov    %r8,%rcx
not    %rcx
test   $0x1,%r13b
je     13be <interp_high_order_dxf+0x25e>
mov    %r8,%rdx
or     $0x1,%rdx
lea    (%rdx,%rbp,1),%ebx
movslq %ebx,%rbx
movss  (%r14,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rdi,%r8,8)
movss  (%r15,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rsi,%r8,8)
mov    %rdx,%r8
add    %r13,%rcx
je     1430 <interp_high_order_dxf+0x2d0>
mov    %ebp,%ecx
lea    (%rdi,%r13,8),%rdx
add    $0x8,%rdx
nopl   (%rax)
lea    (%rcx,%r8,1),%ebp
add    $0x1,%ebp
movslq %ebp,%rbp
movss  (%r14,%rbp,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rdi,%r8,8)
movss  (%r15,%rbp,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x8(%rdx,%r8,8)
lea    0x2(%rcx,%r8,1),%ebp
movslq %ebp,%rbp
movss  (%r14,%rbp,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%rdi,%r8,8)
movss  (%r15,%rbp,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rdx,%r8,8)
lea    0x2(%r8),%rax
mov    %rax,%r8
cmp    %rax,%r13
jne    13d0 <interp_high_order_dxf+0x270>
lea    0x20(%rsp),%r8
mov    %r12d,%edx
mov    0xc(%rsp),%ebx
mov    %ebx,%ecx
call   1040 <gslpolyfit@plt>
lea    0xbc6(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1080 <willus_mem_free@plt>
test   %ebx,%ebx
js     147d <interp_high_order_dxf+0x31d>
mov    %ebx,%ecx
add    $0x1,%rcx
mov    %ecx,%eax
and    $0x3,%eax
cmp    $0x3,%ebx
jae    1486 <interp_high_order_dxf+0x326>
movsd  0xb98(%rip),%xmm1
xorpd  %xmm0,%xmm0
xor    %edx,%edx
movsd  (%rsp),%xmm4
jmp    14f1 <interp_high_order_dxf+0x391>
xorpd  %xmm0,%xmm0
jmp    12d9 <interp_high_order_dxf+0x179>
and    $0xfffffffc,%ecx
movsd  0xb77(%rip),%xmm1
xorpd  %xmm0,%xmm0
xor    %edx,%edx
movsd  (%rsp),%xmm4
nopl   0x0(%rax)
movapd %xmm4,%xmm2
mulsd  %xmm1,%xmm2
mulsd  0x20(%rsp,%rdx,8),%xmm1
movapd %xmm4,%xmm3
mulsd  %xmm2,%xmm3
mulsd  0x28(%rsp,%rdx,8),%xmm2
addsd  %xmm0,%xmm1
movapd %xmm4,%xmm0
mulsd  %xmm3,%xmm0
mulsd  0x30(%rsp,%rdx,8),%xmm3
addsd  %xmm1,%xmm2
movapd %xmm4,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x38(%rsp,%rdx,8),%xmm0
addsd  %xmm2,%xmm3
addsd  %xmm3,%xmm0
add    $0x4,%rdx
cmp    %rdx,%rcx
jne    14a0 <interp_high_order_dxf+0x340>
test   %rax,%rax
je     12d9 <interp_high_order_dxf+0x179>
lea    (%rsp,%rdx,8),%rcx
add    $0x20,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movapd %xmm4,%xmm2
mulsd  %xmm1,%xmm2
mulsd  (%rcx,%rdx,8),%xmm1
addsd  %xmm1,%xmm0
add    $0x1,%rdx
movapd %xmm2,%xmm1
cmp    %rdx,%rax
jne    1510 <interp_high_order_dxf+0x3b0>
jmp    12d9 <interp_high_order_dxf+0x179>

LLVM IR (-O0):
@interp_high_order_dxf.funcname = internal global i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i32 0, i32 0)
@.str = [22 x i8] c"interp_high_order_dxf\00"
define double @interp_high_order_dxf(double %0, float* %1, float* %2, i32 %3, i32 %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca [16 x double]
%19 = alloca double
%20 = alloca double
%21 = alloca i8*
%22 = alloca double*
%23 = alloca double*
store double %0, double* %8
store float* %1, float** %9
store float* %2, float** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store double %5, double* %13
%24 = load i32, i32* %12
%25 = icmp sgt i32 %24, 15
br i1 %25, label %26, label %27
26: ; preds = %6
store i32 15, i32* %12
br label %27
27: ; preds = %26, %6
%28 = load double, double* %13
%29 = call i32 @fabs(double %28)
%30 = sitofp i32 %29 to double
%31 = fdiv double %30, 2.000000e+00
store double %31, double* %13
%32 = load double, double* %8
%33 = load float*, float** %9
%34 = getelementptr inbounds float, float* %33, i64 0
%35 = load float, float* %34
%36 = fpext float %35 to double
%37 = fcmp olt double %32, %36
br i1 %37, label %38, label %43
38: ; preds = %27
%39 = load float*, float** %9
%40 = getelementptr inbounds float, float* %39, i64 0
%41 = load float, float* %40
%42 = fpext float %41 to double
store double %42, double* %8
br label %62
43: ; preds = %27
%44 = load double, double* %8
%45 = load float*, float** %9
%46 = load i32, i32* %11
%47 = sub nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds float, float* %45, i64 %48
%50 = load float, float* %49
%51 = fpext float %50 to double
%52 = fcmp ogt double %44, %51
br i1 %52, label %53, label %61
53: ; preds = %43
%54 = load float*, float** %9
%55 = load i32, i32* %11
%56 = sub nsw i32 %55, 1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds float, float* %54, i64 %57
%59 = load float, float* %58
%60 = fpext float %59 to double
store double %60, double* %8
br label %61
61: ; preds = %53, %43
br label %62
62: ; preds = %61, %38
%63 = load double, double* %8
%64 = load float*, float** %9
%65 = load i32, i32* %11
%66 = call i32 @indexx(double %63, float* %64, i32 %65)
store i32 %66, i32* %14
%67 = load i32, i32* %14
%68 = icmp slt i32 %67, 0
br i1 %68, label %69, label %74
69: ; preds = %62
%70 = load float*, float** %10
%71 = getelementptr inbounds float, float* %70, i64 0
%72 = load float, float* %71
%73 = fpext float %72 to double
store double %73, double* %7
br label %230
74: ; preds = %62
%75 = load i32, i32* %14
%76 = load i32, i32* %11
%77 = sub nsw i32 %76, 1
%78 = icmp sge i32 %75, %77
br i1 %78, label %79, label %87
79: ; preds = %74
%80 = load float*, float** %10
%81 = load i32, i32* %11
%82 = sub nsw i32 %81, 1
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds float, float* %80, i64 %83
%85 = load float, float* %84
%86 = fpext float %85 to double
store double %86, double* %7
br label %230
87: ; preds = %74
%88 = load i32, i32* %14
store i32 %88, i32* %15
br label %89
89: ; preds = %106, %87
%90 = load i32, i32* %14
%91 = icmp sge i32 %90, 0
br i1 %91, label %92, label %103
92: ; preds = %89
%93 = load float*, float** %9
%94 = load i32, i32* %14
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds float, float* %93, i64 %95
%97 = load float, float* %96
%98 = fpext float %97 to double
%99 = load double, double* %13
%100 = fadd double %98, %99
%101 = load double, double* %8
%102 = fcmp oge double %100, %101
br label %103
103: ; preds = %92, %89
%104 = phi i1 [ false, %89 ], [ %102, %92 ]
br i1 %104, label %105, label %109
105: ; preds = %103
br label %106
106: ; preds = %105
%107 = load i32, i32* %14
%108 = add nsw i32 %107, -1
store i32 %108, i32* %14
br label %89
109: ; preds = %103
%110 = load i32, i32* %14
%111 = add nsw i32 %110, 1
store i32 %111, i32* %14
br label %112
112: ; preds = %130, %109
%113 = load i32, i32* %15
%114 = load i32, i32* %11
%115 = icmp slt i32 %113, %114
br i1 %115, label %116, label %127
116: ; preds = %112
%117 = load float*, float** %9
%118 = load i32, i32* %15
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds float, float* %117, i64 %119
%121 = load float, float* %120
%122 = fpext float %121 to double
%123 = load double, double* %13
%124 = fsub double %122, %123
%125 = load double, double* %8
%126 = fcmp ole double %124, %125
br label %127
127: ; preds = %116, %112
%128 = phi i1 [ false, %112 ], [ %126, %116 ]
br i1 %128, label %129, label %133
129: ; preds = %127
br label %130
130: ; preds = %129
%131 = load i32, i32* %15
%132 = add nsw i32 %131, 1
store i32 %132, i32* %15
br label %112
133: ; preds = %127
%134 = load i32, i32* %15
%135 = add nsw i32 %134, -1
store i32 %135, i32* %15
%136 = load i32, i32* %15
%137 = load i32, i32* %14
%138 = sub nsw i32 %136, %137
%139 = add nsw i32 %138, 1
store i32 %139, i32* %17
%140 = load i32, i32* %17
%141 = icmp slt i32 %140, 2
br i1 %141, label %142, label %148
142: ; preds = %133
%143 = load double, double* %8
%144 = load float*, float** %9
%145 = load float*, float** %10
%146 = load i32, i32* %11
%147 = call double @interpxy(double %143, float* %144, float* %145, i32 %146)
store double %147, double* %7
br label %230
148: ; preds = %133
%149 = load i32, i32* %17
%150 = load i32, i32* %12
%151 = add nsw i32 %150, 1
%152 = icmp slt i32 %149, %151
br i1 %152, label %153, label %156
153: ; preds = %148
%154 = load i32, i32* %17
%155 = sub nsw i32 %154, 1
store i32 %155, i32* %12
br label %156
156: ; preds = %153, %148
%157 = load i32, i32* %17
%158 = sext i32 %157 to i64
%159 = mul i64 16, %158
%160 = trunc i64 %159 to i32
%161 = load i8*, i8** @interp_high_order_dxf.funcname
%162 = call i32 @willus_mem_alloc_warn(i8** %21, i32 %160, i8* %161, i32 10)
%163 = load i8*, i8** %21
%164 = bitcast i8* %163 to double*
store double* %164, double** %22
%165 = load double*, double** %22
%166 = load i32, i32* %17
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds double, double* %165, i64 %167
store double* %168, double** %23
store i32 0, i32* %16
br label %169
169: ; preds = %198, %156
%170 = load i32, i32* %16
%171 = load i32, i32* %17
%172 = icmp slt i32 %170, %171
br i1 %172, label %173, label %201
173: ; preds = %169
%174 = load float*, float** %9
%175 = load i32, i32* %16
%176 = load i32, i32* %14
%177 = add nsw i32 %175, %176
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds float, float* %174, i64 %178
%180 = load float, float* %179
%181 = fpext float %180 to double
%182 = load double*, double** %22
%183 = load i32, i32* %16
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %182, i64 %184
store double %181, double* %185
%186 = load float*, float** %10
%187 = load i32, i32* %16
%188 = load i32, i32* %14
%189 = add nsw i32 %187, %188
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds float, float* %186, i64 %190
%192 = load float, float* %191
%193 = fpext float %192 to double
%194 = load double*, double** %23
%195 = load i32, i32* %16
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds double, double* %194, i64 %196
store double %193, double* %197
br label %198
198: ; preds = %173
%199 = load i32, i32* %16
%200 = add nsw i32 %199, 1
store i32 %200, i32* %16
br label %169
201: ; preds = %169
%202 = load double*, double** %22
%203 = load double*, double** %23
%204 = load i32, i32* %17
%205 = load i32, i32* %12
%206 = getelementptr inbounds [16 x double], [16 x double]* %18, i64 0, i64 0
%207 = call i32 @gslpolyfit(double* %202, double* %203, i32 %204, i32 %205, double* %206)
%208 = load i8*, i8** @interp_high_order_dxf.funcname
%209 = call i32 @willus_mem_free(double** %22, i8* %208)
store double 0.000000e+00, double* %20
store double 1.000000e+00, double* %19
store i32 0, i32* %16
br label %210
210: ; preds = %215, %201
%211 = load i32, i32* %16
%212 = load i32, i32* %12
%213 = icmp sle i32 %211, %212
br i1 %213, label %214, label %228
214: ; preds = %210
br label %215
215: ; preds = %214
%216 = load double, double* %19
%217 = load i32, i32* %16
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds [16 x double], [16 x double]* %18, i64 0, i64 %218
%220 = load double, double* %219
%221 = load double, double* %20
%222 = call double @llvm.fmuladd.f64(double %216, double %220, double %221)
store double %222, double* %20
%223 = load double, double* %8
%224 = load double, double* %19
%225 = fmul double %224, %223
store double %225, double* %19
%226 = load i32, i32* %16
%227 = add nsw i32 %226, 1
store i32 %227, i32* %16
br label %210
228: ; preds = %210
%229 = load double, double* %20
store double %229, double* %7
br label %230
230: ; preds = %228, %142, %79, %69
%231 = load double, double* %7
ret double %231
}

LLVM IR (-O2):
@.str = [22 x i8] c"interp_high_order_dxf\00"
define double @interp_high_order_dxf(double %0, float* %1, float* %2, i32 %3, i32 %4, double %5) {
%7 = alloca [16 x double]
%8 = alloca i8*
%9 = alloca double*
%10 = bitcast [16 x double]* %7 to i8*
%11 = bitcast i8** %8 to i8*
%12 = bitcast double** %9 to i8*
%13 = icmp slt i32 %4, 15
%14 = select i1 %13, i32 %4, i32 15
%15 = tail call i32 @fabs(double %5)
%16 = sitofp i32 %15 to double
%17 = fmul double %16, 5.000000e-01
%18 = load float, float* %1
%19 = fpext float %18 to double
%20 = fcmp ogt double %19, %0
br i1 %20, label %29, label %21
21: ; preds = %6
%22 = add nsw i32 %3, -1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds float, float* %1, i64 %23
%25 = load float, float* %24
%26 = fpext float %25 to double
%27 = fcmp olt double %26, %0
br i1 %27, label %28, label %29
28: ; preds = %21
br label %29
29: ; preds = %6, %21, %28
%30 = phi double [ %26, %28 ], [ %0, %21 ], [ %19, %6 ]
%31 = tail call i32 @indexx(double %30, float* %1, i32 %3)
%32 = icmp slt i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %29
%34 = load float, float* %2
%35 = fpext float %34 to double
br label %245
36: ; preds = %29
%37 = add nsw i32 %3, -1
%38 = icmp slt i32 %31, %37
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = zext i32 %31 to i64
br label %46
41: ; preds = %36
%42 = sext i32 %37 to i64
%43 = getelementptr inbounds float, float* %2, i64 %42
%44 = load float, float* %43
%45 = fpext float %44 to double
br label %245
46: ; preds = %39, %53
%47 = phi i64 [ %40, %39 ], [ %54, %53 ]
%48 = getelementptr inbounds float, float* %1, i64 %47
%49 = load float, float* %48
%50 = fpext float %49 to double
%51 = fadd double %17, %50
%52 = fcmp ult double %51, %30
br i1 %52, label %56, label %53
53: ; preds = %46
%54 = add nsw i64 %47, -1
%55 = icmp sgt i64 %47, 0
br i1 %55, label %46, label %58
56: ; preds = %46
%57 = trunc i64 %47 to i32
br label %58
58: ; preds = %53, %56
%59 = phi i32 [ %57, %56 ], [ -1, %53 ]
%60 = icmp slt i32 %31, %3
br i1 %60, label %61, label %76
61: ; preds = %58
%62 = sext i32 %31 to i64
br label %63
63: ; preds = %61, %70
%64 = phi i64 [ %62, %61 ], [ %71, %70 ]
%65 = getelementptr inbounds float, float* %1, i64 %64
%66 = load float, float* %65
%67 = fpext float %66 to double
%68 = fsub double %67, %17
%69 = fcmp ugt double %68, %30
br i1 %69, label %74, label %70
70: ; preds = %63
%71 = add nsw i64 %64, 1
%72 = trunc i64 %71 to i32
%73 = icmp eq i32 %72, %3
br i1 %73, label %76, label %63
74: ; preds = %63
%75 = trunc i64 %64 to i32
br label %76
76: ; preds = %70, %74, %58
%77 = phi i32 [ %31, %58 ], [ %75, %74 ], [ %3, %70 ]
%78 = sub i32 -2, %59
%79 = add i32 %77, %78
%80 = add i32 %79, 1
%81 = icmp slt i32 %79, 1
br i1 %81, label %82, label %84
82: ; preds = %76
%83 = tail call double @interpxy(double %30, float* %1, float* %2, i32 %3)
br label %245
84: ; preds = %76
%85 = icmp slt i32 %79, %14
%86 = select i1 %85, i32 %79, i32 %14
%87 = zext i32 %80 to i64
%88 = shl i32 %80, 4
%89 = call i32 @willus_mem_alloc_warn(i8** %8, i32 %88, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 10)
%90 = bitcast i8** %8 to double**
%91 = load double*, double** %90
store double* %91, double** %9
%92 = getelementptr inbounds double, double* %91, i64 %87
%93 = icmp ult i32 %80, 4
br i1 %93, label %138, label %94
94: ; preds = %84
%95 = add nsw i64 %87, -1
%96 = add i32 %59, 1
%97 = trunc i64 %95 to i32
%98 = add i32 %96, %97
%99 = icmp slt i32 %98, %96
%100 = icmp ugt i64 %95, 4294967295
%101 = or i1 %99, %100
br i1 %101, label %138, label %102
102: ; preds = %94
%103 = and i64 %87, 4294967292
br label %104
104: ; preds = %104, %102
%105 = phi i64 [ 0, %102 ], [ %134, %104 ]
%106 = trunc i64 %105 to i32
%107 = or i32 %106, 1
%108 = add i32 %59, %107
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds float, float* %1, i64 %109
%111 = bitcast float* %110 to <2 x float>*
%112 = load <2 x float>, <2 x float>* %111
%113 = getelementptr inbounds float, float* %110, i64 2
%114 = bitcast float* %113 to <2 x float>*
%115 = load <2 x float>, <2 x float>* %114
%116 = fpext <2 x float> %112 to <2 x double>
%117 = fpext <2 x float> %115 to <2 x double>
%118 = getelementptr inbounds double, double* %91, i64 %105
%119 = bitcast double* %118 to <2 x double>*
store <2 x double> %116, <2 x double>* %119
%120 = getelementptr inbounds double, double* %118, i64 2
%121 = bitcast double* %120 to <2 x double>*
store <2 x double> %117, <2 x double>* %121
%122 = getelementptr inbounds float, float* %2, i64 %109
%123 = bitcast float* %122 to <2 x float>*
%124 = load <2 x float>, <2 x float>* %123
%125 = getelementptr inbounds float, float* %122, i64 2
%126 = bitcast float* %125 to <2 x float>*
%127 = load <2 x float>, <2 x float>* %126
%128 = fpext <2 x float> %124 to <2 x double>
%129 = fpext <2 x float> %127 to <2 x double>
%130 = getelementptr inbounds double, double* %92, i64 %105
%131 = bitcast double* %130 to <2 x double>*
store <2 x double> %128, <2 x double>* %131
%132 = getelementptr inbounds double, double* %130, i64 2
%133 = bitcast double* %132 to <2 x double>*
store <2 x double> %129, <2 x double>* %133
%134 = add nuw i64 %105, 4
%135 = icmp eq i64 %134, %103
br i1 %135, label %136, label %104
136: ; preds = %104
%137 = icmp eq i64 %103, %87
br i1 %137, label %187, label %138
138: ; preds = %94, %84, %136
%139 = phi i64 [ 0, %94 ], [ 0, %84 ], [ %103, %136 ]
%140 = xor i64 %139, -1
%141 = and i64 %87, 1
%142 = icmp eq i64 %141, 0
br i1 %142, label %156, label %143
143: ; preds = %138
%144 = or i64 %139, 1
%145 = trunc i64 %144 to i32
%146 = add i32 %59, %145
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds float, float* %1, i64 %147
%149 = load float, float* %148
%150 = fpext float %149 to double
%151 = getelementptr inbounds double, double* %91, i64 %139
store double %150, double* %151
%152 = getelementptr inbounds float, float* %2, i64 %147
%153 = load float, float* %152
%154 = fpext float %153 to double
%155 = getelementptr inbounds double, double* %92, i64 %139
store double %154, double* %155
br label %156
156: ; preds = %143, %138
%157 = phi i64 [ %139, %138 ], [ %144, %143 ]
%158 = sub nsw i64 0, %87
%159 = icmp eq i64 %140, %158
br i1 %159, label %187, label %160
160: ; preds = %156, %160
%161 = phi i64 [ %174, %160 ], [ %157, %156 ]
%162 = add nuw nsw i64 %161, 1
%163 = trunc i64 %162 to i32
%164 = add i32 %59, %163
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds float, float* %1, i64 %165
%167 = load float, float* %166
%168 = fpext float %167 to double
%169 = getelementptr inbounds double, double* %91, i64 %161
store double %168, double* %169
%170 = getelementptr inbounds float, float* %2, i64 %165
%171 = load float, float* %170
%172 = fpext float %171 to double
%173 = getelementptr inbounds double, double* %92, i64 %161
store double %172, double* %173
%174 = add nuw nsw i64 %161, 2
%175 = trunc i64 %174 to i32
%176 = add i32 %59, %175
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds float, float* %1, i64 %177
%179 = load float, float* %178
%180 = fpext float %179 to double
%181 = getelementptr inbounds double, double* %91, i64 %162
store double %180, double* %181
%182 = getelementptr inbounds float, float* %2, i64 %177
%183 = load float, float* %182
%184 = fpext float %183 to double
%185 = getelementptr inbounds double, double* %92, i64 %162
store double %184, double* %185
%186 = icmp eq i64 %174, %87
br i1 %186, label %187, label %160
187: ; preds = %156, %160, %136
%188 = getelementptr inbounds [16 x double], [16 x double]* %7, i64 0, i64 0
%189 = call i32 @gslpolyfit(double* %91, double* %92, i32 %80, i32 %86, double* %188)
%190 = call i32 @willus_mem_free(double** %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%191 = icmp slt i32 %86, 0
br i1 %191, label %245, label %192
192: ; preds = %187
%193 = add nuw nsw i32 %86, 1
%194 = zext i32 %193 to i64
%195 = add nsw i64 %194, -1
%196 = and i64 %194, 3
%197 = icmp ult i64 %195, 3
br i1 %197, label %227, label %198
198: ; preds = %192
%199 = and i64 %194, 4294967292
br label %200
200: ; preds = %200, %198
%201 = phi i64 [ 0, %198 ], [ %224, %200 ]
%202 = phi double [ 0.000000e+00, %198 ], [ %222, %200 ]
%203 = phi double [ 1.000000e+00, %198 ], [ %223, %200 ]
%204 = phi i64 [ 0, %198 ], [ %225, %200 ]
%205 = getelementptr inbounds [16 x double], [16 x double]* %7, i64 0, i64 %201
%206 = load double, double* %205
%207 = call double @llvm.fmuladd.f64(double %203, double %206, double %202)
%208 = fmul double %30, %203
%209 = or i64 %201, 1
%210 = getelementptr inbounds [16 x double], [16 x double]* %7, i64 0, i64 %209
%211 = load double, double* %210
%212 = call double @llvm.fmuladd.f64(double %208, double %211, double %207)
%213 = fmul double %30, %208
%214 = or i64 %201, 2
%215 = getelementptr inbounds [16 x double], [16 x double]* %7, i64 0, i64 %214
%216 = load double, double* %215
%217 = call double @llvm.fmuladd.f64(double %213, double %216, double %212)
%218 = fmul double %30, %213
%219 = or i64 %201, 3
%220 = getelementptr inbounds [16 x double], [16 x double]* %7, i64 0, i64 %219
%221 = load double, double* %220
%222 = call double @llvm.fmuladd.f64(double %218, double %221, double %217)
%223 = fmul double %30, %218
%224 = add nuw nsw i64 %201, 4
%225 = add i64 %204, 4
%226 = icmp eq i64 %225, %199
br i1 %226, label %227, label %200
227: ; preds = %200, %192
%228 = phi double [ undef, %192 ], [ %222, %200 ]
%229 = phi i64 [ 0, %192 ], [ %224, %200 ]
%230 = phi double [ 0.000000e+00, %192 ], [ %222, %200 ]
%231 = phi double [ 1.000000e+00, %192 ], [ %223, %200 ]
%232 = icmp eq i64 %196, 0
br i1 %232, label %245, label %233
233: ; preds = %227, %233
%234 = phi i64 [ %242, %233 ], [ %229, %227 ]
%235 = phi double [ %240, %233 ], [ %230, %227 ]
%236 = phi double [ %241, %233 ], [ %231, %227 ]
%237 = phi i64 [ %243, %233 ], [ 0, %227 ]
%238 = getelementptr inbounds [16 x double], [16 x double]* %7, i64 0, i64 %234
%239 = load double, double* %238
%240 = call double @llvm.fmuladd.f64(double %236, double %239, double %235)
%241 = fmul double %30, %236
%242 = add nuw nsw i64 %234, 1
%243 = add i64 %237, 1
%244 = icmp eq i64 %243, %196
br i1 %244, label %245, label %233
245: ; preds = %227, %233, %187, %82, %41, %33
%246 = phi double [ %35, %33 ], [ %45, %41 ], [ %83, %82 ], [ 0.000000e+00, %187 ], [ %228, %227 ], [ %240, %233 ]
ret double %246
}