#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);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int main() {
  double a, b, c;
  scanf("%lf %lf %lf", &a, &b, &c);
  printf("TRIANGULO: %.3lf\n", a * c / 2);
  printf("CIRCULO: %.3lf\n", 3.14159 * c * c);
  printf("TRAPEZIO: %.3lf\n", (a + b) / 2 * c);
  printf("QUADRADO: %.3lf\n", b * b);
  printf("RETANGULO: %.3lf\n", a * b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xea7(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe97(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe67(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  (%rsp),%xmm0
mulsd  0xeb0(%rip),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm1
movsd  0xe9f(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0xe6f(%rip),%xmm0
mulsd  (%rsp),%xmm0
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
lea    0xe95(%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"TRIANGULO: %.3lf\0A\00"
@.str.2 = [16 x i8] c"CIRCULO: %.3lf\0A\00"
@.str.3 = [17 x i8] c"TRAPEZIO: %.3lf\0A\00"
@.str.4 = [17 x i8] c"QUADRADO: %.3lf\0A\00"
@.str.5 = [18 x i8] c"RETANGULO: %.3lf\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* %4
%8 = fmul double %6, %7
%9 = fdiv double %8, 2.000000e+00
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %9)
%11 = load double, double* %4
%12 = fmul double 3.141590e+00, %11
%13 = load double, double* %4
%14 = fmul double %12, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %14)
%16 = load double, double* %2
%17 = load double, double* %3
%18 = fadd double %16, %17
%19 = fdiv double %18, 2.000000e+00
%20 = load double, double* %4
%21 = fmul double %19, %20
%22 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %21)
%23 = load double, double* %3
%24 = load double, double* %3
%25 = fmul double %23, %24
%26 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %25)
%27 = load double, double* %2
%28 = load double, double* %3
%29 = fmul double %27, %28
%30 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), double %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.1 = [18 x i8] c"TRIANGULO: %.3lf\0A\00"
@.str.2 = [16 x i8] c"CIRCULO: %.3lf\0A\00"
@.str.3 = [17 x i8] c"TRAPEZIO: %.3lf\0A\00"
@.str.4 = [17 x i8] c"QUADRADO: %.3lf\0A\00"
@.str.5 = [18 x i8] c"RETANGULO: %.3lf\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* %3
%10 = fmul double %8, %9
%11 = fmul double %10, 5.000000e-01
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %11)
%13 = load double, double* %3
%14 = fmul double %13, 3.141590e+00
%15 = fmul double %13, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %15)
%17 = load double, double* %1
%18 = load double, double* %2
%19 = fadd double %17, %18
%20 = fmul double %19, 5.000000e-01
%21 = load double, double* %3
%22 = fmul double %21, %20
%23 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %22)
%24 = load double, double* %2
%25 = fmul double %24, %24
%26 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %25)
%27 = load double, double* %1
%28 = load double, double* %2
%29 = fmul double %27, %28
%30 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), double %29)
ret i32 0
}