#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 *, ...);
double stub1(double, int, double);
void table(double (*pf)(double i, int m, double n), double a, int m, double n) {
  int irate;
  double i;
  double f;
  printf("INTEREST RATE			FUTURE VALUE\n");
  for (irate = 1; irate <= 20; ++irate) {
    i = 0.1 * irate;
    f = a * (*pf)(i, m, n);
    printf("%2d				%.2f\n", irate, f);
  }
  return;
}


x86 assembly (clang, -O0):
<table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  %xmm1,-0x20(%rbp)
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x24(%rbp)
cmpl   $0x14,-0x24(%rbp)
jg     11b0 <table+0xa0>
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  0xeab(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x30(%rbp),%xmm0
mov    -0x14(%rbp),%edi
movsd  -0x20(%rbp),%xmm1
call   *%rax
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x24(%rbp),%esi
movsd  -0x38(%rbp),%xmm0
lea    0xe8b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113e <table+0x2e>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<table>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
mov    %esi,%r14d
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebp
movsd  0xeab(%rip),%xmm0
lea    0xeb4(%rip),%r15
nopl   0x0(%rax)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
mulsd  0xe96(%rip),%xmm0
mov    %r14d,%edi
movsd  0x10(%rsp),%xmm1
call   *%rbx
mulsd  0x8(%rsp),%xmm0
mov    %r15,%rdi
mov    %ebp,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xe64(%rip),%xmm0
add    $0x1,%ebp
cmp    $0x15,%ebp
jne    1160 <table+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"INTEREST RATE\09\09\09FUTURE VALUE\0A\00"
@.str.1 = [13 x i8] c"%2d\09\09\09\09%.2f\0A\00"
define void @table(double (double, i32, double)* %0, double %1, i32 %2, double %3) {
%5 = alloca double (double, i32, double)*
%6 = alloca double
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca double
%11 = alloca double
store double (double, i32, double)* %0, double (double, i32, double)** %5
store double %1, double* %6
store i32 %2, i32* %7
store double %3, double* %8
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %9
br label %13
13: ; preds = %30, %4
%14 = load i32, i32* %9
%15 = icmp sle i32 %14, 20
br i1 %15, label %16, label %33
16: ; preds = %13
%17 = load i32, i32* %9
%18 = sitofp i32 %17 to double
%19 = fmul double 1.000000e-01, %18
store double %19, double* %10
%20 = load double, double* %6
%21 = load double (double, i32, double)*, double (double, i32, double)** %5
%22 = load double, double* %10
%23 = load i32, i32* %7
%24 = load double, double* %8
%25 = call double %21(double %22, i32 %23, double %24)
%26 = fmul double %20, %25
store double %26, double* %11
%27 = load i32, i32* %9
%28 = load double, double* %11
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %27, double %28)
br label %30
30: ; preds = %16
%31 = load i32, i32* %9
%32 = add nsw i32 %31, 1
store i32 %32, i32* %9
br label %13
33: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"%2d\09\09\09\09%.2f\0A\00"
@str = [29 x i8] c"INTEREST RATE\09\09\09FUTURE VALUE\00"
define void @table(double (double, i32, double)* nocapture %0, double %1, i32 %2, double %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 1, %4 ], [ %13, %6 ]
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 1.000000e-01
%10 = tail call double %0(double %9, i32 %2, double %3)
%11 = fmul double %10, %1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %7, double %11)
%13 = add nuw nsw i32 %7, 1
%14 = icmp eq i32 %13, 21
br i1 %14, label %15, label %6
15: ; preds = %6
ret void
}