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


x86 assembly (clang, -O0):
<euclid_dist2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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,-0x1c(%rbp)
call   1030 <powl@plt>
mov    -0x1c(%rbp),%edi
mov    %rax,-0x18(%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    -0x18(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrtl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclid_dist2d>:
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
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <sqrtl@plt>

LLVM IR (-O0):
define x86_fp80 @euclid_dist2d(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 = call x86_fp80 @sqrtl(i64 %21)
ret x86_fp80 %22
}

LLVM IR (-O2):
define x86_fp80 @euclid_dist2d(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 = tail call x86_fp80 @sqrtl(i64 %13)
ret x86_fp80 %14
}