#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*/ scanf(char *, float *, float *, float *);
float sqrt(float);
int main(void) {
  float a, b, c, s, area;
  printf("Please Input 3 float number:");
  scanf("%f,%f,%f", &a, &b, &c);
  s = 1.0 / 2 * (a + b + c);
  area = sqrt(s * (s - a) * (s - b) * (s - c));
  printf("a=%7.2f,b=%7.2f,c=%7.2f,s=%7.2f\n", a, b, c, s);
  printf("area=%7.2f\n", area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%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
cvtss2sd %xmm0,%xmm1
movsd  0xe80(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
subss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x14(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xe3d(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe47(%rip),%rdi
mov    $0x1,%al
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
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <scanf@plt>
movss  0x10(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
movaps %xmm0,%xmm5
addss  %xmm1,%xmm5
movss  0x8(%rsp),%xmm2
addss  %xmm2,%xmm5
mulss  0xe7e(%rip),%xmm5
movaps %xmm5,%xmm3
subss  %xmm0,%xmm3
mulss  %xmm5,%xmm3
movaps %xmm5,%xmm4
subss  %xmm1,%xmm4
mulss  %xmm3,%xmm4
movaps %xmm5,%xmm0
subss  %xmm2,%xmm0
mulss  %xmm4,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     11b1 <main+0x81>
sqrtss %xmm0,%xmm0
jmp    11c2 <main+0x92>
movss  %xmm5,0x14(%rsp)
call   1050 <sqrt@plt>
movss  0x14(%rsp),%xmm5
movss  %xmm0,0x4(%rsp)
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x8(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
xorps  %xmm3,%xmm3
cvtss2sd %xmm5,%xmm3
lea    0xe36(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Please Input 3 float number:\00"
@.str.1 = [9 x i8] c"%f,%f,%f\00"
@.str.2 = [33 x i8] c"a=%7.2f,b=%7.2f,c=%7.2f,s=%7.2f\0A\00"
@.str.3 = [12 x i8] c"area=%7.2f\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 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, float* %4)
%9 = load float, float* %2
%10 = load float, float* %3
%11 = fadd float %9, %10
%12 = load float, float* %4
%13 = fadd float %11, %12
%14 = fpext float %13 to double
%15 = fmul double 5.000000e-01, %14
%16 = fptrunc double %15 to float
store float %16, float* %5
%17 = load float, float* %5
%18 = load float, float* %5
%19 = load float, float* %2
%20 = fsub float %18, %19
%21 = fmul float %17, %20
%22 = load float, float* %5
%23 = load float, float* %3
%24 = fsub float %22, %23
%25 = fmul float %21, %24
%26 = load float, float* %5
%27 = load float, float* %4
%28 = fsub float %26, %27
%29 = fmul float %25, %28
%30 = call float @sqrt(float %29)
store float %30, float* %6
%31 = load float, float* %2
%32 = fpext float %31 to double
%33 = load float, float* %3
%34 = fpext float %33 to double
%35 = load float, float* %4
%36 = fpext float %35 to double
%37 = load float, float* %5
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), double %32, double %34, double %36, double %38)
%40 = load float, float* %6
%41 = fpext float %40 to double
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), double %41)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Please Input 3 float number:\00"
@.str.1 = [9 x i8] c"%f,%f,%f\00"
@.str.2 = [33 x i8] c"a=%7.2f,b=%7.2f,c=%7.2f,s=%7.2f\0A\00"
@.str.3 = [12 x i8] c"area=%7.2f\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 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, float* %3)
%9 = load float, float* %1
%10 = load float, float* %2
%11 = fadd float %9, %10
%12 = load float, float* %3
%13 = fadd float %11, %12
%14 = fmul float %13, 5.000000e-01
%15 = fsub float %14, %9
%16 = fmul float %14, %15
%17 = fsub float %14, %10
%18 = fmul float %17, %16
%19 = fsub float %14, %12
%20 = fmul float %19, %18
%21 = call float @sqrt(float %20)
%22 = load float, float* %1
%23 = fpext float %22 to double
%24 = load float, float* %2
%25 = fpext float %24 to double
%26 = load float, float* %3
%27 = fpext float %26 to double
%28 = fpext float %14 to double
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), double %23, double %25, double %27, double %28)
%30 = fpext float %21 to double
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), double %30)
ret i32 0
}