#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 */
double fabs(double);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int main(int argc, char const *argv[]) {
  double a, b, c;
  scanf("%lf %lf %lf", &a, &b, &c);
  bool condicaoTriangulo = (fabs(b - c) < a) && (a < b + c);
  if (condicaoTriangulo) {
    double perimetro = a + b + c;
    printf("Perimetro = %.1f\n", perimetro);
  } else {
    double area = ((a + b) * c) / 2;
    printf("Area = %.1f\n", area);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xedb(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x20(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
movaps 0xea1(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x41(%rbp)
jbe    1190 <main+0x70>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     11cf <main+0xaf>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
jmp    1200 <main+0xe0>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xe2a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeed(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm0
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
andpd  0xea8(%rip),%xmm2
movsd  0x10(%rsp),%xmm3
ucomisd %xmm2,%xmm3
movapd %xmm1,%xmm2
addsd  %xmm3,%xmm2
jbe    1183 <main+0x63>
addsd  %xmm0,%xmm1
ucomisd %xmm3,%xmm1
jbe    1183 <main+0x63>
addsd  %xmm2,%xmm0
lea    0xea3(%rip),%rdi
jmp    1196 <main+0x76>
mulsd  %xmm2,%xmm0
mulsd  0xe81(%rip),%xmm0
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.1 = [18 x i8] c"Perimetro = %.1f\0A\00"
@.str.2 = [13 x i8] c"Area = %.1f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca double
%11 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %6, double* %7, double* %8)
%13 = load double, double* %7
%14 = load double, double* %8
%15 = fsub double %13, %14
%16 = call double @llvm.fabs.f64(double %15)
%17 = load double, double* %6
%18 = fcmp olt double %16, %17
br i1 %18, label %19, label %25
19: ; preds = %2
%20 = load double, double* %6
%21 = load double, double* %7
%22 = load double, double* %8
%23 = fadd double %21, %22
%24 = fcmp olt double %20, %23
br label %25
25: ; preds = %19, %2
%26 = phi i1 [ false, %2 ], [ %24, %19 ]
%27 = zext i1 %26 to i32
store i32 %27, i32* %9
%28 = load i32, i32* %9
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %38
30: ; preds = %25
%31 = load double, double* %6
%32 = load double, double* %7
%33 = fadd double %31, %32
%34 = load double, double* %8
%35 = fadd double %33, %34
store double %35, double* %10
%36 = load double, double* %10
%37 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %36)
br label %47
38: ; preds = %25
%39 = load double, double* %6
%40 = load double, double* %7
%41 = fadd double %39, %40
%42 = load double, double* %8
%43 = fmul double %41, %42
%44 = fdiv double %43, 2.000000e+00
store double %44, double* %11
%45 = load double, double* %11
%46 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %45)
br label %47
47: ; preds = %38, %30
ret i32 0
}

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