#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 */
scalar_t__ sqrt(float);
float mvVecDistanceBetween3(const float *a, const float *b) {
  float tmp1 = a[0] - b[0];
  float tmp2 = a[1] - b[1];
  float tmp3 = a[2] - b[2];
  return (float)sqrt((tmp1 * tmp1) + (tmp2 * tmp2) + (tmp3 * tmp3));
}


x86 assembly (clang, -O0):
<mvVecDistanceBetween3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x8(%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvVecDistanceBetween3>:
push   %rax
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm2
subss  (%rsi),%xmm1
subss  0x4(%rsi),%xmm2
movss  0x8(%rdi),%xmm0
subss  0x8(%rsi),%xmm0
mulss  %xmm2,%xmm2
mulss  %xmm1,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @mvVecDistanceBetween3(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fsub float %3, %4
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = fsub float %7, %9
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = fsub float %12, %14
%16 = fmul float %10, %10
%17 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %16)
%18 = tail call float @llvm.fmuladd.f32(float %15, float %15, float %17)
%19 = tail call i64 @sqrt(float %18)
%20 = sitofp i64 %19 to float
ret float %20
}