void cftleaf(int n, int isplt, double *a) {
  void cftmdl1(int n, double *a);
  void cftmdl2(int n, double *a);
  void cftf161(double *a);
  void cftf162(double *a);
  void cftf081(double *a);
  void cftf082(double *a);
  if (n == 512) {
    cftmdl1(128, a);
    cftf161(a);
    cftf162(&a[32]);
    cftf161(&a[64]);
    cftf161(&a[96]);
    cftmdl2(128, &a[128]);
    cftf161(&a[128]);
    cftf162(&a[160]);
    cftf161(&a[192]);
    cftf162(&a[224]);
    cftmdl1(128, &a[256]);
    cftf161(&a[256]);
    cftf162(&a[288]);
    cftf161(&a[320]);
    cftf161(&a[352]);
    if (isplt != 0) {
      cftmdl1(128, &a[384]);
      cftf161(&a[480]);
    } else {
      cftmdl2(128, &a[384]);
      cftf162(&a[480]);
    }
    cftf161(&a[384]);
    cftf162(&a[416]);
    cftf161(&a[448]);
  } else {
    cftmdl1(64, a);
    cftf081(a);
    cftf082(&a[16]);
    cftf081(&a[32]);
    cftf081(&a[48]);
    cftmdl2(64, &a[64]);
    cftf081(&a[64]);
    cftf082(&a[80]);
    cftf081(&a[96]);
    cftf082(&a[112]);
    cftmdl1(64, &a[128]);
    cftf081(&a[128]);
    cftf082(&a[144]);
    cftf081(&a[160]);
    cftf081(&a[176]);
    if (isplt != 0) {
      cftmdl1(64, &a[192]);
      cftf081(&a[240]);
    } else {
      cftmdl2(64, &a[192]);
      cftf082(&a[240]);
    }
    cftf081(&a[192]);
    cftf082(&a[208]);
    cftf081(&a[224]);
  }
}


x86 assembly (clang, -O0):
<cftleaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x200,-0x4(%rbp)
jne    12fe <cftleaf+0x19e>
mov    -0x10(%rbp),%rsi
mov    $0x80,%edi
call   1060 <cftmdl1@plt>
mov    -0x10(%rbp),%rdi
call   1040 <cftf161@plt>
mov    -0x10(%rbp),%rdi
add    $0x100,%rdi
call   1070 <cftf162@plt>
mov    -0x10(%rbp),%rdi
add    $0x200,%rdi
call   1040 <cftf161@plt>
mov    -0x10(%rbp),%rdi
add    $0x300,%rdi
call   1040 <cftf161@plt>
mov    -0x10(%rbp),%rsi
add    $0x400,%rsi
mov    $0x80,%edi
call   1030 <cftmdl2@plt>
mov    -0x10(%rbp),%rdi
add    $0x400,%rdi
call   1040 <cftf161@plt>
mov    -0x10(%rbp),%rdi
add    $0x500,%rdi
call   1070 <cftf162@plt>
mov    -0x10(%rbp),%rdi
add    $0x600,%rdi
call   1040 <cftf161@plt>
mov    -0x10(%rbp),%rdi
add    $0x700,%rdi
call   1070 <cftf162@plt>
mov    -0x10(%rbp),%rsi
add    $0x800,%rsi
mov    $0x80,%edi
call   1060 <cftmdl1@plt>
mov    -0x10(%rbp),%rdi
add    $0x800,%rdi
call   1040 <cftf161@plt>
mov    -0x10(%rbp),%rdi
add    $0x900,%rdi
call   1070 <cftf162@plt>
mov    -0x10(%rbp),%rdi
add    $0xa00,%rdi
call   1040 <cftf161@plt>
mov    -0x10(%rbp),%rdi
add    $0xb00,%rdi
call   1040 <cftf161@plt>
cmpl   $0x0,-0x8(%rbp)
je     12a4 <cftleaf+0x144>
mov    -0x10(%rbp),%rsi
add    $0xc00,%rsi
mov    $0x80,%edi
call   1060 <cftmdl1@plt>
mov    -0x10(%rbp),%rdi
add    $0xf00,%rdi
call   1040 <cftf161@plt>
jmp    12c9 <cftleaf+0x169>
mov    -0x10(%rbp),%rsi
add    $0xc00,%rsi
mov    $0x80,%edi
call   1030 <cftmdl2@plt>
mov    -0x10(%rbp),%rdi
add    $0xf00,%rdi
call   1070 <cftf162@plt>
mov    -0x10(%rbp),%rdi
add    $0xc00,%rdi
call   1040 <cftf161@plt>
mov    -0x10(%rbp),%rdi
add    $0xd00,%rdi
call   1070 <cftf162@plt>
mov    -0x10(%rbp),%rdi
add    $0xe00,%rdi
call   1040 <cftf161@plt>
jmp    1478 <cftleaf+0x318>
mov    -0x10(%rbp),%rsi
mov    $0x40,%edi
call   1060 <cftmdl1@plt>
mov    -0x10(%rbp),%rdi
call   1050 <cftf081@plt>
mov    -0x10(%rbp),%rdi
add    $0x80,%rdi
call   1080 <cftf082@plt>
mov    -0x10(%rbp),%rdi
add    $0x100,%rdi
call   1050 <cftf081@plt>
mov    -0x10(%rbp),%rdi
add    $0x180,%rdi
call   1050 <cftf081@plt>
mov    -0x10(%rbp),%rsi
add    $0x200,%rsi
mov    $0x40,%edi
call   1030 <cftmdl2@plt>
mov    -0x10(%rbp),%rdi
add    $0x200,%rdi
call   1050 <cftf081@plt>
mov    -0x10(%rbp),%rdi
add    $0x280,%rdi
call   1080 <cftf082@plt>
mov    -0x10(%rbp),%rdi
add    $0x300,%rdi
call   1050 <cftf081@plt>
mov    -0x10(%rbp),%rdi
add    $0x380,%rdi
call   1080 <cftf082@plt>
mov    -0x10(%rbp),%rsi
add    $0x400,%rsi
mov    $0x40,%edi
call   1060 <cftmdl1@plt>
mov    -0x10(%rbp),%rdi
add    $0x400,%rdi
call   1050 <cftf081@plt>
mov    -0x10(%rbp),%rdi
add    $0x480,%rdi
call   1080 <cftf082@plt>
mov    -0x10(%rbp),%rdi
add    $0x500,%rdi
call   1050 <cftf081@plt>
mov    -0x10(%rbp),%rdi
add    $0x580,%rdi
call   1050 <cftf081@plt>
cmpl   $0x0,-0x8(%rbp)
je     1423 <cftleaf+0x2c3>
mov    -0x10(%rbp),%rsi
add    $0x600,%rsi
mov    $0x40,%edi
call   1060 <cftmdl1@plt>
mov    -0x10(%rbp),%rdi
add    $0x780,%rdi
call   1050 <cftf081@plt>
jmp    1448 <cftleaf+0x2e8>
mov    -0x10(%rbp),%rsi
add    $0x600,%rsi
mov    $0x40,%edi
call   1030 <cftmdl2@plt>
mov    -0x10(%rbp),%rdi
add    $0x780,%rdi
call   1080 <cftf082@plt>
mov    -0x10(%rbp),%rdi
add    $0x600,%rdi
call   1050 <cftf081@plt>
mov    -0x10(%rbp),%rdi
add    $0x680,%rdi
call   1080 <cftf082@plt>
mov    -0x10(%rbp),%rdi
add    $0x700,%rdi
call   1050 <cftf081@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cftleaf>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
cmp    $0x200,%edi
jne    125d <cftleaf+0xfd>
mov    $0x80,%edi
mov    %rbx,%rsi
call   1060 <cftmdl1@plt>
mov    %rbx,%rdi
call   1040 <cftf161@plt>
lea    0x100(%rbx),%rdi
call   1070 <cftf162@plt>
lea    0x200(%rbx),%rdi
call   1040 <cftf161@plt>
lea    0x300(%rbx),%rdi
call   1040 <cftf161@plt>
lea    0x400(%rbx),%rbp
mov    $0x80,%edi
mov    %rbp,%rsi
call   1030 <cftmdl2@plt>
mov    %rbp,%rdi
call   1040 <cftf161@plt>
lea    0x500(%rbx),%rdi
call   1070 <cftf162@plt>
lea    0x600(%rbx),%rdi
call   1040 <cftf161@plt>
lea    0x700(%rbx),%rdi
call   1070 <cftf162@plt>
lea    0x800(%rbx),%rbp
mov    $0x80,%edi
mov    %rbp,%rsi
call   1060 <cftmdl1@plt>
mov    %rbp,%rdi
call   1040 <cftf161@plt>
lea    0x900(%rbx),%rdi
call   1070 <cftf162@plt>
lea    0xa00(%rbx),%rdi
call   1040 <cftf161@plt>
lea    0xb00(%rbx),%rdi
call   1040 <cftf161@plt>
lea    0xc00(%rbx),%rbp
mov    $0x80,%edi
mov    %rbp,%rsi
test   %r14d,%r14d
je     133d <cftleaf+0x1dd>
call   1060 <cftmdl1@plt>
lea    0xf00(%rbx),%rdi
call   1040 <cftf161@plt>
jmp    134e <cftleaf+0x1ee>
mov    $0x40,%edi
mov    %rbx,%rsi
call   1060 <cftmdl1@plt>
mov    %rbx,%rdi
call   1050 <cftf081@plt>
lea    0x80(%rbx),%rdi
call   1080 <cftf082@plt>
lea    0x100(%rbx),%rdi
call   1050 <cftf081@plt>
lea    0x180(%rbx),%rdi
call   1050 <cftf081@plt>
lea    0x200(%rbx),%rbp
mov    $0x40,%edi
mov    %rbp,%rsi
call   1030 <cftmdl2@plt>
mov    %rbp,%rdi
call   1050 <cftf081@plt>
lea    0x280(%rbx),%rdi
call   1080 <cftf082@plt>
lea    0x300(%rbx),%rdi
call   1050 <cftf081@plt>
lea    0x380(%rbx),%rdi
call   1080 <cftf082@plt>
lea    0x400(%rbx),%rbp
mov    $0x40,%edi
mov    %rbp,%rsi
call   1060 <cftmdl1@plt>
mov    %rbp,%rdi
call   1050 <cftf081@plt>
lea    0x480(%rbx),%rdi
call   1080 <cftf082@plt>
lea    0x500(%rbx),%rdi
call   1050 <cftf081@plt>
lea    0x580(%rbx),%rdi
call   1050 <cftf081@plt>
lea    0x600(%rbx),%rbp
mov    $0x40,%edi
mov    %rbp,%rsi
test   %r14d,%r14d
je     1375 <cftleaf+0x215>
call   1060 <cftmdl1@plt>
lea    0x780(%rbx),%rdi
call   1050 <cftf081@plt>
jmp    1386 <cftleaf+0x226>
call   1030 <cftmdl2@plt>
lea    0xf00(%rbx),%rdi
call   1070 <cftf162@plt>
mov    %rbp,%rdi
call   1040 <cftf161@plt>
lea    0xd00(%rbx),%rdi
call   1070 <cftf162@plt>
add    $0xe00,%rbx
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <cftf161@plt>
call   1030 <cftmdl2@plt>
lea    0x780(%rbx),%rdi
call   1080 <cftf082@plt>
mov    %rbp,%rdi
call   1050 <cftf081@plt>
lea    0x680(%rbx),%rdi
call   1080 <cftf082@plt>
add    $0x700,%rbx
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <cftf081@plt>

LLVM IR (-O0):
define void @cftleaf(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 eq i32 %7, 512
br i1 %8, label %9, label %57
9: ; preds = %3
%10 = load double*, double** %6
%11 = load double*, double** %6
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 32
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 64
%16 = load double*, double** %6
%17 = getelementptr inbounds double, double* %16, i64 96
%18 = load double*, double** %6
%19 = getelementptr inbounds double, double* %18, i64 128
%20 = load double*, double** %6
%21 = getelementptr inbounds double, double* %20, i64 128
%22 = load double*, double** %6
%23 = getelementptr inbounds double, double* %22, i64 160
%24 = load double*, double** %6
%25 = getelementptr inbounds double, double* %24, i64 192
%26 = load double*, double** %6
%27 = getelementptr inbounds double, double* %26, i64 224
%28 = load double*, double** %6
%29 = getelementptr inbounds double, double* %28, i64 256
%30 = load double*, double** %6
%31 = getelementptr inbounds double, double* %30, i64 256
%32 = load double*, double** %6
%33 = getelementptr inbounds double, double* %32, i64 288
%34 = load double*, double** %6
%35 = getelementptr inbounds double, double* %34, i64 320
%36 = load double*, double** %6
%37 = getelementptr inbounds double, double* %36, i64 352
%38 = load i32, i32* %5
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %45
40: ; preds = %9
%41 = load double*, double** %6
%42 = getelementptr inbounds double, double* %41, i64 384
%43 = load double*, double** %6
%44 = getelementptr inbounds double, double* %43, i64 480
br label %50
45: ; preds = %9
%46 = load double*, double** %6
%47 = getelementptr inbounds double, double* %46, i64 384
%48 = load double*, double** %6
%49 = getelementptr inbounds double, double* %48, i64 480
br label %50
50: ; preds = %45, %40
%51 = load double*, double** %6
%52 = getelementptr inbounds double, double* %51, i64 384
%53 = load double*, double** %6
%54 = getelementptr inbounds double, double* %53, i64 416
%55 = load double*, double** %6
%56 = getelementptr inbounds double, double* %55, i64 448
br label %105
57: ; preds = %3
%58 = load double*, double** %6
%59 = load double*, double** %6
%60 = load double*, double** %6
%61 = getelementptr inbounds double, double* %60, i64 16
%62 = load double*, double** %6
%63 = getelementptr inbounds double, double* %62, i64 32
%64 = load double*, double** %6
%65 = getelementptr inbounds double, double* %64, i64 48
%66 = load double*, double** %6
%67 = getelementptr inbounds double, double* %66, i64 64
%68 = load double*, double** %6
%69 = getelementptr inbounds double, double* %68, i64 64
%70 = load double*, double** %6
%71 = getelementptr inbounds double, double* %70, i64 80
%72 = load double*, double** %6
%73 = getelementptr inbounds double, double* %72, i64 96
%74 = load double*, double** %6
%75 = getelementptr inbounds double, double* %74, i64 112
%76 = load double*, double** %6
%77 = getelementptr inbounds double, double* %76, i64 128
%78 = load double*, double** %6
%79 = getelementptr inbounds double, double* %78, i64 128
%80 = load double*, double** %6
%81 = getelementptr inbounds double, double* %80, i64 144
%82 = load double*, double** %6
%83 = getelementptr inbounds double, double* %82, i64 160
%84 = load double*, double** %6
%85 = getelementptr inbounds double, double* %84, i64 176
%86 = load i32, i32* %5
%87 = icmp ne i32 %86, 0
br i1 %87, label %88, label %93
88: ; preds = %57
%89 = load double*, double** %6
%90 = getelementptr inbounds double, double* %89, i64 192
%91 = load double*, double** %6
%92 = getelementptr inbounds double, double* %91, i64 240
br label %98
93: ; preds = %57
%94 = load double*, double** %6
%95 = getelementptr inbounds double, double* %94, i64 192
%96 = load double*, double** %6
%97 = getelementptr inbounds double, double* %96, i64 240
br label %98
98: ; preds = %93, %88
%99 = load double*, double** %6
%100 = getelementptr inbounds double, double* %99, i64 192
%101 = load double*, double** %6
%102 = getelementptr inbounds double, double* %101, i64 208
%103 = load double*, double** %6
%104 = getelementptr inbounds double, double* %103, i64 224
br label %105
105: ; preds = %98, %50
ret void
}

LLVM IR (-O2):
define void @cftleaf(i32 %0, i32 %1, double* %2) {
%4 = icmp eq i32 %0, 512
br i1 %4, label %5, label %27
5: ; preds = %3
tail call void @cftmdl1(i32 128, double* %2)
tail call void @cftf161(double* %2)
%6 = getelementptr inbounds double, double* %2, i64 32
tail call void @cftf162(double* %6)
%7 = getelementptr inbounds double, double* %2, i64 64
tail call void @cftf161(double* %7)
%8 = getelementptr inbounds double, double* %2, i64 96
tail call void @cftf161(double* %8)
%9 = getelementptr inbounds double, double* %2, i64 128
tail call void @cftmdl2(i32 128, double* %9)
tail call void @cftf161(double* %9)
%10 = getelementptr inbounds double, double* %2, i64 160
tail call void @cftf162(double* %10)
%11 = getelementptr inbounds double, double* %2, i64 192
tail call void @cftf161(double* %11)
%12 = getelementptr inbounds double, double* %2, i64 224
tail call void @cftf162(double* %12)
%13 = getelementptr inbounds double, double* %2, i64 256
tail call void @cftmdl1(i32 128, double* %13)
tail call void @cftf161(double* %13)
%14 = getelementptr inbounds double, double* %2, i64 288
tail call void @cftf162(double* %14)
%15 = getelementptr inbounds double, double* %2, i64 320
tail call void @cftf161(double* %15)
%16 = getelementptr inbounds double, double* %2, i64 352
tail call void @cftf161(double* %16)
%17 = icmp eq i32 %1, 0
%18 = getelementptr inbounds double, double* %2, i64 384
br i1 %17, label %21, label %19
19: ; preds = %5
tail call void @cftmdl1(i32 128, double* %18)
%20 = getelementptr inbounds double, double* %2, i64 480
tail call void @cftf161(double* %20)
br label %23
21: ; preds = %5
tail call void @cftmdl2(i32 128, double* %18)
%22 = getelementptr inbounds double, double* %2, i64 480
tail call void @cftf162(double* %22)
br label %23
23: ; preds = %21, %19
%24 = getelementptr inbounds double, double* %2, i64 384
tail call void @cftf161(double* %24)
%25 = getelementptr inbounds double, double* %2, i64 416
tail call void @cftf162(double* %25)
%26 = getelementptr inbounds double, double* %2, i64 448
tail call void @cftf161(double* %26)
br label %49
27: ; preds = %3
tail call void @cftmdl1(i32 64, double* %2)
tail call void @cftf081(double* %2)
%28 = getelementptr inbounds double, double* %2, i64 16
tail call void @cftf082(double* %28)
%29 = getelementptr inbounds double, double* %2, i64 32
tail call void @cftf081(double* %29)
%30 = getelementptr inbounds double, double* %2, i64 48
tail call void @cftf081(double* %30)
%31 = getelementptr inbounds double, double* %2, i64 64
tail call void @cftmdl2(i32 64, double* %31)
tail call void @cftf081(double* %31)
%32 = getelementptr inbounds double, double* %2, i64 80
tail call void @cftf082(double* %32)
%33 = getelementptr inbounds double, double* %2, i64 96
tail call void @cftf081(double* %33)
%34 = getelementptr inbounds double, double* %2, i64 112
tail call void @cftf082(double* %34)
%35 = getelementptr inbounds double, double* %2, i64 128
tail call void @cftmdl1(i32 64, double* %35)
tail call void @cftf081(double* %35)
%36 = getelementptr inbounds double, double* %2, i64 144
tail call void @cftf082(double* %36)
%37 = getelementptr inbounds double, double* %2, i64 160
tail call void @cftf081(double* %37)
%38 = getelementptr inbounds double, double* %2, i64 176
tail call void @cftf081(double* %38)
%39 = icmp eq i32 %1, 0
%40 = getelementptr inbounds double, double* %2, i64 192
br i1 %39, label %43, label %41
41: ; preds = %27
tail call void @cftmdl1(i32 64, double* %40)
%42 = getelementptr inbounds double, double* %2, i64 240
tail call void @cftf081(double* %42)
br label %45
43: ; preds = %27
tail call void @cftmdl2(i32 64, double* %40)
%44 = getelementptr inbounds double, double* %2, i64 240
tail call void @cftf082(double* %44)
br label %45
45: ; preds = %43, %41
%46 = getelementptr inbounds double, double* %2, i64 192
tail call void @cftf081(double* %46)
%47 = getelementptr inbounds double, double* %2, i64 208
tail call void @cftf082(double* %47)
%48 = getelementptr inbounds double, double* %2, i64 224
tail call void @cftf081(double* %48)
br label %49
49: ; preds = %45, %23
ret void
}