int sphx2s(eul, nphi, ntheta, spt, sll, phi, theta, lng, lat) const
    double eul[5];
int nphi, ntheta, spt, sll;
const double phi[], theta[];
double lng[], 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;
  }
  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) {
    costhe = cosd(*thetap);
    sinthe = sind(*thetap);
    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;
      cosphi = cosd(dphi);
      sinphi = sind(dphi);
      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,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    11b7 <sphx2s+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    11cb <sphx2s+0x5b>
movl   $0x1,-0x24(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0xa8(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12c4 <sphx2s+0x154>
mov    -0xa8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
movl   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1287 <sphx2s+0x117>
movsd  -0x60(%rbp),%xmm0
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0xc0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    1239 <sphx2s+0xc9>
jmp    128c <sphx2s+0x11c>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
mov    -0x18(%rbp),%eax
add    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0xa8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xa8(%rbp)
jmp    11f1 <sphx2s+0x81>
mov    0x10(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0xb8(%rbp)
movl   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    18e6 <sphx2s+0x776>
mov    -0xb0(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%al
call   1040 <cosd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0xb0(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%al
call   1030 <sind@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    18b2 <sphx2s+0x742>
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    $0x1,%al
call   1040 <cosd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    $0x1,%al
call   1030 <sind@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x80(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
movaps 0xc38(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xbdc(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1475 <sphx2s+0x305>
mov    -0xb0(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x8(%rax),%xmm0
mov    $0x1,%al
call   1040 <cosd@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xba8(%rip),%xmm2
subsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14d9 <sphx2s+0x369>
jp     14d9 <sphx2s+0x369>
movsd  -0x90(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14d9 <sphx2s+0x369>
jp     14d9 <sphx2s+0x369>
jmp    14fe <sphx2s+0x38e>
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm1
ff
mov    $0x2,%al
call   1090 <atan2d@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1552 <sphx2s+0x3e2>
mov    -0x8(%rbp),%rax
movsd  0xb06(%rip),%xmm0
ucomisd 0x8(%rax),%xmm0
jbe    152c <sphx2s+0x3bc>
movsd  0xafb(%rip),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    154d <sphx2s+0x3dd>
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1552 <sphx2s+0x3e2>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x58(%rbp),%xmm0
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     15af <sphx2s+0x43f>
mov    -0xc0(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    15aa <sphx2s+0x43a>
mov    -0xc0(%rbp),%rax
movsd  0xa7e(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    15e7 <sphx2s+0x477>
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    15e2 <sphx2s+0x472>
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xa46(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    15e7 <sphx2s+0x477>
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xa26(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1624 <sphx2s+0x4b4>
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xa09(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    1659 <sphx2s+0x4e9>
mov    -0xc0(%rbp),%rax
movsd  0x9f5(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    1654 <sphx2s+0x4e4>
mov    -0xc0(%rbp),%rax
movsd  0x9d4(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1659 <sphx2s+0x4e9>
movsd  -0x60(%rbp),%xmm0
movsd  0x9b2(%rip),%xmm1
call   1050 <fmod@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1721 <sphx2s+0x5b1>
jp     1721 <sphx2s+0x5b1>
mov    -0xb0(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0xb8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xb8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x953(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    16e5 <sphx2s+0x575>
mov    -0xb8(%rbp),%rax
movsd  0x942(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0xb8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xb8(%rbp),%rax
movsd  0x944(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    171c <sphx2s+0x5ac>
mov    -0xb8(%rbp),%rax
movsd  0x933(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0xb8(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1863 <sphx2s+0x6f3>
movsd  -0x78(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movaps 0x901(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0x8d5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1840 <sphx2s+0x6d0>
xorps  %xmm0,%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jbe    17dd <sphx2s+0x66d>
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x90(%rbp),%xmm1
ff
mulsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
mov    $0x1,%al
call   1060 <acosd@plt>
cvtsi2sd %eax,%xmm0
movaps 0x89b(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    1828 <sphx2s+0x6b8>
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x90(%rbp),%xmm1
ff
mulsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
mov    $0x1,%al
call   1060 <acosd@plt>
cvtsi2sd %eax,%xmm0
movaps 0x834(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
mov    -0xb8(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    185e <sphx2s+0x6ee>
movsd  -0x98(%rbp),%xmm0
ff
mov    $0x1,%al
call   1080 <asind@plt>
cvtsi2sd %eax,%xmm0
mov    -0xb8(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1863 <sphx2s+0x6f3>
jmp    1868 <sphx2s+0x6f8>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0xc0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0xb8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
jmp    138a <sphx2s+0x21a>
jmp    18b7 <sphx2s+0x747>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0xb0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb0(%rbp)
jmp    12ef <sphx2s+0x17f>
xor    %eax,%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    $0xb8,%rsp
mov    %rdi,%r14
mov    0xf8(%rsp),%rbx
test   %edx,%edx
mov    $0x1,%eax
cmovg  %esi,%eax
mov    %eax,0x48(%rsp)
mov    %esi,%eax
cmovg  %edx,%eax
mov    %eax,0x24(%rsp)
mov    $0x1,%eax
movslq %ecx,%rcx
mov    %rcx,0x78(%rsp)
movslq %r8d,%rcx
mov    %rcx,0x60(%rsp)
mov    %esi,0x28(%rsp)
test   %esi,%esi
jle    1352 <sphx2s+0x1e2>
mov    0x60(%rsp),%rbp
mov    %ebp,%ecx
imul   0x28(%rsp),%ecx
cmp    $0x2,%edx
mov    $0x1,%esi
cmovge %edx,%esi
test   %edx,%edx
movslq %ecx,%rdi
cmovle %eax,%esi
lea    -0x1(%rsi),%eax
mov    %eax,0x90(%rsp)
mov    %esi,%eax
and    $0x7,%eax
mov    %eax,0x30(%rsp)
and    $0x7ffffff8,%esi
mov    %rsi,0x38(%rsp)
lea    0x0(,%rbp,8),%rax
mov    %rax,0x80(%rsp)
mov    %rdi,%rax
shl    $0x6,%rax
imul   $0x38,%rdi,%rsi
mov    %rdi,%rbp
shl    $0x4,%rbp
lea    0x0(,%rbp,2),%r11
add    %rbp,%r11
lea    0x0(,%rdi,8),%r10
lea    (%r10,%r10,4),%r8
mov    %rdi,%r13
shl    $0x5,%r13
lea    (%r10,%r10,2),%r12
xor    %edx,%edx
mov    %rbx,%r15
movl   $0x0,(%rsp)
mov    %r11,0x40(%rsp)
jmp    12a4 <sphx2s+0x134>
nopl   0x0(%rax,%rax,1)
mov    (%rsp),%r11d
add    $0x1,%r11d
mov    0x18(%rsp),%rdx
add    0x60(%rsp),%rdx
mov    0x78(%rsp),%rcx
mov    0x50(%rsp),%r9
lea    (%r9,%rcx,8),%r9
mov    0xa0(%rsp),%r15
add    0x80(%rsp),%r15
mov    %r11d,(%rsp)
cmp    0x28(%rsp),%r11d
mov    0x40(%rsp),%r11
je     1352 <sphx2s+0x1e2>
movsd  (%r9),%xmm0
subsd  0x10(%r14),%xmm0
cmpl   $0x7,0x90(%rsp)
07
mov    %r9,0x50(%rsp)
mov    %rdx,0x18(%rsp)
mov    %r15,0xa0(%rsp)
jae    12e0 <sphx2s+0x170>
lea    (%rbx,%rdx,8),%r15
jmp    1328 <sphx2s+0x1b8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x38(%rsp),%rcx
mov    %ecx,%r9d
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,(%r15)
movsd  %xmm0,(%r15,%rdi,8)
movsd  %xmm0,(%r15,%rbp,1)
movsd  %xmm0,(%r15,%r12,1)
movsd  %xmm0,(%r15,%r13,1)
movsd  %xmm0,(%r15,%r8,1)
movsd  %xmm0,(%r15,%r11,1)
movsd  %xmm0,(%r15,%rsi,1)
add    %rax,%r15
add    $0xfffffff8,%r9d
jne    12f0 <sphx2s+0x180>
cmpl   $0x0,0x30(%rsp)
je     1260 <sphx2s+0xf0>
mov    0x30(%rsp),%ecx
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,(%r15)
add    %r10,%r15
add    $0xffffffff,%ecx
jne    1340 <sphx2s+0x1d0>
jmp    1260 <sphx2s+0xf0>
cmpl   $0x0,0x24(%rsp)
mov    0x60(%rsp),%r12
jle    1734 <sphx2s+0x5c4>
mov    0x100(%rsp),%r15
mov    0xf0(%rsp),%rbp
shl    $0x3,%r12
xor    %ecx,%ecx
jmp    13a0 <sphx2s+0x230>
nopw   0x0(%rax,%rax,1)
mov    0x4c(%rsp),%ecx
add    $0x1,%ecx
mov    0x78(%rsp),%rax
mov    0x18(%rsp),%rbp
lea    0x0(%rbp,%rax,8),%rbp
cmp    0x24(%rsp),%ecx
je     1734 <sphx2s+0x5c4>
mov    %ecx,0x4c(%rsp)
movsd  0x0(%rbp),%xmm0
mov    $0x1,%al
call   1040 <cosd@plt>
mov    %eax,(%rsp)
mov    %rbp,0x18(%rsp)
movsd  0x0(%rbp),%xmm0
mov    $0x1,%al
call   1030 <sind@plt>
mov    0x48(%rsp),%r13d
test   %r13d,%r13d
jle    1380 <sphx2s+0x210>
xorps  %xmm1,%xmm1
cvtsi2sdl (%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x18(%r14),%xmm2
movsd  0x20(%r14),%xmm3
movapd %xmm2,%xmm4
mulsd  %xmm1,%xmm4
movapd %xmm3,%xmm5
mulsd  %xmm1,%xmm5
movsd  %xmm5,0x38(%rsp)
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x40(%rsp)
mulsd  %xmm0,%xmm3
movsd  %xmm3,0x28(%rsp)
movapd %xmm4,0x80(%rsp)
movapd 0xbdc(%rip),%xmm0
xorpd  %xmm0,%xmm4
movapd %xmm4,0x90(%rsp)
xorpd  %xmm0,%xmm1
movapd %xmm1,0x60(%rsp)
jmp    1460 <sphx2s+0x2f0>
mov    $0x1,%al
call   1080 <asind@plt>
xorps  %xmm3,%xmm3
cvtsi2sd %eax,%xmm3
movsd  %xmm3,(%r15)
add    %r12,%rbx
add    %r12,%r15
add    $0xffffffff,%r13d
je     1380 <sphx2s+0x210>
movsd  (%rbx),%xmm0
movaps %xmm0,0x50(%rsp)
mov    $0x1,%al
call   1040 <cosd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm0,(%rsp)
movaps 0x50(%rsp),%xmm0
mov    $0x1,%al
call   1030 <sind@plt>
movapd (%rsp),%xmm3
mov    %eax,%ebp
movapd 0x90(%rsp),%xmm4
mulsd  %xmm3,%xmm4
addsd  0x28(%rsp),%xmm4
movapd %xmm4,%xmm0
andpd  0xb62(%rip),%xmm0
movsd  0xb6a(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    14f9 <sphx2s+0x389>
mov    0x18(%rsp),%rax
movsd  (%rax),%xmm0
addsd  0x8(%r14),%xmm0
mov    $0x1,%al
call   1040 <cosd@plt>
movapd (%rsp),%xmm3
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xb40(%rip),%xmm4
subsd  %xmm3,%xmm4
mulsd  0x80(%rsp),%xmm4
addsd  %xmm0,%xmm4
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
mulsd  0x60(%rsp),%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm4
movapd %xmm4,0xa0(%rsp)
movsd  %xmm1,0x30(%rsp)
jne    1560 <sphx2s+0x3f0>
jp     1560 <sphx2s+0x3f0>
ucomisd %xmm2,%xmm1
jne    1560 <sphx2s+0x3f0>
jp     1560 <sphx2s+0x3f0>
movsd  0xaff(%rip),%xmm0
ucomisd 0x8(%r14),%xmm0
jbe    1590 <sphx2s+0x420>
movapd 0x50(%rsp),%xmm0
movapd %xmm0,%xmm4
movsd  0xaed(%rip),%xmm3
addsd  %xmm3,%xmm4
jmp    15aa <sphx2s+0x43a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movapd %xmm1,%xmm0
movapd %xmm4,%xmm1
mov    $0x2,%al
call   1090 <atan2d@plt>
xorpd  %xmm2,%xmm2
xorps  %xmm4,%xmm4
cvtsi2sd %eax,%xmm4
movsd  0xab6(%rip),%xmm3
movapd 0x50(%rsp),%xmm0
jmp    15aa <sphx2s+0x43a>
nopw   0x0(%rax,%rax,1)
movapd 0x50(%rsp),%xmm0
movapd %xmm0,%xmm4
xorpd  0xa5e(%rip),%xmm4
movsd  0xa8e(%rip),%xmm3
addsd  (%r14),%xmm4
movsd  %xmm4,(%rbx)
movsd  (%r14),%xmm1
ucomisd %xmm2,%xmm1
jae    15d0 <sphx2s+0x460>
ucomisd %xmm2,%xmm4
movsd  0xa7e(%rip),%xmm1
ja     15de <sphx2s+0x46e>
jmp    15e6 <sphx2s+0x476>
xchg   %ax,%ax
ucomisd %xmm4,%xmm2
movsd  0xa64(%rip),%xmm1
jbe    15e6 <sphx2s+0x476>
addsd  %xmm1,%xmm4
movsd  %xmm4,(%rbx)
ucomisd 0xa52(%rip),%xmm4
movsd  0xa52(%rip),%xmm1
ja     160e <sphx2s+0x49e>
movsd  0xa48(%rip),%xmm1
ucomisd %xmm4,%xmm1
movsd  0xa34(%rip),%xmm1
jbe    1616 <sphx2s+0x4a6>
addsd  %xmm1,%xmm4
movsd  %xmm4,(%rbx)
movapd %xmm3,%xmm1
call   1050 <fmod@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1690 <sphx2s+0x520>
jp     1690 <sphx2s+0x520>
movapd (%rsp),%xmm2
mulsd  0x8(%r14),%xmm2
mov    0x18(%rsp),%rax
addsd  (%rax),%xmm2
movsd  0x9f1(%rip),%xmm1
subsd  %xmm2,%xmm1
movsd  0x9dd(%rip),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
movlpd %xmm0,(%r15)
movsd  0x9e7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1450 <sphx2s+0x2e0>
movsd  0x9dd(%rip),%xmm3
subsd  %xmm0,%xmm3
jmp    144b <sphx2s+0x2db>
nopl   0x0(%rax)
movapd (%rsp),%xmm0
mulsd  0x38(%rsp),%xmm0
addsd  0x40(%rsp),%xmm0
movapd %xmm0,%xmm2
andpd  0x963(%rip),%xmm2
ucomisd 0x99b(%rip),%xmm2
jbe    143d <sphx2s+0x2cd>
movsd  0x30(%rsp),%xmm3
mulsd  %xmm3,%xmm3
movapd 0xa0(%rsp),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
ucomisd %xmm1,%xmm2
movapd %xmm0,(%rsp)
jb     16ea <sphx2s+0x57a>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    16f3 <sphx2s+0x583>
movapd %xmm2,%xmm0
call   1070 <sqrt@plt>
mov    $0x1,%al
call   1060 <acosd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm0,%xmm1
andpd  0x903(%rip),%xmm1
orpd   0x8eb(%rip),%xmm0
xorpd  %xmm2,%xmm2
movapd (%rsp),%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm0
andnpd %xmm1,%xmm3
orpd   %xmm0,%xmm3
jmp    144b <sphx2s+0x2db>
xor    %eax,%eax
add    $0xb8,%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 double*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%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
%36 = alloca i32
%37 = alloca i32
%38 = alloca double*
%39 = alloca double*
%40 = alloca double*
%41 = alloca double*
store double* %0, double** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store double* %5, double** %15
store double* %6, double** %16
store double* %7, double** %17
store double* %8, double** %18
%42 = load i32, i32* %12
%43 = icmp sgt i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %9
%45 = load i32, i32* %11
store i32 %45, i32* %19
%46 = load i32, i32* %12
store i32 %46, i32* %20
br label %49
47: ; preds = %9
store i32 1, i32* %19
store i32 1, i32* %20
%48 = load i32, i32* %11
store i32 %48, i32* %12
br label %49
49: ; preds = %47, %44
%50 = load double*, double** %15
store double* %50, double** %38
store i32 0, i32* %22
%51 = load i32, i32* %11
%52 = load i32, i32* %14
%53 = mul nsw i32 %51, %52
store i32 %53, i32* %21
store i32 0, i32* %36
br label %54
54: ; preds = %84, %49
%55 = load i32, i32* %36
%56 = load i32, i32* %11
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %94
58: ; preds = %54
%59 = load double*, double** %38
%60 = load double, double* %59
%61 = load double*, double** %10
%62 = getelementptr inbounds double, double* %61, i64 2
%63 = load double, double* %62
%64 = fsub double %60, %63
store double %64, double* %28
%65 = load double*, double** %17
%66 = load i32, i32* %22
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %65, i64 %67
store double* %68, double** %41
store i32 0, i32* %37
br label %69
69: ; preds = %80, %58
%70 = load i32, i32* %37
%71 = load i32, i32* %20
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %83
73: ; preds = %69
%74 = load double, double* %28
%75 = load double*, double** %41
store double %74, double* %75
%76 = load i32, i32* %21
%77 = load double*, double** %41
%78 = sext i32 %76 to i64
%79 = getelementptr inbounds double, double* %77, i64 %78
store double* %79, double** %41
br label %80
80: ; preds = %73
%81 = load i32, i32* %37
%82 = add nsw i32 %81, 1
store i32 %82, i32* %37
br label %69
83: ; preds = %69
br label %84
84: ; preds = %83
%85 = load i32, i32* %36
%86 = add nsw i32 %85, 1
store i32 %86, i32* %36
%87 = load i32, i32* %14
%88 = load i32, i32* %22
%89 = add nsw i32 %88, %87
store i32 %89, i32* %22
%90 = load i32, i32* %13
%91 = load double*, double** %38
%92 = sext i32 %90 to i64
%93 = getelementptr inbounds double, double* %91, i64 %92
store double* %93, double** %38
br label %54
94: ; preds = %54
%95 = load double*, double** %16
store double* %95, double** %39
%96 = load double*, double** %17
store double* %96, double** %41
%97 = load double*, double** %18
store double* %97, double** %40
store i32 0, i32* %37
br label %98
98: ; preds = %326, %94
%99 = load i32, i32* %37
%100 = load i32, i32* %12
%101 = icmp slt i32 %99, %100
br i1 %101, label %102, label %333
102: ; preds = %98
%103 = load double*, double** %39
%104 = load double, double* %103
%105 = call i32 (double, ...) bitcast (i32 (...)* @cosd to i32 (double, ...)*)(double %104)
%106 = sitofp i32 %105 to double
store double %106, double* %24
%107 = load double*, double** %39
%108 = load double, double* %107
%109 = call i32 (double, ...) bitcast (i32 (...)* @sind to i32 (double, ...)*)(double %108)
%110 = sitofp i32 %109 to double
store double %110, double* %30
%111 = load double, double* %24
%112 = load double*, double** %10
%113 = getelementptr inbounds double, double* %112, i64 3
%114 = load double, double* %113
%115 = fmul double %111, %114
store double %115, double* %25
%116 = load double, double* %24
%117 = load double*, double** %10
%118 = getelementptr inbounds double, double* %117, i64 4
%119 = load double, double* %118
%120 = fmul double %116, %119
store double %120, double* %26
%121 = load double, double* %30
%122 = load double*, double** %10
%123 = getelementptr inbounds double, double* %122, i64 3
%124 = load double, double* %123
%125 = fmul double %121, %124
store double %125, double* %31
%126 = load double, double* %30
%127 = load double*, double** %10
%128 = getelementptr inbounds double, double* %127, i64 4
%129 = load double, double* %128
%130 = fmul double %126, %129
store double %130, double* %32
store i32 0, i32* %36
br label %131
131: ; preds = %314, %102
%132 = load i32, i32* %36
%133 = load i32, i32* %19
%134 = icmp slt i32 %132, %133
br i1 %134, label %135, label %325
135: ; preds = %131
%136 = load double*, double** %41
%137 = load double, double* %136
store double %137, double* %28
%138 = load double, double* %28
%139 = call i32 (double, ...) bitcast (i32 (...)* @cosd to i32 (double, ...)*)(double %138)
%140 = sitofp i32 %139 to double
store double %140, double* %23
%141 = load double, double* %28
%142 = call i32 (double, ...) bitcast (i32 (...)* @sind to i32 (double, ...)*)(double %141)
%143 = sitofp i32 %142 to double
store double %143, double* %29
%144 = load double, double* %32
%145 = load double, double* %25
%146 = load double, double* %23
%147 = fneg double %145
%148 = call double @llvm.fmuladd.f64(double %147, double %146, double %144)
store double %148, double* %33
%149 = load double, double* %33
%150 = call double @llvm.fabs.f64(double %149)
%151 = fcmp olt double %150, 1.000000e-05
br i1 %151, label %152, label %166
152: ; preds = %135
%153 = load double*, double** %39
%154 = load double, double* %153
%155 = load double*, double** %10
%156 = getelementptr inbounds double, double* %155, i64 1
%157 = load double, double* %156
%158 = fadd double %154, %157
%159 = call i32 (double, ...) bitcast (i32 (...)* @cosd to i32 (double, ...)*)(double %158)
%160 = sub nsw i32 0, %159
%161 = sitofp i32 %160 to double
%162 = load double, double* %25
%163 = load double, double* %23
%164 = fsub double 1.000000e+00, %163
%165 = call double @llvm.fmuladd.f64(double %162, double %164, double %161)
store double %165, double* %33
br label %166
166: ; preds = %152, %135
%167 = load double, double* %24
%168 = fneg double %167
%169 = load double, double* %29
%170 = fmul double %168, %169
store double %170, double* %34
%171 = load double, double* %33
%172 = fcmp une double %171, 0.000000e+00
br i1 %172, label %176, label %173
173: ; preds = %166
%174 = load double, double* %34
%175 = fcmp une double %174, 0.000000e+00
br i1 %175, label %176, label %181
176: ; preds = %173, %166
%177 = load double, double* %34
%178 = load double, double* %33
%179 = call i32 (double, double, ...) bitcast (i32 (...)* @atan2d to i32 (double, double, ...)*)(double %177, double %178)
%180 = sitofp i32 %179 to double
store double %180, double* %27
br label %193
181: ; preds = %173
%182 = load double*, double** %10
%183 = getelementptr inbounds double, double* %182, i64 1
%184 = load double, double* %183
%185 = fcmp olt double %184, 9.000000e+01
br i1 %185, label %186, label %189
186: ; preds = %181
%187 = load double, double* %28
%188 = fadd double %187, 1.800000e+02
store double %188, double* %27
br label %192
189: ; preds = %181
%190 = load double, double* %28
%191 = fneg double %190
store double %191, double* %27
br label %192
192: ; preds = %189, %186
br label %193
193: ; preds = %192, %176
%194 = load double*, double** %10
%195 = getelementptr inbounds double, double* %194, i64 0
%196 = load double, double* %195
%197 = load double, double* %27
%198 = fadd double %196, %197
%199 = load double*, double** %41
store double %198, double* %199
%200 = load double*, double** %10
%201 = getelementptr inbounds double, double* %200, i64 0
%202 = load double, double* %201
%203 = fcmp oge double %202, 0.000000e+00
br i1 %203, label %204, label %213
204: ; preds = %193
%205 = load double*, double** %41
%206 = load double, double* %205
%207 = fcmp olt double %206, 0.000000e+00
br i1 %207, label %208, label %212
208: ; preds = %204
%209 = load double*, double** %41
%210 = load double, double* %209
%211 = fadd double %210, 3.600000e+02
store double %211, double* %209
br label %212
212: ; preds = %208, %204
br label %222
213: ; preds = %193
%214 = load double*, double** %41
%215 = load double, double* %214
%216 = fcmp ogt double %215, 0.000000e+00
br i1 %216, label %217, label %221
217: ; preds = %213
%218 = load double*, double** %41
%219 = load double, double* %218
%220 = fsub double %219, 3.600000e+02
store double %220, double* %218
br label %221
221: ; preds = %217, %213
br label %222
222: ; preds = %221, %212
%223 = load double*, double** %41
%224 = load double, double* %223
%225 = fcmp ogt double %224, 3.600000e+02
br i1 %225, label %226, label %230
226: ; preds = %222
%227 = load double*, double** %41
%228 = load double, double* %227
%229 = fsub double %228, 3.600000e+02
store double %229, double* %227
br label %239
230: ; preds = %222
%231 = load double*, double** %41
%232 = load double, double* %231
%233 = fcmp olt double %232, -3.600000e+02
br i1 %233, label %234, label %238
234: ; preds = %230
%235 = load double*, double** %41
%236 = load double, double* %235
%237 = fadd double %236, 3.600000e+02
store double %237, double* %235
br label %238
238: ; preds = %234, %230
br label %239
239: ; preds = %238, %226
%240 = load double, double* %28
%241 = call double @fmod(double %240, double 1.800000e+02)
%242 = fcmp oeq double %241, 0.000000e+00
br i1 %242, label %243, label %270
243: ; preds = %239
%244 = load double*, double** %39
%245 = load double, double* %244
%246 = load double, double* %23
%247 = load double*, double** %10
%248 = getelementptr inbounds double, double* %247, i64 1
%249 = load double, double* %248
%250 = call double @llvm.fmuladd.f64(double %246, double %249, double %245)
%251 = load double*, double** %40
store double %250, double* %251
%252 = load double*, double** %40
%253 = load double, double* %252
%254 = fcmp ogt double %253, 9.000000e+01
br i1 %254, label %255, label %260
255: ; preds = %243
%256 = load double*, double** %40
%257 = load double, double* %256
%258 = fsub double 1.800000e+02, %257
%259 = load double*, double** %40
store double %258, double* %259
br label %260
260: ; preds = %255, %243
%261 = load double*, double** %40
%262 = load double, double* %261
%263 = fcmp olt double %262, -9.000000e+01
br i1 %263, label %264, label %269
264: ; preds = %260
%265 = load double*, double** %40
%266 = load double, double* %265
%267 = fsub double -1.800000e+02, %266
%268 = load double*, double** %40
store double %267, double* %268
br label %269
269: ; preds = %264, %260
br label %313
270: ; preds = %239
%271 = load double, double* %31
%272 = load double, double* %26
%273 = load double, double* %23
%274 = call double @llvm.fmuladd.f64(double %272, double %273, double %271)
store double %274, double* %35
%275 = load double, double* %35
%276 = call double @llvm.fabs.f64(double %275)
%277 = fcmp ogt double %276, 0x3FEFAE147AE147AE
br i1 %277, label %278, label %307
278: ; preds = %270
%279 = load double, double* %35
%280 = fcmp olt double %279, 0.000000e+00
br i1 %280, label %281, label %293
281: ; preds = %278
%282 = load double, double* %33
%283 = load double, double* %33
%284 = load double, double* %34
%285 = load double, double* %34
%286 = fmul double %284, %285
%287 = call double @llvm.fmuladd.f64(double %282, double %283, double %286)
%288 = call double @sqrt(double %287)
%289 = call i32 (double, ...) bitcast (i32 (...)* @acosd to i32 (double, ...)*)(double %288)
%290 = sitofp i32 %289 to double
%291 = call double @llvm.fabs.f64(double %290)
%292 = fneg double %291
br label %304
293: ; preds = %278
%294 = load double, double* %33
%295 = load double, double* %33
%296 = load double, double* %34
%297 = load double, double* %34
%298 = fmul double %296, %297
%299 = call double @llvm.fmuladd.f64(double %294, double %295, double %298)
%300 = call double @sqrt(double %299)
%301 = call i32 (double, ...) bitcast (i32 (...)* @acosd to i32 (double, ...)*)(double %300)
%302 = sitofp i32 %301 to double
%303 = call double @llvm.fabs.f64(double %302)
br label %304
304: ; preds = %293, %281
%305 = phi double [ %292, %281 ], [ %303, %293 ]
%306 = load double*, double** %40
store double %305, double* %306
br label %312
307: ; preds = %270
%308 = load double, double* %35
%309 = call i32 (double, ...) bitcast (i32 (...)* @asind to i32 (double, ...)*)(double %308)
%310 = sitofp i32 %309 to double
%311 = load double*, double** %40
store double %310, double* %311
br label %312
312: ; preds = %307, %304
br label %313
313: ; preds = %312, %269
br label %314
314: ; preds = %313
%315 = load i32, i32* %36
%316 = add nsw i32 %315, 1
store i32 %316, i32* %36
%317 = load i32, i32* %14
%318 = load double*, double** %41
%319 = sext i32 %317 to i64
%320 = getelementptr inbounds double, double* %318, i64 %319
store double* %320, double** %41
%321 = load i32, i32* %14
%322 = load double*, double** %40
%323 = sext i32 %321 to i64
%324 = getelementptr inbounds double, double* %322, i64 %323
store double* %324, double** %40
br label %131
325: ; preds = %131
br label %326
326: ; preds = %325
%327 = load i32, i32* %37
%328 = add nsw i32 %327, 1
store i32 %328, i32* %37
%329 = load i32, i32* %13
%330 = load double*, double** %39
%331 = sext i32 %329 to i64
%332 = getelementptr inbounds double, double* %330, i64 %331
store double* %332, double** %39
br label %98
333: ; preds = %98
ret i32 0
}

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 = icmp sgt i32 %2, 0
%11 = select i1 %10, i32 %1, i32 1
%12 = select i1 %10, i32 %2, i32 %1
%13 = icmp sgt i32 %1, 0
br i1 %13, label %14, label %27
14: ; preds = %9
%15 = mul nsw i32 %4, %1
%16 = getelementptr inbounds double, double* %0, i64 2
%17 = sext i32 %15 to i64
%18 = sext i32 %3 to i64
%19 = tail call i32 @llvm.smax.i32(i32 %2, i32 1)
%20 = select i1 %10, i32 %19, i32 1
%21 = sext i32 %4 to i64
%22 = add nsw i32 %20, -1
%23 = and i32 %20, 7
%24 = icmp ult i32 %22, 7
%25 = and i32 %20, 2147483640
%26 = icmp eq i32 %23, 0
br label %36
27: ; preds = %65, %9
%28 = icmp sgt i32 %12, 0
br i1 %28, label %29, label %191
29: ; preds = %27
%30 = getelementptr inbounds double, double* %0, i64 3
%31 = getelementptr inbounds double, double* %0, i64 4
%32 = icmp sgt i32 %11, 0
%33 = getelementptr inbounds double, double* %0, i64 1
%34 = sext i32 %4 to i64
%35 = sext i32 %3 to i64
br label %70
36: ; preds = %14, %65
%37 = phi i64 [ 0, %14 ], [ %67, %65 ]
%38 = phi double* [ %5, %14 ], [ %68, %65 ]
%39 = phi i32 [ 0, %14 ], [ %66, %65 ]
%40 = load double, double* %38
%41 = load double, double* %16
%42 = fsub double %40, %41
%43 = getelementptr inbounds double, double* %7, i64 %37
br i1 %24, label %57, label %44
44: ; preds = %36, %44
%45 = phi double* [ %54, %44 ], [ %43, %36 ]
%46 = phi i32 [ %55, %44 ], [ 0, %36 ]
store double %42, double* %45
%47 = getelementptr inbounds double, double* %45, i64 %17
store double %42, double* %47
%48 = getelementptr inbounds double, double* %47, i64 %17
store double %42, double* %48
%49 = getelementptr inbounds double, double* %48, i64 %17
store double %42, double* %49
%50 = getelementptr inbounds double, double* %49, i64 %17
store double %42, double* %50
%51 = getelementptr inbounds double, double* %50, i64 %17
store double %42, double* %51
%52 = getelementptr inbounds double, double* %51, i64 %17
store double %42, double* %52
%53 = getelementptr inbounds double, double* %52, i64 %17
store double %42, double* %53
%54 = getelementptr inbounds double, double* %53, i64 %17
%55 = add i32 %46, 8
%56 = icmp eq i32 %55, %25
br i1 %56, label %57, label %44
57: ; preds = %44, %36
%58 = phi double* [ %43, %36 ], [ %54, %44 ]
br i1 %26, label %65, label %59
59: ; preds = %57, %59
%60 = phi double* [ %62, %59 ], [ %58, %57 ]
%61 = phi i32 [ %63, %59 ], [ 0, %57 ]
store double %42, double* %60
%62 = getelementptr inbounds double, double* %60, i64 %17
%63 = add i32 %61, 1
%64 = icmp eq i32 %63, %23
br i1 %64, label %65, label %59
65: ; preds = %59, %57
%66 = add nuw nsw i32 %39, 1
%67 = add nsw i64 %37, %21
%68 = getelementptr inbounds double, double* %38, i64 %18
%69 = icmp eq i32 %66, %1
br i1 %69, label %27, label %36
70: ; preds = %29, %185
%71 = phi double* [ %7, %29 ], [ %187, %185 ]
%72 = phi double* [ %8, %29 ], [ %186, %185 ]
%73 = phi double* [ %6, %29 ], [ %189, %185 ]
%74 = phi i32 [ 0, %29 ], [ %188, %185 ]
%75 = load double, double* %73
%76 = tail call i32 (double, ...) bitcast (i32 (...)* @cosd to i32 (double, ...)*)(double %75)
%77 = sitofp i32 %76 to double
%78 = load double, double* %73
%79 = tail call i32 (double, ...) bitcast (i32 (...)* @sind to i32 (double, ...)*)(double %78)
%80 = sitofp i32 %79 to double
%81 = load double, double* %30
%82 = fmul double %81, %77
%83 = load double, double* %31
%84 = fmul double %83, %77
%85 = fmul double %81, %80
%86 = fmul double %83, %80
br i1 %32, label %87, label %185
87: ; preds = %70
%88 = fneg double %82
%89 = fneg double %77
br label %90
90: ; preds = %87, %180
%91 = phi double* [ %71, %87 ], [ %182, %180 ]
%92 = phi double* [ %72, %87 ], [ %183, %180 ]
%93 = phi i32 [ 0, %87 ], [ %181, %180 ]
%94 = load double, double* %91
%95 = tail call i32 (double, ...) bitcast (i32 (...)* @cosd to i32 (double, ...)*)(double %94)
%96 = sitofp i32 %95 to double
%97 = tail call i32 (double, ...) bitcast (i32 (...)* @sind to i32 (double, ...)*)(double %94)
%98 = sitofp i32 %97 to double
%99 = tail call double @llvm.fmuladd.f64(double %88, double %96, double %86)
%100 = tail call double @llvm.fabs.f64(double %99)
%101 = fcmp olt double %100, 1.000000e-05
br i1 %101, label %102, label %111
102: ; preds = %90
%103 = load double, double* %73
%104 = load double, double* %33
%105 = fadd double %103, %104
%106 = tail call i32 (double, ...) bitcast (i32 (...)* @cosd to i32 (double, ...)*)(double %105)
%107 = sub nsw i32 0, %106
%108 = sitofp i32 %107 to double
%109 = fsub double 1.000000e+00, %96
%110 = tail call double @llvm.fmuladd.f64(double %82, double %109, double %108)
br label %111
111: ; preds = %102, %90
%112 = phi double [ %110, %102 ], [ %99, %90 ]
%113 = fmul double %89, %98
%114 = fcmp une double %112, 0.000000e+00
%115 = fcmp une double %113, 0.000000e+00
%116 = select i1 %114, i1 true, i1 %115
br i1 %116, label %117, label %120
117: ; preds = %111
%118 = tail call i32 (double, double, ...) bitcast (i32 (...)* @atan2d to i32 (double, double, ...)*)(double %113, double %112)
%119 = sitofp i32 %118 to double
br label %127
120: ; preds = %111
%121 = load double, double* %33
%122 = fcmp olt double %121, 9.000000e+01
br i1 %122, label %123, label %125
123: ; preds = %120
%124 = fadd double %94, 1.800000e+02
br label %127
125: ; preds = %120
%126 = fneg double %94
br label %127
127: ; preds = %123, %125, %117
%128 = phi double [ %119, %117 ], [ %124, %123 ], [ %126, %125 ]
%129 = load double, double* %0
%130 = fadd double %128, %129
store double %130, double* %91
%131 = load double, double* %0
%132 = fcmp ult double %131, 0.000000e+00
br i1 %132, label %135, label %133
133: ; preds = %127
%134 = fcmp olt double %130, 0.000000e+00
br i1 %134, label %137, label %140
135: ; preds = %127
%136 = fcmp ogt double %130, 0.000000e+00
br i1 %136, label %137, label %140
137: ; preds = %135, %133
%138 = phi double [ 3.600000e+02, %133 ], [ -3.600000e+02, %135 ]
%139 = fadd double %130, %138
store double %139, double* %91
br label %140
140: ; preds = %137, %135, %133
%141 = phi double [ %130, %135 ], [ %130, %133 ], [ %139, %137 ]
%142 = fcmp ogt double %141, 3.600000e+02
br i1 %142, label %145, label %143
143: ; preds = %140
%144 = fcmp olt double %141, -3.600000e+02
br i1 %144, label %145, label %148
145: ; preds = %143, %140
%146 = phi double [ -3.600000e+02, %140 ], [ 3.600000e+02, %143 ]
%147 = fadd double %141, %146
store double %147, double* %91
br label %148
148: ; preds = %145, %143
%149 = tail call double @fmod(double %94, double 1.800000e+02)
%150 = fcmp oeq double %149, 0.000000e+00
br i1 %150, label %151, label %161
151: ; preds = %148
%152 = load double, double* %73
%153 = load double, double* %33
%154 = tail call double @llvm.fmuladd.f64(double %96, double %153, double %152)
%155 = fcmp ogt double %154, 9.000000e+01
%156 = fsub double 1.800000e+02, %154
%157 = select i1 %155, double %156, double %154
store double %157, double* %92
%158 = fcmp olt double %157, -9.000000e+01
br i1 %158, label %159, label %180
159: ; preds = %151
%160 = fsub double -1.800000e+02, %157
br label %178
161: ; preds = %148
%162 = tail call double @llvm.fmuladd.f64(double %84, double %96, double %85)
%163 = tail call double @llvm.fabs.f64(double %162)
%164 = fcmp ogt double %163, 0x3FEFAE147AE147AE
br i1 %164, label %165, label %175
165: ; preds = %161
%166 = fcmp olt double %162, 0.000000e+00
%167 = fmul double %113, %113
%168 = tail call double @llvm.fmuladd.f64(double %112, double %112, double %167)
%169 = tail call double @sqrt(double %168)
%170 = tail call i32 (double, ...) bitcast (i32 (...)* @acosd to i32 (double, ...)*)(double %169)
%171 = sitofp i32 %170 to double
%172 = tail call double @llvm.fabs.f64(double %171)
%173 = fneg double %172
%174 = select i1 %166, double %173, double %172
br label %178
175: ; preds = %161
%176 = tail call i32 (double, ...) bitcast (i32 (...)* @asind to i32 (double, ...)*)(double %162)
%177 = sitofp i32 %176 to double
br label %178
178: ; preds = %165, %175, %159
%179 = phi double [ %160, %159 ], [ %177, %175 ], [ %174, %165 ]
store double %179, double* %92
br label %180
180: ; preds = %178, %151
%181 = add nuw nsw i32 %93, 1
%182 = getelementptr inbounds double, double* %91, i64 %34
%183 = getelementptr inbounds double, double* %92, i64 %34
%184 = icmp eq i32 %181, %11
br i1 %184, label %185, label %90
185: ; preds = %180, %70
%186 = phi double* [ %72, %70 ], [ %183, %180 ]
%187 = phi double* [ %71, %70 ], [ %182, %180 ]
%188 = add nuw nsw i32 %74, 1
%189 = getelementptr inbounds double, double* %73, i64 %35
%190 = icmp eq i32 %188, %12
br i1 %190, label %191, label %70
191: ; preds = %185, %27
ret i32 0
}