#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 exp(float);
int /*<<< orphan*/ free_vector(float *, int /*<<< orphan*/, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ polcoe(float *, float *, int, float *);
int /*<<< orphan*/ printf(char *, ...);
float sin(float);
float *vector(int /*<<< orphan*/, int);
int main(void) {
  int i, j, nfunc;
  float f, sum, x, *coeff, *xa, *ya;
  coeff = vector(0, 4);
  xa = vector(0, 4);
  ya = vector(0, 4);
  for (nfunc = 1; nfunc <= 2; nfunc++) {
    if (nfunc == 1) {
      printf("sine function from 0 to PI\n\n");
      for (i = 0; i <= 4; i++) {
        xa[i] = (i + 1) * 3.1415926 / (4 + 1);
        ya[i] = sin(xa[i]);
      }
    } else if (nfunc == 2) {
      printf("exponential function from 0 to 1\n\n");
      for (i = 0; i <= 4; i++) {
        xa[i] = 1.0 * (i + 1) / (4 + 1);
        ya[i] = exp(xa[i]);
      }
    } else {
      break;
    }
    polcoe(xa, ya, 4, coeff);
    printf("  coefficients\n");
    for (i = 0; i <= 4; i++)
      printf("%12.6f", coeff[i]);
    printf("\n\n%9s %13s %15s\n", "x", "f(x)", "polynomial");
    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);
      }
      sum = coeff[4];
      for (j = 4 - 1; j >= 0; j--)
        sum = coeff[j] + sum * x;
      printf("%12.6f %12.6f %12.6f\n", x, f, sum);
    }
    printf("\n************************************\n");
    printf("press RETURN\n");
    (void)getchar();
  }
  free_vector(ya, 0, 4);
  free_vector(xa, 0, 4);
  free_vector(coeff, 0, 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x4,%esi
call   1080 <vector@plt>
mov    %rax,-0x28(%rbp)
xor    %edi,%edi
mov    $0x4,%esi
call   1080 <vector@plt>
mov    %rax,-0x30(%rbp)
xor    %edi,%edi
mov    $0x4,%esi
call   1080 <vector@plt>
mov    %rax,-0x38(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jg     14c9 <main+0x359>
cmpl   $0x1,-0x10(%rbp)
jne    124e <main+0xde>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jg     1249 <main+0xd9>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe25(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdf9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1070 <sin@plt>
mov    -0x38(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11df <main+0x6f>
jmp    12e6 <main+0x176>
cmpl   $0x2,-0x10(%rbp)
jne    12dc <main+0x16c>
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jg     12d7 <main+0x167>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xd7f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd6b(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1090 <exp@plt>
mov    -0x38(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    126d <main+0xfd>
jmp    12e1 <main+0x171>
jmp    14c9 <main+0x359>
jmp    12e6 <main+0x176>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x28(%rbp),%rcx
mov    $0x4,%edx
call   1030 <polcoe@plt>
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jg     1348 <main+0x1d8>
mov    -0x28(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd45(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1311 <main+0x1a1>
lea    0xd30(%rip),%rdi
lea    0xd3a(%rip),%rsi
lea    0xd35(%rip),%rdx
lea    0xd33(%rip),%rcx
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1498 <main+0x328>
cmpl   $0x1,-0x10(%rbp)
jne    13cc <main+0x25c>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xc85(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xc71(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xc75(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1070 <sin@plt>
movss  %xmm0,-0x14(%rbp)
jmp    1410 <main+0x2a0>
cmpl   $0x2,-0x10(%rbp)
jne    140b <main+0x29b>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xc35(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xc21(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1090 <exp@plt>
movss  %xmm0,-0x14(%rbp)
jmp    1410 <main+0x2a0>
mov    -0x28(%rbp),%rax
movss  0x10(%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x3,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1461 <main+0x2f1>
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
movss  -0x18(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1425 <main+0x2b5>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x18(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xc1f(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1372 <main+0x202>
lea    0xc19(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b6 <main+0x46>
mov    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <free_vector@plt>
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <free_vector@plt>
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%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
xor    %edi,%edi
mov    $0x4,%esi
call   1090 <vector@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    $0x4,%esi
call   1090 <vector@plt>
mov    %rax,%r14
xor    %edi,%edi
mov    $0x4,%esi
call   1090 <vector@plt>
mov    %rax,%r15
mov    $0x1,%r13d
lea    0xe82(%rip),%r12
jmp    11fd <main+0x7d>
nopw   0x0(%rax,%rax,1)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
add    $0x1,%r13d
cmp    $0x3,%r13d
je     1423 <main+0x2a3>
cmp    $0x1,%r13d
jne    1260 <main+0xe0>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
movl   $0x3f20d97c,(%r14)
movl   $0x3f167918,(%r15)
movl   $0x3fa0d97c,0x4(%r14)
3f
movl   $0x3f737871,0x4(%r15)
3f
movl   $0x3ff14639,0x8(%r14)
3f
movl   $0x3f737871,0x8(%r15)
3f
movl   $0x4020d97c,0xc(%r14)
40
movl   $0x3f167917,0xc(%r15)
3f
movl   $0x40490fda,0x10(%r14)
40
movl   $0x34222169,0x10(%r15)
34
jmp    12ba <main+0x13a>
nop
lea    0xdf9(%rip),%rdi
call   1030 <puts@plt>
movl   $0x3e4ccccd,(%r14)
movl   $0x3f9c56ed,(%r15)
movl   $0x3ecccccd,0x4(%r14)
3e
movl   $0x3fbef41d,0x4(%r15)
3f
movl   $0x3f19999a,0x8(%r14)
3f
movl   $0x3fe93b31,0x8(%r15)
3f
movl   $0x3f4ccccd,0xc(%r14)
3f
movl   $0x400e6f43,0xc(%r15)
40
movl   $0x3f800000,0x10(%r14)
3f
movl   $0x402df854,0x10(%r15)
40
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x4,%edx
mov    %rbx,%rcx
call   1040 <polcoe@plt>
lea    0xdae(%rip),%rdi
call   1030 <puts@plt>
movss  (%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd38(%rip),%rbp
mov    %rbp,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x4(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x8(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0xc(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x10(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xce2(%rip),%rdi
lea    0xcec(%rip),%rsi
lea    0xce7(%rip),%rdx
lea    0xce5(%rip),%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%ebp
movsd  0xc92(%rip),%xmm1
jmp    13e3 <main+0x263>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
call   10a0 <exp@plt>
movss  0xc(%rsp),%xmm1
movss  0x10(%rbx),%xmm2
mulss  %xmm1,%xmm2
addss  0xc(%rbx),%xmm2
mulss  %xmm1,%xmm2
addss  0x8(%rbx),%xmm2
mulss  %xmm1,%xmm2
addss  0x4(%rbx),%xmm2
mulss  %xmm1,%xmm2
addss  (%rbx),%xmm2
xorps  %xmm3,%xmm3
cvtss2sd %xmm1,%xmm3
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
cvtss2sd %xmm2,%xmm2
mov    %r12,%rdi
movaps %xmm3,%xmm0
mov    $0x3,%al
call   1050 <printf@plt>
movsd  0x10(%rsp),%xmm1
addsd  0xc26(%rip),%xmm1
add    $0xffffffff,%ebp
je     11d0 <main+0x50>
movapd %xmm1,%xmm0
divsd  0xc19(%rip),%xmm0
addsd  0xc19(%rip),%xmm0
cmp    $0x1,%r13d
movsd  %xmm1,0x10(%rsp)
jne    1370 <main+0x1f0>
mulsd  0xc09(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
call   1080 <sin@plt>
jmp    137f <main+0x1ff>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <free_vector@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <free_vector@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%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"sine function from 0 to PI\0A\0A\00"
@.str.1 = [35 x i8] c"exponential function from 0 to 1\0A\0A\00"
@.str.2 = [16 x i8] c" coefficients\0A\00"
@.str.3 = [7 x i8] c"%12.6f\00"
@.str.4 = [17 x i8] c"\0A\0A%9s %13s %15s\0A\00"
@.str.5 = [2 x i8] c"x\00"
@.str.6 = [5 x i8] c"f(x)\00"
@.str.7 = [11 x i8] c"polynomial\00"
@.str.8 = [22 x i8] c"%12.6f %12.6f %12.6f\0A\00"
@.str.9 = [39 x i8] c"\0A************************************\0A\00"
@.str.10 = [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 float* @vector(i32 0, i32 4)
store float* %11, float** %8
%12 = call float* @vector(i32 0, i32 4)
store float* %12, float** %9
%13 = call float* @vector(i32 0, i32 4)
store float* %13, float** %10
store i32 1, i32* %4
br label %14
14: ; preds = %168, %0
%15 = load i32, i32* %4
%16 = icmp sle i32 %15, 2
br i1 %16, label %17, label %171
17: ; preds = %14
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %50
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %22
22: ; preds = %46, %20
%23 = load i32, i32* %2
%24 = icmp sle i32 %23, 4
br i1 %24, label %25, label %49
25: ; preds = %22
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
%28 = sitofp i32 %27 to double
%29 = fmul double %28, 0x400921FB4D12D84A
%30 = fdiv double %29, 5.000000e+00
%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 = %25
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 1
store i32 %48, i32* %2
br label %22
49: ; preds = %22
br label %85
50: ; preds = %17
%51 = load i32, i32* %4
%52 = icmp eq i32 %51, 2
br i1 %52, label %53, label %83
53: ; preds = %50
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %55
55: ; preds = %79, %53
%56 = load i32, i32* %2
%57 = icmp sle i32 %56, 4
br i1 %57, label %58, label %82
58: ; preds = %55
%59 = load i32, i32* %2
%60 = add nsw i32 %59, 1
%61 = sitofp i32 %60 to double
%62 = fmul double 1.000000e+00, %61
%63 = fdiv double %62, 5.000000e+00
%64 = fptrunc double %63 to float
%65 = load float*, float** %9
%66 = load i32, i32* %2
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds float, float* %65, i64 %67
store float %64, float* %68
%69 = load float*, float** %9
%70 = load i32, i32* %2
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds float, float* %69, i64 %71
%73 = load float, float* %72
%74 = call float @exp(float %73)
%75 = load float*, float** %10
%76 = load i32, i32* %2
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds float, float* %75, i64 %77
store float %74, float* %78
br label %79
79: ; preds = %58
%80 = load i32, i32* %2
%81 = add nsw i32 %80, 1
store i32 %81, i32* %2
br label %55
82: ; preds = %55
br label %84
83: ; preds = %50
br label %171
84: ; preds = %82
br label %85
85: ; preds = %84, %49
%86 = load float*, float** %9
%87 = load float*, float** %10
%88 = load float*, float** %8
%89 = call i32 @polcoe(float* %86, float* %87, i32 4, float* %88)
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %91
91: ; preds = %102, %85
%92 = load i32, i32* %2
%93 = icmp sle i32 %92, 4
br i1 %93, label %94, label %105
94: ; preds = %91
%95 = load float*, float** %8
%96 = load i32, i32* %2
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds float, float* %95, i64 %97
%99 = load float, float* %98
%100 = fpext float %99 to double
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %100)
br label %102
102: ; preds = %94
%103 = load i32, i32* %2
%104 = add nsw i32 %103, 1
store i32 %104, i32* %2
br label %91
105: ; preds = %91
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %2
br label %107
107: ; preds = %161, %105
%108 = load i32, i32* %2
%109 = icmp sle i32 %108, 10
br i1 %109, label %110, label %164
110: ; preds = %107
%111 = load i32, i32* %4
%112 = icmp eq i32 %111, 1
br i1 %112, label %113, label %122
113: ; preds = %110
%114 = load i32, i32* %2
%115 = sitofp i32 %114 to double
%116 = fdiv double %115, 1.000000e+01
%117 = fadd double -5.000000e-02, %116
%118 = fmul double %117, 0x400921FB4D12D84A
%119 = fptrunc double %118 to float
store float %119, float* %7
%120 = load float, float* %7
%121 = call float @sin(float %120)
store float %121, float* %5
br label %134
122: ; preds = %110
%123 = load i32, i32* %4
%124 = icmp eq i32 %123, 2
br i1 %124, label %125, label %133
125: ; preds = %122
%126 = load i32, i32* %2
%127 = sitofp i32 %126 to double
%128 = fdiv double %127, 1.000000e+01
%129 = fadd double -5.000000e-02, %128
%130 = fptrunc double %129 to float
store float %130, float* %7
%131 = load float, float* %7
%132 = call float @exp(float %131)
store float %132, float* %5
br label %133
133: ; preds = %125, %122
br label %134
134: ; preds = %133, %113
%135 = load float*, float** %8
%136 = getelementptr inbounds float, float* %135, i64 4
%137 = load float, float* %136
store float %137, float* %6
store i32 3, i32* %3
br label %138
138: ; preds = %150, %134
%139 = load i32, i32* %3
%140 = icmp sge i32 %139, 0
br i1 %140, label %141, label %153
141: ; preds = %138
%142 = load float*, float** %8
%143 = load i32, i32* %3
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds float, float* %142, i64 %144
%146 = load float, float* %145
%147 = load float, float* %6
%148 = load float, float* %7
%149 = call float @llvm.fmuladd.f32(float %147, float %148, float %146)
store float %149, float* %6
br label %150
150: ; preds = %141
%151 = load i32, i32* %3
%152 = add nsw i32 %151, -1
store i32 %152, i32* %3
br label %138
153: ; preds = %138
%154 = load float, float* %7
%155 = fpext float %154 to double
%156 = load float, float* %5
%157 = fpext float %156 to double
%158 = load float, float* %6
%159 = fpext float %158 to double
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), double %155, double %157, double %159)
br label %161
161: ; preds = %153
%162 = load i32, i32* %2
%163 = add nsw i32 %162, 1
store i32 %163, i32* %2
br label %107
164: ; preds = %107
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0))
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%167 = call i32 (...) @getchar()
br label %168
168: ; preds = %164
%169 = load i32, i32* %4
%170 = add nsw i32 %169, 1
store i32 %170, i32* %4
br label %14
171: ; preds = %83, %14
%172 = load float*, float** %10
%173 = call i32 @free_vector(float* %172, i32 0, i32 4)
%174 = load float*, float** %9
%175 = call i32 @free_vector(float* %174, i32 0, i32 4)
%176 = load float*, float** %8
%177 = call i32 @free_vector(float* %176, i32 0, i32 4)
ret i32 0
}

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