#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_s(char *, int *, int);
int main(void) {
  int i, low_rate, num_years, year;
  double value[5];
  printf("Enter interest rate: ");
  scanf_s("%d", &low_rate, 1);
  printf("Enter number of years: ");
  scanf_s("%d", &num_years, 1);
  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++) {
      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    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1040 <scanf_s@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11c8 <main+0xa8>
mov    -0xc(%rbp),%esi
add    -0x8(%rbp),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
movsd  0xe4c(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp,%rax,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118a <main+0x6a>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1285 <main+0x165>
mov    -0x14(%rbp),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1269 <main+0x149>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xde3(%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)
movslq -0x8(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
lea    0xdfd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1201 <main+0xe1>
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11dd <main+0xbd>
xor    %eax,%eax
add    $0x40,%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
mov    $0x1,%edx
call   1050 <scanf_s@plt>
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1050 <scanf_s@plt>
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
lea    0xeab(%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    $0x2,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
add    $0x3,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
add    $0x4,%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  0xe04(%rip),%xmm0
lea    0xe43(%rip),%r14
lea    0xe45(%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)
nopw   0x0(%rax,%rax,1)
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 = [9 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 [5 x double]
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32 1)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32 1)
%11 = 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 %12
12: ; preds = %23, %0
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 5
br i1 %14, label %15, label %26
15: ; preds = %12
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = add nsw i32 %16, %17
%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* %2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 %21
store double 1.000000e+02, double* %22
br label %23
23: ; preds = %15
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %12
26: ; preds = %12
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %5
br label %28
28: ; preds = %63, %26
%29 = load i32, i32* %5
%30 = load i32, i32* %4
%31 = icmp sle i32 %29, %30
br i1 %31, label %32, label %66
32: ; preds = %28
%33 = load i32, i32* %5
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %33)
store i32 0, i32* %2
br label %35
35: ; preds = %58, %32
%36 = load i32, i32* %2
%37 = icmp slt i32 %36, 5
br i1 %37, label %38, label %61
38: ; preds = %35
%39 = load i32, i32* %3
%40 = load i32, i32* %2
%41 = add nsw i32 %39, %40
%42 = sitofp i32 %41 to double
%43 = fdiv double %42, 1.000000e+02
%44 = load i32, i32* %2
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 %45
%47 = load double, double* %46
%48 = load i32, i32* %2
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [5 x double], [5 x double]* %6, 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* %2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [5 x double], [5 x double]* %6, 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* %2
%60 = add nsw i32 %59, 1
store i32 %60, i32* %2
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* %5
%65 = add nsw i32 %64, 1
store i32 %65, i32* %5
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 = [9 x i8] c"%3d \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_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1, 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_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32 1)
%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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 2
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 3
%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 = load i32, i32* %1
%22 = add nsw i32 %21, 4
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %22)
%24 = call i32 @putchar(i32 10)
%25 = load i32, i32* %2
%26 = icmp slt i32 %25, 1
br i1 %26, label %68, label %27
27: ; preds = %0, %27
%28 = phi double [ %62, %27 ], [ 1.000000e+02, %0 ]
%29 = phi double [ %56, %27 ], [ 1.000000e+02, %0 ]
%30 = phi double [ %50, %27 ], [ 1.000000e+02, %0 ]
%31 = phi double [ %44, %27 ], [ 1.000000e+02, %0 ]
%32 = phi double [ %38, %27 ], [ 1.000000e+02, %0 ]
%33 = phi i32 [ %65, %27 ], [ 1, %0 ]
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %33)
%35 = load i32, i32* %1
%36 = sitofp i32 %35 to double
%37 = fdiv double %36, 1.000000e+02
%38 = call double @llvm.fmuladd.f64(double %37, double %32, double %32)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %38)
%40 = load i32, i32* %1
%41 = add nsw i32 %40, 1
%42 = sitofp i32 %41 to double
%43 = fdiv double %42, 1.000000e+02
%44 = call double @llvm.fmuladd.f64(double %43, double %31, double %31)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %44)
%46 = load i32, i32* %1
%47 = add nsw i32 %46, 2
%48 = sitofp i32 %47 to double
%49 = fdiv double %48, 1.000000e+02
%50 = call double @llvm.fmuladd.f64(double %49, double %30, double %30)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %50)
%52 = load i32, i32* %1
%53 = add nsw i32 %52, 3
%54 = sitofp i32 %53 to double
%55 = fdiv double %54, 1.000000e+02
%56 = call double @llvm.fmuladd.f64(double %55, double %29, double %29)
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %56)
%58 = load i32, i32* %1
%59 = add nsw i32 %58, 4
%60 = sitofp i32 %59 to double
%61 = fdiv double %60, 1.000000e+02
%62 = call double @llvm.fmuladd.f64(double %61, double %28, double %28)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %62)
%64 = call i32 @putchar(i32 10)
%65 = add nuw nsw i32 %33, 1
%66 = load i32, i32* %2
%67 = icmp slt i32 %33, %66
br i1 %67, label %27, label %68
68: ; preds = %27, %0
ret i32 0
}