#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__ EOF;
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, double *, double *, double *, double *);
double sqrt(double);
int main() {
  double x1, y1, x2, y2, distance;
  while (EOF != scanf("%lf%lf%lf%lf", &x1, &y1, &x2, &y2)) {
    distance = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
    printf("%.2lf\n", distance);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
lea    0xeac(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1040 <scanf@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
cmp    %rcx,%rax
je     11cd <main+0x9d>
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm3
subsd  -0x18(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0x2ea3(%rip),%rax
mov    (%rax),%rbx
lea    0xeb9(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <scanf@plt>
cmp    %rax,%rbx
jne    117e <main+0x4e>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe83(%rip),%r15
lea    0x20(%rsp),%r12
lea    0x18(%rsp),%r13
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rbp
jmp    11d4 <main+0xa4>
nopl   0x0(%rax,%rax,1)
call   1050 <sqrt@plt>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e30(%rip),%rax
mov    (%rax),%r14
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
mov    %rbp,%r8
call   1040 <scanf@plt>
cmp    %rax,%r14
je     116d <main+0x3d>
movsd  0x10(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  0x18(%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xe00(%rip),%xmm0
jb     11a0 <main+0x70>
sqrtsd %xmm0,%xmm0
jmp    11a5 <main+0x75>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [13 x i8] c"%lf%lf%lf%lf\00"
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
br label %7
7: ; preds = %11, %0
%8 = load i64, i64* @EOF
%9 = call i64 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, double* %4, double* %5)
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %29
11: ; preds = %7
%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 = load double, double* %5
%19 = load double, double* %3
%20 = fsub double %18, %19
%21 = load double, double* %5
%22 = load double, double* %3
%23 = fsub double %21, %22
%24 = fmul double %20, %23
%25 = call double @llvm.fmuladd.f64(double %14, double %17, double %24)
%26 = call double @sqrt(double %25)
store double %26, double* %6
%27 = load double, double* %6
%28 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %27)
br label %7
29: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [13 x i8] c"%lf%lf%lf%lf\00"
@.str.1 = [7 x i8] c"%.2lf\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 = load i64, i64* @EOF
%10 = call i64 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3, double* %4)
%11 = icmp eq i64 %9, %10
br i1 %11, label %26, label %12
12: ; preds = %0, %12
%13 = load double, double* %3
%14 = load double, double* %1
%15 = fsub double %13, %14
%16 = load double, double* %4
%17 = load double, double* %2
%18 = fsub double %16, %17
%19 = fmul double %18, %18
%20 = call double @llvm.fmuladd.f64(double %15, double %15, double %19)
%21 = call double @sqrt(double %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %21)
%23 = load i64, i64* @EOF
%24 = call i64 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3, double* %4)
%25 = icmp eq i64 %23, %24
br i1 %25, label %26, label %12
26: ; preds = %12, %0
ret i32 0
}