#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*/ FFT_bitreverse(int, double *);
int int_log2(int);
double sin(double);
void FFT_transform_internal(int N, double *data, int direction) {
  int n = N / 2;
  int bit = 0;
  int logn;
  int dual = 1;
  if (n == 1)
    return;
  logn = int_log2(n);
  if (N == 0)
    return;
  FFT_bitreverse(N, data);
  for (bit = 0; bit < logn; bit++, dual *= 2) {
    double w_real = 1.0;
    double w_imag = 0.0;
    int a;
    int b;
    double theta = 2.0 * direction * 3.1415926535897932 / (2.0 * (double)dual);
    double s = sin(theta);
    double t = sin(theta / 2.0);
    double s2 = 2.0 * t * t;
    for (a = 0, b = 0; b < n; b += 2 * dual) {
      int i = 2 * b;
      int j = 2 * (b + dual);
      double wd_real = data[j];
      double wd_imag = data[j + 1];
      data[j] = data[i] - wd_real;
      data[j + 1] = data[i + 1] - wd_imag;
      data[i] += wd_real;
      data[i + 1] += wd_imag;
    }
    for (a = 1; a < dual; a++) {
      {
        double tmp_real = w_real - s * w_imag - s2 * w_real;
        double tmp_imag = w_imag + s * w_real - s2 * w_imag;
        w_real = tmp_real;
        w_imag = tmp_imag;
      }
      for (b = 0; b < n; b += 2 * dual) {
        int i = 2 * (b + a);
        int j = 2 * (b + a + dual);
        double z1_real = data[j];
        double z1_imag = data[j + 1];
        double wd_real = w_real * z1_real - w_imag * z1_imag;
        double wd_imag = w_real * z1_imag + w_imag * z1_real;
        data[j] = data[i] - wd_real;
        data[j + 1] = data[i + 1] - wd_imag;
        data[i] += wd_real;
        data[i + 1] += wd_imag;
      }
    }
  }
}


x86 assembly (clang, -O0):
<FFT_transform_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x24(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1170 <FFT_transform_internal+0x40>
jmp    1595 <FFT_transform_internal+0x465>
mov    -0x18(%rbp),%edi
call   1050 <int_log2@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    118a <FFT_transform_internal+0x5a>
jmp    1595 <FFT_transform_internal+0x465>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <FFT_bitreverse@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1595 <FFT_transform_internal+0x465>
movsd  0xe5f(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xe35(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe31(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x24(%rbp),%xmm2
movsd  0xe18(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xdef(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  0xdd9(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    131a <FFT_transform_internal+0x1ea>
mov    -0x40(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x64(%rbp)
mov    -0x40(%rbp),%eax
add    -0x24(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x68(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x64(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x68(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x64(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
add    -0x40(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    1244 <FFT_transform_internal+0x114>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1579 <FFT_transform_internal+0x449>
movsd  -0x30(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1566 <FFT_transform_internal+0x436>
mov    -0x40(%rbp),%eax
add    -0x3c(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x40(%rbp),%eax
add    -0x3c(%rbp),%eax
add    -0x24(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x90(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x90(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    -0x90(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0x38(%rbp),%xmm1
mulsd  -0xa0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0x38(%rbp),%xmm1
mulsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x10(%rbp),%rax
movslq -0x8c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0xa8(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
movslq -0x90(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x8c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0xb0(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x90(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xa8(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
movslq -0x8c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xb0(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x8c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
add    -0x40(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    13ef <FFT_transform_internal+0x2bf>
jmp    156b <FFT_transform_internal+0x43b>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1321 <FFT_transform_internal+0x1f1>
jmp    157e <FFT_transform_internal+0x44e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    119d <FFT_transform_internal+0x6d>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FFT_transform_internal>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %edi,%eax
and    $0xfffffffe,%eax
cmp    $0x2,%eax
je     13db <FFT_transform_internal+0x2ab>
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %edi,%r13d
mov    %edi,%r12d
shr    $0x1f,%r12d
add    %edi,%r12d
sar    %r12d
mov    %r12d,%edi
call   1050 <int_log2@plt>
test   %r13d,%r13d
je     13db <FFT_transform_internal+0x2ab>
mov    %eax,%ebp
mov    %r13d,%edi
mov    %rbx,%rsi
call   1040 <FFT_bitreverse@plt>
test   %ebp,%ebp
jle    13db <FFT_transform_internal+0x2ab>
cvtsi2sd %r15d,%xmm0
addsd  %xmm0,%xmm0
mulsd  0xe67(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movslq %r12d,%r14
mov    $0x1,%r12d
xor    %r15d,%r15d
mov    %ebp,0xc(%rsp)
jmp    11d4 <FFT_transform_internal+0xa4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%ebp
add    $0x1,%r15d
mov    %r8d,%r12d
cmp    %ebp,%r15d
je     13db <FFT_transform_internal+0x2ab>
xorps  %xmm1,%xmm1
cvtsi2sd %r12d,%xmm1
addsd  %xmm1,%xmm1
movsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
call   1030 <sin@plt>
movapd %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0xdff(%rip),%xmm0
call   1030 <sin@plt>
cmp    $0x2,%r13d
jl     1281 <FFT_transform_internal+0x151>
lea    (%r12,%r12,1),%eax
cltq
lea    0x0(,%r12,4),%r8d
lea    (%r12,%r12,1),%r9d
add    $0x1,%r9d
xor    %esi,%esi
xor    %edi,%edi
xchg   %ax,%ax
lea    (%rax,%rsi,1),%ecx
movslq %ecx,%rcx
movsd  (%rbx,%rcx,8),%xmm1
lea    (%r9,%rsi,1),%edx
movslq %edx,%rdx
movsd  (%rbx,%rdx,8),%xmm2
movslq %esi,%rsi
movupd (%rbx,%rsi,8),%xmm3
movapd %xmm3,%xmm4
subsd  %xmm1,%xmm4
movsd  %xmm4,(%rbx,%rcx,8)
unpcklpd %xmm2,%xmm1
addpd  %xmm3,%xmm1
unpckhpd %xmm3,%xmm3
subsd  %xmm2,%xmm3
movsd  %xmm3,(%rbx,%rdx,8)
movupd %xmm1,(%rbx,%rsi,8)
add    %rax,%rdi
add    %r8d,%esi
cmp    %r14,%rdi
jl     1230 <FFT_transform_internal+0x100>
cmp    $0x1,%r12d
movapd 0xd92(%rip),%xmm10
jbe    13d0 <FFT_transform_internal+0x2a0>
movapd 0x20(%rsp),%xmm1
movapd %xmm1,%xmm8
xorpd  %xmm10,%xmm8
movapd %xmm0,%xmm9
mulsd  0xd5e(%rip),%xmm9
mulsd  %xmm0,%xmm9
lea    (%r12,%r12,1),%r8d
movslq %r8d,%rcx
unpcklpd %xmm9,%xmm9
unpcklpd %xmm1,%xmm8
lea    0x0(,%r12,4),%r11d
mov    $0x1,%r10d
mov    $0x3,%r9d
movsd  0xd34(%rip),%xmm3
jmp    1301 <FFT_transform_internal+0x1d1>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r10d
add    $0x2,%r9d
cmp    %r12d,%r10d
je     11c0 <FFT_transform_internal+0x90>
movapd %xmm3,%xmm0
shufpd $0x1,%xmm3,%xmm0
mulpd  %xmm8,%xmm0
addpd  %xmm3,%xmm0
mulpd  %xmm9,%xmm3
addpd  %xmm0,%xmm3
cmp    $0x2,%r13d
jl     12f0 <FFT_transform_internal+0x1c0>
movapd %xmm3,%xmm1
unpckhpd %xmm3,%xmm1
movapd %xmm1,%xmm4
xorpd  %xmm10,%xmm4
mov    %r9d,%eax
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rax),%esi
lea    (%rcx,%rax,1),%ebp
lea    (%rcx,%rax,1),%edx
add    $0xffffffff,%edx
movslq %edx,%rdx
movsd  (%rbx,%rdx,8),%xmm5
movslq %ebp,%rbp
movsd  (%rbx,%rbp,8),%xmm6
movapd %xmm6,%xmm7
mulsd  %xmm4,%xmm7
movapd %xmm3,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm7,%xmm0
mulsd  %xmm1,%xmm5
mulsd  %xmm3,%xmm6
addsd  %xmm5,%xmm6
movslq %esi,%rsi
movsd  (%rbx,%rsi,8),%xmm5
movapd %xmm5,%xmm7
subsd  %xmm0,%xmm7
movsd  %xmm7,(%rbx,%rdx,8)
cltq
movsd  (%rbx,%rax,8),%xmm2
movapd %xmm2,%xmm7
subsd  %xmm6,%xmm7
movsd  %xmm7,(%rbx,%rbp,8)
addsd  %xmm5,%xmm0
movsd  %xmm0,(%rbx,%rsi,8)
addsd  %xmm2,%xmm6
movsd  %xmm6,(%rbx,%rax,8)
add    %rcx,%rdi
add    %r11d,%eax
cmp    %r14,%rdi
jl     1340 <FFT_transform_internal+0x210>
jmp    12f0 <FFT_transform_internal+0x1c0>
nopl   0x0(%rax,%rax,1)
add    %r12d,%r12d
mov    %r12d,%r8d
jmp    11c4 <FFT_transform_internal+0x94>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @FFT_transform_internal(i32 %0, double* %1, i32 %2) {
%4 = sdiv i32 %0, 2
%5 = and i32 %0, -2
%6 = icmp eq i32 %5, 2
br i1 %6, label %120, label %7
7: ; preds = %3
%8 = tail call i32 @int_log2(i32 %4)
%9 = icmp eq i32 %0, 0
br i1 %9, label %120, label %10
10: ; preds = %7
%11 = tail call i32 @FFT_bitreverse(i32 %0, double* %1)
%12 = icmp sgt i32 %8, 0
br i1 %12, label %13, label %120
13: ; preds = %10
%14 = sitofp i32 %2 to double
%15 = fmul double %14, 2.000000e+00
%16 = fmul double %15, 0x400921FB54442D18
%17 = icmp sgt i32 %0, 1
%18 = sext i32 %4 to i64
br label %19
19: ; preds = %13, %116
%20 = phi i32 [ 0, %13 ], [ %118, %116 ]
%21 = phi i32 [ 1, %13 ], [ %117, %116 ]
%22 = sitofp i32 %21 to double
%23 = fmul double %22, 2.000000e+00
%24 = fdiv double %16, %23
%25 = tail call double @sin(double %24)
%26 = fmul double %24, 5.000000e-01
%27 = tail call double @sin(double %26)
br i1 %17, label %28, label %31
28: ; preds = %19
%29 = shl i32 %21, 1
%30 = sext i32 %29 to i64
br label %45
31: ; preds = %45, %19
%32 = icmp ugt i32 %21, 1
br i1 %32, label %35, label %33
33: ; preds = %31
%34 = shl nuw nsw i32 %21, 1
br label %116
35: ; preds = %31
%36 = fneg double %25
%37 = fmul double %27, -2.000000e+00
%38 = fmul double %27, %37
%39 = shl i32 %21, 1
%40 = sext i32 %39 to i64
%41 = insertelement <2 x double> poison, double %38, i64 0
%42 = shufflevector <2 x double> %41, <2 x double> poison, <2 x i32> zeroinitializer
%43 = insertelement <2 x double> poison, double %36, i64 0
%44 = insertelement <2 x double> %43, double %25, i64 1
br label %72
45: ; preds = %28, %45
%46 = phi i64 [ 0, %28 ], [ %70, %45 ]
%47 = trunc i64 %46 to i32
%48 = shl nsw i32 %47, 1
%49 = add nsw i32 %21, %47
%50 = shl nsw i32 %49, 1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %1, i64 %51
%53 = load double, double* %52
%54 = or i32 %50, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds double, double* %1, i64 %55
%57 = load double, double* %56
%58 = sext i32 %48 to i64
%59 = getelementptr inbounds double, double* %1, i64 %58
%60 = bitcast double* %59 to <2 x double>*
%61 = load <2 x double>, <2 x double>* %60
%62 = extractelement <2 x double> %61, i64 0
%63 = fsub double %62, %53
store double %63, double* %52
%64 = extractelement <2 x double> %61, i64 1
%65 = fsub double %64, %57
store double %65, double* %56
%66 = insertelement <2 x double> poison, double %53, i64 0
%67 = insertelement <2 x double> %66, double %57, i64 1
%68 = fadd <2 x double> %67, %61
%69 = bitcast double* %59 to <2 x double>*
store <2 x double> %68, <2 x double>* %69
%70 = add nsw i64 %46, %30
%71 = icmp slt i64 %70, %18
br i1 %71, label %45, label %31
72: ; preds = %35, %113
%73 = phi i32 [ 1, %35 ], [ %114, %113 ]
%74 = phi <2 x double> [ <double 1.000000e+00, double 0.000000e+00>, %35 ], [ %77, %113 ]
%75 = shufflevector <2 x double> %74, <2 x double> undef, <2 x i32> <i32 1, i32 0>
%76 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %44, <2 x double> %75, <2 x double> %74)
%77 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %42, <2 x double> %74, <2 x double> %76)
br i1 %17, label %78, label %113
78: ; preds = %72
%79 = extractelement <2 x double> %77, i64 1
%80 = fneg double %79
%81 = extractelement <2 x double> %77, i64 0
br label %82
82: ; preds = %78, %82
%83 = phi i64 [ 0, %78 ], [ %111, %82 ]
%84 = trunc i64 %83 to i32
%85 = add nsw i32 %73, %84
%86 = shl nsw i32 %85, 1
%87 = add nsw i32 %85, %21
%88 = shl nsw i32 %87, 1
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %1, i64 %89
%91 = load double, double* %90
%92 = or i32 %88, 1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %1, i64 %93
%95 = load double, double* %94
%96 = fmul double %95, %80
%97 = tail call double @llvm.fmuladd.f64(double %81, double %91, double %96)
%98 = fmul double %79, %91
%99 = tail call double @llvm.fmuladd.f64(double %81, double %95, double %98)
%100 = sext i32 %86 to i64
%101 = getelementptr inbounds double, double* %1, i64 %100
%102 = load double, double* %101
%103 = fsub double %102, %97
store double %103, double* %90
%104 = or i32 %86, 1
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %1, i64 %105
%107 = load double, double* %106
%108 = fsub double %107, %99
store double %108, double* %94
%109 = fadd double %102, %97
store double %109, double* %101
%110 = fadd double %99, %107
store double %110, double* %106
%111 = add nsw i64 %83, %40
%112 = icmp slt i64 %111, %18
br i1 %112, label %82, label %113
113: ; preds = %82, %72
%114 = add nuw nsw i32 %73, 1
%115 = icmp eq i32 %114, %21
br i1 %115, label %116, label %72
116: ; preds = %113, %33
%117 = phi i32 [ %34, %33 ], [ %39, %113 ]
%118 = add nuw nsw i32 %20, 1
%119 = icmp eq i32 %118, %8
br i1 %119, label %120, label %19
120: ; preds = %116, %10, %7, %3
ret void
}