#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 fabs(double);
double nsl_geom_point_point_dist(double, double, double, double);
double nsl_geom_point_line_dist(double x1, double y1, double x2, double y2,
                                double xp, double yp) {
  return fabs((xp - x1) * (y2 - y1) - (x2 - x1) * (yp - y1)) /
         nsl_geom_point_point_dist(x1, y1, x2, y2);
}


x86 assembly (clang, -O0):
<nsl_geom_point_line_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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  -0x28(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm3
subsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movaps 0xe78(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <nsl_geom_point_point_dist@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsl_geom_point_line_dist>:
sub    $0x18,%rsp
subsd  %xmm0,%xmm4
movapd %xmm3,%xmm6
subsd  %xmm1,%xmm6
mulsd  %xmm4,%xmm6
movapd %xmm2,%xmm4
subsd  %xmm0,%xmm4
subsd  %xmm1,%xmm5
mulsd  %xmm4,%xmm5
subsd  %xmm5,%xmm6
andpd  0xec0(%rip),%xmm6
movapd %xmm6,(%rsp)
call   1030 <nsl_geom_point_point_dist@plt>
movapd (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @nsl_geom_point_line_dist(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
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
%13 = load double, double* %11
%14 = load double, double* %7
%15 = fsub double %13, %14
%16 = load double, double* %10
%17 = load double, double* %8
%18 = fsub double %16, %17
%19 = load double, double* %9
%20 = load double, double* %7
%21 = fsub double %19, %20
%22 = load double, double* %12
%23 = load double, double* %8
%24 = fsub double %22, %23
%25 = fmul double %21, %24
%26 = fneg double %25
%27 = call double @llvm.fmuladd.f64(double %15, double %18, double %26)
%28 = call double @llvm.fabs.f64(double %27)
%29 = load double, double* %7
%30 = load double, double* %8
%31 = load double, double* %9
%32 = load double, double* %10
%33 = call double @nsl_geom_point_point_dist(double %29, double %30, double %31, double %32)
%34 = fdiv double %28, %33
ret double %34
}

LLVM IR (-O2):
define double @nsl_geom_point_line_dist(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %4, %0
%8 = fsub double %3, %1
%9 = fsub double %2, %0
%10 = fsub double %5, %1
%11 = fneg double %9
%12 = fmul double %10, %11
%13 = tail call double @llvm.fmuladd.f64(double %7, double %8, double %12)
%14 = tail call double @llvm.fabs.f64(double %13)
%15 = tail call double @nsl_geom_point_point_dist(double %0, double %1, double %2, double %3)
%16 = fdiv double %14, %15
ret double %16
}