void cftfsub(int n, float *a, int *ip, int nw, float *w) {
  void bitrv2(int n, int *ip, float *a);
  void bitrv216(float *a);
  void bitrv208(float *a);
  void cftf1st(int n, float *a, float *w);
  void cftrec4(int n, float *a, int nw, float *w);
  void cftleaf(int n, int isplt, float *a, int nw, float *w);
  void cftfx41(int n, float *a, int nw, float *w);
  void cftf161(float *a, float *w);
  void cftf081(float *a, float *w);
  void cftf040(float *a);
  void cftx020(float *a);
  if (n > 8) {
    if (n > 32) {
      cftf1st(n, a, &w[nw - (n >> 2)]);
      if (n > 512) {
        cftrec4(n, a, nw, w);
      } else if (n > 128) {
        cftleaf(n, 1, a, nw, w);
      } else {
        cftfx41(n, a, nw, w);
      }
      bitrv2(n, ip, a);
    } else if (n == 32) {
      cftf161(a, &w[nw - 8]);
      bitrv216(a);
    } else {
      cftf081(a, w);
      bitrv208(a);
    }
  } else if (n == 8) {
    cftf040(a);
  } else if (n == 4) {
    cftx020(a);
  }
}


x86 assembly (clang, -O0):
<cftfsub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
cmpl   $0x8,-0x4(%rbp)
jle    12d2 <cftfsub+0x122>
cmpl   $0x20,-0x4(%rbp)
jle    127e <cftfsub+0xce>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x1c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
sub    %ecx,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdx
call   10b0 <cftf1st@plt>
cmpl   $0x200,-0x4(%rbp)
jle    1227 <cftfsub+0x77>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1040 <cftrec4@plt>
jmp    1269 <cftfsub+0xb9>
cmpl   $0x80,-0x4(%rbp)
jle    1251 <cftfsub+0xa1>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    $0x1,%esi
call   1050 <cftleaf@plt>
jmp    1264 <cftfsub+0xb4>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1090 <cftfx41@plt>
jmp    1269 <cftfsub+0xb9>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   10a0 <bitrv2@plt>
jmp    12cd <cftfsub+0x11d>
cmpl   $0x20,-0x4(%rbp)
jne    12b2 <cftfsub+0x102>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%eax
sub    $0x8,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
call   1030 <cftf161@plt>
mov    -0x10(%rbp),%rdi
call   1080 <bitrv216@plt>
jmp    12c8 <cftfsub+0x118>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1060 <cftf081@plt>
mov    -0x10(%rbp),%rdi
call   10d0 <bitrv208@plt>
jmp    12cd <cftfsub+0x11d>
jmp    1307 <cftfsub+0x157>
cmpl   $0x8,-0x4(%rbp)
jne    12ea <cftfsub+0x13a>
mov    -0x10(%rbp),%rdi
call   1070 <cftf040@plt>
jmp    1302 <cftfsub+0x152>
cmpl   $0x4,-0x4(%rbp)
jne    12fd <cftfsub+0x14d>
mov    -0x10(%rbp),%rdi
call   10c0 <cftx020@plt>
jmp    1302 <cftfsub+0x152>
jmp    1307 <cftfsub+0x157>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cftfsub>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x9,%edi
jl     1208 <cftfsub+0x58>
mov    %r8,%r15
mov    %ecx,%r12d
cmp    $0x21,%ebp
jb     1222 <cftfsub+0x72>
mov    %rdx,%r14
mov    %ebp,%eax
shr    $0x2,%eax
mov    %r12d,%ecx
sub    %eax,%ecx
movslq %ecx,%rax
lea    (%r15,%rax,4),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
call   10b0 <cftf1st@plt>
mov    %ebp,%edi
cmp    $0x201,%ebp
jb     1263 <cftfsub+0xb3>
mov    %rbx,%rsi
mov    %r12d,%edx
mov    %r15,%rcx
call   1040 <cftrec4@plt>
jmp    12a9 <cftfsub+0xf9>
cmp    $0x4,%ebp
je     124a <cftfsub+0x9a>
cmp    $0x8,%ebp
jne    125a <cftfsub+0xaa>
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <cftf040@plt>
cmp    $0x20,%ebp
jne    1280 <cftfsub+0xd0>
movslq %r12d,%rax
lea    (%r15,%rax,4),%rsi
add    $0xffffffffffffffe0,%rsi
mov    %rbx,%rdi
call   1030 <cftf161@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <bitrv216@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    10c0 <cftx020@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x81,%ebp
jb     129b <cftfsub+0xeb>
mov    $0x1,%esi
mov    %rbx,%rdx
mov    %r12d,%ecx
mov    %r15,%r8
call   1050 <cftleaf@plt>
jmp    12a9 <cftfsub+0xf9>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <cftf081@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    10d0 <bitrv208@plt>
mov    %rbx,%rsi
mov    %r12d,%edx
mov    %r15,%rcx
call   1090 <cftfx41@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    10a0 <bitrv2@plt>

LLVM IR (-O0):
define void @cftfsub(i32 %0, float* %1, i32* %2, i32 %3, float* %4) {
%6 = alloca i32
%7 = alloca float*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca float*
store i32 %0, i32* %6
store float* %1, float** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store float* %4, float** %10
%11 = load i32, i32* %6
%12 = icmp sgt i32 %11, 8
br i1 %12, label %13, label %68
13: ; preds = %5
%14 = load i32, i32* %6
%15 = icmp sgt i32 %14, 32
br i1 %15, label %16, label %51
16: ; preds = %13
%17 = load i32, i32* %6
%18 = load float*, float** %7
%19 = load float*, float** %10
%20 = load i32, i32* %9
%21 = load i32, i32* %6
%22 = ashr i32 %21, 2
%23 = sub nsw i32 %20, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds float, float* %19, i64 %24
%26 = load i32, i32* %6
%27 = icmp sgt i32 %26, 512
br i1 %27, label %28, label %33
28: ; preds = %16
%29 = load i32, i32* %6
%30 = load float*, float** %7
%31 = load i32, i32* %9
%32 = load float*, float** %10
br label %47
33: ; preds = %16
%34 = load i32, i32* %6
%35 = icmp sgt i32 %34, 128
br i1 %35, label %36, label %41
36: ; preds = %33
%37 = load i32, i32* %6
%38 = load float*, float** %7
%39 = load i32, i32* %9
%40 = load float*, float** %10
br label %46
41: ; preds = %33
%42 = load i32, i32* %6
%43 = load float*, float** %7
%44 = load i32, i32* %9
%45 = load float*, float** %10
br label %46
46: ; preds = %41, %36
br label %47
47: ; preds = %46, %28
%48 = load i32, i32* %6
%49 = load i32*, i32** %8
%50 = load float*, float** %7
br label %67
51: ; preds = %13
%52 = load i32, i32* %6
%53 = icmp eq i32 %52, 32
br i1 %53, label %54, label %62
54: ; preds = %51
%55 = load float*, float** %7
%56 = load float*, float** %10
%57 = load i32, i32* %9
%58 = sub nsw i32 %57, 8
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds float, float* %56, i64 %59
%61 = load float*, float** %7
br label %66
62: ; preds = %51
%63 = load float*, float** %7
%64 = load float*, float** %10
%65 = load float*, float** %7
br label %66
66: ; preds = %62, %54
br label %67
67: ; preds = %66, %47
br label %80
68: ; preds = %5
%69 = load i32, i32* %6
%70 = icmp eq i32 %69, 8
br i1 %70, label %71, label %73
71: ; preds = %68
%72 = load float*, float** %7
br label %79
73: ; preds = %68
%74 = load i32, i32* %6
%75 = icmp eq i32 %74, 4
br i1 %75, label %76, label %78
76: ; preds = %73
%77 = load float*, float** %7
br label %78
78: ; preds = %76, %73
br label %79
79: ; preds = %78, %71
br label %80
80: ; preds = %79, %67
ret void
}

LLVM IR (-O2):
define void @cftfsub(i32 %0, float* %1, i32* %2, i32 %3, float* %4) {
%6 = icmp sgt i32 %0, 8
br i1 %6, label %7, label %28
7: ; preds = %5
%8 = icmp ugt i32 %0, 32
br i1 %8, label %9, label %21
9: ; preds = %7
%10 = lshr i32 %0, 2
%11 = sub nsw i32 %3, %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds float, float* %4, i64 %12
tail call void @cftf1st(i32 %0, float* %1, float* %13)
%14 = icmp ugt i32 %0, 512
br i1 %14, label %15, label %16
15: ; preds = %9
tail call void @cftrec4(i32 %0, float* %1, i32 %3, float* %4)
br label %20
16: ; preds = %9
%17 = icmp ugt i32 %0, 128
br i1 %17, label %18, label %19
18: ; preds = %16
tail call void @cftleaf(i32 %0, i32 1, float* %1, i32 %3, float* %4)
br label %20
19: ; preds = %16
tail call void @cftfx41(i32 %0, float* %1, i32 %3, float* %4)
br label %20
20: ; preds = %18, %19, %15
tail call void @bitrv2(i32 %0, i32* %2, float* %1)
br label %31
21: ; preds = %7
%22 = icmp eq i32 %0, 32
br i1 %22, label %23, label %27
23: ; preds = %21
%24 = add nsw i32 %3, -8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds float, float* %4, i64 %25
tail call void @cftf161(float* %1, float* %26)
tail call void @bitrv216(float* %1)
br label %31
27: ; preds = %21
tail call void @cftf081(float* %1, float* %4)
tail call void @bitrv208(float* %1)
br label %31
28: ; preds = %5
switch i32 %0, label %31 [
i32 8, label %29
i32 4, label %30
]
29: ; preds = %28
tail call void @cftf040(float* %1)
br label %31
30: ; preds = %28
tail call void @cftx020(float* %1)
br label %31
31: ; preds = %28, %29, %30, %20, %27, %23
ret void
}