#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 *, double, ...);
int /*<<< orphan*/ scanf(char *, double *, double *, int *);
int main() {
  double d, tj;
  int t, i;
  scanf("%lf %lf %d", &d, &tj, &t);
  tj = (tj / 100);
  for (i = 0; i < t; i++) {
    printf("Rendimento no mes %d: %.2lf\n", i, d * tj);
    d += (d * tj);
  }
  printf("Saldo final do investimento: %.2lf\n", d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xeac(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11b7 <main+0x97>
cvtsi2sdl -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
lea    0xe8d(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1164 <main+0x44>
movsd  -0x10(%rbp),%xmm0
lea    0xe6d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xedb(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm1
divsd  0xeb1(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
cmpl   $0x0,0x4(%rsp)
movsd  0x10(%rsp),%xmm0
jle    11ac <main+0x8c>
xor    %ebp,%ebp
lea    0xea8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mov    %rbx,%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
movapd %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rsp)
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1170 <main+0x50>
lea    0xe7d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%lf %lf %d\00"
@.str.1 = [29 x i8] c"Rendimento no mes %d: %.2lf\0A\00"
@.str.2 = [36 x i8] c"Saldo final do investimento: %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, i32* %4)
%7 = load double, double* %3
%8 = fdiv double %7, 1.000000e+02
store double %8, double* %3
store i32 0, i32* %5
br label %9
9: ; preds = %24, %0
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load i32, i32* %5
%15 = sitofp i32 %14 to double
%16 = load double, double* %2
%17 = load double, double* %3
%18 = fmul double %16, %17
%19 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), double %15, double %18)
%20 = load double, double* %2
%21 = load double, double* %3
%22 = load double, double* %2
%23 = call double @llvm.fmuladd.f64(double %20, double %21, double %22)
store double %23, double* %2
br label %24
24: ; preds = %13
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %9
27: ; preds = %9
%28 = load double, double* %2
%29 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%lf %lf %d\00"
@.str.1 = [29 x i8] c"Rendimento no mes %d: %.2lf\0A\00"
@.str.2 = [36 x i8] c"Saldo final do investimento: %.2lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca i32
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, i32* %3)
%8 = load double, double* %2
%9 = fdiv double %8, 1.000000e+02
store double %9, double* %2
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
%12 = load double, double* %1
br i1 %11, label %13, label %26
13: ; preds = %0, %13
%14 = phi double [ %21, %13 ], [ %9, %0 ]
%15 = phi double [ %22, %13 ], [ %12, %0 ]
%16 = phi i32 [ %23, %13 ], [ 0, %0 ]
%17 = sitofp i32 %16 to double
%18 = fmul double %15, %14
%19 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), double %17, double %18)
%20 = load double, double* %1
%21 = load double, double* %2
%22 = call double @llvm.fmuladd.f64(double %20, double %21, double %20)
store double %22, double* %1
%23 = add nuw nsw i32 %16, 1
%24 = load i32, i32* %3
%25 = icmp slt i32 %23, %24
br i1 %25, label %13, label %26
26: ; preds = %13, %0
%27 = phi double [ %12, %0 ], [ %22, %13 ]
%28 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %27)
ret i32 0
}