#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*/ BuG(char *);
double _den(long double, long double, long double, long double, long double,
            long double);
int /*<<< orphan*/ _to_cart(long double *, long double *);
int /*<<< orphan*/ _to_sphere(long double *, long double *);
scalar_t__ euclid_dist(long double *, long double *);
double fabsl(long double);
int find_intersection(long double *p0, long double *p1, long double *p2,
                      long double *p3, long double *p) {
  long double P0[3], P1[3], P2[3], P3[3];
  _to_cart(p0, P0);
  _to_cart(p1, P1);
  _to_cart(p2, P2);
  _to_cart(p3, P3);
  long double a = (P0[1] * P1[2] - P1[1] * P0[2]);
  long double b = -(P0[0] * P1[2] - P1[0] * P0[2]);
  long double c = (P0[0] * P1[1] - P1[0] * P0[1]);
  long double d = (P2[1] * P3[2] - P3[1] * P2[2]);
  long double e = -(P2[0] * P3[2] - P3[0] * P2[2]);
  long double f = (P2[0] * P3[1] - P3[0] * P2[1]);
  long double X1[3], X2[3];
  long double t = 6371000. / _den(a, b, c, d, e, f);
  if (_den(a, b, c, d, e, f) < 0.0000001)
    BuG("DEN ZERO\n");
  if (fabsl(b * d - a * e) < 0.0000001)
    BuG("bd ae zero\n");
  X1[0] = -((b * f - c * e) / (b * d - a * e)) * t;
  X1[1] = -((c * d - a * f) / (b * d - a * e)) * t;
  X1[2] = t;
  X2[0] = -X1[0];
  X2[1] = -X1[1];
  X2[2] = -X1[2];
  _to_sphere(X1, p);
  _to_sphere(X2, &p[2]);
  if (euclid_dist(P0, X1) > euclid_dist(P0, X2)) {
    long double comodo;
    comodo = p[2];
    p[2] = p[0];
    comodo = p[3];
    p[3] = p[1];
  }
  return 1;
}


x86 assembly (clang, -O0):
<find_intersection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1080 <_to_cart@plt>
mov    -0x10(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1080 <_to_cart@plt>
mov    -0x18(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   1080 <_to_cart@plt>
mov    -0x20(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1080 <_to_cart@plt>
fldt   -0x50(%rbp)
fldt   -0x70(%rbp)
fldt   -0x80(%rbp)
fldt   -0x40(%rbp)
fmulp  %st,%st(1)
fxch   %st(2)
fmulp  %st,%st(1)
fsubp  %st,%st(1)
fstpt  -0x100(%rbp)
fldt   -0x60(%rbp)
fldt   -0x70(%rbp)
fldt   -0x90(%rbp)
fldt   -0x40(%rbp)
fmulp  %st,%st(1)
fxch   %st(2)
fmulp  %st,%st(1)
fsubp  %st,%st(1)
fchs
fstpt  -0x110(%rbp)
fldt   -0x60(%rbp)
fldt   -0x80(%rbp)
fldt   -0x90(%rbp)
fldt   -0x50(%rbp)
fmulp  %st,%st(1)
fxch   %st(2)
fmulp  %st,%st(1)
fsubp  %st,%st(1)
fstpt  -0x120(%rbp)
fldt   -0xb0(%rbp)
fldt   -0xd0(%rbp)
fldt   -0xe0(%rbp)
fldt   -0xa0(%rbp)
fmulp  %st,%st(1)
fxch   %st(2)
fmulp  %st,%st(1)
fsubp  %st,%st(1)
fstpt  -0x130(%rbp)
fldt   -0xc0(%rbp)
fldt   -0xd0(%rbp)
fldt   -0xf0(%rbp)
fldt   -0xa0(%rbp)
fmulp  %st,%st(1)
fxch   %st(2)
fmulp  %st,%st(1)
fsubp  %st,%st(1)
fchs
fstpt  -0x140(%rbp)
fldt   -0xc0(%rbp)
fldt   -0xe0(%rbp)
fldt   -0xf0(%rbp)
fldt   -0xb0(%rbp)
fmulp  %st,%st(1)
fxch   %st(2)
fmulp  %st,%st(1)
fsubp  %st,%st(1)
fstpt  -0x150(%rbp)
fldt   -0x100(%rbp)
fldt   -0x110(%rbp)
fldt   -0x120(%rbp)
fldt   -0x130(%rbp)
fldt   -0x140(%rbp)
fldt   -0x150(%rbp)
mov    %rsp,%rax
fstpt  0x50(%rax)
fstpt  0x40(%rax)
fstpt  0x30(%rax)
fstpt  0x20(%rax)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <_den@plt>
movaps %xmm0,%xmm1
movsd  0xd3a(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x1d8(%rbp)
ff
fldl   -0x1d8(%rbp)
fstpt  -0x1c0(%rbp)
fldt   -0x100(%rbp)
fldt   -0x110(%rbp)
fldt   -0x120(%rbp)
fldt   -0x130(%rbp)
fldt   -0x140(%rbp)
fldt   -0x150(%rbp)
mov    %rsp,%rax
fstpt  0x50(%rax)
fstpt  0x40(%rax)
fstpt  0x30(%rax)
fstpt  0x20(%rax)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <_den@plt>
movaps %xmm0,%xmm1
movsd  0xcd2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1344 <find_intersection+0x1e4>
lea    0xcd1(%rip),%rdi
call   1050 <BuG@plt>
fldt   -0x110(%rbp)
fldt   -0x130(%rbp)
fldt   -0x100(%rbp)
fldt   -0x140(%rbp)
fmulp  %st,%st(1)
fchs
fxch   %st(2)
fmulp  %st,%st(1)
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <fabsl@plt>
movaps %xmm0,%xmm1
movsd  0xc85(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1391 <find_intersection+0x231>
lea    0xc8e(%rip),%rdi
call   1050 <BuG@plt>
fldt   -0x110(%rbp)
fldt   -0x150(%rbp)
fldt   -0x120(%rbp)
fldt   -0x140(%rbp)
fmul   %st,%st(1)
fxch   %st(2)
fmul   %st(3),%st
fsubp  %st,%st(1)
fldt   -0x130(%rbp)
fldt   -0x100(%rbp)
fmulp  %st,%st(3)
fmulp  %st,%st(3)
fxch   %st(2)
fsubp  %st,%st(1)
fdivrp %st,%st(1)
fchs
fldt   -0x1c0(%rbp)
fmulp  %st,%st(1)
fstpt  -0x180(%rbp)
fldt   -0x120(%rbp)
fldt   -0x130(%rbp)
fldt   -0x100(%rbp)
fldt   -0x150(%rbp)
fmul   %st(1),%st
fxch   %st(3)
fmul   %st(2),%st
fsubp  %st,%st(3)
fldt   -0x110(%rbp)
fldt   -0x140(%rbp)
fmulp  %st,%st(2)
fmulp  %st,%st(2)
fsubrp %st,%st(1)
fdivrp %st,%st(1)
fchs
fldt   -0x1c0(%rbp)
fmulp  %st,%st(1)
fstpt  -0x170(%rbp)
fldt   -0x1c0(%rbp)
fstpt  -0x160(%rbp)
fldt   -0x180(%rbp)
fchs
fstpt  -0x1b0(%rbp)
fldt   -0x170(%rbp)
fchs
fstpt  -0x1a0(%rbp)
fldt   -0x160(%rbp)
fchs
fstpt  -0x190(%rbp)
lea    -0x180(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1070 <_to_sphere@plt>
lea    -0x1b0(%rbp),%rdi
mov    -0x28(%rbp),%rsi
add    $0x20,%rsi
call   1070 <_to_sphere@plt>
lea    -0x60(%rbp),%rdi
lea    -0x180(%rbp),%rsi
call   1060 <euclid_dist@plt>
mov    %rax,-0x1e0(%rbp)
lea    -0x60(%rbp),%rdi
lea    -0x1b0(%rbp),%rsi
call   1060 <euclid_dist@plt>
mov    %rax,%rcx
mov    -0x1e0(%rbp),%rax
cmp    %rcx,%rax
jle    14dc <find_intersection+0x37c>
mov    -0x28(%rbp),%rax
fldt   0x20(%rax)
fstpt  -0x1d0(%rbp)
mov    -0x28(%rbp),%rax
fldt   (%rax)
fstpt  0x20(%rax)
mov    -0x28(%rbp),%rax
fldt   0x30(%rax)
fstpt  -0x1d0(%rbp)
mov    -0x28(%rbp),%rax
fldt   0x10(%rax)
fstpt  0x30(%rax)
mov    $0x1,%eax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_intersection>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1f0,%rsp
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
lea    0xd0(%rsp),%rsi
call   1080 <_to_cart@plt>
lea    0x1c0(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <_to_cart@plt>
lea    0x190(%rsp),%rsi
mov    %r12,%rdi
call   1080 <_to_cart@plt>
lea    0x160(%rsp),%rsi
mov    %r15,%rdi
call   1080 <_to_cart@plt>
fldt   0xe0(%rsp)
fldt   0x1e0(%rsp)
fldt   0x1d0(%rsp)
fldt   0xf0(%rsp)
fld    %st(0)
fmul   %st(2),%st
fld    %st(4)
fmul   %st(4),%st
fsubp  %st,%st(1)
fstpt  0x70(%rsp)
fldt   0xd0(%rsp)
fldt   0x1c0(%rsp)
fmul   %st,%st(2)
fxch   %st(4)
fmul   %st(1),%st
fsubp  %st,%st(2)
fxch   %st(1)
fstpt  0x64(%rsp)
fxch   %st(3)
fmulp  %st,%st(2)
fmulp  %st,%st(2)
fsubrp %st,%st(1)
fstpt  0x94(%rsp)
fldt   0x1a0(%rsp)
fldt   0x180(%rsp)
fldt   0x170(%rsp)
fldt   0x1b0(%rsp)
fld    %st(0)
fmul   %st(2),%st
fld    %st(4)
fmul   %st(4),%st
fsubp  %st,%st(1)
fld    %st(0)
fstpt  0x88(%rsp)
fldt   0x160(%rsp)
fmul   %st,%st(2)
fldt   0x190(%rsp)
fmul   %st,%st(5)
fxch   %st(5)
fsubp  %st,%st(3)
fmulp  %st,%st(5)
fxch   %st(3)
fmulp  %st,%st(2)
fldt   0x64(%rsp)
fchs
fld    %st(0)
fstpt  0x64(%rsp)
fxch   %st(2)
fsubp  %st,%st(4)
fld    %st(3)
fstpt  0xac(%rsp)
fld    %st(0)
fstpt  0xa0(%rsp)
fchs
fld    %st(0)
fstpt  0x7c(%rsp)
fxch   %st(3)
fstpt  0x50(%rsp)
fxch   %st(2)
fstpt  0x40(%rsp)
fstpt  0x30(%rsp)
fldt   0x94(%rsp)
fstpt  0x20(%rsp)
fstpt  0x10(%rsp)
fldt   0x70(%rsp)
fstpt  (%rsp)
call   1030 <_den@plt>
movsd  0xd4a(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0xb8(%rsp)
fldl   0xb8(%rsp)
fstpt  0xc4(%rsp)
fldt   0xac(%rsp)
fstpt  0x50(%rsp)
fldt   0x7c(%rsp)
fstpt  0x40(%rsp)
fldt   0x88(%rsp)
fstpt  0x30(%rsp)
fldt   0x94(%rsp)
fstpt  0x20(%rsp)
fldt   0x64(%rsp)
fstpt  0x10(%rsp)
fldt   0x70(%rsp)
fstpt  (%rsp)
call   1030 <_den@plt>
movsd  0xcf2(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1328 <find_intersection+0x1c8>
lea    0xced(%rip),%rdi
call   1050 <BuG@plt>
fldt   0x70(%rsp)
fldt   0xa0(%rsp)
fmulp  %st,%st(1)
fldt   0x88(%rsp)
fldt   0x64(%rsp)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fld    %st(0)
fstpt  0x7c(%rsp)
fstpt  (%rsp)
call   1040 <fabsl@plt>
movsd  0xcae(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    136c <find_intersection+0x20c>
lea    0xcb3(%rip),%rdi
call   1050 <BuG@plt>
fldt   0x94(%rsp)
fldt   0xa0(%rsp)
fmul   %st(1),%st
fldt   0xac(%rsp)
fldt   0x64(%rsp)
fmul   %st(1),%st
faddp  %st,%st(2)
fldt   0x70(%rsp)
fmulp  %st,%st(1)
fldt   0x88(%rsp)
fmulp  %st,%st(3)
fsubrp %st,%st(2)
fchs
fldt   0x7c(%rsp)
fdivr  %st,%st(1)
fxch   %st(2)
fchs
fdivp  %st,%st(2)
fldt   0xc4(%rsp)
fmul   %st,%st(1)
fld    %st(1)
fstpt  0x130(%rsp)
fxch   %st(1)
fchs
fstpt  0x100(%rsp)
fmul   %st,%st(1)
fld    %st(1)
fstpt  0x140(%rsp)
fxch   %st(1)
fchs
fstpt  0x110(%rsp)
fld    %st(0)
fstpt  0x150(%rsp)
fchs
fstpt  0x120(%rsp)
lea    0x130(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1070 <_to_sphere@plt>
lea    0x20(%r14),%rsi
lea    0x100(%rsp),%r12
mov    %r12,%rdi
call   1070 <_to_sphere@plt>
lea    0xd0(%rsp),%r13
mov    %r13,%rdi
mov    %r15,%rsi
call   1060 <euclid_dist@plt>
mov    %rax,%rbx
mov    %r13,%rdi
mov    %r12,%rsi
call   1060 <euclid_dist@plt>
cmp    %rax,%rbx
jle    144b <find_intersection+0x2eb>
fldt   (%r14)
fstpt  0x20(%r14)
fldt   0x10(%r14)
fstpt  0x30(%r14)
mov    $0x1,%eax
add    $0x1f0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"DEN ZERO\0A\00"
@.str.1 = [12 x i8] c"bd ae zero\0A\00"
define i32 @find_intersection(x86_fp80* %0, x86_fp80* %1, x86_fp80* %2, x86_fp80* %3, x86_fp80* %4) {
%6 = alloca x86_fp80*
%7 = alloca x86_fp80*
%8 = alloca x86_fp80*
%9 = alloca x86_fp80*
%10 = alloca x86_fp80*
%11 = alloca [3 x x86_fp80]
%12 = alloca [3 x x86_fp80]
%13 = alloca [3 x x86_fp80]
%14 = alloca [3 x x86_fp80]
%15 = alloca x86_fp80
%16 = alloca x86_fp80
%17 = alloca x86_fp80
%18 = alloca x86_fp80
%19 = alloca x86_fp80
%20 = alloca x86_fp80
%21 = alloca [3 x x86_fp80]
%22 = alloca [3 x x86_fp80]
%23 = alloca x86_fp80
%24 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %6
store x86_fp80* %1, x86_fp80** %7
store x86_fp80* %2, x86_fp80** %8
store x86_fp80* %3, x86_fp80** %9
store x86_fp80* %4, x86_fp80** %10
%25 = load x86_fp80*, x86_fp80** %6
%26 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %11, i64 0, i64 0
%27 = call i32 @_to_cart(x86_fp80* %25, x86_fp80* %26)
%28 = load x86_fp80*, x86_fp80** %7
%29 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %12, i64 0, i64 0
%30 = call i32 @_to_cart(x86_fp80* %28, x86_fp80* %29)
%31 = load x86_fp80*, x86_fp80** %8
%32 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %13, i64 0, i64 0
%33 = call i32 @_to_cart(x86_fp80* %31, x86_fp80* %32)
%34 = load x86_fp80*, x86_fp80** %9
%35 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %14, i64 0, i64 0
%36 = call i32 @_to_cart(x86_fp80* %34, x86_fp80* %35)
%37 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %11, i64 0, i64 1
%38 = load x86_fp80, x86_fp80* %37
%39 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %12, i64 0, i64 2
%40 = load x86_fp80, x86_fp80* %39
%41 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %12, i64 0, i64 1
%42 = load x86_fp80, x86_fp80* %41
%43 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %11, i64 0, i64 2
%44 = load x86_fp80, x86_fp80* %43
%45 = fmul x86_fp80 %42, %44
%46 = fneg x86_fp80 %45
%47 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %38, x86_fp80 %40, x86_fp80 %46)
store x86_fp80 %47, x86_fp80* %15
%48 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %11, i64 0, i64 0
%49 = load x86_fp80, x86_fp80* %48
%50 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %12, i64 0, i64 2
%51 = load x86_fp80, x86_fp80* %50
%52 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %12, i64 0, i64 0
%53 = load x86_fp80, x86_fp80* %52
%54 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %11, i64 0, i64 2
%55 = load x86_fp80, x86_fp80* %54
%56 = fmul x86_fp80 %53, %55
%57 = fneg x86_fp80 %56
%58 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %49, x86_fp80 %51, x86_fp80 %57)
%59 = fneg x86_fp80 %58
store x86_fp80 %59, x86_fp80* %16
%60 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %11, i64 0, i64 0
%61 = load x86_fp80, x86_fp80* %60
%62 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %12, i64 0, i64 1
%63 = load x86_fp80, x86_fp80* %62
%64 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %12, i64 0, i64 0
%65 = load x86_fp80, x86_fp80* %64
%66 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %11, i64 0, i64 1
%67 = load x86_fp80, x86_fp80* %66
%68 = fmul x86_fp80 %65, %67
%69 = fneg x86_fp80 %68
%70 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %61, x86_fp80 %63, x86_fp80 %69)
store x86_fp80 %70, x86_fp80* %17
%71 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %13, i64 0, i64 1
%72 = load x86_fp80, x86_fp80* %71
%73 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %14, i64 0, i64 2
%74 = load x86_fp80, x86_fp80* %73
%75 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %14, i64 0, i64 1
%76 = load x86_fp80, x86_fp80* %75
%77 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %13, i64 0, i64 2
%78 = load x86_fp80, x86_fp80* %77
%79 = fmul x86_fp80 %76, %78
%80 = fneg x86_fp80 %79
%81 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %72, x86_fp80 %74, x86_fp80 %80)
store x86_fp80 %81, x86_fp80* %18
%82 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %13, i64 0, i64 0
%83 = load x86_fp80, x86_fp80* %82
%84 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %14, i64 0, i64 2
%85 = load x86_fp80, x86_fp80* %84
%86 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %14, i64 0, i64 0
%87 = load x86_fp80, x86_fp80* %86
%88 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %13, i64 0, i64 2
%89 = load x86_fp80, x86_fp80* %88
%90 = fmul x86_fp80 %87, %89
%91 = fneg x86_fp80 %90
%92 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %83, x86_fp80 %85, x86_fp80 %91)
%93 = fneg x86_fp80 %92
store x86_fp80 %93, x86_fp80* %19
%94 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %13, i64 0, i64 0
%95 = load x86_fp80, x86_fp80* %94
%96 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %14, i64 0, i64 1
%97 = load x86_fp80, x86_fp80* %96
%98 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %14, i64 0, i64 0
%99 = load x86_fp80, x86_fp80* %98
%100 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %13, i64 0, i64 1
%101 = load x86_fp80, x86_fp80* %100
%102 = fmul x86_fp80 %99, %101
%103 = fneg x86_fp80 %102
%104 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %95, x86_fp80 %97, x86_fp80 %103)
store x86_fp80 %104, x86_fp80* %20
%105 = load x86_fp80, x86_fp80* %15
%106 = load x86_fp80, x86_fp80* %16
%107 = load x86_fp80, x86_fp80* %17
%108 = load x86_fp80, x86_fp80* %18
%109 = load x86_fp80, x86_fp80* %19
%110 = load x86_fp80, x86_fp80* %20
%111 = call double @_den(x86_fp80 %105, x86_fp80 %106, x86_fp80 %107, x86_fp80 %108, x86_fp80 %109, x86_fp80 %110)
%112 = fdiv double 6.371000e+06, %111
%113 = fpext double %112 to x86_fp80
store x86_fp80 %113, x86_fp80* %23
%114 = load x86_fp80, x86_fp80* %15
%115 = load x86_fp80, x86_fp80* %16
%116 = load x86_fp80, x86_fp80* %17
%117 = load x86_fp80, x86_fp80* %18
%118 = load x86_fp80, x86_fp80* %19
%119 = load x86_fp80, x86_fp80* %20
%120 = call double @_den(x86_fp80 %114, x86_fp80 %115, x86_fp80 %116, x86_fp80 %117, x86_fp80 %118, x86_fp80 %119)
%121 = fcmp olt double %120, 0x3E7AD7F29ABCAF48
br i1 %121, label %122, label %124
122: ; preds = %5
%123 = call i32 @BuG(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %124
124: ; preds = %122, %5
%125 = load x86_fp80, x86_fp80* %16
%126 = load x86_fp80, x86_fp80* %18
%127 = load x86_fp80, x86_fp80* %15
%128 = load x86_fp80, x86_fp80* %19
%129 = fmul x86_fp80 %127, %128
%130 = fneg x86_fp80 %129
%131 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %125, x86_fp80 %126, x86_fp80 %130)
%132 = call double @fabsl(x86_fp80 %131)
%133 = fcmp olt double %132, 0x3E7AD7F29ABCAF48
br i1 %133, label %134, label %136
134: ; preds = %124
%135 = call i32 @BuG(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %136
136: ; preds = %134, %124
%137 = load x86_fp80, x86_fp80* %16
%138 = load x86_fp80, x86_fp80* %20
%139 = load x86_fp80, x86_fp80* %17
%140 = load x86_fp80, x86_fp80* %19
%141 = fmul x86_fp80 %139, %140
%142 = fneg x86_fp80 %141
%143 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %137, x86_fp80 %138, x86_fp80 %142)
%144 = load x86_fp80, x86_fp80* %16
%145 = load x86_fp80, x86_fp80* %18
%146 = load x86_fp80, x86_fp80* %15
%147 = load x86_fp80, x86_fp80* %19
%148 = fmul x86_fp80 %146, %147
%149 = fneg x86_fp80 %148
%150 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %144, x86_fp80 %145, x86_fp80 %149)
%151 = fdiv x86_fp80 %143, %150
%152 = fneg x86_fp80 %151
%153 = load x86_fp80, x86_fp80* %23
%154 = fmul x86_fp80 %152, %153
%155 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %21, i64 0, i64 0
store x86_fp80 %154, x86_fp80* %155
%156 = load x86_fp80, x86_fp80* %17
%157 = load x86_fp80, x86_fp80* %18
%158 = load x86_fp80, x86_fp80* %15
%159 = load x86_fp80, x86_fp80* %20
%160 = fmul x86_fp80 %158, %159
%161 = fneg x86_fp80 %160
%162 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %156, x86_fp80 %157, x86_fp80 %161)
%163 = load x86_fp80, x86_fp80* %16
%164 = load x86_fp80, x86_fp80* %18
%165 = load x86_fp80, x86_fp80* %15
%166 = load x86_fp80, x86_fp80* %19
%167 = fmul x86_fp80 %165, %166
%168 = fneg x86_fp80 %167
%169 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %163, x86_fp80 %164, x86_fp80 %168)
%170 = fdiv x86_fp80 %162, %169
%171 = fneg x86_fp80 %170
%172 = load x86_fp80, x86_fp80* %23
%173 = fmul x86_fp80 %171, %172
%174 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %21, i64 0, i64 1
store x86_fp80 %173, x86_fp80* %174
%175 = load x86_fp80, x86_fp80* %23
%176 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %21, i64 0, i64 2
store x86_fp80 %175, x86_fp80* %176
%177 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %21, i64 0, i64 0
%178 = load x86_fp80, x86_fp80* %177
%179 = fneg x86_fp80 %178
%180 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %22, i64 0, i64 0
store x86_fp80 %179, x86_fp80* %180
%181 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %21, i64 0, i64 1
%182 = load x86_fp80, x86_fp80* %181
%183 = fneg x86_fp80 %182
%184 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %22, i64 0, i64 1
store x86_fp80 %183, x86_fp80* %184
%185 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %21, i64 0, i64 2
%186 = load x86_fp80, x86_fp80* %185
%187 = fneg x86_fp80 %186
%188 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %22, i64 0, i64 2
store x86_fp80 %187, x86_fp80* %188
%189 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %21, i64 0, i64 0
%190 = load x86_fp80*, x86_fp80** %10
%191 = call i32 @_to_sphere(x86_fp80* %189, x86_fp80* %190)
%192 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %22, i64 0, i64 0
%193 = load x86_fp80*, x86_fp80** %10
%194 = getelementptr inbounds x86_fp80, x86_fp80* %193, i64 2
%195 = call i32 @_to_sphere(x86_fp80* %192, x86_fp80* %194)
%196 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %11, i64 0, i64 0
%197 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %21, i64 0, i64 0
%198 = call i64 @euclid_dist(x86_fp80* %196, x86_fp80* %197)
%199 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %11, i64 0, i64 0
%200 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %22, i64 0, i64 0
%201 = call i64 @euclid_dist(x86_fp80* %199, x86_fp80* %200)
%202 = icmp sgt i64 %198, %201
br i1 %202, label %203, label %220
203: ; preds = %136
%204 = load x86_fp80*, x86_fp80** %10
%205 = getelementptr inbounds x86_fp80, x86_fp80* %204, i64 2
%206 = load x86_fp80, x86_fp80* %205
store x86_fp80 %206, x86_fp80* %24
%207 = load x86_fp80*, x86_fp80** %10
%208 = getelementptr inbounds x86_fp80, x86_fp80* %207, i64 0
%209 = load x86_fp80, x86_fp80* %208
%210 = load x86_fp80*, x86_fp80** %10
%211 = getelementptr inbounds x86_fp80, x86_fp80* %210, i64 2
store x86_fp80 %209, x86_fp80* %211
%212 = load x86_fp80*, x86_fp80** %10
%213 = getelementptr inbounds x86_fp80, x86_fp80* %212, i64 3
%214 = load x86_fp80, x86_fp80* %213
store x86_fp80 %214, x86_fp80* %24
%215 = load x86_fp80*, x86_fp80** %10
%216 = getelementptr inbounds x86_fp80, x86_fp80* %215, i64 1
%217 = load x86_fp80, x86_fp80* %216
%218 = load x86_fp80*, x86_fp80** %10
%219 = getelementptr inbounds x86_fp80, x86_fp80* %218, i64 3
store x86_fp80 %217, x86_fp80* %219
br label %220
220: ; preds = %203, %136
ret i32 1
}

LLVM IR (-O2):
@.str = [10 x i8] c"DEN ZERO\0A\00"
@.str.1 = [12 x i8] c"bd ae zero\0A\00"
define i32 @find_intersection(x86_fp80* %0, x86_fp80* %1, x86_fp80* %2, x86_fp80* %3, x86_fp80* %4) {
%6 = alloca [3 x x86_fp80]
%7 = alloca [3 x x86_fp80]
%8 = alloca [3 x x86_fp80]
%9 = alloca [3 x x86_fp80]
%10 = alloca [3 x x86_fp80]
%11 = alloca [3 x x86_fp80]
%12 = bitcast [3 x x86_fp80]* %6 to i8*
%13 = bitcast [3 x x86_fp80]* %7 to i8*
%14 = bitcast [3 x x86_fp80]* %8 to i8*
%15 = bitcast [3 x x86_fp80]* %9 to i8*
%16 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %6, i64 0, i64 0
%17 = call i32 @_to_cart(x86_fp80* %0, x86_fp80* %16)
%18 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %7, i64 0, i64 0
%19 = call i32 @_to_cart(x86_fp80* %1, x86_fp80* %18)
%20 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %8, i64 0, i64 0
%21 = call i32 @_to_cart(x86_fp80* %2, x86_fp80* %20)
%22 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %9, i64 0, i64 0
%23 = call i32 @_to_cart(x86_fp80* %3, x86_fp80* %22)
%24 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %6, i64 0, i64 1
%25 = load x86_fp80, x86_fp80* %24
%26 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %7, i64 0, i64 2
%27 = load x86_fp80, x86_fp80* %26
%28 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %7, i64 0, i64 1
%29 = load x86_fp80, x86_fp80* %28
%30 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %6, i64 0, i64 2
%31 = load x86_fp80, x86_fp80* %30
%32 = fneg x86_fp80 %29
%33 = fmul x86_fp80 %31, %32
%34 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %25, x86_fp80 %27, x86_fp80 %33)
%35 = load x86_fp80, x86_fp80* %16
%36 = load x86_fp80, x86_fp80* %18
%37 = fneg x86_fp80 %36
%38 = fmul x86_fp80 %31, %37
%39 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %35, x86_fp80 %27, x86_fp80 %38)
%40 = fneg x86_fp80 %39
%41 = fmul x86_fp80 %25, %37
%42 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %35, x86_fp80 %29, x86_fp80 %41)
%43 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %8, i64 0, i64 1
%44 = load x86_fp80, x86_fp80* %43
%45 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %9, i64 0, i64 2
%46 = load x86_fp80, x86_fp80* %45
%47 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %9, i64 0, i64 1
%48 = load x86_fp80, x86_fp80* %47
%49 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %8, i64 0, i64 2
%50 = load x86_fp80, x86_fp80* %49
%51 = fneg x86_fp80 %48
%52 = fmul x86_fp80 %50, %51
%53 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %44, x86_fp80 %46, x86_fp80 %52)
%54 = load x86_fp80, x86_fp80* %20
%55 = load x86_fp80, x86_fp80* %22
%56 = fneg x86_fp80 %55
%57 = fmul x86_fp80 %50, %56
%58 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %54, x86_fp80 %46, x86_fp80 %57)
%59 = fneg x86_fp80 %58
%60 = fmul x86_fp80 %44, %56
%61 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %54, x86_fp80 %48, x86_fp80 %60)
%62 = bitcast [3 x x86_fp80]* %10 to i8*
%63 = bitcast [3 x x86_fp80]* %11 to i8*
%64 = call double @_den(x86_fp80 %34, x86_fp80 %40, x86_fp80 %42, x86_fp80 %53, x86_fp80 %59, x86_fp80 %61)
%65 = fdiv double 6.371000e+06, %64
%66 = fpext double %65 to x86_fp80
%67 = call double @_den(x86_fp80 %34, x86_fp80 %40, x86_fp80 %42, x86_fp80 %53, x86_fp80 %59, x86_fp80 %61)
%68 = fcmp olt double %67, 0x3E7AD7F29ABCAF48
br i1 %68, label %69, label %71
69: ; preds = %5
%70 = call i32 @BuG(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %71
71: ; preds = %69, %5
%72 = fmul x86_fp80 %34, %58
%73 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %40, x86_fp80 %53, x86_fp80 %72)
%74 = call double @fabsl(x86_fp80 %73)
%75 = fcmp olt double %74, 0x3E7AD7F29ABCAF48
br i1 %75, label %76, label %78
76: ; preds = %71
%77 = call i32 @BuG(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %78
78: ; preds = %76, %71
%79 = fmul x86_fp80 %42, %58
%80 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %40, x86_fp80 %61, x86_fp80 %79)
%81 = fneg x86_fp80 %80
%82 = fdiv x86_fp80 %81, %73
%83 = fmul x86_fp80 %82, %66
%84 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %10, i64 0, i64 0
store x86_fp80 %83, x86_fp80* %84
%85 = fneg x86_fp80 %34
%86 = fmul x86_fp80 %61, %85
%87 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %42, x86_fp80 %53, x86_fp80 %86)
%88 = fneg x86_fp80 %87
%89 = fdiv x86_fp80 %88, %73
%90 = fmul x86_fp80 %89, %66
%91 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %10, i64 0, i64 1
store x86_fp80 %90, x86_fp80* %91
%92 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %10, i64 0, i64 2
store x86_fp80 %66, x86_fp80* %92
%93 = fneg x86_fp80 %83
%94 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %11, i64 0, i64 0
store x86_fp80 %93, x86_fp80* %94
%95 = fneg x86_fp80 %90
%96 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %11, i64 0, i64 1
store x86_fp80 %95, x86_fp80* %96
%97 = fneg x86_fp80 %66
%98 = getelementptr inbounds [3 x x86_fp80], [3 x x86_fp80]* %11, i64 0, i64 2
store x86_fp80 %97, x86_fp80* %98
%99 = call i32 @_to_sphere(x86_fp80* %84, x86_fp80* %4)
%100 = getelementptr inbounds x86_fp80, x86_fp80* %4, i64 2
%101 = call i32 @_to_sphere(x86_fp80* %94, x86_fp80* %100)
%102 = call i64 @euclid_dist(x86_fp80* %16, x86_fp80* %84)
%103 = call i64 @euclid_dist(x86_fp80* %16, x86_fp80* %94)
%104 = icmp sgt i64 %102, %103
br i1 %104, label %105, label %110
105: ; preds = %78
%106 = load x86_fp80, x86_fp80* %4
store x86_fp80 %106, x86_fp80* %100
%107 = getelementptr inbounds x86_fp80, x86_fp80* %4, i64 3
%108 = getelementptr inbounds x86_fp80, x86_fp80* %4, i64 1
%109 = load x86_fp80, x86_fp80* %108
store x86_fp80 %109, x86_fp80* %107
br label %110
110: ; preds = %105, %78
ret i32 1
}