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

LLVM IR (-O2):
define i32 @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 i32 undef
}