#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ pacf(double *, int, double *, int);
int /*<<< orphan*/ pacf_opt(double *, int, int, double *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int i, N, M;
  double *inp, *par;
  int method;
  FILE *ifp;
  double temp[1200];
  ifp = fopen("../data/seriesC.txt", "r");
  i = 0;
  if (!ifp) {
    printf("Cannot Open File");
    exit(100);
  }
  while (!feof(ifp)) {
    fscanf(ifp, "%lf \n", &temp[i]);
    i++;
  }
  N = i;
  inp = (double *)malloc(sizeof(double) * N);
  for (i = 0; i < N; ++i) {
    inp[i] = temp[i];
  }
  M = 10;
  par = (double *)malloc(sizeof(double) * M);
  printf("\n Default Method : pacf \n");
  pacf(inp, N, par, M);
  for (i = 0; i < M; ++i) {
    printf("%g ", par[i]);
  }
  printf("\n");
  method = 0;
  printf("\n pacf_opt Method 0 Yule Walker \n");
  pacf_opt(inp, N, method, par, M);
  for (i = 0; i < M; ++i) {
    printf("%g ", par[i]);
  }
  printf("\n");
  method = 1;
  printf("\n pacf_opt Method 1 Burg \n");
  pacf_opt(inp, N, method, par, M);
  for (i = 0; i < M; ++i) {
    printf("%g ", par[i]);
  }
  printf("\n");
  method = 2;
  printf("\n pacf_opt Method 2 MLE (Box-Jenkins) \n");
  pacf_opt(inp, N, method, par, M);
  for (i = 0; i < M; ++i) {
    printf("%g ", par[i]);
  }
  printf("\n");
  free(inp);
  free(par);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x25b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe57(%rip),%rdi
lea    0xe64(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x8(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11e3 <main+0x53>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x64,%edi
call   10b0 <exit@plt>
jmp    11e8 <main+0x58>
mov    -0x30(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1206 <main+0x76>
jmp    1236 <main+0xa6>
mov    -0x30(%rbp),%rdi
movslq -0x8(%rbp),%rax
lea    -0x25b0(%rbp),%rdx
shl    $0x3,%rax
add    %rax,%rdx
lea    0xe04(%rip),%rsi
call   1050 <fscanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e8 <main+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    128a <main+0xfa>
movslq -0x8(%rbp),%rax
movsd  -0x25b0(%rbp,%rax,8),%xmm0
ff ff
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1256 <main+0xc6>
movl   $0xa,-0x10(%rbp)
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%ecx
call   1080 <pacf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1301 <main+0x171>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xd5b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12cc <main+0x13c>
lea    0xda6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
lea    0xd2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%r8d
call   1090 <pacf_opt@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1377 <main+0x1e7>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xce5(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1342 <main+0x1b2>
lea    0xd30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x24(%rbp)
lea    0xcda(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%r8d
call   1090 <pacf_opt@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    13ed <main+0x25d>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xc6f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    13b8 <main+0x228>
lea    0xcba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x2,-0x24(%rbp)
lea    0xc7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%r8d
call   1090 <pacf_opt@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1463 <main+0x2d3>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xbf9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    142e <main+0x29e>
lea    0xc44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x25b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x2588,%rsp
lea    0xe3b(%rip),%rdi
lea    0xe48(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     169b <main+0x4eb>
mov    %rax,%r14
mov    %rax,%rdi
call   1080 <feof@plt>
test   %eax,%eax
je     1536 <main+0x386>
xor    %r14d,%r14d
xor    %edi,%edi
call   1090 <malloc@plt>
mov    %rax,%r15
mov    $0x50,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
lea    0xe23(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
mov    $0xa,%ecx
call   10a0 <pacf@plt>
movsd  (%rbx),%xmm0
lea    0xdfc(%rip),%r12
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x8(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x18(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x20(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x28(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x30(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x38(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x40(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x48(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xd77(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
mov    %r14d,%esi
xor    %edx,%edx
mov    %rbx,%rcx
mov    $0xa,%r8d
call   10b0 <pacf_opt@plt>
movsd  (%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x8(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x18(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x20(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x28(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x30(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x38(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x40(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x48(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xcd7(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
mov    $0xa,%r8d
call   10b0 <pacf_opt@plt>
movsd  (%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x8(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x18(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x20(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x28(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x30(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x38(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x40(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x48(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xc2d(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x2,%edx
mov    %rbx,%rcx
mov    $0xa,%r8d
call   10b0 <pacf_opt@plt>
movsd  (%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x8(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x18(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x20(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x28(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x30(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x38(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x40(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x48(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x2588,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
xor    %ebx,%ebx
lea    0xae8(%rip),%r15
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rsp,%rbx,1),%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <fscanf@plt>
mov    %r14,%rdi
call   1080 <feof@plt>
add    $0xffffffffffffffff,%r12
add    $0x8,%rbx
test   %eax,%eax
je     1550 <main+0x3a0>
mov    %ebx,%edi
call   1090 <malloc@plt>
mov    %rax,%r15
test   %r12d,%r12d
je     1650 <main+0x4a0>
mov    %r12,%r14
neg    %r14
mov    %r14d,%eax
cmp    $0x4,%rax
jb     15b7 <main+0x407>
lea    (%r15,%rax,8),%rcx
lea    (%rsp,%rax,8),%rdx
mov    %rsp,%rsi
cmp    %rcx,%rsi
setb   %cl
cmp    %rdx,%r15
jae    1658 <main+0x4a8>
test   %cl,%cl
je     1658 <main+0x4a8>
xor    %ecx,%ecx
add    %ecx,%r12d
neg    %r12d
mov    %rcx,%rdx
not    %rdx
add    %rdx,%rax
test   $0x3,%r12b
je     15f5 <main+0x445>
mov    %r14d,%edx
sub    %cl,%dl
movzbl %dl,%edx
and    $0x3,%edx
nopl   0x0(%rax)
movsd  (%rsp,%rcx,8),%xmm0
movsd  %xmm0,(%r15,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rdx
jne    15e0 <main+0x430>
cmp    $0x2,%rax
jbe    11fa <main+0x4a>
mov    %r14d,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rsp,%rcx,8),%xmm0
movsd  %xmm0,(%r15,%rcx,8)
movsd  0x8(%rsp,%rcx,8),%xmm0
movsd  %xmm0,0x8(%r15,%rcx,8)
movsd  0x10(%rsp,%rcx,8),%xmm0
movsd  %xmm0,0x10(%r15,%rcx,8)
movsd  0x18(%rsp,%rcx,8),%xmm0
movsd  %xmm0,0x18(%r15,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%rax
jne    1610 <main+0x460>
jmp    11fa <main+0x4a>
xor    %r14d,%r14d
jmp    11fa <main+0x4a>
mov    %r14d,%esi
mov    %r14d,%edx
and    $0x3,%edx
mov    %rax,%rcx
sub    %rdx,%rcx
sub    %rdx,%rsi
xor    %edi,%edi
nopl   0x0(%rax)
movaps (%rsp,%rdi,8),%xmm0
movaps 0x10(%rsp,%rdi,8),%xmm1
movups %xmm0,(%r15,%rdi,8)
movups %xmm1,0x10(%r15,%rdi,8)
add    $0x4,%rdi
cmp    %rdi,%rsi
jne    1670 <main+0x4c0>
test   %rdx,%rdx
jne    15b9 <main+0x409>
jmp    11fa <main+0x4a>
lea    0x974(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x64,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"../data/seriesC.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [17 x i8] c"Cannot Open File\00"
@.str.3 = [6 x i8] c"%lf \0A\00"
@.str.4 = [26 x i8] c"\0A Default Method : pacf \0A\00"
@.str.5 = [4 x i8] c"%g \00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [34 x i8] c"\0A pacf_opt Method 0 Yule Walker \0A\00"
@.str.8 = [27 x i8] c"\0A pacf_opt Method 1 Burg \0A\00"
@.str.9 = [40 x i8] c"\0A pacf_opt Method 2 MLE (Box-Jenkins) \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca [1200 x double]
store i32 0, i32* %1
%10 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %8
store i32 0, i32* %2
%11 = load i32*, i32** %8
%12 = icmp ne i32* %11, null
br i1 %12, label %16, label %13
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @exit(i32 100)
unreachable
16: ; preds = %0
br label %17
17: ; preds = %22, %16
%18 = load i32*, i32** %8
%19 = call i32 @feof(i32* %18)
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
br i1 %21, label %22, label %30
22: ; preds = %17
%23 = load i32*, i32** %8
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [1200 x double], [1200 x double]* %9, i64 0, i64 %25
%27 = call i32 @fscanf(i32* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double* %26)
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %17
30: ; preds = %17
%31 = load i32, i32* %2
store i32 %31, i32* %3
%32 = load i32, i32* %3
%33 = sext i32 %32 to i64
%34 = mul i64 8, %33
%35 = trunc i64 %34 to i32
%36 = call i64 @malloc(i32 %35)
%37 = inttoptr i64 %36 to double*
store double* %37, double** %5
store i32 0, i32* %2
br label %38
38: ; preds = %51, %30
%39 = load i32, i32* %2
%40 = load i32, i32* %3
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %54
42: ; preds = %38
%43 = load i32, i32* %2
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [1200 x double], [1200 x double]* %9, i64 0, i64 %44
%46 = load double, double* %45
%47 = load double*, double** %5
%48 = load i32, i32* %2
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %47, i64 %49
store double %46, double* %50
br label %51
51: ; preds = %42
%52 = load i32, i32* %2
%53 = add nsw i32 %52, 1
store i32 %53, i32* %2
br label %38
54: ; preds = %38
store i32 10, i32* %4
%55 = load i32, i32* %4
%56 = sext i32 %55 to i64
%57 = mul i64 8, %56
%58 = trunc i64 %57 to i32
%59 = call i64 @malloc(i32 %58)
%60 = inttoptr i64 %59 to double*
store double* %60, double** %6
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%62 = load double*, double** %5
%63 = load i32, i32* %3
%64 = load double*, double** %6
%65 = load i32, i32* %4
%66 = call i32 @pacf(double* %62, i32 %63, double* %64, i32 %65)
store i32 0, i32* %2
br label %67
67: ; preds = %78, %54
%68 = load i32, i32* %2
%69 = load i32, i32* %4
%70 = icmp slt i32 %68, %69
br i1 %70, label %71, label %81
71: ; preds = %67
%72 = load double*, double** %6
%73 = load i32, i32* %2
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %72, i64 %74
%76 = load double, double* %75
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %76)
br label %78
78: ; preds = %71
%79 = load i32, i32* %2
%80 = add nsw i32 %79, 1
store i32 %80, i32* %2
br label %67
81: ; preds = %67
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %7
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0))
%84 = load double*, double** %5
%85 = load i32, i32* %3
%86 = load i32, i32* %7
%87 = load double*, double** %6
%88 = load i32, i32* %4
%89 = call i32 @pacf_opt(double* %84, i32 %85, i32 %86, double* %87, i32 %88)
store i32 0, i32* %2
br label %90
90: ; preds = %101, %81
%91 = load i32, i32* %2
%92 = load i32, i32* %4
%93 = icmp slt i32 %91, %92
br i1 %93, label %94, label %104
94: ; preds = %90
%95 = load double*, double** %6
%96 = load i32, i32* %2
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds double, double* %95, i64 %97
%99 = load double, double* %98
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %99)
br label %101
101: ; preds = %94
%102 = load i32, i32* %2
%103 = add nsw i32 %102, 1
store i32 %103, i32* %2
br label %90
104: ; preds = %90
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %7
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%107 = load double*, double** %5
%108 = load i32, i32* %3
%109 = load i32, i32* %7
%110 = load double*, double** %6
%111 = load i32, i32* %4
%112 = call i32 @pacf_opt(double* %107, i32 %108, i32 %109, double* %110, i32 %111)
store i32 0, i32* %2
br label %113
113: ; preds = %124, %104
%114 = load i32, i32* %2
%115 = load i32, i32* %4
%116 = icmp slt i32 %114, %115
br i1 %116, label %117, label %127
117: ; preds = %113
%118 = load double*, double** %6
%119 = load i32, i32* %2
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double, double* %118, i64 %120
%122 = load double, double* %121
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %122)
br label %124
124: ; preds = %117
%125 = load i32, i32* %2
%126 = add nsw i32 %125, 1
store i32 %126, i32* %2
br label %113
127: ; preds = %113
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32 2, i32* %7
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0))
%130 = load double*, double** %5
%131 = load i32, i32* %3
%132 = load i32, i32* %7
%133 = load double*, double** %6
%134 = load i32, i32* %4
%135 = call i32 @pacf_opt(double* %130, i32 %131, i32 %132, double* %133, i32 %134)
store i32 0, i32* %2
br label %136
136: ; preds = %147, %127
%137 = load i32, i32* %2
%138 = load i32, i32* %4
%139 = icmp slt i32 %137, %138
br i1 %139, label %140, label %150
140: ; preds = %136
%141 = load double*, double** %6
%142 = load i32, i32* %2
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %141, i64 %143
%145 = load double, double* %144
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %145)
br label %147
147: ; preds = %140
%148 = load i32, i32* %2
%149 = add nsw i32 %148, 1
store i32 %149, i32* %2
br label %136
150: ; preds = %136
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%152 = load double*, double** %5
%153 = call i32 @free(double* %152)
%154 = load double*, double** %6
%155 = call i32 @free(double* %154)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"../data/seriesC.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [17 x i8] c"Cannot Open File\00"
@.str.3 = [6 x i8] c"%lf \0A\00"
@.str.5 = [4 x i8] c"%g \00"
@str = [25 x i8] c"\0A Default Method : pacf \00"
@str.10 = [33 x i8] c"\0A pacf_opt Method 0 Yule Walker \00"
@str.11 = [26 x i8] c"\0A pacf_opt Method 1 Burg \00"
@str.12 = [39 x i8] c"\0A pacf_opt Method 2 MLE (Box-Jenkins) \00"
define i32 @main() {
%1 = alloca [1200 x double]
%2 = bitcast [1200 x double]* %1 to i8*
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %11, label %5
5: ; preds = %0
%6 = call i32 @feof(i32* %3)
%7 = icmp eq i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = call i64 @malloc(i32 0)
%10 = inttoptr i64 %9 to double*
br label %96
11: ; preds = %0
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @exit(i32 100)
unreachable
14: ; preds = %5, %14
%15 = phi i64 [ %18, %14 ], [ 0, %5 ]
%16 = getelementptr inbounds [1200 x double], [1200 x double]* %1, i64 0, i64 %15
%17 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double* %16)
%18 = add nuw i64 %15, 1
%19 = call i32 @feof(i32* %3)
%20 = icmp eq i32 %19, 0
br i1 %20, label %14, label %21
21: ; preds = %14
%22 = trunc i64 %18 to i32
%23 = shl i32 %22, 3
%24 = call i64 @malloc(i32 %23)
%25 = inttoptr i64 %24 to double*
%26 = inttoptr i64 %24 to i8*
%27 = icmp eq i32 %22, 0
br i1 %27, label %96, label %28
28: ; preds = %21
%29 = and i64 %18, 4294967295
%30 = icmp ult i64 %29, 4
br i1 %30, label %58, label %31
31: ; preds = %28
%32 = getelementptr double, double* %25, i64 %29
%33 = getelementptr [1200 x double], [1200 x double]* %1, i64 0, i64 %29
%34 = bitcast double* %33 to i8*
%35 = icmp ult i8* %26, %34
%36 = bitcast double* %32 to [1200 x double]*
%37 = icmp ult [1200 x double]* %1, %36
%38 = and i1 %35, %37
br i1 %38, label %58, label %39
39: ; preds = %31
%40 = and i64 %18, 3
%41 = sub nsw i64 %29, %40
br label %42
42: ; preds = %42, %39
%43 = phi i64 [ 0, %39 ], [ %54, %42 ]
%44 = getelementptr inbounds [1200 x double], [1200 x double]* %1, i64 0, i64 %43
%45 = bitcast double* %44 to <2 x double>*
%46 = load <2 x double>, <2 x double>* %45
%47 = getelementptr inbounds double, double* %44, i64 2
%48 = bitcast double* %47 to <2 x double>*
%49 = load <2 x double>, <2 x double>* %48
%50 = getelementptr inbounds double, double* %25, i64 %43
%51 = bitcast double* %50 to <2 x double>*
store <2 x double> %46, <2 x double>* %51
%52 = getelementptr inbounds double, double* %50, i64 2
%53 = bitcast double* %52 to <2 x double>*
store <2 x double> %49, <2 x double>* %53
%54 = add nuw i64 %43, 4
%55 = icmp eq i64 %54, %41
br i1 %55, label %56, label %42
56: ; preds = %42
%57 = icmp eq i64 %40, 0
br i1 %57, label %96, label %58
58: ; preds = %31, %28, %56
%59 = phi i64 [ 0, %31 ], [ 0, %28 ], [ %41, %56 ]
%60 = sub i64 %18, %59
%61 = xor i64 %59, -1
%62 = add nsw i64 %29, %61
%63 = and i64 %60, 3
%64 = icmp eq i64 %63, 0
br i1 %64, label %74, label %65
65: ; preds = %58, %65
%66 = phi i64 [ %71, %65 ], [ %59, %58 ]
%67 = phi i64 [ %72, %65 ], [ 0, %58 ]
%68 = getelementptr inbounds [1200 x double], [1200 x double]* %1, i64 0, i64 %66
%69 = load double, double* %68
%70 = getelementptr inbounds double, double* %25, i64 %66
store double %69, double* %70
%71 = add nuw nsw i64 %66, 1
%72 = add i64 %67, 1
%73 = icmp eq i64 %72, %63
br i1 %73, label %74, label %65
74: ; preds = %65, %58
%75 = phi i64 [ %59, %58 ], [ %71, %65 ]
%76 = icmp ult i64 %62, 3
br i1 %76, label %96, label %77
77: ; preds = %74, %77
%78 = phi i64 [ %94, %77 ], [ %75, %74 ]
%79 = getelementptr inbounds [1200 x double], [1200 x double]* %1, i64 0, i64 %78
%80 = load double, double* %79
%81 = getelementptr inbounds double, double* %25, i64 %78
store double %80, double* %81
%82 = add nuw nsw i64 %78, 1
%83 = getelementptr inbounds [1200 x double], [1200 x double]* %1, i64 0, i64 %82
%84 = load double, double* %83
%85 = getelementptr inbounds double, double* %25, i64 %82
store double %84, double* %85
%86 = add nuw nsw i64 %78, 2
%87 = getelementptr inbounds [1200 x double], [1200 x double]* %1, i64 0, i64 %86
%88 = load double, double* %87
%89 = getelementptr inbounds double, double* %25, i64 %86
store double %88, double* %89
%90 = add nuw nsw i64 %78, 3
%91 = getelementptr inbounds [1200 x double], [1200 x double]* %1, i64 0, i64 %90
%92 = load double, double* %91
%93 = getelementptr inbounds double, double* %25, i64 %90
store double %92, double* %93
%94 = add nuw nsw i64 %78, 4
%95 = icmp eq i64 %94, %29
br i1 %95, label %96, label %77
96: ; preds = %74, %77, %56, %8, %21
%97 = phi double* [ %10, %8 ], [ %25, %21 ], [ %25, %56 ], [ %25, %77 ], [ %25, %74 ]
%98 = phi i32 [ 0, %8 ], [ 0, %21 ], [ %22, %56 ], [ %22, %77 ], [ %22, %74 ]
%99 = call i64 @malloc(i32 80)
%100 = inttoptr i64 %99 to double*
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%102 = call i32 @pacf(double* %97, i32 %98, double* %100, i32 10)
%103 = load double, double* %100
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %103)
%105 = getelementptr inbounds double, double* %100, i64 1
%106 = load double, double* %105
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %106)
%108 = getelementptr inbounds double, double* %100, i64 2
%109 = load double, double* %108
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %109)
%111 = getelementptr inbounds double, double* %100, i64 3
%112 = load double, double* %111
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %112)
%114 = getelementptr inbounds double, double* %100, i64 4
%115 = load double, double* %114
%116 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %115)
%117 = getelementptr inbounds double, double* %100, i64 5
%118 = load double, double* %117
%119 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %118)
%120 = getelementptr inbounds double, double* %100, i64 6
%121 = load double, double* %120
%122 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %121)
%123 = getelementptr inbounds double, double* %100, i64 7
%124 = load double, double* %123
%125 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %124)
%126 = getelementptr inbounds double, double* %100, i64 8
%127 = load double, double* %126
%128 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %127)
%129 = getelementptr inbounds double, double* %100, i64 9
%130 = load double, double* %129
%131 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %130)
%132 = call i32 @putchar(i32 10)
%133 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.10, i64 0, i64 0))
%134 = call i32 @pacf_opt(double* %97, i32 %98, i32 0, double* %100, i32 10)
%135 = load double, double* %100
%136 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %135)
%137 = load double, double* %105
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %137)
%139 = load double, double* %108
%140 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %139)
%141 = load double, double* %111
%142 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %141)
%143 = load double, double* %114
%144 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %143)
%145 = load double, double* %117
%146 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %145)
%147 = load double, double* %120
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %147)
%149 = load double, double* %123
%150 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %149)
%151 = load double, double* %126
%152 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %151)
%153 = load double, double* %129
%154 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %153)
%155 = call i32 @putchar(i32 10)
%156 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.11, i64 0, i64 0))
%157 = call i32 @pacf_opt(double* %97, i32 %98, i32 1, double* %100, i32 10)
%158 = load double, double* %100
%159 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %158)
%160 = load double, double* %105
%161 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %160)
%162 = load double, double* %108
%163 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %162)
%164 = load double, double* %111
%165 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %164)
%166 = load double, double* %114
%167 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %166)
%168 = load double, double* %117
%169 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %168)
%170 = load double, double* %120
%171 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %170)
%172 = load double, double* %123
%173 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %172)
%174 = load double, double* %126
%175 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %174)
%176 = load double, double* %129
%177 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %176)
%178 = call i32 @putchar(i32 10)
%179 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.12, i64 0, i64 0))
%180 = call i32 @pacf_opt(double* %97, i32 %98, i32 2, double* %100, i32 10)
%181 = load double, double* %100
%182 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %181)
%183 = load double, double* %105
%184 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %183)
%185 = load double, double* %108
%186 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %185)
%187 = load double, double* %111
%188 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %187)
%189 = load double, double* %114
%190 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %189)
%191 = load double, double* %117
%192 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %191)
%193 = load double, double* %120
%194 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %193)
%195 = load double, double* %123
%196 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %195)
%197 = load double, double* %126
%198 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %197)
%199 = load double, double* %129
%200 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %199)
%201 = call i32 @putchar(i32 10)
%202 = call i32 @free(double* %97)
%203 = call i32 @free(double* %100)
ret i32 0
}