#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 /*<<< orphan*/ gslpolyfit(double *, double *, int, int, double *);
int /*<<< orphan*/ willus_mem_alloc_warn(void **, int, char *, int);
int /*<<< orphan*/ willus_mem_free(double **, char *);
int arrayf_find_max_point(float *x0, float *y0, float *x, float *y, int n) {
  double c[3];
  double *tx, *ty;
  double xoff, yoff;
  int i;
  willus_mem_alloc_warn((void **)&tx, sizeof(double) * 2 * n,
                        "arrayf_find_max_point", 10);
  ty = &tx[n];
  for (xoff = yoff = 0., i = 0; i < n; i++) {
    xoff += x[i];
    yoff += y[i];
  }
  xoff /= n;
  yoff /= n;
  for (i = 0; i < n; i++) {
    tx[i] = x[i] - xoff;
    ty[i] = y[i] - yoff;
  }
  gslpolyfit(tx, ty, n, 2, c);
  willus_mem_free((double **)&tx, "array_find_max_point");
  if (c[2] == 0)
    return (-1);
  (*x0) = (float)(-c[1] / (2. * c[2]));
  (*y0) = (float)(c[2] * (*x0) * (*x0) + c[1] * (*x0) + c[0] + yoff);
  (*x0) = (*x0) + xoff;
  return (0);
}


x86 assembly (clang, -O0):
<arrayf_find_max_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
lea    -0x58(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x4,%rax
mov    %eax,%esi
lea    0xea4(%rip),%rdx
mov    $0xa,%ecx
call   1030 <willus_mem_alloc_warn@plt>
mov    -0x58(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    11e8 <arrayf_find_max_point+0xb8>
mov    -0x20(%rbp),%rax
movslq -0x74(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x74(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1198 <arrayf_find_max_point+0x68>
cvtsi2sdl -0x2c(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
cvtsi2sdl -0x2c(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1275 <arrayf_find_max_point+0x145>
mov    -0x20(%rbp),%rax
movslq -0x74(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  -0x68(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x74(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  -0x70(%rbp),%xmm0
mov    -0x60(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1215 <arrayf_find_max_point+0xe5>
mov    -0x58(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x2c(%rbp),%edx
lea    -0x50(%rbp),%r8
mov    $0x2,%ecx
call   1040 <gslpolyfit@plt>
lea    -0x58(%rbp),%rdi
lea    0xd85(%rip),%rsi
call   1050 <willus_mem_free@plt>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12c2 <arrayf_find_max_point+0x192>
jp     12c2 <arrayf_find_max_point+0x192>
movl   $0xffffffff,-0x4(%rbp)
jmp    1373 <arrayf_find_max_point+0x243>
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd1a(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  -0x48(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm3
cvtss2sd %xmm3,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x50(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x68(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayf_find_max_point>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8d,%r12d
mov    %rcx,%rbx
mov    %rdx,%rbp
mov    %rsi,%r14
mov    %rdi,%r15
movslq %r8d,%r13
mov    %r13d,%esi
shl    $0x4,%esi
lea    0xeb3(%rip),%rdx
lea    0x8(%rsp),%rdi
mov    $0xa,%ecx
call   1030 <willus_mem_alloc_warn@plt>
mov    0x8(%rsp),%rdi
lea    (%rdi,%r13,8),%rsi
test   %r13d,%r13d
jle    118b <arrayf_find_max_point+0x5b>
mov    %r12d,%r9d
cmp    $0x1,%r12d
jne    11a7 <arrayf_find_max_point+0x77>
xorpd  %xmm3,%xmm3
xor    %ecx,%ecx
jmp    11f4 <arrayf_find_max_point+0xc4>
cvtsi2sd %r12d,%xmm0
xorpd  %xmm1,%xmm1
divsd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm1
movapd %xmm1,0x10(%rsp)
jmp    13bf <arrayf_find_max_point+0x28f>
mov    %r9d,%edx
and    $0xfffffffe,%edx
xorpd  %xmm3,%xmm3
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movss  0x0(%rbp,%rcx,4),%xmm0
movss  0x4(%rbp,%rcx,4),%xmm1
movss  (%rbx,%rcx,4),%xmm2
unpcklps %xmm0,%xmm2
movss  0x4(%rbx,%rcx,4),%xmm0
cvtps2pd %xmm2,%xmm2
unpcklps %xmm1,%xmm0
addpd  %xmm3,%xmm2
cvtps2pd %xmm0,%xmm3
addpd  %xmm2,%xmm3
add    $0x2,%rcx
cmp    %rcx,%rdx
jne    11c0 <arrayf_find_max_point+0x90>
test   $0x1,%r9b
je     120f <arrayf_find_max_point+0xdf>
movss  0x0(%rbp,%rcx,4),%xmm0
movss  (%rbx,%rcx,4),%xmm1
unpcklps %xmm0,%xmm1
cvtps2pd %xmm1,%xmm0
addpd  %xmm0,%xmm3
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm3
test   %r12d,%r12d
movapd %xmm3,0x10(%rsp)
jle    13bf <arrayf_find_max_point+0x28f>
cmp    $0x1,%r12d
je     1252 <arrayf_find_max_point+0x122>
lea    (%r9,%r13,1),%rax
lea    (%rdi,%rax,8),%rax
cmp    %rax,%rdi
jae    130b <arrayf_find_max_point+0x1db>
lea    (%rdi,%r9,8),%rax
cmp    %rax,%rsi
jae    130b <arrayf_find_max_point+0x1db>
xor    %ecx,%ecx
mov    %rcx,%rax
not    %rax
test   $0x1,%r9b
je     1291 <arrayf_find_max_point+0x161>
movss  0x0(%rbp,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movapd %xmm3,%xmm1
unpckhpd %xmm3,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rdi,%rcx,8)
movss  (%rbx,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  %xmm3,%xmm0
movsd  %xmm0,(%rsi,%rcx,8)
or     $0x1,%rcx
add    %r9,%rax
je     13bf <arrayf_find_max_point+0x28f>
movapd %xmm3,%xmm0
unpckhpd %xmm3,%xmm0
lea    (%rdi,%r13,8),%rax
add    $0x8,%rax
nopw   0x0(%rax,%rax,1)
movss  0x0(%rbp,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi,%rcx,8)
movss  (%rbx,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm3,%xmm1
movsd  %xmm1,-0x8(%rax,%rcx,8)
movss  0x4(%rbp,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rdi,%rcx,8)
movss  0x4(%rbx,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm3,%xmm1
movsd  %xmm1,(%rax,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%r9
jne    12b0 <arrayf_find_max_point+0x180>
jmp    13bf <arrayf_find_max_point+0x28f>
mov    %r9d,%ecx
and    $0xfffffffe,%ecx
movapd %xmm3,%xmm1
unpckhpd %xmm3,%xmm1
movapd %xmm3,%xmm0
unpcklpd %xmm3,%xmm0
lea    -0x2(%rcx),%rax
mov    %rax,%r8
shr    %r8
add    $0x1,%r8
test   %rax,%rax
je     147b <arrayf_find_max_point+0x34b>
mov    %r8,%rax
and    $0xfffffffffffffffe,%rax
lea    (%rdi,%r13,8),%r10
add    $0x10,%r10
xor    %edx,%edx
nopl   0x0(%rax)
cvtps2pd 0x0(%rbp,%rdx,4),%xmm2
subpd  %xmm1,%xmm2
movupd %xmm2,(%rdi,%rdx,8)
cvtps2pd (%rbx,%rdx,4),%xmm2
subpd  %xmm0,%xmm2
movupd %xmm2,-0x10(%r10,%rdx,8)
cvtps2pd 0x8(%rbp,%rdx,4),%xmm2
subpd  %xmm1,%xmm2
movupd %xmm2,0x10(%rdi,%rdx,8)
cvtps2pd 0x8(%rbx,%rdx,4),%xmm2
subpd  %xmm0,%xmm2
movupd %xmm2,(%r10,%rdx,8)
add    $0x4,%rdx
add    $0xfffffffffffffffe,%rax
jne    1350 <arrayf_find_max_point+0x220>
test   $0x1,%r8b
je     13b6 <arrayf_find_max_point+0x286>
cvtps2pd 0x0(%rbp,%rdx,4),%xmm2
subpd  %xmm1,%xmm2
movupd %xmm2,(%rdi,%rdx,8)
cvtps2pd (%rbx,%rdx,4),%xmm1
subpd  %xmm0,%xmm1
movupd %xmm1,(%rsi,%rdx,8)
cmp    %r9,%rcx
jne    1254 <arrayf_find_max_point+0x124>
lea    0x20(%rsp),%r8
mov    %r12d,%edx
mov    $0x2,%ecx
call   1040 <gslpolyfit@plt>
lea    0xc4e(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1050 <willus_mem_free@plt>
movsd  0x30(%rsp),%xmm0
mov    $0xffffffff,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13f9 <arrayf_find_max_point+0x2c9>
jnp    146c <arrayf_find_max_point+0x33c>
movsd  0x28(%rsp),%xmm1
movapd 0xbf9(%rip),%xmm2
xorpd  %xmm1,%xmm2
movapd %xmm0,%xmm3
addsd  %xmm0,%xmm3
divsd  %xmm3,%xmm2
cvtsd2ss %xmm2,%xmm2
movss  %xmm2,(%r15)
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  0x20(%rsp),%xmm0
movapd 0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14)
movss  (%r15),%xmm0
cvtss2sd %xmm0,%xmm0
unpckhpd %xmm1,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,(%r15)
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edx,%edx
test   $0x1,%r8b
jne    139b <arrayf_find_max_point+0x26b>
jmp    13b6 <arrayf_find_max_point+0x286>

LLVM IR (-O0):
@.str = [22 x i8] c"arrayf_find_max_point\00"
@.str.1 = [21 x i8] c"array_find_max_point\00"
define i32 @arrayf_find_max_point(float* %0, float* %1, float* %2, float* %3, i32 %4) {
%6 = alloca i32
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32
%12 = alloca [3 x double]
%13 = alloca double*
%14 = alloca double*
%15 = alloca double
%16 = alloca double
%17 = alloca i32
store float* %0, float** %7
store float* %1, float** %8
store float* %2, float** %9
store float* %3, float** %10
store i32 %4, i32* %11
%18 = bitcast double** %13 to i8**
%19 = load i32, i32* %11
%20 = sext i32 %19 to i64
%21 = mul i64 16, %20
%22 = trunc i64 %21 to i32
%23 = call i32 @willus_mem_alloc_warn(i8** %18, i32 %22, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 10)
%24 = load double*, double** %13
%25 = load i32, i32* %11
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
store double* %27, double** %14
store double 0.000000e+00, double* %16
store double 0.000000e+00, double* %15
store i32 0, i32* %17
br label %28
28: ; preds = %49, %5
%29 = load i32, i32* %17
%30 = load i32, i32* %11
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %52
32: ; preds = %28
%33 = load float*, float** %9
%34 = load i32, i32* %17
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds float, float* %33, i64 %35
%37 = load float, float* %36
%38 = fpext float %37 to double
%39 = load double, double* %15
%40 = fadd double %39, %38
store double %40, double* %15
%41 = load float*, float** %10
%42 = load i32, i32* %17
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds float, float* %41, i64 %43
%45 = load float, float* %44
%46 = fpext float %45 to double
%47 = load double, double* %16
%48 = fadd double %47, %46
store double %48, double* %16
br label %49
49: ; preds = %32
%50 = load i32, i32* %17
%51 = add nsw i32 %50, 1
store i32 %51, i32* %17
br label %28
52: ; preds = %28
%53 = load i32, i32* %11
%54 = sitofp i32 %53 to double
%55 = load double, double* %15
%56 = fdiv double %55, %54
store double %56, double* %15
%57 = load i32, i32* %11
%58 = sitofp i32 %57 to double
%59 = load double, double* %16
%60 = fdiv double %59, %58
store double %60, double* %16
store i32 0, i32* %17
br label %61
61: ; preds = %90, %52
%62 = load i32, i32* %17
%63 = load i32, i32* %11
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %93
65: ; preds = %61
%66 = load float*, float** %9
%67 = load i32, i32* %17
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds float, float* %66, i64 %68
%70 = load float, float* %69
%71 = fpext float %70 to double
%72 = load double, double* %15
%73 = fsub double %71, %72
%74 = load double*, double** %13
%75 = load i32, i32* %17
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %74, i64 %76
store double %73, double* %77
%78 = load float*, float** %10
%79 = load i32, i32* %17
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds float, float* %78, i64 %80
%82 = load float, float* %81
%83 = fpext float %82 to double
%84 = load double, double* %16
%85 = fsub double %83, %84
%86 = load double*, double** %14
%87 = load i32, i32* %17
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds double, double* %86, i64 %88
store double %85, double* %89
br label %90
90: ; preds = %65
%91 = load i32, i32* %17
%92 = add nsw i32 %91, 1
store i32 %92, i32* %17
br label %61
93: ; preds = %61
%94 = load double*, double** %13
%95 = load double*, double** %14
%96 = load i32, i32* %11
%97 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 0
%98 = call i32 @gslpolyfit(double* %94, double* %95, i32 %96, i32 2, double* %97)
%99 = call i32 @willus_mem_free(double** %13, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%100 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 2
%101 = load double, double* %100
%102 = fcmp oeq double %101, 0.000000e+00
br i1 %102, label %103, label %104
103: ; preds = %93
store i32 -1, i32* %6
br label %144
104: ; preds = %93
%105 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 1
%106 = load double, double* %105
%107 = fneg double %106
%108 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 2
%109 = load double, double* %108
%110 = fmul double 2.000000e+00, %109
%111 = fdiv double %107, %110
%112 = fptrunc double %111 to float
%113 = load float*, float** %7
store float %112, float* %113
%114 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 2
%115 = load double, double* %114
%116 = load float*, float** %7
%117 = load float, float* %116
%118 = fpext float %117 to double
%119 = fmul double %115, %118
%120 = load float*, float** %7
%121 = load float, float* %120
%122 = fpext float %121 to double
%123 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 1
%124 = load double, double* %123
%125 = load float*, float** %7
%126 = load float, float* %125
%127 = fpext float %126 to double
%128 = fmul double %124, %127
%129 = call double @llvm.fmuladd.f64(double %119, double %122, double %128)
%130 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 0
%131 = load double, double* %130
%132 = fadd double %129, %131
%133 = load double, double* %16
%134 = fadd double %132, %133
%135 = fptrunc double %134 to float
%136 = load float*, float** %8
store float %135, float* %136
%137 = load float*, float** %7
%138 = load float, float* %137
%139 = fpext float %138 to double
%140 = load double, double* %15
%141 = fadd double %139, %140
%142 = fptrunc double %141 to float
%143 = load float*, float** %7
store float %142, float* %143
store i32 0, i32* %6
br label %144
144: ; preds = %104, %103
%145 = load i32, i32* %6
ret i32 %145
}

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