#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 const);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int main() {
  const double PI = 3.14159;
  double a, b, c;
  scanf("%lf %lf %lf", &a, &b, &c);
  printf("TRIANGULO: %.3lf\n", (a * c) / 2);
  printf("CIRCULO: %.3lf\n", PI * c * c);
  printf("TRAPEZIO: %.3lf\n", ((a + b) * c) / 2);
  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    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe8a(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xe55(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%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  (%rsp),%xmm0
mulsd  0xe6a(%rip),%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
%5 = alloca double
store i32 0, i32* %1
store double 3.141590e+00, double* %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %3, double* %4, double* %5)
%7 = load double, double* %3
%8 = load double, double* %5
%9 = fmul double %7, %8
%10 = fdiv double %9, 2.000000e+00
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = load double, double* %5
%13 = fmul double 3.141590e+00, %12
%14 = load double, double* %5
%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* %3
%18 = load double, double* %4
%19 = fadd double %17, %18
%20 = load double, double* %5
%21 = fmul double %19, %20
%22 = fdiv double %21, 2.000000e+00
%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* %4
%25 = load double, double* %4
%26 = fmul double %24, %25
%27 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %26)
%28 = load double, double* %3
%29 = load double, double* %4
%30 = fmul double %28, %29
%31 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), double %30)
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 = load double, double* %3
%21 = fmul double %19, %20
%22 = fmul double %21, 5.000000e-01
%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
}