void FFT1DOnce(direction, M, N, u, x) int direction;
int M;
int N;
double *u;
double *x;
{
  int j;
  int k;
  int q;
  int L;
  int r;
  int Lstar;
  double *u1;
  double *x1;
  double *x2;
  double omega_r;
  double omega_c;
  double tau_r;
  double tau_c;
  double x_r;
  double x_c;
  Reverse(N, M, x);
  for (q = 1; q <= M; q++) {
    L = 1 << q;
    r = N / L;
    Lstar = L / 2;
    u1 = &u[2 * (Lstar - 1)];
    for (k = 0; k < r; k++) {
      x1 = &x[2 * (k * L)];
      x2 = &x[2 * (k * L + Lstar)];
      for (j = 0; j < Lstar; j++) {
        omega_r = u1[2 * j];
        omega_c = direction * u1[2 * j + 1];
        x_r = x2[2 * j];
        x_c = x2[2 * j + 1];
        tau_r = omega_r * x_r - omega_c * x_c;
        tau_c = omega_r * x_c + omega_c * x_r;
        x_r = x1[2 * j];
        x_c = x1[2 * j + 1];
        x2[2 * j] = x_r - tau_r;
        x2[2 * j + 1] = x_c - tau_c;
        x1[2 * j] = x_r + tau_r;
        x1[2 * j + 1] = x_c + tau_c;
      }
    }
  }
}


x86 assembly (clang, -O0):
<FFT1DOnce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1030 <Reverse@plt>
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     138c <FFT1DOnce+0x27c>
mov    -0x2c(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x30(%rbp)
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1379 <FFT1DOnce+0x269>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
imul   -0x30(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
imul   -0x30(%rbp),%ecx
add    -0x38(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1366 <FFT1DOnce+0x256>
mov    -0x40(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
mov    -0x40(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x50(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x50(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  -0x80(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
mov    -0x50(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
mov    -0x50(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
mov    -0x48(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
mov    -0x48(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11e5 <FFT1DOnce+0xd5>
jmp    136b <FFT1DOnce+0x25b>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1197 <FFT1DOnce+0x87>
jmp    137e <FFT1DOnce+0x26e>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1144 <FFT1DOnce+0x34>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FFT1DOnce>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r12
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%r13d
mov    %edi,%ebx
mov    %edx,%edi
mov    %r8,%rdx
xor    %eax,%eax
call   1030 <Reverse@plt>
test   %r13d,%r13d
jle    1240 <FFT1DOnce+0x130>
cvtsi2sd %ebx,%xmm0
add    $0x8,%r14
mov    $0x1,%ecx
movapd 0xead(%rip),%xmm1
jmp    116e <FFT1DOnce+0x5e>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rcx),%eax
cmp    %r13d,%ecx
mov    %eax,%ecx
je     1240 <FFT1DOnce+0x130>
mov    $0x1,%r10d
shl    %cl,%r10d
mov    %r15d,%eax
cltd
idiv   %r10d
test   %eax,%eax
jle    1160 <FFT1DOnce+0x50>
mov    %r10d,%edx
shr    $0x1f,%edx
add    %r10d,%edx
mov    %edx,%r9d
sar    %r9d
and    $0xfffffffe,%edx
add    $0xfffffffe,%edx
movslq %edx,%rdx
mov    %r9d,%r8d
lea    (%r14,%rdx,8),%rbp
xor    %r11d,%r11d
jmp    11b9 <FFT1DOnce+0xa9>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r11d
cmp    %eax,%r11d
je     1160 <FFT1DOnce+0x50>
mov    %r11d,%esi
shl    %cl,%esi
cmp    $0x2,%r10d
jl     11b0 <FFT1DOnce+0xa0>
lea    (%rsi,%rsi,1),%edx
add    %r9d,%esi
add    %esi,%esi
movslq %edx,%rdx
lea    (%r12,%rdx,8),%rdx
movslq %esi,%rsi
lea    (%r12,%rsi,8),%rbx
mov    %r8,%rsi
xor    %edi,%edi
nop
movsd  0x0(%rbp,%rdi,1),%xmm2
mulsd  %xmm0,%xmm2
movupd (%rbx,%rdi,1),%xmm3
movapd %xmm2,%xmm4
xorpd  %xmm1,%xmm4
unpcklpd %xmm2,%xmm4
movsd  -0x8(%rbp,%rdi,1),%xmm2
unpcklpd %xmm2,%xmm2
mulpd  %xmm3,%xmm2
shufpd $0x1,%xmm3,%xmm3
mulpd  %xmm4,%xmm3
addpd  %xmm3,%xmm2
movupd (%rdx,%rdi,1),%xmm3
movapd %xmm3,%xmm4
subpd  %xmm2,%xmm4
movupd %xmm4,(%rbx,%rdi,1)
addpd  %xmm3,%xmm2
movupd %xmm2,(%rdx,%rdi,1)
add    $0x10,%rdi
add    $0xffffffffffffffff,%rsi
jne    11e0 <FFT1DOnce+0xd0>
jmp    11b0 <FFT1DOnce+0xa0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @FFT1DOnce(i32 %0, i32 %1, i32 %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double* %3, double** %9
store double* %4, double** %10
%26 = load i32, i32* %8
%27 = load i32, i32* %7
%28 = load double*, double** %10
%29 = call i32 (i32, i32, double*, ...) bitcast (i32 (...)* @Reverse to i32 (i32, i32, double*, ...)*)(i32 %26, i32 %27, double* %28)
store i32 1, i32* %13
br label %30
30: ; preds = %171, %5
%31 = load i32, i32* %13
%32 = load i32, i32* %7
%33 = icmp sle i32 %31, %32
br i1 %33, label %34, label %174
34: ; preds = %30
%35 = load i32, i32* %13
%36 = shl i32 1, %35
store i32 %36, i32* %14
%37 = load i32, i32* %8
%38 = load i32, i32* %14
%39 = sdiv i32 %37, %38
store i32 %39, i32* %15
%40 = load i32, i32* %14
%41 = sdiv i32 %40, 2
store i32 %41, i32* %16
%42 = load double*, double** %9
%43 = load i32, i32* %16
%44 = sub nsw i32 %43, 1
%45 = mul nsw i32 2, %44
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %42, i64 %46
store double* %47, double** %17
store i32 0, i32* %12
br label %48
48: ; preds = %167, %34
%49 = load i32, i32* %12
%50 = load i32, i32* %15
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %170
52: ; preds = %48
%53 = load double*, double** %10
%54 = load i32, i32* %12
%55 = load i32, i32* %14
%56 = mul nsw i32 %54, %55
%57 = mul nsw i32 2, %56
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %53, i64 %58
store double* %59, double** %18
%60 = load double*, double** %10
%61 = load i32, i32* %12
%62 = load i32, i32* %14
%63 = mul nsw i32 %61, %62
%64 = load i32, i32* %16
%65 = add nsw i32 %63, %64
%66 = mul nsw i32 2, %65
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %60, i64 %67
store double* %68, double** %19
store i32 0, i32* %11
br label %69
69: ; preds = %163, %52
%70 = load i32, i32* %11
%71 = load i32, i32* %16
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %166
73: ; preds = %69
%74 = load double*, double** %17
%75 = load i32, i32* %11
%76 = mul nsw i32 2, %75
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %74, i64 %77
%79 = load double, double* %78
store double %79, double* %20
%80 = load i32, i32* %6
%81 = sitofp i32 %80 to double
%82 = load double*, double** %17
%83 = load i32, i32* %11
%84 = mul nsw i32 2, %83
%85 = add nsw i32 %84, 1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %82, i64 %86
%88 = load double, double* %87
%89 = fmul double %81, %88
store double %89, double* %21
%90 = load double*, double** %19
%91 = load i32, i32* %11
%92 = mul nsw i32 2, %91
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %90, i64 %93
%95 = load double, double* %94
store double %95, double* %24
%96 = load double*, double** %19
%97 = load i32, i32* %11
%98 = mul nsw i32 2, %97
%99 = add nsw i32 %98, 1
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %96, i64 %100
%102 = load double, double* %101
store double %102, double* %25
%103 = load double, double* %20
%104 = load double, double* %24
%105 = load double, double* %21
%106 = load double, double* %25
%107 = fmul double %105, %106
%108 = fneg double %107
%109 = call double @llvm.fmuladd.f64(double %103, double %104, double %108)
store double %109, double* %22
%110 = load double, double* %20
%111 = load double, double* %25
%112 = load double, double* %21
%113 = load double, double* %24
%114 = fmul double %112, %113
%115 = call double @llvm.fmuladd.f64(double %110, double %111, double %114)
store double %115, double* %23
%116 = load double*, double** %18
%117 = load i32, i32* %11
%118 = mul nsw i32 2, %117
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %116, i64 %119
%121 = load double, double* %120
store double %121, double* %24
%122 = load double*, double** %18
%123 = load i32, i32* %11
%124 = mul nsw i32 2, %123
%125 = add nsw i32 %124, 1
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double, double* %122, i64 %126
%128 = load double, double* %127
store double %128, double* %25
%129 = load double, double* %24
%130 = load double, double* %22
%131 = fsub double %129, %130
%132 = load double*, double** %19
%133 = load i32, i32* %11
%134 = mul nsw i32 2, %133
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %132, i64 %135
store double %131, double* %136
%137 = load double, double* %25
%138 = load double, double* %23
%139 = fsub double %137, %138
%140 = load double*, double** %19
%141 = load i32, i32* %11
%142 = mul nsw i32 2, %141
%143 = add nsw i32 %142, 1
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double, double* %140, i64 %144
store double %139, double* %145
%146 = load double, double* %24
%147 = load double, double* %22
%148 = fadd double %146, %147
%149 = load double*, double** %18
%150 = load i32, i32* %11
%151 = mul nsw i32 2, %150
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds double, double* %149, i64 %152
store double %148, double* %153
%154 = load double, double* %25
%155 = load double, double* %23
%156 = fadd double %154, %155
%157 = load double*, double** %18
%158 = load i32, i32* %11
%159 = mul nsw i32 2, %158
%160 = add nsw i32 %159, 1
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds double, double* %157, i64 %161
store double %156, double* %162
br label %163
163: ; preds = %73
%164 = load i32, i32* %11
%165 = add nsw i32 %164, 1
store i32 %165, i32* %11
br label %69
166: ; preds = %69
br label %167
167: ; preds = %166
%168 = load i32, i32* %12
%169 = add nsw i32 %168, 1
store i32 %169, i32* %12
br label %48
170: ; preds = %48
br label %171
171: ; preds = %170
%172 = load i32, i32* %13
%173 = add nsw i32 %172, 1
store i32 %173, i32* %13
br label %30
174: ; preds = %30
ret void
}

LLVM IR (-O2):
define void @FFT1DOnce(i32 %0, i32 %1, i32 %2, double* nocapture %3, double* %4) {
%6 = tail call i32 (i32, i32, double*, ...) bitcast (i32 (...)* @Reverse to i32 (i32, i32, double*, ...)*)(i32 %2, i32 %1, double* %4)
%7 = icmp slt i32 %1, 1
br i1 %7, label %68, label %8
8: ; preds = %5
%9 = sitofp i32 %0 to double
br label %10
10: ; preds = %8, %65
%11 = phi i32 [ 1, %8 ], [ %66, %65 ]
%12 = shl nuw i32 1, %11
%13 = sdiv i32 %2, %12
%14 = sdiv i32 %12, 2
%15 = shl nsw i32 %14, 1
%16 = add i32 %15, -2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %3, i64 %17
%19 = icmp sgt i32 %13, 0
br i1 %19, label %20, label %65
20: ; preds = %10
%21 = icmp sgt i32 %12, 1
%22 = zext i32 %14 to i64
br label %23
23: ; preds = %20, %62
%24 = phi i32 [ 0, %20 ], [ %63, %62 ]
%25 = shl i32 %24, %11
%26 = shl nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %4, i64 %27
%29 = add nsw i32 %25, %14
%30 = shl nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %4, i64 %31
br i1 %21, label %33, label %62
33: ; preds = %23, %33
%34 = phi i64 [ %60, %33 ], [ 0, %23 ]
%35 = shl nuw nsw i64 %34, 1
%36 = getelementptr inbounds double, double* %18, i64 %35
%37 = load double, double* %36
%38 = or i64 %35, 1
%39 = getelementptr inbounds double, double* %18, i64 %38
%40 = load double, double* %39
%41 = fmul double %40, %9
%42 = getelementptr inbounds double, double* %32, i64 %35
%43 = bitcast double* %42 to <2 x double>*
%44 = load <2 x double>, <2 x double>* %43
%45 = fneg double %41
%46 = insertelement <2 x double> poison, double %41, i64 0
%47 = insertelement <2 x double> %46, double %45, i64 1
%48 = fmul <2 x double> %44, %47
%49 = shufflevector <2 x double> %48, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%50 = insertelement <2 x double> poison, double %37, i64 0
%51 = shufflevector <2 x double> %50, <2 x double> poison, <2 x i32> zeroinitializer
%52 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %51, <2 x double> %44, <2 x double> %49)
%53 = getelementptr inbounds double, double* %28, i64 %35
%54 = bitcast double* %53 to <2 x double>*
%55 = load <2 x double>, <2 x double>* %54
%56 = fsub <2 x double> %55, %52
%57 = bitcast double* %42 to <2 x double>*
store <2 x double> %56, <2 x double>* %57
%58 = fadd <2 x double> %55, %52
%59 = bitcast double* %53 to <2 x double>*
store <2 x double> %58, <2 x double>* %59
%60 = add nuw nsw i64 %34, 1
%61 = icmp eq i64 %60, %22
br i1 %61, label %62, label %33
62: ; preds = %33, %23
%63 = add nuw nsw i32 %24, 1
%64 = icmp eq i32 %63, %13
br i1 %64, label %65, label %23
65: ; preds = %62, %10
%66 = add nuw i32 %11, 1
%67 = icmp eq i32 %11, %1
br i1 %67, label %68, label %10
68: ; preds = %65, %5
ret void
}