#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 /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
void main(void) {
  int qtMeses, c;
  float valAplic, txJuros, valJur, valor;
  printf("Insira o valor aplicado: ");
  scanf("%f", &valAplic);
  printf("Insira a taxa de Juros: ");
  scanf("%f", &txJuros);
  printf("Insira a Quantidade de meses: ");
  scanf("%i", &qtMeses);
  valor = valAplic;
  for (c = 1; c <= qtMeses; c++)
    valor = valor + valor * txJuros / 100;
  valJur = valor - valAplic;
  printf("R$%.2f", valJur);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11d7 <main+0xb7>
movss  -0x18(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movss  0xe44(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1199 <main+0x79>
movss  -0x18(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe66(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0x8(%rsp),%xmm0
mov    0xc(%rsp),%eax
movaps %xmm0,%xmm2
test   %eax,%eax
jle    11f7 <main+0xd7>
movss  0x4(%rsp),%xmm1
movaps %xmm0,%xmm2
cmp    $0x1,%eax
je     11e3 <main+0xc3>
mov    %eax,%ecx
and    $0xfffffffe,%ecx
movss  0xe4d(%rip),%xmm3
movaps %xmm0,%xmm2
cs nopw 0x0(%rax,%rax,1)
movaps %xmm2,%xmm4
mulss  %xmm1,%xmm4
divss  %xmm3,%xmm4
addss  %xmm2,%xmm4
movaps %xmm4,%xmm2
mulss  %xmm1,%xmm2
divss  %xmm3,%xmm2
addss  %xmm4,%xmm2
add    $0xfffffffe,%ecx
jne    11c0 <main+0xa0>
test   $0x1,%al
je     11f7 <main+0xd7>
mulss  %xmm2,%xmm1
divss  0xe0d(%rip),%xmm1
addss  %xmm1,%xmm2
subss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
lea    0xe53(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Insira o valor aplicado: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"Insira a taxa de Juros: \00"
@.str.3 = [31 x i8] c"Insira a Quantidade de meses: \00"
@.str.4 = [3 x i8] c"%i\00"
@.str.5 = [7 x i8] c"R$%.2f\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%13 = load float, float* %3
store float %13, float* %6
store i32 1, i32* %2
br label %14
14: ; preds = %25, %0
%15 = load i32, i32* %2
%16 = load i32, i32* %1
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load float, float* %6
%20 = load float, float* %6
%21 = load float, float* %4
%22 = fmul float %20, %21
%23 = fdiv float %22, 1.000000e+02
%24 = fadd float %19, %23
store float %24, float* %6
br label %25
25: ; preds = %18
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %14
28: ; preds = %14
%29 = load float, float* %6
%30 = load float, float* %3
%31 = fsub float %29, %30
store float %31, float* %5
%32 = load float, float* %5
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %33)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Insira o valor aplicado: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"Insira a taxa de Juros: \00"
@.str.3 = [31 x i8] c"Insira a Quantidade de meses: \00"
@.str.4 = [3 x i8] c"%i\00"
@.str.5 = [7 x i8] c"R$%.2f\00"
define void @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = bitcast i32* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%13 = load float, float* %2
%14 = load i32, i32* %1
%15 = icmp slt i32 %14, 1
br i1 %15, label %41, label %16
16: ; preds = %0
%17 = load float, float* %3
%18 = and i32 %14, 1
%19 = icmp eq i32 %14, 1
br i1 %19, label %33, label %20
20: ; preds = %16
%21 = and i32 %14, -2
br label %22
22: ; preds = %22, %20
%23 = phi float [ %13, %20 ], [ %30, %22 ]
%24 = phi i32 [ 0, %20 ], [ %31, %22 ]
%25 = fmul float %23, %17
%26 = fdiv float %25, 1.000000e+02
%27 = fadd float %23, %26
%28 = fmul float %27, %17
%29 = fdiv float %28, 1.000000e+02
%30 = fadd float %27, %29
%31 = add i32 %24, 2
%32 = icmp eq i32 %31, %21
br i1 %32, label %33, label %22
33: ; preds = %22, %16
%34 = phi float [ undef, %16 ], [ %30, %22 ]
%35 = phi float [ %13, %16 ], [ %30, %22 ]
%36 = icmp eq i32 %18, 0
br i1 %36, label %41, label %37
37: ; preds = %33
%38 = fmul float %35, %17
%39 = fdiv float %38, 1.000000e+02
%40 = fadd float %35, %39
br label %41
41: ; preds = %37, %33, %0
%42 = phi float [ %13, %0 ], [ %34, %33 ], [ %40, %37 ]
%43 = fsub float %42, %13
%44 = fpext float %43 to double
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %44)
ret void
}