#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 *, ...);
void main() {
  const float rendimento = 0.006;
  float valor = 0;
  printf("Primeiro mes:\n");
  printf("Deposito de 1000 reais.\n\n");
  valor = 1000;
  printf("Segundo mes:\n");
  valor += valor * rendimento;
  printf("Deposito de 800 reais.\n\n");
  valor += 800;
  printf("Terceiro mes:\n");
  valor += valor * rendimento;
  printf("Saque de 500 reais.\n\n");
  valor -= 500;
  printf("Quarto mes:\n");
  valor += valor * rendimento;
  printf("%f", valor);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xebb(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe8a(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xe6f(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe3d(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe19(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xdec(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe61(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rdi
movsd  0xe7c(%rip),%xmm0
mov    $0x1,%al
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Primeiro mes:\0A\00"
@.str.1 = [26 x i8] c"Deposito de 1000 reais.\0A\0A\00"
@.str.2 = [14 x i8] c"Segundo mes:\0A\00"
@.str.3 = [25 x i8] c"Deposito de 800 reais.\0A\0A\00"
@.str.4 = [15 x i8] c"Terceiro mes:\0A\00"
@.str.5 = [22 x i8] c"Saque de 500 reais.\0A\0A\00"
@.str.6 = [13 x i8] c"Quarto mes:\0A\00"
@.str.7 = [3 x i8] c"%f\00"
define void @main() {
%1 = alloca float
%2 = alloca float
store float 0x3F789374C0000000, float* %1
store float 0.000000e+00, float* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
store float 1.000000e+03, float* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%6 = load float, float* %2
%7 = load float, float* %2
%8 = call float @llvm.fmuladd.f32(float %6, float 0x3F789374C0000000, float %7)
store float %8, float* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%10 = load float, float* %2
%11 = fadd float %10, 8.000000e+02
store float %11, float* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%13 = load float, float* %2
%14 = load float, float* %2
%15 = call float @llvm.fmuladd.f32(float %13, float 0x3F789374C0000000, float %14)
store float %15, float* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%17 = load float, float* %2
%18 = fsub float %17, 5.000000e+02
store float %18, float* %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%20 = load float, float* %2
%21 = load float, float* %2
%22 = call float @llvm.fmuladd.f32(float %20, float 0x3F789374C0000000, float %21)
store float %22, float* %2
%23 = load float, float* %2
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), double %24)
ret void
}

LLVM IR (-O2):
@.str.7 = [3 x i8] c"%f\00"
@str = [14 x i8] c"Primeiro mes:\00"
@str.8 = [25 x i8] c"Deposito de 1000 reais.\0A\00"
@str.9 = [13 x i8] c"Segundo mes:\00"
@str.10 = [24 x i8] c"Deposito de 800 reais.\0A\00"
@str.11 = [14 x i8] c"Terceiro mes:\00"
@str.12 = [21 x i8] c"Saque de 500 reais.\0A\00"
@str.13 = [12 x i8] c"Quarto mes:\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.8, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.9, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.10, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.11, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.12, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.13, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), double 0x4094B2F2C0000000)
ret void
}