#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 */

/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, int);
void wigNaiveSynthesis_symY(int m1, int m2, int bw, double *coeffs,
                            double *wignersTrans, double *signal,
                            double *workspace) {
  int i, j, m, n;
  int fudge;
  double *wignersTransPtr;
  double tmp0, tmp1, tmp2, tmp3;
  m = ((((m1) > 0 ? (m1) : (-m1))) > (((m2) > 0 ? (m2) : (-m2)))
           ? (((m1) > 0 ? (m1) : (-m1)))
           : (((m2) > 0 ? (m2) : (-m2))));
  n = 2 * bw;
  if (m1 < 0) {
    if ((m - m2) % 2)
      fudge = -1;
    else
      fudge = 1;
  } else {
    if ((m + m1) % 2)
      fudge = -1;
    else
      fudge = 1;
  }
  wignersTransPtr = wignersTrans + (bw - m) * n - (bw - m);
  memcpy(workspace, coeffs, sizeof(double) * n);
  for (i = 0; i < n; i++) {
    workspace[i] *= fudge;
    fudge *= -1;
  }
  for (i = 0; i < n; i++) {
    tmp0 = 0.;
    tmp1 = 0.;
    tmp2 = 0.;
    tmp3 = 0.;
    for (j = 0; j < (bw - m) % 4; ++j)
      tmp0 += wignersTransPtr[j] * workspace[j];
    for (; j < (bw - m); j += 4) {
      tmp0 += wignersTransPtr[j] * workspace[j];
      tmp1 += wignersTransPtr[j + 1] * workspace[j + 1];
      tmp2 += wignersTransPtr[j + 2] * workspace[j + 2];
      tmp3 += wignersTransPtr[j + 3] * workspace[j + 3];
    }
    signal[i] = tmp0 + tmp1 + tmp2 + tmp3;
    wignersTransPtr = wignersTrans + (n - i - 1) * (bw - m) - (bw - m);
  }
}


x86 assembly (clang, -O0):
<wigNaiveSynthesis_symY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1149 <wigNaiveSynthesis_symY+0x39>
mov    -0x4(%rbp),%eax
mov    %eax,-0x6c(%rbp)
jmp    1151 <wigNaiveSynthesis_symY+0x41>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x70(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    116c <wigNaiveSynthesis_symY+0x5c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x74(%rbp)
jmp    1174 <wigNaiveSynthesis_symY+0x64>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x70(%rbp),%eax
mov    -0x74(%rbp),%ecx
cmp    %ecx,%eax
jle    11aa <wigNaiveSynthesis_symY+0x9a>
cmpl   $0x0,-0x4(%rbp)
jle    1197 <wigNaiveSynthesis_symY+0x87>
mov    -0x4(%rbp),%eax
mov    %eax,-0x78(%rbp)
jmp    119f <wigNaiveSynthesis_symY+0x8f>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0x7c(%rbp)
jmp    11cd <wigNaiveSynthesis_symY+0xbd>
cmpl   $0x0,-0x8(%rbp)
jle    11bf <wigNaiveSynthesis_symY+0xaf>
mov    -0x8(%rbp),%eax
mov    %eax,-0x80(%rbp)
jmp    11c7 <wigNaiveSynthesis_symY+0xb7>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x80(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1215 <wigNaiveSynthesis_symY+0x105>
mov    -0x34(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1209 <wigNaiveSynthesis_symY+0xf9>
movl   $0xffffffff,-0x3c(%rbp)
jmp    1210 <wigNaiveSynthesis_symY+0x100>
movl   $0x1,-0x3c(%rbp)
jmp    1244 <wigNaiveSynthesis_symY+0x134>
mov    -0x34(%rbp),%eax
add    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1238 <wigNaiveSynthesis_symY+0x128>
movl   $0xffffffff,-0x3c(%rbp)
jmp    123f <wigNaiveSynthesis_symY+0x12f>
movl   $0x1,-0x3c(%rbp)
jmp    1244 <wigNaiveSynthesis_symY+0x134>
mov    -0x20(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    -0x34(%rbp),%ecx
imul   -0x38(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
sub    -0x34(%rbp),%ecx
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x38(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    12cb <wigNaiveSynthesis_symY+0x1bb>
cvtsi2sdl -0x3c(%rbp),%xmm0
mov    0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
imul   $0xffffffff,-0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1293 <wigNaiveSynthesis_symY+0x183>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    14be <wigNaiveSynthesis_symY+0x3ae>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x34(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0x84(%rbp),%eax
cmp    %edx,%eax
jge    1364 <wigNaiveSynthesis_symY+0x254>
mov    -0x48(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1305 <wigNaiveSynthesis_symY+0x1f5>
jmp    1369 <wigNaiveSynthesis_symY+0x259>
mov    -0x30(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x34(%rbp),%ecx
cmp    %ecx,%eax
jge    1456 <wigNaiveSynthesis_symY+0x346>
mov    -0x48(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x30(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x30(%rbp)
jmp    1369 <wigNaiveSynthesis_symY+0x259>
movsd  -0x50(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0xc(%rbp),%edx
sub    -0x34(%rbp),%edx
imul   %edx,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
sub    -0x34(%rbp),%ecx
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12d2 <wigNaiveSynthesis_symY+0x1c2>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wigNaiveSynthesis_symY>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r14
mov    %r8,0x10(%rsp)
mov    %edx,%r12d
mov    %esi,%ebp
mov    %edi,%r13d
mov    0x50(%rsp),%rbx
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
mov    %esi,%r15d
neg    %r15d
cmovs  %esi,%r15d
cmp    %r15d,%eax
cmova  %eax,%r15d
shl    $0x4,%edx
mov    %rbx,%rdi
mov    %rcx,%rsi
call   1030 <memcpy@plt>
test   %r12d,%r12d
jle    134e <wigNaiveSynthesis_symY+0x23e>
test   %r13d,%r13d
cmovns %r13d,%ebp
add    %r15d,%ebp
and    $0x1,%ebp
cmp    $0x1,%ebp
sbb    %ecx,%ecx
neg    %ebp
sbb    %eax,%eax
lea    (%r12,%r12,1),%r9d
or     $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    $0x1,%eax
cmp    $0x2,%r9d
cmovge %r9d,%eax
jge    1196 <wigNaiveSynthesis_symY+0x86>
xor    %ecx,%ecx
jmp    11d7 <wigNaiveSynthesis_symY+0xc7>
or     $0x1,%ecx
mov    %eax,%edx
and    $0x7ffffffe,%edx
cvtsi2sd %ecx,%xmm1
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movsd  (%rbx,%rcx,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rbx,%rcx,8)
movsd  0x8(%rbx,%rcx,8),%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rbx,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rdx
jne    11b0 <wigNaiveSynthesis_symY+0xa0>
test   $0x1,%al
je     11e5 <wigNaiveSynthesis_symY+0xd5>
mulsd  (%rbx,%rcx,8),%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
test   %r12d,%r12d
jle    134e <wigNaiveSynthesis_symY+0x23e>
mov    %r12d,%ecx
sub    %r15d,%ecx
movslq %ecx,%rdx
mov    %edx,%ebp
imul   %r9d,%ebp
mov    %rdx,%rax
neg    %rax
lea    0x3(%rdx),%edi
test   %edx,%edx
cmovns %edx,%edi
and    $0xfffffffc,%edi
mov    %edx,%esi
sub    %edi,%esi
xor    %edi,%edi
test   %esi,%esi
mov    $0x0,%r8d
cmovg  %esi,%r8d
cmp    $0x2,%r9d
mov    $0x1,%r11d
cmovge %r9d,%r11d
mov    %r12,0x8(%rsp)
mov    0x10(%rsp),%r12
lea    (%r12,%rax,8),%r13
movslq %r15d,%r10
add    %r8,%r10
movslq 0x8(%rsp),%rax
sub    %rax,%r10
lea    (%r12,%r10,8),%r10
xorpd  %xmm0,%xmm0
jmp    1295 <wigNaiveSynthesis_symY+0x185>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorpd  %xmm3,%xmm3
xorpd  %xmm2,%xmm2
addsd  %xmm3,%xmm1
unpckhpd %xmm3,%xmm3
addsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,(%r14,%rdi,8)
mov    %edi,%ebp
not    %ebp
add    %r9d,%ebp
imul   %ecx,%ebp
add    $0x1,%rdi
cmp    %r11,%rdi
je     134e <wigNaiveSynthesis_symY+0x23e>
movslq %ebp,%rbp
mov    $0x0,%eax
xorpd  %xmm1,%xmm1
test   %esi,%esi
jle    12d0 <wigNaiveSynthesis_symY+0x1c0>
movsd  0x0(%r13,%rbp,8),%xmm1
mulsd  (%rbx),%xmm1
addsd  %xmm0,%xmm1
cmp    $0x1,%esi
je     12e6 <wigNaiveSynthesis_symY+0x1d6>
movsd  0x8(%r13,%rbp,8),%xmm2
mulsd  0x8(%rbx),%xmm2
addsd  %xmm2,%xmm1
cmp    $0x2,%esi
jne    12d6 <wigNaiveSynthesis_symY+0x1c6>
mov    %esi,%eax
cmp    %ecx,%eax
jge    1260 <wigNaiveSynthesis_symY+0x150>
jmp    12f0 <wigNaiveSynthesis_symY+0x1e0>
movsd  0x10(%r13,%rbp,8),%xmm2
mulsd  0x10(%rbx),%xmm2
addsd  %xmm2,%xmm1
mov    %esi,%eax
cmp    %ecx,%eax
jge    1260 <wigNaiveSynthesis_symY+0x150>
lea    (%r10,%rbp,8),%rbp
xorpd  %xmm5,%xmm5
xorpd  %xmm2,%xmm2
mov    %r8,%rax
nop
movapd %xmm5,%xmm4
movsd  0x0(%rbp),%xmm3
mulsd  (%rbx,%rax,8),%xmm3
addsd  %xmm3,%xmm1
movupd 0x8(%rbp),%xmm5
movupd 0x8(%rbx,%rax,8),%xmm3
mulpd  %xmm5,%xmm3
movapd %xmm3,%xmm5
addpd  %xmm4,%xmm5
movsd  0x18(%rbp),%xmm6
mulsd  0x18(%rbx,%rax,8),%xmm6
addsd  %xmm6,%xmm2
add    $0x4,%rax
add    $0x20,%rbp
cmp    %rdx,%rax
jl     1300 <wigNaiveSynthesis_symY+0x1f0>
addpd  %xmm4,%xmm3
jmp    1268 <wigNaiveSynthesis_symY+0x158>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @wigNaiveSynthesis_symY(i32 %0, i32 %1, i32 %2, double* %3, double* %4, double* %5, double* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca double*
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store double* %3, double** %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
%25 = load i32, i32* %8
%26 = icmp sgt i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %7
%28 = load i32, i32* %8
br label %32
29: ; preds = %7
%30 = load i32, i32* %8
%31 = sub nsw i32 0, %30
br label %32
32: ; preds = %29, %27
%33 = phi i32 [ %28, %27 ], [ %31, %29 ]
%34 = load i32, i32* %9
%35 = icmp sgt i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = load i32, i32* %9
br label %41
38: ; preds = %32
%39 = load i32, i32* %9
%40 = sub nsw i32 0, %39
br label %41
41: ; preds = %38, %36
%42 = phi i32 [ %37, %36 ], [ %40, %38 ]
%43 = icmp sgt i32 %33, %42
br i1 %43, label %44, label %54
44: ; preds = %41
%45 = load i32, i32* %8
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %44
%48 = load i32, i32* %8
br label %52
49: ; preds = %44
%50 = load i32, i32* %8
%51 = sub nsw i32 0, %50
br label %52
52: ; preds = %49, %47
%53 = phi i32 [ %48, %47 ], [ %51, %49 ]
br label %64
54: ; preds = %41
%55 = load i32, i32* %9
%56 = icmp sgt i32 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = load i32, i32* %9
br label %62
59: ; preds = %54
%60 = load i32, i32* %9
%61 = sub nsw i32 0, %60
br label %62
62: ; preds = %59, %57
%63 = phi i32 [ %58, %57 ], [ %61, %59 ]
br label %64
64: ; preds = %62, %52
%65 = phi i32 [ %53, %52 ], [ %63, %62 ]
store i32 %65, i32* %17
%66 = load i32, i32* %10
%67 = mul nsw i32 2, %66
store i32 %67, i32* %18
%68 = load i32, i32* %8
%69 = icmp slt i32 %68, 0
br i1 %69, label %70, label %79
70: ; preds = %64
%71 = load i32, i32* %17
%72 = load i32, i32* %9
%73 = sub nsw i32 %71, %72
%74 = srem i32 %73, 2
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %70
store i32 -1, i32* %19
br label %78
77: ; preds = %70
store i32 1, i32* %19
br label %78
78: ; preds = %77, %76
br label %88
79: ; preds = %64
%80 = load i32, i32* %17
%81 = load i32, i32* %8
%82 = add nsw i32 %80, %81
%83 = srem i32 %82, 2
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %86
85: ; preds = %79
store i32 -1, i32* %19
br label %87
86: ; preds = %79
store i32 1, i32* %19
br label %87
87: ; preds = %86, %85
br label %88
88: ; preds = %87, %78
%89 = load double*, double** %12
%90 = load i32, i32* %10
%91 = load i32, i32* %17
%92 = sub nsw i32 %90, %91
%93 = load i32, i32* %18
%94 = mul nsw i32 %92, %93
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double, double* %89, i64 %95
%97 = load i32, i32* %10
%98 = load i32, i32* %17
%99 = sub nsw i32 %97, %98
%100 = sext i32 %99 to i64
%101 = sub i64 0, %100
%102 = getelementptr inbounds double, double* %96, i64 %101
store double* %102, double** %20
%103 = load double*, double** %14
%104 = load double*, double** %11
%105 = load i32, i32* %18
%106 = sext i32 %105 to i64
%107 = mul i64 8, %106
%108 = trunc i64 %107 to i32
%109 = call i32 @memcpy(double* %103, double* %104, i32 %108)
store i32 0, i32* %15
br label %110
110: ; preds = %125, %88
%111 = load i32, i32* %15
%112 = load i32, i32* %18
%113 = icmp slt i32 %111, %112
br i1 %113, label %114, label %128
114: ; preds = %110
%115 = load i32, i32* %19
%116 = sitofp i32 %115 to double
%117 = load double*, double** %14
%118 = load i32, i32* %15
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %117, i64 %119
%121 = load double, double* %120
%122 = fmul double %121, %116
store double %122, double* %120
%123 = load i32, i32* %19
%124 = mul nsw i32 %123, -1
store i32 %124, i32* %19
br label %125
125: ; preds = %114
%126 = load i32, i32* %15
%127 = add nsw i32 %126, 1
store i32 %127, i32* %15
br label %110
128: ; preds = %110
store i32 0, i32* %15
br label %129
129: ; preds = %251, %128
%130 = load i32, i32* %15
%131 = load i32, i32* %18
%132 = icmp slt i32 %130, %131
br i1 %132, label %133, label %254
133: ; preds = %129
store double 0.000000e+00, double* %21
store double 0.000000e+00, double* %22
store double 0.000000e+00, double* %23
store double 0.000000e+00, double* %24
store i32 0, i32* %16
br label %134
134: ; preds = %154, %133
%135 = load i32, i32* %16
%136 = load i32, i32* %10
%137 = load i32, i32* %17
%138 = sub nsw i32 %136, %137
%139 = srem i32 %138, 4
%140 = icmp slt i32 %135, %139
br i1 %140, label %141, label %157
141: ; preds = %134
%142 = load double*, double** %20
%143 = load i32, i32* %16
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double, double* %142, i64 %144
%146 = load double, double* %145
%147 = load double*, double** %14
%148 = load i32, i32* %16
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds double, double* %147, i64 %149
%151 = load double, double* %150
%152 = load double, double* %21
%153 = call double @llvm.fmuladd.f64(double %146, double %151, double %152)
store double %153, double* %21
br label %154
154: ; preds = %141
%155 = load i32, i32* %16
%156 = add nsw i32 %155, 1
store i32 %156, i32* %16
br label %134
157: ; preds = %134
br label %158
158: ; preds = %219, %157
%159 = load i32, i32* %16
%160 = load i32, i32* %10
%161 = load i32, i32* %17
%162 = sub nsw i32 %160, %161
%163 = icmp slt i32 %159, %162
br i1 %163, label %164, label %222
164: ; preds = %158
%165 = load double*, double** %20
%166 = load i32, i32* %16
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds double, double* %165, i64 %167
%169 = load double, double* %168
%170 = load double*, double** %14
%171 = load i32, i32* %16
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds double, double* %170, i64 %172
%174 = load double, double* %173
%175 = load double, double* %21
%176 = call double @llvm.fmuladd.f64(double %169, double %174, double %175)
store double %176, double* %21
%177 = load double*, double** %20
%178 = load i32, i32* %16
%179 = add nsw i32 %178, 1
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds double, double* %177, i64 %180
%182 = load double, double* %181
%183 = load double*, double** %14
%184 = load i32, i32* %16
%185 = add nsw i32 %184, 1
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double, double* %183, i64 %186
%188 = load double, double* %187
%189 = load double, double* %22
%190 = call double @llvm.fmuladd.f64(double %182, double %188, double %189)
store double %190, double* %22
%191 = load double*, double** %20
%192 = load i32, i32* %16
%193 = add nsw i32 %192, 2
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds double, double* %191, i64 %194
%196 = load double, double* %195
%197 = load double*, double** %14
%198 = load i32, i32* %16
%199 = add nsw i32 %198, 2
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds double, double* %197, i64 %200
%202 = load double, double* %201
%203 = load double, double* %23
%204 = call double @llvm.fmuladd.f64(double %196, double %202, double %203)
store double %204, double* %23
%205 = load double*, double** %20
%206 = load i32, i32* %16
%207 = add nsw i32 %206, 3
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds double, double* %205, i64 %208
%210 = load double, double* %209
%211 = load double*, double** %14
%212 = load i32, i32* %16
%213 = add nsw i32 %212, 3
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds double, double* %211, i64 %214
%216 = load double, double* %215
%217 = load double, double* %24
%218 = call double @llvm.fmuladd.f64(double %210, double %216, double %217)
store double %218, double* %24
br label %219
219: ; preds = %164
%220 = load i32, i32* %16
%221 = add nsw i32 %220, 4
store i32 %221, i32* %16
br label %158
222: ; preds = %158
%223 = load double, double* %21
%224 = load double, double* %22
%225 = fadd double %223, %224
%226 = load double, double* %23
%227 = fadd double %225, %226
%228 = load double, double* %24
%229 = fadd double %227, %228
%230 = load double*, double** %13
%231 = load i32, i32* %15
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds double, double* %230, i64 %232
store double %229, double* %233
%234 = load double*, double** %12
%235 = load i32, i32* %18
%236 = load i32, i32* %15
%237 = sub nsw i32 %235, %236
%238 = sub nsw i32 %237, 1
%239 = load i32, i32* %10
%240 = load i32, i32* %17
%241 = sub nsw i32 %239, %240
%242 = mul nsw i32 %238, %241
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds double, double* %234, i64 %243
%245 = load i32, i32* %10
%246 = load i32, i32* %17
%247 = sub nsw i32 %245, %246
%248 = sext i32 %247 to i64
%249 = sub i64 0, %248
%250 = getelementptr inbounds double, double* %244, i64 %249
store double* %250, double** %20
br label %251
251: ; preds = %222
%252 = load i32, i32* %15
%253 = add nsw i32 %252, 1
store i32 %253, i32* %15
br label %129
254: ; preds = %129
ret void
}

LLVM IR (-O2):
define void @wigNaiveSynthesis_symY(i32 %0, i32 %1, i32 %2, double* %3, double* nocapture %4, double* nocapture writeonly %5, double* %6) {
%8 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%9 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%10 = icmp ugt i32 %8, %9
%11 = select i1 %10, i32 %8, i32 %9
%12 = shl i32 %2, 1
%13 = sub nsw i32 %2, %11
%14 = mul nsw i32 %13, %12
%15 = sext i32 %13 to i64
%16 = sub nsw i64 0, %15
%17 = shl i32 %2, 4
%18 = tail call i32 @memcpy(double* %6, double* %3, i32 %17)
%19 = icmp sgt i32 %2, 0
br i1 %19, label %20, label %137
20: ; preds = %7
%21 = icmp slt i32 %0, 0
%22 = select i1 %21, i32 %1, i32 %0
%23 = add i32 %11, %22
%24 = and i32 %23, 1
%25 = icmp eq i32 %24, 0
%26 = select i1 %25, i32 -1, i32 1
%27 = select i1 %25, i32 1, i32 -1
%28 = call i32 @llvm.smax.i32(i32 %12, i32 1)
%29 = zext i32 %28 to i64
%30 = and i64 %29, 1
%31 = icmp slt i32 %12, 2
br i1 %31, label %36, label %32
32: ; preds = %20
%33 = and i64 %29, 2147483646
%34 = sitofp i32 %27 to double
%35 = sitofp i32 %26 to double
br label %57
36: ; preds = %57, %20
%37 = phi i64 [ 0, %20 ], [ %67, %57 ]
%38 = icmp eq i64 %30, 0
br i1 %38, label %44, label %39
39: ; preds = %36
%40 = sitofp i32 %27 to double
%41 = getelementptr inbounds double, double* %6, i64 %37
%42 = load double, double* %41
%43 = fmul double %42, %40
store double %43, double* %41
br label %44
44: ; preds = %36, %39
br i1 %19, label %45, label %137
45: ; preds = %44
%46 = srem i32 %13, 4
%47 = icmp sgt i32 %46, 0
%48 = call i32 @llvm.smax.i32(i32 %46, i32 0)
%49 = zext i32 %48 to i64
%50 = call i32 @llvm.smax.i32(i32 %12, i32 1)
%51 = zext i32 %50 to i64
%52 = getelementptr inbounds double, double* %4, i64 %16
%53 = icmp eq i32 %46, 1
%54 = getelementptr inbounds double, double* %6, i64 1
%55 = icmp eq i32 %46, 2
%56 = getelementptr inbounds double, double* %6, i64 2
br label %70
57: ; preds = %57, %32
%58 = phi i64 [ 0, %32 ], [ %67, %57 ]
%59 = phi i64 [ 0, %32 ], [ %68, %57 ]
%60 = getelementptr inbounds double, double* %6, i64 %58
%61 = load double, double* %60
%62 = fmul double %61, %34
store double %62, double* %60
%63 = or i64 %58, 1
%64 = getelementptr inbounds double, double* %6, i64 %63
%65 = load double, double* %64
%66 = fmul double %65, %35
store double %66, double* %64
%67 = add nuw nsw i64 %58, 2
%68 = add i64 %59, 2
%69 = icmp eq i64 %68, %33
br i1 %69, label %36, label %57
70: ; preds = %45, %122
%71 = phi i64 [ 0, %45 ], [ %135, %122 ]
%72 = phi i32 [ %14, %45 ], [ %134, %122 ]
%73 = trunc i64 %71 to i32
%74 = sext i32 %72 to i64
%75 = getelementptr inbounds double, double* %52, i64 %74
br i1 %47, label %80, label %76
76: ; preds = %80, %84, %89, %70
%77 = phi i32 [ 0, %70 ], [ %46, %89 ], [ %46, %84 ], [ %46, %80 ]
%78 = phi double [ 0.000000e+00, %70 ], [ %83, %80 ], [ %88, %84 ], [ %93, %89 ]
%79 = icmp slt i32 %77, %13
br i1 %79, label %94, label %122
80: ; preds = %70
%81 = load double, double* %75
%82 = load double, double* %6
%83 = tail call double @llvm.fmuladd.f64(double %81, double %82, double 0.000000e+00)
br i1 %53, label %76, label %84
84: ; preds = %80
%85 = getelementptr inbounds double, double* %75, i64 1
%86 = load double, double* %85
%87 = load double, double* %54
%88 = tail call double @llvm.fmuladd.f64(double %86, double %87, double %83)
br i1 %55, label %76, label %89
89: ; preds = %84
%90 = getelementptr inbounds double, double* %75, i64 2
%91 = load double, double* %90
%92 = load double, double* %56
%93 = tail call double @llvm.fmuladd.f64(double %91, double %92, double %88)
br label %76
94: ; preds = %76, %94
%95 = phi i64 [ %118, %94 ], [ %49, %76 ]
%96 = phi double [ %117, %94 ], [ 0.000000e+00, %76 ]
%97 = phi double [ %103, %94 ], [ %78, %76 ]
%98 = phi <2 x double> [ %111, %94 ], [ zeroinitializer, %76 ]
%99 = getelementptr inbounds double, double* %75, i64 %95
%100 = load double, double* %99
%101 = getelementptr inbounds double, double* %6, i64 %95
%102 = load double, double* %101
%103 = tail call double @llvm.fmuladd.f64(double %100, double %102, double %97)
%104 = add nuw nsw i64 %95, 1
%105 = getelementptr inbounds double, double* %75, i64 %104
%106 = getelementptr inbounds double, double* %6, i64 %104
%107 = bitcast double* %105 to <2 x double>*
%108 = load <2 x double>, <2 x double>* %107
%109 = bitcast double* %106 to <2 x double>*
%110 = load <2 x double>, <2 x double>* %109
%111 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %108, <2 x double> %110, <2 x double> %98)
%112 = add nuw nsw i64 %95, 3
%113 = getelementptr inbounds double, double* %75, i64 %112
%114 = load double, double* %113
%115 = getelementptr inbounds double, double* %6, i64 %112
%116 = load double, double* %115
%117 = tail call double @llvm.fmuladd.f64(double %114, double %116, double %96)
%118 = add nuw nsw i64 %95, 4
%119 = icmp slt i64 %118, %15
br i1 %119, label %94, label %120
120: ; preds = %94
%121 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %108, <2 x double> %110, <2 x double> %98)
br label %122
122: ; preds = %120, %76
%123 = phi double [ %78, %76 ], [ %103, %120 ]
%124 = phi double [ 0.000000e+00, %76 ], [ %117, %120 ]
%125 = phi <2 x double> [ zeroinitializer, %76 ], [ %121, %120 ]
%126 = extractelement <2 x double> %125, i64 0
%127 = fadd double %123, %126
%128 = extractelement <2 x double> %125, i64 1
%129 = fadd double %127, %128
%130 = fadd double %129, %124
%131 = getelementptr inbounds double, double* %5, i64 %71
store double %130, double* %131
%132 = xor i32 %73, -1
%133 = add i32 %12, %132
%134 = mul nsw i32 %133, %13
%135 = add nuw nsw i64 %71, 1
%136 = icmp eq i64 %135, %51
br i1 %136, label %137, label %70
137: ; preds = %122, %7, %44
ret void
}