#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 *, double, ...);
double sqrt(double);
int main(void) {
  double a, b, c, s, area;
  a = 3.67;
  b = 5.43;
  c = 6.21;
  s = (a + b + c) / 2;
  area = sqrt(s * (s - a) * (s - b) * (s - c));
  printf("a=%f\tb=%f\tc=%f\n", a, b, c);
  printf("area=%f\n", area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb7(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  0xe93(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xe5b(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xe58(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf08(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
movsd  0xee0(%rip),%xmm2
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
movsd  0xed2(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"a=%f\09b=%f\09c=%f\0A\00"
@.str.1 = [9 x i8] c"area=%f\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
store double 3.670000e+00, double* %2
store double 5.430000e+00, double* %3
store double 6.210000e+00, double* %4
%7 = load double, double* %2
%8 = load double, double* %3
%9 = fadd double %7, %8
%10 = load double, double* %4
%11 = fadd double %9, %10
%12 = fdiv double %11, 2.000000e+00
store double %12, double* %5
%13 = load double, double* %5
%14 = load double, double* %5
%15 = load double, double* %2
%16 = fsub double %14, %15
%17 = fmul double %13, %16
%18 = load double, double* %5
%19 = load double, double* %3
%20 = fsub double %18, %19
%21 = fmul double %17, %20
%22 = load double, double* %5
%23 = load double, double* %4
%24 = fsub double %22, %23
%25 = fmul double %21, %24
%26 = call double @sqrt(double %25)
store double %26, double* %6
%27 = load double, double* %2
%28 = load double, double* %3
%29 = load double, double* %4
%30 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %27, double %28, double %29)
%31 = load double, double* %6
%32 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"a=%f\09b=%f\09c=%f\0A\00"
@.str.1 = [9 x i8] c"area=%f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 3.670000e+00, double 5.430000e+00, double 6.210000e+00)
%2 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double 0x4023CE8E8ADD986B)
ret i32 0
}