void cftfsub(int n, double *a) {
  void bitrv2(int n, double *a);
  void bitrv216(double *a);
  void bitrv208(double *a);
  void cftmdl1(int n, double *a);
  void cftrec4(int n, double *a);
  void cftleaf(int n, int isplt, double *a);
  void cftfx41(int n, double *a);
  void cftf161(double *a);
  void cftf081(double *a);
  void cftf040(double *a);
  void cftx020(double *a);
  if (n > 8) {
    if (n > 32) {
      cftmdl1(n, a);
      if (n > 512) {
        cftrec4(n, a);
      } else if (n > 128) {
        cftleaf(n, 1, a);
      } else {
        cftfx41(n, a);
      }
      bitrv2(n, a);
    } else if (n == 32) {
      cftf161(a);
      bitrv216(a);
    } else {
      cftf081(a);
      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    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x8,-0x4(%rbp)
jle    127f <cftfsub+0xcf>
cmpl   $0x20,-0x4(%rbp)
jle    1242 <cftfsub+0x92>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10a0 <cftmdl1@plt>
cmpl   $0x200,-0x4(%rbp)
jle    11fd <cftfsub+0x4d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <cftrec4@plt>
jmp    1231 <cftfsub+0x81>
cmpl   $0x80,-0x4(%rbp)
jle    1220 <cftfsub+0x70>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1050 <cftleaf@plt>
jmp    122c <cftfsub+0x7c>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <cftfx41@plt>
jmp    1231 <cftfsub+0x81>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10b0 <bitrv2@plt>
jmp    127a <cftfsub+0xca>
cmpl   $0x20,-0x4(%rbp)
jne    1263 <cftfsub+0xb3>
mov    -0x10(%rbp),%rdi
call   1030 <cftf161@plt>
mov    -0x10(%rbp),%rdi
call   1080 <bitrv216@plt>
jmp    1275 <cftfsub+0xc5>
mov    -0x10(%rbp),%rdi
call   1060 <cftf081@plt>
mov    -0x10(%rbp),%rdi
call   10d0 <bitrv208@plt>
jmp    127a <cftfsub+0xca>
jmp    12b4 <cftfsub+0x104>
cmpl   $0x8,-0x4(%rbp)
jne    1297 <cftfsub+0xe7>
mov    -0x10(%rbp),%rdi
call   1070 <cftf040@plt>
jmp    12af <cftfsub+0xff>
cmpl   $0x4,-0x4(%rbp)
jne    12aa <cftfsub+0xfa>
mov    -0x10(%rbp),%rdi
call   10c0 <cftx020@plt>
jmp    12af <cftfsub+0xff>
jmp    12b4 <cftfsub+0x104>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cftfsub>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x9,%edi
jl     11e0 <cftfsub+0x30>
cmp    $0x21,%ebp
jb     11f8 <cftfsub+0x48>
mov    %ebp,%edi
mov    %rbx,%rsi
call   10a0 <cftmdl1@plt>
mov    %ebp,%edi
cmp    $0x201,%ebp
jb     1228 <cftfsub+0x78>
mov    %rbx,%rsi
call   1040 <cftrec4@plt>
jmp    125a <cftfsub+0xaa>
cmp    $0x4,%ebp
je     1213 <cftfsub+0x63>
cmp    $0x8,%ebp
jne    1221 <cftfsub+0x71>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <cftf040@plt>
mov    %rbx,%rdi
cmp    $0x20,%ebp
jne    123f <cftfsub+0x8f>
call   1030 <cftf161@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1080 <bitrv216@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    10c0 <cftx020@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
cmp    $0x81,%ebp
jb     1252 <cftfsub+0xa2>
mov    $0x1,%esi
mov    %rbx,%rdx
call   1050 <cftleaf@plt>
jmp    125a <cftfsub+0xaa>
call   1060 <cftf081@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    10d0 <bitrv208@plt>
mov    %rbx,%rsi
call   1090 <cftfx41@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    10b0 <bitrv2@plt>

LLVM IR (-O0):
define void @cftfsub(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
store i32 %0, i32* %3
store double* %1, double** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 8
br i1 %6, label %7, label %42
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 32
br i1 %9, label %10, label %31
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load double*, double** %4
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 512
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* %3
%17 = load double*, double** %4
br label %28
18: ; preds = %10
%19 = load i32, i32* %3
%20 = icmp sgt i32 %19, 128
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %3
%23 = load double*, double** %4
br label %27
24: ; preds = %18
%25 = load i32, i32* %3
%26 = load double*, double** %4
br label %27
27: ; preds = %24, %21
br label %28
28: ; preds = %27, %15
%29 = load i32, i32* %3
%30 = load double*, double** %4
br label %41
31: ; preds = %7
%32 = load i32, i32* %3
%33 = icmp eq i32 %32, 32
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load double*, double** %4
%36 = load double*, double** %4
br label %40
37: ; preds = %31
%38 = load double*, double** %4
%39 = load double*, double** %4
br label %40
40: ; preds = %37, %34
br label %41
41: ; preds = %40, %28
br label %54
42: ; preds = %2
%43 = load i32, i32* %3
%44 = icmp eq i32 %43, 8
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = load double*, double** %4
br label %53
47: ; preds = %42
%48 = load i32, i32* %3
%49 = icmp eq i32 %48, 4
br i1 %49, label %50, label %52
50: ; preds = %47
%51 = load double*, double** %4
br label %52
52: ; preds = %50, %47
br label %53
53: ; preds = %52, %45
br label %54
54: ; preds = %53, %41
ret void
}

LLVM IR (-O2):
define void @cftfsub(i32 %0, double* %1) {
%3 = icmp sgt i32 %0, 8
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = icmp ugt i32 %0, 32
br i1 %5, label %6, label %14
6: ; preds = %4
tail call void @cftmdl1(i32 %0, double* %1)
%7 = icmp ugt i32 %0, 512
br i1 %7, label %8, label %9
8: ; preds = %6
tail call void @cftrec4(i32 %0, double* %1)
br label %13
9: ; preds = %6
%10 = icmp ugt i32 %0, 128
br i1 %10, label %11, label %12
11: ; preds = %9
tail call void @cftleaf(i32 %0, i32 1, double* %1)
br label %13
12: ; preds = %9
tail call void @cftfx41(i32 %0, double* %1)
br label %13
13: ; preds = %11, %12, %8
tail call void @bitrv2(i32 %0, double* %1)
br label %21
14: ; preds = %4
%15 = icmp eq i32 %0, 32
br i1 %15, label %16, label %17
16: ; preds = %14
tail call void @cftf161(double* %1)
tail call void @bitrv216(double* %1)
br label %21
17: ; preds = %14
tail call void @cftf081(double* %1)
tail call void @bitrv208(double* %1)
br label %21
18: ; preds = %2
switch i32 %0, label %21 [
i32 8, label %19
i32 4, label %20
]
19: ; preds = %18
tail call void @cftf040(double* %1)
br label %21
20: ; preds = %18
tail call void @cftx020(double* %1)
br label %21
21: ; preds = %18, %19, %20, %13, %17, %16
ret void
}