#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 *);
int /*<<< orphan*/ resetA(double *);
int /*<<< orphan*/ writeA(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;
  writeA(a);
#pragma mta use 100 streams
#pragma mta assert no dependence
  for (j = 0; j < l; j += 2) {
    resetA(a);
    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) {
    resetA(a);
    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)
mov    -0x10(%rbp),%rdi
call   1050 <writeA@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1225 <cftmd0+0xf5>
mov    -0x10(%rbp),%rdi
call   1040 <resetA@plt>
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
movsd  0xdfd(%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    11d3 <cftmd0+0xa3>
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0x20(%rbp),%ecx
cmp    %ecx,%eax
jge    12a1 <cftmd0+0x171>
mov    -0x10(%rbp),%rdi
call   1040 <resetA@plt>
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  0xd72(%rip),%xmm3
call   1030 <btrfly@plt>
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
jmp    122b <cftmd0+0xfb>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cftmd0>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%rbx
lea    0x0(,%rsi,4),%ebp
movsd  0x10(%rcx),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rsi,(%rsp)
movslq %esi,%r13
lea    (%rdx,%r13,8),%r14
lea    (%r14,%r13,8),%r15
lea    (%r15,%r13,8),%r12
mov    %rdx,%rdi
call   1050 <writeA@plt>
test   %r13d,%r13d
jle    11bd <cftmd0+0x8d>
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1040 <resetA@plt>
xorps  %xmm1,%xmm1
xorps  %xmm3,%xmm3
xorps  %xmm5,%xmm5
mov    %r13d,%edi
movsd  0xe64(%rip),%xmm0
movaps %xmm0,%xmm2
movaps %xmm0,%xmm4
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r12,%r8
call   1030 <btrfly@plt>
add    $0x2,%r13d
cmp    (%rsp),%r13d
jl     1180 <cftmd0+0x50>
mov    (%rsp),%rax
lea    (%rax,%rax,4),%r13d
cmp    %r13d,%ebp
jge    121d <cftmd0+0xed>
movaps 0xe3f(%rip),%xmm0
xorps  0x10(%rsp),%xmm0
movaps %xmm0,(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <resetA@plt>
xorps  %xmm2,%xmm2
mov    %ebp,%edi
movaps 0x10(%rsp),%xmm0
movaps %xmm0,%xmm1
movsd  0xe03(%rip),%xmm3
movaps (%rsp),%xmm4
movaps %xmm0,%xmm5
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r12,%r8
call   1030 <btrfly@plt>
add    $0x2,%ebp
cmp    %r13d,%ebp
jl     11e0 <cftmd0+0xb0>
add    $0x28,%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
%44 = load double*, double** %7
%45 = call i32 @writeA(double* %44)
store i32 0, i32* %9
br label %46
46: ; preds = %59, %4
%47 = load i32, i32* %9
%48 = load i32, i32* %6
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %62
50: ; preds = %46
%51 = load double*, double** %7
%52 = call i32 @resetA(double* %51)
%53 = load i32, i32* %9
%54 = load double*, double** %7
%55 = load double*, double** %13
%56 = load double*, double** %14
%57 = load double*, double** %15
%58 = call i32 @btrfly(i32 %53, 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* %54, double* %55, double* %56, double* %57)
br label %59
59: ; preds = %50
%60 = load i32, i32* %9
%61 = add nsw i32 %60, 2
store i32 %61, i32* %9
br label %46
62: ; preds = %46
%63 = load i32, i32* %10
store i32 %63, i32* %9
br label %64
64: ; preds = %84, %62
%65 = load i32, i32* %9
%66 = load i32, i32* %6
%67 = load i32, i32* %10
%68 = add nsw i32 %66, %67
%69 = icmp slt i32 %65, %68
br i1 %69, label %70, label %87
70: ; preds = %64
%71 = load double*, double** %7
%72 = call i32 @resetA(double* %71)
%73 = load i32, i32* %9
%74 = load double, double* %11
%75 = load double, double* %11
%76 = load double, double* %11
%77 = fneg double %76
%78 = load double, double* %11
%79 = load double*, double** %7
%80 = load double*, double** %13
%81 = load double*, double** %14
%82 = load double*, double** %15
%83 = call i32 @btrfly(i32 %73, double %74, double %75, double 0.000000e+00, double 1.000000e+00, double %77, double %78, double* %79, double* %80, double* %81, double* %82)
br label %84
84: ; preds = %70
%85 = load i32, i32* %9
%86 = add nsw i32 %85, 2
store i32 %86, i32* %9
br label %64
87: ; preds = %64
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 = tail call i32 @writeA(double* %2)
%13 = icmp sgt i32 %1, 0
br i1 %13, label %19, label %14
14: ; preds = %19, %4
%15 = mul i32 %1, 5
%16 = icmp slt i32 %5, %15
br i1 %16, label %17, label %31
17: ; preds = %14
%18 = fneg double %7
br label %25
19: ; preds = %4, %19
%20 = phi i32 [ %23, %19 ], [ 0, %4 ]
%21 = tail call i32 @resetA(double* %2)
%22 = tail call i32 @btrfly(i32 %20, 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)
%23 = add nuw nsw i32 %20, 2
%24 = icmp slt i32 %23, %1
br i1 %24, label %19, label %14
25: ; preds = %17, %25
%26 = phi i32 [ %5, %17 ], [ %29, %25 ]
%27 = tail call i32 @resetA(double* %2)
%28 = tail call i32 @btrfly(i32 %26, double %7, double %7, double 0.000000e+00, double 1.000000e+00, double %18, double %7, double* %2, double* %9, double* %10, double* %11)
%29 = add nsw i32 %26, 2
%30 = icmp slt i32 %29, %15
br i1 %30, label %25, label %31
31: ; preds = %25, %14
ret void
}