#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 H, R, A, V;
  printf("\n ** CALCULO DO VALOR DE UMA LATA ** \n");
  printf("\nDigite a altura: ");
  scanf("%f", &H);
  printf("Digite o raio: ");
  scanf("%f", &R);
  A = 2.0 * 3.1415 * R * R + 2.0 * 3.1415 * R * H;
  V = A * 100.0;
  V = V / 10000;
  printf("\nO valor da lata e: %f reais.\n", V);
  printf("\n\n<< Marco_Tulio >>\n");
  getchar(), getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe7d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm3
movsd  0xe5f(%rip),%xmm1
mulsd  %xmm3,%xmm1
movss  -0x4(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe24(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xe02(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe5f(%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    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebd(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe60(%rip),%xmm1
mulsd  %xmm0,%xmm1
movss  0xc(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
mulss  0xe3f(%rip),%xmm0
divss  0xe3b(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe91(%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 = [39 x i8] c"\0A ** CALCULO DO VALOR DE UMA LATA ** \0A\00"
@.str.1 = [19 x i8] c"\0ADigite a altura: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [16 x i8] c"Digite o raio: \00"
@.str.4 = [31 x i8] c"\0AO valor da lata e: %f reais.\0A\00"
@.str.5 = [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 ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 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 ([16 x i8], [16 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* %2
%11 = fpext float %10 to double
%12 = fmul double 6.283000e+00, %11
%13 = load float, float* %2
%14 = fpext float %13 to double
%15 = load float, float* %2
%16 = fpext float %15 to double
%17 = fmul double 6.283000e+00, %16
%18 = load float, float* %1
%19 = fpext float %18 to double
%20 = fmul double %17, %19
%21 = call double @llvm.fmuladd.f64(double %12, double %14, double %20)
%22 = fptrunc double %21 to float
store float %22, float* %3
%23 = load float, float* %3
%24 = fpext float %23 to double
%25 = fmul double %24, 1.000000e+02
%26 = fptrunc double %25 to float
store float %26, float* %4
%27 = load float, float* %4
%28 = fdiv float %27, 1.000000e+04
store float %28, float* %4
%29 = load float, float* %4
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), double %30)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%33 = call i32 (...) @getchar()
%34 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"\0ADigite a altura: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [16 x i8] c"Digite o raio: \00"
@.str.4 = [31 x i8] c"\0AO valor da lata e: %f reais.\0A\00"
@str = [38 x i8] c"\0A ** CALCULO DO VALOR DE UMA LATA ** \00"
@str.6 = [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 ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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 ([16 x i8], [16 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* %2
%11 = fpext float %10 to double
%12 = fmul double %11, 6.283000e+00
%13 = load float, float* %1
%14 = fpext float %13 to double
%15 = fmul double %12, %14
%16 = call double @llvm.fmuladd.f64(double %12, double %11, double %15)
%17 = fptrunc double %16 to float
%18 = fmul float %17, 1.000000e+02
%19 = fdiv float %18, 1.000000e+04
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), double %20)
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0))
%23 = call i32 (...) @getchar()
%24 = call i32 (...) @getchar()
ret i32 0
}