#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 *, float);
int /*<<< orphan*/ scanf(char *, float *, float *, float *);
int main() {
  float a, b, c;
  scanf("%f%f%f", &a, &b, &c);
  printf("TRIANGULO: %.3f\n", (.5 * c * a));
  printf("CIRCULO: %.3f\n", (c * c * 3.14159));
  printf("TRAPEZIO: %.3f\n", ((a + b) * .5 * c));
  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    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe79(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe47(%rip),%xmm1
mulsd  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeaf(%rip),%xmm0
movss  0x14(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe80(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe50(%rip),%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
mulss  %xmm0,%xmm0
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm0
mulss  0x10(%rsp),%xmm0
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%f%f%f\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 float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3)
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fmul double %9, 5.000000e-01
%11 = load float, float* %1
%12 = fpext float %11 to double
%13 = fmul double %10, %12
%14 = fptrunc double %13 to float
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %14)
%16 = load float, float* %3
%17 = fmul float %16, %16
%18 = fpext float %17 to double
%19 = fmul double %18, 3.141590e+00
%20 = fptrunc double %19 to float
%21 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), float %20)
%22 = load float, float* %1
%23 = load float, float* %2
%24 = fadd float %22, %23
%25 = fpext float %24 to double
%26 = fmul double %25, 5.000000e-01
%27 = load float, float* %3
%28 = fpext float %27 to double
%29 = fmul double %26, %28
%30 = fptrunc double %29 to float
%31 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), float %30)
%32 = load float, float* %2
%33 = fmul float %32, %32
%34 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), float %33)
%35 = load float, float* %1
%36 = load float, float* %2
%37 = fmul float %35, %36
%38 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), float %37)
ret i32 0
}