#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*/ btrfly(int, double, double, double, double, double, double,
                          double *, double *, double *, double *);
void cftmd0(int n, int l, double *a, double *w) {
  int j, m = l << 2;
  double wk1r = w[2];
  double *v = w + 1;
  double *b = a + l;
  double *c = a + l + l;
  double *d = a + l + l + l;
#pragma mta use 100 streams
#pragma mta assert no dependence
  for (j = 0; j < l; j += 2)
    btrfly(j, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, a, b, c, d);
#pragma mta use 100 streams
#pragma mta assert no dependence
  for (j = m; j < l + m; j += 2)
    btrfly(j, wk1r, wk1r, 0.0, 1.0, -wk1r, wk1r, a, b, c, d);
}


x86 assembly (clang, -O0):
<cftmd0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f3 <cftmd0+0xe3>
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
movsd  0xe2f(%rip),%xmm4
xorps  %xmm5,%xmm5
movaps %xmm4,%xmm0
movaps %xmm5,%xmm1
movaps %xmm4,%xmm2
movaps %xmm5,%xmm3
call   1030 <btrfly@plt>
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
jmp    11aa <cftmd0+0x9a>
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0x20(%rbp),%ecx
cmp    %ecx,%eax
jge    1266 <cftmd0+0x156>
mov    -0x1c(%rbp),%edi
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
movsd  -0x28(%rbp),%xmm5
mov    -0x10(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
xorps  %xmm2,%xmm2
movsd  0xdad(%rip),%xmm3
call   1030 <btrfly@plt>
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
jmp    11f9 <cftmd0+0xe9>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cftmd0>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdx,%r12
mov    %esi,%r14d
lea    0x0(,%r14,4),%eax
mov    %eax,0xc(%rsp)
movsd  0x10(%rcx),%xmm0
movaps %xmm0,0x10(%rsp)
movslq %esi,%rax
lea    (%rdx,%rax,8),%rbx
lea    (%rbx,%rax,8),%rbp
lea    0x0(,%rax,8),%r15
add    %rbp,%r15
test   %eax,%eax
jle    1194 <cftmd0+0x84>
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
xorps  %xmm3,%xmm3
xorps  %xmm5,%xmm5
mov    %r13d,%edi
movsd  0xe8c(%rip),%xmm0
movaps %xmm0,%xmm2
movaps %xmm0,%xmm4
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
mov    %r15,%r8
call   1030 <btrfly@plt>
add    $0x2,%r13d
cmp    %r14d,%r13d
jl     1160 <cftmd0+0x50>
lea    (%r14,%r14,4),%r13d
mov    0xc(%rsp),%eax
cmp    %r13d,%eax
jge    11f6 <cftmd0+0xe6>
mov    %r12,%r14
mov    %r15,%r12
mov    %rbx,%r15
mov    %rbp,%rbx
mov    %eax,%ebp
movaps 0xe5a(%rip),%xmm0
xorps  0x10(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
xorps  %xmm2,%xmm2
mov    %ebp,%edi
movaps 0x10(%rsp),%xmm0
movaps %xmm0,%xmm1
movsd  0xe2b(%rip),%xmm3
movaps 0x20(%rsp),%xmm4
movaps %xmm0,%xmm5
mov    %r14,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %r12,%r8
call   1030 <btrfly@plt>
add    $0x2,%ebp
cmp    %r13d,%ebp
jl     11c0 <cftmd0+0xb0>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @cftmd0(i32 %0, i32 %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
%16 = load i32, i32* %6
%17 = shl i32 %16, 2
store i32 %17, i32* %10
%18 = load double*, double** %8
%19 = getelementptr inbounds double, double* %18, i64 2
%20 = load double, double* %19
store double %20, double* %11
%21 = load double*, double** %8
%22 = getelementptr inbounds double, double* %21, i64 1
store double* %22, double** %12
%23 = load double*, double** %7
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
store double* %26, double** %13
%27 = load double*, double** %7
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %30, i64 %32
store double* %33, double** %14
%34 = load double*, double** %7
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %34, i64 %36
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %37, i64 %39
%41 = load i32, i32* %6
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %40, i64 %42
store double* %43, double** %15
store i32 0, i32* %9
br label %44
44: ; preds = %55, %4
%45 = load i32, i32* %9
%46 = load i32, i32* %6
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %58
48: ; preds = %44
%49 = load i32, i32* %9
%50 = load double*, double** %7
%51 = load double*, double** %13
%52 = load double*, double** %14
%53 = load double*, double** %15
%54 = call i32 @btrfly(i32 %49, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double* %50, double* %51, double* %52, double* %53)
br label %55
55: ; preds = %48
%56 = load i32, i32* %9
%57 = add nsw i32 %56, 2
store i32 %57, i32* %9
br label %44
58: ; preds = %44
%59 = load i32, i32* %10
store i32 %59, i32* %9
br label %60
60: ; preds = %78, %58
%61 = load i32, i32* %9
%62 = load i32, i32* %6
%63 = load i32, i32* %10
%64 = add nsw i32 %62, %63
%65 = icmp slt i32 %61, %64
br i1 %65, label %66, label %81
66: ; preds = %60
%67 = load i32, i32* %9
%68 = load double, double* %11
%69 = load double, double* %11
%70 = load double, double* %11
%71 = fneg double %70
%72 = load double, double* %11
%73 = load double*, double** %7
%74 = load double*, double** %13
%75 = load double*, double** %14
%76 = load double*, double** %15
%77 = call i32 @btrfly(i32 %67, double %68, double %69, double 0.000000e+00, double 1.000000e+00, double %71, double %72, double* %73, double* %74, double* %75, double* %76)
br label %78
78: ; preds = %66
%79 = load i32, i32* %9
%80 = add nsw i32 %79, 2
store i32 %80, i32* %9
br label %60
81: ; preds = %60
ret void
}

LLVM IR (-O2):
define void @cftmd0(i32 %0, i32 %1, double* %2, double* nocapture %3) {
%5 = shl i32 %1, 2
%6 = getelementptr inbounds double, double* %3, i64 2
%7 = load double, double* %6
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds double, double* %2, i64 %8
%10 = getelementptr inbounds double, double* %9, i64 %8
%11 = getelementptr inbounds double, double* %10, i64 %8
%12 = icmp sgt i32 %1, 0
br i1 %12, label %18, label %13
13: ; preds = %18, %4
%14 = mul i32 %1, 5
%15 = icmp slt i32 %5, %14
br i1 %15, label %16, label %28
16: ; preds = %13
%17 = fneg double %7
br label %23
18: ; preds = %4, %18
%19 = phi i32 [ %21, %18 ], [ 0, %4 ]
%20 = tail call i32 @btrfly(i32 %19, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double* %2, double* %9, double* %10, double* %11)
%21 = add nuw nsw i32 %19, 2
%22 = icmp slt i32 %21, %1
br i1 %22, label %18, label %13
23: ; preds = %16, %23
%24 = phi i32 [ %5, %16 ], [ %26, %23 ]
%25 = tail call i32 @btrfly(i32 %24, double %7, double %7, double 0.000000e+00, double 1.000000e+00, double %17, double %7, double* %2, double* %9, double* %10, double* %11)
%26 = add nsw i32 %24, 2
%27 = icmp slt i32 %26, %14
br i1 %27, label %23, label %28
28: ; preds = %23, %13
ret void
}