#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, float);
scalar_t__ scanf(char *, float *, float *, float *);
int main() {
  float a, b, c;
  while (scanf("%f %f %f", &a, &b, &c) != EOF) {
    printf("TRIANGULO: %.3f\n", a * c / 2);
    printf("CIRCULO: %.3f\n", 3.14159 * (c * c));
    printf("TRAPEZIO: %.3f\n", c * ((a + b) / 2));
    printf("QUADRADO: %.3f\n", b * b);
    printf("RETANGULO: %.3f\n", a * b);
  }
}


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>
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
je     11ff <main+0xdf>
movss  -0x8(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  0xe97(%rip),%xmm1
divss  %xmm1,%xmm0
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe79(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
addss  -0xc(%rbp),%xmm1
movss  0xe46(%rip),%xmm2
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xedb(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x2e98(%rip),%r13
cmp    0x0(%r13),%rax
je     1235 <main+0x115>
lea    0xef8(%rip),%rbx
lea    0xea8(%rip),%rbp
lea    0x14(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
nopw   0x0(%rax,%rax,1)
movss  0x14(%rsp),%xmm0
mulss  0xc(%rsp),%xmm0
movss  0xe6c(%rip),%xmm1
mulss  %xmm1,%xmm0
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe4e(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
mulss  0xe22(%rip),%xmm0
mulss  0xc(%rsp),%xmm0
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
mulss  %xmm0,%xmm0
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm0
mulss  0x10(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1040 <scanf@plt>
cmp    0x0(%r13),%rax
jne    1180 <main+0x60>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%f %f %f\00"
@EOF = global i64 0
@.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 i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %39, label %10
10: ; preds = %0, %10
%11 = load float, float* %1
%12 = load float, float* %3
%13 = fmul float %11, %12
%14 = fmul float %13, 5.000000e-01
%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* %3
%23 = load float, float* %1
%24 = load float, float* %2
%25 = fadd float %23, %24
%26 = fmul float %25, 5.000000e-01
%27 = fmul float %22, %26
%28 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), float %27)
%29 = load float, float* %2
%30 = fmul float %29, %29
%31 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), float %30)
%32 = load float, float* %1
%33 = load float, float* %2
%34 = fmul float %32, %33
%35 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), float %34)
%36 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3)
%37 = load i64, i64* @EOF
%38 = icmp eq i64 %36, %37
br i1 %38, label %39, label %10
39: ; preds = %10, %0
ret i32 0
}