#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 */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
double sqrt(double);
int main() {
  double x1, y1, x2, y2, d1, d2, sum, result;
  scanf("%lf%lf", &x1, &y1);
  scanf("%lf%lf", &x2, &y2);
  d1 = ((x2 - x1) * (x2 - x1));
  d2 = ((y2 - y1) * (y2 - y1));
  sum = (d1 + d2);
  result = sqrt(sum);
  printf("%0.4lf\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
lea    0xea6(%rip),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rbx
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm1
movhpd (%rsp),%xmm1
movsd  0x18(%rsp),%xmm0
movhpd 0x10(%rsp),%xmm0
subpd  %xmm0,%xmm1
mulpd  %xmm1,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1199 <main+0x69>
sqrtsd %xmm0,%xmm0
jmp    119e <main+0x6e>
call   1050 <sqrt@plt>
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%lf%lf\00"
@.str.1 = [8 x i8] c"%0.4lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 0, i32* %1
%10 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%11 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double* %4, double* %5)
%12 = load double, double* %4
%13 = load double, double* %2
%14 = fsub double %12, %13
%15 = load double, double* %4
%16 = load double, double* %2
%17 = fsub double %15, %16
%18 = fmul double %14, %17
store double %18, double* %6
%19 = load double, double* %5
%20 = load double, double* %3
%21 = fsub double %19, %20
%22 = load double, double* %5
%23 = load double, double* %3
%24 = fsub double %22, %23
%25 = fmul double %21, %24
store double %25, double* %7
%26 = load double, double* %6
%27 = load double, double* %7
%28 = fadd double %26, %27
store double %28, double* %8
%29 = load double, double* %8
%30 = call double @sqrt(double %29)
store double %30, double* %9
%31 = load double, double* %9
%32 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%lf%lf\00"
@.str.1 = [8 x i8] c"%0.4lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %1 to i8*
%6 = bitcast double* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = bitcast double* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%10 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double* %3, double* %4)
%11 = load double, double* %3
%12 = load double, double* %1
%13 = load double, double* %4
%14 = load double, double* %2
%15 = insertelement <2 x double> poison, double %11, i64 0
%16 = insertelement <2 x double> %15, double %13, i64 1
%17 = insertelement <2 x double> poison, double %12, i64 0
%18 = insertelement <2 x double> %17, double %14, i64 1
%19 = fsub <2 x double> %16, %18
%20 = fmul <2 x double> %19, %19
%21 = shufflevector <2 x double> %20, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%22 = fadd <2 x double> %20, %21
%23 = extractelement <2 x double> %22, i64 0
%24 = call double @sqrt(double %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %24)
ret i32 0
}