int sphx2s(const double eul[5], int nphi, int ntheta, int spt, int sll,
           const double phi[], const double theta[], double lng[],
           double lat[]) {
  int mphi, mtheta, rowlen, rowoff;
  double cosphi, costhe, costhe3, costhe4, dlng, dphi, sinphi, sinthe, sinthe3,
      sinthe4, x, y, z;
  register int iphi, itheta;
  register const double *phip, *thetap;
  register double *latp, *lngp;
  if (ntheta > 0) {
    mphi = nphi;
    mtheta = ntheta;
  } else {
    mphi = 1;
    mtheta = 1;
    ntheta = nphi;
  }
  if (eul[4] == 0.0) {
    if (eul[1] == 0.0) {
      dlng = fmod(eul[0] + 180.0 - eul[2], 360.0);
      lngp = lng;
      latp = lat;
      phip = phi;
      thetap = theta;
      for (itheta = 0; itheta < ntheta; itheta++) {
        for (iphi = 0; iphi < mphi; iphi++) {
          *lngp = *phip + dlng;
          *latp = *thetap;
          if (eul[0] >= 0.0) {
            if (*lngp < 0.0)
              *lngp += 360.0;
          } else {
            if (*lngp > 0.0)
              *lngp -= 360.0;
          }
          if (*lngp > 360.0) {
            *lngp -= 360.0;
          } else if (*lngp < -360.0) {
            *lngp += 360.0;
          }
          lngp += sll;
          latp += sll;
          phip += spt;
          thetap += spt;
        }
      }
    } else {
      dlng = fmod(eul[0] + eul[2], 360.0);
      lngp = lng;
      latp = lat;
      phip = phi;
      thetap = theta;
      for (itheta = 0; itheta < ntheta; itheta++) {
        for (iphi = 0; iphi < mphi; iphi++) {
          *lngp = dlng - *phip;
          *latp = -(*thetap);
          if (eul[0] >= 0.0) {
            if (*lngp < 0.0)
              *lngp += 360.0;
          } else {
            if (*lngp > 0.0)
              *lngp -= 360.0;
          }
          if (*lngp > 360.0) {
            *lngp -= 360.0;
          } else if (*lngp < -360.0) {
            *lngp += 360.0;
          }
          lngp += sll;
          latp += sll;
          phip += spt;
          thetap += spt;
        }
      }
    }
    return 0;
  }
  phip = phi;
  rowoff = 0;
  rowlen = nphi * sll;
  for (iphi = 0; iphi < nphi; iphi++, rowoff += sll, phip += spt) {
    dphi = *phip - eul[2];
    lngp = lng + rowoff;
    for (itheta = 0; itheta < mtheta; itheta++) {
      *lngp = dphi;
      lngp += rowlen;
    }
  }
  thetap = theta;
  lngp = lng;
  latp = lat;
  for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) {
    sincosd(*thetap, &sinthe, &costhe);
    costhe3 = costhe * eul[3];
    costhe4 = costhe * eul[4];
    sinthe3 = sinthe * eul[3];
    sinthe4 = sinthe * eul[4];
    for (iphi = 0; iphi < mphi; iphi++, lngp += sll, latp += sll) {
      dphi = *lngp;
      sincosd(dphi, &sinphi, &cosphi);
      x = sinthe4 - costhe3 * cosphi;
      if (fabs(x) < 1.0e-5) {
        x = -cosd(*thetap + eul[1]) + costhe3 * (1.0 - cosphi);
      }
      y = -costhe * sinphi;
      if (x != 0.0 || y != 0.0) {
        dlng = atan2d(y, x);
      } else {
        if (eul[1] < 90.0) {
          dlng = dphi + 180.0;
        } else {
          dlng = -dphi;
        }
      }
      *lngp = eul[0] + dlng;
      if (eul[0] >= 0.0) {
        if (*lngp < 0.0)
          *lngp += 360.0;
      } else {
        if (*lngp > 0.0)
          *lngp -= 360.0;
      }
      if (*lngp > 360.0) {
        *lngp -= 360.0;
      } else if (*lngp < -360.0) {
        *lngp += 360.0;
      }
      if (fmod(dphi, 180.0) == 0.0) {
        *latp = *thetap + cosphi * eul[1];
        if (*latp > 90.0)
          *latp = 180.0 - *latp;
        if (*latp < -90.0)
          *latp = -180.0 - *latp;
      } else {
        z = sinthe3 + costhe4 * cosphi;
        if (fabs(z) > 0.99) {
          *latp = ((z) < 0.0 ? -fabs(acosd(sqrt(x * x + y * y)))
                             : fabs(acosd(sqrt(x * x + y * y))));
        } else {
          *latp = asind(z);
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<sphx2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    11b7 <sphx2s+0x47>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    11cb <sphx2s+0x5b>
movl   $0x1,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    16ac <sphx2s+0x53c>
jp     16ac <sphx2s+0x53c>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    144a <sphx2s+0x2da>
jp     144a <sphx2s+0x2da>
mov    -0x10(%rbp),%rax
movsd  0xe09(%rip),%xmm0
addsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  0xdfc(%rip),%xmm1
call   1040 <fmod@plt>
movsd  %xmm0,-0x60(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0xb8(%rbp)
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1445 <sphx2s+0x2d5>
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    142c <sphx2s+0x2bc>
mov    -0xb0(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x60(%rbp),%xmm0
mov    -0xc8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xb8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1302 <sphx2s+0x192>
mov    -0xc8(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    12fd <sphx2s+0x18d>
mov    -0xc8(%rbp),%rax
movsd  0xd2b(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    133a <sphx2s+0x1ca>
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1335 <sphx2s+0x1c5>
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xcf3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    133a <sphx2s+0x1ca>
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xcd3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1377 <sphx2s+0x207>
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xcb6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    13ac <sphx2s+0x23c>
mov    -0xc8(%rbp),%rax
movsd  0xca2(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    13a7 <sphx2s+0x237>
mov    -0xc8(%rbp),%rax
movsd  0xc81(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    13ac <sphx2s+0x23c>
mov    -0x20(%rbp),%ecx
mov    -0xc8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc8(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0xc0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0xb0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb0(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0xb8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    127d <sphx2s+0x10d>
jmp    1431 <sphx2s+0x2c1>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    1264 <sphx2s+0xf4>
jmp    16a0 <sphx2s+0x530>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x10(%rax),%xmm0
movsd  0xbbd(%rip),%xmm1
call   1040 <fmod@plt>
movsd  %xmm0,-0x60(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0xb8(%rbp)
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    169b <sphx2s+0x52b>
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1682 <sphx2s+0x512>
movsd  -0x60(%rbp),%xmm0
mov    -0xb0(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0xc8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xb8(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1558 <sphx2s+0x3e8>
mov    -0xc8(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    1553 <sphx2s+0x3e3>
mov    -0xc8(%rbp),%rax
movsd  0xad5(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1590 <sphx2s+0x420>
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    158b <sphx2s+0x41b>
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xa9d(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    1590 <sphx2s+0x420>
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xa7d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    15cd <sphx2s+0x45d>
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xa60(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    1602 <sphx2s+0x492>
mov    -0xc8(%rbp),%rax
movsd  0xa4c(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    15fd <sphx2s+0x48d>
mov    -0xc8(%rbp),%rax
movsd  0xa2b(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1602 <sphx2s+0x492>
mov    -0x20(%rbp),%ecx
mov    -0xc8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc8(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0xc0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0xb0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb0(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0xb8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    14bc <sphx2s+0x34c>
jmp    1687 <sphx2s+0x517>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    14a3 <sphx2s+0x333>
jmp    16a0 <sphx2s+0x530>
movl   $0x0,-0x4(%rbp)
jmp    1da2 <sphx2s+0xc32>
mov    -0x28(%rbp),%rax
mov    %rax,-0xb0(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x20(%rbp),%eax
mov    %eax,-0x34(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    17a5 <sphx2s+0x635>
mov    -0xb0(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc8(%rbp)
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    1768 <sphx2s+0x5f8>
movsd  -0x68(%rbp),%xmm0
mov    -0xc8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x34(%rbp),%ecx
mov    -0xc8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc8(%rbp)
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    171a <sphx2s+0x5aa>
jmp    176d <sphx2s+0x5fd>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
mov    -0x20(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0xb0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb0(%rbp)
jmp    16d2 <sphx2s+0x562>
mov    0x10(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0xc0(%rbp)
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1d9b <sphx2s+0xc2b>
mov    -0xb8(%rbp),%rax
movsd  (%rax),%xmm0
lea    -0x78(%rbp),%rdi
lea    -0x48(%rbp),%rsi
mov    $0x1,%al
call   1070 <sincosd@plt>
movsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1d67 <sphx2s+0xbf7>
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
lea    -0x70(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x1,%al
call   1070 <sincosd@plt>
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x50(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm1
ff
movaps 0x783(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x727(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    192a <sphx2s+0x7ba>
mov    -0xb8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm0
mov    $0x1,%al
call   1030 <cosd@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  0x6f3(%rip),%xmm2
subsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    198e <sphx2s+0x81e>
jp     198e <sphx2s+0x81e>
movsd  -0x98(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    198e <sphx2s+0x81e>
jp     198e <sphx2s+0x81e>
jmp    19b3 <sphx2s+0x843>
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
mov    $0x2,%al
call   1090 <atan2d@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1a07 <sphx2s+0x897>
mov    -0x10(%rbp),%rax
movsd  0x651(%rip),%xmm0
ucomisd 0x8(%rax),%xmm0
jbe    19e1 <sphx2s+0x871>
movsd  0x646(%rip),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1a02 <sphx2s+0x892>
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1a07 <sphx2s+0x897>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x60(%rbp),%xmm0
mov    -0xc8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1a64 <sphx2s+0x8f4>
mov    -0xc8(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    1a5f <sphx2s+0x8ef>
mov    -0xc8(%rbp),%rax
movsd  0x5c9(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1a9c <sphx2s+0x92c>
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1a97 <sphx2s+0x927>
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x591(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    1a9c <sphx2s+0x92c>
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x571(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1ad9 <sphx2s+0x969>
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x554(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    1b0e <sphx2s+0x99e>
mov    -0xc8(%rbp),%rax
movsd  0x540(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    1b09 <sphx2s+0x999>
mov    -0xc8(%rbp),%rax
movsd  0x51f(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1b0e <sphx2s+0x99e>
movsd  -0x68(%rbp),%xmm0
movsd  0x4fd(%rip),%xmm1
call   1040 <fmod@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1bd6 <sphx2s+0xa66>
jp     1bd6 <sphx2s+0xa66>
mov    -0xb8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x49e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1b9a <sphx2s+0xa2a>
mov    -0xc0(%rbp),%rax
movsd  0x48d(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xc0(%rbp),%rax
movsd  0x48f(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    1bd1 <sphx2s+0xa61>
mov    -0xc0(%rbp),%rax
movsd  0x47e(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1d18 <sphx2s+0xba8>
movsd  -0x80(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movaps 0x44c(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0x420(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1cf5 <sphx2s+0xb85>
xorps  %xmm0,%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jbe    1c92 <sphx2s+0xb22>
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x98(%rbp),%xmm1
ff
mulsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
mov    $0x1,%al
call   1050 <acosd@plt>
cvtsi2sd %eax,%xmm0
movaps 0x3e6(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    1cdd <sphx2s+0xb6d>
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x98(%rbp),%xmm1
ff
mulsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
mov    $0x1,%al
call   1050 <acosd@plt>
cvtsi2sd %eax,%xmm0
movaps 0x37f(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1d13 <sphx2s+0xba3>
movsd  -0xa0(%rbp),%xmm0
ff
mov    $0x1,%al
call   1080 <asind@plt>
cvtsi2sd %eax,%xmm0
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1d18 <sphx2s+0xba8>
jmp    1d1d <sphx2s+0xbad>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0xc8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc8(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0xc0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
jmp    1852 <sphx2s+0x6e2>
jmp    1d6c <sphx2s+0xbfc>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0xb8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
jmp    17d0 <sphx2s+0x660>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sphx2s>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %r9,%rbx
mov    %rdi,%r13
mov    0x110(%rsp),%r12
mov    0x108(%rsp),%r15
mov    0x100(%rsp),%rbp
test   %edx,%edx
mov    $0x1,%r14d
cmovg  %esi,%r14d
mov    %esi,%eax
cmovg  %edx,%eax
mov    %eax,0xc(%rsp)
movsd  0x20(%rdi),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12e9 <sphx2s+0x179>
jp     12e9 <sphx2s+0x179>
movsd  0x0(%r13),%xmm0
movsd  0x8(%r13),%xmm2
ucomisd %xmm1,%xmm2
mov    %r8d,0x10(%rsp)
mov    %ecx,0x40(%rsp)
jne    1860 <sphx2s+0x6f0>
jp     1860 <sphx2s+0x6f0>
addsd  0xe3e(%rip),%xmm0
subsd  0x10(%r13),%xmm0
movsd  0xe38(%rip),%xmm1
call   1040 <fmod@plt>
movsd  0xe2b(%rip),%xmm5
cmpl   $0x0,0xc(%rsp)
jle    1960 <sphx2s+0x7f0>
movslq 0x10(%rsp),%rax
movslq 0x40(%rsp),%rcx
shl    $0x3,%rax
shl    $0x3,%rcx
xor    %edx,%edx
xorpd  %xmm1,%xmm1
movsd  0xe08(%rip),%xmm2
jmp    125d <sphx2s+0xed>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%edx
cmp    0xc(%rsp),%edx
je     1960 <sphx2s+0x7f0>
test   %r14d,%r14d
jle    1250 <sphx2s+0xe0>
mov    %r14d,%esi
jmp    128a <sphx2s+0x11a>
nopw   0x0(%rax,%rax,1)
addsd  %xmm4,%xmm3
movsd  %xmm3,(%r15)
add    %rax,%r15
add    %rax,%r12
add    %rcx,%rbp
add    %rcx,%rbx
add    $0xffffffff,%esi
je     1250 <sphx2s+0xe0>
movsd  (%rbx),%xmm3
addsd  %xmm0,%xmm3
movsd  %xmm3,(%r15)
movsd  0x0(%rbp),%xmm3
movsd  %xmm3,(%r12)
movsd  0x0(%r13),%xmm3
ucomisd %xmm1,%xmm3
movsd  (%r15),%xmm3
jae    12c0 <sphx2s+0x150>
ucomisd %xmm1,%xmm3
movapd %xmm2,%xmm4
ja     12ca <sphx2s+0x15a>
jmp    12d3 <sphx2s+0x163>
nop
ucomisd %xmm3,%xmm1
movapd %xmm5,%xmm4
jbe    12d3 <sphx2s+0x163>
addsd  %xmm4,%xmm3
movsd  %xmm3,(%r15)
ucomisd %xmm5,%xmm3
movapd %xmm2,%xmm4
ja     1270 <sphx2s+0x100>
ucomisd %xmm3,%xmm2
movapd %xmm5,%xmm4
ja     1270 <sphx2s+0x100>
jmp    1279 <sphx2s+0x109>
mov    %esi,%r11d
mov    %r14d,0x24(%rsp)
movslq %ecx,%rax
mov    %rax,0x60(%rsp)
movslq %r8d,%rax
mov    %rax,0x30(%rsp)
test   %esi,%esi
jle    14b3 <sphx2s+0x343>
imul   %r11d,%r8d
cmp    $0x2,%edx
mov    $0x1,%eax
mov    $0x1,%ecx
cmovge %edx,%ecx
test   %edx,%edx
movslq %r8d,%rdi
cmovle %eax,%ecx
lea    -0x1(%rcx),%eax
mov    %eax,0x70(%rsp)
mov    %ecx,%eax
and    $0x7,%eax
mov    %eax,0x28(%rsp)
and    $0x7ffffff8,%ecx
mov    %rcx,0xb0(%rsp)
mov    %rdi,0xa8(%rsp)
mov    0x30(%rsp),%rax
lea    0x0(,%rax,8),%rax
mov    %rax,0x50(%rsp)
mov    %rdi,%rsi
shl    $0x6,%rsi
imul   $0x38,%rdi,%rax
mov    %rax,0xa0(%rsp)
mov    %rdi,%rdx
shl    $0x4,%rdx
lea    (%rdx,%rdx,2),%r8
lea    0x0(,%rdi,8),%r9
lea    (%r9,%r9,4),%r10
shl    $0x5,%rdi
lea    (%r9,%r9,2),%r14
mov    %r15,0x10(%rsp)
movl   $0x0,0x40(%rsp)
mov    %r13,0x80(%rsp)
mov    %r11d,0x58(%rsp)
xor    %eax,%eax
jmp    13f5 <sphx2s+0x285>
nopl   (%rax)
mov    0x40(%rsp),%edx
add    $0x1,%edx
mov    0x90(%rsp),%rax
add    0x30(%rsp),%rax
mov    0x60(%rsp),%rcx
lea    (%rbx,%rcx,8),%rbx
mov    0x10(%rsp),%rcx
add    0x50(%rsp),%rcx
mov    %rcx,0x10(%rsp)
mov    %edx,0x40(%rsp)
cmp    0x58(%rsp),%edx
mov    0x80(%rsp),%r13
mov    %r11,%rdx
je     14b3 <sphx2s+0x343>
movsd  (%rbx),%xmm0
subsd  0x10(%r13),%xmm0
cmpl   $0x7,0x70(%rsp)
mov    %rax,0x90(%rsp)
jae    1420 <sphx2s+0x2b0>
lea    (%r15,%rax,8),%r13
jmp    1480 <sphx2s+0x310>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0xb0(%rsp),%rcx
mov    %ecx,%r11d
mov    0xa8(%rsp),%rcx
mov    0x10(%rsp),%r13
mov    0xa0(%rsp),%rax
movsd  %xmm0,0x0(%r13)
movsd  %xmm0,0x0(%r13,%rcx,8)
movsd  %xmm0,0x0(%r13,%rdx,1)
movsd  %xmm0,0x0(%r13,%r14,1)
movsd  %xmm0,0x0(%r13,%rdi,1)
movsd  %xmm0,0x0(%r13,%r10,1)
movsd  %xmm0,0x0(%r13,%r8,1)
movsd  %xmm0,0x0(%r13,%rax,1)
add    %rsi,%r13
add    $0xfffffff8,%r11d
jne    1440 <sphx2s+0x2d0>
mov    %rdx,%r11
cmpl   $0x0,0x28(%rsp)
je     13b0 <sphx2s+0x240>
mov    0x28(%rsp),%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  %xmm0,0x0(%r13)
add    %r9,%r13
add    $0xffffffff,%ecx
jne    14a0 <sphx2s+0x330>
jmp    13b0 <sphx2s+0x240>
cmpl   $0x0,0xc(%rsp)
mov    0x24(%rsp),%ebx
jle    1960 <sphx2s+0x7f0>
shlq   $0x3,0x30(%rsp)
xor    %r14d,%r14d
jmp    14ed <sphx2s+0x37d>
nopl   (%rax)
add    $0x1,%r14d
mov    0x60(%rsp),%rax
lea    0x0(%rbp,%rax,8),%rbp
cmp    0xc(%rsp),%r14d
mov    0x24(%rsp),%ebx
je     1960 <sphx2s+0x7f0>
movsd  0x0(%rbp),%xmm0
lea    0xb8(%rsp),%rdi
lea    0x68(%rsp),%rsi
mov    $0x1,%al
call   1070 <sincosd@plt>
test   %ebx,%ebx
jle    14d0 <sphx2s+0x360>
movsd  0x68(%rsp),%xmm0
movsd  0x18(%r13),%xmm1
movsd  0x20(%r13),%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x58(%rsp)
movsd  0xb8(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x50(%rsp)
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x28(%rsp)
movapd %xmm3,0x70(%rsp)
xorpd  0xaa7(%rip),%xmm3
movapd %xmm3,0x80(%rsp)
jmp    1590 <sphx2s+0x420>
movapd %xmm3,%xmm0
mov    $0x1,%al
call   1080 <asind@plt>
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movsd  %xmm2,(%r12)
mov    0x30(%rsp),%rax
add    %rax,%r15
add    %rax,%r12
add    $0xffffffff,%ebx
je     14d0 <sphx2s+0x360>
movsd  (%r15),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xc0(%rsp),%rdi
lea    0x38(%rsp),%rsi
mov    $0x1,%al
call   1070 <sincosd@plt>
movsd  0x38(%rsp),%xmm3
mulsd  0x80(%rsp),%xmm3
addsd  0x28(%rsp),%xmm3
movapd %xmm3,%xmm0
andpd  0xa41(%rip),%xmm0
movsd  0xa49(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1610 <sphx2s+0x4a0>
movsd  0x0(%rbp),%xmm0
addsd  0x8(%r13),%xmm0
mov    $0x1,%al
call   1030 <cosd@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xa28(%rip),%xmm3
subsd  0x38(%rsp),%xmm3
mulsd  0x70(%rsp),%xmm3
addsd  %xmm0,%xmm3
movsd  0x68(%rsp),%xmm1
xorpd  0x9e2(%rip),%xmm1
mulsd  0xc0(%rsp),%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm3
movapd %xmm3,0x40(%rsp)
movapd %xmm1,0x90(%rsp)
jne    1680 <sphx2s+0x510>
jp     1680 <sphx2s+0x510>
ucomisd %xmm2,%xmm1
jne    1680 <sphx2s+0x510>
jp     1680 <sphx2s+0x510>
movsd  0x9de(%rip),%xmm0
ucomisd 0x8(%r13),%xmm0
jbe    16b0 <sphx2s+0x540>
movapd 0x10(%rsp),%xmm0
movapd %xmm0,%xmm4
movsd  0x9cc(%rip),%xmm3
addsd  %xmm3,%xmm4
jmp    16ca <sphx2s+0x55a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm1,%xmm0
movapd %xmm3,%xmm1
mov    $0x2,%al
call   1090 <atan2d@plt>
xorpd  %xmm2,%xmm2
xorps  %xmm4,%xmm4
cvtsi2sd %eax,%xmm4
movsd  0x996(%rip),%xmm3
movapd 0x10(%rsp),%xmm0
jmp    16ca <sphx2s+0x55a>
nopw   0x0(%rax,%rax,1)
movapd 0x10(%rsp),%xmm0
movapd %xmm0,%xmm4
xorpd  0x93e(%rip),%xmm4
movsd  0x96e(%rip),%xmm3
addsd  0x0(%r13),%xmm4
movsd  %xmm4,(%r15)
movsd  0x0(%r13),%xmm1
ucomisd %xmm2,%xmm1
jae    1700 <sphx2s+0x590>
ucomisd %xmm2,%xmm4
movsd  0x95b(%rip),%xmm1
ja     170e <sphx2s+0x59e>
jmp    1717 <sphx2s+0x5a7>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
ucomisd %xmm4,%xmm2
movsd  0x934(%rip),%xmm1
jbe    1717 <sphx2s+0x5a7>
addsd  %xmm1,%xmm4
movsd  %xmm4,(%r15)
ucomisd 0x921(%rip),%xmm4
movsd  0x921(%rip),%xmm1
ja     173f <sphx2s+0x5cf>
movsd  0x917(%rip),%xmm1
ucomisd %xmm4,%xmm1
movsd  0x903(%rip),%xmm1
jbe    1748 <sphx2s+0x5d8>
addsd  %xmm1,%xmm4
movsd  %xmm4,(%r15)
movapd %xmm3,%xmm1
call   1040 <fmod@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    17c0 <sphx2s+0x650>
jp     17c0 <sphx2s+0x650>
movsd  0x38(%rsp),%xmm1
mulsd  0x8(%r13),%xmm1
addsd  0x0(%rbp),%xmm1
movsd  0x8c2(%rip),%xmm2
subsd  %xmm1,%xmm2
movsd  0x8ae(%rip),%xmm0
cmpltsd %xmm1,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
movlpd %xmm0,(%r12)
movsd  0x8b7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    157c <sphx2s+0x40c>
movsd  0x8ad(%rip),%xmm2
subsd  %xmm0,%xmm2
jmp    1576 <sphx2s+0x406>
nopl   0x0(%rax)
movsd  0x38(%rsp),%xmm3
mulsd  0x58(%rsp),%xmm3
addsd  0x50(%rsp),%xmm3
movapd %xmm3,%xmm0
andpd  0x832(%rip),%xmm0
ucomisd 0x86a(%rip),%xmm0
jbe    1564 <sphx2s+0x3f4>
movapd 0x90(%rsp),%xmm2
mulsd  %xmm2,%xmm2
movapd 0x40(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
movapd %xmm3,0x10(%rsp)
jb     1819 <sphx2s+0x6a9>
sqrtsd %xmm0,%xmm0
jmp    181e <sphx2s+0x6ae>
call   1060 <sqrt@plt>
mov    $0x1,%al
call   1050 <acosd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm0,%xmm1
andpd  0x7d8(%rip),%xmm1
orpd   0x7c0(%rip),%xmm0
movapd 0x10(%rsp),%xmm2
cmpltsd 0x819(%rip),%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
jmp    1576 <sphx2s+0x406>
addsd  0x10(%r13),%xmm0
movsd  0x7d2(%rip),%xmm1
call   1040 <fmod@plt>
movsd  0x7c5(%rip),%xmm6
cmpl   $0x0,0xc(%rsp)
jle    1960 <sphx2s+0x7f0>
movslq 0x10(%rsp),%rax
movslq 0x40(%rsp),%rcx
shl    $0x3,%rax
shl    $0x3,%rcx
xor    %edx,%edx
movapd 0x75e(%rip),%xmm1
xorpd  %xmm2,%xmm2
movsd  0x79a(%rip),%xmm3
jmp    18bd <sphx2s+0x74d>
add    $0x1,%edx
cmp    0xc(%rsp),%edx
je     1960 <sphx2s+0x7f0>
test   %r14d,%r14d
jle    18b0 <sphx2s+0x740>
mov    %r14d,%esi
jmp    18ea <sphx2s+0x77a>
nopw   0x0(%rax,%rax,1)
addsd  %xmm5,%xmm4
movsd  %xmm4,(%r15)
add    %rax,%r15
add    %rax,%r12
add    %rcx,%rbp
add    %rcx,%rbx
add    $0xffffffff,%esi
je     18b0 <sphx2s+0x740>
movapd %xmm0,%xmm4
subsd  (%rbx),%xmm4
movsd  %xmm4,(%r15)
movsd  0x0(%rbp),%xmm4
xorpd  %xmm1,%xmm4
movlpd %xmm4,(%r12)
movsd  0x0(%r13),%xmm4
ucomisd %xmm2,%xmm4
movsd  (%r15),%xmm4
jae    1930 <sphx2s+0x7c0>
ucomisd %xmm2,%xmm4
movapd %xmm3,%xmm5
ja     193a <sphx2s+0x7ca>
jmp    1943 <sphx2s+0x7d3>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
ucomisd %xmm4,%xmm2
movapd %xmm6,%xmm5
jbe    1943 <sphx2s+0x7d3>
addsd  %xmm5,%xmm4
movsd  %xmm4,(%r15)
ucomisd %xmm6,%xmm4
movapd %xmm3,%xmm5
ja     18d0 <sphx2s+0x760>
ucomisd %xmm4,%xmm3
movapd %xmm6,%xmm5
ja     18d0 <sphx2s+0x760>
jmp    18d9 <sphx2s+0x769>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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