#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float R, H, V, A;
  printf("\n**CALCULO DO VOLUME E A AREA DO CILINDRO**\n\n");
  printf("Qual o raio do cilindro? ");
  scanf("%f", &R);
  printf("Qual a altura do cilindro? ");
  scanf("%f", &H);
  V = 3.1415 * R * R * H;
  A = 2 * 3.1415 * R * (R + H);
  printf("\nO volume do cilindro e: %f.\n", V);
  printf("\nA area do cilindro e: %f.\n", A);
  printf("\n\n<< Marco Tulio >>\n");
  getchar(), getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe75(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe35(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
addss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe84(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf37(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe60(%rip),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movss  0x8(%rsp),%xmm3
cvtss2sd %xmm3,%xmm4
mulsd  %xmm2,%xmm4
xorps  %xmm2,%xmm2
cvtsd2ss %xmm4,%xmm2
mulsd  0xe43(%rip),%xmm1
addss  %xmm3,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
lea    0xe60(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe66(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"\0A**CALCULO DO VOLUME E A AREA DO CILINDRO**\0A\0A\00"
@.str.1 = [26 x i8] c"Qual o raio do cilindro? \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [28 x i8] c"Qual a altura do cilindro? \00"
@.str.4 = [30 x i8] c"\0AO volume do cilindro e: %f.\0A\00"
@.str.5 = [28 x i8] c"\0AA area do cilindro e: %f.\0A\00"
@.str.6 = [21 x i8] c"\0A\0A<< Marco Tulio >>\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%10 = load float, float* %1
%11 = fpext float %10 to double
%12 = fmul double 3.141500e+00, %11
%13 = load float, float* %1
%14 = fpext float %13 to double
%15 = fmul double %12, %14
%16 = load float, float* %2
%17 = fpext float %16 to double
%18 = fmul double %15, %17
%19 = fptrunc double %18 to float
store float %19, float* %3
%20 = load float, float* %1
%21 = fpext float %20 to double
%22 = fmul double 6.283000e+00, %21
%23 = load float, float* %1
%24 = load float, float* %2
%25 = fadd float %23, %24
%26 = fpext float %25 to double
%27 = fmul double %22, %26
%28 = fptrunc double %27 to float
store float %28, float* %4
%29 = load float, float* %3
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), double %30)
%32 = load float, float* %4
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), double %33)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%36 = call i32 (...) @getchar()
%37 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [26 x i8] c"Qual o raio do cilindro? \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [28 x i8] c"Qual a altura do cilindro? \00"
@.str.4 = [30 x i8] c"\0AO volume do cilindro e: %f.\0A\00"
@.str.5 = [28 x i8] c"\0AA area do cilindro e: %f.\0A\00"
@str = [45 x i8] c"\0A**CALCULO DO VOLUME E A AREA DO CILINDRO**\0A\00"
@str.7 = [20 x i8] c"\0A\0A<< Marco Tulio >>\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%10 = load float, float* %1
%11 = fpext float %10 to double
%12 = fmul double %11, 3.141500e+00
%13 = fmul double %12, %11
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = fmul double %13, %15
%17 = fptrunc double %16 to float
%18 = fmul double %11, 6.283000e+00
%19 = fadd float %10, %14
%20 = fpext float %19 to double
%21 = fmul double %18, %20
%22 = fptrunc double %21 to float
%23 = fpext float %17 to double
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), double %23)
%25 = fpext float %22 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), double %25)
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0))
%28 = call i32 (...) @getchar()
%29 = call i32 (...) @getchar()
ret i32 0
}