#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 sqrt(double);
double forward_oop_cos_low(double *delta0, double *delta1, double *delta2) {
  double n[3];
  double n_sq, tmp0, tmp1;
  n[0] = delta0[1] * delta1[2] - delta0[2] * delta1[1];
  n[1] = delta0[2] * delta1[0] - delta0[0] * delta1[2];
  n[2] = delta0[0] * delta1[1] - delta0[1] * delta1[0];
  n_sq = n[0] * n[0] + n[1] * n[1] + n[2] * n[2];
  tmp0 = delta2[0] * delta2[0] + delta2[1] * delta2[1] + delta2[2] * delta2[2];
  tmp1 = n[0] * delta2[0] + n[1] * delta2[1] + n[2] * delta2[2];
  return sqrt(1.0 - tmp1 * tmp1 / tmp0 / n_sq);
}


x86 assembly (clang, -O0):
<forward_oop_cos_low>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
divsd  -0x40(%rbp),%xmm1
divsd  -0x38(%rbp),%xmm1
movsd  0xd32(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forward_oop_cos_low>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm3
movsd  0x10(%rsi),%xmm4
movsd  0x10(%rdi),%xmm0
movsd  (%rsi),%xmm5
movsd  0x8(%rsi),%xmm6
movapd %xmm3,%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm1,%xmm4
mulsd  %xmm6,%xmm1
mulsd  %xmm0,%xmm6
subsd  %xmm6,%xmm2
mulsd  %xmm5,%xmm0
subsd  %xmm4,%xmm0
mulsd  %xmm3,%xmm5
subsd  %xmm5,%xmm1
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
movapd %xmm2,%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm3,%xmm4
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm4,%xmm3
movsd  (%rdx),%xmm4
movsd  0x8(%rdx),%xmm5
mulsd  %xmm5,%xmm0
mulsd  %xmm5,%xmm5
mulsd  %xmm4,%xmm2
mulsd  %xmm4,%xmm4
addsd  %xmm5,%xmm4
movsd  0x10(%rdx),%xmm5
mulsd  %xmm5,%xmm1
mulsd  %xmm5,%xmm5
addsd  %xmm4,%xmm5
addsd  %xmm2,%xmm0
addsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm1
divsd  %xmm5,%xmm1
divsd  %xmm3,%xmm1
movsd  0xe42(%rip),%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11d1 <forward_oop_cos_low+0xc1>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @forward_oop_cos_low(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [3 x double]
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 2
%16 = load double, double* %15
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = fmul double %19, %22
%24 = fneg double %23
%25 = call double @llvm.fmuladd.f64(double %13, double %16, double %24)
%26 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
store double %25, double* %26
%27 = load double*, double** %4
%28 = getelementptr inbounds double, double* %27, i64 2
%29 = load double, double* %28
%30 = load double*, double** %5
%31 = getelementptr inbounds double, double* %30, i64 0
%32 = load double, double* %31
%33 = load double*, double** %4
%34 = getelementptr inbounds double, double* %33, i64 0
%35 = load double, double* %34
%36 = load double*, double** %5
%37 = getelementptr inbounds double, double* %36, i64 2
%38 = load double, double* %37
%39 = fmul double %35, %38
%40 = fneg double %39
%41 = call double @llvm.fmuladd.f64(double %29, double %32, double %40)
%42 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
store double %41, double* %42
%43 = load double*, double** %4
%44 = getelementptr inbounds double, double* %43, i64 0
%45 = load double, double* %44
%46 = load double*, double** %5
%47 = getelementptr inbounds double, double* %46, i64 1
%48 = load double, double* %47
%49 = load double*, double** %4
%50 = getelementptr inbounds double, double* %49, i64 1
%51 = load double, double* %50
%52 = load double*, double** %5
%53 = getelementptr inbounds double, double* %52, i64 0
%54 = load double, double* %53
%55 = fmul double %51, %54
%56 = fneg double %55
%57 = call double @llvm.fmuladd.f64(double %45, double %48, double %56)
%58 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
store double %57, double* %58
%59 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%60 = load double, double* %59
%61 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%62 = load double, double* %61
%63 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%64 = load double, double* %63
%65 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%66 = load double, double* %65
%67 = fmul double %64, %66
%68 = call double @llvm.fmuladd.f64(double %60, double %62, double %67)
%69 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%70 = load double, double* %69
%71 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%72 = load double, double* %71
%73 = call double @llvm.fmuladd.f64(double %70, double %72, double %68)
store double %73, double* %8
%74 = load double*, double** %6
%75 = getelementptr inbounds double, double* %74, i64 0
%76 = load double, double* %75
%77 = load double*, double** %6
%78 = getelementptr inbounds double, double* %77, i64 0
%79 = load double, double* %78
%80 = load double*, double** %6
%81 = getelementptr inbounds double, double* %80, i64 1
%82 = load double, double* %81
%83 = load double*, double** %6
%84 = getelementptr inbounds double, double* %83, i64 1
%85 = load double, double* %84
%86 = fmul double %82, %85
%87 = call double @llvm.fmuladd.f64(double %76, double %79, double %86)
%88 = load double*, double** %6
%89 = getelementptr inbounds double, double* %88, i64 2
%90 = load double, double* %89
%91 = load double*, double** %6
%92 = getelementptr inbounds double, double* %91, i64 2
%93 = load double, double* %92
%94 = call double @llvm.fmuladd.f64(double %90, double %93, double %87)
store double %94, double* %9
%95 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%96 = load double, double* %95
%97 = load double*, double** %6
%98 = getelementptr inbounds double, double* %97, i64 0
%99 = load double, double* %98
%100 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
%101 = load double, double* %100
%102 = load double*, double** %6
%103 = getelementptr inbounds double, double* %102, i64 1
%104 = load double, double* %103
%105 = fmul double %101, %104
%106 = call double @llvm.fmuladd.f64(double %96, double %99, double %105)
%107 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
%108 = load double, double* %107
%109 = load double*, double** %6
%110 = getelementptr inbounds double, double* %109, i64 2
%111 = load double, double* %110
%112 = call double @llvm.fmuladd.f64(double %108, double %111, double %106)
store double %112, double* %10
%113 = load double, double* %10
%114 = load double, double* %10
%115 = fmul double %113, %114
%116 = load double, double* %9
%117 = fdiv double %115, %116
%118 = load double, double* %8
%119 = fdiv double %117, %118
%120 = fsub double 1.000000e+00, %119
%121 = call double @sqrt(double %120)
ret double %121
}

LLVM IR (-O2):
define double @forward_oop_cos_low(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %1, i64 2
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 2
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %1, i64 1
%11 = load double, double* %10
%12 = fneg double %9
%13 = fmul double %11, %12
%14 = tail call double @llvm.fmuladd.f64(double %5, double %7, double %13)
%15 = load double, double* %1
%16 = load double, double* %0
%17 = fneg double %16
%18 = fmul double %7, %17
%19 = tail call double @llvm.fmuladd.f64(double %9, double %15, double %18)
%20 = fneg double %5
%21 = fmul double %15, %20
%22 = tail call double @llvm.fmuladd.f64(double %16, double %11, double %21)
%23 = fmul double %19, %19
%24 = tail call double @llvm.fmuladd.f64(double %14, double %14, double %23)
%25 = tail call double @llvm.fmuladd.f64(double %22, double %22, double %24)
%26 = load double, double* %2
%27 = getelementptr inbounds double, double* %2, i64 1
%28 = load double, double* %27
%29 = fmul double %28, %28
%30 = tail call double @llvm.fmuladd.f64(double %26, double %26, double %29)
%31 = getelementptr inbounds double, double* %2, i64 2
%32 = load double, double* %31
%33 = tail call double @llvm.fmuladd.f64(double %32, double %32, double %30)
%34 = fmul double %19, %28
%35 = tail call double @llvm.fmuladd.f64(double %14, double %26, double %34)
%36 = tail call double @llvm.fmuladd.f64(double %22, double %32, double %35)
%37 = fmul double %36, %36
%38 = fdiv double %37, %33
%39 = fdiv double %38, %25
%40 = fsub double 1.000000e+00, %39
%41 = tail call double @sqrt(double %40)
ret double %41
}