#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 */
float sqrt(float);
float vlength(float x0, float y0, float z0, float x1, float y1, float z1) {
  float X, Y, Z;
  float length;
  X = x0 - x1;
  Y = y0 - y1;
  Z = z0 - z1;
  length = sqrt(X * X + Y * Y + Z * Z);
  return (length);
}


x86 assembly (clang, -O0):
<vlength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlength>:
subss  %xmm3,%xmm0
subss  %xmm4,%xmm1
subss  %xmm5,%xmm2
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm2,%xmm2
addss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm2
jb     1140 <vlength+0x30>
xorps  %xmm0,%xmm0
sqrtss %xmm2,%xmm0
ret
movaps %xmm2,%xmm0
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define float @vlength(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fsub float %0, %3
%8 = fsub float %1, %4
%9 = fsub float %2, %5
%10 = fmul float %8, %8
%11 = tail call float @llvm.fmuladd.f32(float %7, float %7, float %10)
%12 = tail call float @llvm.fmuladd.f32(float %9, float %9, float %11)
%13 = tail call float @sqrt(float %12)
ret float %13
}