#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*/ CheckPointer(float *, char *);
int /*<<< orphan*/ IsPowerOfTwo(unsigned int);
unsigned int NumberOfBitsNeeded(unsigned int);
unsigned int ReverseBits(unsigned int, unsigned int);
double cos(double);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
double sin(double);
int /*<<< orphan*/ stderr;
void fft_float(unsigned NumSamples, int InverseTransform, float *RealIn,
               float *ImagIn, float *RealOut, float *ImagOut) {
  unsigned NumBits;
  unsigned i, j, k, n;
  unsigned BlockSize, BlockEnd;
  double angle_numerator = 2.0 * (3.14159265358979323846);
  double tr, ti;
  if (!IsPowerOfTwo(NumSamples)) {
    fprintf(stderr, "Error in fft():  NumSamples=%u is not power of two\n",
            NumSamples);
    exit(1);
  }
  if (InverseTransform)
    angle_numerator = -angle_numerator;
  CheckPointer(RealIn, "RealIn");
  CheckPointer(RealOut, "RealOut");
  CheckPointer(ImagOut, "ImagOut");
  NumBits = NumberOfBitsNeeded(NumSamples);
  for (i = 0; i < NumSamples; i++) {
    j = ReverseBits(i, NumBits);
    RealOut[j] = RealIn[i];
    ImagOut[j] = (ImagIn == NULL) ? 0.0 : ImagIn[i];
  }
  BlockEnd = 1;
  for (BlockSize = 2; BlockSize <= NumSamples; BlockSize <<= 1) {
    double delta_angle = angle_numerator / (double)BlockSize;
    double sm2 = sin(-2 * delta_angle);
    double sm1 = sin(-delta_angle);
    double cm2 = cos(-2 * delta_angle);
    double cm1 = cos(-delta_angle);
    double w = 2 * cm1;
    double ar[3], ai[3];
    double temp;
    for (i = 0; i < NumSamples; i += BlockSize) {
      ar[2] = cm2;
      ar[1] = cm1;
      ai[2] = sm2;
      ai[1] = sm1;
      for (j = i, n = 0; n < BlockEnd; j++, n++) {
        ar[0] = w * ar[1] - ar[2];
        ar[2] = ar[1];
        ar[1] = ar[0];
        ai[0] = w * ai[1] - ai[2];
        ai[2] = ai[1];
        ai[1] = ai[0];
        k = j + BlockEnd;
        tr = ar[0] * RealOut[k] - ai[0] * ImagOut[k];
        ti = ar[0] * ImagOut[k] + ai[0] * RealOut[k];
        RealOut[k] = RealOut[j] - tr;
        ImagOut[k] = ImagOut[j] - ti;
        RealOut[j] += tr;
        ImagOut[j] += ti;
      }
    }
    BlockEnd = BlockSize;
  }
  if (InverseTransform) {
    double denom = (double)NumSamples;
    for (i = 0; i < NumSamples; i++) {
      RealOut[i] /= denom;
      ImagOut[i] /= denom;
    }
  }
}


x86 assembly (clang, -O0):
<fft_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movsd  0xe57(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <IsPowerOfTwo@plt>
cmp    $0x0,%eax
jne    11e1 <fft_float+0x61>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe46(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
cmpl   $0x0,-0x8(%rbp)
je     120c <fft_float+0x8c>
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe35(%rip),%rsi
call   10a0 <CheckPointer@plt>
mov    -0x20(%rbp),%rdi
lea    0xe2c(%rip),%rsi
call   10a0 <CheckPointer@plt>
mov    -0x28(%rbp),%rdi
lea    0xe24(%rip),%rsi
call   10a0 <CheckPointer@plt>
mov    -0x4(%rbp),%edi
call   1030 <NumberOfBitsNeeded@plt>
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    12d9 <fft_float+0x159>
mov    -0x30(%rbp),%edi
mov    -0x2c(%rbp),%esi
call   1080 <ReverseBits@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
cmpq   $0x0,-0x18(%rbp)
jne    129b <fft_float+0x11b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
jmp    12b3 <fft_float+0x133>
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
cvtsd2ss %xmm0,%xmm0
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    124e <fft_float+0xce>
movl   $0x1,-0x44(%rbp)
movl   $0x2,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x4(%rbp),%eax
ja     162d <fft_float+0x4ad>
movsd  -0x50(%rbp),%xmm0
mov    -0x40(%rbp),%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xcff(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
call   1060 <sin@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1060 <sin@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  0xcc2(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xc7a(%rip),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1619 <fft_float+0x499>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x44(%rbp),%eax
jae    1606 <fft_float+0x486>
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0xa0(%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  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0xc8(%rbp),%xmm2
ff
movsd  -0xc0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x34(%rbp),%eax
add    -0x44(%rbp),%eax
mov    %eax,-0x38(%rbp)
movsd  -0xb0(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  -0xd0(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm3
cvtss2sd %xmm3,%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0xb0(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  -0xd0(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm3
cvtss2sd %xmm3,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  -0x58(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  -0x60(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
movsd  -0x58(%rbp),%xmm1
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
movsd  -0x60(%rbp),%xmm1
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13f5 <fft_float+0x275>
jmp    160b <fft_float+0x48b>
mov    -0x40(%rbp),%eax
add    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    13a5 <fft_float+0x225>
mov    -0x40(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    12e7 <fft_float+0x167>
cmpl   $0x0,-0x8(%rbp)
je     16b7 <fft_float+0x537>
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    16b2 <fft_float+0x532>
movsd  -0xe0(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
movsd  -0xe0(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    164e <fft_float+0x4ce>
jmp    16b7 <fft_float+0x537>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fft_float>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,%r14
mov    %r8,%rbx
mov    %rcx,%r12
mov    %rdx,%r13
mov    %esi,%ebp
mov    %edi,%r15d
call   1040 <IsPowerOfTwo@plt>
test   %eax,%eax
je     1536 <fft_float+0x3b6>
mov    %ebp,0x1c(%rsp)
test   %ebp,%ebp
sete   0x30(%rsp)
lea    0xe9e(%rip),%rsi
mov    %r13,0x8(%rsp)
mov    %r13,%rdi
call   10a0 <CheckPointer@plt>
lea    0xe91(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <CheckPointer@plt>
lea    0xe8a(%rip),%rsi
mov    %r14,%rdi
call   10a0 <CheckPointer@plt>
mov    %r15d,%edi
call   1030 <NumberOfBitsNeeded@plt>
test   %r15d,%r15d
je     1527 <fft_float+0x3a7>
mov    %eax,%ebp
mov    %r15d,%eax
mov    %rax,0x10(%rsp)
xor    %ecx,%ecx
mov    0x30(%rsp),%al
mov    %al,%cl
lea    0xded(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,0x48(%rsp)
xor    %r13d,%r13d
jmp    1252 <fft_float+0xd2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movss  (%r12,%r13,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x10(%rsp),%rcx
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14,%rax,4)
add    $0x1,%r13
cmp    %r13,%rcx
je     1278 <fft_float+0xf8>
mov    %r13d,%edi
mov    %ebp,%esi
call   1080 <ReverseBits@plt>
mov    0x8(%rsp),%rcx
movss  (%rcx,%r13,4),%xmm0
mov    %eax,%eax
movss  %xmm0,(%rbx,%rax,4)
test   %r12,%r12
jne    1230 <fft_float+0xb0>
xorps  %xmm0,%xmm0
jmp    123a <fft_float+0xba>
cmp    $0x2,%r15d
jae    12af <fft_float+0x12f>
cmpl   $0x0,0x1c(%rsp)
mov    0x10(%rsp),%rsi
je     1527 <fft_float+0x3a7>
test   %r15d,%r15d
je     1527 <fft_float+0x3a7>
xorps  %xmm0,%xmm0
cvtsi2sd %rsi,%xmm0
cmp    $0x4,%esi
jae    144d <fft_float+0x2cd>
xor    %eax,%eax
jmp    14f0 <fft_float+0x370>
mov    $0x1,%ebp
mov    $0x2,%eax
jmp    12cc <fft_float+0x14c>
nopl   0x0(%rax,%rax,1)
lea    (%r12,%r12,1),%eax
mov    %r12d,%ebp
cmp    %r15d,%eax
ja     127e <fft_float+0xfe>
mov    %eax,%r12d
mov    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x48(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
mulsd  0xd2b(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
call   1060 <sin@plt>
movapd %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <sin@plt>
xorps  0xcf8(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movsd  0x20(%rsp),%xmm0
call   1070 <cos@plt>
movaps %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <cos@plt>
movapd 0x50(%rsp),%xmm9
movapd 0x30(%rsp),%xmm8
unpcklpd 0x20(%rsp),%xmm8
unpcklpd %xmm0,%xmm9
addsd  %xmm0,%xmm0
unpcklpd %xmm0,%xmm0
xor    %eax,%eax
mov    %ebp,%ecx
jmp    136f <fft_float+0x1ef>
add    %r12d,%eax
add    %r12d,%ecx
cmp    %r15d,%eax
jae    12c0 <fft_float+0x140>
test   %ebp,%ebp
je     1360 <fft_float+0x1e0>
xor    %edx,%edx
movapd %xmm9,%xmm1
movapd %xmm8,%xmm3
nop
movapd %xmm1,%xmm2
movapd %xmm0,%xmm1
mulpd  %xmm2,%xmm1
lea    (%rax,%rdx,1),%esi
subpd  %xmm3,%xmm1
lea    (%rcx,%rdx,1),%edi
movss  (%rbx,%rdi,4),%xmm3
xorps  %xmm4,%xmm4
cvtss2sd %xmm3,%xmm4
movss  (%r14,%rdi,4),%xmm3
xorps  %xmm5,%xmm5
cvtss2sd %xmm3,%xmm5
movapd %xmm1,%xmm6
movapd %xmm1,%xmm3
unpckhpd %xmm1,%xmm3
mulsd  %xmm5,%xmm6
movapd %xmm3,%xmm7
mulsd  %xmm4,%xmm7
subsd  %xmm6,%xmm7
movss  (%rbx,%rsi,4),%xmm6
cvtss2sd %xmm6,%xmm6
subsd  %xmm7,%xmm6
cvtsd2ss %xmm6,%xmm6
mulsd  %xmm1,%xmm4
mulsd  %xmm5,%xmm3
movss  %xmm6,(%rbx,%rdi,4)
movss  (%r14,%rsi,4),%xmm5
addsd  %xmm4,%xmm3
xorps  %xmm4,%xmm4
cvtss2sd %xmm5,%xmm4
subsd  %xmm3,%xmm4
cvtsd2ss %xmm4,%xmm4
movss  %xmm4,(%r14,%rdi,4)
movss  (%rbx,%rsi,4),%xmm4
cvtss2sd %xmm4,%xmm4
addsd  %xmm7,%xmm4
cvtsd2ss %xmm4,%xmm4
movss  %xmm4,(%rbx,%rsi,4)
movss  (%r14,%rsi,4),%xmm4
cvtss2sd %xmm4,%xmm4
addsd  %xmm3,%xmm4
xorps  %xmm3,%xmm3
cvtsd2ss %xmm4,%xmm3
movss  %xmm3,(%r14,%rsi,4)
add    $0x1,%edx
movapd %xmm2,%xmm3
cmp    %edx,%ebp
jne    1380 <fft_float+0x200>
jmp    1360 <fft_float+0x1e0>
lea    (%r14,%rsi,4),%rax
cmp    %rbx,%rax
jbe    1466 <fft_float+0x2e6>
lea    (%rbx,%rsi,4),%rax
cmp    %r14,%rax
jbe    1466 <fft_float+0x2e6>
xor    %eax,%eax
jmp    14f0 <fft_float+0x370>
mov    %esi,%eax
and    $0xfffffffc,%eax
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    0x0(,%rsi,4),%rcx
and    $0xfffffffffffffff0,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cvtps2pd 0x8(%rbx,%rdx,1),%xmm2
cvtps2pd (%rbx,%rdx,1),%xmm3
divpd  %xmm1,%xmm3
divpd  %xmm1,%xmm2
cvtpd2ps %xmm2,%xmm2
cvtpd2ps %xmm3,%xmm3
unpcklpd %xmm2,%xmm3
movupd %xmm3,(%rbx,%rdx,1)
cvtps2pd 0x8(%r14,%rdx,1),%xmm2
cvtps2pd (%r14,%rdx,1),%xmm3
divpd  %xmm1,%xmm3
divpd  %xmm1,%xmm2
cvtpd2ps %xmm2,%xmm2
cvtpd2ps %xmm3,%xmm3
unpcklpd %xmm2,%xmm3
movupd %xmm3,(%r14,%rdx,1)
add    $0x10,%rdx
cmp    %rdx,%rcx
jne    1490 <fft_float+0x310>
cmp    %rsi,%rax
je     1527 <fft_float+0x3a7>
cs nopw 0x0(%rax,%rax,1)
nop
movss  (%rbx,%rax,4),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,(%rbx,%rax,4)
movss  (%r14,%rax,4),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,(%r14,%rax,4)
add    $0x1,%rax
cmp    %rax,%rsi
jne    14f0 <fft_float+0x370>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2aa3(%rip),%rax
mov    (%rax),%edi
lea    0xae2(%rip),%rsi
mov    %r15d,%edx
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Error in fft(): NumSamples=%u is not power of two\0A\00"
@.str.1 = [7 x i8] c"RealIn\00"
@.str.2 = [8 x i8] c"RealOut\00"
@.str.3 = [8 x i8] c"ImagOut\00"
define void @fft_float(i32 %0, i32 %1, float* %2, float* %3, float* %4, float* %5) {
%7 = tail call i32 @IsPowerOfTwo(i32 %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %0)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %6
%14 = icmp eq i32 %1, 0
%15 = select i1 %14, double 0x401921FB54442D18, double 0xC01921FB54442D18
%16 = tail call i32 @CheckPointer(float* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%17 = tail call i32 @CheckPointer(float* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%18 = tail call i32 @CheckPointer(float* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%19 = tail call i32 @NumberOfBitsNeeded(i32 %0)
%20 = icmp eq i32 %0, 0
br i1 %20, label %167, label %21
21: ; preds = %13
%22 = icmp eq float* %3, null
%23 = zext i32 %0 to i64
br label %26
24: ; preds = %38
%25 = icmp ult i32 %0, 2
br i1 %25, label %115, label %44
26: ; preds = %21, %38
%27 = phi i64 [ 0, %21 ], [ %42, %38 ]
%28 = trunc i64 %27 to i32
%29 = tail call i32 @ReverseBits(i32 %28, i32 %19)
%30 = getelementptr inbounds float, float* %2, i64 %27
%31 = load float, float* %30
%32 = zext i32 %29 to i64
%33 = getelementptr inbounds float, float* %4, i64 %32
store float %31, float* %33
br i1 %22, label %38, label %34
34: ; preds = %26
%35 = getelementptr inbounds float, float* %3, i64 %27
%36 = load float, float* %35
%37 = fpext float %36 to double
br label %38
38: ; preds = %26, %34
%39 = phi double [ %37, %34 ], [ 0.000000e+00, %26 ]
%40 = fptrunc double %39 to float
%41 = getelementptr inbounds float, float* %5, i64 %32
store float %40, float* %41
%42 = add nuw nsw i64 %27, 1
%43 = icmp eq i64 %42, %23
br i1 %43, label %24, label %26
44: ; preds = %24, %112
%45 = phi i32 [ %113, %112 ], [ 2, %24 ]
%46 = phi i32 [ %45, %112 ], [ 1, %24 ]
%47 = uitofp i32 %45 to double
%48 = fdiv double %15, %47
%49 = fmul double %48, -2.000000e+00
%50 = tail call double @sin(double %49)
%51 = tail call double @sin(double %48)
%52 = fneg double %51
%53 = tail call double @cos(double %49)
%54 = tail call double @cos(double %48)
%55 = fmul double %54, 2.000000e+00
%56 = icmp eq i32 %46, 0
%57 = insertelement <2 x double> poison, double %50, i64 0
%58 = insertelement <2 x double> %57, double %53, i64 1
%59 = insertelement <2 x double> poison, double %52, i64 0
%60 = insertelement <2 x double> %59, double %54, i64 1
%61 = insertelement <2 x double> poison, double %55, i64 0
%62 = shufflevector <2 x double> %61, <2 x double> poison, <2 x i32> zeroinitializer
br label %63
63: ; preds = %44, %108
%64 = phi i32 [ %46, %44 ], [ %111, %108 ]
%65 = phi i32 [ 0, %44 ], [ %109, %108 ]
br i1 %56, label %108, label %66
66: ; preds = %63, %66
%67 = phi i32 [ %106, %66 ], [ %65, %63 ]
%68 = phi <2 x double> [ %71, %66 ], [ %60, %63 ]
%69 = phi <2 x double> [ %68, %66 ], [ %58, %63 ]
%70 = fneg <2 x double> %69
%71 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %62, <2 x double> %68, <2 x double> %70)
%72 = add i32 %67, %46
%73 = zext i32 %72 to i64
%74 = getelementptr inbounds float, float* %4, i64 %73
%75 = load float, float* %74
%76 = fpext float %75 to double
%77 = getelementptr inbounds float, float* %5, i64 %73
%78 = load float, float* %77
%79 = fpext float %78 to double
%80 = extractelement <2 x double> %71, i64 0
%81 = fneg double %80
%82 = fmul double %81, %79
%83 = extractelement <2 x double> %71, i64 1
%84 = tail call double @llvm.fmuladd.f64(double %83, double %76, double %82)
%85 = fmul double %80, %76
%86 = tail call double @llvm.fmuladd.f64(double %83, double %79, double %85)
%87 = zext i32 %67 to i64
%88 = getelementptr inbounds float, float* %4, i64 %87
%89 = load float, float* %88
%90 = fpext float %89 to double
%91 = fsub double %90, %84
%92 = fptrunc double %91 to float
store float %92, float* %74
%93 = getelementptr inbounds float, float* %5, i64 %87
%94 = load float, float* %93
%95 = fpext float %94 to double
%96 = fsub double %95, %86
%97 = fptrunc double %96 to float
store float %97, float* %77
%98 = load float, float* %88
%99 = fpext float %98 to double
%100 = fadd double %84, %99
%101 = fptrunc double %100 to float
store float %101, float* %88
%102 = load float, float* %93
%103 = fpext float %102 to double
%104 = fadd double %86, %103
%105 = fptrunc double %104 to float
store float %105, float* %93
%106 = add i32 %67, 1
%107 = icmp eq i32 %106, %64
br i1 %107, label %108, label %66
108: ; preds = %66, %63
%109 = add i32 %65, %45
%110 = icmp ult i32 %109, %0
%111 = add i32 %64, %45
br i1 %110, label %63, label %112
112: ; preds = %108
%113 = shl i32 %45, 1
%114 = icmp ugt i32 %113, %0
br i1 %114, label %115, label %44
115: ; preds = %112, %24
br i1 %14, label %167, label %116
116: ; preds = %115
%117 = uitofp i32 %0 to double
br i1 %20, label %167, label %118
118: ; preds = %116
%119 = zext i32 %0 to i64
%120 = icmp ult i32 %0, 4
br i1 %120, label %151, label %121
121: ; preds = %118
%122 = getelementptr float, float* %4, i64 %23
%123 = getelementptr float, float* %5, i64 %23
%124 = icmp ugt float* %123, %4
%125 = icmp ugt float* %122, %5
%126 = and i1 %124, %125
br i1 %126, label %151, label %127
127: ; preds = %121
%128 = and i64 %23, 4294967292
%129 = insertelement <4 x double> poison, double %117, i64 0
%130 = shufflevector <4 x double> %129, <4 x double> poison, <4 x i32> zeroinitializer
br label %131
131: ; preds = %131, %127
%132 = phi i64 [ 0, %127 ], [ %147, %131 ]
%133 = getelementptr inbounds float, float* %4, i64 %132
%134 = bitcast float* %133 to <4 x float>*
%135 = load <4 x float>, <4 x float>* %134
%136 = fpext <4 x float> %135 to <4 x double>
%137 = fdiv <4 x double> %136, %130
%138 = fptrunc <4 x double> %137 to <4 x float>
%139 = bitcast float* %133 to <4 x float>*
store <4 x float> %138, <4 x float>* %139
%140 = getelementptr inbounds float, float* %5, i64 %132
%141 = bitcast float* %140 to <4 x float>*
%142 = load <4 x float>, <4 x float>* %141
%143 = fpext <4 x float> %142 to <4 x double>
%144 = fdiv <4 x double> %143, %130
%145 = fptrunc <4 x double> %144 to <4 x float>
%146 = bitcast float* %140 to <4 x float>*
store <4 x float> %145, <4 x float>* %146
%147 = add nuw i64 %132, 4
%148 = icmp eq i64 %147, %128
br i1 %148, label %149, label %131
149: ; preds = %131
%150 = icmp eq i64 %128, %23
br i1 %150, label %167, label %151
151: ; preds = %121, %118, %149
%152 = phi i64 [ 0, %121 ], [ 0, %118 ], [ %128, %149 ]
br label %153
153: ; preds = %151, %153
%154 = phi i64 [ %165, %153 ], [ %152, %151 ]
%155 = getelementptr inbounds float, float* %4, i64 %154
%156 = load float, float* %155
%157 = fpext float %156 to double
%158 = fdiv double %157, %117
%159 = fptrunc double %158 to float
store float %159, float* %155
%160 = getelementptr inbounds float, float* %5, i64 %154
%161 = load float, float* %160
%162 = fpext float %161 to double
%163 = fdiv double %162, %117
%164 = fptrunc double %163 to float
store float %164, float* %160
%165 = add nuw nsw i64 %154, 1
%166 = icmp eq i64 %165, %119
br i1 %166, label %167, label %153
167: ; preds = %153, %149, %13, %116, %115
ret void
}