#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 */
scalar_t__ cos(double);
int /*<<< orphan*/ genExp_mem(int, double, double *, double *);
int /*<<< orphan*/ memcpy(double *, double *, int);
int /*<<< orphan*/ rotateCoefDegree_mem(int, double *, double *, double *,
                                        double *, double *, double *, double *,
                                        double *, int, double *);
int seanindex(int, int, int);
scalar_t__ sin(double);
scalar_t__ sqrt(double);
int /*<<< orphan*/ wignerdmat_mem(int, double *, double *, double *, double *,
                                  double *);
void rotateCoefAll_mem(int bw, int degOut, double alpha, double beta,
                       double gamma, double *cfR, double *cfI,
                       double *scratch) {
  int i, m;
  int deg, dim, dummy;
  double *sqrts, trigs[2];
  double *matIn, *matOut, *workspace;
  double *cfTmpR, *cfTmpI;
  double *cfrTmpR, *cfrTmpI;
  double *expAR, *expAI, *expGR, *expGI;
  sqrts = scratch;
  matIn = sqrts + 2 * bw;
  matOut = matIn + (2 * bw - 1) * (2 * bw - 1);
  cfTmpR = matOut + (2 * bw - 1) * (2 * bw - 1);
  cfTmpI = cfTmpR + (2 * bw - 1);
  cfrTmpR = cfTmpI + (2 * bw - 1);
  cfrTmpI = cfrTmpR + (2 * bw - 1);
  expAR = cfrTmpI + (2 * bw - 1);
  expAI = expAR + (2 * bw - 1);
  expGR = expAI + (2 * bw - 1);
  expGI = expGR + (2 * bw - 1);
  workspace = expGI + (2 * bw - 1);
  for (i = 0; i < 2 * bw; i++)
    sqrts[i] = (double)sqrt((double)i);
  trigs[0] = (double)cos(0.5 * beta);
  trigs[1] = (double)sin(0.5 * beta);
  genExp_mem(bw, alpha, expAR, expAI);
  genExp_mem(bw, gamma, expGR, expGI);
  for (deg = 0; deg <= degOut; deg++) {
    dim = 2 * deg - 1;
    if (deg > 0)
      memcpy(matIn, matOut, sizeof(double) * (dim * dim));
    for (m = -deg; m < deg + 1; m++) {
      dummy = seanindex(m, deg, bw);
      cfTmpR[m + deg] = cfR[dummy];
      cfTmpI[m + deg] = cfI[dummy];
    }
    wignerdmat_mem(deg, matIn, matOut, trigs, sqrts, workspace);
    rotateCoefDegree_mem(deg, cfTmpR, cfTmpI, cfrTmpR, cfrTmpI, expAR, expAI,
                         expGR, expGI, bw - 1, matOut);
    for (m = -deg; m < deg + 1; m++) {
      dummy = seanindex(m, deg, bw);
      cfR[dummy] = cfrTmpR[m + deg];
      cfI[dummy] = cfrTmpI[m + deg];
    }
  }
  for (deg = degOut + 1; deg < bw; deg++)
    for (m = -deg; m < deg + 1; m++) {
      dummy = seanindex(m, deg, bw);
      cfR[dummy] = (double)0;
      cfI[dummy] = (double)0;
    }
}


x86 assembly (clang, -O0):
<rotateCoefAll_mem>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0xf0,%rsp
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %r8,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
mov    -0x14(%rbp),%edx
shl    $0x1,%edx
sub    $0x1,%edx
imul   %edx,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
mov    -0x14(%rbp),%edx
shl    $0x1,%edx
sub    $0x1,%edx
imul   %edx,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xa0(%rbp)
mov    -0xa0(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb0(%rbp)
mov    -0xb0(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xb8(%rbp)
mov    -0xb8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
mov    -0xc0(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xc8(%rbp)
mov    -0xc8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xd0(%rbp)
mov    -0xd0(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x98(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    1376 <rotateCoefAll_mem+0x1f6>
cvtsi2sdl -0x4c(%rbp),%xmm0
call   1080 <sqrt@plt>
cvtsi2sd %rax,%xmm0
mov    -0x68(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    133b <rotateCoefAll_mem+0x1bb>
movsd  0xc82(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1070 <cos@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xc66(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <sin@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x14(%rbp),%edi
movsd  -0x20(%rbp),%xmm0
mov    -0xc0(%rbp),%rsi
mov    -0xc8(%rbp),%rdx
call   1090 <genExp_mem@plt>
mov    -0x14(%rbp),%edi
movsd  -0x30(%rbp),%xmm0
mov    -0xd0(%rbp),%rsi
mov    -0xd8(%rbp),%rdx
call   1090 <genExp_mem@plt>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     15c6 <rotateCoefAll_mem+0x446>
mov    -0x54(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x58(%rbp)
cmpl   $0x0,-0x54(%rbp)
jle    142f <rotateCoefAll_mem+0x2af>
mov    -0x88(%rbp),%rdi
mov    -0x90(%rbp),%rsi
mov    -0x58(%rbp),%eax
imul   -0x58(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
xor    %eax,%eax
sub    -0x54(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    14ab <rotateCoefAll_mem+0x32b>
mov    -0x50(%rbp),%edi
mov    -0x54(%rbp),%esi
mov    -0x14(%rbp),%edx
call   10a0 <seanindex@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xa0(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xa8(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1437 <rotateCoefAll_mem+0x2b7>
mov    -0x54(%rbp),%edi
mov    -0x88(%rbp),%rsi
mov    -0x90(%rbp),%rdx
lea    -0x80(%rbp),%rcx
mov    -0x68(%rbp),%r8
mov    -0x98(%rbp),%r9
call   1060 <wignerdmat_mem@plt>
mov    -0x54(%rbp),%edi
mov    -0xa0(%rbp),%rsi
mov    -0xa8(%rbp),%rdx
mov    -0xb0(%rbp),%rcx
mov    -0xb8(%rbp),%r8
mov    -0xc0(%rbp),%r9
mov    -0xc8(%rbp),%r14
mov    -0xd0(%rbp),%rbx
mov    -0xd8(%rbp),%r11
mov    -0x14(%rbp),%r10d
sub    $0x1,%r10d
mov    -0x90(%rbp),%rax
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <rotateCoefDegree_mem@plt>
xor    %eax,%eax
sub    -0x54(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    15b3 <rotateCoefAll_mem+0x433>
mov    -0x50(%rbp),%edi
mov    -0x54(%rbp),%esi
mov    -0x14(%rbp),%edx
call   10a0 <seanindex@plt>
mov    %eax,-0x5c(%rbp)
mov    -0xb0(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xb8(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    153f <rotateCoefAll_mem+0x3bf>
jmp    15b8 <rotateCoefAll_mem+0x438>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    13eb <rotateCoefAll_mem+0x26b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1646 <rotateCoefAll_mem+0x4c6>
xor    %eax,%eax
sub    -0x54(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1633 <rotateCoefAll_mem+0x4b3>
mov    -0x50(%rbp),%edi
mov    -0x54(%rbp),%esi
mov    -0x14(%rbp),%edx
call   10a0 <seanindex@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movslq -0x5c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    15e3 <rotateCoefAll_mem+0x463>
jmp    1638 <rotateCoefAll_mem+0x4b8>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    15cf <rotateCoefAll_mem+0x44f>
add    $0xf0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateCoefAll_mem>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %r8,%rbx
mov    %rcx,0x30(%rsp)
mov    %rdx,%r15
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x28(%rsp)
mov    %esi,%r12d
mov    %edi,%r13d
lea    0x0(%r13,%r13,1),%eax
movslq %eax,%rdx
lea    (%r8,%rdx,8),%rsi
lea    -0x1(%r13,%r13,1),%ecx
imul   %ecx,%ecx
mov    %rsi,0x70(%rsp)
lea    (%rsi,%rcx,8),%rsi
mov    %rsi,0x68(%rsp)
lea    (%rsi,%rcx,8),%rcx
mov    %rcx,0x78(%rsp)
lea    -0x8(%rcx,%rdx,8),%rcx
mov    %rcx,0xa8(%rsp)
lea    -0x8(%rcx,%rdx,8),%rcx
mov    %rcx,0xa0(%rsp)
lea    -0x8(%rcx,%rdx,8),%rcx
mov    %rcx,0x98(%rsp)
lea    -0x8(%rcx,%rdx,8),%rcx
mov    %rcx,0x60(%rsp)
lea    -0x8(%rcx,%rdx,8),%rcx
mov    %rcx,0x58(%rsp)
lea    -0x8(%rcx,%rdx,8),%rcx
mov    %rdx,0x20(%rsp)
mov    %rcx,0x50(%rsp)
lea    (%rcx,%rdx,8),%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,0x48(%rsp)
test   %edi,%edi
mov    %r12,0x38(%rsp)
mov    %r8,0x18(%rsp)
jle    1333 <rotateCoefAll_mem+0x1b3>
cmp    $0x2,%eax
mov    $0x1,%r12d
cmovge %eax,%r12d
lea    -0x1(%r12),%rax
mov    %r12d,%r14d
and    $0x3,%r14d
cmp    $0x3,%rax
jae    126e <rotateCoefAll_mem+0xee>
xor    %ebp,%ebp
jmp    12f9 <rotateCoefAll_mem+0x179>
and    $0x7ffffffc,%r12d
xor    %ebp,%ebp
mov    0x18(%rsp),%rbx
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
call   1080 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
lea    0x1(%rbp),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1080 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x8(%rbx,%rbp,8)
lea    0x2(%rbp),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1080 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x10(%rbx,%rbp,8)
lea    0x3(%rbp),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1080 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x18(%rbx,%rbp,8)
add    $0x4,%rbp
cmp    %r12,%rbp
jne    1280 <rotateCoefAll_mem+0x100>
test   %r14,%r14
mov    0x38(%rsp),%r12
mov    0x18(%rsp),%rbx
je     1333 <rotateCoefAll_mem+0x1b3>
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
call   1080 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
add    $0xffffffffffffffff,%r14
jne    1310 <rotateCoefAll_mem+0x190>
movsd  0x8(%rsp),%xmm0
mulsd  0xcbf(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1070 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0xc0(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0xc8(%rsp)
mov    %r13d,%edi
movsd  0x28(%rsp),%xmm0
mov    0x60(%rsp),%rsi
mov    0x58(%rsp),%rdx
call   1090 <genExp_mem@plt>
mov    %r13d,%edi
movsd  0x10(%rsp),%xmm0
mov    0x50(%rsp),%rsi
mov    0x48(%rsp),%rbp
mov    %rbp,%rdx
call   1090 <genExp_mem@plt>
test   %r12d,%r12d
js     15b4 <rotateCoefAll_mem+0x434>
mov    %r15,0x10(%rsp)
mov    0x20(%rsp),%rax
lea    -0x8(,%rax,8),%rcx
ff
add    %rbp,%rcx
mov    %rcx,0x88(%rsp)
add    $0xffffffffffffffff,%rax
mov    %r13,0x40(%rsp)
lea    -0x1(%r13),%ecx
mov    %rcx,0x80(%rsp)
lea    0x1(%r12),%ecx
add    $0xffffffffffffffff,%rax
mov    %rax,0x20(%rsp)
mov    $0x1,%esi
xor    %eax,%eax
xor    %r12d,%r12d
mov    %rcx,0x90(%rsp)
mov    0x40(%rsp),%r13
nopl   0x0(%rax)
mov    %rsi,0x8(%rsp)
mov    %r12,0xb0(%rsp)
test   %rax,%rax
mov    %rax,%r14
je     1440 <rotateCoefAll_mem+0x2c0>
lea    (%rax,%rax,1),%edx
add    $0xffffffff,%edx
imul   %edx,%edx
shl    $0x3,%edx
mov    0x70(%rsp),%rdi
mov    0x68(%rsp),%rsi
call   1050 <memcpy@plt>
xor    %ebp,%ebp
mov    0x78(%rsp),%r15
mov    0x20(%rsp),%rbx
mov    0xb0(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%r12,%rbp,1),%edi
mov    %r14d,%esi
mov    %r13d,%edx
call   10a0 <seanindex@plt>
cltq
mov    0x10(%rsp),%rdx
movsd  (%rdx,%rax,8),%xmm0
movsd  %xmm0,(%r15)
mov    0x30(%rsp),%rdx
movsd  (%rdx,%rax,8),%xmm0
movsd  %xmm0,0x8(%r15,%rbx,8)
add    $0x8,%r15
add    $0x1,%rbp
cmp    %ebp,0x8(%rsp)
jne    1460 <rotateCoefAll_mem+0x2e0>
mov    %r14,%rcx
mov    %ecx,%ebp
add    $0x1,%rcx
mov    %rcx,0xb8(%rsp)
mov    %ebp,%edi
mov    0x70(%rsp),%rsi
mov    0x68(%rsp),%rbx
mov    %rbx,%rdx
lea    0xc0(%rsp),%rcx
mov    0x18(%rsp),%r8
mov    0x88(%rsp),%r9
call   1060 <wignerdmat_mem@plt>
sub    $0x8,%rsp
mov    %ebp,0x30(%rsp)
mov    %ebp,%edi
mov    0x80(%rsp),%rsi
mov    0xb0(%rsp),%rdx
mov    0xa8(%rsp),%r15
mov    %r15,%rcx
mov    0xa0(%rsp),%r14
mov    %r14,%r8
mov    0x68(%rsp),%r9
push   %rbx
push   0x90(%rsp)
push   0x60(%rsp)
push   0x70(%rsp)
push   0x80(%rsp)
call   1030 <rotateCoefDegree_mem@plt>
add    $0x30,%rsp
mov    0x30(%rsp),%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%r12,%rbx,1),%edi
mov    0x28(%rsp),%esi
mov    %r13d,%edx
call   10a0 <seanindex@plt>
movsd  (%r15,%rbx,8),%xmm0
cltq
mov    0x10(%rsp),%rcx
movsd  %xmm0,(%rcx,%rax,8)
movsd  (%r14,%rbx,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rax,8)
add    $0x1,%rbx
cmp    %ebx,0x8(%rsp)
jne    1540 <rotateCoefAll_mem+0x3c0>
add    $0xffffffffffffffff,%r12
mov    0x8(%rsp),%rsi
add    $0x2,%rsi
mov    0x90(%rsp),%rcx
mov    0xb8(%rsp),%rax
cmp    %rcx,%rax
jne    1410 <rotateCoefAll_mem+0x290>
mov    0x10(%rsp),%r15
mov    0x40(%rsp),%r13
mov    0x38(%rsp),%r12
cmp    %r13d,%ecx
jl     15be <rotateCoefAll_mem+0x43e>
jmp    1619 <rotateCoefAll_mem+0x499>
lea    0x1(%r12),%ecx
cmp    %r13d,%ecx
jge    1619 <rotateCoefAll_mem+0x499>
mov    0x30(%rsp),%rbx
jmp    15da <rotateCoefAll_mem+0x45a>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%r12),%ecx
cmp    %r13d,%ecx
je     1619 <rotateCoefAll_mem+0x499>
mov    %r12d,%eax
mov    %ecx,%r12d
mov    %eax,%ecx
not    %ecx
cmp    %ecx,%r12d
jl     15d0 <rotateCoefAll_mem+0x450>
mov    $0xfffffffe,%ebp
sub    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
mov    %r12d,%esi
mov    %r13d,%edx
call   10a0 <seanindex@plt>
cltq
movq   $0x0,(%r15,%rax,8)
movq   $0x0,(%rbx,%rax,8)
cmp    %r12d,%ebp
jl     15f0 <rotateCoefAll_mem+0x470>
jmp    15d0 <rotateCoefAll_mem+0x450>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @rotateCoefAll_mem(i32 %0, i32 %1, double %2, double %3, double %4, double* nocapture %5, double* nocapture %6, double* %7) {
%9 = alloca [2 x double]
%10 = bitcast [2 x double]* %9 to i8*
%11 = shl i32 %0, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %7, i64 %12
%14 = add nsw i32 %11, -1
%15 = mul nsw i32 %14, %14
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds double, double* %13, i64 %16
%18 = getelementptr inbounds double, double* %17, i64 %16
%19 = sext i32 %14 to i64
%20 = getelementptr inbounds double, double* %18, i64 %19
%21 = getelementptr inbounds double, double* %20, i64 %19
%22 = getelementptr inbounds double, double* %21, i64 %19
%23 = getelementptr inbounds double, double* %22, i64 %19
%24 = getelementptr inbounds double, double* %23, i64 %19
%25 = getelementptr inbounds double, double* %24, i64 %19
%26 = getelementptr inbounds double, double* %25, i64 %19
%27 = getelementptr inbounds double, double* %26, i64 %19
%28 = icmp sgt i32 %0, 0
br i1 %28, label %29, label %80
29: ; preds = %8
%30 = call i32 @llvm.smax.i32(i32 %11, i32 1)
%31 = zext i32 %30 to i64
%32 = add nsw i64 %31, -1
%33 = and i64 %31, 3
%34 = icmp ult i64 %32, 3
br i1 %34, label %66, label %35
35: ; preds = %29
%36 = and i64 %31, 2147483644
br label %37
37: ; preds = %37, %35
%38 = phi i64 [ 0, %35 ], [ %63, %37 ]
%39 = phi i64 [ 0, %35 ], [ %64, %37 ]
%40 = trunc i64 %38 to i32
%41 = sitofp i32 %40 to double
%42 = tail call i64 @sqrt(double %41)
%43 = sitofp i64 %42 to double
%44 = getelementptr inbounds double, double* %7, i64 %38
store double %43, double* %44
%45 = or i64 %38, 1
%46 = trunc i64 %45 to i32
%47 = sitofp i32 %46 to double
%48 = tail call i64 @sqrt(double %47)
%49 = sitofp i64 %48 to double
%50 = getelementptr inbounds double, double* %7, i64 %45
store double %49, double* %50
%51 = or i64 %38, 2
%52 = trunc i64 %51 to i32
%53 = sitofp i32 %52 to double
%54 = tail call i64 @sqrt(double %53)
%55 = sitofp i64 %54 to double
%56 = getelementptr inbounds double, double* %7, i64 %51
store double %55, double* %56
%57 = or i64 %38, 3
%58 = trunc i64 %57 to i32
%59 = sitofp i32 %58 to double
%60 = tail call i64 @sqrt(double %59)
%61 = sitofp i64 %60 to double
%62 = getelementptr inbounds double, double* %7, i64 %57
store double %61, double* %62
%63 = add nuw nsw i64 %38, 4
%64 = add i64 %39, 4
%65 = icmp eq i64 %64, %36
br i1 %65, label %66, label %37
66: ; preds = %37, %29
%67 = phi i64 [ 0, %29 ], [ %63, %37 ]
%68 = icmp eq i64 %33, 0
br i1 %68, label %80, label %69
69: ; preds = %66, %69
%70 = phi i64 [ %77, %69 ], [ %67, %66 ]
%71 = phi i64 [ %78, %69 ], [ 0, %66 ]
%72 = trunc i64 %70 to i32
%73 = sitofp i32 %72 to double
%74 = tail call i64 @sqrt(double %73)
%75 = sitofp i64 %74 to double
%76 = getelementptr inbounds double, double* %7, i64 %70
store double %75, double* %76
%77 = add nuw nsw i64 %70, 1
%78 = add i64 %71, 1
%79 = icmp eq i64 %78, %33
br i1 %79, label %80, label %69
80: ; preds = %66, %69, %8
%81 = fmul double %3, 5.000000e-01
%82 = tail call i64 @cos(double %81)
%83 = sitofp i64 %82 to double
%84 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
store double %83, double* %84
%85 = tail call i64 @sin(double %81)
%86 = sitofp i64 %85 to double
%87 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
store double %86, double* %87
%88 = tail call i32 @genExp_mem(i32 %0, double %2, double* %23, double* %24)
%89 = tail call i32 @genExp_mem(i32 %0, double %4, double* %25, double* %26)
%90 = icmp slt i32 %1, 0
br i1 %90, label %91, label %93
91: ; preds = %80
%92 = add nsw i32 %1, 1
br label %101
93: ; preds = %80
%94 = add nsw i32 %0, -1
%95 = add nuw i32 %1, 1
%96 = zext i32 %95 to i64
br label %104
97: ; preds = %138
%98 = add nsw i64 %107, -1
%99 = add nuw i32 %106, 1
%100 = icmp eq i64 %135, %96
br i1 %100, label %101, label %104
101: ; preds = %97, %91
%102 = phi i32 [ %92, %91 ], [ %95, %97 ]
%103 = icmp slt i32 %102, %0
br i1 %103, label %156, label %169
104: ; preds = %93, %97
%105 = phi i64 [ 0, %93 ], [ %135, %97 ]
%106 = phi i32 [ 1, %93 ], [ %99, %97 ]
%107 = phi i64 [ 0, %93 ], [ %98, %97 ]
%108 = icmp eq i64 %105, 0
br i1 %108, label %116, label %109
109: ; preds = %104
%110 = trunc i64 %105 to i32
%111 = shl i32 %110, 1
%112 = add nsw i32 %111, -1
%113 = shl i32 %112, 3
%114 = mul i32 %113, %112
%115 = call i32 @memcpy(double* %13, double* %17, i32 %114)
br label %116
116: ; preds = %104, %109
%117 = trunc i64 %105 to i32
br label %118
118: ; preds = %116, %118
%119 = phi i64 [ %107, %116 ], [ %130, %118 ]
%120 = trunc i64 %119 to i32
%121 = call i32 @seanindex(i32 %120, i32 %117, i32 %0)
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double, double* %5, i64 %122
%124 = load double, double* %123
%125 = add nsw i64 %119, %105
%126 = getelementptr inbounds double, double* %18, i64 %125
store double %124, double* %126
%127 = getelementptr inbounds double, double* %6, i64 %122
%128 = load double, double* %127
%129 = getelementptr inbounds double, double* %20, i64 %125
store double %128, double* %129
%130 = add nsw i64 %119, 1
%131 = trunc i64 %130 to i32
%132 = icmp eq i32 %106, %131
br i1 %132, label %133, label %118
133: ; preds = %118
%134 = trunc i64 %105 to i32
%135 = add nuw nsw i64 %105, 1
%136 = call i32 @wignerdmat_mem(i32 %134, double* %13, double* %17, double* %84, double* %7, double* %27)
%137 = call i32 @rotateCoefDegree_mem(i32 %134, double* %18, double* %20, double* %21, double* %22, double* %23, double* %24, double* %25, double* %26, i32 %94, double* %17)
br label %138
138: ; preds = %133, %138
%139 = phi i64 [ %107, %133 ], [ %150, %138 ]
%140 = trunc i64 %139 to i32
%141 = call i32 @seanindex(i32 %140, i32 %134, i32 %0)
%142 = add nsw i64 %139, %105
%143 = getelementptr inbounds double, double* %21, i64 %142
%144 = load double, double* %143
%145 = sext i32 %141 to i64
%146 = getelementptr inbounds double, double* %5, i64 %145
store double %144, double* %146
%147 = getelementptr inbounds double, double* %22, i64 %142
%148 = load double, double* %147
%149 = getelementptr inbounds double, double* %6, i64 %145
store double %148, double* %149
%150 = add nsw i64 %139, 1
%151 = trunc i64 %150 to i32
%152 = icmp eq i32 %106, %151
br i1 %152, label %97, label %138
153: ; preds = %161, %156
%154 = add i32 %157, 1
%155 = icmp eq i32 %154, %0
br i1 %155, label %169, label %156
156: ; preds = %101, %153
%157 = phi i32 [ %154, %153 ], [ %102, %101 ]
%158 = phi i32 [ %157, %153 ], [ %1, %101 ]
%159 = xor i32 %158, -1
%160 = icmp slt i32 %157, %159
br i1 %160, label %153, label %161
161: ; preds = %156, %161
%162 = phi i32 [ %167, %161 ], [ %159, %156 ]
%163 = call i32 @seanindex(i32 %162, i32 %157, i32 %0)
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %5, i64 %164
store double 0.000000e+00, double* %165
%166 = getelementptr inbounds double, double* %6, i64 %164
store double 0.000000e+00, double* %166
%167 = add nsw i32 %162, 1
%168 = icmp slt i32 %162, %157
br i1 %168, label %161, label %153
169: ; preds = %153, %101
ret void
}