#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, float, float, float);
int /*<<< orphan*/ scanf(char *, float *, float *, float *);
float sqrt(float);
int main() {
  float a, b, c;
  scanf("%f %f %f", &a, &b, &c);
  float sum, mean, squ, sqroot;
  sum = a + b + c;
  mean = sum / 3.0;
  squ = a * a + b * b + c * c;
  sqroot = sqrt(squ);
  printf("%f,%f,%f,%f\n", sum, mean, squ, sqroot);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm3
movaps %xmm0,%xmm4
addss  %xmm3,%xmm4
movss  0xc(%rsp),%xmm2
addss  %xmm2,%xmm4
movaps %xmm4,%xmm1
divss  0xe89(%rip),%xmm1
mulss  %xmm3,%xmm3
mulss  %xmm0,%xmm0
addss  %xmm3,%xmm0
mulss  %xmm2,%xmm2
addss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm2
jb     119c <main+0x6c>
xorps  %xmm3,%xmm3
sqrtss %xmm2,%xmm3
jmp    11c9 <main+0x99>
movaps %xmm2,%xmm0
movss  %xmm4,0x8(%rsp)
movss  %xmm2,0x4(%rsp)
movss  %xmm1,(%rsp)
call   1050 <sqrt@plt>
movss  (%rsp),%xmm1
movss  0x4(%rsp),%xmm2
movss  0x8(%rsp),%xmm4
movaps %xmm0,%xmm3
lea    0xe3d(%rip),%rdi
movaps %xmm4,%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

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