#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 areaDoTriangulo(double, double, double);
scalar_t__ isTriangulo(double, double, double);
double perimetroDoTrapezio(double, double, double);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int main(void) {
  double a, b, c;
  scanf("%lf %lf %lf", &a, &b, &c);
  if (isTriangulo(a, b, c)) {
    printf("Perimetro = %.1f\n", perimetroDoTrapezio(a, b, c));
  } else {
    printf("Area = %.1f\n", areaDoTriangulo(a, b, c));
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1060 <isTriangulo@plt>
cmp    $0x0,%rax
je     11ba <main+0x6a>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1040 <perimetroDoTrapezio@plt>
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
jmp    11da <main+0x8a>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1070 <areaDoTriangulo@plt>
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xea5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1060 <isTriangulo@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
test   %rax,%rax
je     11a7 <main+0x57>
call   1040 <perimetroDoTrapezio@plt>
lea    0xe67(%rip),%rdi
jmp    11b3 <main+0x63>
call   1070 <areaDoTriangulo@plt>
lea    0xe6b(%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() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, double* %4)
%6 = load double, double* %2
%7 = load double, double* %3
%8 = load double, double* %4
%9 = call i64 @isTriangulo(double %6, double %7, double %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %0
%12 = load double, double* %2
%13 = load double, double* %3
%14 = load double, double* %4
%15 = call double @perimetroDoTrapezio(double %12, double %13, double %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %15)
br label %23
17: ; preds = %0
%18 = load double, double* %2
%19 = load double, double* %3
%20 = load double, double* %4
%21 = call double @areaDoTriangulo(double %18, double %19, double %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %21)
br label %23
23: ; preds = %17, %11
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() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3)
%8 = load double, double* %1
%9 = load double, double* %2
%10 = load double, double* %3
%11 = call i64 @isTriangulo(double %8, double %9, double %10)
%12 = icmp eq i64 %11, 0
%13 = load double, double* %1
%14 = load double, double* %2
%15 = load double, double* %3
br i1 %12, label %19, label %16
16: ; preds = %0
%17 = call double @perimetroDoTrapezio(double %13, double %14, double %15)
%18 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %17)
br label %22
19: ; preds = %0
%20 = call double @areaDoTriangulo(double %13, double %14, double %15)
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %20)
br label %22
22: ; preds = %19, %16
ret i32 0
}