#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", .5 * (a * c));
    printf("CIRCULO: %.3f\n", 3.14159 * (c * c));
    printf("TRAPEZIO: %.3f\n", .5 * (a + b) * 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>
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
je     1213 <main+0xf3>
movss  -0x8(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe93(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe71(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe3f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%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    0xee3(%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     1244 <main+0x124>
lea    0xf00(%rip),%rbx
lea    0xeb0(%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
mulss  0xe6c(%rip),%xmm0
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe52(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe32(%rip),%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
mulss  %xmm0,%xmm0
lea    0xe41(%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 %42
9: ; preds = %5
%10 = load float, float* %2
%11 = load float, float* %4
%12 = fmul float %10, %11
%13 = fpext float %12 to double
%14 = fmul double 5.000000e-01, %13
%15 = fptrunc double %14 to float
%16 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %15)
%17 = load float, float* %4
%18 = load float, float* %4
%19 = fmul float %17, %18
%20 = fpext float %19 to double
%21 = fmul double 3.141590e+00, %20
%22 = fptrunc double %21 to float
%23 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), float %22)
%24 = load float, float* %2
%25 = load float, float* %3
%26 = fadd float %24, %25
%27 = fpext float %26 to double
%28 = fmul double 5.000000e-01, %27
%29 = load float, float* %4
%30 = fpext float %29 to double
%31 = fmul double %28, %30
%32 = fptrunc double %31 to float
%33 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), float %32)
%34 = load float, float* %3
%35 = load float, float* %3
%36 = fmul float %34, %35
%37 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), float %36)
%38 = load float, float* %2
%39 = load float, float* %3
%40 = fmul float %38, %39
%41 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), float %40)
br label %5
42: ; preds = %5
ret i32 0
}

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 %42, 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* %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)
%39 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3)
%40 = load i64, i64* @EOF
%41 = icmp eq i64 %39, %40
br i1 %41, label %42, label %10
42: ; preds = %10, %0
ret i32 0
}