void cftfx41(int n, double *a, int nw, double *w) {
  void cftf161(double *a, double *w);
  void cftf162(double *a, double *w);
  void cftf081(double *a, double *w);
  void cftf082(double *a, double *w);
  if (n == 128) {
    cftf161(a, &w[nw - 8]);
    cftf162(&a[32], &w[nw - 32]);
    cftf161(&a[64], &w[nw - 8]);
    cftf161(&a[96], &w[nw - 8]);
  } else {
    cftf081(a, &w[nw - 8]);
    cftf082(&a[16], &w[nw - 8]);
    cftf081(&a[32], &w[nw - 8]);
    cftf081(&a[48], &w[nw - 8]);
  }
}


x86 assembly (clang, -O0):
<cftfx41>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x80,-0x4(%rbp)
jne    11ed <cftfx41+0xad>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
call   1030 <cftf161@plt>
mov    -0x10(%rbp),%rdi
add    $0x100,%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%eax
sub    $0x20,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
call   1050 <cftf162@plt>
mov    -0x10(%rbp),%rdi
add    $0x200,%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
call   1030 <cftf161@plt>
mov    -0x10(%rbp),%rdi
add    $0x300,%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
call   1030 <cftf161@plt>
jmp    1272 <cftfx41+0x132>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
call   1040 <cftf081@plt>
mov    -0x10(%rbp),%rdi
add    $0x80,%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
call   1060 <cftf082@plt>
mov    -0x10(%rbp),%rdi
add    $0x100,%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
call   1040 <cftf081@plt>
mov    -0x10(%rbp),%rdi
add    $0x180,%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
call   1040 <cftf081@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cftfx41>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
movslq %edx,%r12
lea    (%rcx,%r12,8),%r14
add    $0xffffffffffffffc0,%r14
cmp    $0x80,%edi
jne    11af <cftfx41+0x6f>
mov    %rcx,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <cftf161@plt>
lea    0x100(%rbx),%rdi
lea    (%r15,%r12,8),%rsi
add    $0xffffffffffffff00,%rsi
call   1050 <cftf162@plt>
lea    0x200(%rbx),%rdi
mov    %r14,%rsi
call   1030 <cftf161@plt>
add    $0x300,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <cftf161@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <cftf081@plt>
lea    0x80(%rbx),%rdi
mov    %r14,%rsi
call   1060 <cftf082@plt>
lea    0x100(%rbx),%rdi
mov    %r14,%rsi
call   1040 <cftf081@plt>
add    $0x180,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <cftf081@plt>

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

LLVM IR (-O2):
define void @cftfx41(i32 %0, double* %1, i32 %2, double* %3) {
%5 = icmp eq i32 %0, 128
%6 = add nsw i32 %2, -8
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds double, double* %3, i64 %7
br i1 %5, label %9, label %16
9: ; preds = %4
tail call void @cftf161(double* %1, double* %8)
%10 = getelementptr inbounds double, double* %1, i64 32
%11 = add nsw i32 %2, -32
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %3, i64 %12
tail call void @cftf162(double* %10, double* %13)
%14 = getelementptr inbounds double, double* %1, i64 64
tail call void @cftf161(double* %14, double* %8)
%15 = getelementptr inbounds double, double* %1, i64 96
tail call void @cftf161(double* %15, double* %8)
br label %20
16: ; preds = %4
tail call void @cftf081(double* %1, double* %8)
%17 = getelementptr inbounds double, double* %1, i64 16
tail call void @cftf082(double* %17, double* %8)
%18 = getelementptr inbounds double, double* %1, i64 32
tail call void @cftf081(double* %18, double* %8)
%19 = getelementptr inbounds double, double* %1, i64 48
tail call void @cftf081(double* %19, double* %8)
br label %20
20: ; preds = %16, %9
ret void
}