int sphs2x(const double eul[5], int nlng, int nlat, int sll, int spt,
           const double lng[], const double lat[], double phi[],
           double theta[]) {
  int mlat, mlng, rowlen, rowoff;
  double coslat, coslat3, coslat4, coslng, dlng, dphi, sinlat, sinlat3, sinlat4,
      sinlng, x, y, z;
  register int ilat, ilng;
  register const double *latp, *lngp;
  register double *phip, *thetap;
  if (nlat > 0) {
    mlng = nlng;
    mlat = nlat;
  } else {
    mlng = 1;
    mlat = 1;
    nlat = nlng;
  }
  if (eul[4] == 0.0) {
    if (eul[1] == 0.0) {
      dphi = fmod(eul[2] - 180.0 - eul[0], 360.0);
      lngp = lng;
      latp = lat;
      phip = phi;
      thetap = theta;
      for (ilat = 0; ilat < nlat; ilat++) {
        for (ilng = 0; ilng < mlng; ilng++) {
          *phip = fmod(*lngp + dphi, 360.0);
          *thetap = *latp;
          if (*phip > 180.0) {
            *phip -= 360.0;
          } else if (*phip < -180.0) {
            *phip += 360.0;
          }
          phip += spt;
          thetap += spt;
          lngp += sll;
          latp += sll;
        }
      }
    } else {
      dphi = fmod(eul[2] + eul[0], 360.0);
      lngp = lng;
      latp = lat;
      phip = phi;
      thetap = theta;
      for (ilat = 0; ilat < nlat; ilat++) {
        for (ilng = 0; ilng < mlng; ilng++) {
          *phip = fmod(dphi - *lngp, 360.0);
          *thetap = -(*latp);
          if (*phip > 180.0) {
            *phip -= 360.0;
          } else if (*phip < -180.0) {
            *phip += 360.0;
          }
          phip += spt;
          thetap += spt;
          lngp += sll;
          latp += sll;
        }
      }
    }
    return 0;
  }
  lngp = lng;
  rowoff = 0;
  rowlen = nlng * spt;
  for (ilng = 0; ilng < nlng; ilng++, rowoff += spt, lngp += sll) {
    dlng = *lngp - eul[0];
    phip = phi + rowoff;
    thetap = theta;
    for (ilat = 0; ilat < mlat; ilat++) {
      *phip = dlng;
      phip += rowlen;
    }
  }
  latp = lat;
  phip = phi;
  thetap = theta;
  for (ilat = 0; ilat < nlat; ilat++, latp += sll) {
    sincosd(*latp, &sinlat, &coslat);
    coslat3 = coslat * eul[3];
    coslat4 = coslat * eul[4];
    sinlat3 = sinlat * eul[3];
    sinlat4 = sinlat * eul[4];
    for (ilng = 0; ilng < mlng; ilng++, phip += spt, thetap += spt) {
      dlng = *phip;
      sincosd(dlng, &sinlng, &coslng);
      x = sinlat4 - coslat3 * coslng;
      if (fabs(x) < 1.0e-5) {
        x = -cosd(*latp + eul[1]) + coslat3 * (1.0 - coslng);
      }
      y = -coslat * sinlng;
      if (x != 0.0 || y != 0.0) {
        dphi = atan2d(y, x);
      } else {
        if (eul[1] < 90.0) {
          dphi = dlng - 180.0;
        } else {
          dphi = -dlng;
        }
      }
      *phip = fmod(eul[2] + dphi, 360.0);
      if (*phip > 180.0) {
        *phip -= 360.0;
      } else if (*phip < -180.0) {
        *phip += 360.0;
      }
      if (fmod(dlng, 180.0) == 0.0) {
        *thetap = *latp + coslng * eul[1];
        if (*thetap > 90.0)
          *thetap = 180.0 - *thetap;
        if (*thetap < -90.0)
          *thetap = -180.0 - *thetap;
      } else {
        z = sinlat3 + coslat4 * coslng;
        if (fabs(z) > 0.99) {
          *thetap = ((z) < 0.0 ? -fabs(acosd(sqrt(x * x + y * y)))
                               : fabs(acosd(sqrt(x * x + y * y))));
        } else {
          *thetap = asind(z);
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<sphs2x>:
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 <sphs2x+0x47>
mov    -0x14(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    11cb <sphs2x+0x5b>
movl   $0x1,-0x30(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    15d0 <sphs2x+0x460>
jp     15d0 <sphs2x+0x460>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13de <sphs2x+0x26e>
jp     13de <sphs2x+0x26e>
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  0xe04(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  0xdf8(%rip),%xmm1
call   1040 <fmod@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0xc8(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    13d9 <sphs2x+0x269>
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    13c0 <sphs2x+0x250>
mov    -0xb8(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  0xd78(%rip),%xmm1
call   1040 <fmod@plt>
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xb0(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0xc8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xd37(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    130b <sphs2x+0x19b>
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xd22(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    1340 <sphs2x+0x1d0>
mov    -0xc0(%rbp),%rax
movsd  0xd0e(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    133b <sphs2x+0x1cb>
mov    -0xc0(%rbp),%rax
movsd  0xced(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1340 <sphs2x+0x1d0>
mov    -0x20(%rbp),%ecx
mov    -0xc0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0xc8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc8(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0xb8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0xb0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb0(%rbp)
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    1281 <sphs2x+0x111>
jmp    13c5 <sphs2x+0x255>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1268 <sphs2x+0xf8>
jmp    15c4 <sphs2x+0x454>
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
movsd  0xc29(%rip),%xmm1
call   1040 <fmod@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0xc8(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    15bf <sphs2x+0x44f>
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    15a6 <sphs2x+0x436>
movsd  -0x68(%rbp),%xmm0
mov    -0xb8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  0xba9(%rip),%xmm1
call   1040 <fmod@plt>
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xb0(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0xc8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xb51(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    14f1 <sphs2x+0x381>
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xb3c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    1526 <sphs2x+0x3b6>
mov    -0xc0(%rbp),%rax
movsd  0xb28(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    1521 <sphs2x+0x3b1>
mov    -0xc0(%rbp),%rax
movsd  0xb07(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1526 <sphs2x+0x3b6>
mov    -0x20(%rbp),%ecx
mov    -0xc0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0xc8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc8(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0xb8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0xb0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb0(%rbp)
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    1450 <sphs2x+0x2e0>
jmp    15ab <sphs2x+0x43b>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1437 <sphs2x+0x2c7>
jmp    15c4 <sphs2x+0x454>
movl   $0x0,-0x4(%rbp)
jmp    1c65 <sphs2x+0xaf5>
mov    -0x28(%rbp),%rax
mov    %rax,-0xb8(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x20(%rbp),%eax
mov    %eax,-0x34(%rbp)
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    16d3 <sphs2x+0x563>
mov    -0xb8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0xc8(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1696 <sphs2x+0x526>
movsd  -0x60(%rbp),%xmm0
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x34(%rbp),%ecx
mov    -0xc0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1648 <sphs2x+0x4d8>
jmp    169b <sphs2x+0x52b>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
mov    -0x20(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0xb8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
jmp    15f6 <sphs2x+0x486>
mov    0x10(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0xc8(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1c5e <sphs2x+0xaee>
mov    -0xb0(%rbp),%rax
movsd  (%rax),%xmm0
lea    -0x70(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x1,%al
call   1070 <sincosd@plt>
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    1c2a <sphs2x+0xaba>
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
lea    -0x88(%rbp),%rdi
lea    -0x58(%rbp),%rsi
mov    $0x1,%al
call   1070 <sincosd@plt>
movsd  -0x80(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%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 0x848(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x7fc(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1855 <sphs2x+0x6e5>
mov    -0xb0(%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  -0x48(%rbp),%xmm0
movsd  0x7c8(%rip),%xmm2
subsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    18bc <sphs2x+0x74c>
jp     18bc <sphs2x+0x74c>
movsd  -0x98(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    18bc <sphs2x+0x74c>
jp     18bc <sphs2x+0x74c>
jmp    18e1 <sphs2x+0x771>
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
mov    $0x2,%al
call   1090 <atan2d@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1939 <sphs2x+0x7c9>
mov    -0x10(%rbp),%rax
movsd  0x723(%rip),%xmm0
ucomisd 0x8(%rax),%xmm0
jbe    1913 <sphs2x+0x7a3>
movsd  -0x60(%rbp),%xmm0
movsd  0x713(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1934 <sphs2x+0x7c4>
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1939 <sphs2x+0x7c9>
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  0x6d1(%rip),%xmm1
call   1040 <fmod@plt>
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x6a6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    199c <sphs2x+0x82c>
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x691(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    19d1 <sphs2x+0x861>
mov    -0xc0(%rbp),%rax
movsd  0x67d(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    19cc <sphs2x+0x85c>
mov    -0xc0(%rbp),%rax
movsd  0x65c(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    19d1 <sphs2x+0x861>
movsd  -0x60(%rbp),%xmm0
movsd  0x63a(%rip),%xmm1
call   1040 <fmod@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1a99 <sphs2x+0x929>
jp     1a99 <sphs2x+0x929>
mov    -0xb0(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0xc8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xc8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x5db(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1a5d <sphs2x+0x8ed>
mov    -0xc8(%rbp),%rax
movsd  0x5ca(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0xc8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xc8(%rbp),%rax
movsd  0x5cc(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    1a94 <sphs2x+0x924>
mov    -0xc8(%rbp),%rax
movsd  0x5a3(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0xc8(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1bdb <sphs2x+0xa6b>
movsd  -0x78(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movaps 0x579(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0x55d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1bb8 <sphs2x+0xa48>
xorps  %xmm0,%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jbe    1b55 <sphs2x+0x9e5>
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 0x513(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    1ba0 <sphs2x+0xa30>
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 0x4ac(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
mov    -0xc8(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1bd6 <sphs2x+0xa66>
movsd  -0xa0(%rbp),%xmm0
ff
mov    $0x1,%al
call   1080 <asind@plt>
cvtsi2sd %eax,%xmm0
mov    -0xc8(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1bdb <sphs2x+0xa6b>
jmp    1be0 <sphs2x+0xa70>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0xc0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0xc8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc8(%rbp)
jmp    177d <sphs2x+0x60d>
jmp    1c2f <sphs2x+0xabf>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0xb0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb0(%rbp)
jmp    16fe <sphs2x+0x58e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sphs2x>:
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,0x8(%rsp)
movsd  0x20(%rdi),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %r14d,0xc(%rsp)
jne    12e6 <sphs2x+0x176>
jp     12e6 <sphs2x+0x176>
movsd  0x8(%r13),%xmm2
movsd  0x10(%r13),%xmm0
ucomisd %xmm1,%xmm2
mov    %r8d,0x20(%rsp)
mov    %ecx,0x30(%rsp)
jne    181d <sphs2x+0x6ad>
jp     181d <sphs2x+0x6ad>
addsd  0xe39(%rip),%xmm0
subsd  0x0(%r13),%xmm0
movsd  0xe33(%rip),%xmm1
call   1040 <fmod@plt>
movsd  %xmm0,0x10(%rsp)
cmpl   $0x0,0x8(%rsp)
jle    190c <sphs2x+0x79c>
movslq 0x20(%rsp),%rax
movslq 0x30(%rsp),%r13
shl    $0x3,%rax
mov    %rax,0x20(%rsp)
shl    $0x3,%r13
xor    %eax,%eax
jmp    1256 <sphs2x+0xe6>
xchg   %ax,%ax
mov    0x30(%rsp),%eax
add    $0x1,%eax
cmp    0x8(%rsp),%eax
mov    0xc(%rsp),%r14d
je     190c <sphs2x+0x79c>
test   %r14d,%r14d
mov    %eax,0x30(%rsp)
jg     1290 <sphs2x+0x120>
jmp    1240 <sphs2x+0xd0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r15)
mov    0x20(%rsp),%rax
add    %rax,%r12
add    %rax,%r15
add    %r13,%rbx
add    %r13,%rbp
add    $0xffffffff,%r14d
je     1240 <sphs2x+0xd0>
movsd  (%rbx),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  0xd9e(%rip),%xmm1
call   1040 <fmod@plt>
movsd  %xmm0,(%r15)
movsd  0x0(%rbp),%xmm0
movsd  %xmm0,(%r12)
movsd  (%r15),%xmm0
ucomisd 0xd8c(%rip),%xmm0
movsd  0xd7c(%rip),%xmm1
ja     1270 <sphs2x+0x100>
movsd  0xd62(%rip),%xmm1
ucomisd %xmm0,%xmm1
movsd  0xd5e(%rip),%xmm1
ja     1270 <sphs2x+0x100>
jmp    1279 <sphs2x+0x109>
movslq %ecx,%rax
mov    %rax,0x70(%rsp)
movslq %r8d,%rax
mov    %rax,0x48(%rsp)
test   %esi,%esi
jle    14b3 <sphs2x+0x343>
imul   %esi,%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,0x80(%rsp)
mov    %ecx,%eax
and    $0x7,%eax
mov    %eax,0x40(%rsp)
and    $0x7ffffff8,%ecx
mov    %rcx,0xb0(%rsp)
mov    %esi,%ecx
mov    %rdi,0xa8(%rsp)
mov    0x48(%rsp),%rax
lea    0x0(,%rax,8),%rax
mov    %rax,0x68(%rsp)
mov    %rdi,%r14
shl    $0x6,%r14
imul   $0x38,%rdi,%rsi
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),%r11
xor    %eax,%eax
mov    %rax,0x10(%rsp)
mov    %r15,0x20(%rsp)
movl   $0x0,0x30(%rsp)
mov    %r13,0x90(%rsp)
mov    %ecx,0x60(%rsp)
mov    %r14,0x58(%rsp)
jmp    13fb <sphs2x+0x28b>
nopl   0x0(%rax,%rax,1)
mov    0x30(%rsp),%eax
add    $0x1,%eax
mov    0x10(%rsp),%rcx
add    0x48(%rsp),%rcx
mov    %rcx,0x10(%rsp)
mov    0x70(%rsp),%rcx
lea    (%rbx,%rcx,8),%rbx
mov    0x20(%rsp),%rcx
add    0x68(%rsp),%rcx
mov    %rcx,0x20(%rsp)
mov    %r14d,%ecx
mov    %eax,0x30(%rsp)
cmp    %r14d,%eax
mov    0x90(%rsp),%r13
mov    0x58(%rsp),%r14
je     14b3 <sphs2x+0x343>
movsd  (%rbx),%xmm0
subsd  0x0(%r13),%xmm0
cmpl   $0x7,0x80(%rsp)
07
jae    1420 <sphs2x+0x2b0>
mov    0x10(%rsp),%rax
lea    (%r15,%rax,8),%r13
jmp    1480 <sphs2x+0x310>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rax
mov    0xb0(%rsp),%rcx
mov    %ecx,%r14d
mov    0xa8(%rsp),%rcx
mov    0x20(%rsp),%r13
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,0x0(%r13)
movsd  %xmm0,0x0(%r13,%rcx,8)
movsd  %xmm0,0x0(%r13,%rdx,1)
movsd  %xmm0,0x0(%r13,%r11,1)
movsd  %xmm0,0x0(%r13,%rdi,1)
movsd  %xmm0,0x0(%r13,%r10,1)
movsd  %xmm0,0x0(%r13,%r8,1)
movsd  %xmm0,0x0(%r13,%rsi,1)
add    %rax,%r13
add    $0xfffffff8,%r14d
jne    1440 <sphs2x+0x2d0>
mov    0x60(%rsp),%r14d
cmpl   $0x0,0x40(%rsp)
je     13b0 <sphs2x+0x240>
mov    0x40(%rsp),%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm0,0x0(%r13)
add    %r9,%r13
add    $0xffffffff,%ecx
jne    14a0 <sphs2x+0x330>
jmp    13b0 <sphs2x+0x240>
cmpl   $0x0,0x8(%rsp)
mov    0xc(%rsp),%r14d
jle    190c <sphs2x+0x79c>
shlq   $0x3,0x48(%rsp)
xor    %ebx,%ebx
jmp    14eb <sphs2x+0x37b>
nopl   (%rax)
mov    0x58(%rsp),%ebx
add    $0x1,%ebx
mov    0x70(%rsp),%rax
lea    0x0(%rbp,%rax,8),%rbp
cmp    0x8(%rsp),%ebx
je     190c <sphs2x+0x79c>
movsd  0x0(%rbp),%xmm0
lea    0xc0(%rsp),%rdi
lea    0x78(%rsp),%rsi
mov    $0x1,%al
call   1070 <sincosd@plt>
test   %r14d,%r14d
mov    %ebx,0x58(%rsp)
jle    14d0 <sphs2x+0x360>
movsd  0x78(%rsp),%xmm0
movsd  0x18(%r13),%xmm1
movsd  0x20(%r13),%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x68(%rsp)
movsd  0xc0(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x60(%rsp)
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x40(%rsp)
movapd %xmm3,0x80(%rsp)
xorpd  0xaa1(%rip),%xmm3
movapd %xmm3,0x90(%rsp)
mov    %r14d,%ebx
jmp    1599 <sphs2x+0x429>
movapd %xmm3,%xmm0
mov    $0x1,%al
call   1080 <asind@plt>
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movsd  %xmm2,(%r12)
mov    0x48(%rsp),%rax
add    %rax,%r12
add    %rax,%r15
add    $0xffffffff,%ebx
je     14d0 <sphs2x+0x360>
movsd  (%r15),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xb8(%rsp),%rdi
lea    0x50(%rsp),%rsi
mov    $0x1,%al
call   1070 <sincosd@plt>
movsd  0x50(%rsp),%xmm2
mulsd  0x90(%rsp),%xmm2
addsd  0x40(%rsp),%xmm2
movapd %xmm2,%xmm0
andpd  0xa38(%rip),%xmm0
movsd  0xa40(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    161c <sphs2x+0x4ac>
movsd  0x0(%rbp),%xmm0
addsd  0x8(%r13),%xmm0
mov    $0x1,%al
call   1030 <cosd@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xa1f(%rip),%xmm2
subsd  0x50(%rsp),%xmm2
mulsd  0x80(%rsp),%xmm2
addsd  %xmm0,%xmm2
movsd  0x78(%rsp),%xmm1
xorpd  0x9d6(%rip),%xmm1
mulsd  0xb8(%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
movapd %xmm2,0x20(%rsp)
movapd %xmm1,0x30(%rsp)
jne    1680 <sphs2x+0x510>
jp     1680 <sphs2x+0x510>
ucomisd %xmm0,%xmm1
jne    1680 <sphs2x+0x510>
jp     1680 <sphs2x+0x510>
movsd  0x9d5(%rip),%xmm0
ucomisd 0x8(%r13),%xmm0
jbe    16a0 <sphs2x+0x530>
movapd 0x10(%rsp),%xmm0
addsd  0x9c7(%rip),%xmm0
jmp    16ae <sphs2x+0x53e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm1,%xmm0
movapd %xmm2,%xmm1
mov    $0x2,%al
call   1090 <atan2d@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
jmp    16ae <sphs2x+0x53e>
nopl   0x0(%rax,%rax,1)
movapd 0x10(%rsp),%xmm0
xorpd  0x952(%rip),%xmm0
addsd  0x10(%r13),%xmm0
movsd  0x984(%rip),%xmm1
call   1040 <fmod@plt>
movsd  %xmm0,(%r15)
movsd  0x982(%rip),%xmm2
ucomisd %xmm2,%xmm0
movsd  0x96e(%rip),%xmm1
ja     16f2 <sphs2x+0x582>
movsd  0x954(%rip),%xmm1
ucomisd %xmm0,%xmm1
movsd  0x950(%rip),%xmm1
jbe    16fb <sphs2x+0x58b>
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r15)
movapd 0x10(%rsp),%xmm0
movapd %xmm2,%xmm1
call   1040 <fmod@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1780 <sphs2x+0x610>
jp     1780 <sphs2x+0x610>
movsd  0x50(%rsp),%xmm1
mulsd  0x8(%r13),%xmm1
addsd  0x0(%rbp),%xmm1
movsd  0x921(%rip),%xmm2
subsd  %xmm1,%xmm2
movsd  0x8f5(%rip),%xmm0
cmpltsd %xmm1,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
movlpd %xmm0,(%r12)
movsd  0x906(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1585 <sphs2x+0x415>
movsd  0x8cc(%rip),%xmm2
subsd  %xmm0,%xmm2
jmp    157f <sphs2x+0x40f>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  0x50(%rsp),%xmm3
mulsd  0x68(%rsp),%xmm3
addsd  0x60(%rsp),%xmm3
movapd %xmm3,%xmm0
andpd  0x872(%rip),%xmm0
ucomisd 0x8b2(%rip),%xmm0
jbe    156d <sphs2x+0x3fd>
movapd 0x30(%rsp),%xmm2
mulsd  %xmm2,%xmm2
movapd 0x20(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
movapd %xmm3,0x10(%rsp)
jb     17d6 <sphs2x+0x666>
sqrtsd %xmm0,%xmm0
jmp    17db <sphs2x+0x66b>
call   1060 <sqrt@plt>
mov    $0x1,%al
call   1050 <acosd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm0,%xmm1
andpd  0x81b(%rip),%xmm1
orpd   0x803(%rip),%xmm0
movapd 0x10(%rsp),%xmm2
cmpltsd 0x85c(%rip),%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
jmp    157f <sphs2x+0x40f>
addsd  0x0(%r13),%xmm0
movsd  0x815(%rip),%xmm1
call   1040 <fmod@plt>
movsd  %xmm0,0x10(%rsp)
cmpl   $0x0,0x8(%rsp)
jle    190c <sphs2x+0x79c>
movslq 0x20(%rsp),%rax
movslq 0x30(%rsp),%r13
shl    $0x3,%rax
mov    %rax,0x20(%rsp)
shl    $0x3,%r13
xor    %eax,%eax
jmp    1876 <sphs2x+0x706>
nopl   0x0(%rax)
mov    0x30(%rsp),%eax
add    $0x1,%eax
cmp    0x8(%rsp),%eax
mov    0xc(%rsp),%r14d
je     190c <sphs2x+0x79c>
test   %r14d,%r14d
mov    %eax,0x30(%rsp)
jg     18b0 <sphs2x+0x740>
jmp    1860 <sphs2x+0x6f0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r15)
mov    0x20(%rsp),%rax
add    %rax,%r12
add    %rax,%r15
add    %r13,%rbx
add    %r13,%rbp
add    $0xffffffff,%r14d
je     1860 <sphs2x+0x6f0>
movsd  0x10(%rsp),%xmm0
subsd  (%rbx),%xmm0
movsd  0x77e(%rip),%xmm1
call   1040 <fmod@plt>
movsd  %xmm0,(%r15)
movsd  0x0(%rbp),%xmm0
xorps  0x728(%rip),%xmm0
movlps %xmm0,(%r12)
movsd  (%r15),%xmm0
ucomisd 0x766(%rip),%xmm0
movsd  0x756(%rip),%xmm1
ja     1890 <sphs2x+0x720>
movsd  0x73c(%rip),%xmm1
ucomisd %xmm0,%xmm1
movsd  0x738(%rip),%xmm1
ja     1890 <sphs2x+0x720>
jmp    1899 <sphs2x+0x729>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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