#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 */
double pow(double, unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int main(void) {
  double amount;
  double principal = 1000.0;
  double rate = 5.0;
  unsigned int year;
  for (rate = 5; rate <= 10; rate++) {
    printf("%4s%21s%30s\n", "Year", "Amount on deposit",
           "Tasso d'interesse annuo");
    for (year = 1; year <= 10; ++year) {
      amount = principal * pow(1.0 + (rate / 100), year);
      printf("%4u%21.2f%30.0f\n", year, amount, (rate));
    }
    puts("");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xea2(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1239 <main+0x109>
lea    0xea8(%rip),%rdi
lea    0xeae(%rip),%rsi
lea    0xeac(%rip),%rdx
lea    0xeb7(%rip),%rcx
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
ja     1216 <main+0xe6>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  0xe5c(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe48(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    -0x24(%rbp),%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x24(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe63(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a3 <main+0x73>
lea    0xe57(%rip),%rdi
call   1030 <puts@plt>
movsd  0xdee(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1166 <main+0x36>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movsd  0xeba(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x6,%ebp
lea    0xec8(%rip),%r14
lea    0xece(%rip),%r15
lea    0xecc(%rip),%r12
lea    0xed7(%rip),%r13
lea    0xee8(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm1
divsd  0xe67(%rip),%xmm1
movsd  0xe67(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movapd %xmm1,%xmm0
mov    $0x1,%edi
call   1050 <pow@plt>
movsd  0xe4f(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    %rbx,%rdi
mov    $0x1,%esi
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mulsd  0xe1e(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%esi
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    $0x3,%edi
call   1050 <pow@plt>
mulsd  0xdf1(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x3,%esi
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    $0x4,%edi
call   1050 <pow@plt>
mulsd  0xdc4(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x4,%esi
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    $0x5,%edi
call   1050 <pow@plt>
mulsd  0xd97(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x5,%esi
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    $0x6,%edi
call   1050 <pow@plt>
mulsd  0xd6a(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x6,%esi
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    $0x7,%edi
call   1050 <pow@plt>
mulsd  0xd3d(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x7,%esi
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    $0x8,%edi
call   1050 <pow@plt>
mulsd  0xd10(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x8,%esi
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    $0x9,%edi
call   1050 <pow@plt>
mulsd  0xce3(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x9,%esi
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    $0xa,%edi
call   1050 <pow@plt>
mulsd  0xcb6(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa,%esi
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xc81(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
add    $0xffffffff,%ebp
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%4s%21s%30s\0A\00"
@.str.1 = [5 x i8] c"Year\00"
@.str.2 = [18 x i8] c"Amount on deposit\00"
@.str.3 = [24 x i8] c"Tasso d'interesse annuo\00"
@.str.4 = [17 x i8] c"%4u%21.2f%30.0f\0A\00"
@.str.5 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store i32 0, i32* %1
store double 1.000000e+03, double* %3
store double 5.000000e+00, double* %4
store double 5.000000e+00, double* %4
br label %6
6: ; preds = %31, %0
%7 = load double, double* %4
%8 = fcmp ole double %7, 1.000000e+01
br i1 %8, label %9, label %34
9: ; preds = %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 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), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %5
br label %11
11: ; preds = %26, %9
%12 = load i32, i32* %5
%13 = icmp ule i32 %12, 10
br i1 %13, label %14, label %29
14: ; preds = %11
%15 = load double, double* %3
%16 = load double, double* %4
%17 = fdiv double %16, 1.000000e+02
%18 = fadd double 1.000000e+00, %17
%19 = load i32, i32* %5
%20 = call double @pow(double %18, i32 %19)
%21 = fmul double %15, %20
store double %21, double* %2
%22 = load i32, i32* %5
%23 = load double, double* %2
%24 = load double, double* %4
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %22, double %23, double %24)
br label %26
26: ; preds = %14
%27 = load i32, i32* %5
%28 = add i32 %27, 1
store i32 %28, i32* %5
br label %11
29: ; preds = %11
%30 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
br label %31
31: ; preds = %29
%32 = load double, double* %4
%33 = fadd double %32, 1.000000e+00
store double %33, double* %4
br label %6
34: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%4s%21s%30s\0A\00"
@.str.1 = [5 x i8] c"Year\00"
@.str.2 = [18 x i8] c"Amount on deposit\00"
@.str.3 = [24 x i8] c"Tasso d'interesse annuo\00"
@.str.4 = [17 x i8] c"%4u%21.2f%30.0f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 5, %0 ], [ %38, %1 ]
%3 = sitofp i32 %2 to double
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 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), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%5 = fdiv double %3, 1.000000e+02
%6 = fadd double %5, 1.000000e+00
%7 = tail call double @pow(double %6, i32 1)
%8 = fmul double %7, 1.000000e+03
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 1, double %8, double %3)
%10 = tail call double @pow(double %6, i32 2)
%11 = fmul double %10, 1.000000e+03
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 2, double %11, double %3)
%13 = tail call double @pow(double %6, i32 3)
%14 = fmul double %13, 1.000000e+03
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 3, double %14, double %3)
%16 = tail call double @pow(double %6, i32 4)
%17 = fmul double %16, 1.000000e+03
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 4, double %17, double %3)
%19 = tail call double @pow(double %6, i32 5)
%20 = fmul double %19, 1.000000e+03
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 5, double %20, double %3)
%22 = tail call double @pow(double %6, i32 6)
%23 = fmul double %22, 1.000000e+03
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 6, double %23, double %3)
%25 = tail call double @pow(double %6, i32 7)
%26 = fmul double %25, 1.000000e+03
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 7, double %26, double %3)
%28 = tail call double @pow(double %6, i32 8)
%29 = fmul double %28, 1.000000e+03
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 8, double %29, double %3)
%31 = tail call double @pow(double %6, i32 9)
%32 = fmul double %31, 1.000000e+03
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 9, double %32, double %3)
%34 = tail call double @pow(double %6, i32 10)
%35 = fmul double %34, 1.000000e+03
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 10, double %35, double %3)
%37 = tail call i32 @putchar(i32 10)
%38 = add nuw nsw i32 %2, 1
%39 = icmp eq i32 %38, 11
br i1 %39, label %40, label %1
40: ; preds = %1
ret i32 0
}