#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 */
double atof(char *);
int atoi(char *);
double cos(double);
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*/ genWig_L2_U(int, int, int, int, double *, double *, double *,
                               double *, double *, double *);
scalar_t__ malloc(int);
double sin(double);
int sqrt(double);
int /*<<< orphan*/ *stdout;
int main(int argc, char **argv) {
  int i, j;
  int m1, m2, bw;
  int flag, n, m;
  double *workspace, *scratch;
  double *sinPts, *cosPts, *result;
  double *sinPts2, *cosPts2;
  FILE *fp;
  double *ang, fudge;
  if (argc < 7) {
    fprintf(stdout, "Usage: test_Wigner_angle m1 m2 bw flag output_file_name "
                    "a0 [ a1 ... aN ]\n");
    exit(0);
  }
  m1 = atoi(argv[1]);
  m2 = atoi(argv[2]);
  bw = atoi(argv[3]);
  flag = atoi(argv[4]);
  m = ((((m1) > 0 ? (m1) : (-m1))) > (((m2) > 0 ? (m2) : (-m2)))
           ? (((m1) > 0 ? (m1) : (-m1)))
           : (((m2) > 0 ? (m2) : (-m2))));
  n = argc - 6;
  ang = (double *)malloc(sizeof(double) * n);
  result = (double *)malloc(sizeof(double) * n * (bw - m));
  workspace = (double *)malloc(sizeof(double) * (4 + 6) * n);
  sinPts = workspace;
  cosPts = sinPts + n;
  sinPts2 = cosPts + n;
  cosPts2 = sinPts2 + n;
  scratch = cosPts2 + n;
  for (i = 0; i < n; i++)
    ang[i] = atof(argv[6 + i]);
  for (i = 0; i < n; i++) {
    sinPts[i] = sin(ang[i]);
    cosPts[i] = cos(ang[i]);
    sinPts2[i] = sin(0.5 * ang[i]);
    cosPts2[i] = cos(0.5 * ang[i]);
  }
  genWig_L2_U(m1, m2, bw, n, sinPts, cosPts, sinPts2, cosPts2, result, scratch);
  fp = fopen(argv[5], "w");
  for (i = 0; i < (bw - m); i++) {
    fudge = 1 / sqrt((double)(2 * (m + i) + 1) / 2.0);
    for (j = 0; j < n; j++) {
      if (result[i * n + j] < 0) {
        if (flag)
          fprintf(fp, "%.15f  ", result[i * n + j]);
        else
          fprintf(fp, "%.15f  ", result[i * n + j] * fudge);
      } else {
        if (flag)
          fprintf(fp, " %.15f  ", result[i * n + j]);
        else
          fprintf(fp, " %.15f  ", result[i * n + j] * fudge);
      }
    }
    fprintf(fp, "\n");
  }
  fclose(fp);
  free(workspace);
  free(result);
  free(ang);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0xb8,%rsp
movl   $0x0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x7,-0x10(%rbp)
jge    1203 <main+0x43>
mov    0x2df5(%rip),%rax
mov    (%rax),%rdi
lea    0xe1b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    125b <main+0x9b>
mov    -0x24(%rbp),%eax
mov    %eax,-0x8c(%rbp)
jmp    1266 <main+0xa6>
xor    %eax,%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    %eax,-0x90(%rbp)
cmpl   $0x0,-0x28(%rbp)
jle    128a <main+0xca>
mov    -0x28(%rbp),%eax
mov    %eax,-0x94(%rbp)
jmp    1295 <main+0xd5>
xor    %eax,%eax
sub    -0x28(%rbp),%eax
mov    %eax,-0x94(%rbp)
mov    -0x90(%rbp),%eax
mov    -0x94(%rbp),%ecx
cmp    %ecx,%eax
jle    12dd <main+0x11d>
cmpl   $0x0,-0x24(%rbp)
jle    12c1 <main+0x101>
mov    -0x24(%rbp),%eax
mov    %eax,-0x98(%rbp)
jmp    12cc <main+0x10c>
xor    %eax,%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x98(%rbp)
mov    -0x98(%rbp),%eax
mov    %eax,-0x9c(%rbp)
jmp    130c <main+0x14c>
cmpl   $0x0,-0x28(%rbp)
jle    12f5 <main+0x135>
mov    -0x28(%rbp),%eax
mov    %eax,-0xa0(%rbp)
jmp    1300 <main+0x140>
xor    %eax,%eax
sub    -0x28(%rbp),%eax
mov    %eax,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
mov    %eax,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x6,%eax
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x80(%rbp)
movslq -0x34(%rbp),%rax
shl    $0x3,%rax
mov    -0x2c(%rbp),%ecx
sub    -0x38(%rbp),%ecx
movslq %ecx,%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x60(%rbp)
movslq -0x34(%rbp),%rax
imul   $0x50,%rax,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x34(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x34(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
movslq -0x34(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
movslq -0x34(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    13fc <main+0x23c>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <atof@plt>
mov    -0x80(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    13bf <main+0x1ff>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    14a9 <main+0x2e9>
mov    -0x80(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1070 <sin@plt>
mov    -0x50(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x80(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1090 <cos@plt>
mov    -0x58(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x80(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  0xbab(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
call   1070 <sin@plt>
mov    -0x68(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x80(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  0xb84(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
call   1090 <cos@plt>
mov    -0x70(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1403 <main+0x243>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    -0x68(%rbp),%rbx
mov    -0x70(%rbp),%r11
mov    -0x60(%rbp),%r10
mov    -0x48(%rbp),%rax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   10b0 <genWig_L2_U@plt>
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%rdi
lea    0xb66(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x78(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
sub    -0x38(%rbp),%ecx
cmp    %ecx,%eax
jge    1689 <main+0x4c9>
mov    -0x38(%rbp),%eax
add    -0x1c(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xad3(%rip),%xmm1
divsd  %xmm1,%xmm0
call   10d0 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1669 <main+0x4a9>
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    15ea <main+0x42a>
cmpl   $0x0,-0x30(%rbp)
je     15b5 <main+0x3f5>
mov    -0x78(%rbp),%rdi
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xab4(%rip),%rsi
mov    $0x1,%al
call   1060 <fprintf@plt>
jmp    15e5 <main+0x425>
mov    -0x78(%rbp),%rdi
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
lea    0xa7f(%rip),%rsi
mov    $0x1,%al
call   1060 <fprintf@plt>
jmp    1656 <main+0x496>
cmpl   $0x0,-0x30(%rbp)
je     1621 <main+0x461>
mov    -0x78(%rbp),%rdi
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xa47(%rip),%rsi
mov    $0x1,%al
call   1060 <fprintf@plt>
jmp    1651 <main+0x491>
mov    -0x78(%rbp),%rdi
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x20(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
lea    0xa12(%rip),%rsi
mov    $0x1,%al
call   1060 <fprintf@plt>
jmp    1656 <main+0x496>
jmp    165b <main+0x49b>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1553 <main+0x393>
mov    -0x78(%rbp),%rdi
lea    0x9e4(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1504 <main+0x344>
mov    -0x78(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
cmp    $0x6,%edi
jle    14f7 <main+0x317>
mov    %rsi,%r12
mov    %edi,%r15d
mov    0x8(%rsi),%rdi
call   10d0 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%r12),%rdi
call   10d0 <atoi@plt>
mov    %eax,%ebx
mov    0x18(%r12),%rdi
call   10d0 <atoi@plt>
mov    %eax,0x10(%rsp)
mov    0x20(%r12),%rdi
call   10d0 <atoi@plt>
mov    %ebp,%ecx
neg    %ecx
mov    %ebp,0x34(%rsp)
cmovs  %ebp,%ecx
mov    %ebx,%ebp
neg    %ebp
mov    %ebx,0x30(%rsp)
cmovs  %ebx,%ebp
cmp    %ebp,%ecx
cmova  %ecx,%ebp
mov    %eax,%r14d
lea    -0x6(%r15),%ebx
mov    %r15,0x38(%rsp)
mov    %r12,0x8(%rsp)
lea    -0x30(,%r15,8),%r13d
ff
mov    %r13d,%edi
call   1090 <malloc@plt>
mov    %rax,%r15
mov    0x10(%rsp),%eax
mov    %rbp,0x60(%rsp)
sub    %ebp,%eax
mov    %eax,0x2c(%rsp)
imul   %eax,%r13d
mov    %r13d,%edi
mov    0x8(%rsp),%r13
call   1090 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    %ebx,%eax
shl    $0x4,%eax
lea    (%rax,%rax,4),%edi
call   1090 <malloc@plt>
mov    %rax,0x20(%rsp)
lea    (%rax,%rbx,8),%rax
mov    %rax,0x48(%rsp)
lea    (%rax,%rbx,8),%rax
mov    %rax,%r12
lea    (%rax,%rbx,8),%rax
mov    %rax,0x50(%rsp)
lea    (%rax,%rbx,8),%rax
mov    %rax,0x40(%rsp)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    0x30(%r13,%rbp,8),%rdi
call   1040 <atof@plt>
movsd  %xmm0,(%r15,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    12d0 <main+0xf0>
cmpl   $0x7,0x38(%rsp)
mov    %r15,%rbp
mov    %r12,(%rsp)
mov    0x50(%rsp),%r13
mov    0x48(%rsp),%r12
jl     137f <main+0x19f>
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  0x0(%rbp,%r15,8),%xmm0
call   1080 <sin@plt>
mov    0x20(%rsp),%rax
movsd  %xmm0,(%rax,%r15,8)
movsd  0x0(%rbp,%r15,8),%xmm0
call   10a0 <cos@plt>
movsd  %xmm0,(%r12,%r15,8)
movsd  0x0(%rbp,%r15,8),%xmm0
movsd  0xcb8(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1080 <sin@plt>
mov    (%rsp),%rax
movsd  %xmm0,(%rax,%r15,8)
movsd  0x0(%rbp,%r15,8),%xmm0
mulsd  0xc96(%rip),%xmm0
call   10a0 <cos@plt>
movsd  %xmm0,0x0(%r13,%r15,8)
add    $0x1,%r15
cmp    %r15,%rbx
jne    1310 <main+0x130>
mov    %rbp,0x58(%rsp)
mov    0x34(%rsp),%edi
mov    0x30(%rsp),%esi
mov    0x10(%rsp),%edx
mov    %ebx,%ecx
mov    0x20(%rsp),%r8
mov    %r12,%r9
push   0x40(%rsp)
push   0x20(%rsp)
push   %r13
push   0x18(%rsp)
call   10c0 <genWig_L2_U@plt>
add    $0x20,%rsp
mov    0x8(%rsp),%rax
mov    0x28(%rax),%rdi
lea    0xc99(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbp
mov    0x2c(%rsp),%eax
test   %eax,%eax
jle    14c0 <main+0x2e0>
movslq %ebx,%rcx
mov    %eax,%eax
mov    %rax,0x8(%rsp)
shl    $0x3,%rcx
mov    %rcx,0x10(%rsp)
mov    0x18(%rsp),%r15
xor    %r12d,%r12d
jmp    1421 <main+0x241>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
mov    %rbp,%rsi
call   1060 <fputc@plt>
add    $0x1,%r12
add    0x10(%rsp),%r15
cmp    0x8(%rsp),%r12
je     14c0 <main+0x2e0>
mov    0x60(%rsp),%rax
add    %r12d,%eax
lea    0x1(%rax,%rax,1),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xbc4(%rip),%xmm0
call   10e0 <sqrt@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
mov    $0x0,%ecx
cmovae %ecx,%eax
cmpl   $0x7,0x38(%rsp)
jl     1400 <main+0x220>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
xor    %r13d,%r13d
jmp    1493 <main+0x2b3>
nopw   0x0(%rax,%rax,1)
test   %r14d,%r14d
je     14b9 <main+0x2d9>
mov    %rbp,%rdi
lea    0xbdd(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
add    $0x1,%r13
cmp    %r13,%rbx
je     1400 <main+0x220>
movsd  (%r15,%r13,8),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1470 <main+0x290>
test   %r14d,%r14d
jne    14ad <main+0x2cd>
mulsd  (%rsp),%xmm0
mov    %rbp,%rdi
lea    0xba6(%rip),%rsi
jmp    147f <main+0x29f>
mulsd  (%rsp),%xmm0
jmp    1475 <main+0x295>
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x58(%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    0x2ae2(%rip),%rax
mov    (%rax),%rcx
lea    0xb08(%rip),%rdi
mov    $0x49,%esi
mov    $0x1,%edx
call   1100 <fwrite@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@stdout = global i32* null
@.str = [74 x i8] c"Usage: test_Wigner_angle m1 m2 bw flag output_file_name a0 [ a1 ... aN ]\0A\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [8 x i8] c"%.15f \00"
@.str.3 = [9 x i8] c" %.15f \00"
@.str.4 = [2 x i8] c"\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 i32
%13 = alloca i32
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca i32*
%22 = alloca double*
%23 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 7
br i1 %25, label %26, label %30
26: ; preds = %2
%27 = load i32*, i32** @stdout
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([74 x i8], [74 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* %8
%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* %9
%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* %10
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 4
%45 = load i8*, i8** %44
%46 = call i32 @atoi(i8* %45)
store i32 %46, i32* %11
%47 = load i32, i32* %8
%48 = icmp sgt i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %30
%50 = load i32, i32* %8
br label %54
51: ; preds = %30
%52 = load i32, i32* %8
%53 = sub nsw i32 0, %52
br label %54
54: ; preds = %51, %49
%55 = phi i32 [ %50, %49 ], [ %53, %51 ]
%56 = load i32, i32* %9
%57 = icmp sgt i32 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %54
%59 = load i32, i32* %9
br label %63
60: ; preds = %54
%61 = load i32, i32* %9
%62 = sub nsw i32 0, %61
br label %63
63: ; preds = %60, %58
%64 = phi i32 [ %59, %58 ], [ %62, %60 ]
%65 = icmp sgt i32 %55, %64
br i1 %65, label %66, label %76
66: ; preds = %63
%67 = load i32, i32* %8
%68 = icmp sgt i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %66
%70 = load i32, i32* %8
br label %74
71: ; preds = %66
%72 = load i32, i32* %8
%73 = sub nsw i32 0, %72
br label %74
74: ; preds = %71, %69
%75 = phi i32 [ %70, %69 ], [ %73, %71 ]
br label %86
76: ; preds = %63
%77 = load i32, i32* %9
%78 = icmp sgt i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %76
%80 = load i32, i32* %9
br label %84
81: ; preds = %76
%82 = load i32, i32* %9
%83 = sub nsw i32 0, %82
br label %84
84: ; preds = %81, %79
%85 = phi i32 [ %80, %79 ], [ %83, %81 ]
br label %86
86: ; preds = %84, %74
%87 = phi i32 [ %75, %74 ], [ %85, %84 ]
store i32 %87, i32* %13
%88 = load i32, i32* %4
%89 = sub nsw i32 %88, 6
store i32 %89, i32* %12
%90 = load i32, i32* %12
%91 = sext i32 %90 to i64
%92 = mul i64 8, %91
%93 = trunc i64 %92 to i32
%94 = call i64 @malloc(i32 %93)
%95 = inttoptr i64 %94 to double*
store double* %95, double** %22
%96 = load i32, i32* %12
%97 = sext i32 %96 to i64
%98 = mul i64 8, %97
%99 = load i32, i32* %10
%100 = load i32, i32* %13
%101 = sub nsw i32 %99, %100
%102 = sext i32 %101 to i64
%103 = mul i64 %98, %102
%104 = trunc i64 %103 to i32
%105 = call i64 @malloc(i32 %104)
%106 = inttoptr i64 %105 to double*
store double* %106, double** %18
%107 = load i32, i32* %12
%108 = sext i32 %107 to i64
%109 = mul i64 80, %108
%110 = trunc i64 %109 to i32
%111 = call i64 @malloc(i32 %110)
%112 = inttoptr i64 %111 to double*
store double* %112, double** %14
%113 = load double*, double** %14
store double* %113, double** %16
%114 = load double*, double** %16
%115 = load i32, i32* %12
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds double, double* %114, i64 %116
store double* %117, double** %17
%118 = load double*, double** %17
%119 = load i32, i32* %12
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double, double* %118, i64 %120
store double* %121, double** %19
%122 = load double*, double** %19
%123 = load i32, i32* %12
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds double, double* %122, i64 %124
store double* %125, double** %20
%126 = load double*, double** %20
%127 = load i32, i32* %12
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds double, double* %126, i64 %128
store double* %129, double** %15
store i32 0, i32* %6
br label %130
130: ; preds = %146, %86
%131 = load i32, i32* %6
%132 = load i32, i32* %12
%133 = icmp slt i32 %131, %132
br i1 %133, label %134, label %149
134: ; preds = %130
%135 = load i8**, i8*** %5
%136 = load i32, i32* %6
%137 = add nsw i32 6, %136
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i8*, i8** %135, i64 %138
%140 = load i8*, i8** %139
%141 = call double @atof(i8* %140)
%142 = load double*, double** %22
%143 = load i32, i32* %6
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double, double* %142, i64 %144
store double %141, double* %145
br label %146
146: ; preds = %134
%147 = load i32, i32* %6
%148 = add nsw i32 %147, 1
store i32 %148, i32* %6
br label %130
149: ; preds = %130
store i32 0, i32* %6
br label %150
150: ; preds = %197, %149
%151 = load i32, i32* %6
%152 = load i32, i32* %12
%153 = icmp slt i32 %151, %152
br i1 %153, label %154, label %200
154: ; preds = %150
%155 = load double*, double** %22
%156 = load i32, i32* %6
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds double, double* %155, i64 %157
%159 = load double, double* %158
%160 = call double @sin(double %159)
%161 = load double*, double** %16
%162 = load i32, i32* %6
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds double, double* %161, i64 %163
store double %160, double* %164
%165 = load double*, double** %22
%166 = load i32, i32* %6
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds double, double* %165, i64 %167
%169 = load double, double* %168
%170 = call double @cos(double %169)
%171 = load double*, double** %17
%172 = load i32, i32* %6
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds double, double* %171, i64 %173
store double %170, double* %174
%175 = load double*, double** %22
%176 = load i32, i32* %6
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds double, double* %175, i64 %177
%179 = load double, double* %178
%180 = fmul double 5.000000e-01, %179
%181 = call double @sin(double %180)
%182 = load double*, double** %19
%183 = load i32, i32* %6
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %182, i64 %184
store double %181, double* %185
%186 = load double*, double** %22
%187 = load i32, i32* %6
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds double, double* %186, i64 %188
%190 = load double, double* %189
%191 = fmul double 5.000000e-01, %190
%192 = call double @cos(double %191)
%193 = load double*, double** %20
%194 = load i32, i32* %6
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds double, double* %193, i64 %195
store double %192, double* %196
br label %197
197: ; preds = %154
%198 = load i32, i32* %6
%199 = add nsw i32 %198, 1
store i32 %199, i32* %6
br label %150
200: ; preds = %150
%201 = load i32, i32* %8
%202 = load i32, i32* %9
%203 = load i32, i32* %10
%204 = load i32, i32* %12
%205 = load double*, double** %16
%206 = load double*, double** %17
%207 = load double*, double** %19
%208 = load double*, double** %20
%209 = load double*, double** %18
%210 = load double*, double** %15
%211 = call i32 @genWig_L2_U(i32 %201, i32 %202, i32 %203, i32 %204, double* %205, double* %206, double* %207, double* %208, double* %209, double* %210)
%212 = load i8**, i8*** %5
%213 = getelementptr inbounds i8*, i8** %212, i64 5
%214 = load i8*, i8** %213
%215 = call i32* @fopen(i8* %214, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %215, i32** %21
store i32 0, i32* %6
br label %216
216: ; preds = %315, %200
%217 = load i32, i32* %6
%218 = load i32, i32* %10
%219 = load i32, i32* %13
%220 = sub nsw i32 %218, %219
%221 = icmp slt i32 %217, %220
br i1 %221, label %222, label %318
222: ; preds = %216
%223 = load i32, i32* %13
%224 = load i32, i32* %6
%225 = add nsw i32 %223, %224
%226 = mul nsw i32 2, %225
%227 = add nsw i32 %226, 1
%228 = sitofp i32 %227 to double
%229 = fdiv double %228, 2.000000e+00
%230 = call i32 @sqrt(double %229)
%231 = sdiv i32 1, %230
%232 = sitofp i32 %231 to double
store double %232, double* %23
store i32 0, i32* %7
br label %233
233: ; preds = %309, %222
%234 = load i32, i32* %7
%235 = load i32, i32* %12
%236 = icmp slt i32 %234, %235
br i1 %236, label %237, label %312
237: ; preds = %233
%238 = load double*, double** %18
%239 = load i32, i32* %6
%240 = load i32, i32* %12
%241 = mul nsw i32 %239, %240
%242 = load i32, i32* %7
%243 = add nsw i32 %241, %242
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds double, double* %238, i64 %244
%246 = load double, double* %245
%247 = fcmp olt double %246, 0.000000e+00
br i1 %247, label %248, label %278
248: ; preds = %237
%249 = load i32, i32* %11
%250 = icmp ne i32 %249, 0
br i1 %250, label %251, label %263
251: ; preds = %248
%252 = load i32*, i32** %21
%253 = load double*, double** %18
%254 = load i32, i32* %6
%255 = load i32, i32* %12
%256 = mul nsw i32 %254, %255
%257 = load i32, i32* %7
%258 = add nsw i32 %256, %257
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds double, double* %253, i64 %259
%261 = load double, double* %260
%262 = call i32 (i32*, i8*, ...) @fprintf(i32* %252, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %261)
br label %277
263: ; preds = %248
%264 = load i32*, i32** %21
%265 = load double*, double** %18
%266 = load i32, i32* %6
%267 = load i32, i32* %12
%268 = mul nsw i32 %266, %267
%269 = load i32, i32* %7
%270 = add nsw i32 %268, %269
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds double, double* %265, i64 %271
%273 = load double, double* %272
%274 = load double, double* %23
%275 = fmul double %273, %274
%276 = call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %275)
br label %277
277: ; preds = %263, %251
br label %308
278: ; preds = %237
%279 = load i32, i32* %11
%280 = icmp ne i32 %279, 0
br i1 %280, label %281, label %293
281: ; preds = %278
%282 = load i32*, i32** %21
%283 = load double*, double** %18
%284 = load i32, i32* %6
%285 = load i32, i32* %12
%286 = mul nsw i32 %284, %285
%287 = load i32, i32* %7
%288 = add nsw i32 %286, %287
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds double, double* %283, i64 %289
%291 = load double, double* %290
%292 = call i32 (i32*, i8*, ...) @fprintf(i32* %282, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %291)
br label %307
293: ; preds = %278
%294 = load i32*, i32** %21
%295 = load double*, double** %18
%296 = load i32, i32* %6
%297 = load i32, i32* %12
%298 = mul nsw i32 %296, %297
%299 = load i32, i32* %7
%300 = add nsw i32 %298, %299
%301 = sext i32 %300 to i64
%302 = getelementptr inbounds double, double* %295, i64 %301
%303 = load double, double* %302
%304 = load double, double* %23
%305 = fmul double %303, %304
%306 = call i32 (i32*, i8*, ...) @fprintf(i32* %294, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %305)
br label %307
307: ; preds = %293, %281
br label %308
308: ; preds = %307, %277
br label %309
309: ; preds = %308
%310 = load i32, i32* %7
%311 = add nsw i32 %310, 1
store i32 %311, i32* %7
br label %233
312: ; preds = %233
%313 = load i32*, i32** %21
%314 = call i32 (i32*, i8*, ...) @fprintf(i32* %313, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %315
315: ; preds = %312
%316 = load i32, i32* %6
%317 = add nsw i32 %316, 1
store i32 %317, i32* %6
br label %216
318: ; preds = %216
%319 = load i32*, i32** %21
%320 = call i32 @fclose(i32* %319)
%321 = load double*, double** %14
%322 = call i32 @free(double* %321)
%323 = load double*, double** %18
%324 = call i32 @free(double* %323)
%325 = load double*, double** %22
%326 = call i32 @free(double* %325)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32* null
@.str = [74 x i8] c"Usage: test_Wigner_angle m1 m2 bw flag output_file_name a0 [ a1 ... aN ]\0A\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [8 x i8] c"%.15f \00"
@.str.3 = [9 x i8] c" %.15f \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 7
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32*, i32** @stdout
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i64 73, i64 1, i32* %5)
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 4
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = tail call i32 @llvm.abs.i32(i32 %11, i1 true)
%22 = tail call i32 @llvm.abs.i32(i32 %14, i1 true)
%23 = icmp ugt i32 %21, %22
%24 = select i1 %23, i32 %21, i32 %22
%25 = add nsw i32 %0, -6
%26 = zext i32 %25 to i64
%27 = shl i32 %25, 3
%28 = tail call i64 @malloc(i32 %27)
%29 = inttoptr i64 %28 to double*
%30 = sub nsw i32 %17, %24
%31 = mul i32 %30, %27
%32 = tail call i64 @malloc(i32 %31)
%33 = inttoptr i64 %32 to double*
%34 = mul i32 %25, 80
%35 = tail call i64 @malloc(i32 %34)
%36 = inttoptr i64 %35 to double*
%37 = getelementptr inbounds double, double* %36, i64 %26
%38 = getelementptr inbounds double, double* %37, i64 %26
%39 = getelementptr inbounds double, double* %38, i64 %26
%40 = getelementptr inbounds double, double* %39, i64 %26
br label %43
41: ; preds = %43
%42 = icmp sgt i32 %0, 6
br i1 %42, label %52, label %71
43: ; preds = %8, %43
%44 = phi i64 [ 0, %8 ], [ %50, %43 ]
%45 = add nuw nsw i64 %44, 6
%46 = getelementptr inbounds i8*, i8** %1, i64 %45
%47 = load i8*, i8** %46
%48 = tail call double @atof(i8* %47)
%49 = getelementptr inbounds double, double* %29, i64 %44
store double %48, double* %49
%50 = add nuw nsw i64 %44, 1
%51 = icmp eq i64 %50, %26
br i1 %51, label %41, label %43
52: ; preds = %41, %52
%53 = phi i64 [ %69, %52 ], [ 0, %41 ]
%54 = getelementptr inbounds double, double* %29, i64 %53
%55 = load double, double* %54
%56 = tail call double @sin(double %55)
%57 = getelementptr inbounds double, double* %36, i64 %53
store double %56, double* %57
%58 = load double, double* %54
%59 = tail call double @cos(double %58)
%60 = getelementptr inbounds double, double* %37, i64 %53
store double %59, double* %60
%61 = load double, double* %54
%62 = fmul double %61, 5.000000e-01
%63 = tail call double @sin(double %62)
%64 = getelementptr inbounds double, double* %38, i64 %53
store double %63, double* %64
%65 = load double, double* %54
%66 = fmul double %65, 5.000000e-01
%67 = tail call double @cos(double %66)
%68 = getelementptr inbounds double, double* %39, i64 %53
store double %67, double* %68
%69 = add nuw nsw i64 %53, 1
%70 = icmp eq i64 %69, %26
br i1 %70, label %71, label %52
71: ; preds = %52, %41
%72 = tail call i32 @genWig_L2_U(i32 %11, i32 %14, i32 %17, i32 %25, double* %36, double* %37, double* %38, double* %39, double* %33, double* %40)
%73 = getelementptr inbounds i8*, i8** %1, i64 5
%74 = load i8*, i8** %73
%75 = tail call i32* @fopen(i8* %74, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%76 = icmp sgt i32 %30, 0
br i1 %76, label %77, label %121
77: ; preds = %71
%78 = icmp eq i32 %20, 0
%79 = sext i32 %25 to i64
%80 = zext i32 %30 to i64
br label %81
81: ; preds = %77, %117
%82 = phi i64 [ 0, %77 ], [ %119, %117 ]
%83 = trunc i64 %82 to i32
%84 = add nuw nsw i32 %24, %83
%85 = shl nuw nsw i32 %84, 1
%86 = or i32 %85, 1
%87 = sitofp i32 %86 to double
%88 = fmul double %87, 5.000000e-01
%89 = tail call i32 @sqrt(double %88)
%90 = add i32 %89, 1
%91 = icmp ult i32 %90, 3
%92 = select i1 %91, i32 %89, i32 0
%93 = sitofp i32 %92 to double
br i1 %42, label %94, label %117
94: ; preds = %81
%95 = mul nsw i64 %82, %79
br label %96
96: ; preds = %94, %114
%97 = phi i64 [ 0, %94 ], [ %115, %114 ]
%98 = add nsw i64 %97, %95
%99 = getelementptr inbounds double, double* %33, i64 %98
%100 = load double, double* %99
%101 = fcmp olt double %100, 0.000000e+00
br i1 %101, label %102, label %108
102: ; preds = %96
br i1 %78, label %105, label %103
103: ; preds = %102
%104 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %100)
br label %114
105: ; preds = %102
%106 = fmul double %100, %93
%107 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %106)
br label %114
108: ; preds = %96
br i1 %78, label %111, label %109
109: ; preds = %108
%110 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %100)
br label %114
111: ; preds = %108
%112 = fmul double %100, %93
%113 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %112)
br label %114
114: ; preds = %105, %103, %111, %109
%115 = add nuw nsw i64 %97, 1
%116 = icmp eq i64 %115, %26
br i1 %116, label %117, label %96
117: ; preds = %114, %81
%118 = tail call i32 @fputc(i32 10, i32* %75)
%119 = add nuw nsw i64 %82, 1
%120 = icmp eq i64 %119, %80
br i1 %120, label %121, label %81
121: ; preds = %117, %71
%122 = tail call i32 @fclose(i32* %75)
%123 = tail call i32 @free(double* %36)
%124 = tail call i32 @free(double* %33)
%125 = tail call i32 @free(double* %29)
ret i32 0
}