#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*/ genWigTrans_L2(int, int, int, double *, double *, double *,
                                  double *, double *, double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ wigNaiveSynthesis(int, int, int, double *, double *,
                                     double *, double *);
int main(int argc, char **argv) {
  int i, m1, m2, bw, n;
  int m;
  double *coeffs, *result, *wignersTrans;
  double *workspace, *scratch;
  double *sinPts, *cosPts;
  double *sinPts2, *cosPts2;
  FILE *fp;
  if (argc < 6) {
    fprintf(stdout,
            "Usage: test_Wigner_Synthesis 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;
  coeffs = (double *)malloc(sizeof(double) * (bw - m));
  result = (double *)malloc(sizeof(double) * n);
  wignersTrans = (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 < (bw - m); i++)
    fscanf(fp, "%lf", coeffs + i);
  fclose(fp);
  SinEvalPts(n, sinPts);
  CosEvalPts(n, cosPts);
  SinEvalPts2(n, sinPts2);
  CosEvalPts2(n, cosPts2);
  genWigTrans_L2(m1, m2, bw, sinPts, cosPts, sinPts2, cosPts2, wignersTrans,
                 scratch);
  wigNaiveSynthesis(m1, m2, bw, coeffs, wignersTrans, result, scratch);
  fp = fopen(argv[5], "w");
  for (i = 0; i < n; i++)
    fprintf(fp, "%.15f\n", result[i]);
  fclose(fp);
  free(workspace);
  free(wignersTrans);
  free(result);
  free(coeffs);
  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    1222 <main+0x42>
mov    0x2dd6(%rip),%rax
movslq (%rax),%rdi
lea    0xdec(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1267 <main+0x87>
mov    -0x18(%rbp),%eax
mov    %eax,-0x7c(%rbp)
jmp    126f <main+0x8f>
xor    %eax,%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
mov    %eax,-0x80(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    128d <main+0xad>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x84(%rbp)
jmp    1298 <main+0xb8>
xor    %eax,%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x80(%rbp),%eax
mov    -0x84(%rbp),%ecx
cmp    %ecx,%eax
jle    12dd <main+0xfd>
cmpl   $0x0,-0x18(%rbp)
jle    12c1 <main+0xe1>
mov    -0x18(%rbp),%eax
mov    %eax,-0x88(%rbp)
jmp    12cc <main+0xec>
xor    %eax,%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    %eax,-0x8c(%rbp)
jmp    130c <main+0x12c>
cmpl   $0x0,-0x1c(%rbp)
jle    12f5 <main+0x115>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x90(%rbp)
jmp    1300 <main+0x120>
xor    %eax,%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x90(%rbp)
mov    -0x90(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x28(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x30(%rbp)
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   10b0 <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   10b0 <malloc@plt>
mov    %rax,-0x40(%rbp)
movslq -0x24(%rbp),%rax
imul   $0x50,%rax,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x24(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%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,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xc61(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x78(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    -0x28(%rbp),%ecx
cmp    %ecx,%eax
jge    142b <main+0x24b>
mov    -0x78(%rbp),%rdi
mov    -0x30(%rbp),%rdx
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xc28(%rip),%rsi
call   1080 <fscanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13ed <main+0x20d>
mov    -0x78(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x24(%rbp),%edi
mov    -0x58(%rbp),%rsi
call   10a0 <SinEvalPts@plt>
mov    -0x24(%rbp),%edi
mov    -0x60(%rbp),%rsi
call   10d0 <CosEvalPts@plt>
mov    -0x24(%rbp),%edi
mov    -0x68(%rbp),%rsi
call   1070 <SinEvalPts2@plt>
mov    -0x24(%rbp),%edi
mov    -0x70(%rbp),%rsi
call   1050 <CosEvalPts2@plt>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x58(%rbp),%rcx
mov    -0x60(%rbp),%r8
mov    -0x68(%rbp),%r9
mov    -0x70(%rbp),%r11
mov    -0x40(%rbp),%r10
mov    -0x50(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   10c0 <genWigTrans_L2@plt>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    -0x50(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <wigNaiveSynthesis@plt>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
lea    0xb7b(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x78(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1512 <main+0x332>
mov    -0x78(%rbp),%rdi
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xb49(%rip),%rsi
mov    $0x1,%al
call   1090 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    14d9 <main+0x2f9>
mov    -0x78(%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>
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    $0x58,%rsp
cmp    $0x5,%edi
jle    144c <main+0x25c>
mov    0x8(%rsi),%rdi
mov    %rsi,%rbx
mov    %rsi,0x38(%rsp)
call   10f0 <atoi@plt>
mov    %eax,%r14d
mov    0x10(%rbx),%rdi
call   10f0 <atoi@plt>
mov    %eax,%ebp
mov    0x18(%rbx),%rdi
call   10f0 <atoi@plt>
mov    %r14d,%ecx
neg    %ecx
mov    %r14d,0x24(%rsp)
cmovs  %r14d,%ecx
mov    %ebp,%edx
neg    %edx
mov    %ebp,0x20(%rsp)
cmovs  %ebp,%edx
cmp    %edx,%ecx
cmova  %ecx,%edx
mov    %eax,%r15d
lea    (%r15,%r15,1),%r12d
mov    %eax,%r14d
sub    %edx,%r14d
lea    0x0(,%r14,8),%ebx
mov    %ebx,%edi
call   10b0 <malloc@plt>
mov    %rax,0x10(%rsp)
movslq %r12d,%rbp
mov    %r15d,%edi
shl    $0x4,%edi
call   10b0 <malloc@plt>
mov    %rax,%r13
mov    %r12d,0xc(%rsp)
imul   %r12d,%ebx
mov    %ebx,%edi
call   10b0 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %r15,0x28(%rsp)
mov    %r15d,%eax
shl    $0x5,%eax
lea    (%rax,%rax,4),%edi
call   10b0 <malloc@plt>
mov    %rax,0x18(%rsp)
lea    (%rax,%rbp,8),%rax
mov    %rax,%r12
lea    (%rax,%rbp,8),%rax
mov    %rax,0x40(%rsp)
lea    (%rax,%rbp,8),%rax
mov    %rax,0x48(%rsp)
lea    (%rax,%rbp,8),%rax
mov    %rax,0x50(%rsp)
mov    0x38(%rsp),%rax
mov    0x20(%rax),%rdi
lea    0xd60(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,%rbp
test   %r14d,%r14d
jle    1318 <main+0x128>
mov    %r14d,%r14d
shl    $0x3,%r14
lea    0xd47(%rip),%r15
mov    0x10(%rsp),%rbx
xchg   %ax,%ax
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1080 <fscanf@plt>
add    $0x8,%rbx
add    $0xfffffffffffffff8,%r14
jne    1300 <main+0x110>
mov    %rbp,%rdi
call   1060 <fclose@plt>
mov    0xc(%rsp),%ebp
mov    %ebp,%edi
mov    0x18(%rsp),%rsi
call   10a0 <SinEvalPts@plt>
mov    %ebp,%edi
mov    %r12,%rsi
call   10d0 <CosEvalPts@plt>
mov    %ebp,%edi
mov    0x40(%rsp),%rbx
mov    %rbx,%rsi
call   1070 <SinEvalPts2@plt>
mov    %ebp,%edi
mov    0x48(%rsp),%r14
mov    %r14,%rsi
call   1050 <CosEvalPts2@plt>
sub    $0x8,%rsp
mov    0x2c(%rsp),%ebp
mov    %ebp,%edi
mov    0x28(%rsp),%r15d
mov    %r15d,%esi
mov    0x30(%rsp),%rdx
mov    0x20(%rsp),%rcx
mov    %r12,%r8
mov    %rbx,%r9
mov    0x58(%rsp),%r12
push   %r12
mov    0x40(%rsp),%rbx
push   %rbx
push   %r14
call   10c0 <genWigTrans_L2@plt>
add    $0x18,%rsp
mov    %ebp,%edi
mov    %r15d,%esi
mov    0x30(%rsp),%rbp
mov    %ebp,%edx
mov    0x18(%rsp),%rcx
mov    %rbx,%r8
mov    %r13,%r9
push   %r12
call   1040 <wigNaiveSynthesis@plt>
add    $0x10,%rsp
mov    0x38(%rsp),%rax
mov    0x28(%rax),%rdi
lea    0xc80(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,%r15
test   %ebp,%ebp
jle    140d <main+0x21d>
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
mov    $0x1,%ebx
cmovge %eax,%ebx
xor    %ebp,%ebp
lea    0xc5e(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  0x0(%r13,%rbp,8),%xmm0
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1090 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    13f0 <main+0x200>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b8d(%rip),%rax
movslq (%rax),%rcx
lea    0xba3(%rip),%rdi
mov    $0x3d,%esi
mov    $0x1,%edx
call   1110 <fwrite@plt>
xor    %edi,%edi
call   1100 <exit@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [62 x i8] c"Usage: test_Wigner_Synthesis 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 ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i64 61, 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 = sub nsw i32 %19, %23
%26 = shl i32 %25, 3
%27 = tail call i64 @malloc(i32 %26)
%28 = inttoptr i64 %27 to double*
%29 = sext i32 %24 to i64
%30 = shl i32 %19, 4
%31 = tail call i64 @malloc(i32 %30)
%32 = inttoptr i64 %31 to double*
%33 = mul i32 %26, %24
%34 = tail call i64 @malloc(i32 %33)
%35 = inttoptr i64 %34 to double*
%36 = mul i32 %19, 160
%37 = tail call i64 @malloc(i32 %36)
%38 = inttoptr i64 %37 to double*
%39 = getelementptr inbounds double, double* %38, i64 %29
%40 = getelementptr inbounds double, double* %39, i64 %29
%41 = getelementptr inbounds double, double* %40, i64 %29
%42 = getelementptr inbounds double, double* %41, i64 %29
%43 = getelementptr inbounds i8*, i8** %1, i64 4
%44 = load i8*, i8** %43
%45 = tail call i32* @fopen(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%46 = icmp sgt i32 %25, 0
br i1 %46, label %47, label %55
47: ; preds = %10
%48 = zext i32 %25 to i64
br label %49
49: ; preds = %47, %49
%50 = phi i64 [ 0, %47 ], [ %53, %49 ]
%51 = getelementptr inbounds double, double* %28, i64 %50
%52 = tail call i32 @fscanf(i32* %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %51)
%53 = add nuw nsw i64 %50, 1
%54 = icmp eq i64 %53, %48
br i1 %54, label %55, label %49
55: ; preds = %49, %10
%56 = tail call i32 @fclose(i32* %45)
%57 = tail call i32 @SinEvalPts(i32 %24, double* %38)
%58 = tail call i32 @CosEvalPts(i32 %24, double* %39)
%59 = tail call i32 @SinEvalPts2(i32 %24, double* %40)
%60 = tail call i32 @CosEvalPts2(i32 %24, double* %41)
%61 = tail call i32 @genWigTrans_L2(i32 %13, i32 %16, i32 %19, double* %38, double* %39, double* %40, double* %41, double* %35, double* %42)
%62 = tail call i32 @wigNaiveSynthesis(i32 %13, i32 %16, i32 %19, double* %28, double* %35, double* %32, double* %42)
%63 = getelementptr inbounds i8*, i8** %1, i64 5
%64 = load i8*, i8** %63
%65 = tail call i32* @fopen(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%66 = icmp sgt i32 %19, 0
br i1 %66, label %67, label %77
67: ; preds = %55
%68 = call i32 @llvm.smax.i32(i32 %24, i32 1)
%69 = zext i32 %68 to i64
br label %70
70: ; preds = %67, %70
%71 = phi i64 [ 0, %67 ], [ %75, %70 ]
%72 = getelementptr inbounds double, double* %32, i64 %71
%73 = load double, double* %72
%74 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %73)
%75 = add nuw nsw i64 %71, 1
%76 = icmp eq i64 %75, %69
br i1 %76, label %77, label %70
77: ; preds = %70, %55
%78 = tail call i32 @fclose(i32* %65)
%79 = tail call i32 @free(double* %38)
%80 = tail call i32 @free(double* %35)
%81 = tail call i32 @free(double* %32)
%82 = tail call i32 @free(double* %28)
ret i32 0
}