#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 pow(double, int);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int main() {
  double a, b, c;
  double pi = 3.14159;
  scanf("%lf %lf %lf", &a, &b, &c);
  printf("TRIANGULO: %.3f\n", (a * c) / 2);
  printf("CIRCULO: %.3f\n", pi * pow(c, 2));
  printf("TRAPEZIO: %.3f\n", ((a + b) * c) / 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  0xec1(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    0xebd(%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  0xe8a(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe32(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%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  0xea0(%rip),%xmm0
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mulsd  0xe85(%rip),%xmm0
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
mulsd  0xe58(%rip),%xmm0
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
lea    0xe7f(%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* %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 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
%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* %4
%14 = call double @pow(double %13, i32 2)
%15 = fmul double %12, %14
%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* %2
%18 = load double, double* %3
%19 = fadd double %17, %18
%20 = load double, double* %4
%21 = fmul double %19, %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* %3
%25 = load double, double* %3
%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* %2
%29 = load double, double* %3
%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 = call double @pow(double %13, i32 2)
%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* %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 ([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
}