#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 low_rate, num_years;
  double value[5];
  printf("Enter interest rate: ");
  scanf("%d", &low_rate);
  printf("Enter number of years: ");
  scanf("%d", &num_years);
  printf("\nYears");
  for (int i = 0; i < ((int)(sizeof(value) / sizeof(value[0]))); i += 1) {
    printf("%6d%%", low_rate + 1);
    value[i] = 100.00;
  }
  printf("\n");
  for (int year = 1; year <= num_years; year += 1) {
    printf("%3d\t", year);
    for (int i = 0; i < ((int)(sizeof(value) / sizeof(value[0]))); i += 1) {
      value[i] += (low_rate + i) / 100.0 * value[i];
      printf("%7.2f", value[i]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x5,-0x44(%rbp)
jge    11be <main+0x9e>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x44(%rbp),%rax
movsd  0xe56(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp,%rax,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1180 <main+0x60>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     127b <main+0x15b>
mov    -0x48(%rbp),%esi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c(%rbp)
cmpl   $0x5,-0x4c(%rbp)
jge    125f <main+0x13f>
mov    -0x8(%rbp),%eax
add    -0x4c(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xded(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x4c(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm2
movslq -0x4c(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp,%rax,8)
movslq -0x4c(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
lea    0xe03(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11f7 <main+0xd7>
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    11d3 <main+0xb3>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
add    $0x1,%esi
lea    0xeb2(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
add    $0x1,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
add    $0x1,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
add    $0x1,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
add    $0x1,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rsp)
jle    1351 <main+0x221>
movsd  0xe0b(%rip),%xmm0
lea    0xe4a(%rip),%r14
lea    0xe48(%rip),%rbx
xor    %ebp,%ebp
movsd  %xmm0,0x28(%rsp)
movsd  %xmm0,0x20(%rsp)
movsd  %xmm0,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xorps  %xmm2,%xmm2
cvtsi2sdl (%rsp),%xmm2
movsd  0xdb1(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm2
addsd  %xmm2,%xmm0
mov    %rbx,%rdi
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%rsp),%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  0xd7a(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm0
mov    %rbx,%rdi
movsd  %xmm0,0x10(%rsp)
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%rsp),%eax
add    $0x2,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  0xd47(%rip),%xmm1
movsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm0
mov    %rbx,%rdi
movsd  %xmm0,0x18(%rsp)
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%rsp),%eax
add    $0x3,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  0xd14(%rip),%xmm1
movsd  0x20(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm0
mov    %rbx,%rdi
movsd  %xmm0,0x20(%rsp)
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%rsp),%eax
add    $0x4,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  0xce1(%rip),%xmm1
movsd  0x28(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm0
mov    %rbx,%rdi
movsd  %xmm0,0x28(%rsp)
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    0x4(%rsp),%ebp
jl     1230 <main+0x100>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
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 = [5 x i8] c"%3d\09\00"
@.str.7 = [6 x i8] c"%7.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [5 x double]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
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* %2)
%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* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %5
br label %13
13: ; preds = %23, %0
%14 = load i32, i32* %5
%15 = icmp slt i32 %14, 5
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 %21
store double 1.000000e+02, double* %22
br label %23
23: ; preds = %16
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %13
26: ; preds = %13
%27 = 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 %28
28: ; preds = %63, %26
%29 = load i32, i32* %6
%30 = load i32, i32* %3
%31 = icmp sle i32 %29, %30
br i1 %31, label %32, label %66
32: ; preds = %28
%33 = load i32, i32* %6
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %33)
store i32 0, i32* %7
br label %35
35: ; preds = %58, %32
%36 = load i32, i32* %7
%37 = icmp slt i32 %36, 5
br i1 %37, label %38, label %61
38: ; preds = %35
%39 = load i32, i32* %2
%40 = load i32, i32* %7
%41 = add nsw i32 %39, %40
%42 = sitofp i32 %41 to double
%43 = fdiv double %42, 1.000000e+02
%44 = load i32, i32* %7
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 %45
%47 = load double, double* %46
%48 = load i32, i32* %7
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 %49
%51 = load double, double* %50
%52 = call double @llvm.fmuladd.f64(double %43, double %47, double %51)
store double %52, double* %50
%53 = load i32, i32* %7
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 %54
%56 = load double, double* %55
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %56)
br label %58
58: ; preds = %38
%59 = load i32, i32* %7
%60 = add nsw i32 %59, 1
store i32 %60, i32* %7
br label %35
61: ; preds = %35
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %63
63: ; preds = %61
%64 = load i32, i32* %6
%65 = add nsw i32 %64, 1
store i32 %65, i32* %6
br label %28
66: ; preds = %28
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 = [5 x i8] c"%3d\09\00"
@.str.7 = [6 x i8] c"%7.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 1
%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 = call i32 @putchar(i32 10)
%26 = load i32, i32* %2
%27 = icmp slt i32 %26, 1
br i1 %27, label %28, label %29
28: ; preds = %29, %0
ret i32 0
29: ; preds = %0, %29
%30 = phi double [ %64, %29 ], [ 1.000000e+02, %0 ]
%31 = phi double [ %58, %29 ], [ 1.000000e+02, %0 ]
%32 = phi double [ %52, %29 ], [ 1.000000e+02, %0 ]
%33 = phi double [ %46, %29 ], [ 1.000000e+02, %0 ]
%34 = phi double [ %40, %29 ], [ 1.000000e+02, %0 ]
%35 = phi i32 [ %67, %29 ], [ 1, %0 ]
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %1
%38 = sitofp i32 %37 to double
%39 = fdiv double %38, 1.000000e+02
%40 = call double @llvm.fmuladd.f64(double %39, double %34, double %34)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %40)
%42 = load i32, i32* %1
%43 = add nsw i32 %42, 1
%44 = sitofp i32 %43 to double
%45 = fdiv double %44, 1.000000e+02
%46 = call double @llvm.fmuladd.f64(double %45, double %33, double %33)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %46)
%48 = load i32, i32* %1
%49 = add nsw i32 %48, 2
%50 = sitofp i32 %49 to double
%51 = fdiv double %50, 1.000000e+02
%52 = call double @llvm.fmuladd.f64(double %51, double %32, double %32)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %52)
%54 = load i32, i32* %1
%55 = add nsw i32 %54, 3
%56 = sitofp i32 %55 to double
%57 = fdiv double %56, 1.000000e+02
%58 = call double @llvm.fmuladd.f64(double %57, double %31, double %31)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %58)
%60 = load i32, i32* %1
%61 = add nsw i32 %60, 4
%62 = sitofp i32 %61 to double
%63 = fdiv double %62, 1.000000e+02
%64 = call double @llvm.fmuladd.f64(double %63, double %30, double %30)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %64)
%66 = call i32 @putchar(i32 10)
%67 = add nuw nsw i32 %35, 1
%68 = load i32, i32* %2
%69 = icmp slt i32 %35, %68
br i1 %69, label %29, label %28
}