#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ cross_prod(double *, double *, double *);
double fmod(double, int);
int /*<<< orphan*/ rec2sph(double *, double *, double *);
int /*<<< orphan*/ roty(double *, double, double *);
int /*<<< orphan*/ rotz(double *, double, double *);
int /*<<< orphan*/ sph2rec(double, double, double *);
int /*<<< orphan*/ sphdist(double, double, double, double, double *);
void arc_intercept(double r1, double d1, double r2, double d2, double r3,
                   double d3, double rc, double dc, double *r0, double *d0) {
  double cart1[3], cart2[3], cart3[3], carts[3];
  double v1[3], v2[3];
  double F[3];
  double lonf, latf;
  double ang1, ang2, ang3;
  double vr1[3], vr2[3], vr3[3];
  double rlonm0, rlatm0, rlonm, rlatm;
  double rlon1, rlat1, rlon3, rlat3, rlons, rlats;
  double minrlon, maxrlon;
  double vn[3];
  double lon0, lat0;
  double sdist1, sdist2;
  sph2rec(r1, d1, cart1);
  sph2rec(r2, d2, cart2);
  sph2rec(r3, d3, cart3);
  v1[0] = cart2[0] - cart1[0];
  v1[1] = cart2[1] - cart1[1];
  v1[2] = cart2[2] - cart1[2];
  v2[0] = cart3[0] - cart2[0];
  v2[1] = cart3[1] - cart2[1];
  v2[2] = cart3[2] - cart2[2];
  cross_prod(v1, v2, F);
  rec2sph(F, &lonf, &latf);
  ang1 = 2 * 3.141592653589793 - lonf;
  ang2 = 1.5707963267948966 - latf;
  rotz(cart2, ang1, vr1);
  roty(vr1, ang2, vr2);
  rec2sph(vr2, &rlonm0, &rlatm0);
  ang3 = 3.141592653589793 - rlonm0;
  rotz(vr2, ang3, vr3);
  rec2sph(vr3, &rlonm, &rlatm);
  rlonm = fmod(rlonm + 2 * 3.141592653589793, 2 * 3.141592653589793);
  sph2rec(rc, dc, carts);
  rotz(carts, ang1, vr1);
  roty(vr1, ang2, vr2);
  rotz(vr2, ang3, vr3);
  rec2sph(vr3, &rlons, &rlats);
  rlons = fmod(rlons + 2 * 3.141592653589793, 2 * 3.141592653589793);
  rotz(cart1, ang1, vr1);
  roty(vr1, ang2, vr2);
  rotz(vr2, ang3, vr3);
  rec2sph(vr3, &rlon1, &rlat1);
  rlon1 = fmod(rlon1 + 2 * 3.141592653589793, 2 * 3.141592653589793);
  rotz(cart3, ang1, vr1);
  roty(vr1, ang2, vr2);
  rotz(vr2, ang3, vr3);
  rec2sph(vr3, &rlon3, &rlat3);
  rlon3 = fmod(rlon3 + 2 * 3.141592653589793, 2 * 3.141592653589793);
  minrlon = (rlon1 < rlon3) ? rlon1 : rlon3;
  maxrlon = (rlon1 > rlon3) ? rlon1 : rlon3;
  if ((rlons < maxrlon) && (rlons > minrlon)) {
    sph2rec(rlons, rlatm, vn);
    rotz(vn, -1.0 * ang3, vr1);
    roty(vr1, -1.0 * ang2, vr2);
    rotz(vr2, -1.0 * ang1, vr3);
    rec2sph(vr3, &lon0, &lat0);
    lon0 = fmod(lon0 + 2 * 3.141592653589793, 2 * 3.141592653589793);
    *r0 = lon0;
    *d0 = lat0;
    return;
  }
  sphdist(r1, d1, rc, dc, &sdist1);
  sphdist(r3, d3, rc, dc, &sdist2);
  if (sdist1 < sdist2) {
    *r0 = r1;
    *d0 = d1;
  } else {
    *r0 = r3;
    *d0 = d3;
  }
  return;
}


x86 assembly (clang, -O0):
<arc_intercept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
mov    %rdi,-0x48(%rbp)
mov    %rsi,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x70(%rbp),%rdi
call   1040 <sph2rec@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    -0x90(%rbp),%rdi
call   1040 <sph2rec@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    -0xb0(%rbp),%rdi
call   1040 <sph2rec@plt>
movsd  -0x90(%rbp),%xmm0
ff
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
subsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
subsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
lea    -0xf0(%rbp),%rdi
lea    -0x110(%rbp),%rsi
lea    -0x130(%rbp),%rdx
call   1050 <cross_prod@plt>
lea    -0x130(%rbp),%rdi
lea    -0x138(%rbp),%rsi
lea    -0x140(%rbp),%rdx
call   1070 <rec2sph@plt>
movsd  0xd59(%rip),%xmm0
subsd  -0x138(%rbp),%xmm0
ff
movsd  %xmm0,-0x148(%rbp)
ff
movsd  0xd51(%rip),%xmm0
subsd  -0x140(%rbp),%xmm0
ff
movsd  %xmm0,-0x150(%rbp)
ff
lea    -0x90(%rbp),%rdi
movsd  -0x148(%rbp),%xmm0
ff
lea    -0x170(%rbp),%rsi
call   1030 <rotz@plt>
lea    -0x170(%rbp),%rdi
movsd  -0x150(%rbp),%xmm0
ff
lea    -0x190(%rbp),%rsi
call   1080 <roty@plt>
lea    -0x190(%rbp),%rdi
lea    -0x1b8(%rbp),%rsi
lea    -0x1c0(%rbp),%rdx
call   1070 <rec2sph@plt>
movsd  0xce1(%rip),%xmm0
subsd  -0x1b8(%rbp),%xmm0
ff
movsd  %xmm0,-0x158(%rbp)
ff
lea    -0x190(%rbp),%rdi
movsd  -0x158(%rbp),%xmm0
ff
lea    -0x1b0(%rbp),%rsi
call   1030 <rotz@plt>
lea    -0x1b0(%rbp),%rdi
lea    -0x1c8(%rbp),%rsi
lea    -0x1d0(%rbp),%rdx
call   1070 <rec2sph@plt>
movsd  0xc8c(%rip),%xmm0
addsd  -0x1c8(%rbp),%xmm0
ff
mov    $0x6,%edi
call   1060 <fmod@plt>
movsd  %xmm0,-0x1c8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    -0xd0(%rbp),%rdi
call   1040 <sph2rec@plt>
lea    -0xd0(%rbp),%rdi
movsd  -0x148(%rbp),%xmm0
ff
lea    -0x170(%rbp),%rsi
call   1030 <rotz@plt>
lea    -0x170(%rbp),%rdi
movsd  -0x150(%rbp),%xmm0
ff
lea    -0x190(%rbp),%rsi
call   1080 <roty@plt>
lea    -0x190(%rbp),%rdi
movsd  -0x158(%rbp),%xmm0
ff
lea    -0x1b0(%rbp),%rsi
call   1030 <rotz@plt>
lea    -0x1b0(%rbp),%rdi
lea    -0x1f8(%rbp),%rsi
lea    -0x200(%rbp),%rdx
call   1070 <rec2sph@plt>
movsd  0xbe9(%rip),%xmm0
addsd  -0x1f8(%rbp),%xmm0
ff
mov    $0x6,%edi
call   1060 <fmod@plt>
movsd  %xmm0,-0x1f8(%rbp)
ff
lea    -0x70(%rbp),%rdi
movsd  -0x148(%rbp),%xmm0
ff
lea    -0x170(%rbp),%rsi
call   1030 <rotz@plt>
lea    -0x170(%rbp),%rdi
movsd  -0x150(%rbp),%xmm0
ff
lea    -0x190(%rbp),%rsi
call   1080 <roty@plt>
lea    -0x190(%rbp),%rdi
movsd  -0x158(%rbp),%xmm0
ff
lea    -0x1b0(%rbp),%rsi
call   1030 <rotz@plt>
lea    -0x1b0(%rbp),%rdi
lea    -0x1d8(%rbp),%rsi
lea    -0x1e0(%rbp),%rdx
call   1070 <rec2sph@plt>
movsd  0xb5f(%rip),%xmm0
addsd  -0x1d8(%rbp),%xmm0
ff
mov    $0x6,%edi
call   1060 <fmod@plt>
movsd  %xmm0,-0x1d8(%rbp)
ff
lea    -0xb0(%rbp),%rdi
movsd  -0x148(%rbp),%xmm0
ff
lea    -0x170(%rbp),%rsi
call   1030 <rotz@plt>
lea    -0x170(%rbp),%rdi
movsd  -0x150(%rbp),%xmm0
ff
lea    -0x190(%rbp),%rsi
call   1080 <roty@plt>
lea    -0x190(%rbp),%rdi
movsd  -0x158(%rbp),%xmm0
ff
lea    -0x1b0(%rbp),%rsi
call   1030 <rotz@plt>
lea    -0x1b0(%rbp),%rdi
lea    -0x1e8(%rbp),%rsi
lea    -0x1f0(%rbp),%rdx
call   1070 <rec2sph@plt>
movsd  0xad2(%rip),%xmm0
addsd  -0x1e8(%rbp),%xmm0
ff
mov    $0x6,%edi
call   1060 <fmod@plt>
movsd  %xmm0,-0x1e8(%rbp)
ff
movsd  -0x1d8(%rbp),%xmm1
ff
movsd  -0x1e8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    1577 <arc_intercept+0x407>
movsd  -0x1d8(%rbp),%xmm0
ff
movsd  %xmm0,-0x258(%rbp)
ff
jmp    1587 <arc_intercept+0x417>
movsd  -0x1e8(%rbp),%xmm0
ff
movsd  %xmm0,-0x258(%rbp)
ff
movsd  -0x258(%rbp),%xmm0
ff
movsd  %xmm0,-0x208(%rbp)
ff
movsd  -0x1d8(%rbp),%xmm0
ff
ucomisd -0x1e8(%rbp),%xmm0
ff
jbe    15c2 <arc_intercept+0x452>
movsd  -0x1d8(%rbp),%xmm0
ff
movsd  %xmm0,-0x260(%rbp)
ff
jmp    15d2 <arc_intercept+0x462>
movsd  -0x1e8(%rbp),%xmm0
ff
movsd  %xmm0,-0x260(%rbp)
ff
movsd  -0x260(%rbp),%xmm0
ff
movsd  %xmm0,-0x210(%rbp)
ff
movsd  -0x1f8(%rbp),%xmm1
ff
movsd  -0x210(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    16f8 <arc_intercept+0x588>
movsd  -0x1f8(%rbp),%xmm0
ff
ucomisd -0x208(%rbp),%xmm0
ff
jbe    16f8 <arc_intercept+0x588>
movsd  -0x1f8(%rbp),%xmm0
ff
movsd  -0x1d0(%rbp),%xmm1
ff
lea    -0x230(%rbp),%rdi
call   1040 <sph2rec@plt>
lea    -0x230(%rbp),%rdi
movsd  0x9db(%rip),%xmm0
mulsd  -0x158(%rbp),%xmm0
ff
lea    -0x170(%rbp),%rsi
call   1030 <rotz@plt>
lea    -0x170(%rbp),%rdi
movsd  0x9b8(%rip),%xmm0
mulsd  -0x150(%rbp),%xmm0
ff
lea    -0x190(%rbp),%rsi
call   1080 <roty@plt>
lea    -0x190(%rbp),%rdi
movsd  0x995(%rip),%xmm0
mulsd  -0x148(%rbp),%xmm0
ff
lea    -0x1b0(%rbp),%rsi
call   1030 <rotz@plt>
lea    -0x1b0(%rbp),%rdi
lea    -0x238(%rbp),%rsi
lea    -0x240(%rbp),%rdx
call   1070 <rec2sph@plt>
movsd  0x947(%rip),%xmm0
addsd  -0x238(%rbp),%xmm0
ff
mov    $0x6,%edi
call   1060 <fmod@plt>
movsd  %xmm0,-0x238(%rbp)
ff
movsd  -0x238(%rbp),%xmm0
ff
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x240(%rbp),%xmm0
ff
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1790 <arc_intercept+0x620>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
lea    -0x248(%rbp),%rdi
call   1090 <sphdist@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
lea    -0x250(%rbp),%rdi
call   1090 <sphdist@plt>
movsd  -0x248(%rbp),%xmm1
ff
movsd  -0x250(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    1771 <arc_intercept+0x601>
movsd  -0x8(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    178b <arc_intercept+0x61b>
movsd  -0x28(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1790 <arc_intercept+0x620>
add    $0x260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arc_intercept>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x248,%rsp
mov    %rsi,0x90(%rsp)
mov    %rdi,0x50(%rsp)
movsd  %xmm7,0x20(%rsp)
movsd  %xmm6,0x18(%rsp)
movsd  %xmm5,0x10(%rsp)
movaps %xmm4,0x80(%rsp)
movsd  %xmm3,(%rsp)
movsd  %xmm2,0x40(%rsp)
lea    0x170(%rsp),%r13
movaps %xmm0,0xc0(%rsp)
movsd  %xmm1,0x58(%rsp)
mov    %r13,%rdi
call   1040 <sph2rec@plt>
lea    0x150(%rsp),%rbp
movsd  0x40(%rsp),%xmm0
movsd  (%rsp),%xmm1
mov    %rbp,%rdi
call   1040 <sph2rec@plt>
lea    0x130(%rsp),%r12
movaps 0x80(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %r12,%rdi
call   1040 <sph2rec@plt>
movapd 0x150(%rsp),%xmm0
movapd 0x130(%rsp),%xmm1
subpd  %xmm0,%xmm1
subpd  0x170(%rsp),%xmm0
movsd  0x160(%rsp),%xmm2
movsd  0x140(%rsp),%xmm3
subsd  %xmm2,%xmm3
subsd  0x180(%rsp),%xmm2
movapd %xmm0,0x110(%rsp)
movsd  %xmm2,0x120(%rsp)
movapd %xmm1,0xf0(%rsp)
movsd  %xmm3,0x100(%rsp)
lea    0x110(%rsp),%rdi
lea    0xf0(%rsp),%rsi
lea    0x210(%rsp),%rbx
mov    %rbx,%rdx
call   1050 <cross_prod@plt>
lea    0xb8(%rsp),%rsi
lea    0xb0(%rsp),%rdx
mov    %rbx,%rdi
call   1070 <rec2sph@plt>
movsd  0xd54(%rip),%xmm0
subsd  0xb8(%rsp),%xmm0
movapd %xmm0,0x40(%rsp)
movsd  0xd45(%rip),%xmm1
subsd  0xb0(%rsp),%xmm1
movapd %xmm1,(%rsp)
lea    0x1f0(%rsp),%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <rotz@plt>
lea    0x1d0(%rsp),%rbp
mov    %rbx,%rdi
movaps (%rsp),%xmm0
mov    %rbp,%rsi
call   1080 <roty@plt>
lea    0xa8(%rsp),%rsi
lea    0x1a8(%rsp),%rdx
mov    %rbp,%rdi
call   1070 <rec2sph@plt>
movsd  0xcf5(%rip),%xmm0
subsd  0xa8(%rsp),%xmm0
movapd %xmm0,0x70(%rsp)
lea    0x1b0(%rsp),%r14
mov    %rbp,%rdi
mov    %r14,%rsi
call   1030 <rotz@plt>
lea    0x68(%rsp),%rsi
lea    0xa0(%rsp),%rdx
mov    %r14,%rdi
call   1070 <rec2sph@plt>
movsd  0x68(%rsp),%xmm0
addsd  0xca0(%rip),%xmm0
mov    $0x6,%edi
call   1060 <fmod@plt>
movsd  %xmm0,0x68(%rsp)
lea    0x230(%rsp),%r15
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mov    %r15,%rdi
call   1040 <sph2rec@plt>
mov    %r15,%rdi
movaps 0x40(%rsp),%xmm0
mov    %rbx,%rsi
call   1030 <rotz@plt>
mov    %rbx,%rdi
movaps (%rsp),%xmm0
mov    %rbp,%rsi
call   1080 <roty@plt>
mov    %rbp,%rdi
movaps 0x70(%rsp),%xmm0
mov    %r14,%rsi
call   1030 <rotz@plt>
lea    0x30(%rsp),%rsi
lea    0x190(%rsp),%rdx
mov    %r14,%rdi
call   1070 <rec2sph@plt>
movsd  0x30(%rsp),%xmm0
addsd  0xc22(%rip),%xmm0
mov    $0x6,%edi
call   1060 <fmod@plt>
movsd  %xmm0,0x30(%rsp)
mov    %r13,%rdi
movaps 0x40(%rsp),%xmm0
mov    %rbx,%rsi
call   1030 <rotz@plt>
mov    %rbx,%rdi
movaps (%rsp),%xmm0
mov    %rbp,%rsi
call   1080 <roty@plt>
mov    %rbp,%rdi
movaps 0x70(%rsp),%xmm0
mov    %r14,%rsi
call   1030 <rotz@plt>
lea    0x38(%rsp),%rsi
lea    0x1a0(%rsp),%rdx
mov    %r14,%rdi
call   1070 <rec2sph@plt>
movsd  0x38(%rsp),%xmm0
addsd  0xbc0(%rip),%xmm0
mov    $0x6,%edi
call   1060 <fmod@plt>
movsd  %xmm0,0x38(%rsp)
mov    %r12,%rdi
movaps 0x40(%rsp),%xmm0
mov    %rbx,%rsi
call   1030 <rotz@plt>
mov    %rbx,%rdi
movaps (%rsp),%xmm0
mov    %rbp,%rsi
call   1080 <roty@plt>
mov    %rbp,%rdi
movaps 0x70(%rsp),%xmm0
mov    %r14,%rsi
call   1030 <rotz@plt>
lea    0x60(%rsp),%rsi
lea    0x198(%rsp),%rdx
mov    %r14,%rdi
call   1070 <rec2sph@plt>
movsd  0xb64(%rip),%xmm0
addsd  0x60(%rsp),%xmm0
mov    $0x6,%edi
call   1060 <fmod@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x60(%rsp)
movsd  0x38(%rsp),%xmm2
movapd %xmm2,%xmm3
maxsd  %xmm0,%xmm3
movsd  0x30(%rsp),%xmm0
ucomisd %xmm0,%xmm3
jbe    159b <arc_intercept+0x42b>
minsd  %xmm1,%xmm2
ucomisd %xmm2,%xmm0
jbe    159b <arc_intercept+0x42b>
movsd  0xa0(%rsp),%xmm1
lea    0xd0(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sph2rec@plt>
movaps 0x70(%rsp),%xmm0
xorps  0xb19(%rip),%xmm0
lea    0x1f0(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <rotz@plt>
movaps (%rsp),%xmm0
xorps  0xafb(%rip),%xmm0
lea    0x1d0(%rsp),%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1080 <roty@plt>
movaps 0x40(%rsp),%xmm0
xorps  0xadc(%rip),%xmm0
lea    0x1b0(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <rotz@plt>
lea    0x28(%rsp),%rsi
lea    0x98(%rsp),%rdx
mov    %rbp,%rdi
call   1070 <rec2sph@plt>
movsd  0x28(%rsp),%xmm0
addsd  0xa86(%rip),%xmm0
mov    $0x6,%edi
call   1060 <fmod@plt>
mov    0x50(%rsp),%rax
movsd  %xmm0,(%rax)
movsd  0x98(%rsp),%xmm1
jmp    162f <arc_intercept+0x4bf>
lea    0xd0(%rsp),%rdi
movaps 0xc0(%rsp),%xmm0
movsd  0x58(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
call   1090 <sphdist@plt>
lea    0x28(%rsp),%rdi
movaps 0x80(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
call   1090 <sphdist@plt>
movsd  0xd0(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
ucomisd %xmm0,%xmm1
cmpltsd %xmm1,%xmm0
movsd  0x58(%rsp),%xmm1
movapd 0xc0(%rsp),%xmm2
andpd  %xmm0,%xmm2
andnpd 0x80(%rsp),%xmm0
orpd   %xmm2,%xmm0
ja     1626 <arc_intercept+0x4b6>
movsd  0x10(%rsp),%xmm1
mov    0x50(%rsp),%rax
movlpd %xmm0,(%rax)
mov    0x90(%rsp),%rax
movsd  %xmm1,(%rax)
add    $0x248,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @arc_intercept(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double* nocapture writeonly %8, double* nocapture writeonly %9) {
%11 = alloca [3 x double]
%12 = alloca [3 x double]
%13 = alloca [3 x double]
%14 = alloca [3 x double]
%15 = alloca [3 x double]
%16 = alloca [3 x double]
%17 = alloca [3 x double]
%18 = alloca double
%19 = alloca double
%20 = alloca [3 x double]
%21 = alloca [3 x double]
%22 = alloca [3 x double]
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca [3 x double]
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = bitcast [3 x double]* %11 to i8*
%39 = bitcast [3 x double]* %12 to i8*
%40 = bitcast [3 x double]* %13 to i8*
%41 = bitcast [3 x double]* %14 to i8*
%42 = bitcast [3 x double]* %15 to i8*
%43 = bitcast [3 x double]* %16 to i8*
%44 = bitcast [3 x double]* %17 to i8*
%45 = bitcast double* %18 to i8*
%46 = bitcast double* %19 to i8*
%47 = bitcast [3 x double]* %20 to i8*
%48 = bitcast [3 x double]* %21 to i8*
%49 = bitcast [3 x double]* %22 to i8*
%50 = bitcast double* %23 to i8*
%51 = bitcast double* %24 to i8*
%52 = bitcast double* %25 to i8*
%53 = bitcast double* %26 to i8*
%54 = bitcast double* %27 to i8*
%55 = bitcast double* %28 to i8*
%56 = bitcast double* %29 to i8*
%57 = bitcast double* %30 to i8*
%58 = bitcast double* %31 to i8*
%59 = bitcast double* %32 to i8*
%60 = bitcast [3 x double]* %33 to i8*
%61 = bitcast double* %34 to i8*
%62 = bitcast double* %35 to i8*
%63 = bitcast double* %36 to i8*
%64 = bitcast double* %37 to i8*
%65 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%66 = call i32 @sph2rec(double %0, double %1, double* %65)
%67 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 0
%68 = call i32 @sph2rec(double %2, double %3, double* %67)
%69 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 0
%70 = call i32 @sph2rec(double %4, double %5, double* %69)
%71 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 0
%72 = bitcast [3 x double]* %12 to <2 x double>*
%73 = load <2 x double>, <2 x double>* %72
%74 = bitcast [3 x double]* %11 to <2 x double>*
%75 = load <2 x double>, <2 x double>* %74
%76 = fsub <2 x double> %73, %75
%77 = bitcast [3 x double]* %15 to <2 x double>*
store <2 x double> %76, <2 x double>* %77
%78 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 2
%79 = load double, double* %78
%80 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 2
%81 = load double, double* %80
%82 = fsub double %79, %81
%83 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 2
store double %82, double* %83
%84 = getelementptr inbounds [3 x double], [3 x double]* %16, i64 0, i64 0
%85 = bitcast [3 x double]* %13 to <2 x double>*
%86 = load <2 x double>, <2 x double>* %85
%87 = fsub <2 x double> %86, %73
%88 = bitcast [3 x double]* %16 to <2 x double>*
store <2 x double> %87, <2 x double>* %88
%89 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 2
%90 = load double, double* %89
%91 = fsub double %90, %79
%92 = getelementptr inbounds [3 x double], [3 x double]* %16, i64 0, i64 2
store double %91, double* %92
%93 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 0
%94 = call i32 @cross_prod(double* %71, double* %84, double* %93)
%95 = call i32 @rec2sph(double* %93, double* %18, double* %19)
%96 = load double, double* %18
%97 = fsub double 0x401921FB54442D18, %96
%98 = load double, double* %19
%99 = fsub double 0x3FF921FB54442D18, %98
%100 = getelementptr inbounds [3 x double], [3 x double]* %20, i64 0, i64 0
%101 = call i32 @rotz(double* %67, double %97, double* %100)
%102 = getelementptr inbounds [3 x double], [3 x double]* %21, i64 0, i64 0
%103 = call i32 @roty(double* %100, double %99, double* %102)
%104 = call i32 @rec2sph(double* %102, double* %23, double* %24)
%105 = load double, double* %23
%106 = fsub double 0x400921FB54442D18, %105
%107 = getelementptr inbounds [3 x double], [3 x double]* %22, i64 0, i64 0
%108 = call i32 @rotz(double* %102, double %106, double* %107)
%109 = call i32 @rec2sph(double* %107, double* %25, double* %26)
%110 = load double, double* %25
%111 = fadd double %110, 0x401921FB54442D18
%112 = call double @fmod(double %111, i32 6)
store double %112, double* %25
%113 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 0, i64 0
%114 = call i32 @sph2rec(double %6, double %7, double* %113)
%115 = call i32 @rotz(double* %113, double %97, double* %100)
%116 = call i32 @roty(double* %100, double %99, double* %102)
%117 = call i32 @rotz(double* %102, double %106, double* %107)
%118 = call i32 @rec2sph(double* %107, double* %31, double* %32)
%119 = load double, double* %31
%120 = fadd double %119, 0x401921FB54442D18
%121 = call double @fmod(double %120, i32 6)
store double %121, double* %31
%122 = call i32 @rotz(double* %65, double %97, double* %100)
%123 = call i32 @roty(double* %100, double %99, double* %102)
%124 = call i32 @rotz(double* %102, double %106, double* %107)
%125 = call i32 @rec2sph(double* %107, double* %27, double* %28)
%126 = load double, double* %27
%127 = fadd double %126, 0x401921FB54442D18
%128 = call double @fmod(double %127, i32 6)
store double %128, double* %27
%129 = call i32 @rotz(double* %69, double %97, double* %100)
%130 = call i32 @roty(double* %100, double %99, double* %102)
%131 = call i32 @rotz(double* %102, double %106, double* %107)
%132 = call i32 @rec2sph(double* %107, double* %29, double* %30)
%133 = load double, double* %29
%134 = fadd double %133, 0x401921FB54442D18
%135 = call double @fmod(double %134, i32 6)
store double %135, double* %29
%136 = load double, double* %27
%137 = fcmp ogt double %136, %135
%138 = select i1 %137, double %136, double %135
%139 = load double, double* %31
%140 = fcmp olt double %139, %138
br i1 %140, label %141, label %160
141: ; preds = %10
%142 = fcmp olt double %136, %135
%143 = select i1 %142, double %136, double %135
%144 = fcmp ogt double %139, %143
br i1 %144, label %145, label %160
145: ; preds = %141
%146 = load double, double* %26
%147 = getelementptr inbounds [3 x double], [3 x double]* %33, i64 0, i64 0
%148 = call i32 @sph2rec(double %139, double %146, double* %147)
%149 = fneg double %106
%150 = call i32 @rotz(double* %147, double %149, double* %100)
%151 = fneg double %99
%152 = call i32 @roty(double* %100, double %151, double* %102)
%153 = fneg double %97
%154 = call i32 @rotz(double* %102, double %153, double* %107)
%155 = call i32 @rec2sph(double* %107, double* %34, double* %35)
%156 = load double, double* %34
%157 = fadd double %156, 0x401921FB54442D18
%158 = call double @fmod(double %157, i32 6)
store double %158, double* %8
%159 = load double, double* %35
br label %168
160: ; preds = %141, %10
%161 = call i32 @sphdist(double %0, double %1, double %6, double %7, double* %36)
%162 = call i32 @sphdist(double %4, double %5, double %6, double %7, double* %37)
%163 = load double, double* %36
%164 = load double, double* %37
%165 = fcmp olt double %163, %164
%166 = select i1 %165, double %0, double %4
%167 = select i1 %165, double %1, double %5
store double %166, double* %8
br label %168
168: ; preds = %160, %145
%169 = phi double [ %167, %160 ], [ %159, %145 ]
store double %169, double* %9
ret void
}