#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 */
scalar_t__ EOF;
float exp(float);
int /*<<< orphan*/ free_vector(float *, int, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ polint(float *, float *, int, float, float *, float *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, int *);
float sin(float);
float *vector(int, int);
int main(void) {
  int i, n, nfunc;
  float dy, f, x, y, *xa, *ya;
  printf("generation of interpolation tables\n");
  printf(" ... sin(x)    0<x<PI\n");
  printf(" ... exp(x)    0<x<1 \n");
  printf("how many entries go in these tables?\n");
  if (scanf("%d", &n) == EOF)
    return 1;
  xa = vector(1, n);
  ya = vector(1, n);
  for (nfunc = 1; nfunc <= 2; nfunc++) {
    if (nfunc == 1) {
      printf("\nsine function from 0 to PI\n");
      for (i = 1; i <= n; i++) {
        xa[i] = i * 3.1415926 / n;
        ya[i] = sin(xa[i]);
      }
    } else if (nfunc == 2) {
      printf("\nexponential function from 0 to 1\n");
      for (i = 1; i <= n; i++) {
        xa[i] = i * 1.0 / n;
        ya[i] = exp(xa[i]);
      }
    } else {
      break;
    }
    printf("\n%9s %13s %16s %13s\n", "x", "f(x)", "interpolated", "error");
    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);
      }
      polint(xa, ya, n, x, &y, &dy);
      printf("%12.6f %12.6f %12.6f %4s %11f\n", x, f, y, " ", dy);
    }
    printf("\n***********************************\n");
    printf("press RETURN\n");
    (void)getchar();
  }
  free_vector(ya, 1, n);
  free_vector(xa, 1, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   10a0 <scanf@plt>
mov    0x2e0a(%rip),%rcx
cmp    (%rcx),%rax
jne    11f3 <main+0x73>
movl   $0x1,-0x4(%rbp)
jmp    14cd <main+0x34d>
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
call   1070 <vector@plt>
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
call   1070 <vector@plt>
mov    %rax,-0x30(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jg     14a4 <main+0x324>
cmpl   $0x1,-0x10(%rbp)
jne    12ae <main+0x12e>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     12a9 <main+0x129>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xdba(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%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   1060 <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    1245 <main+0xc5>
jmp    1340 <main+0x1c0>
cmpl   $0x2,-0x10(%rbp)
jne    1336 <main+0x1b6>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1331 <main+0x1b1>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xd1a(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%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   1080 <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    12cd <main+0x14d>
jmp    133b <main+0x1bb>
jmp    14a4 <main+0x324>
jmp    1340 <main+0x1c0>
lea    0xd94(%rip),%rdi
lea    0xda2(%rip),%rsi
lea    0xd9d(%rip),%rdx
lea    0xd9b(%rip),%rcx
lea    0xda1(%rip),%r8
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1473 <main+0x2f3>
cmpl   $0x1,-0x10(%rbp)
jne    13cb <main+0x24b>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xc7e(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xc6a(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xc6e(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1060 <sin@plt>
movss  %xmm0,-0x18(%rbp)
jmp    140f <main+0x28f>
cmpl   $0x2,-0x10(%rbp)
jne    140a <main+0x28a>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xc2e(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xc1a(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1080 <exp@plt>
movss  %xmm0,-0x18(%rbp)
jmp    140f <main+0x28f>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0xc(%rbp),%edx
movss  -0x1c(%rbp),%xmm0
lea    -0x20(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1090 <polint@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x20(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x14(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xcb3(%rip),%rdi
lea    0xccb(%rip),%rsi
mov    $0x4,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1371 <main+0x1f1>
lea    0xcb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcc9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    121c <main+0x9c>
mov    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1040 <free_vector@plt>
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1040 <free_vector@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%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    $0x28,%rsp
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4b(%rip),%rdi
lea    0xc(%rsp),%rsi
call   10b0 <scanf@plt>
mov    %rax,%rcx
mov    0x2dff(%rip),%rdx
mov    $0x1,%eax
cmp    (%rdx),%rcx
je     1454 <main+0x2c4>
mov    0xc(%rsp),%esi
mov    $0x1,%r13d
mov    $0x1,%edi
call   1080 <vector@plt>
mov    %rax,%r14
mov    0xc(%rsp),%esi
mov    $0x1,%edi
call   1080 <vector@plt>
mov    %rax,%rbx
lea    0xe2c(%rip),%r15
lea    0xe91(%rip),%r12
jmp    125d <main+0xcd>
nop
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
add    $0x1,%r13d
cmp    $0x3,%r13d
je     1430 <main+0x2a0>
cmp    $0x1,%r13d
jne    12d0 <main+0x140>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1327 <main+0x197>
mov    $0x1,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0xd71(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14,%rbp,4)
call   1070 <sin@plt>
movss  %xmm0,(%rbx,%rbp,4)
lea    0x1(%rbp),%rcx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbp
mov    %rcx,%rbp
jl     1280 <main+0xf0>
jmp    1327 <main+0x197>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xe0e(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1327 <main+0x197>
mov    $0x1,%ebp
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14,%rbp,4)
call   1090 <exp@plt>
movss  %xmm0,(%rbx,%rbp,4)
lea    0x1(%rbp),%rcx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbp
mov    %rcx,%rbp
jl     12f0 <main+0x160>
lea    0xcf5(%rip),%rdi
lea    0xd03(%rip),%rsi
lea    0xcfe(%rip),%rdx
lea    0xcfc(%rip),%rcx
lea    0xd02(%rip),%r8
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%ebp
movsd  0xcaa(%rip),%xmm1
jmp    13f0 <main+0x260>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
call   1090 <exp@plt>
movss  %xmm0,0x14(%rsp)
mov    0xc(%rsp),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
movss  0x10(%rsp),%xmm0
lea    0x18(%rsp),%rcx
lea    0x1c(%rsp),%r8
call   10a0 <polint@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x14(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x18(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  0x1c(%rsp),%xmm3
cvtss2sd %xmm3,%xmm3
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x4,%al
call   1040 <printf@plt>
movsd  0x20(%rsp),%xmm1
addsd  0xc21(%rip),%xmm1
add    $0xffffffff,%ebp
je     1230 <main+0xa0>
movapd %xmm1,%xmm0
divsd  0xc14(%rip),%xmm0
addsd  0xc14(%rip),%xmm0
cmp    $0x1,%r13d
movsd  %xmm1,0x20(%rsp)
jne    1370 <main+0x1e0>
mulsd  0xbe4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
call   1070 <sin@plt>
jmp    137f <main+0x1ef>
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <free_vector@plt>
mov    0xc(%rsp),%edx
mov    %r14,%rdi
mov    $0x1,%esi
call   1050 <free_vector@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.4 = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.7 = [21 x i8] c"\0A%9s %13s %16s %13s\0A\00"
@.str.8 = [2 x i8] c"x\00"
@.str.9 = [5 x i8] c"f(x)\00"
@.str.10 = [13 x i8] c"interpolated\00"
@.str.11 = [6 x i8] c"error\00"
@.str.12 = [31 x i8] c"%12.6f %12.6f %12.6f %4s %11f\0A\00"
@.str.13 = [2 x i8] c" \00"
@str = [35 x i8] c"generation of interpolation tables\00"
@str.16 = [22 x i8] c" ... sin(x) 0<x<PI\00"
@str.17 = [22 x i8] c" ... exp(x) 0<x<1 \00"
@str.18 = [37 x i8] c"how many entries go in these tables?\00"
@str.19 = [34 x i8] c"\0Aexponential function from 0 to 1\00"
@str.20 = [37 x i8] c"\0A***********************************\00"
@str.21 = [13 x i8] c"press RETURN\00"
@str.22 = [28 x i8] c"\0Asine function from 0 to PI\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = bitcast i32* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.17, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.18, i64 0, i64 0))
%11 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %100, label %14
14: ; preds = %0
%15 = load i32, i32* %1
%16 = call float* @vector(i32 1, i32 %15)
%17 = load i32, i32* %1
%18 = call float* @vector(i32 1, i32 %17)
br label %19
19: ; preds = %14, %89
%20 = phi i32 [ 1, %14 ], [ %93, %89 ]
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %42
22: ; preds = %19
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.22, i64 0, i64 0))
%24 = load i32, i32* %1
%25 = icmp slt i32 %24, 1
br i1 %25, label %61, label %26
26: ; preds = %22, %26
%27 = phi i64 [ %38, %26 ], [ 1, %22 ]
%28 = phi i32 [ %39, %26 ], [ %24, %22 ]
%29 = trunc i64 %27 to i32
%30 = sitofp i32 %29 to double
%31 = fmul double %30, 0x400921FB4D12D84A
%32 = sitofp i32 %28 to double
%33 = fdiv double %31, %32
%34 = fptrunc double %33 to float
%35 = getelementptr inbounds float, float* %16, i64 %27
store float %34, float* %35
%36 = call float @sin(float %34)
%37 = getelementptr inbounds float, float* %18, i64 %27
store float %36, float* %37
%38 = add nuw nsw i64 %27, 1
%39 = load i32, i32* %1
%40 = sext i32 %39 to i64
%41 = icmp slt i64 %27, %40
br i1 %41, label %26, label %61
42: ; preds = %19
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.19, i64 0, i64 0))
%44 = load i32, i32* %1
%45 = icmp slt i32 %44, 1
br i1 %45, label %61, label %46
46: ; preds = %42, %46
%47 = phi i64 [ %57, %46 ], [ 1, %42 ]
%48 = phi i32 [ %58, %46 ], [ %44, %42 ]
%49 = trunc i64 %47 to i32
%50 = sitofp i32 %49 to double
%51 = sitofp i32 %48 to double
%52 = fdiv double %50, %51
%53 = fptrunc double %52 to float
%54 = getelementptr inbounds float, float* %16, i64 %47
store float %53, float* %54
%55 = call float @exp(float %53)
%56 = getelementptr inbounds float, float* %18, i64 %47
store float %55, float* %56
%57 = add nuw nsw i64 %47, 1
%58 = load i32, i32* %1
%59 = sext i32 %58 to i64
%60 = icmp slt i64 %47, %59
br i1 %60, label %46, label %61
61: ; preds = %46, %26, %42, %22
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
br label %63
63: ; preds = %61, %75
%64 = phi i32 [ 1, %61 ], [ %87, %75 ]
%65 = sitofp i32 %64 to double
%66 = fdiv double %65, 1.000000e+01
%67 = fadd double %66, -5.000000e-02
br i1 %21, label %68, label %72
68: ; preds = %63
%69 = fmul double %67, 0x400921FB4D12D84A
%70 = fptrunc double %69 to float
%71 = call float @sin(float %70)
br label %75
72: ; preds = %63
%73 = fptrunc double %67 to float
%74 = call float @exp(float %73)
br label %75
75: ; preds = %72, %68
%76 = phi float [ %71, %68 ], [ %74, %72 ]
%77 = phi float [ %70, %68 ], [ %73, %72 ]
%78 = load i32, i32* %1
%79 = call i32 @polint(float* %16, float* %18, i32 %78, float %77, float* %3, float* %2)
%80 = fpext float %77 to double
%81 = fpext float %76 to double
%82 = load float, float* %3
%83 = fpext float %82 to double
%84 = load float, float* %2
%85 = fpext float %84 to double
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), double %80, double %81, double %83, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), double %85)
%87 = add nuw nsw i32 %64, 1
%88 = icmp eq i32 %87, 11
br i1 %88, label %89, label %63
89: ; preds = %75
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.20, i64 0, i64 0))
%91 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.21, i64 0, i64 0))
%92 = call i32 (...) @getchar()
%93 = add nuw nsw i32 %20, 1
%94 = icmp eq i32 %93, 3
br i1 %94, label %95, label %19
95: ; preds = %89
%96 = load i32, i32* %1
%97 = call i32 @free_vector(float* %18, i32 1, i32 %96)
%98 = load i32, i32* %1
%99 = call i32 @free_vector(float* %16, i32 1, i32 %98)
br label %100
100: ; preds = %0, %95
%101 = phi i32 [ 0, %95 ], [ 1, %0 ]
ret i32 %101
}