#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 sqrt(double);
int qreval(double *ev, double *dp, int n) {
  double cc, sc = 0.0, d, x, y, h, tzr = 1.e-15;
  int j, k, m, mqr = 8 * n;
  for (j = 0, m = n - 1;; ++j) {
    while (1) {
      if (m < 1)
        return 0;
      k = m - 1;
      if (fabs(dp[k]) <= fabs(ev[m]) * tzr)
        --m;
      else {
        x = (ev[k] - ev[m]) / 2.;
        h = sqrt(x * x + dp[k] * dp[k]);
        if (m > 1 && fabs(dp[m - 2]) > fabs(ev[k]) * tzr)
          break;
        x += ev[m];
        ev[m--] = x - h;
        ev[m--] = x + h;
      }
    }
    if (j > mqr)
      return -1;
    if (x > 0.)
      d = ev[m] + x - h;
    else
      d = ev[m] + x + h;
    cc = 1.;
    y = 0.;
    ev[0] -= d;
    for (k = 0; k < m; ++k) {
      x = ev[k] * cc - y;
      y = dp[k] * cc;
      h = sqrt(x * x + dp[k] * dp[k]);
      if (k > 0)
        dp[k - 1] = sc * h;
      ev[k] = cc * h;
      cc = x / h;
      sc = dp[k] / h;
      ev[k + 1] -= d;
      y *= sc;
      ev[k] = cc * (ev[k] + y) + ev[k + 1] * sc * sc + d;
    }
    ev[k] = ev[k] * cc - y;
    dp[k - 1] = ev[k] * sc;
    ev[k] = ev[k] * cc + d;
  }
  return 0;
}


x86 assembly (clang, -O0):
<qreval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x68(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1156 <qreval+0x46>
cmpl   $0x1,-0x64(%rbp)
jge    116c <qreval+0x5c>
movl   $0x0,-0x4(%rbp)
jmp    158e <qreval+0x47e>
mov    -0x64(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xe97(%rip),%xmm0
pand   %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xe7f(%rip),%xmm2
pand   %xmm2,%xmm0
mulsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11c2 <qreval+0xb2>
mov    -0x64(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x64(%rbp)
jmp    12cf <qreval+0x1bf>
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  0xe24(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x50(%rbp)
cmpl   $0x1,-0x64(%rbp)
jle    1276 <qreval+0x166>
mov    -0x18(%rbp),%rax
mov    -0x64(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xdda(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xdc2(%rip),%xmm2
pand   %xmm2,%xmm1
mulsd  -0x58(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    1276 <qreval+0x166>
jmp    12d4 <qreval+0x1c4>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x64(%rbp),%ecx
mov    %ecx,%edx
add    $0xffffffff,%edx
mov    %edx,-0x64(%rbp)
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x40(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x64(%rbp),%ecx
mov    %ecx,%edx
add    $0xffffffff,%edx
mov    %edx,-0x64(%rbp)
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1156 <qreval+0x46>
mov    -0x5c(%rbp),%eax
cmp    -0x68(%rbp),%eax
jle    12ec <qreval+0x1dc>
movl   $0xffffffff,-0x4(%rbp)
jmp    158e <qreval+0x47e>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    131f <qreval+0x20f>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x40(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    133b <qreval+0x22b>
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x40(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xccd(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movl   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    14ed <qreval+0x3dd>
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x50(%rbp)
cmpl   $0x0,-0x60(%rbp)
jle    1426 <qreval+0x316>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x60(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x40(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x60(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
addsd  -0x48(%rbp),%xmm2
mov    -0x10(%rbp),%rax
mov    -0x60(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    136c <qreval+0x25c>
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x60(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1151 <qreval+0x41>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qreval>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%r14
xor    %esi,%esi
cmp    $0x2,%edx
jl     14e3 <qreval+0x3d3>
mov    %rdi,%r15
mov    %edx,%ebp
add    $0xffffffff,%ebp
lea    0x1(,%rdx,8),%r13d
xor    %ecx,%ecx
test   %r13d,%r13d
mov    $0x0,%eax
mov    %rax,0x8(%rsp)
cmovle %ecx,%r13d
xorpd  %xmm10,%xmm10
movapd 0xea4(%rip),%xmm5
movsd  0xebc(%rip),%xmm6
xorpd  %xmm3,%xmm3
movsd  %xmm3,0x18(%rsp)
jmp    1198 <qreval+0x88>
addsd  (%r15,%r12,8),%xmm4
movapd %xmm4,%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%r12,8)
addsd  %xmm0,%xmm4
movsd  %xmm4,(%r15,%rbx,8)
mov    %eax,%ebp
test   %eax,%eax
jle    14e1 <qreval+0x3d1>
lea    -0x1(%rbp),%ebx
movsd  (%r14,%rbx,8),%xmm1
movapd %xmm1,%xmm2
andpd  %xmm5,%xmm2
mov    %ebp,%r12d
movsd  (%r15,%r12,8),%xmm0
movapd %xmm0,%xmm3
andpd  %xmm5,%xmm3
mulsd  %xmm6,%xmm3
ucomisd %xmm2,%xmm3
mov    %ebx,%eax
jae    118e <qreval+0x7e>
movsd  (%r15,%rbx,8),%xmm4
subsd  %xmm0,%xmm4
mulsd  0xe50(%rip),%xmm4
mulsd  %xmm1,%xmm1
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm10,%xmm0
jb     1200 <qreval+0xf0>
sqrtsd %xmm0,%xmm0
jmp    1224 <qreval+0x114>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm4,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm4
movsd  0xe09(%rip),%xmm6
movapd 0xde1(%rip),%xmm5
xorpd  %xmm10,%xmm10
lea    -0x2(%rbp),%eax
cmp    $0x2,%ebp
jb     1170 <qreval+0x60>
mov    %eax,%ecx
movsd  (%r14,%rcx,8),%xmm1
andpd  %xmm5,%xmm1
movsd  (%r15,%rbx,8),%xmm2
andpd  %xmm5,%xmm2
mulsd  %xmm6,%xmm2
ucomisd %xmm2,%xmm1
jbe    1170 <qreval+0x60>
cmp    %r13d,0x8(%rsp)
je     14f4 <qreval+0x3e4>
movsd  (%r15,%r12,8),%xmm1
addsd  %xmm4,%xmm1
movapd %xmm0,%xmm3
xorpd  0xd9b(%rip),%xmm3
xorpd  %xmm2,%xmm2
xorpd  %xmm9,%xmm9
cmpltsd %xmm4,%xmm9
andpd  %xmm9,%xmm3
andnpd %xmm0,%xmm9
orpd   %xmm3,%xmm9
addsd  %xmm1,%xmm9
movsd  (%r15),%xmm7
subsd  %xmm9,%xmm7
movsd  %xmm7,(%r15)
xor    %esi,%esi
test   %ebp,%ebp
jle    12df <qreval+0x1cf>
movsd  (%r14),%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm7,%xmm0
mulsd  %xmm7,%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm10,%xmm0
movapd %xmm9,0x30(%rsp)
mov    %r13d,0x24(%rsp)
jb     12f4 <qreval+0x1e4>
sqrtsd %xmm0,%xmm0
jmp    132b <qreval+0x21b>
movsd  0xd49(%rip),%xmm4
xor    %eax,%eax
movsd  0x18(%rsp),%xmm3
jmp    149c <qreval+0x38c>
movsd  %xmm2,(%rsp)
movsd  %xmm7,0x10(%rsp)
call   1030 <sqrt@plt>
movsd  0x10(%rsp),%xmm7
movsd  (%rsp),%xmm2
movapd 0x30(%rsp),%xmm9
movsd  0xd02(%rip),%xmm6
movapd 0xcda(%rip),%xmm5
xorpd  %xmm10,%xmm10
movsd  0x8(%r15),%xmm1
movsd  %xmm0,(%r15)
divsd  %xmm0,%xmm7
movsd  (%r14),%xmm3
divsd  %xmm0,%xmm3
subsd  %xmm9,%xmm1
movsd  %xmm1,0x8(%r15)
mulsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
movapd %xmm3,%xmm8
mulsd  %xmm1,%xmm8
mulsd  %xmm3,%xmm8
mulsd  %xmm7,%xmm0
addsd  %xmm8,%xmm0
addsd  %xmm9,%xmm0
movsd  %xmm0,(%r15)
mov    %r12,%rbx
add    $0xffffffffffffffff,%rbx
xor    %r13d,%r13d
jmp    1452 <qreval+0x342>
nopw   0x0(%rax,%rax,1)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,(%rsp)
movsd  %xmm7,0x10(%rsp)
movsd  %xmm4,0x28(%rsp)
call   1030 <sqrt@plt>
movsd  0x28(%rsp),%xmm4
movsd  0x10(%rsp),%xmm7
movsd  (%rsp),%xmm2
movapd 0x30(%rsp),%xmm9
movsd  0x18(%rsp),%xmm3
movsd  0xc4e(%rip),%xmm6
movapd 0xc26(%rip),%xmm5
xorpd  %xmm10,%xmm10
mulsd  %xmm7,%xmm2
mulsd  %xmm0,%xmm3
mov    %r13d,%eax
movsd  %xmm3,(%r14,%rax,8)
mulsd  %xmm0,%xmm7
movsd  %xmm7,0x8(%r15,%r13,8)
divsd  %xmm0,%xmm4
movsd  0x8(%r14,%r13,8),%xmm3
divsd  %xmm0,%xmm3
movsd  0x10(%r15,%r13,8),%xmm1
subsd  %xmm9,%xmm1
movsd  %xmm1,0x10(%r15,%r13,8)
mulsd  %xmm3,%xmm2
addsd  %xmm2,%xmm7
movapd %xmm3,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm4,%xmm7
addsd  %xmm0,%xmm7
addsd  %xmm9,%xmm7
movsd  %xmm7,0x8(%r15,%r13,8)
add    $0x1,%r13
movapd %xmm4,%xmm7
cmp    %r13,%rbx
je     148d <qreval+0x37d>
mulsd  %xmm7,%xmm1
movapd %xmm1,%xmm4
subsd  %xmm2,%xmm4
movsd  0x8(%r14,%r13,8),%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm10,%xmm0
jb     1390 <qreval+0x280>
sqrtsd %xmm0,%xmm0
jmp    13df <qreval+0x2cf>
movsd  (%r15,%r12,8),%xmm7
mov    %ebp,%eax
mov    0x24(%rsp),%r13d
xor    %esi,%esi
mov    %eax,%ecx
mulsd  %xmm4,%xmm7
subsd  %xmm2,%xmm7
movsd  %xmm7,(%r15,%rcx,8)
mulsd  %xmm3,%xmm7
add    $0xffffffff,%eax
movsd  %xmm7,(%r14,%rax,8)
mulsd  (%r15,%rcx,8),%xmm4
addsd  %xmm9,%xmm4
movsd  %xmm4,(%r15,%rcx,8)
mov    0x8(%rsp),%rax
add    $0x1,%eax
mov    %rax,0x8(%rsp)
test   %ebp,%ebp
jg     1168 <qreval+0x58>
jmp    14e3 <qreval+0x3d3>
xor    %esi,%esi
mov    %esi,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xffffffff,%esi
jmp    14e3 <qreval+0x3d3>

LLVM IR (-O0):
define i32 @qreval(double* %0, double* %1, i32 %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store double 0.000000e+00, double* %9
store double 1.000000e-15, double* %14
%19 = load i32, i32* %7
%20 = mul nsw i32 8, %19
store i32 %20, i32* %18
store i32 0, i32* %15
%21 = load i32, i32* %7
%22 = sub nsw i32 %21, 1
store i32 %22, i32* %17
br label %23
23: ; preds = %298, %3
br label %24
24: ; preds = %23, %121
%25 = load i32, i32* %17
%26 = icmp slt i32 %25, 1
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 0, i32* %4
br label %301
28: ; preds = %24
%29 = load i32, i32* %17
%30 = sub nsw i32 %29, 1
store i32 %30, i32* %16
%31 = load double*, double** %6
%32 = load i32, i32* %16
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = load double, double* %34
%36 = call double @llvm.fabs.f64(double %35)
%37 = load double*, double** %5
%38 = load i32, i32* %17
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %37, i64 %39
%41 = load double, double* %40
%42 = call double @llvm.fabs.f64(double %41)
%43 = load double, double* %14
%44 = fmul double %42, %43
%45 = fcmp ole double %36, %44
br i1 %45, label %46, label %49
46: ; preds = %28
%47 = load i32, i32* %17
%48 = add nsw i32 %47, -1
store i32 %48, i32* %17
br label %121
49: ; preds = %28
%50 = load double*, double** %5
%51 = load i32, i32* %16
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %50, i64 %52
%54 = load double, double* %53
%55 = load double*, double** %5
%56 = load i32, i32* %17
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %55, i64 %57
%59 = load double, double* %58
%60 = fsub double %54, %59
%61 = fdiv double %60, 2.000000e+00
store double %61, double* %11
%62 = load double, double* %11
%63 = load double, double* %11
%64 = load double*, double** %6
%65 = load i32, i32* %16
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %64, i64 %66
%68 = load double, double* %67
%69 = load double*, double** %6
%70 = load i32, i32* %16
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
%73 = load double, double* %72
%74 = fmul double %68, %73
%75 = call double @llvm.fmuladd.f64(double %62, double %63, double %74)
%76 = call double @sqrt(double %75)
store double %76, double* %13
%77 = load i32, i32* %17
%78 = icmp sgt i32 %77, 1
br i1 %78, label %79, label %97
79: ; preds = %49
%80 = load double*, double** %6
%81 = load i32, i32* %17
%82 = sub nsw i32 %81, 2
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %80, i64 %83
%85 = load double, double* %84
%86 = call double @llvm.fabs.f64(double %85)
%87 = load double*, double** %5
%88 = load i32, i32* %16
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %87, i64 %89
%91 = load double, double* %90
%92 = call double @llvm.fabs.f64(double %91)
%93 = load double, double* %14
%94 = fmul double %92, %93
%95 = fcmp ogt double %86, %94
br i1 %95, label %96, label %97
96: ; preds = %79
br label %122
97: ; preds = %79, %49
%98 = load double*, double** %5
%99 = load i32, i32* %17
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %98, i64 %100
%102 = load double, double* %101
%103 = load double, double* %11
%104 = fadd double %103, %102
store double %104, double* %11
%105 = load double, double* %11
%106 = load double, double* %13
%107 = fsub double %105, %106
%108 = load double*, double** %5
%109 = load i32, i32* %17
%110 = add nsw i32 %109, -1
store i32 %110, i32* %17
%111 = sext i32 %109 to i64
%112 = getelementptr inbounds double, double* %108, i64 %111
store double %107, double* %112
%113 = load double, double* %11
%114 = load double, double* %13
%115 = fadd double %113, %114
%116 = load double*, double** %5
%117 = load i32, i32* %17
%118 = add nsw i32 %117, -1
store i32 %118, i32* %17
%119 = sext i32 %117 to i64
%120 = getelementptr inbounds double, double* %116, i64 %119
store double %115, double* %120
br label %121
121: ; preds = %97, %46
br label %24
122: ; preds = %96
%123 = load i32, i32* %15
%124 = load i32, i32* %18
%125 = icmp sgt i32 %123, %124
br i1 %125, label %126, label %127
126: ; preds = %122
store i32 -1, i32* %4
br label %301
127: ; preds = %122
%128 = load double, double* %11
%129 = fcmp ogt double %128, 0.000000e+00
br i1 %129, label %130, label %140
130: ; preds = %127
%131 = load double*, double** %5
%132 = load i32, i32* %17
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds double, double* %131, i64 %133
%135 = load double, double* %134
%136 = load double, double* %11
%137 = fadd double %135, %136
%138 = load double, double* %13
%139 = fsub double %137, %138
store double %139, double* %10
br label %150
140: ; preds = %127
%141 = load double*, double** %5
%142 = load i32, i32* %17
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %141, i64 %143
%145 = load double, double* %144
%146 = load double, double* %11
%147 = fadd double %145, %146
%148 = load double, double* %13
%149 = fadd double %147, %148
store double %149, double* %10
br label %150
150: ; preds = %140, %130
store double 1.000000e+00, double* %8
store double 0.000000e+00, double* %12
%151 = load double, double* %10
%152 = load double*, double** %5
%153 = getelementptr inbounds double, double* %152, i64 0
%154 = load double, double* %153
%155 = fsub double %154, %151
store double %155, double* %153
store i32 0, i32* %16
br label %156
156: ; preds = %257, %150
%157 = load i32, i32* %16
%158 = load i32, i32* %17
%159 = icmp slt i32 %157, %158
br i1 %159, label %160, label %260
160: ; preds = %156
%161 = load double*, double** %5
%162 = load i32, i32* %16
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds double, double* %161, i64 %163
%165 = load double, double* %164
%166 = load double, double* %8
%167 = load double, double* %12
%168 = fneg double %167
%169 = call double @llvm.fmuladd.f64(double %165, double %166, double %168)
store double %169, double* %11
%170 = load double*, double** %6
%171 = load i32, i32* %16
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds double, double* %170, i64 %172
%174 = load double, double* %173
%175 = load double, double* %8
%176 = fmul double %174, %175
store double %176, double* %12
%177 = load double, double* %11
%178 = load double, double* %11
%179 = load double*, double** %6
%180 = load i32, i32* %16
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds double, double* %179, i64 %181
%183 = load double, double* %182
%184 = load double*, double** %6
%185 = load i32, i32* %16
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double, double* %184, i64 %186
%188 = load double, double* %187
%189 = fmul double %183, %188
%190 = call double @llvm.fmuladd.f64(double %177, double %178, double %189)
%191 = call double @sqrt(double %190)
store double %191, double* %13
%192 = load i32, i32* %16
%193 = icmp sgt i32 %192, 0
br i1 %193, label %194, label %203
194: ; preds = %160
%195 = load double, double* %9
%196 = load double, double* %13
%197 = fmul double %195, %196
%198 = load double*, double** %6
%199 = load i32, i32* %16
%200 = sub nsw i32 %199, 1
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %198, i64 %201
store double %197, double* %202
br label %203
203: ; preds = %194, %160
%204 = load double, double* %8
%205 = load double, double* %13
%206 = fmul double %204, %205
%207 = load double*, double** %5
%208 = load i32, i32* %16
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds double, double* %207, i64 %209
store double %206, double* %210
%211 = load double, double* %11
%212 = load double, double* %13
%213 = fdiv double %211, %212
store double %213, double* %8
%214 = load double*, double** %6
%215 = load i32, i32* %16
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds double, double* %214, i64 %216
%218 = load double, double* %217
%219 = load double, double* %13
%220 = fdiv double %218, %219
store double %220, double* %9
%221 = load double, double* %10
%222 = load double*, double** %5
%223 = load i32, i32* %16
%224 = add nsw i32 %223, 1
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds double, double* %222, i64 %225
%227 = load double, double* %226
%228 = fsub double %227, %221
store double %228, double* %226
%229 = load double, double* %9
%230 = load double, double* %12
%231 = fmul double %230, %229
store double %231, double* %12
%232 = load double, double* %8
%233 = load double*, double** %5
%234 = load i32, i32* %16
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds double, double* %233, i64 %235
%237 = load double, double* %236
%238 = load double, double* %12
%239 = fadd double %237, %238
%240 = load double*, double** %5
%241 = load i32, i32* %16
%242 = add nsw i32 %241, 1
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds double, double* %240, i64 %243
%245 = load double, double* %244
%246 = load double, double* %9
%247 = fmul double %245, %246
%248 = load double, double* %9
%249 = fmul double %247, %248
%250 = call double @llvm.fmuladd.f64(double %232, double %239, double %249)
%251 = load double, double* %10
%252 = fadd double %250, %251
%253 = load double*, double** %5
%254 = load i32, i32* %16
%255 = sext i32 %254 to i64
%256 = getelementptr inbounds double, double* %253, i64 %255
store double %252, double* %256
br label %257
257: ; preds = %203
%258 = load i32, i32* %16
%259 = add nsw i32 %258, 1
store i32 %259, i32* %16
br label %156
260: ; preds = %156
%261 = load double*, double** %5
%262 = load i32, i32* %16
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds double, double* %261, i64 %263
%265 = load double, double* %264
%266 = load double, double* %8
%267 = load double, double* %12
%268 = fneg double %267
%269 = call double @llvm.fmuladd.f64(double %265, double %266, double %268)
%270 = load double*, double** %5
%271 = load i32, i32* %16
%272 = sext i32 %271 to i64
%273 = getelementptr inbounds double, double* %270, i64 %272
store double %269, double* %273
%274 = load double*, double** %5
%275 = load i32, i32* %16
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds double, double* %274, i64 %276
%278 = load double, double* %277
%279 = load double, double* %9
%280 = fmul double %278, %279
%281 = load double*, double** %6
%282 = load i32, i32* %16
%283 = sub nsw i32 %282, 1
%284 = sext i32 %283 to i64
%285 = getelementptr inbounds double, double* %281, i64 %284
store double %280, double* %285
%286 = load double*, double** %5
%287 = load i32, i32* %16
%288 = sext i32 %287 to i64
%289 = getelementptr inbounds double, double* %286, i64 %288
%290 = load double, double* %289
%291 = load double, double* %8
%292 = load double, double* %10
%293 = call double @llvm.fmuladd.f64(double %290, double %291, double %292)
%294 = load double*, double** %5
%295 = load i32, i32* %16
%296 = sext i32 %295 to i64
%297 = getelementptr inbounds double, double* %294, i64 %296
store double %293, double* %297
br label %298
298: ; preds = %260
%299 = load i32, i32* %15
%300 = add nsw i32 %299, 1
store i32 %300, i32* %15
br label %23
301: ; preds = %126, %27
%302 = load i32, i32* %4
ret i32 %302
}

LLVM IR (-O2):
define i32 @qreval(double* nocapture %0, double* nocapture %1, i32 %2) {
%4 = icmp slt i32 %2, 2
br i1 %4, label %139, label %5
5: ; preds = %3
%6 = add nsw i32 %2, -1
%7 = shl i32 %2, 3
%8 = or i32 %7, 1
%9 = call i32 @llvm.smax.i32(i32 %8, i32 0)
%10 = getelementptr inbounds double, double* %0, i64 1
%11 = getelementptr inbounds double, double* %0, i64 1
br label %12
12: ; preds = %5, %121
%13 = phi i32 [ %17, %121 ], [ %6, %5 ]
%14 = phi i32 [ %137, %121 ], [ 0, %5 ]
%15 = phi double [ %123, %121 ], [ 0.000000e+00, %5 ]
br label %16
16: ; preds = %12, %53
%17 = phi i32 [ %13, %12 ], [ %54, %53 ]
%18 = add nsw i32 %17, -1
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds double, double* %1, i64 %19
%21 = load double, double* %20
%22 = tail call double @llvm.fabs.f64(double %21)
%23 = zext i32 %17 to i64
%24 = getelementptr inbounds double, double* %0, i64 %23
%25 = load double, double* %24
%26 = tail call double @llvm.fabs.f64(double %25)
%27 = fmul double %26, 1.000000e-15
%28 = fcmp ugt double %22, %27
br i1 %28, label %29, label %53
29: ; preds = %16
%30 = getelementptr inbounds double, double* %0, i64 %19
%31 = load double, double* %30
%32 = fsub double %31, %25
%33 = fmul double %32, 5.000000e-01
%34 = fmul double %21, %21
%35 = tail call double @llvm.fmuladd.f64(double %33, double %33, double %34)
%36 = tail call double @sqrt(double %35)
%37 = icmp ugt i32 %17, 1
%38 = add nsw i32 %17, -2
br i1 %37, label %39, label %48
39: ; preds = %29
%40 = zext i32 %38 to i64
%41 = getelementptr inbounds double, double* %1, i64 %40
%42 = load double, double* %41
%43 = tail call double @llvm.fabs.f64(double %42)
%44 = load double, double* %30
%45 = tail call double @llvm.fabs.f64(double %44)
%46 = fmul double %45, 1.000000e-15
%47 = fcmp ogt double %43, %46
br i1 %47, label %56, label %48
48: ; preds = %29, %39
%49 = load double, double* %24
%50 = fadd double %33, %49
%51 = fsub double %50, %36
store double %51, double* %24
%52 = fadd double %36, %50
store double %52, double* %30
br label %53
53: ; preds = %16, %48
%54 = phi i32 [ %38, %48 ], [ %18, %16 ]
%55 = icmp slt i32 %54, 1
br i1 %55, label %139, label %16
56: ; preds = %39
%57 = zext i32 %17 to i64
%58 = icmp eq i32 %14, %9
br i1 %58, label %139, label %59
59: ; preds = %56
%60 = fcmp ogt double %33, 0.000000e+00
%61 = load double, double* %24
%62 = fadd double %33, %61
%63 = fneg double %36
%64 = select i1 %60, double %63, double %36
%65 = fadd double %62, %64
%66 = load double, double* %0
%67 = fsub double %66, %65
store double %67, double* %0
%68 = icmp sgt i32 %17, 0
br i1 %68, label %69, label %121
69: ; preds = %59
%70 = load double, double* %1
%71 = fmul double %70, %70
%72 = tail call double @llvm.fmuladd.f64(double %67, double %67, double %71)
%73 = tail call double @sqrt(double %72)
%74 = load double, double* %10
store double %73, double* %0
%75 = fdiv double %67, %73
%76 = load double, double* %1
%77 = fdiv double %76, %73
%78 = fsub double %74, %65
store double %78, double* %11
%79 = fmul double %70, %77
%80 = fadd double %73, %79
%81 = fmul double %77, %78
%82 = fmul double %77, %81
%83 = tail call double @llvm.fmuladd.f64(double %75, double %80, double %82)
%84 = fadd double %65, %83
store double %84, double* %0
br label %85
85: ; preds = %69, %85
%86 = phi double [ %78, %69 ], [ %111, %85 ]
%87 = phi i64 [ 1, %69 ], [ %108, %85 ]
%88 = phi double [ %75, %69 ], [ %105, %85 ]
%89 = phi double [ %79, %69 ], [ %112, %85 ]
%90 = phi double [ %77, %69 ], [ %107, %85 ]
%91 = getelementptr inbounds double, double* %0, i64 %87
%92 = fneg double %89
%93 = tail call double @llvm.fmuladd.f64(double %86, double %88, double %92)
%94 = getelementptr inbounds double, double* %1, i64 %87
%95 = load double, double* %94
%96 = fmul double %88, %95
%97 = fmul double %95, %95
%98 = tail call double @llvm.fmuladd.f64(double %93, double %93, double %97)
%99 = tail call double @sqrt(double %98)
%100 = fmul double %90, %99
%101 = add nuw i64 %87, 4294967295
%102 = and i64 %101, 4294967295
%103 = getelementptr inbounds double, double* %1, i64 %102
store double %100, double* %103
%104 = fmul double %88, %99
store double %104, double* %91
%105 = fdiv double %93, %99
%106 = load double, double* %94
%107 = fdiv double %106, %99
%108 = add nuw nsw i64 %87, 1
%109 = getelementptr inbounds double, double* %0, i64 %108
%110 = load double, double* %109
%111 = fsub double %110, %65
store double %111, double* %109
%112 = fmul double %96, %107
%113 = fadd double %104, %112
%114 = fmul double %107, %111
%115 = fmul double %107, %114
%116 = tail call double @llvm.fmuladd.f64(double %105, double %113, double %115)
%117 = fadd double %65, %116
store double %117, double* %91
%118 = icmp eq i64 %108, %57
br i1 %118, label %119, label %85
119: ; preds = %85
%120 = load double, double* %24
br label %121
121: ; preds = %59, %119
%122 = phi double [ %120, %119 ], [ %67, %59 ]
%123 = phi double [ %107, %119 ], [ %15, %59 ]
%124 = phi double [ %112, %119 ], [ 0.000000e+00, %59 ]
%125 = phi double [ %105, %119 ], [ 1.000000e+00, %59 ]
%126 = phi i32 [ %17, %119 ], [ 0, %59 ]
%127 = zext i32 %126 to i64
%128 = getelementptr inbounds double, double* %0, i64 %127
%129 = fneg double %124
%130 = tail call double @llvm.fmuladd.f64(double %122, double %125, double %129)
store double %130, double* %128
%131 = fmul double %123, %130
%132 = add nsw i32 %126, -1
%133 = zext i32 %132 to i64
%134 = getelementptr inbounds double, double* %1, i64 %133
store double %131, double* %134
%135 = load double, double* %128
%136 = tail call double @llvm.fmuladd.f64(double %135, double %125, double %65)
store double %136, double* %128
%137 = add nuw nsw i32 %14, 1
%138 = icmp slt i32 %17, 1
br i1 %138, label %139, label %12
139: ; preds = %56, %121, %53, %3
%140 = phi i32 [ 0, %3 ], [ 0, %53 ], [ 0, %121 ], [ -1, %56 ]
ret i32 %140
}