#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 ql(double d[], double e[], int n) {
  int m, l, iter, i;
  double s, r, p, g, f, dd, c, b;
  e[n] = 0.0;
  for (l = 1; l <= n; l++) {
    iter = 0;
    do {
      for (m = l; m <= n - 1; m++) {
        dd = fabs(d[m]) + fabs(d[m + 1]);
        if (fabs(e[m]) + dd == dd) {
          break;
        }
      }
      if (m != l) {
        if (iter++ == 50) {
          return (1);
        }
        g = (d[l + 1] - d[l]) / (2.0 * e[l]);
        r = sqrt((g * g) + 1.0);
        g = d[m] - d[l] + e[l] / (g + ((g) < 0 ? -fabs(r) : fabs(r)));
        s = c = 1.0;
        p = 0.0;
        for (i = m - 1; i >= l; i--) {
          f = s * e[i];
          b = c * e[i];
          if (fabs(f) >= fabs(g)) {
            c = g / f;
            r = sqrt((c * c) + 1.0);
            e[i + 1] = f * r;
            c *= (s = 1.0 / r);
          } else {
            s = f / g;
            r = sqrt((s * s) + 1.0);
            e[i + 1] = g * r;
            s *= (c = 1.0 / r);
          }
          g = d[i + 1] - p;
          r = (d[i] - g) * s + 2.0 * c * b;
          p = s * r;
          d[i + 1] = g + p;
          g = c * r - b;
        }
        d[l] = d[l] - p;
        e[l] = g;
        e[m] = 0.0;
      }
    } while (m != l);
  }
  return (0);
}


x86 assembly (clang, -O0):
<ql>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     15c8 <ql+0x4b8>
movl   $0x0,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     11eb <ql+0xdb>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xe85(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xe68(%rip),%xmm2
pand   %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xe47(%rip),%xmm1
pand   %xmm1,%xmm0
addsd  -0x60(%rbp),%xmm0
ucomisd -0x60(%rbp),%xmm0
jne    11d8 <ql+0xc8>
jp     11d8 <ql+0xc8>
jmp    11eb <ql+0xdb>
jmp    11dd <ql+0xcd>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1156 <ql+0x46>
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     15a4 <ql+0x494>
mov    -0x28(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x28(%rbp)
cmp    $0x32,%eax
jne    1217 <ql+0x107>
movl   $0x1,-0x4(%rbp)
jmp    15cf <ql+0x4bf>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  0xdd2(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xda6(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    12f8 <ql+0x1e8>
movsd  -0x40(%rbp),%xmm0
movaps 0xd30(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    1310 <ql+0x200>
movsd  -0x40(%rbp),%xmm0
movaps 0xcfc(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x80(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm3
ff
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xccd(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xcc0(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jl     1563 <ql+0x453>
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm0
movaps 0xc54(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
movaps 0xc44(%rip),%xmm2
pand   %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     143a <ql+0x32a>
movsd  -0x50(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc21(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xbef(%rip),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    14a5 <ql+0x395>
movsd  -0x58(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xbb1(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xb7f(%rip),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  0xb38(%rip),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    1366 <ql+0x256>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    15a9 <ql+0x499>
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    1150 <ql+0x40>
jmp    15ba <ql+0x4aa>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113d <ql+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ql>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
movslq %edx,%r12
movq   $0x0,(%rsi,%r12,8)
test   %r12d,%r12d
jle    14d8 <ql+0x3c8>
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0x1(%rdx),%eax
mov    %rax,0x58(%rsp)
mov    $0x1,%ebp
movdqa 0xeb3(%rip),%xmm2
movsd  0xecb(%rip),%xmm5
xorpd  %xmm8,%xmm8
mov    %rdx,0x60(%rsp)
cmp    %ebp,%edx
mov    %ebp,%eax
cmovg  %edx,%eax
mov    %eax,0x28(%rsp)
lea    0x1(%rbp),%rax
mov    %rax,0x68(%rsp)
mov    %eax,%r14d
xor    %r13d,%r13d
mov    %r14,0x70(%rsp)
jmp    11b5 <ql+0xa5>
movsd  (%rbx,%rbp,8),%xmm9
movdqa 0xe72(%rip),%xmm2
mov    0x70(%rsp),%r14
mov    0x2c(%rsp),%r13d
subsd  %xmm6,%xmm9
add    $0x1,%r13d
movsd  %xmm9,(%rbx,%rbp,8)
movsd  %xmm7,(%r15,%rbp,8)
movq   $0x0,(%r15,%rax,8)
mov    %rbp,%rcx
nopl   0x0(%rax,%rax,1)
cmp    %r12,%rcx
jge    1200 <ql+0xf0>
lea    0x1(%rcx),%rax
movdqu (%rbx,%rcx,8),%xmm0
pand   %xmm2,%xmm0
pshufd $0xee,%xmm0,%xmm1
addsd  %xmm0,%xmm1
movq   (%r15,%rcx,8),%xmm0
pand   %xmm2,%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm1,%xmm0
mov    %rax,%rcx
jne    11c0 <ql+0xb0>
jp     11c0 <ql+0xb0>
add    $0xffffffff,%eax
jmp    1204 <ql+0xf4>
nopl   0x0(%rax)
mov    0x28(%rsp),%eax
mov    %eax,%eax
cmp    %rax,%rbp
je     14c0 <ql+0x3b0>
cmp    $0x32,%r13d
je     14dc <ql+0x3cc>
movsd  (%rbx,%r14,8),%xmm1
subsd  (%rbx,%rbp,8),%xmm1
movsd  (%r15,%rbp,8),%xmm0
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm5,%xmm0
ucomisd %xmm8,%xmm0
mov    %rax,0x8(%rsp)
jb     1250 <ql+0x140>
sqrtsd %xmm0,%xmm0
jmp    1273 <ql+0x163>
movsd  %xmm1,0x30(%rsp)
call   1030 <sqrt@plt>
movsd  0x30(%rsp),%xmm1
mov    0x8(%rsp),%rax
xorpd  %xmm8,%xmm8
movsd  0xdad(%rip),%xmm5
movsd  (%rbx,%rax,8),%xmm2
movsd  (%rbx,%rbp,8),%xmm9
subsd  %xmm9,%xmm2
movsd  (%r15,%rbp,8),%xmm7
movapd %xmm0,%xmm3
andpd  0xd6b(%rip),%xmm3
orpd   0xd73(%rip),%xmm0
xorpd  %xmm6,%xmm6
movapd %xmm1,%xmm4
cmpltsd %xmm6,%xmm4
andpd  %xmm4,%xmm0
andnpd %xmm3,%xmm4
orpd   %xmm0,%xmm4
addsd  %xmm1,%xmm4
divsd  %xmm4,%xmm7
addsd  %xmm2,%xmm7
cmp    %rax,%rbp
jae    14b0 <ql+0x3a0>
mov    %r13d,0x2c(%rsp)
xorpd  %xmm6,%xmm6
mov    %rax,%r14
movapd %xmm5,%xmm3
movapd %xmm5,%xmm4
jmp    13b7 <ql+0x2a7>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movapd %xmm7,0x30(%rsp)
movsd  %xmm6,0x20(%rsp)
movsd  %xmm3,0x18(%rsp)
movapd %xmm4,0x40(%rsp)
movsd  %xmm9,0x10(%rsp)
call   1030 <sqrt@plt>
movsd  0x10(%rsp),%xmm9
movapd 0x40(%rsp),%xmm4
movsd  0x18(%rsp),%xmm3
movsd  0x20(%rsp),%xmm6
movapd 0x30(%rsp),%xmm7
mov    0x8(%rsp),%rax
xorpd  %xmm8,%xmm8
movsd  0xcdb(%rip),%xmm5
mulsd  %xmm0,%xmm7
movapd %xmm5,%xmm1
divsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm4
movapd %xmm7,%xmm2
mulsd  %xmm9,%xmm3
movsd  %xmm2,(%r15,%r14,8)
movsd  -0x8(%rbx,%r14,8),%xmm7
movsd  (%rbx,%r14,8),%xmm0
subsd  %xmm6,%xmm0
subsd  %xmm0,%xmm7
movapd %xmm1,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm2
mulsd  %xmm4,%xmm7
addsd  %xmm2,%xmm7
movapd %xmm4,%xmm6
mulsd  %xmm7,%xmm6
addsd  %xmm6,%xmm0
movsd  %xmm0,(%rbx,%r14,8)
mulsd  %xmm1,%xmm7
subsd  %xmm3,%xmm7
mov    %r13,%r14
movapd %xmm1,%xmm3
cmp    %rbp,%r13
jle    1180 <ql+0x70>
lea    -0x1(%r14),%r13
movsd  -0x8(%r15,%r14,8),%xmm9
mulsd  %xmm9,%xmm4
movapd %xmm4,%xmm0
movapd 0xc2d(%rip),%xmm2
andpd  %xmm2,%xmm0
movapd %xmm7,%xmm1
andpd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jae    1410 <ql+0x300>
divsd  %xmm7,%xmm4
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm5,%xmm0
ucomisd %xmm8,%xmm0
jb     12f0 <ql+0x1e0>
sqrtsd %xmm0,%xmm0
jmp    1345 <ql+0x235>
nopl   0x0(%rax)
divsd  %xmm4,%xmm7
movapd %xmm7,%xmm0
mulsd  %xmm7,%xmm0
addsd  %xmm5,%xmm0
ucomisd %xmm8,%xmm0
jb     1430 <ql+0x320>
sqrtsd %xmm0,%xmm0
jmp    1485 <ql+0x375>
nopl   (%rax)
movapd %xmm7,0x30(%rsp)
movsd  %xmm6,0x20(%rsp)
movsd  %xmm3,0x18(%rsp)
movapd %xmm4,0x40(%rsp)
movsd  %xmm9,0x10(%rsp)
call   1030 <sqrt@plt>
movsd  0x10(%rsp),%xmm9
movapd 0x40(%rsp),%xmm4
movsd  0x18(%rsp),%xmm3
movsd  0x20(%rsp),%xmm6
movapd 0x30(%rsp),%xmm7
mov    0x8(%rsp),%rax
xorpd  %xmm8,%xmm8
movsd  0xb9b(%rip),%xmm5
mulsd  %xmm0,%xmm4
movapd %xmm4,%xmm2
movapd %xmm5,%xmm1
divsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm7
movapd %xmm1,%xmm4
movapd %xmm7,%xmm1
jmp    1359 <ql+0x249>
cs nopw 0x0(%rax,%rax,1)
movdqa 0xb48(%rip),%xmm2
jmp    1198 <ql+0x88>
nopl   (%rax)
mov    0x68(%rsp),%rax
mov    %rax,%rbp
cmp    0x58(%rsp),%rax
mov    0x60(%rsp),%rdx
jne    115f <ql+0x4f>
xor    %eax,%eax
jmp    14e1 <ql+0x3d1>
mov    $0x1,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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