#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\nCIRCULO: %.3f\n", (a * c) / 2, (3.14159 * c * c));
  printf("TRAPEZIO: %.3f\nQUADRADO: %.3f\n", ((a + b) / 2) * c, 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  -0x8(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  0xea7(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe9a(%rip),%xmm1
mulsd  %xmm2,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm1
lea    0xe93(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  0xe61(%rip),%xmm1
divss  %xmm1,%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe7b(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
lea    0xe82(%rip),%rdi
mov    $0x1,%al
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    0xc(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1040 <scanf@plt>
movss  0x10(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
mulss  %xmm1,%xmm0
mulss  0xea9(%rip),%xmm0
cvtss2sd %xmm1,%xmm2
movsd  0xea5(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
lea    0xea7(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
addss  %xmm1,%xmm0
mulss  0xe6f(%rip),%xmm0
mulss  0x10(%rsp),%xmm0
mulss  %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe92(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
mulss  0x14(%rsp),%xmm0
lea    0xe97(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%f %f %f\00"
@.str.1 = [31 x i8] c"TRIANGULO: %.3f\0ACIRCULO: %.3f\0A\00"
@.str.2 = [31 x i8] c"TRAPEZIO: %.3f\0AQUADRADO: %.3f\0A\00"
@.str.3 = [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 ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %2, float* %3, float* %4)
%6 = load float, float* %2
%7 = load float, float* %4
%8 = fmul float %6, %7
%9 = fdiv float %8, 2.000000e+00
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = fmul double 3.141590e+00, %11
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = fmul double %12, %14
%16 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), float %9, double %15)
%17 = load float, float* %2
%18 = load float, float* %3
%19 = fadd float %17, %18
%20 = fdiv float %19, 2.000000e+00
%21 = load float, float* %4
%22 = fmul float %20, %21
%23 = load float, float* %3
%24 = load float, float* %3
%25 = fmul float %23, %24
%26 = fpext float %25 to double
%27 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), float %22, double %26)
%28 = load float, float* %2
%29 = load float, float* %3
%30 = fmul float %28, %29
%31 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), float %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%f %f %f\00"
@.str.1 = [31 x i8] c"TRIANGULO: %.3f\0ACIRCULO: %.3f\0A\00"
@.str.2 = [31 x i8] c"TRAPEZIO: %.3f\0AQUADRADO: %.3f\0A\00"
@.str.3 = [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 ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3)
%8 = load float, float* %1
%9 = load float, float* %3
%10 = fmul float %8, %9
%11 = fmul float %10, 5.000000e-01
%12 = fpext float %9 to double
%13 = fmul double %12, 3.141590e+00
%14 = fmul double %13, %12
%15 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), float %11, double %14)
%16 = load float, float* %1
%17 = load float, float* %2
%18 = fadd float %16, %17
%19 = fmul float %18, 5.000000e-01
%20 = load float, float* %3
%21 = fmul float %20, %19
%22 = fmul float %17, %17
%23 = fpext float %22 to double
%24 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), float %21, double %23)
%25 = load float, float* %1
%26 = load float, float* %2
%27 = fmul float %25, %26
%28 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), float %27)
ret i32 0
}