#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 *, float, float);
int /*<<< orphan*/ scanf(char *, float *, float *, int *);
int main() {
  int i, x;
  float inves, juros, rend;
  scanf("%f %f %d", &inves, &juros, &x);
  x = x * 12;
  for (i = 0; i < x; i = i + 3) {
    rend = inves * juros;
    inves = inves + rend;
    printf("Rendimento: %.2f Montante: %.2f\n", rend, inves);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
imul   $0xc,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a3 <main+0x83>
movss  -0x10(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <main+0x35>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xed3(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
lea    0x0(,%rax,4),%ecx
lea    (%rcx,%rcx,2),%ecx
mov    %ecx,0xc(%rsp)
test   %eax,%eax
jle    118b <main+0x6b>
xor    %ebp,%ebp
lea    0xea9(%rip),%rbx
movss  0x10(%rsp),%xmm1
movss  0x14(%rsp),%xmm0
mulss  %xmm1,%xmm0
addss  %xmm0,%xmm1
movss  %xmm1,0x10(%rsp)
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x3,%ebp
cmp    0xc(%rsp),%ebp
jl     1160 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%f %f %d\00"
@.str.1 = [33 x i8] c"Rendimento: %.2f Montante: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %4, float* %5, i32* %3)
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 12
store i32 %9, i32* %3
store i32 0, i32* %2
br label %10
10: ; preds = %24, %0
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = load float, float* %4
%16 = load float, float* %5
%17 = fmul float %15, %16
store float %17, float* %6
%18 = load float, float* %4
%19 = load float, float* %6
%20 = fadd float %18, %19
store float %20, float* %4
%21 = load float, float* %6
%22 = load float, float* %4
%23 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), float %21, float %22)
br label %24
24: ; preds = %14
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 3
store i32 %26, i32* %2
br label %10
27: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%f %f %d\00"
@.str.1 = [33 x i8] c"Rendimento: %.2f Montante: %.2f\0A\00"
define i32 @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 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %2, float* %3, i32* %1)
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, 12
store i32 %9, i32* %1
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %21
11: ; preds = %0, %11
%12 = phi i32 [ %18, %11 ], [ 0, %0 ]
%13 = load float, float* %2
%14 = load float, float* %3
%15 = fmul float %13, %14
%16 = fadd float %13, %15
store float %16, float* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), float %15, float %16)
%18 = add nuw nsw i32 %12, 3
%19 = load i32, i32* %1
%20 = icmp slt i32 %18, %19
br i1 %20, label %11, label %21
21: ; preds = %11, %0
ret i32 0
}