#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 */
double circleSphereIntersection(double, double, double, double, double, double,
                                double, double, double, double, double, double,
                                double, double);
double calcAngle(double x0, double y0, double z0, double x1, double y1,
                 double z1, double dm, double lm, double le, double la,
                 double nx, double ny, double nz, double ux, double uy,
                 double uz, double t) {
  double ex = (1 - t) * x0 + t * x1;
  double ey = (1 - t) * y0 + t * y1;
  double ez = (1 - t) * z0 + t * z1;
  return circleSphereIntersection(
      ux * dm / 2., uy * dm / 2., uz * dm / 2., lm, nx, ny, nz,
      ex + ux * le / 2., ey + uy * le / 2., ez + uz * le / 2., la, ux, uy, uz);
}


x86 assembly (clang, -O0):
<calcAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  0x50(%rbp),%xmm8
movsd  0x48(%rbp),%xmm8
movsd  0x40(%rbp),%xmm8
movsd  0x38(%rbp),%xmm8
movsd  0x30(%rbp),%xmm8
movsd  0x28(%rbp),%xmm8
movsd  0x20(%rbp),%xmm8
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
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)
movsd  0xe87(%rip),%xmm0
subsd  0x50(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0x50(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe5e(%rip),%xmm0
subsd  0x50(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0x50(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe35(%rip),%xmm0
subsd  0x50(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0x50(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  0xdfa(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x40(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
movsd  0xde4(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0x48(%rbp),%xmm2
mulsd  -0x38(%rbp),%xmm2
movsd  0xdce(%rip),%xmm3
divsd  %xmm3,%xmm2
movsd  -0x40(%rbp),%xmm3
movsd  0x20(%rbp),%xmm4
movsd  0x28(%rbp),%xmm5
movsd  0x30(%rbp),%xmm6
movsd  -0x48(%rbp),%xmm7
movsd  0x38(%rbp),%xmm8
mulsd  0x10(%rbp),%xmm8
movsd  0xd9c(%rip),%xmm9
divsd  %xmm9,%xmm8
addsd  %xmm8,%xmm7
movsd  -0x50(%rbp),%xmm13
movsd  0x40(%rbp),%xmm8
mulsd  0x10(%rbp),%xmm8
movsd  0xd77(%rip),%xmm9
divsd  %xmm9,%xmm8
addsd  %xmm8,%xmm13
movsd  -0x58(%rbp),%xmm12
movsd  0x48(%rbp),%xmm8
mulsd  0x10(%rbp),%xmm8
movsd  0xd52(%rip),%xmm9
divsd  %xmm9,%xmm8
addsd  %xmm8,%xmm12
movsd  0x18(%rbp),%xmm11
movsd  0x38(%rbp),%xmm10
movsd  0x40(%rbp),%xmm9
movsd  0x48(%rbp),%xmm8
movsd  %xmm13,(%rsp)
movsd  %xmm12,0x8(%rsp)
movsd  %xmm11,0x10(%rsp)
movsd  %xmm10,0x18(%rsp)
movsd  %xmm9,0x20(%rsp)
movsd  %xmm8,0x28(%rsp)
call   1030 <circleSphereIntersection@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcAngle>:
sub    $0x38,%rsp
movaps %xmm7,%xmm8
movapd %xmm6,%xmm10
movapd %xmm5,%xmm9
movapd %xmm4,%xmm7
movsd  0x50(%rsp),%xmm4
movsd  0x58(%rsp),%xmm5
movsd  0x40(%rsp),%xmm11
movsd  0x78(%rsp),%xmm12
movsd  0x80(%rsp),%xmm6
movsd  0xeae(%rip),%xmm13
subsd  %xmm6,%xmm13
mulsd  %xmm6,%xmm3
mulsd  %xmm13,%xmm0
addsd  %xmm3,%xmm0
movsd  0x70(%rsp),%xmm14
mulsd  %xmm6,%xmm7
mulsd  %xmm13,%xmm1
addsd  %xmm7,%xmm1
movsd  0x68(%rsp),%xmm15
mulsd  %xmm6,%xmm9
mulsd  %xmm2,%xmm13
addsd  %xmm9,%xmm13
movapd %xmm10,%xmm2
mulsd  %xmm15,%xmm2
movsd  0xe68(%rip),%xmm6
mulsd  %xmm6,%xmm2
movapd %xmm11,%xmm7
mulsd  %xmm15,%xmm7
mulsd  %xmm6,%xmm7
addsd  %xmm0,%xmm7
movapd %xmm11,%xmm0
mulsd  %xmm14,%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm10,%xmm1
mulsd  %xmm14,%xmm1
mulsd  %xmm6,%xmm1
mulsd  %xmm12,%xmm10
mulsd  %xmm6,%xmm10
mulsd  %xmm12,%xmm11
mulsd  %xmm6,%xmm11
movsd  0x60(%rsp),%xmm6
addsd  %xmm13,%xmm11
movsd  0x48(%rsp),%xmm3
movsd  %xmm12,0x28(%rsp)
movsd  %xmm14,0x20(%rsp)
movsd  %xmm15,0x18(%rsp)
movsd  %xmm3,0x10(%rsp)
movsd  %xmm11,0x8(%rsp)
movsd  %xmm0,(%rsp)
movapd %xmm2,%xmm0
movapd %xmm10,%xmm2
movaps %xmm8,%xmm3
call   1030 <circleSphereIntersection@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @calcAngle(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11, double %12, double %13, double %14, double %15, double %16) {
%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
%35 = alloca double
%36 = alloca double
%37 = alloca double
store double %0, double* %18
store double %1, double* %19
store double %2, double* %20
store double %3, double* %21
store double %4, double* %22
store double %5, double* %23
store double %6, double* %24
store double %7, double* %25
store double %8, double* %26
store double %9, double* %27
store double %10, double* %28
store double %11, double* %29
store double %12, double* %30
store double %13, double* %31
store double %14, double* %32
store double %15, double* %33
store double %16, double* %34
%38 = load double, double* %34
%39 = fsub double 1.000000e+00, %38
%40 = load double, double* %18
%41 = load double, double* %34
%42 = load double, double* %21
%43 = fmul double %41, %42
%44 = call double @llvm.fmuladd.f64(double %39, double %40, double %43)
store double %44, double* %35
%45 = load double, double* %34
%46 = fsub double 1.000000e+00, %45
%47 = load double, double* %19
%48 = load double, double* %34
%49 = load double, double* %22
%50 = fmul double %48, %49
%51 = call double @llvm.fmuladd.f64(double %46, double %47, double %50)
store double %51, double* %36
%52 = load double, double* %34
%53 = fsub double 1.000000e+00, %52
%54 = load double, double* %20
%55 = load double, double* %34
%56 = load double, double* %23
%57 = fmul double %55, %56
%58 = call double @llvm.fmuladd.f64(double %53, double %54, double %57)
store double %58, double* %37
%59 = load double, double* %31
%60 = load double, double* %24
%61 = fmul double %59, %60
%62 = fdiv double %61, 2.000000e+00
%63 = load double, double* %32
%64 = load double, double* %24
%65 = fmul double %63, %64
%66 = fdiv double %65, 2.000000e+00
%67 = load double, double* %33
%68 = load double, double* %24
%69 = fmul double %67, %68
%70 = fdiv double %69, 2.000000e+00
%71 = load double, double* %25
%72 = load double, double* %28
%73 = load double, double* %29
%74 = load double, double* %30
%75 = load double, double* %35
%76 = load double, double* %31
%77 = load double, double* %26
%78 = fmul double %76, %77
%79 = fdiv double %78, 2.000000e+00
%80 = fadd double %75, %79
%81 = load double, double* %36
%82 = load double, double* %32
%83 = load double, double* %26
%84 = fmul double %82, %83
%85 = fdiv double %84, 2.000000e+00
%86 = fadd double %81, %85
%87 = load double, double* %37
%88 = load double, double* %33
%89 = load double, double* %26
%90 = fmul double %88, %89
%91 = fdiv double %90, 2.000000e+00
%92 = fadd double %87, %91
%93 = load double, double* %27
%94 = load double, double* %31
%95 = load double, double* %32
%96 = load double, double* %33
%97 = call double @circleSphereIntersection(double %62, double %66, double %70, double %71, double %72, double %73, double %74, double %80, double %86, double %92, double %93, double %94, double %95, double %96)
ret double %97
}

LLVM IR (-O2):
define double @calcAngle(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11, double %12, double %13, double %14, double %15, double %16) {
%18 = fsub double 1.000000e+00, %16
%19 = fmul double %3, %16
%20 = tail call double @llvm.fmuladd.f64(double %18, double %0, double %19)
%21 = fmul double %4, %16
%22 = tail call double @llvm.fmuladd.f64(double %18, double %1, double %21)
%23 = fmul double %5, %16
%24 = tail call double @llvm.fmuladd.f64(double %18, double %2, double %23)
%25 = fmul double %6, %13
%26 = fmul double %25, 5.000000e-01
%27 = fmul double %6, %14
%28 = fmul double %27, 5.000000e-01
%29 = fmul double %6, %15
%30 = fmul double %29, 5.000000e-01
%31 = fmul double %8, %13
%32 = fmul double %31, 5.000000e-01
%33 = fadd double %32, %20
%34 = fmul double %8, %14
%35 = fmul double %34, 5.000000e-01
%36 = fadd double %35, %22
%37 = fmul double %8, %15
%38 = fmul double %37, 5.000000e-01
%39 = fadd double %38, %24
%40 = tail call double @circleSphereIntersection(double %26, double %28, double %30, double %7, double %10, double %11, double %12, double %33, double %36, double %39, double %9, double %13, double %14, double %15)
ret double %40
}