#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 *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int /*<<< orphan*/ sqrt(double);
main() {
  int i;
  double j, min, s[9];
  scanf("%lf %lf %lf", s, s + 1, s + 2);
  {
    j = s[0] + s[1] + s[2];
    min = j * j;
    for (i = 0; i < 3; i++)
      if ((j - s[i]) * (j - s[i]) + s[i] * s[i] < min)
        min = (j - s[i]) * (j - s[i]) + s[i] * s[i];
    printf("%lf\n", sqrt(min));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rsi
lea    -0x60(%rbp),%rdx
add    $0x8,%rdx
lea    -0x60(%rbp),%rcx
add    $0x10,%rcx
lea    0xea6(%rip),%rdi
call   1040 <scanf@plt>
movsd  -0x60(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    122e <main+0xfe>
movsd  -0x10(%rbp),%xmm1
movslq -0x8(%rbp),%rax
subsd  -0x60(%rbp,%rax,8),%xmm1
movsd  -0x10(%rbp),%xmm2
movslq -0x8(%rbp),%rax
subsd  -0x60(%rbp,%rax,8),%xmm2
movslq -0x8(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm0
movslq -0x8(%rbp),%rax
mulsd  -0x60(%rbp,%rax,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    121b <main+0xeb>
movsd  -0x10(%rbp),%xmm0
movslq -0x8(%rbp),%rax
subsd  -0x60(%rbp,%rax,8),%xmm0
movsd  -0x10(%rbp),%xmm2
movslq -0x8(%rbp),%rax
subsd  -0x60(%rbp,%rax,8),%xmm2
movslq -0x8(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm1
movslq -0x8(%rbp),%rax
mulsd  -0x60(%rbp,%rax,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1220 <main+0xf0>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1189 <main+0x59>
movsd  -0x18(%rbp),%xmm0
call   1050 <sqrt@plt>
mov    %eax,%esi
lea    0xdcb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xebb(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
movapd %xmm1,%xmm0
addsd  %xmm2,%xmm0
movsd  0x10(%rsp),%xmm3
addsd  %xmm3,%xmm0
movapd %xmm0,%xmm4
mulsd  %xmm0,%xmm4
movapd %xmm0,%xmm5
subsd  %xmm1,%xmm5
mulsd  %xmm1,%xmm1
mulsd  %xmm5,%xmm5
addsd  %xmm1,%xmm5
minsd  %xmm4,%xmm5
movapd %xmm0,%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm2
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
minsd  %xmm5,%xmm1
subsd  %xmm3,%xmm0
mulsd  %xmm3,%xmm3
mulsd  %xmm0,%xmm0
addsd  %xmm3,%xmm0
minsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
lea    0xe4a(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca [9 x double]
store i32 0, i32* %1
%6 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
%7 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
%8 = getelementptr inbounds double, double* %7, i64 1
%9 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
%10 = getelementptr inbounds double, double* %9, i64 2
%11 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %6, double* %8, double* %10)
%12 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
%13 = load double, double* %12
%14 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 1
%15 = load double, double* %14
%16 = fadd double %13, %15
%17 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 2
%18 = load double, double* %17
%19 = fadd double %16, %18
store double %19, double* %3
%20 = load double, double* %3
%21 = load double, double* %3
%22 = fmul double %20, %21
store double %22, double* %4
store i32 0, i32* %2
br label %23
23: ; preds = %75, %0
%24 = load i32, i32* %2
%25 = icmp slt i32 %24, 3
br i1 %25, label %26, label %78
26: ; preds = %23
%27 = load double, double* %3
%28 = load i32, i32* %2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 %29
%31 = load double, double* %30
%32 = fsub double %27, %31
%33 = load double, double* %3
%34 = load i32, i32* %2
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 %35
%37 = load double, double* %36
%38 = fsub double %33, %37
%39 = load i32, i32* %2
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 %40
%42 = load double, double* %41
%43 = load i32, i32* %2
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 %44
%46 = load double, double* %45
%47 = fmul double %42, %46
%48 = call double @llvm.fmuladd.f64(double %32, double %38, double %47)
%49 = load double, double* %4
%50 = fcmp olt double %48, %49
br i1 %50, label %51, label %74
51: ; preds = %26
%52 = load double, double* %3
%53 = load i32, i32* %2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 %54
%56 = load double, double* %55
%57 = fsub double %52, %56
%58 = load double, double* %3
%59 = load i32, i32* %2
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 %60
%62 = load double, double* %61
%63 = fsub double %58, %62
%64 = load i32, i32* %2
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 %65
%67 = load double, double* %66
%68 = load i32, i32* %2
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 %69
%71 = load double, double* %70
%72 = fmul double %67, %71
%73 = call double @llvm.fmuladd.f64(double %57, double %63, double %72)
store double %73, double* %4
br label %74
74: ; preds = %51, %26
br label %75
75: ; preds = %74
%76 = load i32, i32* %2
%77 = add nsw i32 %76, 1
store i32 %77, i32* %2
br label %23
78: ; preds = %23
%79 = load double, double* %4
%80 = call i32 @sqrt(double %79)
%81 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %80)
%82 = load i32, i32* %1
ret i32 %82
}

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