#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 */
scalar_t__ pow(double, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  double rate = 1.02704;
  double money = 500.00;
  double sum;
  int ii;
  for (ii = 1; ii <= 20; ii++) {
    sum += pow(rate, ii);
  }
  printf("%f\n", sum);
  printf("%f\n", money * 12 * 20);
  printf("%f", sum * money * 12);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x24(%rbp)
cmpl   $0x14,-0x24(%rbp)
jg     1184 <main+0x64>
movsd  -0x10(%rbp),%xmm0
mov    -0x24(%rbp),%edi
call   1040 <pow@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1150 <main+0x30>
movsd  -0x20(%rbp),%xmm0
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe73(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe6e(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe44(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movsd  0xed7(%rip),%xmm0
mov    $0x1,%edi
call   1040 <pow@plt>
movsd  0xec5(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0xeb3(%rip),%xmm0
mov    $0x3,%edi
call   1040 <pow@plt>
movsd  0xea1(%rip),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
movsd  0xe8f(%rip),%xmm0
mov    $0x5,%edi
call   1040 <pow@plt>
movsd  0xe7d(%rip),%xmm0
mov    $0x6,%edi
call   1040 <pow@plt>
movsd  0xe6b(%rip),%xmm0
mov    $0x7,%edi
call   1040 <pow@plt>
movsd  0xe59(%rip),%xmm0
mov    $0x8,%edi
call   1040 <pow@plt>
movsd  0xe47(%rip),%xmm0
mov    $0x9,%edi
call   1040 <pow@plt>
movsd  0xe35(%rip),%xmm0
mov    $0xa,%edi
call   1040 <pow@plt>
movsd  0xe23(%rip),%xmm0
mov    $0xb,%edi
call   1040 <pow@plt>
movsd  0xe11(%rip),%xmm0
mov    $0xc,%edi
call   1040 <pow@plt>
movsd  0xdff(%rip),%xmm0
mov    $0xd,%edi
call   1040 <pow@plt>
movsd  0xded(%rip),%xmm0
mov    $0xe,%edi
call   1040 <pow@plt>
movsd  0xddb(%rip),%xmm0
mov    $0xf,%edi
call   1040 <pow@plt>
movsd  0xdc9(%rip),%xmm0
mov    $0x10,%edi
call   1040 <pow@plt>
movsd  0xdb7(%rip),%xmm0
mov    $0x11,%edi
call   1040 <pow@plt>
movsd  0xda5(%rip),%xmm0
mov    $0x12,%edi
call   1040 <pow@plt>
movsd  0xd93(%rip),%xmm0
mov    $0x13,%edi
call   1040 <pow@plt>
movsd  0xd81(%rip),%xmm0
mov    $0x14,%edi
call   1040 <pow@plt>
lea    0xd88(%rip),%rbx
movsd  0xd70(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xd68(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xd65(%rip),%rdi
movsd  0xd49(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store i32 0, i32* %1
store double 1.027040e+00, double* %2
store double 5.000000e+02, double* %3
store i32 1, i32* %5
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %5
%8 = icmp sle i32 %7, 20
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load double, double* %2
%11 = load i32, i32* %5
%12 = call i64 @pow(double %10, i32 %11)
%13 = sitofp i64 %12 to double
%14 = load double, double* %4
%15 = fadd double %14, %13
store double %15, double* %4
br label %16
16: ; preds = %9
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
%20 = load double, double* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %20)
%22 = load double, double* %3
%23 = fmul double %22, 1.200000e+01
%24 = fmul double %23, 2.000000e+01
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %24)
%26 = load double, double* %4
%27 = load double, double* %3
%28 = fmul double %26, %27
%29 = fmul double %28, 1.200000e+01
%30 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = tail call i64 @pow(double 1.027040e+00, i32 1)
%2 = tail call i64 @pow(double 1.027040e+00, i32 2)
%3 = tail call i64 @pow(double 1.027040e+00, i32 3)
%4 = tail call i64 @pow(double 1.027040e+00, i32 4)
%5 = tail call i64 @pow(double 1.027040e+00, i32 5)
%6 = tail call i64 @pow(double 1.027040e+00, i32 6)
%7 = tail call i64 @pow(double 1.027040e+00, i32 7)
%8 = tail call i64 @pow(double 1.027040e+00, i32 8)
%9 = tail call i64 @pow(double 1.027040e+00, i32 9)
%10 = tail call i64 @pow(double 1.027040e+00, i32 10)
%11 = tail call i64 @pow(double 1.027040e+00, i32 11)
%12 = tail call i64 @pow(double 1.027040e+00, i32 12)
%13 = tail call i64 @pow(double 1.027040e+00, i32 13)
%14 = tail call i64 @pow(double 1.027040e+00, i32 14)
%15 = tail call i64 @pow(double 1.027040e+00, i32 15)
%16 = tail call i64 @pow(double 1.027040e+00, i32 16)
%17 = tail call i64 @pow(double 1.027040e+00, i32 17)
%18 = tail call i64 @pow(double 1.027040e+00, i32 18)
%19 = tail call i64 @pow(double 1.027040e+00, i32 19)
%20 = tail call i64 @pow(double 1.027040e+00, i32 20)
%21 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0x7FF8000000000000)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 1.200000e+05)
%23 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double 0x7FF8000000000000)
ret i32 0
}