#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ cftf081(double *);
int /*<<< orphan*/ cftf082(double *);
int /*<<< orphan*/ cftf161(double *);
int /*<<< orphan*/ cftf162(double *);
int /*<<< orphan*/ cftmdl1(int, double *);
int /*<<< orphan*/ cftmdl2(int, double *);
void cftleaf(int n, int isplt, 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 %79
9: ; preds = %3
%10 = load double*, double** %6
%11 = call i32 @cftmdl1(i32 128, double* %10)
%12 = load double*, double** %6
%13 = call i32 @cftf161(double* %12)
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 32
%16 = call i32 @cftf162(double* %15)
%17 = load double*, double** %6
%18 = getelementptr inbounds double, double* %17, i64 64
%19 = call i32 @cftf161(double* %18)
%20 = load double*, double** %6
%21 = getelementptr inbounds double, double* %20, i64 96
%22 = call i32 @cftf161(double* %21)
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 128
%25 = call i32 @cftmdl2(i32 128, double* %24)
%26 = load double*, double** %6
%27 = getelementptr inbounds double, double* %26, i64 128
%28 = call i32 @cftf161(double* %27)
%29 = load double*, double** %6
%30 = getelementptr inbounds double, double* %29, i64 160
%31 = call i32 @cftf162(double* %30)
%32 = load double*, double** %6
%33 = getelementptr inbounds double, double* %32, i64 192
%34 = call i32 @cftf161(double* %33)
%35 = load double*, double** %6
%36 = getelementptr inbounds double, double* %35, i64 224
%37 = call i32 @cftf162(double* %36)
%38 = load double*, double** %6
%39 = getelementptr inbounds double, double* %38, i64 256
%40 = call i32 @cftmdl1(i32 128, double* %39)
%41 = load double*, double** %6
%42 = getelementptr inbounds double, double* %41, i64 256
%43 = call i32 @cftf161(double* %42)
%44 = load double*, double** %6
%45 = getelementptr inbounds double, double* %44, i64 288
%46 = call i32 @cftf162(double* %45)
%47 = load double*, double** %6
%48 = getelementptr inbounds double, double* %47, i64 320
%49 = call i32 @cftf161(double* %48)
%50 = load double*, double** %6
%51 = getelementptr inbounds double, double* %50, i64 352
%52 = call i32 @cftf161(double* %51)
%53 = load i32, i32* %5
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %62
55: ; preds = %9
%56 = load double*, double** %6
%57 = getelementptr inbounds double, double* %56, i64 384
%58 = call i32 @cftmdl1(i32 128, double* %57)
%59 = load double*, double** %6
%60 = getelementptr inbounds double, double* %59, i64 480
%61 = call i32 @cftf161(double* %60)
br label %69
62: ; preds = %9
%63 = load double*, double** %6
%64 = getelementptr inbounds double, double* %63, i64 384
%65 = call i32 @cftmdl2(i32 128, double* %64)
%66 = load double*, double** %6
%67 = getelementptr inbounds double, double* %66, i64 480
%68 = call i32 @cftf162(double* %67)
br label %69
69: ; preds = %62, %55
%70 = load double*, double** %6
%71 = getelementptr inbounds double, double* %70, i64 384
%72 = call i32 @cftf161(double* %71)
%73 = load double*, double** %6
%74 = getelementptr inbounds double, double* %73, i64 416
%75 = call i32 @cftf162(double* %74)
%76 = load double*, double** %6
%77 = getelementptr inbounds double, double* %76, i64 448
%78 = call i32 @cftf161(double* %77)
br label %149
79: ; preds = %3
%80 = load double*, double** %6
%81 = call i32 @cftmdl1(i32 64, double* %80)
%82 = load double*, double** %6
%83 = call i32 @cftf081(double* %82)
%84 = load double*, double** %6
%85 = getelementptr inbounds double, double* %84, i64 16
%86 = call i32 @cftf082(double* %85)
%87 = load double*, double** %6
%88 = getelementptr inbounds double, double* %87, i64 32
%89 = call i32 @cftf081(double* %88)
%90 = load double*, double** %6
%91 = getelementptr inbounds double, double* %90, i64 48
%92 = call i32 @cftf081(double* %91)
%93 = load double*, double** %6
%94 = getelementptr inbounds double, double* %93, i64 64
%95 = call i32 @cftmdl2(i32 64, double* %94)
%96 = load double*, double** %6
%97 = getelementptr inbounds double, double* %96, i64 64
%98 = call i32 @cftf081(double* %97)
%99 = load double*, double** %6
%100 = getelementptr inbounds double, double* %99, i64 80
%101 = call i32 @cftf082(double* %100)
%102 = load double*, double** %6
%103 = getelementptr inbounds double, double* %102, i64 96
%104 = call i32 @cftf081(double* %103)
%105 = load double*, double** %6
%106 = getelementptr inbounds double, double* %105, i64 112
%107 = call i32 @cftf082(double* %106)
%108 = load double*, double** %6
%109 = getelementptr inbounds double, double* %108, i64 128
%110 = call i32 @cftmdl1(i32 64, double* %109)
%111 = load double*, double** %6
%112 = getelementptr inbounds double, double* %111, i64 128
%113 = call i32 @cftf081(double* %112)
%114 = load double*, double** %6
%115 = getelementptr inbounds double, double* %114, i64 144
%116 = call i32 @cftf082(double* %115)
%117 = load double*, double** %6
%118 = getelementptr inbounds double, double* %117, i64 160
%119 = call i32 @cftf081(double* %118)
%120 = load double*, double** %6
%121 = getelementptr inbounds double, double* %120, i64 176
%122 = call i32 @cftf081(double* %121)
%123 = load i32, i32* %5
%124 = icmp ne i32 %123, 0
br i1 %124, label %125, label %132
125: ; preds = %79
%126 = load double*, double** %6
%127 = getelementptr inbounds double, double* %126, i64 192
%128 = call i32 @cftmdl1(i32 64, double* %127)
%129 = load double*, double** %6
%130 = getelementptr inbounds double, double* %129, i64 240
%131 = call i32 @cftf081(double* %130)
br label %139
132: ; preds = %79
%133 = load double*, double** %6
%134 = getelementptr inbounds double, double* %133, i64 192
%135 = call i32 @cftmdl2(i32 64, double* %134)
%136 = load double*, double** %6
%137 = getelementptr inbounds double, double* %136, i64 240
%138 = call i32 @cftf082(double* %137)
br label %139
139: ; preds = %132, %125
%140 = load double*, double** %6
%141 = getelementptr inbounds double, double* %140, i64 192
%142 = call i32 @cftf081(double* %141)
%143 = load double*, double** %6
%144 = getelementptr inbounds double, double* %143, i64 208
%145 = call i32 @cftf082(double* %144)
%146 = load double*, double** %6
%147 = getelementptr inbounds double, double* %146, i64 224
%148 = call i32 @cftf081(double* %147)
br label %149
149: ; preds = %139, %69
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 %49
5: ; preds = %3
%6 = tail call i32 @cftmdl1(i32 128, double* %2)
%7 = tail call i32 @cftf161(double* %2)
%8 = getelementptr inbounds double, double* %2, i64 32
%9 = tail call i32 @cftf162(double* %8)
%10 = getelementptr inbounds double, double* %2, i64 64
%11 = tail call i32 @cftf161(double* %10)
%12 = getelementptr inbounds double, double* %2, i64 96
%13 = tail call i32 @cftf161(double* %12)
%14 = getelementptr inbounds double, double* %2, i64 128
%15 = tail call i32 @cftmdl2(i32 128, double* %14)
%16 = tail call i32 @cftf161(double* %14)
%17 = getelementptr inbounds double, double* %2, i64 160
%18 = tail call i32 @cftf162(double* %17)
%19 = getelementptr inbounds double, double* %2, i64 192
%20 = tail call i32 @cftf161(double* %19)
%21 = getelementptr inbounds double, double* %2, i64 224
%22 = tail call i32 @cftf162(double* %21)
%23 = getelementptr inbounds double, double* %2, i64 256
%24 = tail call i32 @cftmdl1(i32 128, double* %23)
%25 = tail call i32 @cftf161(double* %23)
%26 = getelementptr inbounds double, double* %2, i64 288
%27 = tail call i32 @cftf162(double* %26)
%28 = getelementptr inbounds double, double* %2, i64 320
%29 = tail call i32 @cftf161(double* %28)
%30 = getelementptr inbounds double, double* %2, i64 352
%31 = tail call i32 @cftf161(double* %30)
%32 = icmp eq i32 %1, 0
%33 = getelementptr inbounds double, double* %2, i64 384
br i1 %32, label %38, label %34
34: ; preds = %5
%35 = tail call i32 @cftmdl1(i32 128, double* %33)
%36 = getelementptr inbounds double, double* %2, i64 480
%37 = tail call i32 @cftf161(double* %36)
br label %42
38: ; preds = %5
%39 = tail call i32 @cftmdl2(i32 128, double* %33)
%40 = getelementptr inbounds double, double* %2, i64 480
%41 = tail call i32 @cftf162(double* %40)
br label %42
42: ; preds = %38, %34
%43 = getelementptr inbounds double, double* %2, i64 384
%44 = tail call i32 @cftf161(double* %43)
%45 = getelementptr inbounds double, double* %2, i64 416
%46 = tail call i32 @cftf162(double* %45)
%47 = getelementptr inbounds double, double* %2, i64 448
%48 = tail call i32 @cftf161(double* %47)
br label %93
49: ; preds = %3
%50 = tail call i32 @cftmdl1(i32 64, double* %2)
%51 = tail call i32 @cftf081(double* %2)
%52 = getelementptr inbounds double, double* %2, i64 16
%53 = tail call i32 @cftf082(double* %52)
%54 = getelementptr inbounds double, double* %2, i64 32
%55 = tail call i32 @cftf081(double* %54)
%56 = getelementptr inbounds double, double* %2, i64 48
%57 = tail call i32 @cftf081(double* %56)
%58 = getelementptr inbounds double, double* %2, i64 64
%59 = tail call i32 @cftmdl2(i32 64, double* %58)
%60 = tail call i32 @cftf081(double* %58)
%61 = getelementptr inbounds double, double* %2, i64 80
%62 = tail call i32 @cftf082(double* %61)
%63 = getelementptr inbounds double, double* %2, i64 96
%64 = tail call i32 @cftf081(double* %63)
%65 = getelementptr inbounds double, double* %2, i64 112
%66 = tail call i32 @cftf082(double* %65)
%67 = getelementptr inbounds double, double* %2, i64 128
%68 = tail call i32 @cftmdl1(i32 64, double* %67)
%69 = tail call i32 @cftf081(double* %67)
%70 = getelementptr inbounds double, double* %2, i64 144
%71 = tail call i32 @cftf082(double* %70)
%72 = getelementptr inbounds double, double* %2, i64 160
%73 = tail call i32 @cftf081(double* %72)
%74 = getelementptr inbounds double, double* %2, i64 176
%75 = tail call i32 @cftf081(double* %74)
%76 = icmp eq i32 %1, 0
%77 = getelementptr inbounds double, double* %2, i64 192
br i1 %76, label %82, label %78
78: ; preds = %49
%79 = tail call i32 @cftmdl1(i32 64, double* %77)
%80 = getelementptr inbounds double, double* %2, i64 240
%81 = tail call i32 @cftf081(double* %80)
br label %86
82: ; preds = %49
%83 = tail call i32 @cftmdl2(i32 64, double* %77)
%84 = getelementptr inbounds double, double* %2, i64 240
%85 = tail call i32 @cftf082(double* %84)
br label %86
86: ; preds = %82, %78
%87 = getelementptr inbounds double, double* %2, i64 192
%88 = tail call i32 @cftf081(double* %87)
%89 = getelementptr inbounds double, double* %2, i64 208
%90 = tail call i32 @cftf082(double* %89)
%91 = getelementptr inbounds double, double* %2, i64 224
%92 = tail call i32 @cftf081(double* %91)
br label %93
93: ; preds = %86, %42
ret void
}