#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 *);
int /*<<< orphan*/ system(char *);
int main() {
  double A, B, C, CIRCULO;
  const double pi = 3.14159;
  scanf("%lf", &A);
  scanf("%lf", &B);
  scanf("%lf", &C);
  CIRCULO = pi * pow(C, 2);
  printf("TRIANGULO: %.3lf\n", A * C / 2);
  printf("CIRCULO: %.3lf\n", CIRCULO);
  printf("TRAPEZIO: %.3lf\n", (A + B) * C / 2);
  printf("QUADRADO: %.3lf\n", pow(B, 2));
  printf("RETANGULO: %.3lf\n", A * B);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xead(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe9d(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe8d(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe62(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe3f(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe48(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe07(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe32(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
lea    0xe28(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
lea    0xe23(%rip),%rdi
call   1040 <printf@plt>
lea    0xe29(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
mulsd  0xe78(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  (%rsp),%xmm0
mulsd  0xe67(%rip),%xmm0
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
lea    0xe72(%rip),%rdi
movsd  0x18(%rsp),%xmm0
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
mulsd  0xe30(%rip),%xmm0
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
lea    0xe4c(%rip),%rdi
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
lea    0xe45(%rip),%rdi
call   1040 <printf@plt>
lea    0xe4b(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [18 x i8] c"TRIANGULO: %.3lf\0A\00"
@.str.2 = [16 x i8] c"CIRCULO: %.3lf\0A\00"
@.str.3 = [17 x i8] c"TRAPEZIO: %.3lf\0A\00"
@.str.4 = [17 x i8] c"QUADRADO: %.3lf\0A\00"
@.str.5 = [18 x i8] c"RETANGULO: %.3lf\0A\00"
@.str.6 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
store double 3.141590e+00, double* %6
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%10 = load double, double* %4
%11 = call double @pow(double %10, i32 2)
%12 = fmul double 3.141590e+00, %11
store double %12, double* %5
%13 = load double, double* %2
%14 = load double, double* %4
%15 = fmul double %13, %14
%16 = fdiv double %15, 2.000000e+00
%17 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %16)
%18 = load double, double* %5
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %18)
%20 = load double, double* %2
%21 = load double, double* %3
%22 = fadd double %20, %21
%23 = load double, double* %4
%24 = fmul double %22, %23
%25 = fdiv double %24, 2.000000e+00
%26 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %25)
%27 = load double, double* %3
%28 = call double @pow(double %27, i32 2)
%29 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %28)
%30 = load double, double* %2
%31 = load double, double* %3
%32 = fmul double %30, %31
%33 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), double %32)
%34 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [18 x i8] c"TRIANGULO: %.3lf\0A\00"
@.str.2 = [16 x i8] c"CIRCULO: %.3lf\0A\00"
@.str.3 = [17 x i8] c"TRAPEZIO: %.3lf\0A\00"
@.str.4 = [17 x i8] c"QUADRADO: %.3lf\0A\00"
@.str.5 = [18 x i8] c"RETANGULO: %.3lf\0A\00"
@.str.6 = [6 x i8] c"pause\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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%10 = load double, double* %3
%11 = call double @pow(double %10, i32 2)
%12 = fmul double %11, 3.141590e+00
%13 = load double, double* %1
%14 = load double, double* %3
%15 = fmul double %13, %14
%16 = fmul double %15, 5.000000e-01
%17 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %12)
%19 = load double, double* %1
%20 = load double, double* %2
%21 = fadd double %19, %20
%22 = load double, double* %3
%23 = fmul double %21, %22
%24 = fmul double %23, 5.000000e-01
%25 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %24)
%26 = load double, double* %2
%27 = call double @pow(double %26, i32 2)
%28 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %27)
%29 = load double, double* %1
%30 = load double, double* %2
%31 = fmul double %29, %30
%32 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), double %31)
%33 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}