#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*/ die(char *);
double sqrt(double);
double areaTriangle(double a, double b, double c) {
  double semiPerimeter, retVal;
  if ((a + b < c) || (b + c < a) || (c + a < b))
    die("These three sides cannot make a triangle.\n");
  semiPerimeter = (a + b + c) / 2;
  retVal = sqrt(semiPerimeter * (semiPerimeter - a) * (semiPerimeter - b) *
                (semiPerimeter - c));
  return retVal;
}


x86 assembly (clang, -O0):
<areaTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     1182 <areaTriangle+0x62>
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     1182 <areaTriangle+0x62>
movsd  -0x18(%rbp),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    118e <areaTriangle+0x6e>
lea    0xe7f(%rip),%rdi
call   1030 <die@plt>
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe5b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<areaTriangle>:
sub    $0x28,%rsp
movapd %xmm0,%xmm4
addsd  %xmm1,%xmm0
movapd %xmm4,%xmm3
addsd  %xmm2,%xmm3
ucomisd %xmm3,%xmm1
ja     114e <areaTriangle+0x2e>
ucomisd %xmm0,%xmm2
ja     114e <areaTriangle+0x2e>
movapd %xmm1,%xmm3
addsd  %xmm2,%xmm3
ucomisd %xmm3,%xmm4
jbe    118a <areaTriangle+0x6a>
lea    0xeb3(%rip),%rdi
movsd  %xmm0,0x20(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm4,0x8(%rsp)
call   1030 <die@plt>
movsd  0x8(%rsp),%xmm4
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm0
addsd  %xmm2,%xmm0
mulsd  0xe6a(%rip),%xmm0
movapd %xmm0,%xmm3
subsd  %xmm4,%xmm3
mulsd  %xmm0,%xmm3
movapd %xmm0,%xmm4
subsd  %xmm1,%xmm4
mulsd  %xmm3,%xmm4
subsd  %xmm2,%xmm0
mulsd  %xmm4,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11c9 <areaTriangle+0xa9>
sqrtsd %xmm0,%xmm0
add    $0x28,%rsp
ret
add    $0x28,%rsp
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"These three sides cannot make a triangle.\0A\00"
define double @areaTriangle(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fadd double %9, %10
%12 = load double, double* %6
%13 = fcmp olt double %11, %12
br i1 %13, label %26, label %14
14: ; preds = %3
%15 = load double, double* %5
%16 = load double, double* %6
%17 = fadd double %15, %16
%18 = load double, double* %4
%19 = fcmp olt double %17, %18
br i1 %19, label %26, label %20
20: ; preds = %14
%21 = load double, double* %6
%22 = load double, double* %4
%23 = fadd double %21, %22
%24 = load double, double* %5
%25 = fcmp olt double %23, %24
br i1 %25, label %26, label %28
26: ; preds = %20, %14, %3
%27 = call i32 @die(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %28
28: ; preds = %26, %20
%29 = load double, double* %4
%30 = load double, double* %5
%31 = fadd double %29, %30
%32 = load double, double* %6
%33 = fadd double %31, %32
%34 = fdiv double %33, 2.000000e+00
store double %34, double* %7
%35 = load double, double* %7
%36 = load double, double* %7
%37 = load double, double* %4
%38 = fsub double %36, %37
%39 = fmul double %35, %38
%40 = load double, double* %7
%41 = load double, double* %5
%42 = fsub double %40, %41
%43 = fmul double %39, %42
%44 = load double, double* %7
%45 = load double, double* %6
%46 = fsub double %44, %45
%47 = fmul double %43, %46
%48 = call double @sqrt(double %47)
store double %48, double* %8
%49 = load double, double* %8
ret double %49
}

LLVM IR (-O2):
@.str = [43 x i8] c"These three sides cannot make a triangle.\0A\00"
define double @areaTriangle(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fcmp olt double %4, %2
%6 = fadd double %1, %2
%7 = fcmp olt double %6, %0
%8 = or i1 %5, %7
%9 = fadd double %0, %2
%10 = fcmp olt double %9, %1
%11 = or i1 %10, %8
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = tail call i32 @die(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %3, %12
%15 = fadd double %4, %2
%16 = fmul double %15, 5.000000e-01
%17 = fsub double %16, %0
%18 = fmul double %16, %17
%19 = fsub double %16, %1
%20 = fmul double %19, %18
%21 = fsub double %16, %2
%22 = fmul double %21, %20
%23 = tail call double @sqrt(double %22)
ret double %23
}