int sphs2x(eul, nlng, nlat, sll, spt, lng, lat, phi, theta) const double eul[5];
int nlat, nlng, sll, spt;
const double lat[], lng[];
double phi[], 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;
  }
  lngp = lng;
  rowoff = 0;
  rowlen = nlng * spt;
  for (ilng = 0; ilng < nlng; ilng++, rowoff += spt, lngp += sll) {
    dlng = *lngp - eul[0];
    phip = phi + rowoff;
    for (ilat = 0; ilat < mlat; ilat++) {
      *phip = dlng;
      phip += rowlen;
    }
  }
  latp = lat;
  phip = phi;
  thetap = theta;
  for (ilat = 0; ilat < nlat; ilat++, latp += sll) {
    coslat = cosd(*latp);
    sinlat = sind(*latp);
    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;
      coslng = cosd(dlng);
      sinlng = sind(dlng);
      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,-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 <sphs2x+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    11cb <sphs2x+0x5b>
movl   $0x1,-0x28(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0xb0(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12c3 <sphs2x+0x153>
mov    -0xb0(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1286 <sphs2x+0x116>
movsd  -0x58(%rbp),%xmm0
mov    -0xb8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0xb8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1238 <sphs2x+0xc8>
jmp    128b <sphs2x+0x11b>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
mov    -0x18(%rbp),%eax
add    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0xb0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb0(%rbp)
jmp    11f1 <sphs2x+0x81>
mov    0x10(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0xc0(%rbp)
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    187a <sphs2x+0x70a>
mov    -0xa8(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%al
call   1040 <cosd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0xa8(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%al
call   1030 <sind@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1846 <sphs2x+0x6d6>
mov    -0xb8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    $0x1,%al
call   1040 <cosd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    $0x1,%al
call   1030 <sind@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%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 0xc29(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xbdd(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1474 <sphs2x+0x304>
mov    -0xa8(%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  -0x40(%rbp),%xmm0
movsd  0xba9(%rip),%xmm2
subsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14d8 <sphs2x+0x368>
jp     14d8 <sphs2x+0x368>
movsd  -0x90(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14d8 <sphs2x+0x368>
jp     14d8 <sphs2x+0x368>
jmp    14fd <sphs2x+0x38d>
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm1
ff
mov    $0x2,%al
call   1090 <atan2d@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1555 <sphs2x+0x3e5>
mov    -0x8(%rbp),%rax
movsd  0xb07(%rip),%xmm0
ucomisd 0x8(%rax),%xmm0
jbe    152f <sphs2x+0x3bf>
movsd  -0x58(%rbp),%xmm0
movsd  0xaf7(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1550 <sphs2x+0x3e0>
movsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1555 <sphs2x+0x3e5>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  0xab5(%rip),%xmm1
call   1050 <fmod@plt>
mov    -0xb8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xb8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xa8a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    15b8 <sphs2x+0x448>
mov    -0xb8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xa75(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    15ed <sphs2x+0x47d>
mov    -0xb8(%rbp),%rax
movsd  0xa61(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    15e8 <sphs2x+0x478>
mov    -0xb8(%rbp),%rax
movsd  0xa40(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    15ed <sphs2x+0x47d>
movsd  -0x58(%rbp),%xmm0
movsd  0xa1e(%rip),%xmm1
call   1050 <fmod@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    16b5 <sphs2x+0x545>
jp     16b5 <sphs2x+0x545>
mov    -0xa8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xc0(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x9bf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1679 <sphs2x+0x509>
mov    -0xc0(%rbp),%rax
movsd  0x9ae(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0xc0(%rbp),%rax
movsd  0x9b0(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    16b0 <sphs2x+0x540>
mov    -0xc0(%rbp),%rax
movsd  0x987(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    17f7 <sphs2x+0x687>
movsd  -0x70(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movaps 0x95d(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0x941(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    17d4 <sphs2x+0x664>
xorps  %xmm0,%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jbe    1771 <sphs2x+0x601>
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 0x8f7(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    17bc <sphs2x+0x64c>
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 0x890(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    17f2 <sphs2x+0x682>
movsd  -0x98(%rbp),%xmm0
ff
mov    $0x1,%al
call   1080 <asind@plt>
cvtsi2sd %eax,%xmm0
mov    -0xc0(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    17f7 <sphs2x+0x687>
jmp    17fc <sphs2x+0x68c>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0xb8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0xc0(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
jmp    1389 <sphs2x+0x219>
jmp    184b <sphs2x+0x6db>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0xa8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xa8(%rbp)
jmp    12ee <sphs2x+0x17e>
xor    %eax,%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    $0xb8,%rsp
mov    %rdi,%r14
mov    0xf8(%rsp),%rbx
test   %edx,%edx
mov    $0x1,%eax
cmovg  %esi,%eax
mov    %eax,0x38(%rsp)
mov    %esi,%eax
cmovg  %edx,%eax
mov    %eax,0x1c(%rsp)
mov    $0x1,%eax
movslq %ecx,%rcx
mov    %rcx,0x68(%rsp)
movslq %r8d,%rcx
mov    %rcx,0x50(%rsp)
mov    %esi,0x20(%rsp)
test   %esi,%esi
jle    1342 <sphs2x+0x1d2>
mov    0x50(%rsp),%rdi
mov    %edi,%ecx
imul   0x20(%rsp),%ecx
cmp    $0x2,%edx
mov    $0x1,%esi
cmovge %edx,%esi
test   %edx,%edx
movslq %ecx,%r11
cmovle %eax,%esi
lea    -0x1(%rsi),%eax
mov    %eax,0x80(%rsp)
mov    %esi,%eax
and    $0x7,%eax
mov    %eax,0x28(%rsp)
and    $0x7ffffff8,%esi
mov    %rsi,0x30(%rsp)
lea    0x0(,%rdi,8),%rax
mov    %rax,0x70(%rsp)
mov    %r11,%r10
shl    $0x6,%r10
imul   $0x38,%r11,%r12
mov    %r11,%rax
shl    $0x4,%rax
lea    (%rax,%rax,2),%rdi
lea    0x0(,%r11,8),%rbp
lea    0x0(,%rbp,4),%r8
add    %rbp,%r8
mov    %r11,%r13
shl    $0x5,%r13
lea    0x0(,%rbp,2),%rsi
add    %rbp,%rsi
xor    %edx,%edx
mov    %rbx,%r15
movl   $0x0,(%rsp)
mov    %r14,0xa8(%rsp)
jmp    12a4 <sphs2x+0x134>
nop
mov    (%rsp),%r14d
add    $0x1,%r14d
mov    0x10(%rsp),%rdx
add    0x50(%rsp),%rdx
mov    0x68(%rsp),%rcx
mov    0x40(%rsp),%r9
lea    (%r9,%rcx,8),%r9
mov    0x90(%rsp),%r15
add    0x70(%rsp),%r15
mov    %r14d,(%rsp)
cmp    0x20(%rsp),%r14d
mov    0xa8(%rsp),%r14
je     1342 <sphs2x+0x1d2>
movsd  (%r9),%xmm0
subsd  (%r14),%xmm0
cmpl   $0x7,0x80(%rsp)
07
mov    %r9,0x40(%rsp)
mov    %rdx,0x10(%rsp)
mov    %r15,0x90(%rsp)
jae    12d0 <sphs2x+0x160>
lea    (%rbx,%rdx,8),%r15
jmp    1318 <sphs2x+0x1a8>
mov    0x30(%rsp),%rcx
mov    %ecx,%r9d
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,(%r15)
movsd  %xmm0,(%r15,%r11,8)
movsd  %xmm0,(%r15,%rax,1)
movsd  %xmm0,(%r15,%rsi,1)
movsd  %xmm0,(%r15,%r13,1)
movsd  %xmm0,(%r15,%r8,1)
movsd  %xmm0,(%r15,%rdi,1)
movsd  %xmm0,(%r15,%r12,1)
add    %r10,%r15
add    $0xfffffff8,%r9d
jne    12e0 <sphs2x+0x170>
cmpl   $0x0,0x28(%rsp)
je     1260 <sphs2x+0xf0>
mov    0x28(%rsp),%ecx
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,(%r15)
add    %rbp,%r15
add    $0xffffffff,%ecx
jne    1330 <sphs2x+0x1c0>
jmp    1260 <sphs2x+0xf0>
cmpl   $0x0,0x1c(%rsp)
mov    0x50(%rsp),%r12
jle    16e7 <sphs2x+0x577>
mov    0x100(%rsp),%r15
mov    0xf0(%rsp),%rbp
shl    $0x3,%r12
xor    %ecx,%ecx
jmp    1390 <sphs2x+0x220>
nopw   0x0(%rax,%rax,1)
mov    0x3c(%rsp),%ecx
add    $0x1,%ecx
mov    0x68(%rsp),%rax
mov    0x10(%rsp),%rbp
lea    0x0(%rbp,%rax,8),%rbp
cmp    0x1c(%rsp),%ecx
je     16e7 <sphs2x+0x577>
mov    %ecx,0x3c(%rsp)
movsd  0x0(%rbp),%xmm0
mov    $0x1,%al
call   1040 <cosd@plt>
mov    %eax,(%rsp)
mov    %rbp,0x10(%rsp)
movsd  0x0(%rbp),%xmm0
mov    $0x1,%al
call   1030 <sind@plt>
mov    0x38(%rsp),%r13d
test   %r13d,%r13d
jle    1370 <sphs2x+0x200>
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,0xb0(%rsp)
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x30(%rsp)
mulsd  %xmm0,%xmm3
movsd  %xmm3,0x20(%rsp)
movapd %xmm4,0x70(%rsp)
movapd 0xbec(%rip),%xmm0
xorpd  %xmm0,%xmm4
movapd %xmm4,0x80(%rsp)
xorpd  %xmm0,%xmm1
movapd %xmm1,0x50(%rsp)
jmp    1450 <sphs2x+0x2e0>
mov    $0x1,%al
call   1080 <asind@plt>
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movsd  %xmm2,(%r15)
add    %r12,%r15
add    %r12,%rbx
add    $0xffffffff,%r13d
je     1370 <sphs2x+0x200>
movsd  (%rbx),%xmm0
movaps %xmm0,0x40(%rsp)
mov    $0x1,%al
call   1040 <cosd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm0,(%rsp)
movaps 0x40(%rsp),%xmm0
mov    $0x1,%al
call   1030 <sind@plt>
movapd (%rsp),%xmm2
mov    %eax,%ebp
movapd 0x80(%rsp),%xmm3
mulsd  %xmm2,%xmm3
addsd  0x20(%rsp),%xmm3
movapd %xmm3,%xmm0
andpd  0xb72(%rip),%xmm0
movsd  0xb7a(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    14e6 <sphs2x+0x376>
mov    0x10(%rsp),%rax
movsd  (%rax),%xmm0
addsd  0x8(%r14),%xmm0
mov    $0x1,%al
call   1040 <cosd@plt>
movapd (%rsp),%xmm2
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xb50(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  0x70(%rsp),%xmm3
addsd  %xmm0,%xmm3
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
mulsd  0x50(%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
movapd %xmm3,0x90(%rsp)
movsd  %xmm1,0x28(%rsp)
jne    1540 <sphs2x+0x3d0>
jp     1540 <sphs2x+0x3d0>
ucomisd %xmm0,%xmm1
jne    1540 <sphs2x+0x3d0>
jp     1540 <sphs2x+0x3d0>
movsd  0xb12(%rip),%xmm0
ucomisd 0x8(%r14),%xmm0
jbe    1560 <sphs2x+0x3f0>
movapd 0x40(%rsp),%xmm0
addsd  0xb04(%rip),%xmm0
jmp    156e <sphs2x+0x3fe>
cs nopw 0x0(%rax,%rax,1)
movapd %xmm1,%xmm0
movapd %xmm3,%xmm1
mov    $0x2,%al
call   1090 <atan2d@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
jmp    156e <sphs2x+0x3fe>
nopl   0x0(%rax,%rax,1)
movapd 0x40(%rsp),%xmm0
xorpd  0xa92(%rip),%xmm0
addsd  0x10(%r14),%xmm0
movsd  0xac4(%rip),%xmm1
call   1050 <fmod@plt>
movsd  %xmm0,(%rbx)
movsd  0xac3(%rip),%xmm2
ucomisd %xmm2,%xmm0
movsd  0xaaf(%rip),%xmm1
ja     15b1 <sphs2x+0x441>
movsd  0xa95(%rip),%xmm1
ucomisd %xmm0,%xmm1
movsd  0xa91(%rip),%xmm1
jbe    15b9 <sphs2x+0x449>
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx)
movapd 0x40(%rsp),%xmm0
movapd %xmm2,%xmm1
call   1050 <fmod@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1640 <sphs2x+0x4d0>
jp     1640 <sphs2x+0x4d0>
movapd (%rsp),%xmm2
mulsd  0x8(%r14),%xmm2
mov    0x10(%rsp),%rax
addsd  (%rax),%xmm2
movsd  0xa60(%rip),%xmm1
subsd  %xmm2,%xmm1
movsd  0xa34(%rip),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
movlpd %xmm0,(%r15)
movsd  0xa46(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1440 <sphs2x+0x2d0>
movsd  0xa0c(%rip),%xmm2
subsd  %xmm0,%xmm2
jmp    143b <sphs2x+0x2cb>
cs nopw 0x0(%rax,%rax,1)
nop
movapd (%rsp),%xmm0
mulsd  0xb0(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
movapd %xmm0,%xmm2
andpd  0x9b0(%rip),%xmm2
ucomisd 0x9f0(%rip),%xmm2
jbe    142d <sphs2x+0x2bd>
movsd  0x28(%rsp),%xmm3
mulsd  %xmm3,%xmm3
movapd 0x90(%rsp),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
ucomisd %xmm1,%xmm2
movapd %xmm0,(%rsp)
jb     169d <sphs2x+0x52d>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    16a6 <sphs2x+0x536>
movapd %xmm2,%xmm0
call   1070 <sqrt@plt>
mov    $0x1,%al
call   1060 <acosd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm0,%xmm1
andpd  0x950(%rip),%xmm1
orpd   0x938(%rip),%xmm0
movapd (%rsp),%xmm2
cmpltsd 0x992(%rip),%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
jmp    143b <sphs2x+0x2cb>
xor    %eax,%eax
add    $0xb8,%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 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* %20
%46 = load i32, i32* %12
store i32 %46, i32* %19
br label %49
47: ; preds = %9
store i32 1, i32* %20
store i32 1, i32* %19
%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** %39
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* %37
br label %54
54: ; preds = %84, %49
%55 = load i32, i32* %37
%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** %39
%60 = load double, double* %59
%61 = load double*, double** %10
%62 = getelementptr inbounds double, double* %61, i64 0
%63 = load double, double* %62
%64 = fsub double %60, %63
store double %64, double* %27
%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** %40
store i32 0, i32* %36
br label %69
69: ; preds = %80, %58
%70 = load i32, i32* %36
%71 = load i32, i32* %19
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %83
73: ; preds = %69
%74 = load double, double* %27
%75 = load double*, double** %40
store double %74, double* %75
%76 = load i32, i32* %21
%77 = load double*, double** %40
%78 = sext i32 %76 to i64
%79 = getelementptr inbounds double, double* %77, i64 %78
store double* %79, double** %40
br label %80
80: ; preds = %73
%81 = load i32, i32* %36
%82 = add nsw i32 %81, 1
store i32 %82, i32* %36
br label %69
83: ; preds = %69
br label %84
84: ; preds = %83
%85 = load i32, i32* %37
%86 = add nsw i32 %85, 1
store i32 %86, i32* %37
%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** %39
%92 = sext i32 %90 to i64
%93 = getelementptr inbounds double, double* %91, i64 %92
store double* %93, double** %39
br label %54
94: ; preds = %54
%95 = load double*, double** %16
store double* %95, double** %38
%96 = load double*, double** %17
store double* %96, double** %40
%97 = load double*, double** %18
store double* %97, double** %41
store i32 0, i32* %36
br label %98
98: ; preds = %304, %94
%99 = load i32, i32* %36
%100 = load i32, i32* %12
%101 = icmp slt i32 %99, %100
br i1 %101, label %102, label %311
102: ; preds = %98
%103 = load double*, double** %38
%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* %23
%107 = load double*, double** %38
%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* %29
%111 = load double, double* %23
%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* %24
%116 = load double, double* %23
%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* %25
%121 = load double, double* %29
%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* %30
%126 = load double, double* %29
%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* %31
store i32 0, i32* %37
br label %131
131: ; preds = %292, %102
%132 = load i32, i32* %37
%133 = load i32, i32* %20
%134 = icmp slt i32 %132, %133
br i1 %134, label %135, label %303
135: ; preds = %131
%136 = load double*, double** %40
%137 = load double, double* %136
store double %137, double* %27
%138 = load double, double* %27
%139 = call i32 (double, ...) bitcast (i32 (...)* @cosd to i32 (double, ...)*)(double %138)
%140 = sitofp i32 %139 to double
store double %140, double* %26
%141 = load double, double* %27
%142 = call i32 (double, ...) bitcast (i32 (...)* @sind to i32 (double, ...)*)(double %141)
%143 = sitofp i32 %142 to double
store double %143, double* %32
%144 = load double, double* %31
%145 = load double, double* %24
%146 = load double, double* %26
%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** %38
%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* %24
%163 = load double, double* %26
%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* %23
%168 = fneg double %167
%169 = load double, double* %32
%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* %28
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* %27
%188 = fsub double %187, 1.800000e+02
store double %188, double* %28
br label %192
189: ; preds = %181
%190 = load double, double* %27
%191 = fneg double %190
store double %191, double* %28
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 2
%196 = load double, double* %195
%197 = load double, double* %28
%198 = fadd double %196, %197
%199 = call double @fmod(double %198, double 3.600000e+02)
%200 = load double*, double** %40
store double %199, double* %200
%201 = load double*, double** %40
%202 = load double, double* %201
%203 = fcmp ogt double %202, 1.800000e+02
br i1 %203, label %204, label %208
204: ; preds = %193
%205 = load double*, double** %40
%206 = load double, double* %205
%207 = fsub double %206, 3.600000e+02
store double %207, double* %205
br label %217
208: ; preds = %193
%209 = load double*, double** %40
%210 = load double, double* %209
%211 = fcmp olt double %210, -1.800000e+02
br i1 %211, label %212, label %216
212: ; preds = %208
%213 = load double*, double** %40
%214 = load double, double* %213
%215 = fadd double %214, 3.600000e+02
store double %215, double* %213
br label %216
216: ; preds = %212, %208
br label %217
217: ; preds = %216, %204
%218 = load double, double* %27
%219 = call double @fmod(double %218, double 1.800000e+02)
%220 = fcmp oeq double %219, 0.000000e+00
br i1 %220, label %221, label %248
221: ; preds = %217
%222 = load double*, double** %38
%223 = load double, double* %222
%224 = load double, double* %26
%225 = load double*, double** %10
%226 = getelementptr inbounds double, double* %225, i64 1
%227 = load double, double* %226
%228 = call double @llvm.fmuladd.f64(double %224, double %227, double %223)
%229 = load double*, double** %41
store double %228, double* %229
%230 = load double*, double** %41
%231 = load double, double* %230
%232 = fcmp ogt double %231, 9.000000e+01
br i1 %232, label %233, label %238
233: ; preds = %221
%234 = load double*, double** %41
%235 = load double, double* %234
%236 = fsub double 1.800000e+02, %235
%237 = load double*, double** %41
store double %236, double* %237
br label %238
238: ; preds = %233, %221
%239 = load double*, double** %41
%240 = load double, double* %239
%241 = fcmp olt double %240, -9.000000e+01
br i1 %241, label %242, label %247
242: ; preds = %238
%243 = load double*, double** %41
%244 = load double, double* %243
%245 = fsub double -1.800000e+02, %244
%246 = load double*, double** %41
store double %245, double* %246
br label %247
247: ; preds = %242, %238
br label %291
248: ; preds = %217
%249 = load double, double* %30
%250 = load double, double* %25
%251 = load double, double* %26
%252 = call double @llvm.fmuladd.f64(double %250, double %251, double %249)
store double %252, double* %35
%253 = load double, double* %35
%254 = call double @llvm.fabs.f64(double %253)
%255 = fcmp ogt double %254, 0x3FEFAE147AE147AE
br i1 %255, label %256, label %285
256: ; preds = %248
%257 = load double, double* %35
%258 = fcmp olt double %257, 0.000000e+00
br i1 %258, label %259, label %271
259: ; preds = %256
%260 = load double, double* %33
%261 = load double, double* %33
%262 = load double, double* %34
%263 = load double, double* %34
%264 = fmul double %262, %263
%265 = call double @llvm.fmuladd.f64(double %260, double %261, double %264)
%266 = call double @sqrt(double %265)
%267 = call i32 (double, ...) bitcast (i32 (...)* @acosd to i32 (double, ...)*)(double %266)
%268 = sitofp i32 %267 to double
%269 = call double @llvm.fabs.f64(double %268)
%270 = fneg double %269
br label %282
271: ; preds = %256
%272 = load double, double* %33
%273 = load double, double* %33
%274 = load double, double* %34
%275 = load double, double* %34
%276 = fmul double %274, %275
%277 = call double @llvm.fmuladd.f64(double %272, double %273, double %276)
%278 = call double @sqrt(double %277)
%279 = call i32 (double, ...) bitcast (i32 (...)* @acosd to i32 (double, ...)*)(double %278)
%280 = sitofp i32 %279 to double
%281 = call double @llvm.fabs.f64(double %280)
br label %282
282: ; preds = %271, %259
%283 = phi double [ %270, %259 ], [ %281, %271 ]
%284 = load double*, double** %41
store double %283, double* %284
br label %290
285: ; preds = %248
%286 = load double, double* %35
%287 = call i32 (double, ...) bitcast (i32 (...)* @asind to i32 (double, ...)*)(double %286)
%288 = sitofp i32 %287 to double
%289 = load double*, double** %41
store double %288, double* %289
br label %290
290: ; preds = %285, %282
br label %291
291: ; preds = %290, %247
br label %292
292: ; preds = %291
%293 = load i32, i32* %37
%294 = add nsw i32 %293, 1
store i32 %294, i32* %37
%295 = load i32, i32* %14
%296 = load double*, double** %40
%297 = sext i32 %295 to i64
%298 = getelementptr inbounds double, double* %296, i64 %297
store double* %298, double** %40
%299 = load i32, i32* %14
%300 = load double*, double** %41
%301 = sext i32 %299 to i64
%302 = getelementptr inbounds double, double* %300, i64 %301
store double* %302, double** %41
br label %131
303: ; preds = %131
br label %304
304: ; preds = %303
%305 = load i32, i32* %36
%306 = add nsw i32 %305, 1
store i32 %306, i32* %36
%307 = load i32, i32* %13
%308 = load double*, double** %38
%309 = sext i32 %307 to i64
%310 = getelementptr inbounds double, double* %308, i64 %309
store double* %310, double** %38
br label %98
311: ; preds = %98
ret i32 0
}

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 = 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 %26
14: ; preds = %9
%15 = mul nsw i32 %4, %1
%16 = sext i32 %15 to i64
%17 = sext i32 %3 to i64
%18 = tail call i32 @llvm.smax.i32(i32 %2, i32 1)
%19 = select i1 %10, i32 %18, i32 1
%20 = sext i32 %4 to i64
%21 = add nsw i32 %19, -1
%22 = and i32 %19, 7
%23 = icmp ult i32 %21, 7
%24 = and i32 %19, 2147483640
%25 = icmp eq i32 %22, 0
br label %36
26: ; preds = %65, %9
%27 = icmp sgt i32 %12, 0
br i1 %27, label %28, label %181
28: ; preds = %26
%29 = getelementptr inbounds double, double* %0, i64 3
%30 = getelementptr inbounds double, double* %0, i64 4
%31 = icmp sgt i32 %11, 0
%32 = getelementptr inbounds double, double* %0, i64 1
%33 = getelementptr inbounds double, double* %0, i64 2
%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* %0
%42 = fsub double %40, %41
%43 = getelementptr inbounds double, double* %7, i64 %37
br i1 %23, 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 %16
store double %42, double* %47
%48 = getelementptr inbounds double, double* %47, i64 %16
store double %42, double* %48
%49 = getelementptr inbounds double, double* %48, i64 %16
store double %42, double* %49
%50 = getelementptr inbounds double, double* %49, i64 %16
store double %42, double* %50
%51 = getelementptr inbounds double, double* %50, i64 %16
store double %42, double* %51
%52 = getelementptr inbounds double, double* %51, i64 %16
store double %42, double* %52
%53 = getelementptr inbounds double, double* %52, i64 %16
store double %42, double* %53
%54 = getelementptr inbounds double, double* %53, i64 %16
%55 = add i32 %46, 8
%56 = icmp eq i32 %55, %24
br i1 %56, label %57, label %44
57: ; preds = %44, %36
%58 = phi double* [ %43, %36 ], [ %54, %44 ]
br i1 %25, 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 %16
%63 = add i32 %61, 1
%64 = icmp eq i32 %63, %22
br i1 %64, label %65, label %59
65: ; preds = %59, %57
%66 = add nuw nsw i32 %39, 1
%67 = add nsw i64 %37, %20
%68 = getelementptr inbounds double, double* %38, i64 %17
%69 = icmp eq i32 %66, %1
br i1 %69, label %26, label %36
70: ; preds = %28, %175
%71 = phi double* [ %8, %28 ], [ %177, %175 ]
%72 = phi double* [ %7, %28 ], [ %176, %175 ]
%73 = phi double* [ %6, %28 ], [ %179, %175 ]
%74 = phi i32 [ 0, %28 ], [ %178, %175 ]
%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* %29
%82 = fmul double %81, %77
%83 = load double, double* %30
%84 = fmul double %83, %77
%85 = fmul double %81, %80
%86 = fmul double %83, %80
br i1 %31, label %87, label %175
87: ; preds = %70
%88 = fneg double %82
%89 = fneg double %77
br label %90
90: ; preds = %87, %170
%91 = phi double* [ %71, %87 ], [ %173, %170 ]
%92 = phi double* [ %72, %87 ], [ %172, %170 ]
%93 = phi i32 [ 0, %87 ], [ %171, %170 ]
%94 = load double, double* %92
%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* %32
%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* %32
%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* %33
%130 = fadd double %128, %129
%131 = tail call double @fmod(double %130, double 3.600000e+02)
store double %131, double* %92
%132 = fcmp ogt double %131, 1.800000e+02
br i1 %132, label %135, label %133
133: ; preds = %127
%134 = fcmp olt double %131, -1.800000e+02
br i1 %134, label %135, label %138
135: ; preds = %133, %127
%136 = phi double [ -3.600000e+02, %127 ], [ 3.600000e+02, %133 ]
%137 = fadd double %131, %136
store double %137, double* %92
br label %138
138: ; preds = %135, %133
%139 = tail call double @fmod(double %94, double 1.800000e+02)
%140 = fcmp oeq double %139, 0.000000e+00
br i1 %140, label %141, label %151
141: ; preds = %138
%142 = load double, double* %73
%143 = load double, double* %32
%144 = tail call double @llvm.fmuladd.f64(double %96, double %143, double %142)
%145 = fcmp ogt double %144, 9.000000e+01
%146 = fsub double 1.800000e+02, %144
%147 = select i1 %145, double %146, double %144
store double %147, double* %91
%148 = fcmp olt double %147, -9.000000e+01
br i1 %148, label %149, label %170
149: ; preds = %141
%150 = fsub double -1.800000e+02, %147
br label %168
151: ; preds = %138
%152 = tail call double @llvm.fmuladd.f64(double %84, double %96, double %85)
%153 = tail call double @llvm.fabs.f64(double %152)
%154 = fcmp ogt double %153, 0x3FEFAE147AE147AE
br i1 %154, label %155, label %165
155: ; preds = %151
%156 = fcmp olt double %152, 0.000000e+00
%157 = fmul double %113, %113
%158 = tail call double @llvm.fmuladd.f64(double %112, double %112, double %157)
%159 = tail call double @sqrt(double %158)
%160 = tail call i32 (double, ...) bitcast (i32 (...)* @acosd to i32 (double, ...)*)(double %159)
%161 = sitofp i32 %160 to double
%162 = tail call double @llvm.fabs.f64(double %161)
%163 = fneg double %162
%164 = select i1 %156, double %163, double %162
br label %168
165: ; preds = %151
%166 = tail call i32 (double, ...) bitcast (i32 (...)* @asind to i32 (double, ...)*)(double %152)
%167 = sitofp i32 %166 to double
br label %168
168: ; preds = %155, %165, %149
%169 = phi double [ %150, %149 ], [ %167, %165 ], [ %164, %155 ]
store double %169, double* %91
br label %170
170: ; preds = %168, %141
%171 = add nuw nsw i32 %93, 1
%172 = getelementptr inbounds double, double* %92, i64 %34
%173 = getelementptr inbounds double, double* %91, i64 %34
%174 = icmp eq i32 %171, %11
br i1 %174, label %175, label %90
175: ; preds = %170, %70
%176 = phi double* [ %72, %70 ], [ %172, %170 ]
%177 = phi double* [ %71, %70 ], [ %173, %170 ]
%178 = add nuw nsw i32 %74, 1
%179 = getelementptr inbounds double, double* %73, i64 %35
%180 = icmp eq i32 %178, %12
br i1 %180, label %181, label %70
181: ; preds = %175, %26
ret i32 0
}