#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 pow(float, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, float *, float *, float *, float *);
int /*<<< orphan*/ sqrt(double);
int main() {
  float x1, x2, y1, y2;
  scanf("%f %f %f %f", &x1, &y1, &x2, &y2);
  double xdist = pow((x2 - x1), 2);
  double ydist = pow((y2 - y1), 2);
  printf("%.4lf\n", sqrt((xdist + ydist)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
call   1060 <sqrt@plt>
mov    %eax,%esi
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeb5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rsp,%r8
call   1040 <scanf@plt>
movss  0x8(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  %xmm0,0x10(%rsp)
movss  (%rsp),%xmm0
subss  0x4(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
addsd  0x10(%rsp),%xmm0
call   1060 <sqrt@plt>
lea    0xe67(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%f %f %f %f\00"
@.str.1 = [7 x i8] c"%.4lf\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %1 to i8*
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float* %1, float* %3, float* %2, float* %4)
%10 = load float, float* %2
%11 = load float, float* %1
%12 = fsub float %10, %11
%13 = call double @pow(float %12, i32 2)
%14 = load float, float* %4
%15 = load float, float* %3
%16 = fsub float %14, %15
%17 = call double @pow(float %16, i32 2)
%18 = fadd double %13, %17
%19 = call i32 @sqrt(double %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %19)
ret i32 0
}