#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 asin(double);
double sqrt(double);
double separation(double x1, double y1, double z1, double x2, double y2,
                  double z2) {
  double dx, dy, dz;
  dx = x1 - x2;
  dy = y1 - y2;
  dz = z1 - z2;
  return (57.29577951 * 2. * asin(0.5 * sqrt(dx * dx + dy * dy + dz * dz)));
}


x86 assembly (clang, -O0):
<separation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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  -0x8(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe57(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <asin@plt>
movaps %xmm0,%xmm1
movsd  0xe3b(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<separation>:
push   %rax
subsd  %xmm3,%xmm0
subsd  %xmm4,%xmm1
subsd  %xmm5,%xmm2
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1154 <separation+0x34>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    115d <separation+0x3d>
movapd %xmm2,%xmm0
call   1040 <sqrt@plt>
mulsd  0xe9b(%rip),%xmm0
call   1030 <asin@plt>
mulsd  0xe96(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @separation(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%16 = load double, double* %7
%17 = load double, double* %10
%18 = fsub double %16, %17
store double %18, double* %13
%19 = load double, double* %8
%20 = load double, double* %11
%21 = fsub double %19, %20
store double %21, double* %14
%22 = load double, double* %9
%23 = load double, double* %12
%24 = fsub double %22, %23
store double %24, double* %15
%25 = load double, double* %13
%26 = load double, double* %13
%27 = load double, double* %14
%28 = load double, double* %14
%29 = fmul double %27, %28
%30 = call double @llvm.fmuladd.f64(double %25, double %26, double %29)
%31 = load double, double* %15
%32 = load double, double* %15
%33 = call double @llvm.fmuladd.f64(double %31, double %32, double %30)
%34 = call double @sqrt(double %33)
%35 = fmul double 5.000000e-01, %34
%36 = call double @asin(double %35)
%37 = fmul double 0x405CA5DC1A5D2372, %36
ret double %37
}

LLVM IR (-O2):
define double @separation(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %0, %3
%8 = fsub double %1, %4
%9 = fsub double %2, %5
%10 = fmul double %8, %8
%11 = tail call double @llvm.fmuladd.f64(double %7, double %7, double %10)
%12 = tail call double @llvm.fmuladd.f64(double %9, double %9, double %11)
%13 = tail call double @sqrt(double %12)
%14 = fmul double %13, 5.000000e-01
%15 = tail call double @asin(double %14)
%16 = fmul double %15, 0x405CA5DC1A5D2372
ret double %16
}