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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
lea    0xea6(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
subss  -0x8(%rbp),%xmm2
movss  -0x14(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm3
subss  -0x10(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x8(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
movss  (%rsp),%xmm1
subss  0x4(%rsp),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     118f <main+0x5f>
sqrtss %xmm0,%xmm0
jmp    1194 <main+0x64>
call   1050 <sqrt@plt>
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [6 x i8] c"%.4f\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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %3)
%10 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %2, float* %4)
%11 = load float, float* %2
%12 = load float, float* %1
%13 = fsub float %11, %12
%14 = load float, float* %4
%15 = load float, float* %3
%16 = fsub float %14, %15
%17 = fmul float %16, %16
%18 = call float @llvm.fmuladd.f32(float %13, float %13, float %17)
%19 = call float @sqrt(float %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float %19)
ret i32 0
}