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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int year;
  long amount, principal = 100000, rate = 5;
  long modifier;
  long r = rate + 100;
  int count;
  printf("%4s%21s\n", "Year", "Amount on deposit");
  for (year = 1; year <= 10; year++) {
    modifier = r;
    for (count = 1; count < year; count++) {
      modifier *= r;
      modifier /= 100;
    }
    amount = (principal * modifier) / 100;
    printf("%4d%21d\n", year, amount);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x186a0,-0x18(%rbp)
movq   $0x5,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x64,%rax
mov    %rax,-0x30(%rbp)
lea    0xebe(%rip),%rdi
lea    0xec0(%rip),%rsi
lea    0xebe(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     11ea <main+0xda>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b0 <main+0xa0>
mov    -0x30(%rbp),%rax
imul   -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1177 <main+0x67>
mov    -0x18(%rbp),%rax
imul   -0x28(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <main+0x4e>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xee2(%rip),%rdi
lea    0xee4(%rip),%rsi
lea    0xee2(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%ebp
movabs $0xa3d70a3d70a3d70b,%rbx
0a d7 a3
lea    0xed7(%rip),%r14
xor    %r15d,%r15d
jmp    1173 <main+0x63>
xchg   %ax,%ax
imul   $0x3e8,%rdx,%rdx
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
add    $0x1,%r15d
cmp    $0xb,%ebp
je     1255 <main+0x145>
mov    $0x69,%edx
cmp    $0x2,%ebp
jb     1150 <main+0x40>
lea    -0x1(%r15),%eax
mov    $0x69,%edx
cmp    $0x3,%eax
jb     1211 <main+0x101>
mov    %r15d,%esi
and    $0xfffffffc,%esi
mov    $0x69,%edx
nopw   0x0(%rax,%rax,1)
imul   $0x69,%rdx,%rcx
mov    %rcx,%rax
imul   %rbx
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x6,%rdx
add    %rax,%rdx
imul   $0x69,%rdx,%rcx
mov    %rcx,%rax
imul   %rbx
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x6,%rdx
add    %rax,%rdx
imul   $0x69,%rdx,%rcx
mov    %rcx,%rax
imul   %rbx
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x6,%rdx
add    %rax,%rdx
imul   $0x69,%rdx,%rcx
mov    %rcx,%rax
imul   %rbx
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x6,%rdx
add    %rax,%rdx
add    $0xfffffffc,%esi
jne    11a0 <main+0x90>
test   $0x3,%r15b
je     1150 <main+0x40>
mov    %r15d,%esi
and    $0x3,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   $0x69,%rdx,%rcx
mov    %rcx,%rax
imul   %rbx
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x6,%rdx
add    %rax,%rdx
add    $0xffffffff,%esi
jne    1230 <main+0x120>
jmp    1150 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%4s%21s\0A\00"
@.str.1 = [5 x i8] c"Year\00"
@.str.2 = [18 x i8] c"Amount on deposit\00"
@.str.3 = [9 x i8] c"%4d%21d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
store i32 0, i32* %1
store i64 100000, i64* %4
store i64 5, i64* %5
%9 = load i64, i64* %5
%10 = add nsw i64 %9, 100
store i64 %10, i64* %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %12
12: ; preds = %38, %0
%13 = load i32, i32* %2
%14 = icmp sle i32 %13, 10
br i1 %14, label %15, label %41
15: ; preds = %12
%16 = load i64, i64* %7
store i64 %16, i64* %6
store i32 1, i32* %8
br label %17
17: ; preds = %27, %15
%18 = load i32, i32* %8
%19 = load i32, i32* %2
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %30
21: ; preds = %17
%22 = load i64, i64* %7
%23 = load i64, i64* %6
%24 = mul nsw i64 %23, %22
store i64 %24, i64* %6
%25 = load i64, i64* %6
%26 = sdiv i64 %25, 100
store i64 %26, i64* %6
br label %27
27: ; preds = %21
%28 = load i32, i32* %8
%29 = add nsw i32 %28, 1
store i32 %29, i32* %8
br label %17
30: ; preds = %17
%31 = load i64, i64* %4
%32 = load i64, i64* %6
%33 = mul nsw i64 %31, %32
%34 = sdiv i64 %33, 100
store i64 %34, i64* %3
%35 = load i32, i32* %2
%36 = load i64, i64* %3
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %35, i64 %36)
br label %38
38: ; preds = %30
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %12
41: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%4s%21s\0A\00"
@.str.1 = [5 x i8] c"Year\00"
@.str.2 = [18 x i8] c"Amount on deposit\00"
@.str.3 = [9 x i8] c"%4d%21d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %2
2: ; preds = %0, %36
%3 = phi i32 [ 0, %0 ], [ %42, %36 ]
%4 = phi i32 [ 1, %0 ], [ %40, %36 ]
%5 = icmp ugt i32 %4, 1
br i1 %5, label %6, label %36
6: ; preds = %2
%7 = add i32 %3, -1
%8 = and i32 %3, 3
%9 = icmp ult i32 %7, 3
br i1 %9, label %25, label %10
10: ; preds = %6
%11 = and i32 %3, -4
br label %12
12: ; preds = %12, %10
%13 = phi i64 [ 105, %10 ], [ %22, %12 ]
%14 = phi i32 [ 0, %10 ], [ %23, %12 ]
%15 = mul nsw i64 %13, 105
%16 = sdiv i64 %15, 100
%17 = mul nsw i64 %16, 105
%18 = sdiv i64 %17, 100
%19 = mul nsw i64 %18, 105
%20 = sdiv i64 %19, 100
%21 = mul nsw i64 %20, 105
%22 = sdiv i64 %21, 100
%23 = add i32 %14, 4
%24 = icmp eq i32 %23, %11
br i1 %24, label %25, label %12
25: ; preds = %12, %6
%26 = phi i64 [ undef, %6 ], [ %22, %12 ]
%27 = phi i64 [ 105, %6 ], [ %22, %12 ]
%28 = icmp eq i32 %8, 0
br i1 %28, label %36, label %29
29: ; preds = %25, %29
%30 = phi i64 [ %33, %29 ], [ %27, %25 ]
%31 = phi i32 [ %34, %29 ], [ 0, %25 ]
%32 = mul nsw i64 %30, 105
%33 = sdiv i64 %32, 100
%34 = add i32 %31, 1
%35 = icmp eq i32 %34, %8
br i1 %35, label %36, label %29
36: ; preds = %25, %29, %2
%37 = phi i64 [ 105, %2 ], [ %26, %25 ], [ %33, %29 ]
%38 = mul nsw i64 %37, 1000
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %4, i64 %38)
%40 = add nuw nsw i32 %4, 1
%41 = icmp eq i32 %40, 11
%42 = add i32 %3, 1
br i1 %41, label %43, label %2
43: ; preds = %36
ret i32 0
}