#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__ powl(long double, int);
long double sqrtl(scalar_t__);
long double euclid_dist(long double *a, long double *b) {
  return sqrtl(powl(a[0] - b[0], 2) + powl(a[1] - b[1], 2) +
               powl(a[2] - b[2], 2));
}


x86 assembly (clang, -O0):
<euclid_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fsubrp %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0x2,%edi
mov    %edi,-0x24(%rbp)
call   1030 <powl@plt>
mov    -0x24(%rbp),%edi
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   0x10(%rax)
mov    -0x10(%rbp),%rax
fldt   0x10(%rax)
fsubrp %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <powl@plt>
mov    -0x24(%rbp),%edi
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
fldt   0x20(%rax)
mov    -0x10(%rbp),%rax
fldt   0x20(%rax)
fsubrp %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <powl@plt>
mov    -0x18(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrtl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclid_dist>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
fldt   (%rdi)
fldt   (%rsi)
fsubrp %st,%st(1)
fstpt  (%rsp)
mov    $0x2,%edi
call   1030 <powl@plt>
mov    %rax,%rbx
fldt   0x10(%r15)
fldt   0x10(%r14)
fsubrp %st,%st(1)
fstpt  (%rsp)
mov    $0x2,%edi
call   1030 <powl@plt>
add    %rax,%rbx
fldt   0x20(%r15)
fldt   0x20(%r14)
fsubrp %st,%st(1)
fstpt  (%rsp)
mov    $0x2,%edi
call   1030 <powl@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <sqrtl@plt>

LLVM IR (-O0):
define x86_fp80 @euclid_dist(x86_fp80* %0, x86_fp80* %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = getelementptr inbounds x86_fp80, x86_fp80* %5, i64 0
%7 = load x86_fp80, x86_fp80* %6
%8 = load x86_fp80*, x86_fp80** %4
%9 = getelementptr inbounds x86_fp80, x86_fp80* %8, i64 0
%10 = load x86_fp80, x86_fp80* %9
%11 = fsub x86_fp80 %7, %10
%12 = call i64 @powl(x86_fp80 %11, i32 2)
%13 = load x86_fp80*, x86_fp80** %3
%14 = getelementptr inbounds x86_fp80, x86_fp80* %13, i64 1
%15 = load x86_fp80, x86_fp80* %14
%16 = load x86_fp80*, x86_fp80** %4
%17 = getelementptr inbounds x86_fp80, x86_fp80* %16, i64 1
%18 = load x86_fp80, x86_fp80* %17
%19 = fsub x86_fp80 %15, %18
%20 = call i64 @powl(x86_fp80 %19, i32 2)
%21 = add nsw i64 %12, %20
%22 = load x86_fp80*, x86_fp80** %3
%23 = getelementptr inbounds x86_fp80, x86_fp80* %22, i64 2
%24 = load x86_fp80, x86_fp80* %23
%25 = load x86_fp80*, x86_fp80** %4
%26 = getelementptr inbounds x86_fp80, x86_fp80* %25, i64 2
%27 = load x86_fp80, x86_fp80* %26
%28 = fsub x86_fp80 %24, %27
%29 = call i64 @powl(x86_fp80 %28, i32 2)
%30 = add nsw i64 %21, %29
%31 = call x86_fp80 @sqrtl(i64 %30)
ret x86_fp80 %31
}

LLVM IR (-O2):
define x86_fp80 @euclid_dist(x86_fp80* nocapture %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = load x86_fp80, x86_fp80* %1
%5 = fsub x86_fp80 %3, %4
%6 = tail call i64 @powl(x86_fp80 %5, i32 2)
%7 = getelementptr inbounds x86_fp80, x86_fp80* %0, i64 1
%8 = load x86_fp80, x86_fp80* %7
%9 = getelementptr inbounds x86_fp80, x86_fp80* %1, i64 1
%10 = load x86_fp80, x86_fp80* %9
%11 = fsub x86_fp80 %8, %10
%12 = tail call i64 @powl(x86_fp80 %11, i32 2)
%13 = add nsw i64 %12, %6
%14 = getelementptr inbounds x86_fp80, x86_fp80* %0, i64 2
%15 = load x86_fp80, x86_fp80* %14
%16 = getelementptr inbounds x86_fp80, x86_fp80* %1, i64 2
%17 = load x86_fp80, x86_fp80* %16
%18 = fsub x86_fp80 %15, %17
%19 = tail call i64 @powl(x86_fp80 %18, i32 2)
%20 = add nsw i64 %13, %19
%21 = tail call x86_fp80 @sqrtl(i64 %20)
ret x86_fp80 %21
}