#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*/ resultOfRate;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf_s(char *, int *, int *);
int main(void) {
  const int startMoney = 100;
  double resultOfRate[3];
  int userRate = 0;
  int userYear = 0;
  int indexOfYear = 1;
  int i = 0;
  printf("ÀÌÀÚÀ²¿¡ µû¸¥ ÅõÀÚ°á°ú¸¦ ¾Ë·Áµå¸³´Ï´Ù.\n");
  printf("ÀÌÀÚÀ²°ú ÅõÀÚ±â°£(³â)À» ÀÔ·ÂÇÏ¼¼¿ä: ");
  scanf_s("%d %d", &userRate, &userYear);
  for (i = 0; i < 3; i++) {
    resultOfRate[i] = startMoney;
  }
  printf("Year\t");
  for (i = 0; i < 3; i++) {
    printf("%d%%  \t", userRate + i);
  }
  printf("\n");
  for (indexOfYear = 1; indexOfYear <= userYear; indexOfYear++) {
    printf("%d", indexOfYear);
    for (i = 0; i < ((int)sizeof(resultOfRate) / sizeof(resultOfRate[0]));
         i++) {
      resultOfRate[i] += resultOfRate[i] * (userRate + i) / 100;
      printf("%10.2f", resultOfRate[i]);
    }
    printf("\n");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
lea    -0x24(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1040 <scanf_s@plt>
movl   $0x0,-0x30(%rbp)
cmpl   $0x3,-0x30(%rbp)
jge    11b3 <main+0x93>
movslq -0x30(%rbp),%rax
movsd  0xe61(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp,%rax,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1189 <main+0x69>
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x30(%rbp)
cmpl   $0x3,-0x30(%rbp)
jge    11f4 <main+0xd4>
mov    -0x24(%rbp),%esi
add    -0x30(%rbp),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11c8 <main+0xa8>
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jg     12b1 <main+0x191>
mov    -0x2c(%rbp),%esi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x30(%rbp)
movslq -0x30(%rbp),%rax
cmp    $0x3,%rax
jae    1295 <main+0x175>
movslq -0x30(%rbp),%rax
movsd  -0x20(%rbp,%rax,8),%xmm0
mov    -0x24(%rbp),%eax
add    -0x30(%rbp),%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xda5(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x30(%rbp),%rax
addsd  -0x20(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x20(%rbp,%rax,8)
movslq -0x30(%rbp),%rax
movsd  -0x20(%rbp,%rax,8),%xmm0
lea    0xe29(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    122d <main+0x10d>
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1209 <main+0xe9>
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
movl   $0x0,(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xf08(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed3(%rip),%rdi
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1060 <scanf_s@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%esi
lea    0xeba(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%esi
add    $0x1,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%esi
add    $0x2,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rsp)
jle    12cb <main+0x18b>
movsd  0xe1c(%rip),%xmm0
lea    0xe63(%rip),%r14
lea    0xe6d(%rip),%rbx
xor    %ebp,%ebp
movsd  %xmm0,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xorps  %xmm2,%xmm2
cvtsi2sdl (%rsp),%xmm2
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm2
movsd  0xdc7(%rip),%xmm1
divsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
mov    %rbx,%rdi
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rsp),%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm1
divsd  0xd90(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    %rbx,%rdi
movsd  %xmm0,0x10(%rsp)
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rsp),%eax
add    $0x2,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm1
divsd  0xd5d(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    %rbx,%rdi
movsd  %xmm0,0x18(%rsp)
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    0x4(%rsp),%ebp
jl     1210 <main+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [74 x i8] c"\C3\80\C3\8C\C3\80\C3\9A\C3\80\C2\B2\C2\BF\C2\A1 \C2\B5\C3\BB\C2\B8\C2\A5 \C3\85\C3\B5\C3\80\C3\9A\C2\B0\C3\A1\C2\B0\C3\BA\C2\B8\C2\A6 \C2\BE\C3\8B\C2\B7\C3\81\C2\B5\C3\A5\C2\B8\C2\B3\C2\B4\C3\8F\C2\B4\C3\99.\0A\00"
@.str.1 = [67 x i8] c"\C3\80\C3\8C\C3\80\C3\9A\C3\80\C2\B2\C2\B0\C3\BA \C3\85\C3\B5\C3\80\C3\9A\C2\B1\C3\A2\C2\B0\C2\A3(\C2\B3\C3\A2)\C3\80\C2\BB \C3\80\C3\94\C2\B7\C3\82\C3\87\C3\8F\C2\BC\C2\BC\C2\BF\C3\A4: \00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [6 x i8] c"Year\09\00"
@.str.4 = [8 x i8] c"%d%% \09\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [7 x i8] c"%10.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x double]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
store i32 0, i32* %4
store i32 0, i32* %5
store i32 1, i32* %6
store i32 0, i32* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf_s(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %4, i32* %5)
store i32 0, i32* %7
br label %11
11: ; preds = %18, %0
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 %16
store double 1.000000e+02, double* %17
br label %18
18: ; preds = %14
%19 = load i32, i32* %7
%20 = add nsw i32 %19, 1
store i32 %20, i32* %7
br label %11
21: ; preds = %11
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %7
br label %23
23: ; preds = %31, %21
%24 = load i32, i32* %7
%25 = icmp slt i32 %24, 3
br i1 %25, label %26, label %34
26: ; preds = %23
%27 = load i32, i32* %4
%28 = load i32, i32* %7
%29 = add nsw i32 %27, %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %26
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
br label %23
34: ; preds = %23
%35 = 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 %36
36: ; preds = %73, %34
%37 = load i32, i32* %6
%38 = load i32, i32* %5
%39 = icmp sle i32 %37, %38
br i1 %39, label %40, label %76
40: ; preds = %36
%41 = load i32, i32* %6
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %41)
store i32 0, i32* %7
br label %43
43: ; preds = %68, %40
%44 = load i32, i32* %7
%45 = sext i32 %44 to i64
%46 = icmp ult i64 %45, 3
br i1 %46, label %47, label %71
47: ; preds = %43
%48 = load i32, i32* %7
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 %49
%51 = load double, double* %50
%52 = load i32, i32* %4
%53 = load i32, i32* %7
%54 = add nsw i32 %52, %53
%55 = sitofp i32 %54 to double
%56 = fmul double %51, %55
%57 = fdiv double %56, 1.000000e+02
%58 = load i32, i32* %7
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 %59
%61 = load double, double* %60
%62 = fadd double %61, %57
store double %62, double* %60
%63 = load i32, i32* %7
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 %64
%66 = load double, double* %65
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), double %66)
br label %68
68: ; preds = %47
%69 = load i32, i32* %7
%70 = add nsw i32 %69, 1
store i32 %70, i32* %7
br label %43
71: ; preds = %43
%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 %36
76: ; preds = %36
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [67 x i8] c"\C3\80\C3\8C\C3\80\C3\9A\C3\80\C2\B2\C2\B0\C3\BA \C3\85\C3\B5\C3\80\C3\9A\C2\B1\C3\A2\C2\B0\C2\A3(\C2\B3\C3\A2)\C3\80\C2\BB \C3\80\C3\94\C2\B7\C3\82\C3\87\C3\8F\C2\BC\C2\BC\C2\BF\C3\A4: \00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [6 x i8] c"Year\09\00"
@.str.4 = [8 x i8] c"%d%% \09\00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [7 x i8] c"%10.2f\00"
@str = [73 x i8] c"\C3\80\C3\8C\C3\80\C3\9A\C3\80\C2\B2\C2\BF\C2\A1 \C2\B5\C3\BB\C2\B8\C2\A5 \C3\85\C3\B5\C3\80\C3\9A\C2\B0\C3\A1\C2\B0\C3\BA\C2\B8\C2\A6 \C2\BE\C3\8B\C2\B7\C3\81\C2\B5\C3\A5\C2\B8\C2\B3\C2\B4\C3\8F\C2\B4\C3\99.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf_s(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%9 = load i32, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 2
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %15)
%17 = call i32 @putchar(i32 10)
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 1
br i1 %19, label %50, label %20
20: ; preds = %0, %20
%21 = phi double [ %44, %20 ], [ 1.000000e+02, %0 ]
%22 = phi double [ %37, %20 ], [ 1.000000e+02, %0 ]
%23 = phi double [ %30, %20 ], [ 1.000000e+02, %0 ]
%24 = phi i32 [ %47, %20 ], [ 1, %0 ]
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %1
%27 = sitofp i32 %26 to double
%28 = fmul double %23, %27
%29 = fdiv double %28, 1.000000e+02
%30 = fadd double %23, %29
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), double %30)
%32 = load i32, i32* %1
%33 = add nsw i32 %32, 1
%34 = sitofp i32 %33 to double
%35 = fmul double %22, %34
%36 = fdiv double %35, 1.000000e+02
%37 = fadd double %22, %36
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), double %37)
%39 = load i32, i32* %1
%40 = add nsw i32 %39, 2
%41 = sitofp i32 %40 to double
%42 = fmul double %21, %41
%43 = fdiv double %42, 1.000000e+02
%44 = fadd double %21, %43
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), double %44)
%46 = call i32 @putchar(i32 10)
%47 = add nuw nsw i32 %24, 1
%48 = load i32, i32* %2
%49 = icmp slt i32 %24, %48
br i1 %49, label %20, label %50
50: ; preds = %20, %0
%51 = call i32 @putchar(i32 10)
ret i32 0
}