#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 */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int i, low_rate, month, num_years, year;
  double value[5];
  printf("Enter interest rate: ");
  scanf("%d", &low_rate);
  printf("Enter number of years: ");
  scanf("%d", &num_years);
  printf("\nYears");
  for (i = 0; i < ((int)(sizeof(value) / sizeof(value[0]))); i++) {
    printf("%6d%%", low_rate + i);
    value[i] = 100.00;
  }
  printf("\n");
  for (year = 1; year <= num_years; year++) {
    printf("%3d    ", year);
    for (i = 0; i < ((int)(sizeof(value) / sizeof(value[0]))); i++) {
      for (month = 1; month <= 12; month++)
        value[i] += ((double)(low_rate + i) / 12) / 100.0 * value[i];
      printf("%7.2f", value[i]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11be <main+0x9e>
mov    -0xc(%rbp),%esi
add    -0x8(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
movsd  0xe56(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp,%rax,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1180 <main+0x60>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     12a6 <main+0x186>
mov    -0x18(%rbp),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    128a <main+0x16a>
movl   $0x1,-0x10(%rbp)
cmpl   $0xc,-0x10(%rbp)
jg     1264 <main+0x144>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xde4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdd0(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x8(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm2
movslq -0x8(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp,%rax,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1208 <main+0xe8>
movslq -0x8(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
lea    0xde3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11f7 <main+0xd7>
lea    0xdbd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11d3 <main+0xb3>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xede(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee6(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xec7(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
add    $0x1,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movaps 0xe4d(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    0x8(%rsp),%esi
add    $0x2,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
add    $0x3,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movapd 0xe1e(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
mov    0x8(%rsp),%esi
add    $0x4,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movabs $0x4059000000000000,%rax
mov    %rax,0x30(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0xc(%rsp)
jle    1339 <main+0x209>
mov    $0x1,%r15d
lea    0xe34(%rip),%r14
lea    0xe35(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %ebx,%ebx
nop
mov    0x8(%rsp),%eax
add    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xdab(%rip),%xmm0
divsd  0xdab(%rip),%xmm0
movsd  0x10(%rsp,%rbx,8),%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rsp,%rbx,8)
mov    %r12,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x5,%rbx
jne    1250 <main+0x120>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r15),%eax
cmp    0xc(%rsp),%r15d
mov    %eax,%r15d
jl     1240 <main+0x110>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Enter interest rate: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Enter number of years: \00"
@.str.3 = [7 x i8] c"\0AYears\00"
@.str.4 = [6 x i8] c"%6d%%\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [8 x i8] c"%3d \00"
@.str.7 = [6 x i8] c"%7.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [5 x double]
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %13
13: ; preds = %24, %0
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 5
br i1 %15, label %16, label %27
16: ; preds = %13
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = add nsw i32 %17, %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 %22
store double 1.000000e+02, double* %23
br label %24
24: ; preds = %16
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %13
27: ; preds = %13
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %6
br label %29
29: ; preds = %73, %27
%30 = load i32, i32* %6
%31 = load i32, i32* %5
%32 = icmp sle i32 %30, %31
br i1 %32, label %33, label %76
33: ; preds = %29
%34 = load i32, i32* %6
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 %34)
store i32 0, i32* %2
br label %36
36: ; preds = %68, %33
%37 = load i32, i32* %2
%38 = icmp slt i32 %37, 5
br i1 %38, label %39, label %71
39: ; preds = %36
store i32 1, i32* %4
br label %40
40: ; preds = %59, %39
%41 = load i32, i32* %4
%42 = icmp sle i32 %41, 12
br i1 %42, label %43, label %62
43: ; preds = %40
%44 = load i32, i32* %3
%45 = load i32, i32* %2
%46 = add nsw i32 %44, %45
%47 = sitofp i32 %46 to double
%48 = fdiv double %47, 1.200000e+01
%49 = fdiv double %48, 1.000000e+02
%50 = load i32, i32* %2
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 %51
%53 = load double, double* %52
%54 = load i32, i32* %2
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 %55
%57 = load double, double* %56
%58 = call double @llvm.fmuladd.f64(double %49, double %53, double %57)
store double %58, double* %56
br label %59
59: ; preds = %43
%60 = load i32, i32* %4
%61 = add nsw i32 %60, 1
store i32 %61, i32* %4
br label %40
62: ; preds = %40
%63 = load i32, i32* %2
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 %64
%66 = load double, double* %65
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %66)
br label %68
68: ; preds = %62
%69 = load i32, i32* %2
%70 = add nsw i32 %69, 1
store i32 %70, i32* %2
br label %36
71: ; preds = %36
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %73
73: ; preds = %71
%74 = load i32, i32* %6
%75 = add nsw i32 %74, 1
store i32 %75, i32* %6
br label %29
76: ; preds = %29
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Enter interest rate: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Enter number of years: \00"
@.str.3 = [7 x i8] c"\0AYears\00"
@.str.4 = [6 x i8] c"%6d%%\00"
@.str.6 = [8 x i8] c"%3d \00"
@.str.7 = [6 x i8] c"%7.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x double]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [5 x double]* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %15)
%17 = bitcast [5 x double]* %3 to <2 x double>*
store <2 x double> <double 1.000000e+02, double 1.000000e+02>, <2 x double>* %17
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 2
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 2
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 3
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %23)
%25 = bitcast double* %21 to <2 x double>*
store <2 x double> <double 1.000000e+02, double 1.000000e+02>, <2 x double>* %25
%26 = load i32, i32* %1
%27 = add nsw i32 %26, 4
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 4
store double 1.000000e+02, double* %29
%30 = call i32 @putchar(i32 10)
%31 = load i32, i32* %2
%32 = icmp slt i32 %31, 1
br i1 %32, label %66, label %33
33: ; preds = %0, %61
%34 = phi i32 [ %63, %61 ], [ 1, %0 ]
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %33, %36
%37 = phi i64 [ 0, %33 ], [ %59, %36 ]
%38 = load i32, i32* %1
%39 = trunc i64 %37 to i32
%40 = add nsw i32 %38, %39
%41 = sitofp i32 %40 to double
%42 = fdiv double %41, 1.200000e+01
%43 = fdiv double %42, 1.000000e+02
%44 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 %37
%45 = load double, double* %44
%46 = call double @llvm.fmuladd.f64(double %43, double %45, double %45)
%47 = call double @llvm.fmuladd.f64(double %43, double %46, double %46)
%48 = call double @llvm.fmuladd.f64(double %43, double %47, double %47)
%49 = call double @llvm.fmuladd.f64(double %43, double %48, double %48)
%50 = call double @llvm.fmuladd.f64(double %43, double %49, double %49)
%51 = call double @llvm.fmuladd.f64(double %43, double %50, double %50)
%52 = call double @llvm.fmuladd.f64(double %43, double %51, double %51)
%53 = call double @llvm.fmuladd.f64(double %43, double %52, double %52)
%54 = call double @llvm.fmuladd.f64(double %43, double %53, double %53)
%55 = call double @llvm.fmuladd.f64(double %43, double %54, double %54)
%56 = call double @llvm.fmuladd.f64(double %43, double %55, double %55)
%57 = call double @llvm.fmuladd.f64(double %43, double %56, double %56)
store double %57, double* %44
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %57)
%59 = add nuw nsw i64 %37, 1
%60 = icmp eq i64 %59, 5
br i1 %60, label %61, label %36
61: ; preds = %36
%62 = call i32 @putchar(i32 10)
%63 = add nuw nsw i32 %34, 1
%64 = load i32, i32* %2
%65 = icmp slt i32 %34, %64
br i1 %65, label %33, label %66
66: ; preds = %61, %0
ret i32 0
}