#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 atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ softSymCor2(int, double *, double *, double *, double *,
                               double *, int);
int main(int argc, char **argv) {
  FILE *fp;
  int i, isReal;
  int n, bw;
  double *signal, *pattern;
  double alpha, beta, gamma;
  if (argc < 5) {
    printf("test_soft_sym_correlate2_wrap signalFile patternFile bw isReal\n ");
    exit(0);
  }
  bw = atoi(argv[3]);
  n = 2 * bw;
  isReal = atoi(argv[4]);
  if (isReal) {
    signal = (double *)malloc(sizeof(double) * (n * n));
    pattern = (double *)malloc(sizeof(double) * (n * n));
  } else {
    signal = (double *)malloc(sizeof(double) * (2 * n * n));
    pattern = (double *)malloc(sizeof(double) * (2 * n * n));
  }
  if ((signal == NULL) || (pattern == NULL)) {
    perror("Error in allocating memory");
    exit(1);
  }
  printf("Reading in signal file\n");
  fp = fopen(argv[1], "r");
  if (isReal) {
    for (i = 0; i < n * n; i++)
      fscanf(fp, "%lf", signal + i);
  } else {
    for (i = 0; i < 2 * n * n; i++)
      fscanf(fp, "%lf", signal + i);
  }
  fclose(fp);
  printf("Reading in pattern file\n");
  fp = fopen(argv[2], "r");
  if (isReal) {
    for (i = 0; i < n * n; i++)
      fscanf(fp, "%lf", pattern + i);
  } else {
    for (i = 0; i < 2 * n * n; i++)
      fscanf(fp, "%lf", pattern + i);
  }
  fclose(fp);
  softSymCor2(bw, signal, pattern, &alpha, &beta, &gamma, isReal);
  printf("alpha = %f\nbeta = %f\ngamma = %f\n", alpha, beta, gamma);
  free(pattern);
  free(signal);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11d5 <main+0x35>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     123d <main+0x9d>
mov    -0x24(%rbp),%eax
imul   -0x24(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
imul   -0x24(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x38(%rbp)
jmp    1273 <main+0xd3>
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
imul   -0x24(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
imul   -0x24(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1289 <main+0xe9>
cmpq   $0x0,-0x38(%rbp)
jne    129f <main+0xff>
lea    0xdb1(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdb8(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     131a <main+0x17a>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x24(%rbp),%ecx
imul   -0x24(%rbp),%ecx
cmp    %ecx,%eax
jge    1315 <main+0x175>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rdx
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xd74(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12d6 <main+0x136>
jmp    1368 <main+0x1c8>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
imul   -0x24(%rbp),%ecx
cmp    %ecx,%eax
jge    1363 <main+0x1c3>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rdx
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xd26(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1321 <main+0x181>
jmp    1368 <main+0x1c8>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xd02(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xce6(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     13ec <main+0x24c>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x24(%rbp),%ecx
imul   -0x24(%rbp),%ecx
cmp    %ecx,%eax
jge    13e7 <main+0x247>
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%rdx
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xca2(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    13a8 <main+0x208>
jmp    143a <main+0x29a>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
imul   -0x24(%rbp),%ecx
cmp    %ecx,%eax
jge    1435 <main+0x295>
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%rdx
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xc54(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    13f3 <main+0x253>
jmp    143a <main+0x29a>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x20(%rbp),%eax
lea    -0x40(%rbp),%rcx
lea    -0x48(%rbp),%r8
lea    -0x50(%rbp),%r9
mov    %eax,(%rsp)
call   1080 <softSymCor2@plt>
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
lea    0xc18(%rip),%rdi
mov    $0x3,%al
call   1050 <printf@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
cmp    $0x4,%edi
jle    13fc <main+0x24c>
mov    %rsi,%r13
mov    0x18(%rsi),%rdi
call   10c0 <atoi@plt>
mov    %eax,%r14d
lea    (%r14,%r14,1),%r12d
mov    0x20(%r13),%rdi
call   10c0 <atoi@plt>
mov    %eax,%r15d
mov    %r14d,%eax
imul   %r12d,%eax
mov    %rax,0x20(%rsp)
shl    $0x5,%eax
imul   %r12d,%r12d
lea    0x0(,%r12,8),%ebx
test   %r15d,%r15d
cmove  %eax,%ebx
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rbp,0x18(%rsp)
test   %rbp,%rbp
je     1411 <main+0x261>
test   %rax,%rax
je     1411 <main+0x261>
mov    %rax,0x28(%rsp)
lea    0xe48(%rip),%rdi
call   1040 <puts@plt>
mov    %r13,0x30(%rsp)
mov    0x8(%r13),%rdi
lea    0xe0c(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r13
test   %r15d,%r15d
mov    %r14,0x38(%rsp)
mov    %r15d,0x14(%rsp)
je     129a <main+0xea>
test   %r12d,%r12d
je     12d8 <main+0x128>
mov    %r12d,%r15d
lea    0xde8(%rip),%r14
mov    0x18(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1070 <fscanf@plt>
add    $0x8,%rbx
add    $0xffffffffffffffff,%r15
jne    1280 <main+0xd0>
jmp    12d8 <main+0x128>
mov    0x20(%rsp),%rax
lea    0x0(,%rax,4),%eax
test   %eax,%eax
jle    12d8 <main+0x128>
mov    %eax,%ebp
lea    0xdab(%rip),%r14
mov    0x18(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1070 <fscanf@plt>
add    $0x8,%rbx
add    $0xffffffffffffffff,%rbp
jne    12c0 <main+0x110>
mov    %r13,%rdi
call   1050 <fclose@plt>
lea    0xdb3(%rip),%rdi
call   1040 <puts@plt>
mov    0x30(%rsp),%rax
mov    0x10(%rax),%rdi
lea    0xd60(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r15
cmpl   $0x0,0x14(%rsp)
je     134a <main+0x19a>
test   %r12d,%r12d
mov    0x28(%rsp),%r13
je     1388 <main+0x1d8>
mov    %r12d,%ebx
lea    0xd3f(%rip),%r14
mov    %r13,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1070 <fscanf@plt>
add    $0x8,%rbp
add    $0xffffffffffffffff,%rbx
jne    1330 <main+0x180>
jmp    1388 <main+0x1d8>
mov    0x20(%rsp),%rax
shl    $0x2,%eax
test   %eax,%eax
mov    0x28(%rsp),%r13
jle    1388 <main+0x1d8>
mov    %eax,%ebx
lea    0xcfa(%rip),%r14
mov    %r13,%rbp
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1070 <fscanf@plt>
add    $0x8,%rbp
add    $0xffffffffffffffff,%rbx
jne    1370 <main+0x1c0>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    0x14(%rsp),%eax
mov    %eax,(%rsp)
lea    0x50(%rsp),%rcx
lea    0x48(%rsp),%r8
lea    0x40(%rsp),%r9
mov    0x38(%rsp),%rdi
mov    0x18(%rsp),%rbx
mov    %rbx,%rsi
mov    %r13,%rdx
call   1090 <softSymCor2@plt>
movsd  0x50(%rsp),%xmm0
movsd  0x48(%rsp),%xmm1
movsd  0x40(%rsp),%xmm2
lea    0xc8e(%rip),%rdi
mov    $0x3,%al
call   1060 <printf@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbfd(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
lea    0xc29(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"test_soft_sym_correlate2_wrap signalFile patternFile bw isReal\0A \00"
@.str.1 = [27 x i8] c"Error in allocating memory\00"
@.str.2 = [24 x i8] c"Reading in signal file\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.5 = [25 x i8] c"Reading in pattern file\0A\00"
@.str.6 = [33 x i8] c"alpha = %f\0Abeta = %f\0Agamma = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca double
%15 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 5
br i1 %17, label %18, label %21
18: ; preds = %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 3
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = mul nsw i32 2, %26
store i32 %27, i32* %9
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 4
%30 = load i8*, i8** %29
%31 = call i32 @atoi(i8* %30)
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %51
34: ; preds = %21
%35 = load i32, i32* %9
%36 = load i32, i32* %9
%37 = mul nsw i32 %35, %36
%38 = sext i32 %37 to i64
%39 = mul i64 8, %38
%40 = trunc i64 %39 to i32
%41 = call i64 @malloc(i32 %40)
%42 = inttoptr i64 %41 to double*
store double* %42, double** %11
%43 = load i32, i32* %9
%44 = load i32, i32* %9
%45 = mul nsw i32 %43, %44
%46 = sext i32 %45 to i64
%47 = mul i64 8, %46
%48 = trunc i64 %47 to i32
%49 = call i64 @malloc(i32 %48)
%50 = inttoptr i64 %49 to double*
store double* %50, double** %12
br label %70
51: ; preds = %21
%52 = load i32, i32* %9
%53 = mul nsw i32 2, %52
%54 = load i32, i32* %9
%55 = mul nsw i32 %53, %54
%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** %11
%61 = load i32, i32* %9
%62 = mul nsw i32 2, %61
%63 = load i32, i32* %9
%64 = mul nsw i32 %62, %63
%65 = sext i32 %64 to i64
%66 = mul i64 8, %65
%67 = trunc i64 %66 to i32
%68 = call i64 @malloc(i32 %67)
%69 = inttoptr i64 %68 to double*
store double* %69, double** %12
br label %70
70: ; preds = %51, %34
%71 = load double*, double** %11
%72 = icmp eq double* %71, null
br i1 %72, label %76, label %73
73: ; preds = %70
%74 = load double*, double** %12
%75 = icmp eq double* %74, null
br i1 %75, label %76, label %79
76: ; preds = %73, %70
%77 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%78 = call i32 @exit(i32 1)
unreachable
79: ; preds = %73
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 1
%83 = load i8*, i8** %82
%84 = call i32* @fopen(i8* %83, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %84, i32** %6
%85 = load i32, i32* %8
%86 = icmp ne i32 %85, 0
br i1 %86, label %87, label %105
87: ; preds = %79
store i32 0, i32* %7
br label %88
88: ; preds = %101, %87
%89 = load i32, i32* %7
%90 = load i32, i32* %9
%91 = load i32, i32* %9
%92 = mul nsw i32 %90, %91
%93 = icmp slt i32 %89, %92
br i1 %93, label %94, label %104
94: ; preds = %88
%95 = load i32*, i32** %6
%96 = load double*, double** %11
%97 = load i32, i32* %7
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %96, i64 %98
%100 = call i32 @fscanf(i32* %95, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %99)
br label %101
101: ; preds = %94
%102 = load i32, i32* %7
%103 = add nsw i32 %102, 1
store i32 %103, i32* %7
br label %88
104: ; preds = %88
br label %124
105: ; preds = %79
store i32 0, i32* %7
br label %106
106: ; preds = %120, %105
%107 = load i32, i32* %7
%108 = load i32, i32* %9
%109 = mul nsw i32 2, %108
%110 = load i32, i32* %9
%111 = mul nsw i32 %109, %110
%112 = icmp slt i32 %107, %111
br i1 %112, label %113, label %123
113: ; preds = %106
%114 = load i32*, i32** %6
%115 = load double*, double** %11
%116 = load i32, i32* %7
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %115, i64 %117
%119 = call i32 @fscanf(i32* %114, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %118)
br label %120
120: ; preds = %113
%121 = load i32, i32* %7
%122 = add nsw i32 %121, 1
store i32 %122, i32* %7
br label %106
123: ; preds = %106
br label %124
124: ; preds = %123, %104
%125 = load i32*, i32** %6
%126 = call i32 @fclose(i32* %125)
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%128 = load i8**, i8*** %5
%129 = getelementptr inbounds i8*, i8** %128, i64 2
%130 = load i8*, i8** %129
%131 = call i32* @fopen(i8* %130, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %131, i32** %6
%132 = load i32, i32* %8
%133 = icmp ne i32 %132, 0
br i1 %133, label %134, label %152
134: ; preds = %124
store i32 0, i32* %7
br label %135
135: ; preds = %148, %134
%136 = load i32, i32* %7
%137 = load i32, i32* %9
%138 = load i32, i32* %9
%139 = mul nsw i32 %137, %138
%140 = icmp slt i32 %136, %139
br i1 %140, label %141, label %151
141: ; preds = %135
%142 = load i32*, i32** %6
%143 = load double*, double** %12
%144 = load i32, i32* %7
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds double, double* %143, i64 %145
%147 = call i32 @fscanf(i32* %142, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %146)
br label %148
148: ; preds = %141
%149 = load i32, i32* %7
%150 = add nsw i32 %149, 1
store i32 %150, i32* %7
br label %135
151: ; preds = %135
br label %171
152: ; preds = %124
store i32 0, i32* %7
br label %153
153: ; preds = %167, %152
%154 = load i32, i32* %7
%155 = load i32, i32* %9
%156 = mul nsw i32 2, %155
%157 = load i32, i32* %9
%158 = mul nsw i32 %156, %157
%159 = icmp slt i32 %154, %158
br i1 %159, label %160, label %170
160: ; preds = %153
%161 = load i32*, i32** %6
%162 = load double*, double** %12
%163 = load i32, i32* %7
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %162, i64 %164
%166 = call i32 @fscanf(i32* %161, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %165)
br label %167
167: ; preds = %160
%168 = load i32, i32* %7
%169 = add nsw i32 %168, 1
store i32 %169, i32* %7
br label %153
170: ; preds = %153
br label %171
171: ; preds = %170, %151
%172 = load i32*, i32** %6
%173 = call i32 @fclose(i32* %172)
%174 = load i32, i32* %10
%175 = load double*, double** %11
%176 = load double*, double** %12
%177 = load i32, i32* %8
%178 = call i32 @softSymCor2(i32 %174, double* %175, double* %176, double* %13, double* %14, double* %15, i32 %177)
%179 = load double, double* %13
%180 = load double, double* %14
%181 = load double, double* %15
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), double %179, double %180, double %181)
%183 = load double*, double** %12
%184 = call i32 @free(double* %183)
%185 = load double*, double** %11
%186 = call i32 @free(double* %185)
ret i32 0
}

LLVM IR (-O2):
@.str = [65 x i8] c"test_soft_sym_correlate2_wrap signalFile patternFile bw isReal\0A \00"
@.str.1 = [27 x i8] c"Error in allocating memory\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.6 = [33 x i8] c"alpha = %f\0Abeta = %f\0Agamma = %f\0A\00"
@str = [23 x i8] c"Reading in signal file\00"
@str.7 = [24 x i8] c"Reading in pattern file\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %3 to i8*
%7 = bitcast double* %4 to i8*
%8 = bitcast double* %5 to i8*
%9 = icmp slt i32 %0, 5
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 0)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 3
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
%17 = shl nsw i32 %16, 1
%18 = getelementptr inbounds i8*, i8** %1, i64 4
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = icmp eq i32 %20, 0
%22 = shl i32 %16, 5
%23 = mul i32 %22, %17
%24 = mul nsw i32 %17, %17
%25 = shl i32 %24, 3
%26 = select i1 %21, i32 %23, i32 %25
%27 = tail call i64 @malloc(i32 %26)
%28 = tail call i64 @malloc(i32 %26)
%29 = inttoptr i64 %28 to double*
%30 = inttoptr i64 %27 to double*
%31 = icmp eq i64 %27, 0
%32 = icmp eq i64 %28, 0
%33 = select i1 %31, i1 true, i1 %32
br i1 %33, label %34, label %37
34: ; preds = %13
%35 = tail call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%36 = tail call i32 @exit(i32 1)
unreachable
37: ; preds = %13
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%39 = getelementptr inbounds i8*, i8** %1, i64 1
%40 = load i8*, i8** %39
%41 = tail call i32* @fopen(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br i1 %21, label %47, label %42
42: ; preds = %37
%43 = mul i32 %17, %17
%44 = icmp eq i32 %43, 0
br i1 %44, label %65, label %45
45: ; preds = %42
%46 = zext i32 %43 to i64
br label %53
47: ; preds = %37
%48 = shl nsw i32 %16, 2
%49 = mul i32 %48, %17
%50 = icmp sgt i32 %49, 0
br i1 %50, label %51, label %65
51: ; preds = %47
%52 = zext i32 %49 to i64
br label %59
53: ; preds = %45, %53
%54 = phi i64 [ 0, %45 ], [ %57, %53 ]
%55 = getelementptr inbounds double, double* %30, i64 %54
%56 = tail call i32 @fscanf(i32* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %55)
%57 = add nuw nsw i64 %54, 1
%58 = icmp eq i64 %57, %46
br i1 %58, label %65, label %53
59: ; preds = %51, %59
%60 = phi i64 [ 0, %51 ], [ %63, %59 ]
%61 = getelementptr inbounds double, double* %30, i64 %60
%62 = tail call i32 @fscanf(i32* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %61)
%63 = add nuw nsw i64 %60, 1
%64 = icmp eq i64 %63, %52
br i1 %64, label %65, label %59
65: ; preds = %53, %59, %42, %47
%66 = tail call i32 @fclose(i32* %41)
%67 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.7, i64 0, i64 0))
%68 = getelementptr inbounds i8*, i8** %1, i64 2
%69 = load i8*, i8** %68
%70 = tail call i32* @fopen(i8* %69, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br i1 %21, label %76, label %71
71: ; preds = %65
%72 = mul i32 %17, %17
%73 = icmp eq i32 %72, 0
br i1 %73, label %94, label %74
74: ; preds = %71
%75 = zext i32 %72 to i64
br label %82
76: ; preds = %65
%77 = shl nsw i32 %16, 2
%78 = mul i32 %77, %17
%79 = icmp sgt i32 %78, 0
br i1 %79, label %80, label %94
80: ; preds = %76
%81 = zext i32 %78 to i64
br label %88
82: ; preds = %74, %82
%83 = phi i64 [ 0, %74 ], [ %86, %82 ]
%84 = getelementptr inbounds double, double* %29, i64 %83
%85 = tail call i32 @fscanf(i32* %70, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %84)
%86 = add nuw nsw i64 %83, 1
%87 = icmp eq i64 %86, %75
br i1 %87, label %94, label %82
88: ; preds = %80, %88
%89 = phi i64 [ 0, %80 ], [ %92, %88 ]
%90 = getelementptr inbounds double, double* %29, i64 %89
%91 = tail call i32 @fscanf(i32* %70, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %90)
%92 = add nuw nsw i64 %89, 1
%93 = icmp eq i64 %92, %81
br i1 %93, label %94, label %88
94: ; preds = %82, %88, %71, %76
%95 = tail call i32 @fclose(i32* %70)
%96 = call i32 @softSymCor2(i32 %16, double* %30, double* %29, double* %3, double* %4, double* %5, i32 %20)
%97 = load double, double* %3
%98 = load double, double* %4
%99 = load double, double* %5
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), double %97, double %98, double %99)
%101 = call i32 @free(double* %29)
%102 = call i32 @free(double* %30)
ret i32 0
}