#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(int, int);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  double custoPorMetro = 100;
  double areaTotal;
  double areaBase;
  double areaLateral;
  double valor;
  int raio;
  int altura;
  scanf("%d", &raio);
  scanf("%d", &altura);
  areaBase = 3.1415 * pow(raio, 2) * 2;
  areaLateral = 2 * 3.1415 * raio * altura;
  areaTotal = areaBase + areaLateral;
  valor = areaTotal * custoPorMetro;
  printf("O VALOR DO CUSTO E = %0.2f\n", valor);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x34(%rbp),%edi
mov    $0x2,%esi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe8c(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe78(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x34(%rbp),%xmm1
movsd  0xe5a(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeec(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%edi
mov    $0x2,%esi
call   1050 <pow@plt>
cvtsi2sdl 0x8(%rsp),%xmm1
unpcklpd %xmm1,%xmm0
mulpd  0xe8a(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0xc(%rsp),%xmm1
movapd 0xe89(%rip),%xmm2
unpcklpd %xmm1,%xmm2
mulpd  %xmm2,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm1,%xmm0
mulsd  0xe7d(%rip),%xmm0
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [28 x i8] c"O VALOR DO CUSTO E = %0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store double 1.000000e+02, double* %2
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%11 = load i32, i32* %7
%12 = call double @pow(i32 %11, i32 2)
%13 = fmul double 3.141500e+00, %12
%14 = fmul double %13, 2.000000e+00
store double %14, double* %4
%15 = load i32, i32* %7
%16 = sitofp i32 %15 to double
%17 = fmul double 6.283000e+00, %16
%18 = load i32, i32* %8
%19 = sitofp i32 %18 to double
%20 = fmul double %17, %19
store double %20, double* %5
%21 = load double, double* %4
%22 = load double, double* %5
%23 = fadd double %21, %22
store double %23, double* %3
%24 = load double, double* %3
%25 = load double, double* %2
%26 = fmul double %24, %25
store double %26, double* %6
%27 = load double, double* %6
%28 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), double %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [28 x i8] c"O VALOR DO CUSTO E = %0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = call double @pow(i32 %7, i32 2)
%9 = load i32, i32* %1
%10 = sitofp i32 %9 to double
%11 = insertelement <2 x double> poison, double %8, i64 0
%12 = insertelement <2 x double> %11, double %10, i64 1
%13 = fmul <2 x double> %12, <double 3.141500e+00, double 6.283000e+00>
%14 = load i32, i32* %2
%15 = sitofp i32 %14 to double
%16 = insertelement <2 x double> <double 2.000000e+00, double poison>, double %15, i64 1
%17 = fmul <2 x double> %13, %16
%18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%19 = fadd <2 x double> %17, %18
%20 = extractelement <2 x double> %19, i64 0
%21 = fmul double %20, 1.000000e+02
%22 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), double %21)
ret i32 0
}