#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*/ CosEvalPts(int, double *);
int /*<<< orphan*/ CosEvalPts2(int, double *);
int /*<<< orphan*/ SinEvalPts(int, double *);
int /*<<< orphan*/ SinEvalPts2(int, double *);
int atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, double *);
int /*<<< orphan*/ genWig_L2(int, int, int, double *, double *, double *,
                             double *, double *, double *);
int /*<<< orphan*/ makeweights2(int, double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ wigNaiveAnalysis(int, int, int, double *, double *, double *,
                                    double *, double *);
int main(int argc, char **argv) {
  int i, m1, m2, bw, n;
  int m;
  double *signal, *result, *wigners;
  double *workspace, *scratch;
  double *weights;
  double *sinPts, *cosPts;
  double *sinPts2, *cosPts2;
  FILE *fp;
  if (argc < 6) {
    fprintf(stdout,
            "Usage: test_Wigner_Analysis m1 m2 bw input_file output_file\n");
    exit(0);
  }
  m1 = atoi(argv[1]);
  m2 = atoi(argv[2]);
  bw = atoi(argv[3]);
  m = ((((m1) > 0 ? (m1) : (-m1))) > (((m2) > 0 ? (m2) : (-m2)))
           ? (((m1) > 0 ? (m1) : (-m1)))
           : (((m2) > 0 ? (m2) : (-m2))));
  n = 2 * bw;
  weights = (double *)malloc(sizeof(double) * n);
  signal = (double *)malloc(sizeof(double) * n);
  result = (double *)malloc(sizeof(double) * (bw - m));
  wigners = (double *)malloc(sizeof(double) * (bw - m) * n);
  workspace = (double *)malloc(sizeof(double) * (4 + 6) * n);
  sinPts = workspace;
  cosPts = sinPts + n;
  sinPts2 = cosPts + n;
  cosPts2 = sinPts2 + n;
  scratch = cosPts2 + n;
  fp = fopen(argv[4], "r");
  for (i = 0; i < n; i++)
    fscanf(fp, "%lf", signal + i);
  fclose(fp);
  SinEvalPts(n, sinPts);
  CosEvalPts(n, cosPts);
  SinEvalPts2(n, sinPts2);
  CosEvalPts2(n, cosPts2);
  makeweights2(bw, weights);
  genWig_L2(m1, m2, bw, sinPts, cosPts, sinPts2, cosPts2, wigners, scratch);
  wigNaiveAnalysis(m1, m2, bw, signal, wigners, weights, result, scratch);
  fp = fopen(argv[5], "w");
  for (i = 0; i < (bw - m); i++)
    fprintf(fp, "%.15f\n", result[i]);
  fclose(fp);
  free(workspace);
  free(wigners);
  free(result);
  free(signal);
  free(weights);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    1232 <main+0x42>
mov    0x2dc6(%rip),%rax
movslq (%rax),%rdi
lea    0xddc(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
xor    %edi,%edi
call   1110 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    127a <main+0x8a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x84(%rbp)
jmp    1285 <main+0x95>
xor    %eax,%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    %eax,-0x88(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    12a9 <main+0xb9>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
jmp    12b4 <main+0xc4>
xor    %eax,%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x88(%rbp),%eax
mov    -0x8c(%rbp),%ecx
cmp    %ecx,%eax
jle    12fc <main+0x10c>
cmpl   $0x0,-0x18(%rbp)
jle    12e0 <main+0xf0>
mov    -0x18(%rbp),%eax
mov    %eax,-0x90(%rbp)
jmp    12eb <main+0xfb>
xor    %eax,%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x90(%rbp)
mov    -0x90(%rbp),%eax
mov    %eax,-0x94(%rbp)
jmp    132b <main+0x13b>
cmpl   $0x0,-0x1c(%rbp)
jle    1314 <main+0x124>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x98(%rbp)
jmp    131f <main+0x12f>
xor    %eax,%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x98(%rbp)
mov    -0x98(%rbp),%eax
mov    %eax,-0x94(%rbp)
mov    -0x94(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x24(%rbp)
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x58(%rbp)
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x28(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x28(%rbp),%eax
cltq
shl    $0x3,%rax
movslq -0x24(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x40(%rbp)
movslq -0x24(%rbp),%rax
imul   $0x50,%rax,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
movslq -0x24(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
movslq -0x24(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
movslq -0x24(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
movslq -0x24(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xc2e(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x80(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1458 <main+0x268>
mov    -0x80(%rbp),%rdi
mov    -0x30(%rbp),%rdx
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xbfa(%rip),%rsi
call   1080 <fscanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    141f <main+0x22f>
mov    -0x80(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x24(%rbp),%edi
mov    -0x60(%rbp),%rsi
call   10b0 <SinEvalPts@plt>
mov    -0x24(%rbp),%edi
mov    -0x68(%rbp),%rsi
call   10e0 <CosEvalPts@plt>
mov    -0x24(%rbp),%edi
mov    -0x70(%rbp),%rsi
call   1070 <SinEvalPts2@plt>
mov    -0x24(%rbp),%edi
mov    -0x78(%rbp),%rsi
call   1050 <CosEvalPts2@plt>
mov    -0x20(%rbp),%edi
mov    -0x58(%rbp),%rsi
call   10a0 <makeweights2@plt>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x60(%rbp),%rcx
mov    -0x68(%rbp),%r8
mov    -0x70(%rbp),%r9
mov    -0x78(%rbp),%r11
mov    -0x40(%rbp),%r10
mov    -0x50(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <genWig_L2@plt>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    -0x38(%rbp),%r10
mov    -0x50(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10d0 <wigNaiveAnalysis@plt>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
lea    0xb38(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x80(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    -0x28(%rbp),%ecx
cmp    %ecx,%eax
jge    1559 <main+0x369>
mov    -0x80(%rbp),%rdi
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xb01(%rip),%rsi
mov    $0x1,%al
call   1090 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    151b <main+0x32b>
mov    -0x80(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
cmp    $0x5,%edi
jle    1495 <main+0x295>
mov    0x8(%rsi),%rdi
mov    %rsi,%rbp
mov    %rsi,0x38(%rsp)
call   1100 <atoi@plt>
mov    %eax,%r14d
mov    0x10(%rbp),%rdi
call   1100 <atoi@plt>
mov    %eax,%ebx
mov    0x18(%rbp),%rdi
call   1100 <atoi@plt>
mov    %r14d,%ecx
neg    %ecx
mov    %r14d,0x1c(%rsp)
cmovs  %r14d,%ecx
mov    %ebx,%ebp
neg    %ebp
mov    %ebx,0x4(%rsp)
cmovs  %ebx,%ebp
cmp    %ebp,%ecx
cmova  %ecx,%ebp
mov    %eax,%r15d
lea    (%r15,%r15,1),%r13d
movslq %r13d,%r14
mov    %eax,%ebx
shl    $0x4,%ebx
mov    %ebx,%edi
call   10c0 <malloc@plt>
mov    %rax,0x40(%rsp)
mov    %ebx,%edi
call   10c0 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %r15d,%eax
sub    %ebp,%eax
mov    %rax,0x60(%rsp)
lea    0x0(,%rax,8),%ebx
mov    %ebx,%edi
call   10c0 <malloc@plt>
mov    %rax,%r12
imul   %r13d,%ebx
mov    %ebx,%edi
call   10c0 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %r15d,%eax
shl    $0x5,%eax
lea    (%rax,%rax,4),%edi
call   10c0 <malloc@plt>
mov    %rax,0x10(%rsp)
lea    (%rax,%r14,8),%rax
mov    %rax,0x20(%rsp)
lea    (%rax,%r14,8),%rax
mov    %rax,0x48(%rsp)
lea    (%rax,%r14,8),%rax
mov    %rax,0x28(%rsp)
lea    (%rax,%r14,8),%rax
mov    %rax,0x50(%rsp)
mov    0x38(%rsp),%rax
mov    0x20(%rax),%rdi
lea    0xd47(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,%r14
mov    %r15,0x58(%rsp)
test   %r15d,%r15d
jle    1348 <main+0x148>
cmp    $0x2,%r13d
mov    $0x1,%ebp
cmovge %r13d,%ebp
lea    0xd23(%rip),%r15
mov    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1080 <fscanf@plt>
add    $0x8,%rbx
add    $0xffffffffffffffff,%rbp
jne    1330 <main+0x130>
mov    %r14,%rdi
call   1060 <fclose@plt>
mov    %r13d,%edi
mov    0x10(%rsp),%rsi
call   10b0 <SinEvalPts@plt>
mov    %r13d,%edi
mov    0x20(%rsp),%rsi
call   10e0 <CosEvalPts@plt>
mov    %r13d,%edi
mov    0x48(%rsp),%rbp
mov    %rbp,%rsi
call   1070 <SinEvalPts2@plt>
mov    %r13d,%edi
mov    0x28(%rsp),%rsi
call   1050 <CosEvalPts2@plt>
mov    0x58(%rsp),%rbx
mov    %ebx,%edi
mov    0x40(%rsp),%r14
mov    %r14,%rsi
call   10a0 <makeweights2@plt>
sub    $0x8,%rsp
mov    0x24(%rsp),%r15d
mov    %r15d,%edi
mov    0xc(%rsp),%esi
mov    %ebx,%edx
mov    0x18(%rsp),%rcx
mov    0x28(%rsp),%r8
mov    %rbp,%r9
mov    0x58(%rsp),%r13
push   %r13
mov    0x40(%rsp),%rbp
push   %rbp
push   0x40(%rsp)
call   1040 <genWig_L2@plt>
add    $0x20,%rsp
mov    %r15d,%edi
mov    0x4(%rsp),%esi
mov    %ebx,%edx
mov    0x8(%rsp),%rcx
mov    %rbp,%r8
mov    %r14,%r9
push   %r13
push   %r12
call   10d0 <wigNaiveAnalysis@plt>
add    $0x10,%rsp
mov    0x38(%rsp),%rax
mov    0x28(%rax),%rdi
lea    0xc3e(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,%r15
mov    0x60(%rsp),%rax
test   %eax,%eax
jle    144c <main+0x24c>
mov    %eax,%ebx
xor    %ebp,%ebp
lea    0xc24(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%rbp,8),%xmm0
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1090 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1430 <main+0x230>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x40(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b44(%rip),%rax
movslq (%rax),%rcx
lea    0xb5a(%rip),%rdi
mov    $0x3c,%esi
mov    $0x1,%edx
call   1120 <fwrite@plt>
xor    %edi,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [61 x i8] c"Usage: test_Wigner_Analysis m1 m2 bw input_file output_file\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [7 x i8] c"%.15f\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 i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 6
br i1 %24, label %25, label %31
25: ; preds = %2
%26 = load i32, i32* @stdout
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i32*
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%30 = call i32 @exit(i32 0)
unreachable
31: ; preds = %2
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %7
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 2
%38 = load i8*, i8** %37
%39 = call i32 @atoi(i8* %38)
store i32 %39, i32* %8
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 3
%42 = load i8*, i8** %41
%43 = call i32 @atoi(i8* %42)
store i32 %43, i32* %9
%44 = load i32, i32* %7
%45 = icmp sgt i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %31
%47 = load i32, i32* %7
br label %51
48: ; preds = %31
%49 = load i32, i32* %7
%50 = sub nsw i32 0, %49
br label %51
51: ; preds = %48, %46
%52 = phi i32 [ %47, %46 ], [ %50, %48 ]
%53 = load i32, i32* %8
%54 = icmp sgt i32 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = load i32, i32* %8
br label %60
57: ; preds = %51
%58 = load i32, i32* %8
%59 = sub nsw i32 0, %58
br label %60
60: ; preds = %57, %55
%61 = phi i32 [ %56, %55 ], [ %59, %57 ]
%62 = icmp sgt i32 %52, %61
br i1 %62, label %63, label %73
63: ; preds = %60
%64 = load i32, i32* %7
%65 = icmp sgt i32 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %63
%67 = load i32, i32* %7
br label %71
68: ; preds = %63
%69 = load i32, i32* %7
%70 = sub nsw i32 0, %69
br label %71
71: ; preds = %68, %66
%72 = phi i32 [ %67, %66 ], [ %70, %68 ]
br label %83
73: ; preds = %60
%74 = load i32, i32* %8
%75 = icmp sgt i32 %74, 0
br i1 %75, label %76, label %78
76: ; preds = %73
%77 = load i32, i32* %8
br label %81
78: ; preds = %73
%79 = load i32, i32* %8
%80 = sub nsw i32 0, %79
br label %81
81: ; preds = %78, %76
%82 = phi i32 [ %77, %76 ], [ %80, %78 ]
br label %83
83: ; preds = %81, %71
%84 = phi i32 [ %72, %71 ], [ %82, %81 ]
store i32 %84, i32* %11
%85 = load i32, i32* %9
%86 = mul nsw i32 2, %85
store i32 %86, i32* %10
%87 = load i32, i32* %10
%88 = sext i32 %87 to i64
%89 = mul i64 8, %88
%90 = trunc i64 %89 to i32
%91 = call i64 @malloc(i32 %90)
%92 = inttoptr i64 %91 to double*
store double* %92, double** %17
%93 = load i32, i32* %10
%94 = sext i32 %93 to i64
%95 = mul i64 8, %94
%96 = trunc i64 %95 to i32
%97 = call i64 @malloc(i32 %96)
%98 = inttoptr i64 %97 to double*
store double* %98, double** %12
%99 = load i32, i32* %9
%100 = load i32, i32* %11
%101 = sub nsw i32 %99, %100
%102 = sext i32 %101 to i64
%103 = mul i64 8, %102
%104 = trunc i64 %103 to i32
%105 = call i64 @malloc(i32 %104)
%106 = inttoptr i64 %105 to double*
store double* %106, double** %13
%107 = load i32, i32* %9
%108 = load i32, i32* %11
%109 = sub nsw i32 %107, %108
%110 = sext i32 %109 to i64
%111 = mul i64 8, %110
%112 = load i32, i32* %10
%113 = sext i32 %112 to i64
%114 = mul i64 %111, %113
%115 = trunc i64 %114 to i32
%116 = call i64 @malloc(i32 %115)
%117 = inttoptr i64 %116 to double*
store double* %117, double** %14
%118 = load i32, i32* %10
%119 = sext i32 %118 to i64
%120 = mul i64 80, %119
%121 = trunc i64 %120 to i32
%122 = call i64 @malloc(i32 %121)
%123 = inttoptr i64 %122 to double*
store double* %123, double** %15
%124 = load double*, double** %15
store double* %124, double** %18
%125 = load double*, double** %18
%126 = load i32, i32* %10
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %125, i64 %127
store double* %128, double** %19
%129 = load double*, double** %19
%130 = load i32, i32* %10
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds double, double* %129, i64 %131
store double* %132, double** %20
%133 = load double*, double** %20
%134 = load i32, i32* %10
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %133, i64 %135
store double* %136, double** %21
%137 = load double*, double** %21
%138 = load i32, i32* %10
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double, double* %137, i64 %139
store double* %140, double** %16
%141 = load i8**, i8*** %5
%142 = getelementptr inbounds i8*, i8** %141, i64 4
%143 = load i8*, i8** %142
%144 = call i32* @fopen(i8* %143, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %144, i32** %22
store i32 0, i32* %6
br label %145
145: ; preds = %156, %83
%146 = load i32, i32* %6
%147 = load i32, i32* %10
%148 = icmp slt i32 %146, %147
br i1 %148, label %149, label %159
149: ; preds = %145
%150 = load i32*, i32** %22
%151 = load double*, double** %12
%152 = load i32, i32* %6
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double, double* %151, i64 %153
%155 = call i32 @fscanf(i32* %150, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %154)
br label %156
156: ; preds = %149
%157 = load i32, i32* %6
%158 = add nsw i32 %157, 1
store i32 %158, i32* %6
br label %145
159: ; preds = %145
%160 = load i32*, i32** %22
%161 = call i32 @fclose(i32* %160)
%162 = load i32, i32* %10
%163 = load double*, double** %18
%164 = call i32 @SinEvalPts(i32 %162, double* %163)
%165 = load i32, i32* %10
%166 = load double*, double** %19
%167 = call i32 @CosEvalPts(i32 %165, double* %166)
%168 = load i32, i32* %10
%169 = load double*, double** %20
%170 = call i32 @SinEvalPts2(i32 %168, double* %169)
%171 = load i32, i32* %10
%172 = load double*, double** %21
%173 = call i32 @CosEvalPts2(i32 %171, double* %172)
%174 = load i32, i32* %9
%175 = load double*, double** %17
%176 = call i32 @makeweights2(i32 %174, double* %175)
%177 = load i32, i32* %7
%178 = load i32, i32* %8
%179 = load i32, i32* %9
%180 = load double*, double** %18
%181 = load double*, double** %19
%182 = load double*, double** %20
%183 = load double*, double** %21
%184 = load double*, double** %14
%185 = load double*, double** %16
%186 = call i32 @genWig_L2(i32 %177, i32 %178, i32 %179, double* %180, double* %181, double* %182, double* %183, double* %184, double* %185)
%187 = load i32, i32* %7
%188 = load i32, i32* %8
%189 = load i32, i32* %9
%190 = load double*, double** %12
%191 = load double*, double** %14
%192 = load double*, double** %17
%193 = load double*, double** %13
%194 = load double*, double** %16
%195 = call i32 @wigNaiveAnalysis(i32 %187, i32 %188, i32 %189, double* %190, double* %191, double* %192, double* %193, double* %194)
%196 = load i8**, i8*** %5
%197 = getelementptr inbounds i8*, i8** %196, i64 5
%198 = load i8*, i8** %197
%199 = call i32* @fopen(i8* %198, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %199, i32** %22
store i32 0, i32* %6
br label %200
200: ; preds = %214, %159
%201 = load i32, i32* %6
%202 = load i32, i32* %9
%203 = load i32, i32* %11
%204 = sub nsw i32 %202, %203
%205 = icmp slt i32 %201, %204
br i1 %205, label %206, label %217
206: ; preds = %200
%207 = load i32*, i32** %22
%208 = load double*, double** %13
%209 = load i32, i32* %6
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds double, double* %208, i64 %210
%212 = load double, double* %211
%213 = call i32 (i32*, i8*, ...) @fprintf(i32* %207, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %212)
br label %214
214: ; preds = %206
%215 = load i32, i32* %6
%216 = add nsw i32 %215, 1
store i32 %216, i32* %6
br label %200
217: ; preds = %200
%218 = load i32*, i32** %22
%219 = call i32 @fclose(i32* %218)
%220 = load double*, double** %15
%221 = call i32 @free(double* %220)
%222 = load double*, double** %14
%223 = call i32 @free(double* %222)
%224 = load double*, double** %13
%225 = call i32 @free(double* %224)
%226 = load double*, double** %12
%227 = call i32 @free(double* %226)
%228 = load double*, double** %17
%229 = call i32 @free(double* %228)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [61 x i8] c"Usage: test_Wigner_Analysis m1 m2 bw input_file output_file\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [7 x i8] c"%.15f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 6
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @stdout
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i64 60, i64 1, i32* %7)
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
%17 = getelementptr inbounds i8*, i8** %1, i64 3
%18 = load i8*, i8** %17
%19 = tail call i32 @atoi(i8* %18)
%20 = tail call i32 @llvm.abs.i32(i32 %13, i1 true)
%21 = tail call i32 @llvm.abs.i32(i32 %16, i1 true)
%22 = icmp ugt i32 %20, %21
%23 = select i1 %22, i32 %20, i32 %21
%24 = shl i32 %19, 1
%25 = sext i32 %24 to i64
%26 = shl i32 %19, 4
%27 = tail call i64 @malloc(i32 %26)
%28 = inttoptr i64 %27 to double*
%29 = tail call i64 @malloc(i32 %26)
%30 = inttoptr i64 %29 to double*
%31 = sub nsw i32 %19, %23
%32 = shl i32 %31, 3
%33 = tail call i64 @malloc(i32 %32)
%34 = inttoptr i64 %33 to double*
%35 = mul i32 %32, %24
%36 = tail call i64 @malloc(i32 %35)
%37 = inttoptr i64 %36 to double*
%38 = mul i32 %19, 160
%39 = tail call i64 @malloc(i32 %38)
%40 = inttoptr i64 %39 to double*
%41 = getelementptr inbounds double, double* %40, i64 %25
%42 = getelementptr inbounds double, double* %41, i64 %25
%43 = getelementptr inbounds double, double* %42, i64 %25
%44 = getelementptr inbounds double, double* %43, i64 %25
%45 = getelementptr inbounds i8*, i8** %1, i64 4
%46 = load i8*, i8** %45
%47 = tail call i32* @fopen(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%48 = icmp sgt i32 %19, 0
br i1 %48, label %49, label %58
49: ; preds = %10
%50 = call i32 @llvm.smax.i32(i32 %24, i32 1)
%51 = zext i32 %50 to i64
br label %52
52: ; preds = %49, %52
%53 = phi i64 [ 0, %49 ], [ %56, %52 ]
%54 = getelementptr inbounds double, double* %30, i64 %53
%55 = tail call i32 @fscanf(i32* %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %54)
%56 = add nuw nsw i64 %53, 1
%57 = icmp eq i64 %56, %51
br i1 %57, label %58, label %52
58: ; preds = %52, %10
%59 = tail call i32 @fclose(i32* %47)
%60 = tail call i32 @SinEvalPts(i32 %24, double* %40)
%61 = tail call i32 @CosEvalPts(i32 %24, double* %41)
%62 = tail call i32 @SinEvalPts2(i32 %24, double* %42)
%63 = tail call i32 @CosEvalPts2(i32 %24, double* %43)
%64 = tail call i32 @makeweights2(i32 %19, double* %28)
%65 = tail call i32 @genWig_L2(i32 %13, i32 %16, i32 %19, double* %40, double* %41, double* %42, double* %43, double* %37, double* %44)
%66 = tail call i32 @wigNaiveAnalysis(i32 %13, i32 %16, i32 %19, double* %30, double* %37, double* %28, double* %34, double* %44)
%67 = getelementptr inbounds i8*, i8** %1, i64 5
%68 = load i8*, i8** %67
%69 = tail call i32* @fopen(i8* %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%70 = icmp sgt i32 %31, 0
br i1 %70, label %71, label %80
71: ; preds = %58
%72 = zext i32 %31 to i64
br label %73
73: ; preds = %71, %73
%74 = phi i64 [ 0, %71 ], [ %78, %73 ]
%75 = getelementptr inbounds double, double* %34, i64 %74
%76 = load double, double* %75
%77 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %76)
%78 = add nuw nsw i64 %74, 1
%79 = icmp eq i64 %78, %72
br i1 %79, label %80, label %73
80: ; preds = %73, %58
%81 = tail call i32 @fclose(i32* %69)
%82 = tail call i32 @free(double* %40)
%83 = tail call i32 @free(double* %37)
%84 = tail call i32 @free(double* %34)
%85 = tail call i32 @free(double* %30)
%86 = tail call i32 @free(double* %28)
ret i32 0
}