#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*/ acvf(double *, int, double *, int);
int /*<<< orphan*/ acvf2acf(double *, int);
int /*<<< orphan*/ acvf_opt(double *, int, int, double *, int);
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*/ printf(char *, ...);
int main(void) {
  int i, N, M;
  double *inp, *acf;
  int method;
  FILE *ifp;
  double temp[1200];
  ifp = fopen("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;
  acf = (double *)malloc(sizeof(double) * M);
  printf("\n Default Method : acvf \n");
  acvf(inp, N, acf, M);
  for (i = 0; i < M; ++i) {
    printf("%g ", acf[i]);
  }
  printf("\n");
  method = 0;
  printf("\n acvf_opt Method 0 General Method \n");
  acvf_opt(inp, N, method, acf, M);
  for (i = 0; i < M; ++i) {
    printf("%g ", acf[i]);
  }
  printf("\n");
  method = 1;
  printf("\n acvf_opt Method 1 FFT \n");
  acvf_opt(inp, N, method, acf, M);
  for (i = 0; i < M; ++i) {
    printf("%g ", acf[i]);
  }
  printf("\n \n");
  printf("Autocorrelation \n");
  acvf2acf(acf, M);
  for (i = 0; i < M; ++i) {
    printf("%g ", acf[i]);
  }
  printf("\n");
  free(inp);
  free(acf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x25b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe47(%rip),%rdi
lea    0xe4c(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x8(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11f3 <main+0x53>
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x64,%edi
call   10c0 <exit@plt>
jmp    11f8 <main+0x58>
mov    -0x30(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1216 <main+0x76>
jmp    1246 <main+0xa6>
mov    -0x30(%rbp),%rdi
movslq -0x8(%rbp),%rax
lea    -0x25b0(%rbp),%rdx
shl    $0x3,%rax
add    %rax,%rdx
lea    0xdec(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11f8 <main+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    129a <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    1266 <main+0xc6>
movl   $0xa,-0x10(%rbp)
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%ecx
call   1040 <acvf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1311 <main+0x171>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xd43(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12dc <main+0x13c>
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x24(%rbp)
lea    0xd16(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%r8d
call   1070 <acvf_opt@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1387 <main+0x1e7>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xccd(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1352 <main+0x1b2>
lea    0xcf6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x24(%rbp)
lea    0xcc5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%r8d
call   1070 <acvf_opt@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    13fd <main+0x25d>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xc57(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    13c8 <main+0x228>
lea    0xc7e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc74(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   10a0 <acvf2acf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1461 <main+0x2c1>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xbf3(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    142c <main+0x28c>
lea    0xc1c(%rip),%rdi
mov    $0x0,%al
call   1050 <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    0xe2b(%rip),%rdi
lea    0xe30(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     169b <main+0x4db>
mov    %rax,%r14
mov    %rax,%rdi
call   10a0 <feof@plt>
test   %eax,%eax
je     153c <main+0x37c>
xor    %r14d,%r14d
xor    %edi,%edi
call   10b0 <malloc@plt>
mov    %rax,%r15
mov    $0x50,%edi
call   10b0 <malloc@plt>
mov    %rax,%rbx
lea    0xe0b(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
mov    $0xa,%ecx
call   1060 <acvf@plt>
movsd  (%rbx),%xmm0
lea    0xde4(%rip),%r12
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x8(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x18(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x20(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x28(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x30(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x38(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x40(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x48(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xd5f(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
mov    %r14d,%esi
xor    %edx,%edx
mov    %rbx,%rcx
mov    $0xa,%r8d
call   1090 <acvf_opt@plt>
movsd  (%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x8(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x18(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x20(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x28(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x30(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x38(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x40(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x48(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xcc2(%rip),%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
mov    $0xa,%r8d
call   1090 <acvf_opt@plt>
movsd  (%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x8(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x18(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x20(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x28(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x30(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x38(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x40(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x48(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
lea    0xc21(%rip),%rdi
call   1050 <puts@plt>
lea    0xc18(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   10c0 <acvf2acf@plt>
movsd  (%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x8(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x18(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x20(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x28(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x30(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x38(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x40(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movsd  0x48(%rbx),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1070 <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    0xada(%rip),%r15
xor    %r12d,%r12d
nopl   0x0(%rax,%rax,1)
lea    (%rsp,%rbx,1),%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1080 <fscanf@plt>
mov    %r14,%rdi
call   10a0 <feof@plt>
add    $0xffffffffffffffff,%r12
add    $0x8,%rbx
test   %eax,%eax
je     1550 <main+0x390>
mov    %ebx,%edi
call   10b0 <malloc@plt>
mov    %rax,%r15
test   %r12d,%r12d
je     1650 <main+0x490>
mov    %r12,%r14
neg    %r14
mov    %r14d,%eax
cmp    $0x4,%rax
jb     15b7 <main+0x3f7>
lea    (%r15,%rax,8),%rcx
lea    (%rsp,%rax,8),%rdx
mov    %rsp,%rsi
cmp    %rcx,%rsi
setb   %cl
cmp    %rdx,%r15
jae    1658 <main+0x498>
test   %cl,%cl
je     1658 <main+0x498>
xor    %ecx,%ecx
add    %ecx,%r12d
neg    %r12d
mov    %rcx,%rdx
not    %rdx
add    %rdx,%rax
test   $0x3,%r12b
je     15f5 <main+0x435>
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+0x420>
cmp    $0x2,%rax
jbe    120a <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+0x450>
jmp    120a <main+0x4a>
xor    %r14d,%r14d
jmp    120a <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+0x4b0>
test   %rdx,%rdx
jne    15b9 <main+0x3f9>
jmp    120a <main+0x4a>
lea    0x96c(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x64,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"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 : acvf \0A\00"
@.str.5 = [4 x i8] c"%g \00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [37 x i8] c"\0A acvf_opt Method 0 General Method \0A\00"
@.str.8 = [26 x i8] c"\0A acvf_opt Method 1 FFT \0A\00"
@.str.9 = [4 x i8] c"\0A \0A\00"
@.str.10 = [18 x i8] c"Autocorrelation \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 ([12 x i8], [12 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 @acvf(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 ([37 x i8], [37 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 @acvf_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 ([26 x i8], [26 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 @acvf_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 ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
%130 = load double*, double** %6
%131 = load i32, i32* %4
%132 = call i32 @acvf2acf(double* %130, i32 %131)
store i32 0, i32* %2
br label %133
133: ; preds = %144, %127
%134 = load i32, i32* %2
%135 = load i32, i32* %4
%136 = icmp slt i32 %134, %135
br i1 %136, label %137, label %147
137: ; preds = %133
%138 = load double*, double** %6
%139 = load i32, i32* %2
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double, double* %138, i64 %140
%142 = load double, double* %141
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %142)
br label %144
144: ; preds = %137
%145 = load i32, i32* %2
%146 = add nsw i32 %145, 1
store i32 %146, i32* %2
br label %133
147: ; preds = %133
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%149 = load double*, double** %5
%150 = call i32 @free(double* %149)
%151 = load double*, double** %6
%152 = call i32 @free(double* %151)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"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 : acvf \00"
@str.11 = [36 x i8] c"\0A acvf_opt Method 0 General Method \00"
@str.12 = [25 x i8] c"\0A acvf_opt Method 1 FFT \00"
@str.13 = [3 x i8] c"\0A \00"
@str.14 = [17 x i8] c"Autocorrelation \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 ([12 x i8], [12 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 @acvf(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 ([36 x i8], [36 x i8]* @str.11, i64 0, i64 0))
%134 = call i32 @acvf_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 ([25 x i8], [25 x i8]* @str.12, i64 0, i64 0))
%157 = call i32 @acvf_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 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.13, i64 0, i64 0))
%179 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.14, i64 0, i64 0))
%180 = call i32 @acvf2acf(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
}