void phcs(double *pnm, double *hnm, int waves, double pmu, double *ztemp1,
          double *ztemp2) {
  int twowaves;
  int jk, jn, jm;
  double jnmjk;
  double zcos2;
  double lat;
  double zan;
  double zsinpar;
  double zcospar;
  double zsqp;
  double zcosfak;
  double zsinfak;
  double zq;
  double zwm2;
  double zw;
  double zwq;
  double zq2m1;
  double zwm2q2;
  double z2q2;
  double zcnm;
  double zdnm;
  double zenm;
  twowaves = waves << 1;
  zcos2 = sqrt(1.0 - pmu * pmu);
  lat = acos(pmu);
  zan = 1.0;
  ztemp1[0] = 0.5;
  for (jn = 1; jn < twowaves; jn++) {
    zsqp = 1.0 / sqrt((double)(jn + jn * jn));
    zan *= sqrt(1.0 - 1.0 / (4 * jn * jn));
    zcospar = cos(lat * jn);
    zsinpar = sin(lat * jn) * jn * zsqp;
    zcosfak = 1.0;
    for (jk = 2; jk < jn; jk += 2) {
      jnmjk = jn - jk;
      zcosfak *= (jk - 1.0) * (jn + jnmjk + 2.0) / (jk * (jn + jnmjk + 1.0));
      zsinfak = zcosfak * (jnmjk)*zsqp;
      zcospar += zcosfak * cos(lat * jnmjk);
      zsinpar += zsinfak * sin(lat * jnmjk);
    }
    if ((jn & 1) == 0) {
      zcosfak *= (double)((jn - 1) * (jn + 2)) / (double)(jn * (jn + 1));
      zcospar += zcosfak * 0.5;
    }
    ztemp1[jn] = zan * zcospar;
    ztemp2[jn - 1] = zan * zsinpar;
  }
  memcpy(pnm, ztemp1, waves * sizeof(double));
  pnm += waves;
  memcpy(pnm, ztemp2, waves * sizeof(double));
  pnm += waves;
  hnm[0] = 0.0;
  for (jn = 1; jn < waves; jn++)
    hnm[jn] = jn * (pmu * ztemp1[jn] -
                    sqrt((jn + jn + 1.0) / (jn + jn - 1.0)) * ztemp1[jn - 1]);
  hnm += waves;
  hnm[0] = pmu * ztemp2[0];
  for (jn = 1; jn < waves; jn++)
    hnm[jn] = (jn + 1) * pmu * ztemp2[jn] -
              sqrt(((jn + jn + 3.0) * ((jn + 1) * (jn + 1) - 1.0)) /
                   (jn + jn + 1.0)) *
                  ztemp2[jn - 1];
  hnm += waves;
  for (jm = 2; jm < waves; jm++) {
    pnm[0] = sqrt(1.0 + 1.0 / (jm + jm)) * zcos2 * ztemp2[0];
    hnm[0] = jm * pmu * pnm[0];
    for (jn = 1; jn < twowaves - jm; jn++) {
      zq = jm + jm + jn - 1;
      zwm2 = zq + jn;
      zw = zwm2 + 2;
      zwq = zw * zq;
      zq2m1 = zq * zq - 1.;
      zwm2q2 = zwm2 * zq2m1;
      z2q2 = zq2m1 * 2;
      zcnm = sqrt((zwq * (zq - 2.)) / (zwm2q2 - z2q2));
      zdnm = sqrt((zwq * (jn + 1.)) / zwm2q2);
      zenm = sqrt(zw * jn / ((zq + 1.0) * zwm2));
      pnm[jn] = zcnm * ztemp1[jn] -
                pmu * (zdnm * ztemp1[jn + 1] - zenm * pnm[jn - 1]);
      hnm[jn] = (jm + jn) * pmu * pnm[jn] -
                sqrt(zw * jn * (zq + 1) / zwm2) * pnm[jn - 1];
    }
    memcpy(ztemp1, ztemp2, twowaves * sizeof(double));
    memcpy(ztemp2, pnm, twowaves * sizeof(double));
    pnm += waves;
    hnm += waves;
  }
}


x86 assembly (clang, -O0):
<phcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x34(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe5f(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <acos@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  0xe3a(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movsd  0xe21(%rip),%xmm0
movsd  %xmm0,(%rax)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1453 <phcs+0x303>
mov    -0x3c(%rbp),%eax
mov    -0x3c(%rbp),%ecx
imul   -0x3c(%rbp),%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xdf2(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x3c(%rbp),%eax
shl    $0x2,%eax
imul   -0x3c(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xdd3(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xdc7(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <sin@plt>
cvtsi2sdl -0x3c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xd6e(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    13b3 <phcs+0x263>
mov    -0x3c(%rbp),%eax
sub    -0x38(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl -0x38(%rbp),%xmm0
movsd  0xd3a(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
addsd  -0x48(%rbp),%xmm1
movsd  0xd2c(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
cvtsi2sdl -0x3c(%rbp),%xmm2
addsd  -0x48(%rbp),%xmm2
movsd  0xd05(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0xe8(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0xe0(%rbp),%xmm0
ff
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x38(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x38(%rbp)
jmp    12a6 <phcs+0x156>
mov    -0x3c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1412 <phcs+0x2c2>
mov    -0x3c(%rbp),%eax
sub    $0x1,%eax
mov    -0x3c(%rbp),%ecx
add    $0x2,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
mov    -0x3c(%rbp),%eax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
movsd  0xbfb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11ea <phcs+0x9a>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
movslq -0x14(%rbp),%rdx
shl    $0x3,%rdx
call   1050 <memcpy@plt>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
movslq -0x14(%rbp),%rdx
shl    $0x3,%rdx
call   1050 <memcpy@plt>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1594 <phcs+0x444>
cvtsi2sdl -0x3c(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
mov    -0x3c(%rbp),%eax
add    -0x3c(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xb02(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x3c(%rbp),%eax
add    -0x3c(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xaec(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  -0x100(%rbp),%xmm1
ff
movsd  -0xf8(%rbp),%xmm3
ff
movaps %xmm0,%xmm2
movsd  -0xf0(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%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    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    14b9 <phcs+0x369>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    16b4 <phcs+0x564>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
mov    -0x3c(%rbp),%eax
add    -0x3c(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xa11(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0x9da(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x3c(%rbp),%eax
add    -0x3c(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0x9c0(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  -0x110(%rbp),%xmm2
ff
movaps %xmm0,%xmm1
movsd  -0x108(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    15c5 <phcs+0x475>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movl   $0x2,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1a6c <phcs+0x91c>
mov    -0x40(%rbp),%eax
add    -0x40(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0x91a(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0x90e(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
mulsd  -0x50(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
cvtsi2sdl -0x40(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x34(%rbp),%ecx
sub    -0x40(%rbp),%ecx
cmp    %ecx,%eax
jge    1a0a <phcs+0x8ba>
mov    -0x40(%rbp),%eax
add    -0x40(%rbp),%eax
add    -0x3c(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
cvtsi2sdl -0x3c(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0x88d(%rip),%xmm0
addsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  0x851(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0x81d(%rip),%xmm0
mulsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  0x7f5(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0xb8(%rbp),%xmm1
ff
subsd  -0xc0(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
cvtsi2sdl -0x3c(%rbp),%xmm1
movsd  0x7af(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
divsd  -0xb8(%rbp),%xmm0
ff
call   1070 <sqrt@plt>
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
cvtsi2sdl -0x3c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x779(%rip),%xmm1
addsd  -0x90(%rbp),%xmm1
ff
mulsd  -0x98(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x20(%rbp),%xmm1
movsd  -0xd0(%rbp),%xmm3
ff
mov    -0x28(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm5
movsd  -0xd8(%rbp),%xmm4
ff
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    -0x3c(%rbp),%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
cvtsi2sdl -0x3c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x676(%rip),%xmm1
addsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
divsd  -0x98(%rbp),%xmm0
ff
call   1070 <sqrt@plt>
movsd  -0x120(%rbp),%xmm2
ff
movaps %xmm0,%xmm1
movsd  -0x118(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1739 <phcs+0x5e9>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
movslq -0x34(%rbp),%rdx
shl    $0x3,%rdx
call   1050 <memcpy@plt>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x34(%rbp),%rdx
shl    $0x3,%rdx
call   1050 <memcpy@plt>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    16d0 <phcs+0x580>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phcs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %r8,%r15
mov    %rcx,%rbx
mov    %rsi,0x80(%rsp)
mov    %rdi,%r12
lea    (%rdx,%rdx,1),%eax
mov    %eax,0x14(%rsp)
movsd  %xmm0,0x18(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe71(%rip),%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %rdx,0x60(%rsp)
jb     11a8 <phcs+0x58>
sqrtsd %xmm0,%xmm0
jmp    11ad <phcs+0x5d>
call   1070 <sqrt@plt>
movsd  %xmm0,0xa0(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <acos@plt>
movabs $0x3fe0000000000000,%rax
mov    %rbx,0x68(%rsp)
mov    %rax,(%rbx)
cmpl   $0x2,0x14(%rsp)
mov    %r15,0x88(%rsp)
movsd  0xe18(%rip),%xmm2
jl     149f <phcs+0x34f>
mov    0x14(%rsp),%r13d
mov    $0x1,%ebp
mov    $0xffffffff,%r14d
movapd %xmm2,%xmm1
movsd  %xmm0,0x30(%rsp)
jmp    125a <phcs+0x10a>
nopw   0x0(%rax,%rax,1)
mov    0x88(%rsp),%r15
movsd  0xde0(%rip),%xmm2
movsd  0x58(%rsp),%xmm1
movsd  0x50(%rsp),%xmm0
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm3
mov    0x68(%rsp),%rax
movsd  %xmm3,(%rax,%rbp,8)
mulsd  %xmm1,%xmm4
movsd  %xmm4,-0x8(%r15,%rbp,8)
add    $0x1,%rbp
add    $0x1,%r14d
cmp    %r13,%rbp
je     149f <phcs+0x34f>
mov    %ebp,%eax
imul   %ebp,%eax
add    %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ucomisd 0xdc0(%rip),%xmm0
movsd  %xmm1,0x58(%rsp)
jb     1290 <phcs+0x140>
xorps  %xmm3,%xmm3
sqrtsd %xmm0,%xmm3
jmp    12a1 <phcs+0x151>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1070 <sqrt@plt>
movsd  0xd63(%rip),%xmm2
movapd %xmm0,%xmm3
mov    %ebp,%eax
imul   %ebp,%eax
shl    $0x2,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm2,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
ucomisd 0xd68(%rip),%xmm0
jb     12d0 <phcs+0x180>
sqrtsd %xmm0,%xmm0
jmp    12e9 <phcs+0x199>
movsd  %xmm3,0x8(%rsp)
call   1070 <sqrt@plt>
movsd  0x8(%rsp),%xmm3
movsd  0xd17(%rip),%xmm2
movsd  %xmm0,0x50(%rsp)
movsd  0x30(%rsp),%xmm0
divsd  %xmm3,%xmm2
movsd  %xmm2,0x70(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movsd  %xmm1,0x38(%rsp)
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1060 <cos@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
movsd  0x38(%rsp),%xmm1
movsd  0x70(%rsp),%xmm3
movapd %xmm0,%xmm4
mulsd  %xmm1,%xmm4
mulsd  %xmm3,%xmm4
cmp    $0x3,%rbp
jb     1450 <phcs+0x300>
mov    $0x2,%ebx
mov    %r14d,%r15d
movsd  0xcaa(%rip),%xmm2
movapd %xmm2,%xmm6
movsd  0xc96(%rip),%xmm5
nopw   0x0(%rax,%rax,1)
movapd %xmm6,0x90(%rsp)
movsd  %xmm4,0x20(%rsp)
xorps  %xmm4,%xmm4
cvtsi2sd %r15d,%xmm4
movapd %xmm1,%xmm0
addsd  %xmm4,%xmm0
movapd %xmm6,%xmm1
unpcklpd %xmm0,%xmm1
addsd  %xmm2,%xmm0
addpd  0xc9d(%rip),%xmm1
unpcklpd %xmm6,%xmm0
mulpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm5
movsd  %xmm5,0x8(%rsp)
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm5
mulsd  %xmm3,%xmm5
movsd  %xmm5,0x40(%rsp)
mulsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x78(%rsp)
call   1060 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
movsd  0x78(%rsp),%xmm0
call   1040 <sin@plt>
movapd 0x90(%rsp),%xmm6
movsd  0x38(%rsp),%xmm1
movsd  0x8(%rsp),%xmm5
movsd  0x70(%rsp),%xmm3
movsd  0x20(%rsp),%xmm4
movsd  0xbda(%rip),%xmm2
mulsd  0x40(%rsp),%xmm0
addsd  %xmm0,%xmm4
addsd  %xmm2,%xmm6
add    $0x2,%rbx
add    $0xfffffffe,%r15d
cmp    %rbx,%rbp
ja     1370 <phcs+0x220>
jmp    1458 <phcs+0x308>
nop
movsd  0xba8(%rip),%xmm5
movsd  0x28(%rsp),%xmm3
test   $0x1,%bpl
jne    1210 <phcs+0xc0>
lea    -0x1(%rbp),%rax
lea    0x2(%rbp),%ecx
imul   %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0x1(%rbp),%eax
imul   %ebp,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mulsd  %xmm5,%xmm0
mulsd  0xb7a(%rip),%xmm0
addsd  %xmm0,%xmm3
jmp    1210 <phcs+0xc0>
mov    0x60(%rsp),%r13
movslq %r13d,%rbp
lea    0x0(,%rbp,8),%rbx
mov    %r12,%rdi
mov    0x68(%rsp),%r14
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <memcpy@plt>
mov    %rbp,0x48(%rsp)
lea    (%r12,%rbp,8),%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <memcpy@plt>
mov    0x80(%rsp),%rax
movq   $0x0,(%rax)
cmp    $0x1,%r13d
jle    15b1 <phcs+0x461>
mov    %rbp,0x30(%rsp)
mov    %rbx,0xb0(%rsp)
mov    %r13d,%ecx
mov    %rcx,0x38(%rsp)
mov    $0x1,%ebx
mov    $0x2,%ebp
xorpd  %xmm2,%xmm2
movsd  0xae3(%rip),%xmm3
mov    0x48(%rsp),%r13
jmp    1584 <phcs+0x434>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm4,0x8(%rsp)
call   1070 <sqrt@plt>
movsd  0x8(%rsp),%xmm4
xorpd  %xmm2,%xmm2
mov    0x80(%rsp),%rax
movsd  0xaab(%rip),%xmm3
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mulsd  -0x8(%r14,%rbx,8),%xmm0
mulsd  0x18(%rsp),%xmm4
subsd  %xmm0,%xmm4
mulsd  %xmm1,%xmm4
movsd  %xmm4,(%rax,%rbx,8)
add    $0x1,%rbx
add    $0x2,%ebp
cmp    %rbx,0x38(%rsp)
je     15cb <phcs+0x47b>
movsd  (%r14,%rbx,8),%xmm4
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movapd %xmm1,%xmm0
addsd  %xmm3,%xmm0
addsd  0xa77(%rip),%xmm1
divsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jb     1530 <phcs+0x3e0>
sqrtsd %xmm0,%xmm0
jmp    1555 <phcs+0x405>
movsd  0x18(%rsp),%xmm0
mulsd  (%r15),%xmm0
mov    0x48(%rsp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1a7c <phcs+0x92c>
movsd  (%r15),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%rax,%r13,8)
cmpl   $0x2,0x60(%rsp)
jl     1a7c <phcs+0x92c>
mov    %rax,%rcx
mov    0x48(%rsp),%rax
lea    (%rcx,%rax,8),%r13
mov    $0x1,%r14d
sub    0x38(%rsp),%r14
mov    $0x2,%ebp
mov    $0x2,%ebx
movsd  0xa10(%rip),%xmm4
xorpd  %xmm5,%xmm5
jmp    167d <phcs+0x52d>
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm6,0x8(%rsp)
call   1070 <sqrt@plt>
movsd  0x8(%rsp),%xmm6
xorpd  %xmm5,%xmm5
movsd  0x9e3(%rip),%xmm4
movsd  0x9bb(%rip),%xmm3
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mulsd  0x18(%rsp),%xmm1
mulsd  %xmm6,%xmm1
mulsd  -0x10(%r15,%rbx,8),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,-0x8(%r13,%rbx,8)
add    $0x2,%ebp
lea    (%r14,%rbx,1),%rax
add    $0x1,%rax
add    $0x1,%rbx
cmp    $0x2,%rax
je     16be <phcs+0x56e>
movsd  -0x8(%r15,%rbx,8),%xmm6
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movapd %xmm1,%xmm2
addsd  %xmm4,%xmm2
mov    %ebx,%eax
imul   %ebx,%eax
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm1
divsd  %xmm1,%xmm0
ucomisd %xmm5,%xmm0
jb     1620 <phcs+0x4d0>
sqrtsd %xmm0,%xmm0
jmp    1645 <phcs+0x4f5>
mov    %r13,0x58(%rsp)
cmpl   $0x3,0x38(%rsp)
mov    0x80(%rsp),%rcx
mov    0x30(%rsp),%rbx
jl     1a7c <phcs+0x92c>
mov    0x14(%rsp),%eax
movslq %eax,%rdx
mov    %rdx,0x60(%rsp)
lea    0x0(,%rdx,8),%rdx
mov    %rdx,0xa8(%rsp)
add    $0xfffffffe,%eax
mov    %eax,0x14(%rsp)
mov    0x48(%rsp),%rax
shl    $0x4,%rax
add    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x78(%rsp)
add    %rax,%r12
mov    $0x2,%ebp
mov    $0x3,%r13d
mov    $0x4,%r14d
jmp    179c <phcs+0x64c>
nopl   0x0(%rax)
mov    0x68(%rsp),%rdi
mov    0x88(%rsp),%r15
mov    %r15,%rsi
mov    0xa8(%rsp),%rbp
mov    %rbp,%rdx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    0x30(%rsp),%rbx
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1050 <memcpy@plt>
mov    0x50(%rsp),%rbp
add    $0x1,%rbp
addl   $0xffffffff,0x14(%rsp)
add    $0x1,%r13
mov    0xb0(%rsp),%rax
add    %rax,0x78(%rsp)
add    %rax,%r12
add    $0x2,%r14
cmp    0x38(%rsp),%rbp
movsd  0x86a(%rip),%xmm3
je     1a7c <phcs+0x92c>
lea    0x0(%rbp,%rbp,1),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movapd %xmm3,%xmm0
divsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
ucomisd 0x875(%rip),%xmm0
jb     17d0 <phcs+0x680>
sqrtsd %xmm0,%xmm0
jmp    17d5 <phcs+0x685>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1070 <sqrt@plt>
mulsd  0xa0(%rsp),%xmm0
mov    0x48(%rsp),%rax
lea    (%rbx,%rax,8),%rbx
mov    0x58(%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
mulsd  (%r15),%xmm0
mov    %rbx,0x30(%rsp)
movsd  %xmm0,(%rbx)
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
mulsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mov    %rcx,0x58(%rsp)
movsd  %xmm1,(%rcx)
mov    0x60(%rsp),%rax
mov    %rbp,0x50(%rsp)
sub    %rbp,%rax
cmp    $0x2,%rax
jl     1730 <phcs+0x5e0>
mov    0x14(%rsp),%ebx
add    $0xffffffffffffffff,%rbx
xor    %r15d,%r15d
jmp    1888 <phcs+0x738>
nopl   0x0(%rax)
movapd %xmm2,%xmm0
movsd  %xmm5,0x20(%rsp)
call   1070 <sqrt@plt>
movsd  0x20(%rsp),%xmm5
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
mulsd  0x18(%rsp),%xmm1
mulsd  (%r12,%r15,8),%xmm0
mulsd  %xmm5,%xmm1
subsd  %xmm0,%xmm1
mov    0x78(%rsp),%rax
movsd  %xmm1,(%rax,%r15,8)
add    $0x1,%r15
cmp    %r15,%rbx
je     1730 <phcs+0x5e0>
lea    (%r14,%r15,1),%eax
xorps  %xmm3,%xmm3
cvtsi2sd %eax,%xmm3
lea    0x1(%r15),%eax
xorps  %xmm8,%xmm8
cvtsi2sd %eax,%xmm8
movapd %xmm8,%xmm4
addsd  %xmm3,%xmm4
movapd %xmm4,%xmm5
addsd  0x753(%rip),%xmm5
movapd %xmm5,%xmm7
mulsd  %xmm3,%xmm7
movapd %xmm3,%xmm1
mulsd  %xmm3,%xmm1
addsd  0x74b(%rip),%xmm1
movapd %xmm4,%xmm6
mulsd  %xmm1,%xmm6
addsd  %xmm1,%xmm1
movapd %xmm3,%xmm0
addsd  0x743(%rip),%xmm0
mulsd  %xmm7,%xmm0
movapd %xmm6,%xmm2
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
ucomisd 0x733(%rip),%xmm0
movsd  %xmm3,0x8(%rsp)
movsd  %xmm4,0x90(%rsp)
movsd  %xmm5,0x28(%rsp)
movsd  %xmm8,0x40(%rsp)
jb     1930 <phcs+0x7e0>
xorps  %xmm2,%xmm2
sqrtsd %xmm0,%xmm2
jmp    1958 <phcs+0x808>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm7,0x20(%rsp)
movsd  %xmm6,0x70(%rsp)
call   1070 <sqrt@plt>
movsd  0x70(%rsp),%xmm6
movsd  0x20(%rsp),%xmm7
movsd  0x40(%rsp),%xmm8
movapd %xmm0,%xmm2
movsd  0x6a0(%rip),%xmm1
movapd %xmm8,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm7,%xmm0
divsd  %xmm6,%xmm0
ucomisd 0x6b7(%rip),%xmm0
movsd  %xmm2,0x20(%rsp)
jb     1990 <phcs+0x840>
xorps  %xmm7,%xmm7
sqrtsd %xmm0,%xmm7
jmp    19a8 <phcs+0x858>
nopw   0x0(%rax,%rax,1)
call   1070 <sqrt@plt>
movsd  0x40(%rsp),%xmm8
movsd  0x65c(%rip),%xmm1
movapd %xmm0,%xmm7
movsd  0x8(%rsp),%xmm2
movsd  0x90(%rsp),%xmm3
movsd  0x28(%rsp),%xmm4
mulsd  %xmm8,%xmm4
addsd  %xmm1,%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm3,%xmm1
movapd %xmm4,%xmm0
divsd  %xmm1,%xmm0
ucomisd 0x652(%rip),%xmm0
jb     19f0 <phcs+0x8a0>
sqrtsd %xmm0,%xmm0
jmp    1a22 <phcs+0x8d2>
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm4,0x28(%rsp)
movsd  %xmm7,0x40(%rsp)
call   1070 <sqrt@plt>
movsd  0x40(%rsp),%xmm7
movsd  0x28(%rsp),%xmm4
movsd  0x90(%rsp),%xmm3
movsd  0x8(%rsp),%xmm2
movsd  0x20(%rsp),%xmm5
mulsd  (%r12,%r15,8),%xmm0
mov    0x68(%rsp),%rax
mulsd  0x10(%rax,%r15,8),%xmm7
subsd  %xmm0,%xmm7
mulsd  0x8(%rax,%r15,8),%xmm5
mulsd  0x18(%rsp),%xmm7
subsd  %xmm7,%xmm5
movsd  %xmm5,0x8(%r12,%r15,8)
lea    (%r15,%r13,1),%ebp
mulsd  %xmm4,%xmm2
divsd  %xmm3,%xmm2
ucomisd 0x5c6(%rip),%xmm2
jb     1840 <phcs+0x6f0>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1855 <phcs+0x705>
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @phcs(double* %0, double* %1, i32 %2, double %3, double* %4, double* %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%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
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
store double* %0, double** %7
store double* %1, double** %8
store i32 %2, i32* %9
store double %3, double* %10
store double* %4, double** %11
store double* %5, double** %12
%36 = load i32, i32* %9
%37 = shl i32 %36, 1
store i32 %37, i32* %13
%38 = load double, double* %10
%39 = load double, double* %10
%40 = fneg double %38
%41 = call double @llvm.fmuladd.f64(double %40, double %39, double 1.000000e+00)
%42 = call double @sqrt(double %41)
store double %42, double* %18
%43 = load double, double* %10
%44 = call double @acos(double %43)
store double %44, double* %19
store double 1.000000e+00, double* %20
%45 = load double*, double** %11
%46 = getelementptr inbounds double, double* %45, i64 0
store double 5.000000e-01, double* %46
store i32 1, i32* %15
br label %47
47: ; preds = %174, %6
%48 = load i32, i32* %15
%49 = load i32, i32* %13
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %177
51: ; preds = %47
%52 = load i32, i32* %15
%53 = load i32, i32* %15
%54 = load i32, i32* %15
%55 = mul nsw i32 %53, %54
%56 = add nsw i32 %52, %55
%57 = sitofp i32 %56 to double
%58 = call double @sqrt(double %57)
%59 = fdiv double 1.000000e+00, %58
store double %59, double* %23
%60 = load i32, i32* %15
%61 = mul nsw i32 4, %60
%62 = load i32, i32* %15
%63 = mul nsw i32 %61, %62
%64 = sitofp i32 %63 to double
%65 = fdiv double 1.000000e+00, %64
%66 = fsub double 1.000000e+00, %65
%67 = call double @sqrt(double %66)
%68 = load double, double* %20
%69 = fmul double %68, %67
store double %69, double* %20
%70 = load double, double* %19
%71 = load i32, i32* %15
%72 = sitofp i32 %71 to double
%73 = fmul double %70, %72
%74 = call double @cos(double %73)
store double %74, double* %22
%75 = load double, double* %19
%76 = load i32, i32* %15
%77 = sitofp i32 %76 to double
%78 = fmul double %75, %77
%79 = call double @sin(double %78)
%80 = load i32, i32* %15
%81 = sitofp i32 %80 to double
%82 = fmul double %79, %81
%83 = load double, double* %23
%84 = fmul double %82, %83
store double %84, double* %21
store double 1.000000e+00, double* %24
store i32 2, i32* %14
br label %85
85: ; preds = %133, %51
%86 = load i32, i32* %14
%87 = load i32, i32* %15
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %136
89: ; preds = %85
%90 = load i32, i32* %15
%91 = load i32, i32* %14
%92 = sub nsw i32 %90, %91
%93 = sitofp i32 %92 to double
store double %93, double* %17
%94 = load i32, i32* %14
%95 = sitofp i32 %94 to double
%96 = fsub double %95, 1.000000e+00
%97 = load i32, i32* %15
%98 = sitofp i32 %97 to double
%99 = load double, double* %17
%100 = fadd double %98, %99
%101 = fadd double %100, 2.000000e+00
%102 = fmul double %96, %101
%103 = load i32, i32* %14
%104 = sitofp i32 %103 to double
%105 = load i32, i32* %15
%106 = sitofp i32 %105 to double
%107 = load double, double* %17
%108 = fadd double %106, %107
%109 = fadd double %108, 1.000000e+00
%110 = fmul double %104, %109
%111 = fdiv double %102, %110
%112 = load double, double* %24
%113 = fmul double %112, %111
store double %113, double* %24
%114 = load double, double* %24
%115 = load double, double* %17
%116 = fmul double %114, %115
%117 = load double, double* %23
%118 = fmul double %116, %117
store double %118, double* %25
%119 = load double, double* %24
%120 = load double, double* %19
%121 = load double, double* %17
%122 = fmul double %120, %121
%123 = call double @cos(double %122)
%124 = load double, double* %22
%125 = call double @llvm.fmuladd.f64(double %119, double %123, double %124)
store double %125, double* %22
%126 = load double, double* %25
%127 = load double, double* %19
%128 = load double, double* %17
%129 = fmul double %127, %128
%130 = call double @sin(double %129)
%131 = load double, double* %21
%132 = call double @llvm.fmuladd.f64(double %126, double %130, double %131)
store double %132, double* %21
br label %133
133: ; preds = %89
%134 = load i32, i32* %14
%135 = add nsw i32 %134, 2
store i32 %135, i32* %14
br label %85
136: ; preds = %85
%137 = load i32, i32* %15
%138 = and i32 %137, 1
%139 = icmp eq i32 %138, 0
br i1 %139, label %140, label %158
140: ; preds = %136
%141 = load i32, i32* %15
%142 = sub nsw i32 %141, 1
%143 = load i32, i32* %15
%144 = add nsw i32 %143, 2
%145 = mul nsw i32 %142, %144
%146 = sitofp i32 %145 to double
%147 = load i32, i32* %15
%148 = load i32, i32* %15
%149 = add nsw i32 %148, 1
%150 = mul nsw i32 %147, %149
%151 = sitofp i32 %150 to double
%152 = fdiv double %146, %151
%153 = load double, double* %24
%154 = fmul double %153, %152
store double %154, double* %24
%155 = load double, double* %24
%156 = load double, double* %22
%157 = call double @llvm.fmuladd.f64(double %155, double 5.000000e-01, double %156)
store double %157, double* %22
br label %158
158: ; preds = %140, %136
%159 = load double, double* %20
%160 = load double, double* %22
%161 = fmul double %159, %160
%162 = load double*, double** %11
%163 = load i32, i32* %15
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %162, i64 %164
store double %161, double* %165
%166 = load double, double* %20
%167 = load double, double* %21
%168 = fmul double %166, %167
%169 = load double*, double** %12
%170 = load i32, i32* %15
%171 = sub nsw i32 %170, 1
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds double, double* %169, i64 %172
store double %168, double* %173
br label %174
174: ; preds = %158
%175 = load i32, i32* %15
%176 = add nsw i32 %175, 1
store i32 %176, i32* %15
br label %47
177: ; preds = %47
%178 = load double*, double** %7
%179 = bitcast double* %178 to i8*
%180 = load double*, double** %11
%181 = bitcast double* %180 to i8*
%182 = load i32, i32* %9
%183 = sext i32 %182 to i64
%184 = mul i64 %183, 8
%185 = load i32, i32* %9
%186 = load double*, double** %7
%187 = sext i32 %185 to i64
%188 = getelementptr inbounds double, double* %186, i64 %187
store double* %188, double** %7
%189 = load double*, double** %7
%190 = bitcast double* %189 to i8*
%191 = load double*, double** %12
%192 = bitcast double* %191 to i8*
%193 = load i32, i32* %9
%194 = sext i32 %193 to i64
%195 = mul i64 %194, 8
%196 = load i32, i32* %9
%197 = load double*, double** %7
%198 = sext i32 %196 to i64
%199 = getelementptr inbounds double, double* %197, i64 %198
store double* %199, double** %7
%200 = load double*, double** %8
%201 = getelementptr inbounds double, double* %200, i64 0
store double 0.000000e+00, double* %201
store i32 1, i32* %15
br label %202
202: ; preds = %241, %177
%203 = load i32, i32* %15
%204 = load i32, i32* %9
%205 = icmp slt i32 %203, %204
br i1 %205, label %206, label %244
206: ; preds = %202
%207 = load i32, i32* %15
%208 = sitofp i32 %207 to double
%209 = load double, double* %10
%210 = load double*, double** %11
%211 = load i32, i32* %15
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds double, double* %210, i64 %212
%214 = load double, double* %213
%215 = load i32, i32* %15
%216 = load i32, i32* %15
%217 = add nsw i32 %215, %216
%218 = sitofp i32 %217 to double
%219 = fadd double %218, 1.000000e+00
%220 = load i32, i32* %15
%221 = load i32, i32* %15
%222 = add nsw i32 %220, %221
%223 = sitofp i32 %222 to double
%224 = fsub double %223, 1.000000e+00
%225 = fdiv double %219, %224
%226 = call double @sqrt(double %225)
%227 = load double*, double** %11
%228 = load i32, i32* %15
%229 = sub nsw i32 %228, 1
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds double, double* %227, i64 %230
%232 = load double, double* %231
%233 = fmul double %226, %232
%234 = fneg double %233
%235 = call double @llvm.fmuladd.f64(double %209, double %214, double %234)
%236 = fmul double %208, %235
%237 = load double*, double** %8
%238 = load i32, i32* %15
%239 = sext i32 %238 to i64
%240 = getelementptr inbounds double, double* %237, i64 %239
store double %236, double* %240
br label %241
241: ; preds = %206
%242 = load i32, i32* %15
%243 = add nsw i32 %242, 1
store i32 %243, i32* %15
br label %202
244: ; preds = %202
%245 = load i32, i32* %9
%246 = load double*, double** %8
%247 = sext i32 %245 to i64
%248 = getelementptr inbounds double, double* %246, i64 %247
store double* %248, double** %8
%249 = load double, double* %10
%250 = load double*, double** %12
%251 = getelementptr inbounds double, double* %250, i64 0
%252 = load double, double* %251
%253 = fmul double %249, %252
%254 = load double*, double** %8
%255 = getelementptr inbounds double, double* %254, i64 0
store double %253, double* %255
store i32 1, i32* %15
br label %256
256: ; preds = %304, %244
%257 = load i32, i32* %15
%258 = load i32, i32* %9
%259 = icmp slt i32 %257, %258
br i1 %259, label %260, label %307
260: ; preds = %256
%261 = load i32, i32* %15
%262 = add nsw i32 %261, 1
%263 = sitofp i32 %262 to double
%264 = load double, double* %10
%265 = fmul double %263, %264
%266 = load double*, double** %12
%267 = load i32, i32* %15
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds double, double* %266, i64 %268
%270 = load double, double* %269
%271 = load i32, i32* %15
%272 = load i32, i32* %15
%273 = add nsw i32 %271, %272
%274 = sitofp i32 %273 to double
%275 = fadd double %274, 3.000000e+00
%276 = load i32, i32* %15
%277 = add nsw i32 %276, 1
%278 = load i32, i32* %15
%279 = add nsw i32 %278, 1
%280 = mul nsw i32 %277, %279
%281 = sitofp i32 %280 to double
%282 = fsub double %281, 1.000000e+00
%283 = fmul double %275, %282
%284 = load i32, i32* %15
%285 = load i32, i32* %15
%286 = add nsw i32 %284, %285
%287 = sitofp i32 %286 to double
%288 = fadd double %287, 1.000000e+00
%289 = fdiv double %283, %288
%290 = call double @sqrt(double %289)
%291 = load double*, double** %12
%292 = load i32, i32* %15
%293 = sub nsw i32 %292, 1
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds double, double* %291, i64 %294
%296 = load double, double* %295
%297 = fmul double %290, %296
%298 = fneg double %297
%299 = call double @llvm.fmuladd.f64(double %265, double %270, double %298)
%300 = load double*, double** %8
%301 = load i32, i32* %15
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds double, double* %300, i64 %302
store double %299, double* %303
br label %304
304: ; preds = %260
%305 = load i32, i32* %15
%306 = add nsw i32 %305, 1
store i32 %306, i32* %15
br label %256
307: ; preds = %256
%308 = load i32, i32* %9
%309 = load double*, double** %8
%310 = sext i32 %308 to i64
%311 = getelementptr inbounds double, double* %309, i64 %310
store double* %311, double** %8
store i32 2, i32* %16
br label %312
312: ; preds = %491, %307
%313 = load i32, i32* %16
%314 = load i32, i32* %9
%315 = icmp slt i32 %313, %314
br i1 %315, label %316, label %494
316: ; preds = %312
%317 = load i32, i32* %16
%318 = load i32, i32* %16
%319 = add nsw i32 %317, %318
%320 = sitofp i32 %319 to double
%321 = fdiv double 1.000000e+00, %320
%322 = fadd double 1.000000e+00, %321
%323 = call double @sqrt(double %322)
%324 = load double, double* %18
%325 = fmul double %323, %324
%326 = load double*, double** %12
%327 = getelementptr inbounds double, double* %326, i64 0
%328 = load double, double* %327
%329 = fmul double %325, %328
%330 = load double*, double** %7
%331 = getelementptr inbounds double, double* %330, i64 0
store double %329, double* %331
%332 = load i32, i32* %16
%333 = sitofp i32 %332 to double
%334 = load double, double* %10
%335 = fmul double %333, %334
%336 = load double*, double** %7
%337 = getelementptr inbounds double, double* %336, i64 0
%338 = load double, double* %337
%339 = fmul double %335, %338
%340 = load double*, double** %8
%341 = getelementptr inbounds double, double* %340, i64 0
store double %339, double* %341
store i32 1, i32* %15
br label %342
342: ; preds = %465, %316
%343 = load i32, i32* %15
%344 = load i32, i32* %13
%345 = load i32, i32* %16
%346 = sub nsw i32 %344, %345
%347 = icmp slt i32 %343, %346
br i1 %347, label %348, label %468
348: ; preds = %342
%349 = load i32, i32* %16
%350 = load i32, i32* %16
%351 = add nsw i32 %349, %350
%352 = load i32, i32* %15
%353 = add nsw i32 %351, %352
%354 = sub nsw i32 %353, 1
%355 = sitofp i32 %354 to double
store double %355, double* %26
%356 = load double, double* %26
%357 = load i32, i32* %15
%358 = sitofp i32 %357 to double
%359 = fadd double %356, %358
store double %359, double* %27
%360 = load double, double* %27
%361 = fadd double %360, 2.000000e+00
store double %361, double* %28
%362 = load double, double* %28
%363 = load double, double* %26
%364 = fmul double %362, %363
store double %364, double* %29
%365 = load double, double* %26
%366 = load double, double* %26
%367 = call double @llvm.fmuladd.f64(double %365, double %366, double -1.000000e+00)
store double %367, double* %30
%368 = load double, double* %27
%369 = load double, double* %30
%370 = fmul double %368, %369
store double %370, double* %31
%371 = load double, double* %30
%372 = fmul double %371, 2.000000e+00
store double %372, double* %32
%373 = load double, double* %29
%374 = load double, double* %26
%375 = fsub double %374, 2.000000e+00
%376 = fmul double %373, %375
%377 = load double, double* %31
%378 = load double, double* %32
%379 = fsub double %377, %378
%380 = fdiv double %376, %379
%381 = call double @sqrt(double %380)
store double %381, double* %33
%382 = load double, double* %29
%383 = load i32, i32* %15
%384 = sitofp i32 %383 to double
%385 = fadd double %384, 1.000000e+00
%386 = fmul double %382, %385
%387 = load double, double* %31
%388 = fdiv double %386, %387
%389 = call double @sqrt(double %388)
store double %389, double* %34
%390 = load double, double* %28
%391 = load i32, i32* %15
%392 = sitofp i32 %391 to double
%393 = fmul double %390, %392
%394 = load double, double* %26
%395 = fadd double %394, 1.000000e+00
%396 = load double, double* %27
%397 = fmul double %395, %396
%398 = fdiv double %393, %397
%399 = call double @sqrt(double %398)
store double %399, double* %35
%400 = load double, double* %33
%401 = load double*, double** %11
%402 = load i32, i32* %15
%403 = sext i32 %402 to i64
%404 = getelementptr inbounds double, double* %401, i64 %403
%405 = load double, double* %404
%406 = load double, double* %10
%407 = load double, double* %34
%408 = load double*, double** %11
%409 = load i32, i32* %15
%410 = add nsw i32 %409, 1
%411 = sext i32 %410 to i64
%412 = getelementptr inbounds double, double* %408, i64 %411
%413 = load double, double* %412
%414 = load double, double* %35
%415 = load double*, double** %7
%416 = load i32, i32* %15
%417 = sub nsw i32 %416, 1
%418 = sext i32 %417 to i64
%419 = getelementptr inbounds double, double* %415, i64 %418
%420 = load double, double* %419
%421 = fmul double %414, %420
%422 = fneg double %421
%423 = call double @llvm.fmuladd.f64(double %407, double %413, double %422)
%424 = fmul double %406, %423
%425 = fneg double %424
%426 = call double @llvm.fmuladd.f64(double %400, double %405, double %425)
%427 = load double*, double** %7
%428 = load i32, i32* %15
%429 = sext i32 %428 to i64
%430 = getelementptr inbounds double, double* %427, i64 %429
store double %426, double* %430
%431 = load i32, i32* %16
%432 = load i32, i32* %15
%433 = add nsw i32 %431, %432
%434 = sitofp i32 %433 to double
%435 = load double, double* %10
%436 = fmul double %434, %435
%437 = load double*, double** %7
%438 = load i32, i32* %15
%439 = sext i32 %438 to i64
%440 = getelementptr inbounds double, double* %437, i64 %439
%441 = load double, double* %440
%442 = load double, double* %28
%443 = load i32, i32* %15
%444 = sitofp i32 %443 to double
%445 = fmul double %442, %444
%446 = load double, double* %26
%447 = fadd double %446, 1.000000e+00
%448 = fmul double %445, %447
%449 = load double, double* %27
%450 = fdiv double %448, %449
%451 = call double @sqrt(double %450)
%452 = load double*, double** %7
%453 = load i32, i32* %15
%454 = sub nsw i32 %453, 1
%455 = sext i32 %454 to i64
%456 = getelementptr inbounds double, double* %452, i64 %455
%457 = load double, double* %456
%458 = fmul double %451, %457
%459 = fneg double %458
%460 = call double @llvm.fmuladd.f64(double %436, double %441, double %459)
%461 = load double*, double** %8
%462 = load i32, i32* %15
%463 = sext i32 %462 to i64
%464 = getelementptr inbounds double, double* %461, i64 %463
store double %460, double* %464
br label %465
465: ; preds = %348
%466 = load i32, i32* %15
%467 = add nsw i32 %466, 1
store i32 %467, i32* %15
br label %342
468: ; preds = %342
%469 = load double*, double** %11
%470 = bitcast double* %469 to i8*
%471 = load double*, double** %12
%472 = bitcast double* %471 to i8*
%473 = load i32, i32* %13
%474 = sext i32 %473 to i64
%475 = mul i64 %474, 8
%476 = load double*, double** %12
%477 = bitcast double* %476 to i8*
%478 = load double*, double** %7
%479 = bitcast double* %478 to i8*
%480 = load i32, i32* %13
%481 = sext i32 %480 to i64
%482 = mul i64 %481, 8
%483 = load i32, i32* %9
%484 = load double*, double** %7
%485 = sext i32 %483 to i64
%486 = getelementptr inbounds double, double* %484, i64 %485
store double* %486, double** %7
%487 = load i32, i32* %9
%488 = load double*, double** %8
%489 = sext i32 %487 to i64
%490 = getelementptr inbounds double, double* %488, i64 %489
store double* %490, double** %8
br label %491
491: ; preds = %468
%492 = load i32, i32* %16
%493 = add nsw i32 %492, 1
store i32 %493, i32* %16
br label %312
494: ; preds = %312
ret void
}

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