#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();
double pow(double, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float p, i, I, n, VA;
  printf("\n ** Calculo do rendimento de uma poupança **\n\n");
  printf("Informe a aplicação mensal: ");
  scanf("%f", &p);
  printf("Informe a taxa de juros da poupança aplicada: ");
  scanf("%f", &I);
  printf("Informe o numero de meses aplicados: ");
  scanf("%f", &n);
  i = I / 100.0;
  VA = (((pow(1.0 + i, n)) - 1.0) / i) * p;
  printf("O valor acumulado é de: %.2f reais.\n\n", VA);
  printf("\n<< Marco Tulio>>\n");
  getchar(), getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe47(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe21(%rip),%xmm0
addsd  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
call   1060 <pow@plt>
movsd  0xe0b(%rip),%xmm1
subsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xea6(%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    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xf5b(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec1(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  0x10(%rsp),%xmm0
divss  0xe39(%rip),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0xe2f(%rip),%xmm0
addsd  %xmm1,%xmm0
movss  0xc(%rsp),%xmm1
call   1070 <pow@plt>
addsd  0xe20(%rip),%xmm0
divsd  0x18(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"\0A ** Calculo do rendimento de uma poupan\C3\A7a **\0A\0A\00"
@.str.1 = [31 x i8] c"Informe a aplica\C3\A7\C3\A3o mensal: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [48 x i8] c"Informe a taxa de juros da poupan\C3\A7a aplicada: \00"
@.str.4 = [38 x i8] c"Informe o numero de meses aplicados: \00"
@.str.5 = [39 x i8] c"O valor acumulado \C3\A9 de: %.2f reais.\0A\0A\00"
@.str.6 = [19 x i8] c"\0A<< Marco Tulio>>\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %4)
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fdiv double %14, 1.000000e+02
%16 = fptrunc double %15 to float
store float %16, float* %2
%17 = load float, float* %2
%18 = fpext float %17 to double
%19 = fadd double 1.000000e+00, %18
%20 = load float, float* %4
%21 = call double @pow(double %19, float %20)
%22 = fsub double %21, 1.000000e+00
%23 = load float, float* %2
%24 = fpext float %23 to double
%25 = fdiv double %22, %24
%26 = load float, float* %1
%27 = fpext float %26 to double
%28 = fmul double %25, %27
%29 = fptrunc double %28 to float
store float %29, float* %5
%30 = load float, float* %5
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), double %31)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%34 = call i32 (...) @getchar()
%35 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [31 x i8] c"Informe a aplica\C3\A7\C3\A3o mensal: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [48 x i8] c"Informe a taxa de juros da poupan\C3\A7a aplicada: \00"
@.str.4 = [38 x i8] c"Informe o numero de meses aplicados: \00"
@.str.5 = [39 x i8] c"O valor acumulado \C3\A9 de: %.2f reais.\0A\0A\00"
@str = [48 x i8] c"\0A ** Calculo do rendimento de uma poupan\C3\A7a **\0A\00"
@str.7 = [18 x i8] c"\0A<< Marco Tulio>>\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 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%14 = load float, float* %2
%15 = fdiv float %14, 1.000000e+02
%16 = fpext float %15 to double
%17 = fadd double %16, 1.000000e+00
%18 = load float, float* %3
%19 = call double @pow(double %17, float %18)
%20 = fadd double %19, -1.000000e+00
%21 = fdiv double %20, %16
%22 = load float, float* %1
%23 = fpext float %22 to double
%24 = fmul double %21, %23
%25 = fptrunc double %24 to float
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), double %26)
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.7, i64 0, i64 0))
%29 = call i32 (...) @getchar()
%30 = call i32 (...) @getchar()
ret i32 0
}