#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 */
double fabs(double);
double fmin(double, double);
int sqfun(int, int, double *);
int sqcoef(int ir, double gMSAWave[]) {
  int itm = 40, ix, ig, ii;
  double acc = 5.0E-6, del, e1, e2, f1, f2;
  f1 = 0;
  f2 = 0;
  ig = 1;
  if (gMSAWave[6] >= (1.0 + 8.0 * gMSAWave[4])) {
    ig = 0;
    gMSAWave[15] = gMSAWave[14];
    gMSAWave[16] = gMSAWave[4];
    ix = 1;
    ir = sqfun(ix, ir, gMSAWave);
    gMSAWave[14] = gMSAWave[15];
    gMSAWave[4] = gMSAWave[16];
    if ((ir < 0.0) || (gMSAWave[14] >= 0.0)) {
      return ir;
    }
  }
  gMSAWave[10] = fmin(gMSAWave[4], 0.20);
  if ((ig != 1) || (gMSAWave[9] >= 0.15)) {
    ii = 0;
    do {
      ii = ii + 1;
      if (ii > itm) {
        ir = -1;
        return ir;
      }
      if (gMSAWave[10] <= 0.0) {
        gMSAWave[10] = gMSAWave[4] / ii;
      }
      if (gMSAWave[10] > 0.6) {
        gMSAWave[10] = 0.35 / ii;
      }
      e1 = gMSAWave[10];
      gMSAWave[15] = f1;
      gMSAWave[16] = e1;
      ix = 2;
      ir = sqfun(ix, ir, gMSAWave);
      f1 = gMSAWave[15];
      e1 = gMSAWave[16];
      e2 = gMSAWave[10] * 1.01;
      gMSAWave[15] = f2;
      gMSAWave[16] = e2;
      ix = 2;
      ir = sqfun(ix, ir, gMSAWave);
      f2 = gMSAWave[15];
      e2 = gMSAWave[16];
      e2 = e1 - (e2 - e1) * f1 / (f2 - f1);
      gMSAWave[10] = e2;
      del = fabs((e2 - e1) / e1);
    } while (del > acc);
    gMSAWave[15] = gMSAWave[14];
    gMSAWave[16] = e2;
    ix = 4;
    ir = sqfun(ix, ir, gMSAWave);
    gMSAWave[14] = gMSAWave[15];
    e2 = gMSAWave[16];
    ir = ii;
    if ((ig != 1) || (gMSAWave[10] >= gMSAWave[4])) {
      return ir;
    }
  }
  gMSAWave[15] = gMSAWave[14];
  gMSAWave[16] = gMSAWave[4];
  ix = 3;
  ir = sqfun(ix, ir, gMSAWave);
  gMSAWave[14] = gMSAWave[15];
  gMSAWave[4] = gMSAWave[16];
  if ((ir >= 0) && (gMSAWave[14] < 0.0)) {
    ir = -3;
  }
  return ir;
}


x86 assembly (clang, -O0):
<sqcoef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x28,-0x14(%rbp)
movsd  0xee2(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm1
movsd  0xe9c(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe98(%rip),%xmm2
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     1224 <sqcoef+0x114>
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x70(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x78(%rax)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x80(%rax)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <sqfun@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x78(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x70(%rax)
mov    -0x10(%rbp),%rax
movsd  0x80(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x20(%rax)
cvtsi2sdl -0x8(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1214 <sqcoef+0x104>
mov    -0x10(%rbp),%rax
movsd  0x70(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     121f <sqcoef+0x10f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1558 <sqcoef+0x448>
jmp    1224 <sqcoef+0x114>
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  0xde3(%rip),%xmm1
minsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x50(%rax)
cmpl   $0x1,-0x1c(%rbp)
jne    1267 <sqcoef+0x157>
mov    -0x10(%rbp),%rax
movsd  0x48(%rax),%xmm0
movsd  0xdc3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     14c8 <sqcoef+0x3b8>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1295 <sqcoef+0x185>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1558 <sqcoef+0x448>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd 0x50(%rax),%xmm0
jb     12c2 <sqcoef+0x1b2>
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
cvtsi2sdl -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x50(%rax)
mov    -0x10(%rbp),%rax
movsd  0x50(%rax),%xmm0
movsd  0xd55(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12f7 <sqcoef+0x1e7>
cvtsi2sdl -0x20(%rbp),%xmm1
movsd  0xd46(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x50(%rax)
mov    -0x10(%rbp),%rax
movsd  0x50(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x78(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x80(%rax)
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <sqfun@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x78(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x80(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xcd0(%rip),%xmm0
mulsd  0x50(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x78(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x80(%rax)
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <sqfun@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x78(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x80(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
subsd  -0x38(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
subsd  -0x48(%rbp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x50(%rax)
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
movaps 0xc28(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
ja     126e <sqcoef+0x15e>
mov    -0x10(%rbp),%rax
movsd  0x70(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x78(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x80(%rax)
movl   $0x4,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <sqfun@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x78(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x70(%rax)
mov    -0x10(%rbp),%rax
movsd  0x80(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    14b8 <sqcoef+0x3a8>
mov    -0x10(%rbp),%rax
movsd  0x50(%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd 0x20(%rax),%xmm0
jb     14c3 <sqcoef+0x3b3>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1558 <sqcoef+0x448>
jmp    14c8 <sqcoef+0x3b8>
mov    -0x10(%rbp),%rax
movsd  0x70(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x78(%rax)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x80(%rax)
movl   $0x3,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <sqfun@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x78(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x70(%rax)
mov    -0x10(%rbp),%rax
movsd  0x80(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x20(%rax)
cmpl   $0x0,-0x8(%rbp)
jl     1552 <sqcoef+0x442>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd 0x70(%rax),%xmm0
jbe    1552 <sqcoef+0x442>
movl   $0xfffffffd,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqcoef>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movsd  0x20(%rsi),%xmm1
movsd  0x30(%rsi),%xmm0
movsd  0xed1(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xecd(%rip),%xmm2
ucomisd %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  %xmm2,(%rsp)
jae    1176 <sqcoef+0x66>
movapd %xmm1,%xmm0
minsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x50(%rbx)
movsd  0x48(%rbx),%xmm2
ucomisd 0xeae(%rip),%xmm2
jae    11d9 <sqcoef+0xc9>
movsd  0x70(%rbx),%xmm0
jmp    1343 <sqcoef+0x233>
movsd  0x70(%rbx),%xmm0
movsd  %xmm0,0x78(%rbx)
movsd  %xmm1,0x80(%rbx)
mov    $0x1,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <sqfun@plt>
mov    %eax,%ebp
movsd  0x78(%rbx),%xmm1
movsd  0x80(%rbx),%xmm0
movsd  %xmm1,0x70(%rbx)
movsd  %xmm0,0x20(%rbx)
test   %eax,%eax
js     138b <sqcoef+0x27b>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jae    138b <sqcoef+0x27b>
minsd  0xe42(%rip),%xmm0
lea    0x50(%rbx),%r14
movsd  %xmm0,0x50(%rbx)
jmp    11dd <sqcoef+0xcd>
lea    0x50(%rbx),%r14
mov    %ebp,%eax
xor    %ebp,%ebp
xorpd  %xmm3,%xmm3
xorpd  %xmm4,%xmm4
jmp    1299 <sqcoef+0x189>
xchg   %ax,%ax
movsd  %xmm3,0x78(%rbx)
movsd  %xmm0,0x80(%rbx)
mov    $0x2,%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <sqfun@plt>
movups 0x78(%rbx),%xmm0
movaps %xmm0,0x10(%rsp)
movsd  0x50(%rbx),%xmm0
mulsd  0xe0e(%rip),%xmm0
movaps 0x20(%rsp),%xmm1
movsd  %xmm1,0x78(%rbx)
movsd  %xmm0,0x80(%rbx)
mov    $0x2,%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <sqfun@plt>
movapd 0x10(%rsp),%xmm3
movupd 0x78(%rbx),%xmm4
movapd %xmm4,%xmm0
subpd  %xmm3,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
mulsd  %xmm3,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm3,%xmm2
unpckhpd %xmm3,%xmm2
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x50(%rbx)
movapd %xmm0,%xmm1
subsd  %xmm2,%xmm1
divsd  %xmm2,%xmm1
andpd  0xdc1(%rip),%xmm1
ucomisd 0xda1(%rip),%xmm1
jbe    12fb <sqcoef+0x1eb>
cmp    $0x28,%ebp
je     12f1 <sqcoef+0x1e1>
add    $0x1,%ebp
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jb     12c0 <sqcoef+0x1b0>
movsd  0x20(%rbx),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x50(%rbx)
movapd %xmm4,0x20(%rsp)
ucomisd 0xd52(%rip),%xmm0
jbe    11f0 <sqcoef+0xe0>
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movsd  0xd45(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
jmp    11f0 <sqcoef+0xe0>
mov    $0xffffffff,%ebp
jmp    138b <sqcoef+0x27b>
movsd  0x70(%rbx),%xmm1
movsd  %xmm1,0x78(%rbx)
movsd  %xmm0,0x80(%rbx)
mov    $0x4,%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <sqfun@plt>
movsd  0x8(%rsp),%xmm0
ucomisd (%rsp),%xmm0
movsd  0x78(%rbx),%xmm0
movsd  %xmm0,0x70(%rbx)
jae    138b <sqcoef+0x27b>
movsd  0x20(%rbx),%xmm1
movsd  0x50(%rbx),%xmm2
ucomisd %xmm1,%xmm2
jae    138b <sqcoef+0x27b>
movsd  %xmm0,0x78(%rbx)
movsd  %xmm1,0x80(%rbx)
mov    $0x3,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <sqfun@plt>
movsd  0x78(%rbx),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
movsd  0x80(%rbx),%xmm1
movsd  %xmm0,0x70(%rbx)
mov    $0xfffffffd,%ebp
cmovbe %eax,%ebp
movsd  %xmm1,0x20(%rbx)
test   %eax,%eax
cmovs  %eax,%ebp
mov    %ebp,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @sqcoef(i32 %0, double* %1) {
%3 = getelementptr inbounds double, double* %1, i64 6
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %1, i64 4
%6 = load double, double* %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double 8.000000e+00, double 1.000000e+00)
%8 = fcmp ult double %4, %7
br i1 %8, label %23, label %9
9: ; preds = %2
%10 = getelementptr inbounds double, double* %1, i64 14
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %1, i64 15
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 16
store double %6, double* %13
%14 = tail call i32 @sqfun(i32 1, i32 %0, double* %1)
%15 = load double, double* %12
store double %15, double* %10
%16 = load double, double* %13
store double %16, double* %5
%17 = icmp sgt i32 %14, -1
%18 = fcmp ult double %15, 0.000000e+00
%19 = select i1 %17, i1 %18, i1 false
br i1 %19, label %20, label %105
20: ; preds = %9
%21 = tail call double @llvm.minnum.f64(double %16, double 2.000000e-01)
%22 = getelementptr inbounds double, double* %1, i64 10
store double %21, double* %22
br label %32
23: ; preds = %2
%24 = tail call double @llvm.minnum.f64(double %6, double 2.000000e-01)
%25 = getelementptr inbounds double, double* %1, i64 10
store double %24, double* %25
%26 = getelementptr inbounds double, double* %1, i64 9
%27 = load double, double* %26
%28 = fcmp ult double %27, 1.500000e-01
br i1 %28, label %29, label %32
29: ; preds = %23
%30 = getelementptr inbounds double, double* %1, i64 14
%31 = load double, double* %30
br label %91
32: ; preds = %20, %23
%33 = phi double [ %24, %23 ], [ %21, %20 ]
%34 = phi double* [ %25, %23 ], [ %22, %20 ]
%35 = phi i32 [ %0, %23 ], [ %14, %20 ]
%36 = getelementptr inbounds double, double* %1, i64 15
%37 = getelementptr inbounds double, double* %1, i64 16
%38 = bitcast double* %36 to <2 x double>*
%39 = bitcast double* %36 to <2 x double>*
br label %40
40: ; preds = %60, %32
%41 = phi double [ %33, %32 ], [ %76, %60 ]
%42 = phi i32 [ 0, %32 ], [ %46, %60 ]
%43 = phi i32 [ %35, %32 ], [ %66, %60 ]
%44 = phi double [ 0.000000e+00, %32 ], [ %69, %60 ]
%45 = phi double [ 0.000000e+00, %32 ], [ %81, %60 ]
%46 = add nuw nsw i32 %42, 1
%47 = icmp eq i32 %42, 40
br i1 %47, label %105, label %48
48: ; preds = %40
%49 = fcmp ugt double %41, 0.000000e+00
br i1 %49, label %54, label %50
50: ; preds = %48
%51 = load double, double* %5
%52 = sitofp i32 %46 to double
%53 = fdiv double %51, %52
store double %53, double* %34
br label %54
54: ; preds = %50, %48
%55 = phi double [ %53, %50 ], [ %41, %48 ]
%56 = fcmp ogt double %55, 6.000000e-01
br i1 %56, label %57, label %60
57: ; preds = %54
%58 = sitofp i32 %46 to double
%59 = fdiv double 3.500000e-01, %58
store double %59, double* %34
br label %60
60: ; preds = %57, %54
%61 = phi double [ %59, %57 ], [ %55, %54 ]
store double %44, double* %36
store double %61, double* %37
%62 = tail call i32 @sqfun(i32 2, i32 %43, double* %1)
%63 = load <2 x double>, <2 x double>* %38
%64 = load double, double* %34
%65 = fmul double %64, 1.010000e+00
store double %45, double* %36
store double %65, double* %37
%66 = tail call i32 @sqfun(i32 2, i32 %62, double* %1)
%67 = load <2 x double>, <2 x double>* %39
%68 = fsub <2 x double> %67, %63
%69 = extractelement <2 x double> %63, i64 0
%70 = shufflevector <2 x double> %68, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%71 = fmul <2 x double> %63, %70
%72 = extractelement <2 x double> %71, i64 0
%73 = extractelement <2 x double> %68, i64 0
%74 = fdiv double %72, %73
%75 = extractelement <2 x double> %63, i64 1
%76 = fsub double %75, %74
store double %76, double* %34
%77 = fsub double %76, %75
%78 = fdiv double %77, %75
%79 = tail call double @llvm.fabs.f64(double %78)
%80 = fcmp ogt double %79, 5.000000e-06
%81 = extractelement <2 x double> %67, i64 0
br i1 %80, label %40, label %82
82: ; preds = %60
%83 = getelementptr inbounds double, double* %1, i64 14
%84 = load double, double* %83
store double %84, double* %36
store double %76, double* %37
%85 = tail call i32 @sqfun(i32 4, i32 %66, double* %1)
%86 = load double, double* %36
store double %86, double* %83
br i1 %8, label %87, label %105
87: ; preds = %82
%88 = load double, double* %34
%89 = load double, double* %5
%90 = fcmp ult double %88, %89
br i1 %90, label %91, label %105
91: ; preds = %29, %87
%92 = phi double [ %89, %87 ], [ %6, %29 ]
%93 = phi double [ %86, %87 ], [ %31, %29 ]
%94 = phi i32 [ %46, %87 ], [ %0, %29 ]
%95 = getelementptr inbounds double, double* %1, i64 14
%96 = getelementptr inbounds double, double* %1, i64 15
store double %93, double* %96
%97 = getelementptr inbounds double, double* %1, i64 16
store double %92, double* %97
%98 = tail call i32 @sqfun(i32 3, i32 %94, double* %1)
%99 = load double, double* %96
store double %99, double* %95
%100 = load double, double* %97
store double %100, double* %5
%101 = icmp sgt i32 %98, -1
%102 = fcmp olt double %99, 0.000000e+00
%103 = select i1 %101, i1 %102, i1 false
%104 = select i1 %103, i32 -3, i32 %98
br label %105
105: ; preds = %40, %91, %82, %87, %9
%106 = phi i32 [ %14, %9 ], [ %46, %87 ], [ %46, %82 ], [ %104, %91 ], [ -1, %40 ]
ret i32 %106
}