void cdft(int n, int isgn, double *a) {
  void bitrv2(int n, double *a);
  void bitrv2conj(int n, double *a);
  void cftfsub(int n, double *a);
  void cftbsub(int n, double *a);
  if (n > 4) {
    if (isgn >= 0) {
      bitrv2(n, a);
      cftfsub(n, a);
    } else {
      bitrv2conj(n, a);
      cftbsub(n, a);
    }
  } else if (n == 4) {
    cftfsub(n, a);
  }
}


x86 assembly (clang, -O0):
<cdft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x4,-0x4(%rbp)
jle    11a0 <cdft+0x60>
cmpl   $0x0,-0x8(%rbp)
jl     1183 <cdft+0x43>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <bitrv2@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <cftfsub@plt>
jmp    119b <cdft+0x5b>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <bitrv2conj@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <cftbsub@plt>
jmp    11bb <cdft+0x7b>
cmpl   $0x4,-0x4(%rbp)
jne    11b6 <cdft+0x76>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <cftfsub@plt>
jmp    11bb <cdft+0x7b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdft>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %edi,%ebp
cmp    $0x5,%edi
jl     115f <cdft+0x1f>
mov    %ebp,%edi
test   %esi,%esi
js     117e <cdft+0x3e>
mov    %rbx,%rsi
call   1040 <bitrv2@plt>
mov    %ebp,%edi
jmp    1169 <cdft+0x29>
cmp    $0x4,%ebp
jne    1177 <cdft+0x37>
mov    $0x4,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <cftfsub@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rsi
call   1030 <bitrv2conj@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <cftbsub@plt>

LLVM IR (-O0):
define void @cdft(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 4
br i1 %8, label %9, label %23
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i32, i32* %4
%14 = load double*, double** %6
%15 = load i32, i32* %4
%16 = load double*, double** %6
br label %22
17: ; preds = %9
%18 = load i32, i32* %4
%19 = load double*, double** %6
%20 = load i32, i32* %4
%21 = load double*, double** %6
br label %22
22: ; preds = %17, %12
br label %30
23: ; preds = %3
%24 = load i32, i32* %4
%25 = icmp eq i32 %24, 4
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load i32, i32* %4
%28 = load double*, double** %6
br label %29
29: ; preds = %26, %23
br label %30
30: ; preds = %29, %22
ret void
}

LLVM IR (-O2):
define void @cdft(i32 %0, i32 %1, double* %2) {
%4 = icmp sgt i32 %0, 4
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = icmp sgt i32 %1, -1
br i1 %6, label %7, label %8
7: ; preds = %5
tail call void @bitrv2(i32 %0, double* %2)
tail call void @cftfsub(i32 %0, double* %2)
br label %12
8: ; preds = %5
tail call void @bitrv2conj(i32 %0, double* %2)
tail call void @cftbsub(i32 %0, double* %2)
br label %12
9: ; preds = %3
%10 = icmp eq i32 %0, 4
br i1 %10, label %11, label %12
11: ; preds = %9
tail call void @cftfsub(i32 4, double* %2)
br label %12
12: ; preds = %9, %11, %7, %8
ret void
}