#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(void) {
  const double pi = 3.14159;
  double a, b, c;
  scanf("%lf %lf %lf", &a, &b, &c);
  printf("TRIANGULO: %.3f\n", a * c / 2);
  printf("CIRCULO: %.3f\n", c * c * pi);
  printf("TRAPEZIO: %.3f\n", c * (a + b) / 2);
  printf("QUADRADO: %.3f\n", b * b);
  printf("RETANGULO: %.3f\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  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe4d(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
lea    0xe72(%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),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xe9b(%rip),%xmm0
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
mulsd  0xe6e(%rip),%xmm0
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
lea    0xe9d(%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 = [17 x i8] c"TRIANGULO: %.3f\0A\00"
@.str.2 = [15 x i8] c"CIRCULO: %.3f\0A\00"
@.str.3 = [16 x i8] c"TRAPEZIO: %.3f\0A\00"
@.str.4 = [16 x i8] c"QUADRADO: %.3f\0A\00"
@.str.5 = [17 x i8] c"RETANGULO: %.3f\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 ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = load double, double* %5
%13 = load double, double* %5
%14 = fmul double %12, %13
%15 = fmul double %14, 3.141590e+00
%16 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %15)
%17 = load double, double* %5
%18 = load double, double* %3
%19 = load double, double* %4
%20 = fadd double %18, %19
%21 = fmul double %17, %20
%22 = fdiv double %21, 2.000000e+00
%23 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 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 ([16 x i8], [16 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 ([17 x i8], [17 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 = [17 x i8] c"TRIANGULO: %.3f\0A\00"
@.str.2 = [15 x i8] c"CIRCULO: %.3f\0A\00"
@.str.3 = [16 x i8] c"TRAPEZIO: %.3f\0A\00"
@.str.4 = [16 x i8] c"QUADRADO: %.3f\0A\00"
@.str.5 = [17 x i8] c"RETANGULO: %.3f\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 ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %11)
%13 = load double, double* %3
%14 = fmul double %13, %13
%15 = fmul double %14, 3.141590e+00
%16 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %15)
%17 = load double, double* %3
%18 = load double, double* %1
%19 = load double, double* %2
%20 = fadd double %18, %19
%21 = fmul double %17, %20
%22 = fmul double %21, 5.000000e-01
%23 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 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 ([16 x i8], [16 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 ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %29)
ret i32 0
}