void linepart(double lat1, double lon1, double lat2, double lon2, double frac,
              double *reslat, double *reslon) {
  double x1, y1, z1;
  double x2, y2, z2;
  double xa, ya, za, la;
  double xr, yr, zr;
  double xx, yx, zx;
  double theta = 0;
  double phi = 0;
  double cosphi = 0;
  double sinphi = 0;
  *reslat = lat1;
  *reslon = lon1;
  lat1 = ((lat1)*3.14159265358979323846 / 180.0);
  lon1 = ((lon1)*3.14159265358979323846 / 180.0);
  lat2 = ((lat2)*3.14159265358979323846 / 180.0);
  lon2 = ((lon2)*3.14159265358979323846 / 180.0);
  x1 = cos(lon1) * cos(lat1);
  y1 = sin(lat1);
  z1 = sin(lon1) * cos(lat1);
  x2 = cos(lon2) * cos(lat2);
  y2 = sin(lat2);
  z2 = sin(lon2) * cos(lat2);
  crossproduct(x1, y1, z1, x2, y2, z2, &xa, &ya, &za);
  la = sqrt(xa * xa + ya * ya + za * za);
  if (la) {
    xa /= la;
    ya /= la;
    za /= la;
  }
  if (la) {
    crossproduct(x1, y1, z1, xa, ya, za, &xx, &yx, &zx);
    theta = atan2(dotproduct(xx, yx, zx, x2, y2, z2),
                  dotproduct(x1, y1, z1, x2, y2, z2));
    phi = frac * theta;
    cosphi = cos(phi);
    sinphi = sin(phi);
    xr = x1 * cosphi + xx * sinphi;
    yr = y1 * cosphi + yx * sinphi;
    zr = z1 * cosphi + zx * sinphi;
    if (xr > 1)
      xr = 1;
    if (xr < -1)
      xr = -1;
    if (yr > 1)
      yr = 1;
    if (yr < -1)
      yr = -1;
    if (zr > 1)
      zr = 1;
    if (zr < -1)
      zr = -1;
    *reslat = ((asin(yr)) * 180.0 / 3.14159265358979323846);
    if (xr == 0 && zr == 0) {
      *reslon = 0;
    } else {
      *reslon = ((atan2(zr, xr)) * 180.0 / 3.14159265358979323846);
    }
  }
}


x86 assembly (clang, -O0):
<linepart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xe1e(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe09(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe00(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xdeb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xde2(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xdcd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xdc4(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xdaf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xf0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm3
movsd  -0x60(%rbp),%xmm4
movsd  -0x68(%rbp),%xmm5
lea    -0x70(%rbp),%rdi
lea    -0x78(%rbp),%rsi
lea    -0x80(%rbp),%rdx
mov    $0x6,%al
call   1090 <crossproduct@plt>
movsd  -0x70(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1080 <sqrt@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13c4 <linepart+0x254>
jp     13c4 <linepart+0x254>
jmp    1406 <linepart+0x296>
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x70(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x78(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x80(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1426 <linepart+0x2b6>
jp     1426 <linepart+0x2b6>
jmp    173b <linepart+0x5cb>
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm3
movsd  -0x78(%rbp),%xmm4
movsd  -0x80(%rbp),%xmm5
lea    -0xa8(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
lea    -0xb8(%rbp),%rdx
mov    $0x6,%al
call   1090 <crossproduct@plt>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm2
ff
movsd  -0x58(%rbp),%xmm3
movsd  -0x60(%rbp),%xmm4
movsd  -0x68(%rbp),%xmm5
mov    $0x6,%al
call   1030 <dotproduct@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm3
movsd  -0x60(%rbp),%xmm4
movsd  -0x68(%rbp),%xmm5
mov    $0x6,%al
call   1030 <dotproduct@plt>
movsd  -0x100(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
call   1040 <atan2@plt>
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
mulsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
call   1070 <cos@plt>
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
call   1050 <sin@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0xd0(%rbp),%xmm2
ff
movsd  -0xa8(%rbp),%xmm1
ff
mulsd  -0xd8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0xd0(%rbp),%xmm2
ff
movsd  -0xb0(%rbp),%xmm1
ff
mulsd  -0xd8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  -0xd0(%rbp),%xmm2
ff
movsd  -0xb8(%rbp),%xmm1
ff
mulsd  -0xd8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  0xa62(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    15c8 <linepart+0x458>
movsd  0xa50(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xa48(%rip),%xmm0
ucomisd -0x90(%rbp),%xmm0
ff
jbe    15ee <linepart+0x47e>
movsd  0xa32(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xa12(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1618 <linepart+0x4a8>
movsd  0xa00(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0x9f8(%rip),%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jbe    163e <linepart+0x4ce>
movsd  0x9e2(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  0x9c2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1668 <linepart+0x4f8>
movsd  0x9b0(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0x9a8(%rip),%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jbe    168e <linepart+0x51e>
movsd  0x992(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
call   1060 <asin@plt>
movsd  0x95d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x959(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x90(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1701 <linepart+0x591>
jp     1701 <linepart+0x591>
movsd  -0xa0(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1701 <linepart+0x591>
jp     1701 <linepart+0x591>
mov    -0x38(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1736 <linepart+0x5c6>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
call   1040 <atan2@plt>
movsd  0x8e2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x8de(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    173b <linepart+0x5cb>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linepart>:
push   %r14
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm4,0x70(%rsp)
movsd  %xmm0,(%rdi)
movsd  %xmm1,(%rsi)
movsd  0xe6d(%rip),%xmm5
mulsd  %xmm5,%xmm0
movsd  0xe69(%rip),%xmm4
divsd  %xmm4,%xmm0
movsd  %xmm0,0x10(%rsp)
mulsd  %xmm5,%xmm1
divsd  %xmm4,%xmm1
movapd %xmm1,%xmm0
movsd  %xmm1,0x8(%rsp)
mulsd  %xmm5,%xmm2
divsd  %xmm4,%xmm2
movsd  %xmm2,0x18(%rsp)
mulsd  %xmm3,%xmm5
divsd  %xmm4,%xmm5
movsd  %xmm5,0x20(%rsp)
call   1070 <cos@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x10(%rsp),%xmm0
call   1070 <cos@plt>
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1070 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1070 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,0x38(%rsp)
movsd  0x20(%rsp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
call   1070 <cos@plt>
movapd %xmm0,%xmm5
mulsd  0x20(%rsp),%xmm5
lea    0x50(%rsp),%rdi
lea    0x48(%rsp),%rsi
lea    0x40(%rsp),%rdx
movsd  0x28(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm3
movsd  0x38(%rsp),%xmm4
movsd  %xmm5,0x18(%rsp)
mov    $0x6,%al
call   1090 <crossproduct@plt>
movsd  0x50(%rsp),%xmm1
movsd  0x48(%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x40(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1301 <linepart+0x191>
sqrtsd %xmm0,%xmm0
jmp    130a <linepart+0x19a>
call   1080 <sqrt@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1316 <linepart+0x1a6>
jnp    14fa <linepart+0x38a>
movsd  0x50(%rsp),%xmm3
divsd  %xmm0,%xmm3
movsd  %xmm3,0x50(%rsp)
movsd  0x48(%rsp),%xmm4
divsd  %xmm0,%xmm4
movsd  %xmm4,0x48(%rsp)
movsd  0x40(%rsp),%xmm5
divsd  %xmm0,%xmm5
movsd  %xmm5,0x40(%rsp)
lea    0x68(%rsp),%rdi
lea    0x60(%rsp),%rsi
lea    0x58(%rsp),%rdx
movsd  0x28(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
mov    $0x6,%al
call   1090 <crossproduct@plt>
movsd  0x68(%rsp),%xmm0
movsd  0x60(%rsp),%xmm1
movsd  0x58(%rsp),%xmm2
movsd  0x8(%rsp),%xmm3
movsd  0x38(%rsp),%xmm4
movsd  0x18(%rsp),%xmm5
mov    $0x6,%al
call   1030 <dotproduct@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x28(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm3
movsd  0x38(%rsp),%xmm4
movsd  0x18(%rsp),%xmm5
mov    $0x6,%al
call   1030 <dotproduct@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x20(%rsp),%xmm0
call   1040 <atan2@plt>
mulsd  0x70(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1070 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <sin@plt>
movsd  0x68(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x28(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm2,%xmm5
movsd  0x60(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x30(%rsp),%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm2,%xmm4
mulsd  0x58(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm3
movsd  0xbad(%rip),%xmm1
movapd %xmm1,%xmm0
minsd  %xmm5,%xmm0
movsd  0xba5(%rip),%xmm5
movapd %xmm5,%xmm2
maxsd  %xmm0,%xmm2
movsd  %xmm2,0x18(%rsp)
movapd %xmm1,%xmm2
minsd  %xmm4,%xmm2
movapd %xmm5,%xmm0
maxsd  %xmm2,%xmm0
minsd  %xmm3,%xmm1
maxsd  %xmm1,%xmm5
movsd  %xmm5,0x10(%rsp)
call   1060 <asin@plt>
movsd  0x10(%rsp),%xmm3
movsd  0x18(%rsp),%xmm1
mulsd  0xb50(%rip),%xmm0
divsd  0xb40(%rip),%xmm0
movsd  %xmm0,(%rbx)
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    14dc <linepart+0x36c>
jp     14dc <linepart+0x36c>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm3
jne    14dc <linepart+0x36c>
jnp    14f5 <linepart+0x385>
movapd %xmm3,%xmm0
call   1040 <atan2@plt>
mulsd  0xb1b(%rip),%xmm0
divsd  0xb0b(%rip),%xmm0
movsd  %xmm0,(%r14)
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @linepart(double %0, double %1, double %2, double %3, double %4, double* %5, double* %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%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 double
%22 = alloca 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 double
%34 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double* %5, double** %13
store double* %6, double** %14
store double 0.000000e+00, double* %31
store double 0.000000e+00, double* %32
store double 0.000000e+00, double* %33
store double 0.000000e+00, double* %34
%35 = load double, double* %8
%36 = load double*, double** %13
store double %35, double* %36
%37 = load double, double* %9
%38 = load double*, double** %14
store double %37, double* %38
%39 = load double, double* %8
%40 = fmul double %39, 0x400921FB54442D18
%41 = fdiv double %40, 1.800000e+02
store double %41, double* %8
%42 = load double, double* %9
%43 = fmul double %42, 0x400921FB54442D18
%44 = fdiv double %43, 1.800000e+02
store double %44, double* %9
%45 = load double, double* %10
%46 = fmul double %45, 0x400921FB54442D18
%47 = fdiv double %46, 1.800000e+02
store double %47, double* %10
%48 = load double, double* %11
%49 = fmul double %48, 0x400921FB54442D18
%50 = fdiv double %49, 1.800000e+02
store double %50, double* %11
%51 = load double, double* %9
%52 = call double @cos(double %51)
%53 = load double, double* %8
%54 = call double @cos(double %53)
%55 = fmul double %52, %54
store double %55, double* %15
%56 = load double, double* %8
%57 = call double @sin(double %56)
store double %57, double* %16
%58 = load double, double* %9
%59 = call double @sin(double %58)
%60 = load double, double* %8
%61 = call double @cos(double %60)
%62 = fmul double %59, %61
store double %62, double* %17
%63 = load double, double* %11
%64 = call double @cos(double %63)
%65 = load double, double* %10
%66 = call double @cos(double %65)
%67 = fmul double %64, %66
store double %67, double* %18
%68 = load double, double* %10
%69 = call double @sin(double %68)
store double %69, double* %19
%70 = load double, double* %11
%71 = call double @sin(double %70)
%72 = load double, double* %10
%73 = call double @cos(double %72)
%74 = fmul double %71, %73
store double %74, double* %20
%75 = load double, double* %15
%76 = load double, double* %16
%77 = load double, double* %17
%78 = load double, double* %18
%79 = load double, double* %19
%80 = load double, double* %20
%81 = call i32 (double, double, double, double, double, double, double*, double*, double*, ...) bitcast (i32 (...)* @crossproduct to i32 (double, double, double, double, double, double, double*, double*, double*, ...)*)(double %75, double %76, double %77, double %78, double %79, double %80, double* %21, double* %22, double* %23)
%82 = load double, double* %21
%83 = load double, double* %21
%84 = load double, double* %22
%85 = load double, double* %22
%86 = fmul double %84, %85
%87 = call double @llvm.fmuladd.f64(double %82, double %83, double %86)
%88 = load double, double* %23
%89 = load double, double* %23
%90 = call double @llvm.fmuladd.f64(double %88, double %89, double %87)
%91 = call double @sqrt(double %90)
store double %91, double* %24
%92 = load double, double* %24
%93 = fcmp une double %92, 0.000000e+00
br i1 %93, label %94, label %104
94: ; preds = %7
%95 = load double, double* %24
%96 = load double, double* %21
%97 = fdiv double %96, %95
store double %97, double* %21
%98 = load double, double* %24
%99 = load double, double* %22
%100 = fdiv double %99, %98
store double %100, double* %22
%101 = load double, double* %24
%102 = load double, double* %23
%103 = fdiv double %102, %101
store double %103, double* %23
br label %104
104: ; preds = %94, %7
%105 = load double, double* %24
%106 = fcmp une double %105, 0.000000e+00
br i1 %106, label %107, label %201
107: ; preds = %104
%108 = load double, double* %15
%109 = load double, double* %16
%110 = load double, double* %17
%111 = load double, double* %21
%112 = load double, double* %22
%113 = load double, double* %23
%114 = call i32 (double, double, double, double, double, double, double*, double*, double*, ...) bitcast (i32 (...)* @crossproduct to i32 (double, double, double, double, double, double, double*, double*, double*, ...)*)(double %108, double %109, double %110, double %111, double %112, double %113, double* %28, double* %29, double* %30)
%115 = load double, double* %28
%116 = load double, double* %29
%117 = load double, double* %30
%118 = load double, double* %18
%119 = load double, double* %19
%120 = load double, double* %20
%121 = call i32 (double, double, double, double, double, double, ...) bitcast (i32 (...)* @dotproduct to i32 (double, double, double, double, double, double, ...)*)(double %115, double %116, double %117, double %118, double %119, double %120)
%122 = sitofp i32 %121 to double
%123 = load double, double* %15
%124 = load double, double* %16
%125 = load double, double* %17
%126 = load double, double* %18
%127 = load double, double* %19
%128 = load double, double* %20
%129 = call i32 (double, double, double, double, double, double, ...) bitcast (i32 (...)* @dotproduct to i32 (double, double, double, double, double, double, ...)*)(double %123, double %124, double %125, double %126, double %127, double %128)
%130 = sitofp i32 %129 to double
%131 = call double @atan2(double %122, double %130)
store double %131, double* %31
%132 = load double, double* %12
%133 = load double, double* %31
%134 = fmul double %132, %133
store double %134, double* %32
%135 = load double, double* %32
%136 = call double @cos(double %135)
store double %136, double* %33
%137 = load double, double* %32
%138 = call double @sin(double %137)
store double %138, double* %34
%139 = load double, double* %15
%140 = load double, double* %33
%141 = load double, double* %28
%142 = load double, double* %34
%143 = fmul double %141, %142
%144 = call double @llvm.fmuladd.f64(double %139, double %140, double %143)
store double %144, double* %25
%145 = load double, double* %16
%146 = load double, double* %33
%147 = load double, double* %29
%148 = load double, double* %34
%149 = fmul double %147, %148
%150 = call double @llvm.fmuladd.f64(double %145, double %146, double %149)
store double %150, double* %26
%151 = load double, double* %17
%152 = load double, double* %33
%153 = load double, double* %30
%154 = load double, double* %34
%155 = fmul double %153, %154
%156 = call double @llvm.fmuladd.f64(double %151, double %152, double %155)
store double %156, double* %27
%157 = load double, double* %25
%158 = fcmp ogt double %157, 1.000000e+00
br i1 %158, label %159, label %160
159: ; preds = %107
store double 1.000000e+00, double* %25
br label %160
160: ; preds = %159, %107
%161 = load double, double* %25
%162 = fcmp olt double %161, -1.000000e+00
br i1 %162, label %163, label %164
163: ; preds = %160
store double -1.000000e+00, double* %25
br label %164
164: ; preds = %163, %160
%165 = load double, double* %26
%166 = fcmp ogt double %165, 1.000000e+00
br i1 %166, label %167, label %168
167: ; preds = %164
store double 1.000000e+00, double* %26
br label %168
168: ; preds = %167, %164
%169 = load double, double* %26
%170 = fcmp olt double %169, -1.000000e+00
br i1 %170, label %171, label %172
171: ; preds = %168
store double -1.000000e+00, double* %26
br label %172
172: ; preds = %171, %168
%173 = load double, double* %27
%174 = fcmp ogt double %173, 1.000000e+00
br i1 %174, label %175, label %176
175: ; preds = %172
store double 1.000000e+00, double* %27
br label %176
176: ; preds = %175, %172
%177 = load double, double* %27
%178 = fcmp olt double %177, -1.000000e+00
br i1 %178, label %179, label %180
179: ; preds = %176
store double -1.000000e+00, double* %27
br label %180
180: ; preds = %179, %176
%181 = load double, double* %26
%182 = call double @asin(double %181)
%183 = fmul double %182, 1.800000e+02
%184 = fdiv double %183, 0x400921FB54442D18
%185 = load double*, double** %13
store double %184, double* %185
%186 = load double, double* %25
%187 = fcmp oeq double %186, 0.000000e+00
br i1 %187, label %188, label %193
188: ; preds = %180
%189 = load double, double* %27
%190 = fcmp oeq double %189, 0.000000e+00
br i1 %190, label %191, label %193
191: ; preds = %188
%192 = load double*, double** %14
store double 0.000000e+00, double* %192
br label %200
193: ; preds = %188, %180
%194 = load double, double* %27
%195 = load double, double* %25
%196 = call double @atan2(double %194, double %195)
%197 = fmul double %196, 1.800000e+02
%198 = fdiv double %197, 0x400921FB54442D18
%199 = load double*, double** %14
store double %198, double* %199
br label %200
200: ; preds = %193, %191
br label %201
201: ; preds = %200, %104
ret void
}

LLVM IR (-O2):
define void @linepart(double %0, double %1, double %2, double %3, double %4, double* nocapture writeonly %5, double* nocapture writeonly %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = bitcast double* %8 to i8*
%15 = bitcast double* %9 to i8*
%16 = bitcast double* %10 to i8*
%17 = bitcast double* %11 to i8*
%18 = bitcast double* %12 to i8*
%19 = bitcast double* %13 to i8*
store double %0, double* %5
store double %1, double* %6
%20 = fmul double %0, 0x400921FB54442D18
%21 = fdiv double %20, 1.800000e+02
%22 = fmul double %1, 0x400921FB54442D18
%23 = fdiv double %22, 1.800000e+02
%24 = fmul double %2, 0x400921FB54442D18
%25 = fdiv double %24, 1.800000e+02
%26 = fmul double %3, 0x400921FB54442D18
%27 = fdiv double %26, 1.800000e+02
%28 = tail call double @cos(double %23)
%29 = tail call double @cos(double %21)
%30 = fmul double %28, %29
%31 = tail call double @sin(double %21)
%32 = tail call double @sin(double %23)
%33 = tail call double @cos(double %21)
%34 = fmul double %32, %33
%35 = tail call double @cos(double %27)
%36 = tail call double @cos(double %25)
%37 = fmul double %35, %36
%38 = tail call double @sin(double %25)
%39 = tail call double @sin(double %27)
%40 = tail call double @cos(double %25)
%41 = fmul double %39, %40
%42 = call i32 (double, double, double, double, double, double, double*, double*, double*, ...) bitcast (i32 (...)* @crossproduct to i32 (double, double, double, double, double, double, double*, double*, double*, ...)*)(double %30, double %31, double %34, double %37, double %38, double %41, double* %8, double* %9, double* %10)
%43 = load double, double* %8
%44 = load double, double* %9
%45 = fmul double %44, %44
%46 = call double @llvm.fmuladd.f64(double %43, double %43, double %45)
%47 = load double, double* %10
%48 = call double @llvm.fmuladd.f64(double %47, double %47, double %46)
%49 = call double @sqrt(double %48)
%50 = fcmp une double %49, 0.000000e+00
br i1 %50, label %51, label %103
51: ; preds = %7
%52 = load double, double* %8
%53 = fdiv double %52, %49
store double %53, double* %8
%54 = load double, double* %9
%55 = fdiv double %54, %49
store double %55, double* %9
%56 = load double, double* %10
%57 = fdiv double %56, %49
store double %57, double* %10
%58 = call i32 (double, double, double, double, double, double, double*, double*, double*, ...) bitcast (i32 (...)* @crossproduct to i32 (double, double, double, double, double, double, double*, double*, double*, ...)*)(double %30, double %31, double %34, double %53, double %55, double %57, double* %11, double* %12, double* %13)
%59 = load double, double* %11
%60 = load double, double* %12
%61 = load double, double* %13
%62 = call i32 (double, double, double, double, double, double, ...) bitcast (i32 (...)* @dotproduct to i32 (double, double, double, double, double, double, ...)*)(double %59, double %60, double %61, double %37, double %38, double %41)
%63 = sitofp i32 %62 to double
%64 = call i32 (double, double, double, double, double, double, ...) bitcast (i32 (...)* @dotproduct to i32 (double, double, double, double, double, double, ...)*)(double %30, double %31, double %34, double %37, double %38, double %41)
%65 = sitofp i32 %64 to double
%66 = call double @atan2(double %63, double %65)
%67 = fmul double %66, %4
%68 = call double @cos(double %67)
%69 = call double @sin(double %67)
%70 = load double, double* %11
%71 = fmul double %69, %70
%72 = call double @llvm.fmuladd.f64(double %30, double %68, double %71)
%73 = load double, double* %12
%74 = fmul double %69, %73
%75 = call double @llvm.fmuladd.f64(double %31, double %68, double %74)
%76 = load double, double* %13
%77 = fmul double %69, %76
%78 = call double @llvm.fmuladd.f64(double %34, double %68, double %77)
%79 = fcmp ogt double %72, 1.000000e+00
%80 = select i1 %79, double 1.000000e+00, double %72
%81 = fcmp olt double %80, -1.000000e+00
%82 = select i1 %81, double -1.000000e+00, double %80
%83 = fcmp ogt double %75, 1.000000e+00
%84 = select i1 %83, double 1.000000e+00, double %75
%85 = fcmp olt double %84, -1.000000e+00
%86 = select i1 %85, double -1.000000e+00, double %84
%87 = fcmp ogt double %78, 1.000000e+00
%88 = select i1 %87, double 1.000000e+00, double %78
%89 = fcmp olt double %88, -1.000000e+00
%90 = select i1 %89, double -1.000000e+00, double %88
%91 = call double @asin(double %86)
%92 = fmul double %91, 1.800000e+02
%93 = fdiv double %92, 0x400921FB54442D18
store double %93, double* %5
%94 = fcmp oeq double %82, 0.000000e+00
%95 = fcmp oeq double %90, 0.000000e+00
%96 = select i1 %94, i1 %95, i1 false
br i1 %96, label %101, label %97
97: ; preds = %51
%98 = call double @atan2(double %90, double %82)
%99 = fmul double %98, 1.800000e+02
%100 = fdiv double %99, 0x400921FB54442D18
br label %101
101: ; preds = %51, %97
%102 = phi double [ %100, %97 ], [ 0.000000e+00, %51 ]
store double %102, double* %6
br label %103
103: ; preds = %101, %7
ret void
}