#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);
void main() {
  double principal[49];
  int i;
  principal[48] = (double)1000;
  for (i = 47; i > 0; i--)
    principal[i] = (principal[i + 1] + 1000) / (1 + 0.0171 / 12);
  for (i = 48; i >= 0; i--)
    printf("%.2f\n", principal[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movsd  0xedd(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x2f,-0x194(%rbp)
cmpl   $0x0,-0x194(%rbp)
jle    118b <main+0x7b>
mov    -0x194(%rbp),%eax
add    $0x1,%eax
cltq
movsd  0xeae(%rip),%xmm0
addsd  -0x190(%rbp,%rax,8),%xmm0
ff ff
movsd  0xea5(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x194(%rbp),%rax
movsd  %xmm0,-0x190(%rbp,%rax,8)
ff ff
mov    -0x194(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x194(%rbp)
jmp    1132 <main+0x22>
movl   $0x30,-0x194(%rbp)
cmpl   $0x0,-0x194(%rbp)
jl     11d2 <main+0xc2>
movslq -0x194(%rbp),%rax
movsd  -0x190(%rbp,%rax,8),%xmm0
ff ff
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
mov    -0x194(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x194(%rbp)
jmp    1195 <main+0x85>
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x188,%rsp
movabs $0x408f400000000000,%rax
40 8f 40
mov    %rax,0x180(%rsp)
mov    $0x2f,%eax
movsd  0xec7(%rip),%xmm0
movsd  0xec7(%rip),%xmm1
movapd %xmm0,%xmm2
cs nopw 0x0(%rax,%rax,1)
nop
addsd  %xmm0,%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp,%rax,8)
cmp    $0x1,%rax
jbe    1177 <main+0x67>
addsd  %xmm0,%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,-0x8(%rsp,%rax,8)
add    $0xfffffffffffffffe,%rax
jmp    1150 <main+0x40>
mov    $0x30,%ebx
lea    0xe8d(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%rsp,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     1190 <main+0x80>
add    $0x188,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.2f\0A\00"
define void @main() {
%1 = alloca [49 x double]
%2 = alloca i32
%3 = getelementptr inbounds [49 x double], [49 x double]* %1, i64 0, i64 48
store double 1.000000e+03, double* %3
store i32 47, i32* %2
br label %4
4: ; preds = %18, %0
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [49 x double], [49 x double]* %1, i64 0, i64 %10
%12 = load double, double* %11
%13 = fadd double %12, 1.000000e+03
%14 = fdiv double %13, 0x3FF005D63886594B
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [49 x double], [49 x double]* %1, i64 0, i64 %16
store double %14, double* %17
br label %18
18: ; preds = %7
%19 = load i32, i32* %2
%20 = add nsw i32 %19, -1
store i32 %20, i32* %2
br label %4
21: ; preds = %4
store i32 48, i32* %2
br label %22
22: ; preds = %31, %21
%23 = load i32, i32* %2
%24 = icmp sge i32 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %22
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [49 x double], [49 x double]* %1, i64 0, i64 %27
%29 = load double, double* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %29)
br label %31
31: ; preds = %25
%32 = load i32, i32* %2
%33 = add nsw i32 %32, -1
store i32 %33, i32* %2
br label %22
34: ; preds = %22
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f\0A\00"
define void @main() {
%1 = alloca [49 x double]
%2 = bitcast [49 x double]* %1 to i8*
%3 = getelementptr inbounds [49 x double], [49 x double]* %1, i64 0, i64 48
store double 1.000000e+03, double* %3
br label %4
4: ; preds = %11, %0
%5 = phi double [ 1.000000e+03, %0 ], [ %14, %11 ]
%6 = phi i64 [ 47, %0 ], [ %16, %11 ]
%7 = fadd double %5, 1.000000e+03
%8 = fdiv double %7, 0x3FF005D63886594B
%9 = getelementptr inbounds [49 x double], [49 x double]* %1, i64 0, i64 %6
store double %8, double* %9
%10 = icmp ugt i64 %6, 1
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = add nsw i64 %6, -1
%13 = fadd double %8, 1.000000e+03
%14 = fdiv double %13, 0x3FF005D63886594B
%15 = getelementptr inbounds [49 x double], [49 x double]* %1, i64 0, i64 %12
store double %14, double* %15
%16 = add nsw i64 %6, -2
br label %4
17: ; preds = %4, %17
%18 = phi i64 [ %22, %17 ], [ 48, %4 ]
%19 = getelementptr inbounds [49 x double], [49 x double]* %1, i64 0, i64 %18
%20 = load double, double* %19
%21 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %20)
%22 = add nsw i64 %18, -1
%23 = icmp eq i64 %18, 0
br i1 %23, label %24, label %17
24: ; preds = %17
ret void
}