#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*/ bfstages(float *, long, float *, long, unsigned long, int);
void fftrecurs(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU,
               long StageCnt) {
  long i1;
  if (M <= (11 - (sizeof(float) / 8)))
    bfstages(ioptr, M, Utbl, Ustride, NDiffU, StageCnt);
  else {
    for (i1 = 0; i1 < 8; i1++) {
      fftrecurs(&ioptr[i1 * ((unsigned long)1 << (M - 3)) * 2], M - 3, Utbl,
                8 * Ustride, NDiffU, StageCnt - 1);
    }
    bfstages(ioptr, M, Utbl, Ustride, ((unsigned long)1 << (M - 3)), 1);
  }
}


x86 assembly (clang, -O0):
<fftrecurs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpq   $0xb,-0x10(%rbp)
ja     1170 <fftrecurs+0x50>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%rax
mov    %eax,%r9d
call   1030 <bfstages@plt>
jmp    1217 <fftrecurs+0xf7>
movq   $0x0,-0x38(%rbp)
cmpq   $0x8,-0x38(%rbp)
jge    11e3 <fftrecurs+0xc3>
mov    -0x8(%rbp),%rdi
mov    -0x38(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x3,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
imul   %rcx,%rax
shl    $0x1,%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
sub    $0x3,%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
shl    $0x3,%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
sub    $0x1,%r9
call   1040 <fftrecurs@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1178 <fftrecurs+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rcx
sub    $0x3,%rcx
mov    $0x1,%r8d
shl    %cl,%r8
mov    -0x40(%rbp),%rcx
mov    $0x1,%r9d
call   1030 <bfstages@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fftrecurs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%rbx
mov    %r8,%r13
mov    %rdx,%r15
mov    %rdi,%rbp
cmp    $0xc,%rsi
jae    1151 <fftrecurs+0x31>
mov    %rbp,%rdi
mov    %r15,%rdx
mov    %r13,%r8
mov    %ebx,%r9d
jmp    12c6 <fftrecurs+0x1a6>
lea    -0x3(%rsi),%r12
lea    0x0(,%rcx,8),%r14
add    $0xffffffffffffffff,%rbx
mov    %rbp,%rdi
mov    %rsi,0x8(%rsp)
mov    %r12,%rsi
mov    %r15,%rdx
mov    %rcx,0x10(%rsp)
mov    %r14,%rcx
mov    %r13,%r8
mov    %rbx,%r9
call   1040 <fftrecurs@plt>
mov    $0x1,%eax
mov    %r12d,%ecx
shl    %cl,%rax
mov    %rax,(%rsp)
lea    0x0(,%rax,8),%rdi
add    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r13,%r8
mov    %rbx,%r9
call   1040 <fftrecurs@plt>
mov    $0x4,%eax
mov    %r12d,%ecx
shl    %cl,%rax
lea    0x0(,%rax,4),%rdi
add    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r13,%r8
mov    %rbx,%r9
call   1040 <fftrecurs@plt>
mov    $0x6,%eax
mov    %r12d,%ecx
shl    %cl,%rax
lea    0x0(,%rax,4),%rdi
add    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r13,%r8
mov    %rbx,%r9
call   1040 <fftrecurs@plt>
mov    $0x8,%eax
mov    %r12d,%ecx
shl    %cl,%rax
lea    0x0(,%rax,4),%rdi
add    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r13,%r8
mov    %rbx,%r9
call   1040 <fftrecurs@plt>
mov    $0xa,%eax
mov    %r12d,%ecx
shl    %cl,%rax
lea    0x0(,%rax,4),%rdi
add    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r13,%r8
mov    %rbx,%r9
call   1040 <fftrecurs@plt>
mov    $0xc,%eax
mov    %r12d,%ecx
shl    %cl,%rax
lea    0x0(,%rax,4),%rdi
add    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r13,%r8
mov    %rbx,%r9
call   1040 <fftrecurs@plt>
mov    $0xe,%eax
mov    %r12d,%ecx
shl    %cl,%rax
lea    0x0(,%rax,4),%rdi
add    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r13,%r8
mov    %rbx,%r9
call   1040 <fftrecurs@plt>
mov    %rbp,%rdi
mov    0x8(%rsp),%rsi
mov    %r15,%rdx
mov    0x10(%rsp),%rcx
mov    (%rsp),%r8
mov    $0x1,%r9d
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <bfstages@plt>

LLVM IR (-O0):
define void @fftrecurs(float* %0, i64 %1, float* %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca float*
%8 = alloca i64
%9 = alloca float*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
store float* %0, float** %7
store i64 %1, i64* %8
store float* %2, float** %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%14 = load i64, i64* %8
%15 = icmp ule i64 %14, 11
br i1 %15, label %16, label %25
16: ; preds = %6
%17 = load float*, float** %7
%18 = load i64, i64* %8
%19 = load float*, float** %9
%20 = load i64, i64* %10
%21 = load i64, i64* %11
%22 = load i64, i64* %12
%23 = trunc i64 %22 to i32
%24 = call i32 @bfstages(float* %17, i64 %18, float* %19, i64 %20, i64 %21, i32 %23)
br label %58
25: ; preds = %6
store i64 0, i64* %13
br label %26
26: ; preds = %46, %25
%27 = load i64, i64* %13
%28 = icmp slt i64 %27, 8
br i1 %28, label %29, label %49
29: ; preds = %26
%30 = load float*, float** %7
%31 = load i64, i64* %13
%32 = load i64, i64* %8
%33 = sub nsw i64 %32, 3
%34 = shl i64 1, %33
%35 = mul i64 %31, %34
%36 = mul i64 %35, 2
%37 = getelementptr inbounds float, float* %30, i64 %36
%38 = load i64, i64* %8
%39 = sub nsw i64 %38, 3
%40 = load float*, float** %9
%41 = load i64, i64* %10
%42 = mul nsw i64 8, %41
%43 = load i64, i64* %11
%44 = load i64, i64* %12
%45 = sub nsw i64 %44, 1
br label %46
46: ; preds = %29
%47 = load i64, i64* %13
%48 = add nsw i64 %47, 1
store i64 %48, i64* %13
br label %26
49: ; preds = %26
%50 = load float*, float** %7
%51 = load i64, i64* %8
%52 = load float*, float** %9
%53 = load i64, i64* %10
%54 = load i64, i64* %8
%55 = sub nsw i64 %54, 3
%56 = shl i64 1, %55
%57 = call i32 @bfstages(float* %50, i64 %51, float* %52, i64 %53, i64 %56, i32 1)
br label %58
58: ; preds = %49, %16
ret void
}

LLVM IR (-O2):
define void @fftrecurs(float* %0, i64 %1, float* %2, i64 %3, i64 %4, i64 %5) {
%7 = icmp ult i64 %1, 12
br i1 %7, label %28, label %8
8: ; preds = %6
%9 = add nsw i64 %1, -3
%10 = shl nsw i64 %3, 3
%11 = add nsw i64 %5, -1
tail call void @fftrecurs(float* %0, i64 %9, float* %2, i64 %10, i64 %4, i64 %11)
%12 = shl nuw i64 1, %9
%13 = shl i64 %12, 1
%14 = getelementptr inbounds float, float* %0, i64 %13
tail call void @fftrecurs(float* %14, i64 %9, float* %2, i64 %10, i64 %4, i64 %11)
%15 = shl i64 4, %9
%16 = getelementptr inbounds float, float* %0, i64 %15
tail call void @fftrecurs(float* %16, i64 %9, float* %2, i64 %10, i64 %4, i64 %11)
%17 = shl i64 6, %9
%18 = getelementptr inbounds float, float* %0, i64 %17
tail call void @fftrecurs(float* %18, i64 %9, float* %2, i64 %10, i64 %4, i64 %11)
%19 = shl i64 8, %9
%20 = getelementptr inbounds float, float* %0, i64 %19
tail call void @fftrecurs(float* %20, i64 %9, float* %2, i64 %10, i64 %4, i64 %11)
%21 = shl i64 10, %9
%22 = getelementptr inbounds float, float* %0, i64 %21
tail call void @fftrecurs(float* %22, i64 %9, float* %2, i64 %10, i64 %4, i64 %11)
%23 = shl i64 12, %9
%24 = getelementptr inbounds float, float* %0, i64 %23
tail call void @fftrecurs(float* %24, i64 %9, float* %2, i64 %10, i64 %4, i64 %11)
%25 = shl i64 14, %9
%26 = getelementptr inbounds float, float* %0, i64 %25
tail call void @fftrecurs(float* %26, i64 %9, float* %2, i64 %10, i64 %4, i64 %11)
%27 = tail call i32 @bfstages(float* %0, i64 %1, float* %2, i64 %3, i64 %12, i32 1)
br label %31
28: ; preds = %6
%29 = trunc i64 %5 to i32
%30 = tail call i32 @bfstages(float* %0, i64 %1, float* %2, i64 %3, i64 %4, i32 %29)
br label %31
31: ; preds = %8, %28
ret void
}