void cftrec1(int n, double *a, int nw, double *w) {
  void cftrec1(int n, double *a, int nw, double *w);
  void cftrec2(int n, double *a, int nw, double *w);
  void cftmdl1(int n, double *a, double *w);
  void cftexp1(int n, double *a, int nw, double *w);
  int m;
  m = n >> 2;
  cftmdl1(n, a, &w[nw - 2 * m]);
  if (n > 512) {
    cftrec1(m, a, nw, w);
    cftrec2(m, &a[m], nw, w);
    cftrec1(m, &a[2 * m], nw, w);
    cftrec1(m, &a[3 * m], nw, w);
  } else {
    cftexp1(n, a, nw, w);
  }
}


x86 assembly (clang, -O0):
<cftrec1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x14(%rbp),%eax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
call   1040 <cftmdl1@plt>
cmpl   $0x200,-0x4(%rbp)
jle    1208 <cftrec1+0xc8>
mov    -0x24(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1050 <cftrec1@plt>
mov    -0x24(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <cftrec2@plt>
mov    -0x24(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1050 <cftrec1@plt>
mov    -0x24(%rbp),%edi
mov    -0x10(%rbp),%rsi
imul   $0x3,-0x24(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1050 <cftrec1@plt>
jmp    121b <cftrec1+0xdb>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1060 <cftexp1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cftrec1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %edi,%r12d
mov    %edi,%ebp
sar    $0x2,%ebp
lea    0x0(%rbp,%rbp,1),%r13d
mov    %edx,%eax
sub    %r13d,%eax
cltq
lea    (%rcx,%rax,8),%rdx
call   1040 <cftmdl1@plt>
cmp    $0x201,%r12d
jl     1201 <cftrec1+0xc1>
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
call   1050 <cftrec1@plt>
mov    %r15d,%r12d
mov    %r14,%r15
mov    %ebp,0x4(%rsp)
movslq %ebp,%r14
lea    (%rbx,%r14,8),%rsi
mov    %r14d,%edi
mov    %r12d,%edx
mov    %r15,%rcx
call   1030 <cftrec2@plt>
movslq %r13d,%rax
lea    (%rbx,%rax,8),%rsi
mov    %r14d,%edi
mov    %r12d,%edx
mov    %r15,%rcx
call   1050 <cftrec1@plt>
lea    (%r14,%r14,2),%eax
cltq
lea    (%rbx,%rax,8),%rbx
mov    %r14d,%ebp
sar    $0x2,%ebp
lea    0x0(%rbp,%rbp,1),%r13d
mov    %r12d,%eax
sub    %r13d,%eax
cltq
lea    (%r15,%rax,8),%rdx
mov    %r14d,%edi
mov    %rbx,%rsi
call   1040 <cftmdl1@plt>
cmp    $0x200,%r14d
mov    %r15,%r14
mov    %r12d,%r15d
jg     1180 <cftrec1+0x40>
jmp    1206 <cftrec1+0xc6>
mov    %r12d,0x4(%rsp)
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <cftexp1@plt>

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

LLVM IR (-O2):
define void @cftrec1(i32 %0, double* %1, i32 %2, double* %3) {
%5 = ashr i32 %0, 2
%6 = shl nsw i32 %5, 1
%7 = sub nsw i32 %2, %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds double, double* %3, i64 %8
tail call void @cftmdl1(i32 %0, double* %1, double* %9)
%10 = icmp sgt i32 %0, 512
br i1 %10, label %11, label %28
11: ; preds = %4, %11
%12 = phi i32 [ %23, %11 ], [ %6, %4 ]
%13 = phi i32 [ %22, %11 ], [ %5, %4 ]
%14 = phi double* [ %21, %11 ], [ %1, %4 ]
tail call void @cftrec1(i32 %13, double* %14, i32 %2, double* %3)
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds double, double* %14, i64 %15
tail call void @cftrec2(i32 %13, double* %16, i32 %2, double* %3)
%17 = sext i32 %12 to i64
%18 = getelementptr inbounds double, double* %14, i64 %17
tail call void @cftrec1(i32 %13, double* %18, i32 %2, double* %3)
%19 = mul nsw i32 %13, 3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %14, i64 %20
%22 = ashr i32 %13, 2
%23 = shl nsw i32 %22, 1
%24 = sub nsw i32 %2, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %3, i64 %25
tail call void @cftmdl1(i32 %13, double* %21, double* %26)
%27 = icmp sgt i32 %13, 512
br i1 %27, label %11, label %28
28: ; preds = %11, %4
%29 = phi i32 [ %0, %4 ], [ %13, %11 ]
%30 = phi double* [ %1, %4 ], [ %21, %11 ]
tail call void @cftexp1(i32 %29, double* %30, i32 %2, double* %3)
ret void
}