#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, RE;
  scanf(" %lf %lf %lf ", &A, &B, &C);
  RE = A * C / 2;
  printf("TRIANGULO: %.3lf\n", RE);
  RE = 3.14159 * C * C;
  printf("CIRCULO: %.3lf\n", RE);
  RE = ((A + B) * C) / 2;
  printf("TRAPEZIO: %.3lf\n", RE);
  RE = B * B;
  printf("QUADRADO: %.3lf\n", RE);
  RE = A * B;
  printf("RETANGULO: %.3lf\n", RE);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe8d(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe4e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe5b(%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    0xec7(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm1
movsd  0xe9f(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
mulsd  0xe6a(%rip),%xmm0
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [14 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
%6 = call i32 @scanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, double* %4)
%7 = load double, double* %2
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = fdiv double %9, 2.000000e+00
store double %10, double* %5
%11 = load double, double* %5
%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* %4
%14 = fmul double 3.141590e+00, %13
%15 = load double, double* %4
%16 = fmul double %14, %15
store double %16, double* %5
%17 = load double, double* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %17)
%19 = load double, double* %2
%20 = load double, double* %3
%21 = fadd double %19, %20
%22 = load double, double* %4
%23 = fmul double %21, %22
%24 = fdiv double %23, 2.000000e+00
store double %24, double* %5
%25 = load double, double* %5
%26 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %25)
%27 = load double, double* %3
%28 = load double, double* %3
%29 = fmul double %27, %28
store double %29, double* %5
%30 = load double, double* %5
%31 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %30)
%32 = load double, double* %2
%33 = load double, double* %3
%34 = fmul double %32, %33
store double %34, double* %5
%35 = load double, double* %5
%36 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), double %35)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 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 ([14 x i8], [14 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
}