#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 start_rate, num_years;
  double value[5];
  printf("enter interest rate:\n");
  scanf("%d", &start_rate);
  printf("enter number of years:\n");
  scanf("%d", &num_years);
  printf("\nYears");
  for (int i = 0; i < ((int)(sizeof(value) / sizeof(value[0]))); i++) {
    printf("%6d%", ((int)(sizeof(value) / sizeof(value[0]))) + i);
    value[i] = 100;
  }
  printf("\n");
  for (int i = 1; i < num_years + 1; i++) {
    printf("%3d\t", i);
    for (int i = 0; i < ((int)(sizeof(value) / sizeof(value[0]))); i++) {
      value[i] = (1 + (start_rate + i) / 100) * value[i];
      printf("%7.2f\n", 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    -0x44(%rbp),%esi
add    $0x5,%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    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1271 <main+0x151>
mov    -0x48(%rbp),%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c(%rbp)
cmpl   $0x5,-0x4c(%rbp)
jge    1255 <main+0x135>
mov    -0x8(%rbp),%eax
add    -0x4c(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movslq -0x4c(%rbp),%rax
mulsd  -0x40(%rbp,%rax,8),%xmm0
movslq -0x4c(%rbp),%rax
movsd  %xmm0,-0x40(%rbp,%rax,8)
movslq -0x4c(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
lea    0xe0a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11fc <main+0xdc>
lea    0xdc0(%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    0xed4(%rip),%rdi
call   1040 <puts@plt>
lea    0xead(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe7e(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rsp)
jle    138f <main+0x24f>
movsd  0xe04(%rip),%xmm0
lea    0xe14(%rip),%r14
lea    0xe12(%rip),%rbx
xor    %ebp,%ebp
movsd  %xmm0,0x20(%rsp)
movsd  %xmm0,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  %xmm0,0x28(%rsp)
movsd  %xmm0,0x8(%rsp)
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movslq (%rsp),%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
sar    $0x25,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mov    %rbx,%rdi
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rsp),%eax
add    $0x1,%eax
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
sar    $0x25,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mov    %rbx,%rdi
movsd  %xmm0,0x10(%rsp)
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rsp),%eax
add    $0x2,%eax
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
sar    $0x25,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x18(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mov    %rbx,%rdi
movsd  %xmm0,0x18(%rsp)
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rsp),%eax
add    $0x3,%eax
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
sar    $0x25,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mov    %rbx,%rdi
movsd  %xmm0,0x20(%rsp)
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rsp),%eax
add    $0x4,%eax
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
sar    $0x25,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x28(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mov    %rbx,%rdi
movsd  %xmm0,0x28(%rsp)
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    0x4(%rsp),%ebp
jl     1230 <main+0xf0>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"enter interest rate:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"enter number of years:\0A\00"
@.str.3 = [7 x i8] c"\0AYears\00"
@.str.4 = [5 x i8] c"%6d%\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [5 x i8] c"%3d\09\00"
@.str.7 = [7 x i8] c"%7.2f\0A\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* %5
%18 = add nsw i32 5, %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 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 = %64, %26
%29 = load i32, i32* %6
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
%32 = icmp slt i32 %29, %31
br i1 %32, label %33, label %67
33: ; preds = %28
%34 = load i32, i32* %6
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %34)
store i32 0, i32* %7
br label %36
36: ; preds = %59, %33
%37 = load i32, i32* %7
%38 = icmp slt i32 %37, 5
br i1 %38, label %39, label %62
39: ; preds = %36
%40 = load i32, i32* %2
%41 = load i32, i32* %7
%42 = add nsw i32 %40, %41
%43 = sdiv i32 %42, 100
%44 = add nsw i32 1, %43
%45 = sitofp i32 %44 to double
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 %47
%49 = load double, double* %48
%50 = fmul double %45, %49
%51 = load i32, i32* %7
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 %52
store double %50, double* %53
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 %55
%57 = load double, double* %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), double %57)
br label %59
59: ; preds = %39
%60 = load i32, i32* %7
%61 = add nsw i32 %60, 1
store i32 %61, i32* %7
br label %36
62: ; preds = %36
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %64
64: ; preds = %62
%65 = load i32, i32* %6
%66 = add nsw i32 %65, 1
store i32 %66, i32* %6
br label %28
67: ; preds = %28
ret i32 0
}

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