#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 sqrt(int);
void jspleg1(double *pleg, double plat, int ktrunc, double *work) {
  int itout1, i1m, ilm, jm, jcn, im2;
  double zsin, zcos, zf1m, zre1, zf2m, znsqr, ze1, ze2;
  double zjmsqr;
  double *zhlp1, *zhlp2, *zhlp3;
  itout1 = ktrunc + 1;
  zsin = plat;
  zcos = sqrt(1. - zsin * zsin);
  zhlp1 = work;
  zhlp2 = work + itout1;
  zhlp3 = work + itout1 + itout1;
  ilm = 1;
  pleg[0] = 1.0;
  zf1m = sqrt(3.0);
  pleg[1] = zf1m * zsin;
  for (jm = 1; jm < itout1; jm++) {
    zhlp1[jm] = sqrt(2. * jm + 3.);
    zhlp2[jm] = 1. / sqrt(2. * jm);
  }
  zhlp1[0] = sqrt(3.);
  for (jm = 0; jm < itout1; jm++) {
    i1m = jm - 1;
    zre1 = zhlp1[jm];
    ze1 = 1. / zre1;
    if (i1m != -1) {
      zf2m = zf1m * zcos * zhlp2[jm];
      zf1m = zf2m * zre1;
      ilm = ilm + 1;
      pleg[ilm] = zf2m;
      ilm = ilm + 1;
      pleg[ilm] = zf1m * zsin;
      if (jm == (itout1 - 1))
        break;
    }
    zjmsqr = jm * jm;
    im2 = i1m + 2;
    for (jcn = im2; jcn < itout1; jcn++) {
      znsqr = (jcn + 1) * (jcn + 1);
      zhlp3[jcn] = sqrt((4. * znsqr - 1.) / (znsqr - zjmsqr));
    }
    for (jcn = im2; jcn < itout1; jcn++) {
      ze2 = zhlp3[jcn];
      ilm = ilm + 1;
      pleg[ilm] = ze2 * (zsin * pleg[ilm - 1] - ze1 * pleg[ilm - 2]);
      ze1 = 1. / ze2;
    }
  }
}


x86 assembly (clang, -O0):
<jspleg1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe95(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x90(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x98(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xe2a(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    $0x3,%edi
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    128d <jspleg1+0x17d>
cvtsi2sdl -0x30(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xdfc(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm0
mov    -0x88(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
cvtsi2sdl -0x30(%rbp),%xmm1
movsd  0xdc6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd95(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x90(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1207 <jspleg1+0xf7>
mov    $0x3,%edi
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm0
mov    -0x88(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    14d6 <jspleg1+0x3c6>
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x88(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xd21(%rip),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
cmpl   $0xffffffff,-0x28(%rbp)
je     1377 <jspleg1+0x267>
movsd  -0x50(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    -0x90(%rbp),%rax
movslq -0x30(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1372 <jspleg1+0x262>
jmp    14d6 <jspleg1+0x3c6>
jmp    1377 <jspleg1+0x267>
mov    -0x30(%rbp),%eax
imul   -0x30(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x28(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1410 <jspleg1+0x300>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0xc41(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc3d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x68(%rbp),%xmm1
subsd  -0x80(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm0
mov    -0x98(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1396 <jspleg1+0x286>
mov    -0x38(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    14c3 <jspleg1+0x3b3>
mov    -0x98(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0x70(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xb55(%rip),%xmm0
divsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1416 <jspleg1+0x306>
jmp    14c8 <jspleg1+0x3b8>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12ad <jspleg1+0x19d>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jspleg1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdx,%r12
mov    %esi,%r15d
movsd  %xmm0,0x18(%rsp)
mov    %rdi,%rbx
lea    0x1(%r15),%ebp
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xebf(%rip),%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sqrt@plt>
mov    %eax,0xc(%rsp)
mov    %ebp,0x10(%rsp)
movslq %ebp,%r14
lea    (%r12,%r14,8),%r13
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rbx)
mov    $0x3,%edi
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x20(%rsp)
mulsd  0x18(%rsp),%xmm0
mov    %rbx,0x28(%rsp)
movsd  %xmm0,0x8(%rbx)
test   %r15d,%r15d
jle    11fd <jspleg1+0xed>
mov    0x10(%rsp),%ebp
mov    $0x1,%ebx
nop
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x30(%rsp)
addsd  0xe4f(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r12,%rbx,8)
cvttsd2si 0x30(%rsp),%edi
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xe17(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x0(%r13,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11a0 <jspleg1+0x90>
mov    $0x3,%edi
call   1030 <sqrt@plt>
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movsd  %xmm2,(%r12)
test   %r15d,%r15d
movsd  0x18(%rsp),%xmm3
movsd  0x20(%rsp),%xmm1
js     1461 <jspleg1+0x351>
mov    %r12,%r8
xorps  %xmm0,%xmm0
cvtsi2sdl 0xc(%rsp),%xmm0
movsd  %xmm0,0x68(%rsp)
lea    0x0(,%r14,8),%rbp
add    %r13,%rbp
mov    %r15d,%r9d
mov    0x10(%rsp),%ebx
shl    $0x4,%r14
lea    (%r14,%r12,1),%rsi
add    $0x8,%rsi
mov    0x28(%rsp),%rax
add    $0x8,%rax
mov    %rax,0x58(%rsp)
mov    $0x1,%edx
mov    $0x1,%edi
xor    %r12d,%r12d
movsd  0xd94(%rip),%xmm4
movsd  0xd94(%rip),%xmm5
mov    %r9,%r15
mov    %r8,0x40(%rsp)
mov    %r13,0x38(%rsp)
mov    %r9,0x60(%rsp)
test   %r12,%r12
je     12e1 <jspleg1+0x1d1>
nopl   0x0(%rax,%rax,1)
mulsd  0x68(%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  0x0(%r13,%r12,8),%xmm0
movapd %xmm2,%xmm1
mulsd  %xmm0,%xmm1
movslq %edx,%rax
mov    0x28(%rsp),%rcx
movsd  %xmm0,0x8(%rcx,%rax,8)
movapd %xmm1,%xmm0
mulsd  %xmm3,%xmm0
movsd  %xmm0,0x10(%rcx,%rax,8)
cmp    %r9,%r12
je     1461 <jspleg1+0x351>
add    $0x2,%edx
lea    0x1(%r12),%rax
cmp    %r9,%r12
jae    1439 <jspleg1+0x329>
mov    %rax,0x48(%rsp)
movsd  %xmm2,0x70(%rsp)
mov    %edx,0xc(%rsp)
mov    %rsi,0x10(%rsp)
movsd  %xmm1,0x20(%rsp)
mov    %r12d,%eax
imul   %r12d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x30(%rsp)
mov    %rdi,0x50(%rsp)
mov    %rdi,%r13
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%r13),%r14
mov    %r14d,%eax
imul   %r14d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm5,%xmm1
subsd  0x30(%rsp),%xmm0
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sqrt@plt>
movsd  0xcaf(%rip),%xmm5
movsd  0xc9f(%rip),%xmm4
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x0(%rbp,%r13,8)
mov    %r14,%r13
cmp    %r14,%rbx
jne    1330 <jspleg1+0x220>
mov    0x60(%rsp),%r9
cmp    %r9,%r12
jae    1410 <jspleg1+0x300>
mov    0xc(%rsp),%edx
movslq %edx,%rax
mov    0x28(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm0
mov    0x58(%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
xor    %eax,%eax
mov    0x40(%rsp),%r8
movsd  0x18(%rsp),%xmm3
mov    0x38(%rsp),%r13
mov    0x10(%rsp),%rsi
movsd  0x70(%rsp),%xmm2
nopl   0x0(%rax,%rax,1)
movapd %xmm5,%xmm1
divsd  %xmm2,%xmm1
movsd  (%rsi,%rax,8),%xmm2
mulsd  -0x10(%rcx,%rax,8),%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,(%rcx,%rax,8)
add    $0x1,%rax
cmp    %eax,%r15d
jne    13d0 <jspleg1+0x2c0>
add    %eax,%edx
movsd  0x20(%rsp),%xmm1
jmp    142f <jspleg1+0x31f>
nopw   0x0(%rax,%rax,1)
mov    0x40(%rsp),%r8
movsd  0x18(%rsp),%xmm3
mov    0x38(%rsp),%r13
movsd  0x20(%rsp),%xmm1
mov    0x10(%rsp),%rsi
mov    0xc(%rsp),%edx
mov    0x50(%rsp),%rdi
mov    0x48(%rsp),%rax
cmp    %rbx,%rax
je     1461 <jspleg1+0x351>
add    $0x1,%rdi
movsd  (%r8,%rax,8),%xmm2
add    $0x8,%rsi
add    $0xffffffffffffffff,%r15
mov    %rax,%r12
test   %r12,%r12
jne    12a0 <jspleg1+0x190>
jmp    12e1 <jspleg1+0x1d1>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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