#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 */
float cos(float);
float exp(float);
int /*<<< orphan*/ free_vector(float *, int, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
float sin(float);
int /*<<< orphan*/ spline(float *, float *, int, float, float, float *);
int /*<<< orphan*/ splint(float *, float *, float *, int, float, float *);
float *vector(int, int);
int main(void) {
  int i, nfunc;
  float f, x, y, yp1, ypn, *xa, *ya, *y2;
  xa = vector(1, 10);
  ya = vector(1, 10);
  y2 = vector(1, 10);
  for (nfunc = 1; nfunc <= 2; nfunc++) {
    if (nfunc == 1) {
      printf("\nsine function from 0 to pi\n");
      for (i = 1; i <= 10; i++) {
        xa[i] = i * 3.1415926 / 10;
        ya[i] = sin(xa[i]);
      }
      yp1 = cos(xa[1]);
      ypn = cos(xa[10]);
    } else if (nfunc == 2) {
      printf("\nexponential function from 0 to 1\n");
      for (i = 1; i <= 10; i++) {
        xa[i] = 1.0 * i / 10;
        ya[i] = exp(xa[i]);
      }
      yp1 = exp(xa[1]);
      ypn = exp(xa[10]);
    } else {
      break;
    }
    spline(xa, ya, 10, yp1, ypn, y2);
    printf("\n%9s %13s %17s\n", "x", "f(x)", "interpolation");
    for (i = 1; i <= 10; i++) {
      if (nfunc == 1) {
        x = (-0.05 + i / 10.0) * 3.1415926;
        f = sin(x);
      } else if (nfunc == 2) {
        x = -0.05 + i / 10.0;
        f = exp(x);
      }
      splint(xa, ya, y2, 10, x, &y);
      printf("%12.6f %12.6f %12.6f\n", x, f, y);
    }
    printf("\n***********************************\n");
    printf("Press RETURN\n");
    (void)getchar();
  }
  free_vector(y2, 1, 10);
  free_vector(ya, 1, 10);
  free_vector(xa, 1, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0xa,%esi
call   1080 <vector@plt>
mov    %rax,-0x28(%rbp)
mov    $0x1,%edi
mov    $0xa,%esi
call   1080 <vector@plt>
mov    %rax,-0x30(%rbp)
mov    $0x1,%edi
mov    $0xa,%esi
call   1080 <vector@plt>
mov    %rax,-0x38(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     14c0 <main+0x330>
cmpl   $0x1,-0xc(%rbp)
jne    1298 <main+0x108>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     126d <main+0xdd>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xdf9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdd5(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1070 <sin@plt>
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1208 <main+0x78>
mov    -0x28(%rbp),%rax
movss  0x4(%rax),%xmm0
call   10a0 <cos@plt>
movss  %xmm0,-0x1c(%rbp)
mov    -0x28(%rbp),%rax
movss  0x28(%rax),%xmm0
call   10a0 <cos@plt>
movss  %xmm0,-0x20(%rbp)
jmp    1351 <main+0x1c1>
cmpl   $0x2,-0xc(%rbp)
jne    1347 <main+0x1b7>
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     131c <main+0x18c>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xd3a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd26(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1090 <exp@plt>
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12b7 <main+0x127>
mov    -0x28(%rbp),%rax
movss  0x4(%rax),%xmm0
call   1090 <exp@plt>
movss  %xmm0,-0x1c(%rbp)
mov    -0x28(%rbp),%rax
movss  0x28(%rax),%xmm0
call   1090 <exp@plt>
movss  %xmm0,-0x20(%rbp)
jmp    134c <main+0x1bc>
jmp    14c0 <main+0x330>
jmp    1351 <main+0x1c1>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
movss  -0x1c(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
mov    -0x38(%rbp),%rcx
mov    $0xa,%edx
call   10b0 <spline@plt>
lea    0xce8(%rip),%rdi
lea    0xcf1(%rip),%rsi
lea    0xcec(%rip),%rdx
lea    0xcea(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     148f <main+0x2ff>
cmpl   $0x1,-0xc(%rbp)
jne    13f5 <main+0x265>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xc44(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xc48(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xc44(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1070 <sin@plt>
movss  %xmm0,-0x10(%rbp)
jmp    1439 <main+0x2a9>
cmpl   $0x2,-0xc(%rbp)
jne    1434 <main+0x2a4>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xbf4(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xbf8(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1090 <exp@plt>
movss  %xmm0,-0x10(%rbp)
jmp    1439 <main+0x2a9>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
movss  -0x14(%rbp),%xmm0
mov    $0xa,%ecx
lea    -0x18(%rbp),%r8
call   1040 <splint@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x18(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xc0b(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    139b <main+0x20b>
lea    0xc05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xc1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11df <main+0x4f>
mov    -0x38(%rbp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1050 <free_vector@plt>
mov    -0x30(%rbp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1050 <free_vector@plt>
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1050 <free_vector@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x1,%r13d
mov    $0x1,%edi
mov    $0xa,%esi
call   1090 <vector@plt>
mov    %rax,%r14
mov    $0x1,%edi
mov    $0xa,%esi
call   1090 <vector@plt>
mov    %rax,%rbx
mov    $0x1,%edi
mov    $0xa,%esi
call   1090 <vector@plt>
mov    %rax,%r15
lea    0xe54(%rip),%r12
jmp    122d <main+0x8d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
add    $0x1,%r13d
cmp    $0x3,%r13d
je     14c2 <main+0x322>
cmp    $0x1,%r13d
jne    1300 <main+0x160>
lea    0xe71(%rip),%rdi
call   1030 <puts@plt>
movl   $0x3ea0d97c,0x4(%r14)
3e
movl   $0x3e9e377a,0x4(%rbx)
movl   $0x3f20d97c,0x8(%r14)
3f
movl   $0x3f167918,0x8(%rbx)
movl   $0x3f714639,0xc(%r14)
3f
movl   $0x3f4f1bbd,0xc(%rbx)
movl   $0x3fa0d97c,0x10(%r14)
3f
movl   $0x3f737871,0x10(%rbx)
movl   $0x3fc90fda,0x14(%r14)
3f
movl   $0x3f800000,0x14(%rbx)
movl   $0x3ff14639,0x18(%r14)
3f
movl   $0x3f737871,0x18(%rbx)
movl   $0x400cbe4c,0x1c(%r14)
40
movl   $0x3f4f1bbd,0x1c(%rbx)
movl   $0x4020d97c,0x20(%r14)
40
movl   $0x3f167917,0x20(%rbx)
movl   $0x4034f4ab,0x24(%r14)
40
movl   $0x3e9e377b,0x24(%rbx)
movl   $0x40490fda,0x28(%r14)
40
movl   $0x34222169,0x28(%rbx)
movss  0x4(%r14),%xmm0
call   10b0 <cos@plt>
movss  %xmm0,0x4(%rsp)
movss  0x28(%r14),%xmm0
call   10b0 <cos@plt>
jmp    13be <main+0x21e>
nopw   0x0(%rax,%rax,1)
lea    0xd54(%rip),%rdi
call   1030 <puts@plt>
movl   $0x3dcccccd,0x4(%r14)
3d
movl   $0x3f8d763e,0x4(%rbx)
movl   $0x3e4ccccd,0x8(%r14)
3e
movl   $0x3f9c56ed,0x8(%rbx)
movl   $0x3e99999a,0xc(%r14)
3e
movl   $0x3facc82d,0xc(%rbx)
movl   $0x3ecccccd,0x10(%r14)
3e
movl   $0x3fbef41d,0x10(%rbx)
movl   $0x3f000000,0x14(%r14)
3f
movl   $0x3fd3094c,0x14(%rbx)
movl   $0x3f19999a,0x18(%r14)
3f
movl   $0x3fe93b31,0x18(%rbx)
movl   $0x3f333333,0x1c(%r14)
3f
movl   $0x4000e153,0x1c(%rbx)
movl   $0x3f4ccccd,0x20(%r14)
3f
movl   $0x400e6f43,0x20(%rbx)
movl   $0x3f666666,0x24(%r14)
3f
movl   $0x401d6a23,0x24(%rbx)
movl   $0x3f800000,0x28(%r14)
3f
movl   $0x402df854,0x28(%rbx)
movss  0x4(%r14),%xmm0
call   10a0 <exp@plt>
movss  %xmm0,0x4(%rsp)
movss  0x28(%r14),%xmm0
call   10a0 <exp@plt>
movaps %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
mov    $0xa,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
mov    %r15,%rcx
call   10c0 <spline@plt>
lea    0xc3a(%rip),%rdi
lea    0xc43(%rip),%rsi
lea    0xc3e(%rip),%rdx
lea    0xc3c(%rip),%rcx
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xbf6(%rip),%xmm1
jmp    1482 <main+0x2e2>
nopl   0x0(%rax)
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
call   10a0 <exp@plt>
movss  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    $0xa,%ecx
movss  0x4(%rsp),%xmm0
lea    0xc(%rsp),%r8
call   1050 <splint@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0xc(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
mov    %r12,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm1
addsd  0xb87(%rip),%xmm1
add    $0xffffffff,%ebp
je     1200 <main+0x60>
movapd %xmm1,%xmm0
divsd  0xb7a(%rip),%xmm0
addsd  0xb7a(%rip),%xmm0
cmp    $0x1,%r13d
movsd  %xmm1,0x10(%rsp)
jne    1410 <main+0x270>
mulsd  0xb6a(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
call   1080 <sin@plt>
jmp    141f <main+0x27f>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1060 <free_vector@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1060 <free_vector@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0xa,%edx
call   1060 <free_vector@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"\0Asine function from 0 to pi\0A\00"
@.str.1 = [35 x i8] c"\0Aexponential function from 0 to 1\0A\00"
@.str.2 = [16 x i8] c"\0A%9s %13s %17s\0A\00"
@.str.3 = [2 x i8] c"x\00"
@.str.4 = [5 x i8] c"f(x)\00"
@.str.5 = [14 x i8] c"interpolation\00"
@.str.6 = [22 x i8] c"%12.6f %12.6f %12.6f\0A\00"
@.str.7 = [38 x i8] c"\0A***********************************\0A\00"
@.str.8 = [14 x i8] c"Press RETURN\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
store i32 0, i32* %1
%12 = call float* @vector(i32 1, i32 10)
store float* %12, float** %9
%13 = call float* @vector(i32 1, i32 10)
store float* %13, float** %10
%14 = call float* @vector(i32 1, i32 10)
store float* %14, float** %11
store i32 1, i32* %3
br label %15
15: ; preds = %155, %0
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 2
br i1 %17, label %18, label %158
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %58
21: ; preds = %18
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %23
23: ; preds = %46, %21
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 10
br i1 %25, label %26, label %49
26: ; preds = %23
%27 = load i32, i32* %2
%28 = sitofp i32 %27 to double
%29 = fmul double %28, 0x400921FB4D12D84A
%30 = fdiv double %29, 1.000000e+01
%31 = fptrunc double %30 to float
%32 = load float*, float** %9
%33 = load i32, i32* %2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds float, float* %32, i64 %34
store float %31, float* %35
%36 = load float*, float** %9
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds float, float* %36, i64 %38
%40 = load float, float* %39
%41 = call float @sin(float %40)
%42 = load float*, float** %10
%43 = load i32, i32* %2
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds float, float* %42, i64 %44
store float %41, float* %45
br label %46
46: ; preds = %26
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 1
store i32 %48, i32* %2
br label %23
49: ; preds = %23
%50 = load float*, float** %9
%51 = getelementptr inbounds float, float* %50, i64 1
%52 = load float, float* %51
%53 = call float @cos(float %52)
store float %53, float* %7
%54 = load float*, float** %9
%55 = getelementptr inbounds float, float* %54, i64 10
%56 = load float, float* %55
%57 = call float @cos(float %56)
store float %57, float* %8
br label %100
58: ; preds = %18
%59 = load i32, i32* %3
%60 = icmp eq i32 %59, 2
br i1 %60, label %61, label %98
61: ; preds = %58
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %63
63: ; preds = %86, %61
%64 = load i32, i32* %2
%65 = icmp sle i32 %64, 10
br i1 %65, label %66, label %89
66: ; preds = %63
%67 = load i32, i32* %2
%68 = sitofp i32 %67 to double
%69 = fmul double 1.000000e+00, %68
%70 = fdiv double %69, 1.000000e+01
%71 = fptrunc double %70 to float
%72 = load float*, float** %9
%73 = load i32, i32* %2
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds float, float* %72, i64 %74
store float %71, float* %75
%76 = load float*, float** %9
%77 = load i32, i32* %2
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds float, float* %76, i64 %78
%80 = load float, float* %79
%81 = call float @exp(float %80)
%82 = load float*, float** %10
%83 = load i32, i32* %2
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds float, float* %82, i64 %84
store float %81, float* %85
br label %86
86: ; preds = %66
%87 = load i32, i32* %2
%88 = add nsw i32 %87, 1
store i32 %88, i32* %2
br label %63
89: ; preds = %63
%90 = load float*, float** %9
%91 = getelementptr inbounds float, float* %90, i64 1
%92 = load float, float* %91
%93 = call float @exp(float %92)
store float %93, float* %7
%94 = load float*, float** %9
%95 = getelementptr inbounds float, float* %94, i64 10
%96 = load float, float* %95
%97 = call float @exp(float %96)
store float %97, float* %8
br label %99
98: ; preds = %58
br label %158
99: ; preds = %89
br label %100
100: ; preds = %99, %49
%101 = load float*, float** %9
%102 = load float*, float** %10
%103 = load float, float* %7
%104 = load float, float* %8
%105 = load float*, float** %11
%106 = call i32 @spline(float* %101, float* %102, i32 10, float %103, float %104, float* %105)
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %2
br label %108
108: ; preds = %148, %100
%109 = load i32, i32* %2
%110 = icmp sle i32 %109, 10
br i1 %110, label %111, label %151
111: ; preds = %108
%112 = load i32, i32* %3
%113 = icmp eq i32 %112, 1
br i1 %113, label %114, label %123
114: ; preds = %111
%115 = load i32, i32* %2
%116 = sitofp i32 %115 to double
%117 = fdiv double %116, 1.000000e+01
%118 = fadd double -5.000000e-02, %117
%119 = fmul double %118, 0x400921FB4D12D84A
%120 = fptrunc double %119 to float
store float %120, float* %5
%121 = load float, float* %5
%122 = call float @sin(float %121)
store float %122, float* %4
br label %135
123: ; preds = %111
%124 = load i32, i32* %3
%125 = icmp eq i32 %124, 2
br i1 %125, label %126, label %134
126: ; preds = %123
%127 = load i32, i32* %2
%128 = sitofp i32 %127 to double
%129 = fdiv double %128, 1.000000e+01
%130 = fadd double -5.000000e-02, %129
%131 = fptrunc double %130 to float
store float %131, float* %5
%132 = load float, float* %5
%133 = call float @exp(float %132)
store float %133, float* %4
br label %134
134: ; preds = %126, %123
br label %135
135: ; preds = %134, %114
%136 = load float*, float** %9
%137 = load float*, float** %10
%138 = load float*, float** %11
%139 = load float, float* %5
%140 = call i32 @splint(float* %136, float* %137, float* %138, i32 10, float %139, float* %6)
%141 = load float, float* %5
%142 = fpext float %141 to double
%143 = load float, float* %4
%144 = fpext float %143 to double
%145 = load float, float* %6
%146 = fpext float %145 to double
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %142, double %144, double %146)
br label %148
148: ; preds = %135
%149 = load i32, i32* %2
%150 = add nsw i32 %149, 1
store i32 %150, i32* %2
br label %108
151: ; preds = %108
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%154 = call i32 (...) @getchar()
br label %155
155: ; preds = %151
%156 = load i32, i32* %3
%157 = add nsw i32 %156, 1
store i32 %157, i32* %3
br label %15
158: ; preds = %98, %15
%159 = load float*, float** %11
%160 = call i32 @free_vector(float* %159, i32 1, i32 10)
%161 = load float*, float** %10
%162 = call i32 @free_vector(float* %161, i32 1, i32 10)
%163 = load float*, float** %9
%164 = call i32 @free_vector(float* %163, i32 1, i32 10)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [16 x i8] c"\0A%9s %13s %17s\0A\00"
@.str.3 = [2 x i8] c"x\00"
@.str.4 = [5 x i8] c"f(x)\00"
@.str.5 = [14 x i8] c"interpolation\00"
@.str.6 = [22 x i8] c"%12.6f %12.6f %12.6f\0A\00"
@str = [34 x i8] c"\0Aexponential function from 0 to 1\00"
@str.9 = [37 x i8] c"\0A***********************************\00"
@str.10 = [13 x i8] c"Press RETURN\00"
@str.11 = [28 x i8] c"\0Asine function from 0 to pi\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call float* @vector(i32 1, i32 10)
%4 = tail call float* @vector(i32 1, i32 10)
%5 = tail call float* @vector(i32 1, i32 10)
%6 = getelementptr inbounds float, float* %3, i64 1
%7 = getelementptr inbounds float, float* %3, i64 10
%8 = getelementptr inbounds float, float* %4, i64 1
%9 = getelementptr inbounds float, float* %3, i64 2
%10 = getelementptr inbounds float, float* %4, i64 2
%11 = getelementptr inbounds float, float* %3, i64 3
%12 = getelementptr inbounds float, float* %4, i64 3
%13 = getelementptr inbounds float, float* %3, i64 4
%14 = getelementptr inbounds float, float* %4, i64 4
%15 = getelementptr inbounds float, float* %3, i64 5
%16 = getelementptr inbounds float, float* %4, i64 5
%17 = getelementptr inbounds float, float* %3, i64 6
%18 = getelementptr inbounds float, float* %4, i64 6
%19 = getelementptr inbounds float, float* %3, i64 7
%20 = getelementptr inbounds float, float* %4, i64 7
%21 = getelementptr inbounds float, float* %3, i64 8
%22 = getelementptr inbounds float, float* %4, i64 8
%23 = getelementptr inbounds float, float* %3, i64 9
%24 = getelementptr inbounds float, float* %4, i64 9
%25 = getelementptr inbounds float, float* %4, i64 10
%26 = getelementptr inbounds float, float* %4, i64 1
%27 = getelementptr inbounds float, float* %3, i64 2
%28 = getelementptr inbounds float, float* %4, i64 2
%29 = getelementptr inbounds float, float* %3, i64 3
%30 = getelementptr inbounds float, float* %4, i64 3
%31 = getelementptr inbounds float, float* %3, i64 4
%32 = getelementptr inbounds float, float* %4, i64 4
%33 = getelementptr inbounds float, float* %3, i64 5
%34 = getelementptr inbounds float, float* %4, i64 5
%35 = getelementptr inbounds float, float* %3, i64 6
%36 = getelementptr inbounds float, float* %4, i64 6
%37 = getelementptr inbounds float, float* %3, i64 7
%38 = getelementptr inbounds float, float* %4, i64 7
%39 = getelementptr inbounds float, float* %3, i64 8
%40 = getelementptr inbounds float, float* %4, i64 8
%41 = getelementptr inbounds float, float* %3, i64 9
%42 = getelementptr inbounds float, float* %4, i64 9
%43 = getelementptr inbounds float, float* %4, i64 10
br label %44
44: ; preds = %0, %87
%45 = phi i32 [ 1, %0 ], [ %91, %87 ]
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %53
47: ; preds = %44
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.11, i64 0, i64 0))
store float 0x3FD41B2F80000000, float* %6
store float 0x3FD3C6EF40000000, float* %26
store float 0x3FE41B2F80000000, float* %27
store float 0x3FE2CF2300000000, float* %28
store float 0x3FEE28C720000000, float* %29
store float 0x3FE9E377A0000000, float* %30
store float 0x3FF41B2F80000000, float* %31
store float 0x3FEE6F0E20000000, float* %32
store float 0x3FF921FB40000000, float* %33
store float 1.000000e+00, float* %34
store float 0x3FFE28C720000000, float* %35
store float 0x3FEE6F0E20000000, float* %36
store float 0x400197C980000000, float* %37
store float 0x3FE9E377A0000000, float* %38
store float 0x40041B2F80000000, float* %39
store float 0x3FE2CF22E0000000, float* %40
store float 0x40069E9560000000, float* %41
store float 0x3FD3C6EF60000000, float* %42
store float 0x400921FB40000000, float* %7
store float 0x3E84442D20000000, float* %43
%49 = load float, float* %6
%50 = call float @cos(float %49)
%51 = load float, float* %7
%52 = call float @cos(float %51)
br label %59
53: ; preds = %44
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
store float 0x3FB99999A0000000, float* %6
store float 0x3FF1AEC7C0000000, float* %8
store float 0x3FC99999A0000000, float* %9
store float 0x3FF38ADDA0000000, float* %10
store float 0x3FD3333340000000, float* %11
store float 0x3FF59905A0000000, float* %12
store float 0x3FD99999A0000000, float* %13
store float 0x3FF7DE83A0000000, float* %14
store float 5.000000e-01, float* %15
store float 0x3FFA612980000000, float* %16
store float 0x3FE3333340000000, float* %17
store float 0x3FFD276620000000, float* %18
store float 0x3FE6666660000000, float* %19
store float 0x40001C2A60000000, float* %20
store float 0x3FE99999A0000000, float* %21
store float 0x4001CDE860000000, float* %22
store float 0x3FECCCCCC0000000, float* %23
store float 0x4003AD4460000000, float* %24
store float 1.000000e+00, float* %7
store float 0x4005BF0A80000000, float* %25
%55 = load float, float* %6
%56 = call float @exp(float %55)
%57 = load float, float* %7
%58 = call float @exp(float %57)
br label %59
59: ; preds = %53, %47
%60 = phi float [ %50, %47 ], [ %56, %53 ]
%61 = phi float [ %52, %47 ], [ %58, %53 ]
%62 = call i32 @spline(float* %3, float* %4, i32 10, float %60, float %61, float* %5)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %64
64: ; preds = %59, %76
%65 = phi i32 [ 1, %59 ], [ %85, %76 ]
%66 = sitofp i32 %65 to double
%67 = fdiv double %66, 1.000000e+01
%68 = fadd double %67, -5.000000e-02
br i1 %46, label %69, label %73
69: ; preds = %64
%70 = fmul double %68, 0x400921FB4D12D84A
%71 = fptrunc double %70 to float
%72 = call float @sin(float %71)
br label %76
73: ; preds = %64
%74 = fptrunc double %68 to float
%75 = call float @exp(float %74)
br label %76
76: ; preds = %73, %69
%77 = phi float [ %71, %69 ], [ %74, %73 ]
%78 = phi float [ %72, %69 ], [ %75, %73 ]
%79 = call i32 @splint(float* %3, float* %4, float* %5, i32 10, float %77, float* %1)
%80 = fpext float %77 to double
%81 = fpext float %78 to double
%82 = load float, float* %1
%83 = fpext float %82 to double
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %80, double %81, double %83)
%85 = add nuw nsw i32 %65, 1
%86 = icmp eq i32 %85, 11
br i1 %86, label %87, label %64
87: ; preds = %76
%88 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.9, i64 0, i64 0))
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.10, i64 0, i64 0))
%90 = call i32 (...) @getchar()
%91 = add nuw nsw i32 %45, 1
%92 = icmp eq i32 %91, 3
br i1 %92, label %93, label %44
93: ; preds = %87
%94 = call i32 @free_vector(float* %5, i32 1, i32 10)
%95 = call i32 @free_vector(float* %4, i32 1, i32 10)
%96 = call i32 @free_vector(float* %3, i32 1, i32 10)
ret i32 0
}