void twiddleFFT_4(int sofarRadix, int radix, int remainRadix, int groupOffset,
                  double twiddleRe[], double twiddleIm[], double yRe[],
                  double yIm[]) {
  int yIndx[4];
  int groupNo, blockNo, adr;
  double t1_re, t1_im, t2_re, t2_im;
  double m2_re, m2_im, m3_re, m3_im;
  double yr, yi, twr, twi;
  double ar0, ar1, ar2, ar3;
  double ai0, ai1, ai2, ai3;
  adr = groupOffset;
  for (groupNo = 0; groupNo < remainRadix; groupNo++) {
    for (blockNo = 0; blockNo < radix; blockNo++) {
      yIndx[blockNo] = adr;
      adr = adr + sofarRadix;
    }
    ar0 = yRe[yIndx[0]];
    ai0 = yIm[yIndx[0]];
    yr = yRe[yIndx[2]];
    yi = yIm[yIndx[2]];
    twr = twiddleRe[2];
    twi = twiddleIm[2];
    ar2 = twr * yr - twi * yi;
    ai2 = twr * yi + twi * yr;
    t1_re = ar0 + ar2;
    m2_re = ar0 - ar2;
    t1_im = ai0 + ai2;
    m2_im = ai0 - ai2;
    yr = yRe[yIndx[1]];
    yi = yIm[yIndx[1]];
    twr = twiddleRe[1];
    twi = twiddleIm[1];
    ar1 = twr * yr - twi * yi;
    ai1 = twr * yi + twi * yr;
    yr = yRe[yIndx[3]];
    yi = yIm[yIndx[3]];
    twr = twiddleRe[3];
    twi = twiddleIm[3];
    ar3 = twr * yr - twi * yi;
    ai3 = twr * yi + twi * yr;
    t2_re = ar1 + ar3;
    m3_im = ar3 - ar1;
    t2_im = ai1 + ai3;
    m3_re = ai1 - ai3;
    yRe[yIndx[0]] = t1_re + t2_re;
    yRe[yIndx[1]] = m2_re + m3_re;
    yRe[yIndx[2]] = t1_re - t2_re;
    yRe[yIndx[3]] = m2_re - m3_re;
    yIm[yIndx[0]] = t1_im + t2_im;
    yIm[yIndx[1]] = m2_im + m3_im;
    yIm[yIndx[2]] = t1_im - t2_im;
    yIm[yIndx[3]] = m2_im - m3_im;
    groupOffset = groupOffset + sofarRadix * radix;
    adr = groupOffset;
  }
}


x86 assembly (clang, -O0):
<twiddleFFT_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1568 <twiddleFFT_4+0x468>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1172 <twiddleFFT_4+0x72>
mov    -0x3c(%rbp),%ecx
movslq -0x38(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x3c(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1144 <twiddleFFT_4+0x44>
mov    0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x90(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
addsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
subsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x68(%rbp)
movsd  -0xc8(%rbp),%xmm0
ff
addsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
movsd  -0xc8(%rbp),%xmm0
ff
subsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x70(%rbp)
mov    0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x90(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x90(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
addsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x58(%rbp)
movsd  -0xc0(%rbp),%xmm0
ff
subsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0x80(%rbp)
movsd  -0xd0(%rbp),%xmm0
ff
addsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
movsd  -0xd0(%rbp),%xmm0
ff
subsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
mov    0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
mov    0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
mov    0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
subsd  -0x78(%rbp),%xmm0
mov    0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
subsd  -0x80(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1131 <twiddleFFT_4+0x31>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twiddleFFT_4>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r9,-0x8(%rsp)
mov    %r8,-0x10(%rsp)
mov    %esi,-0x5c(%rsp)
mov    %edx,-0x44(%rsp)
test   %edx,%edx
jle    1454 <twiddleFFT_4+0x354>
mov    0x40(%rsp),%r10
mov    0x38(%rsp),%rax
mov    -0x5c(%rsp),%edx
mov    %edx,%esi
imul   %edi,%esi
mov    %esi,-0x48(%rsp)
mov    %edx,%ebx
mov    %ebx,%edx
and    $0xfffffff8,%edx
lea    -0x8(%rdx),%rsi
mov    %rsi,-0x18(%rsp)
shr    $0x3,%rsi
add    $0x1,%rsi
mov    %rdx,-0x38(%rsp)
imul   %edi,%edx
mov    %rdx,-0x30(%rsp)
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa 0xe8f(%rip),%xmm1
pmuludq %xmm0,%xmm1
pshufd $0xe8,%xmm1,%xmm1
movdqa 0xe8e(%rip),%xmm2
pmuludq %xmm0,%xmm2
pshufd $0xe8,%xmm2,%xmm8
punpckldq %xmm1,%xmm8
pslld  $0x2,%xmm0
mov    %esi,%ebp
and    $0x3,%ebp
and    $0xfffffffffffffffc,%rsi
mov    %rsi,-0x28(%rsp)
mov    %rbp,-0x20(%rsp)
shl    $0x5,%rbp
xor    %r13d,%r13d
mov    -0x10(%rsp),%r14
mov    -0x8(%rsp),%r8
jmp    1343 <twiddleFFT_4+0x243>
nop
mov    -0x58(%rsp),%edx
mov    %edx,-0x40(%rsp)
mov    -0x54(%rsp),%edx
mov    %edx,-0x3c(%rsp)
mov    -0x50(%rsp),%r11d
mov    -0x4c(%rsp),%r12d
movslq -0x40(%rsp),%r15
movsd  (%rax,%r15,8),%xmm10
movsd  (%r10,%r15,8),%xmm9
movslq %r11d,%rdx
movsd  (%rax,%rdx,8),%xmm1
movsd  (%r10,%rdx,8),%xmm6
movsd  0x8(%r14),%xmm5
movsd  0x10(%r14),%xmm12
movsd  0x8(%r8),%xmm11
movsd  0x10(%r8),%xmm7
movapd %xmm12,%xmm4
mulsd  %xmm6,%xmm12
mulsd  %xmm7,%xmm6
mulsd  %xmm1,%xmm4
subsd  %xmm6,%xmm4
mulsd  %xmm7,%xmm1
addsd  %xmm1,%xmm12
movapd %xmm10,%xmm7
addsd  %xmm4,%xmm7
subsd  %xmm4,%xmm10
movapd %xmm9,%xmm13
addsd  %xmm12,%xmm13
movslq -0x3c(%rsp),%rsi
movsd  (%rax,%rsi,8),%xmm4
movsd  (%r10,%rsi,8),%xmm2
movapd %xmm5,%xmm1
mulsd  %xmm2,%xmm5
mulsd  %xmm11,%xmm2
mulsd  %xmm4,%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm11,%xmm4
addsd  %xmm4,%xmm5
movslq %r12d,%r9
movsd  (%rax,%r9,8),%xmm4
movsd  (%r10,%r9,8),%xmm3
movsd  0x18(%r14),%xmm2
movsd  0x18(%r8),%xmm11
movapd %xmm2,%xmm6
mulsd  %xmm3,%xmm2
mulsd  %xmm11,%xmm3
mulsd  %xmm4,%xmm6
subsd  %xmm3,%xmm6
mulsd  %xmm11,%xmm4
addsd  %xmm4,%xmm2
movapd %xmm1,%xmm3
addsd  %xmm6,%xmm3
movapd %xmm5,%xmm4
addsd  %xmm2,%xmm4
subsd  %xmm2,%xmm5
movapd %xmm7,%xmm2
addsd  %xmm3,%xmm2
movsd  %xmm2,(%rax,%r15,8)
movapd %xmm10,%xmm2
addsd  %xmm5,%xmm2
movsd  %xmm2,(%rax,%rsi,8)
subsd  %xmm3,%xmm7
movsd  %xmm7,(%rax,%rdx,8)
subsd  %xmm5,%xmm10
movsd  %xmm10,(%rax,%r9,8)
movapd %xmm13,%xmm2
addsd  %xmm4,%xmm2
movsd  %xmm2,(%r10,%r15,8)
subsd  %xmm12,%xmm9
subsd  %xmm1,%xmm6
movapd %xmm9,%xmm1
addsd  %xmm6,%xmm1
movsd  %xmm1,(%r10,%rsi,8)
subsd  %xmm4,%xmm13
movsd  %xmm13,(%r10,%rdx,8)
subsd  %xmm6,%xmm9
movsd  %xmm9,(%r10,%r9,8)
add    -0x48(%rsp),%ecx
add    $0x1,%r13d
cmp    -0x44(%rsp),%r13d
je     1454 <twiddleFFT_4+0x354>
cmpl   $0x0,-0x5c(%rsp)
jle    11da <twiddleFFT_4+0xda>
cmpl   $0x8,-0x5c(%rsp)
jae    1360 <twiddleFFT_4+0x260>
xor    %edx,%edx
mov    %ecx,%esi
jmp    1440 <twiddleFFT_4+0x340>
xchg   %ax,%ax
movd   %ecx,%xmm1
pshufd $0x0,%xmm1,%xmm2
paddd  %xmm8,%xmm2
cmpq   $0x18,-0x18(%rsp)
jae    137a <twiddleFFT_4+0x27a>
xor    %edx,%edx
jmp    13ea <twiddleFFT_4+0x2ea>
mov    -0x28(%rsp),%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movdqa %xmm2,-0x58(%rsp,%rdx,4)
paddd  %xmm0,%xmm2
movdqa %xmm2,-0x48(%rsp,%rdx,4)
paddd  %xmm0,%xmm2
movdqa %xmm2,-0x38(%rsp,%rdx,4)
paddd  %xmm0,%xmm2
movdqa %xmm2,-0x28(%rsp,%rdx,4)
paddd  %xmm0,%xmm2
movdqa %xmm2,-0x18(%rsp,%rdx,4)
paddd  %xmm0,%xmm2
movdqa %xmm2,-0x8(%rsp,%rdx,4)
paddd  %xmm0,%xmm2
movdqa %xmm2,0x8(%rsp,%rdx,4)
paddd  %xmm0,%xmm2
movdqa %xmm2,0x18(%rsp,%rdx,4)
add    $0x20,%rdx
paddd  %xmm0,%xmm2
add    $0xfffffffffffffffc,%rsi
jne    1390 <twiddleFFT_4+0x290>
cmpq   $0x0,-0x20(%rsp)
je     141c <twiddleFFT_4+0x31c>
lea    -0x48(%rsp),%rsi
lea    (%rsi,%rdx,4),%rdx
xor    %esi,%esi
nopl   (%rax)
movdqa %xmm2,-0x10(%rdx,%rsi,1)
paddd  %xmm0,%xmm2
movdqa %xmm2,(%rdx,%rsi,1)
paddd  %xmm0,%xmm2
add    $0x20,%rsi
cmp    %rsi,%rbp
jne    1400 <twiddleFFT_4+0x300>
cmp    %rbx,-0x38(%rsp)
je     11c0 <twiddleFFT_4+0xc0>
mov    -0x30(%rsp),%rdx
lea    (%rcx,%rdx,1),%esi
mov    -0x38(%rsp),%rdx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %esi,-0x58(%rsp,%rdx,4)
add    %edi,%esi
add    $0x1,%rdx
cmp    %rdx,%rbx
jne    1440 <twiddleFFT_4+0x340>
jmp    11c0 <twiddleFFT_4+0xc0>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @twiddleFFT_4(i32 %0, i32 %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture %5, double* nocapture %6, double* nocapture %7) {
%9 = alloca [4 x i32]
%10 = bitcast [4 x i32]* %9 to i8*
%11 = icmp sgt i32 %2, 0
br i1 %11, label %12, label %189
12: ; preds = %8
%13 = icmp sgt i32 %1, 0
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
%16 = getelementptr inbounds double, double* %4, i64 2
%17 = getelementptr inbounds double, double* %5, i64 2
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
%19 = getelementptr inbounds double, double* %4, i64 1
%20 = getelementptr inbounds double, double* %5, i64 1
%21 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
%22 = getelementptr inbounds double, double* %4, i64 3
%23 = getelementptr inbounds double, double* %5, i64 3
%24 = mul nsw i32 %1, %0
%25 = zext i32 %1 to i64
%26 = and i64 %25, 4294967288
%27 = add nsw i64 %26, -8
%28 = lshr exact i64 %27, 3
%29 = add nuw nsw i64 %28, 1
%30 = icmp ult i32 %1, 8
%31 = and i64 %25, 4294967288
%32 = trunc i64 %31 to i32
%33 = mul i32 %32, %0
%34 = insertelement <4 x i32> poison, i32 %0, i64 0
%35 = shufflevector <4 x i32> %34, <4 x i32> poison, <4 x i32> zeroinitializer
%36 = mul <4 x i32> %35, <i32 0, i32 1, i32 2, i32 3>
%37 = shl i32 %0, 2
%38 = insertelement <4 x i32> poison, i32 %37, i64 0
%39 = shufflevector <4 x i32> %38, <4 x i32> poison, <4 x i32> zeroinitializer
%40 = and i64 %29, 3
%41 = icmp ult i64 %27, 24
%42 = and i64 %29, 4611686018427387900
%43 = icmp eq i64 %40, 0
%44 = icmp eq i64 %31, %25
br label %45
45: ; preds = %12, %124
%46 = phi i32 [ undef, %12 ], [ %125, %124 ]
%47 = phi i32 [ undef, %12 ], [ %126, %124 ]
%48 = phi i32 [ undef, %12 ], [ %127, %124 ]
%49 = phi i32 [ undef, %12 ], [ %128, %124 ]
%50 = phi i32 [ %3, %12 ], [ %186, %124 ]
%51 = phi i32 [ 0, %12 ], [ %187, %124 ]
br i1 %13, label %52, label %124
52: ; preds = %45
br i1 %30, label %109, label %53
53: ; preds = %52
%54 = add i32 %50, %33
%55 = insertelement <4 x i32> poison, i32 %50, i64 0
%56 = shufflevector <4 x i32> %55, <4 x i32> poison, <4 x i32> zeroinitializer
%57 = add <4 x i32> %56, %36
br i1 %41, label %92, label %58
58: ; preds = %53, %58
%59 = phi i64 [ %88, %58 ], [ 0, %53 ]
%60 = phi <4 x i32> [ %89, %58 ], [ %57, %53 ]
%61 = phi i64 [ %90, %58 ], [ 0, %53 ]
%62 = add <4 x i32> %60, %39
%63 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 %59
%64 = bitcast i32* %63 to <4 x i32>*
store <4 x i32> %60, <4 x i32>* %64
%65 = getelementptr inbounds i32, i32* %63, i64 4
%66 = bitcast i32* %65 to <4 x i32>*
store <4 x i32> %62, <4 x i32>* %66
%67 = or i64 %59, 8
%68 = add <4 x i32> %62, %39
%69 = add <4 x i32> %68, %39
%70 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 %67
%71 = bitcast i32* %70 to <4 x i32>*
store <4 x i32> %68, <4 x i32>* %71
%72 = getelementptr inbounds i32, i32* %70, i64 4
%73 = bitcast i32* %72 to <4 x i32>*
store <4 x i32> %69, <4 x i32>* %73
%74 = or i64 %59, 16
%75 = add <4 x i32> %69, %39
%76 = add <4 x i32> %75, %39
%77 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 %74
%78 = bitcast i32* %77 to <4 x i32>*
store <4 x i32> %75, <4 x i32>* %78
%79 = getelementptr inbounds i32, i32* %77, i64 4
%80 = bitcast i32* %79 to <4 x i32>*
store <4 x i32> %76, <4 x i32>* %80
%81 = or i64 %59, 24
%82 = add <4 x i32> %76, %39
%83 = add <4 x i32> %82, %39
%84 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 %81
%85 = bitcast i32* %84 to <4 x i32>*
store <4 x i32> %82, <4 x i32>* %85
%86 = getelementptr inbounds i32, i32* %84, i64 4
%87 = bitcast i32* %86 to <4 x i32>*
store <4 x i32> %83, <4 x i32>* %87
%88 = add nuw i64 %59, 32
%89 = add <4 x i32> %83, %39
%90 = add i64 %61, 4
%91 = icmp eq i64 %90, %42
br i1 %91, label %92, label %58
92: ; preds = %58, %53
%93 = phi i64 [ 0, %53 ], [ %88, %58 ]
%94 = phi <4 x i32> [ %57, %53 ], [ %89, %58 ]
br i1 %43, label %108, label %95
95: ; preds = %92, %95
%96 = phi i64 [ %104, %95 ], [ %93, %92 ]
%97 = phi <4 x i32> [ %105, %95 ], [ %94, %92 ]
%98 = phi i64 [ %106, %95 ], [ 0, %92 ]
%99 = add <4 x i32> %97, %39
%100 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 %96
%101 = bitcast i32* %100 to <4 x i32>*
store <4 x i32> %97, <4 x i32>* %101
%102 = getelementptr inbounds i32, i32* %100, i64 4
%103 = bitcast i32* %102 to <4 x i32>*
store <4 x i32> %99, <4 x i32>* %103
%104 = add nuw i64 %96, 8
%105 = add <4 x i32> %99, %39
%106 = add i64 %98, 1
%107 = icmp eq i64 %106, %40
br i1 %107, label %108, label %95
108: ; preds = %95, %92
br i1 %44, label %119, label %109
109: ; preds = %52, %108
%110 = phi i64 [ 0, %52 ], [ %31, %108 ]
%111 = phi i32 [ %50, %52 ], [ %54, %108 ]
br label %112
112: ; preds = %109, %112
%113 = phi i64 [ %117, %112 ], [ %110, %109 ]
%114 = phi i32 [ %116, %112 ], [ %111, %109 ]
%115 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 %113
store i32 %114, i32* %115
%116 = add nsw i32 %114, %0
%117 = add nuw nsw i64 %113, 1
%118 = icmp eq i64 %117, %25
br i1 %118, label %119, label %112
119: ; preds = %112, %108
%120 = load i32, i32* %14
%121 = load i32, i32* %15
%122 = load i32, i32* %18
%123 = load i32, i32* %21
br label %124
124: ; preds = %119, %45
%125 = phi i32 [ %123, %119 ], [ %46, %45 ]
%126 = phi i32 [ %122, %119 ], [ %47, %45 ]
%127 = phi i32 [ %121, %119 ], [ %48, %45 ]
%128 = phi i32 [ %120, %119 ], [ %49, %45 ]
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double, double* %6, i64 %129
%131 = load double, double* %130
%132 = getelementptr inbounds double, double* %7, i64 %129
%133 = load double, double* %132
%134 = sext i32 %127 to i64
%135 = getelementptr inbounds double, double* %6, i64 %134
%136 = load double, double* %135
%137 = getelementptr inbounds double, double* %7, i64 %134
%138 = load double, double* %137
%139 = load double, double* %16
%140 = load double, double* %17
%141 = fneg double %140
%142 = fmul double %138, %141
%143 = tail call double @llvm.fmuladd.f64(double %139, double %136, double %142)
%144 = fmul double %136, %140
%145 = tail call double @llvm.fmuladd.f64(double %139, double %138, double %144)
%146 = fadd double %131, %143
%147 = fsub double %131, %143
%148 = fadd double %133, %145
%149 = fsub double %133, %145
%150 = sext i32 %126 to i64
%151 = getelementptr inbounds double, double* %6, i64 %150
%152 = load double, double* %151
%153 = getelementptr inbounds double, double* %7, i64 %150
%154 = load double, double* %153
%155 = load double, double* %19
%156 = load double, double* %20
%157 = fneg double %156
%158 = fmul double %154, %157
%159 = tail call double @llvm.fmuladd.f64(double %155, double %152, double %158)
%160 = fmul double %152, %156
%161 = tail call double @llvm.fmuladd.f64(double %155, double %154, double %160)
%162 = sext i32 %125 to i64
%163 = getelementptr inbounds double, double* %6, i64 %162
%164 = load double, double* %163
%165 = getelementptr inbounds double, double* %7, i64 %162
%166 = load double, double* %165
%167 = load double, double* %22
%168 = load double, double* %23
%169 = fneg double %168
%170 = fmul double %166, %169
%171 = tail call double @llvm.fmuladd.f64(double %167, double %164, double %170)
%172 = fmul double %164, %168
%173 = tail call double @llvm.fmuladd.f64(double %167, double %166, double %172)
%174 = fadd double %159, %171
%175 = fsub double %171, %159
%176 = fadd double %161, %173
%177 = fsub double %161, %173
%178 = fadd double %146, %174
store double %178, double* %130
%179 = fadd double %147, %177
store double %179, double* %151
%180 = fsub double %146, %174
store double %180, double* %135
%181 = fsub double %147, %177
store double %181, double* %163
%182 = fadd double %148, %176
store double %182, double* %132
%183 = fadd double %149, %175
store double %183, double* %153
%184 = fsub double %148, %176
store double %184, double* %137
%185 = fsub double %149, %175
store double %185, double* %165
%186 = add nsw i32 %50, %24
%187 = add nuw nsw i32 %51, 1
%188 = icmp eq i32 %187, %2
br i1 %188, label %189, label %45
189: ; preds = %124, %8
ret void
}