#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*/ FFT_10(int, int, int, int, double *, double *);
int /*<<< orphan*/ FFT_2(int, int, int, int, double *, double *);
int /*<<< orphan*/ FFT_3(int, int, int, int, double *, double *);
int /*<<< orphan*/ FFT_4(int, int, int, int, double *, double *);
int /*<<< orphan*/ FFT_5(int, int, int, int, double *, double *);
int /*<<< orphan*/ FFT_7(int, int, int, int, double *, double *);
int /*<<< orphan*/ FFT_8(int, int, int, int, double *, double *);
int /*<<< orphan*/ FFT_odd(int, int, int, int, double *, double *, double *,
                           double *);
int /*<<< orphan*/ initTrig(int, double *, double *);
void transf(int sofarRadix, int radix, int remainRadix, double yRe[],
            double yIm[]) {
  int groupOffset, dataOffset;
  int dataNo;
  double trigRe[37], trigIm[37];
  if (radix > 10)
    initTrig(radix, trigRe, trigIm);
  dataOffset = 0;
  groupOffset = dataOffset;
  for (dataNo = 0; dataNo < sofarRadix; dataNo++) {
    switch (radix) {
    case 2:
      FFT_2(sofarRadix, radix, remainRadix, groupOffset, yRe, yIm);
      break;
    case 3:
      FFT_3(sofarRadix, radix, remainRadix, groupOffset, yRe, yIm);
      break;
    case 4:
      FFT_4(sofarRadix, radix, remainRadix, groupOffset, yRe, yIm);
      break;
    case 5:
      FFT_5(sofarRadix, radix, remainRadix, groupOffset, yRe, yIm);
      break;
    case 7:
      FFT_7(sofarRadix, radix, remainRadix, groupOffset, yRe, yIm);
      break;
    case 8:
      FFT_8(sofarRadix, radix, remainRadix, groupOffset, yRe, yIm);
      break;
    case 10:
      FFT_10(sofarRadix, radix, remainRadix, groupOffset, yRe, yIm);
      break;
    default:
      FFT_odd(sofarRadix, radix, remainRadix, groupOffset, trigRe, trigIm, yRe,
              yIm);
      break;
    }
    dataOffset = dataOffset + 1;
    groupOffset = dataOffset;
  }
}


x86 assembly (clang, -O0):
<transf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2b0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    11cc <transf+0x3c>
mov    -0x8(%rbp),%edi
lea    -0x160(%rbp),%rsi
lea    -0x290(%rbp),%rdx
call   1060 <initTrig@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    133a <transf+0x1aa>
mov    -0x8(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x298(%rbp)
sub    $0x8,%eax
ja     12ed <transf+0x15d>
mov    -0x298(%rbp),%rax
lea    0xdee(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   10a0 <FFT_2@plt>
jmp    131d <transf+0x18d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1050 <FFT_3@plt>
jmp    131d <transf+0x18d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1090 <FFT_4@plt>
jmp    131d <transf+0x18d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1040 <FFT_5@plt>
jmp    131d <transf+0x18d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <FFT_7@plt>
jmp    131d <transf+0x18d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1080 <FFT_8@plt>
jmp    131d <transf+0x18d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1070 <FFT_10@plt>
jmp    131d <transf+0x18d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x24(%rbp),%ecx
lea    -0x160(%rbp),%r8
lea    -0x290(%rbp),%r9
mov    -0x18(%rbp),%r10
mov    -0x20(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10b0 <FFT_odd@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11e0 <transf+0x50>
add    $0x2b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transf>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x268,%rsp
mov    %r8,(%rsp)
mov    %rcx,%r12
mov    %edx,%r13d
mov    %edi,%ebx
mov    %rsi,0x8(%rsp)
cmp    $0xb,%esi
jl     11ce <transf+0x3e>
lea    0x140(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    0x8(%rsp),%rdi
call   1060 <initTrig@plt>
test   %ebx,%ebx
jle    12fc <transf+0x16c>
xor    %ebp,%ebp
mov    0x8(%rsp),%rax
lea    -0x2(%rax),%r15d
lea    0xe18(%rip),%r14
jmp    122b <transf+0x9b>
mov    %ebx,%edi
mov    0x8(%rsp),%rsi
mov    %r13d,%edx
mov    %ebp,%ecx
lea    0x140(%rsp),%r8
lea    0x10(%rsp),%r9
push   (%rsp)
push   %r12
call   10b0 <FFT_odd@plt>
add    $0x10,%rsp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    %ebp,%ebx
je     12fc <transf+0x16c>
cmp    $0x8,%r15d
ja     11ea <transf+0x5a>
movslq (%r14,%r15,4),%rax
add    %r14,%rax
jmp    *%rax
mov    %ebx,%edi
mov    $0x2,%esi
mov    %r13d,%edx
mov    %ebp,%ecx
mov    %r12,%r8
mov    (%rsp),%r9
call   10a0 <FFT_2@plt>
jmp    1220 <transf+0x90>
mov    %ebx,%edi
mov    $0x3,%esi
mov    %r13d,%edx
mov    %ebp,%ecx
mov    %r12,%r8
mov    (%rsp),%r9
call   1050 <FFT_3@plt>
jmp    1220 <transf+0x90>
mov    %ebx,%edi
mov    $0x8,%esi
mov    %r13d,%edx
mov    %ebp,%ecx
mov    %r12,%r8
mov    (%rsp),%r9
call   1080 <FFT_8@plt>
jmp    1220 <transf+0x90>
mov    %ebx,%edi
mov    $0x4,%esi
mov    %r13d,%edx
mov    %ebp,%ecx
mov    %r12,%r8
mov    (%rsp),%r9
call   1090 <FFT_4@plt>
jmp    1220 <transf+0x90>
mov    %ebx,%edi
mov    $0x5,%esi
mov    %r13d,%edx
mov    %ebp,%ecx
mov    %r12,%r8
mov    (%rsp),%r9
call   1040 <FFT_5@plt>
jmp    1220 <transf+0x90>
mov    %ebx,%edi
mov    $0x7,%esi
mov    %r13d,%edx
mov    %ebp,%ecx
mov    %r12,%r8
mov    (%rsp),%r9
call   1030 <FFT_7@plt>
jmp    1220 <transf+0x90>
mov    %ebx,%edi
mov    $0xa,%esi
mov    %r13d,%edx
mov    %ebp,%ecx
mov    %r12,%r8
mov    (%rsp),%r9
call   1070 <FFT_10@plt>
jmp    1220 <transf+0x90>
add    $0x268,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @transf(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 [37 x double]
%15 = alloca [37 x 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
%16 = load i32, i32* %7
%17 = icmp sgt i32 %16, 10
br i1 %17, label %18, label %23
18: ; preds = %5
%19 = load i32, i32* %7
%20 = getelementptr inbounds [37 x double], [37 x double]* %14, i64 0, i64 0
%21 = getelementptr inbounds [37 x double], [37 x double]* %15, i64 0, i64 0
%22 = call i32 @initTrig(i32 %19, double* %20, double* %21)
br label %23
23: ; preds = %18, %5
store i32 0, i32* %12
%24 = load i32, i32* %12
store i32 %24, i32* %11
store i32 0, i32* %13
br label %25
25: ; preds = %101, %23
%26 = load i32, i32* %13
%27 = load i32, i32* %6
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %104
29: ; preds = %25
%30 = load i32, i32* %7
switch i32 %30, label %87 [
i32 2, label %31
i32 3, label %39
i32 4, label %47
i32 5, label %55
i32 7, label %63
i32 8, label %71
i32 10, label %79
]
31: ; preds = %29
%32 = load i32, i32* %6
%33 = load i32, i32* %7
%34 = load i32, i32* %8
%35 = load i32, i32* %11
%36 = load double*, double** %9
%37 = load double*, double** %10
%38 = call i32 @FFT_2(i32 %32, i32 %33, i32 %34, i32 %35, double* %36, double* %37)
br label %97
39: ; preds = %29
%40 = load i32, i32* %6
%41 = load i32, i32* %7
%42 = load i32, i32* %8
%43 = load i32, i32* %11
%44 = load double*, double** %9
%45 = load double*, double** %10
%46 = call i32 @FFT_3(i32 %40, i32 %41, i32 %42, i32 %43, double* %44, double* %45)
br label %97
47: ; preds = %29
%48 = load i32, i32* %6
%49 = load i32, i32* %7
%50 = load i32, i32* %8
%51 = load i32, i32* %11
%52 = load double*, double** %9
%53 = load double*, double** %10
%54 = call i32 @FFT_4(i32 %48, i32 %49, i32 %50, i32 %51, double* %52, double* %53)
br label %97
55: ; preds = %29
%56 = load i32, i32* %6
%57 = load i32, i32* %7
%58 = load i32, i32* %8
%59 = load i32, i32* %11
%60 = load double*, double** %9
%61 = load double*, double** %10
%62 = call i32 @FFT_5(i32 %56, i32 %57, i32 %58, i32 %59, double* %60, double* %61)
br label %97
63: ; preds = %29
%64 = load i32, i32* %6
%65 = load i32, i32* %7
%66 = load i32, i32* %8
%67 = load i32, i32* %11
%68 = load double*, double** %9
%69 = load double*, double** %10
%70 = call i32 @FFT_7(i32 %64, i32 %65, i32 %66, i32 %67, double* %68, double* %69)
br label %97
71: ; preds = %29
%72 = load i32, i32* %6
%73 = load i32, i32* %7
%74 = load i32, i32* %8
%75 = load i32, i32* %11
%76 = load double*, double** %9
%77 = load double*, double** %10
%78 = call i32 @FFT_8(i32 %72, i32 %73, i32 %74, i32 %75, double* %76, double* %77)
br label %97
79: ; preds = %29
%80 = load i32, i32* %6
%81 = load i32, i32* %7
%82 = load i32, i32* %8
%83 = load i32, i32* %11
%84 = load double*, double** %9
%85 = load double*, double** %10
%86 = call i32 @FFT_10(i32 %80, i32 %81, i32 %82, i32 %83, double* %84, double* %85)
br label %97
87: ; preds = %29
%88 = load i32, i32* %6
%89 = load i32, i32* %7
%90 = load i32, i32* %8
%91 = load i32, i32* %11
%92 = getelementptr inbounds [37 x double], [37 x double]* %14, i64 0, i64 0
%93 = getelementptr inbounds [37 x double], [37 x double]* %15, i64 0, i64 0
%94 = load double*, double** %9
%95 = load double*, double** %10
%96 = call i32 @FFT_odd(i32 %88, i32 %89, i32 %90, i32 %91, double* %92, double* %93, double* %94, double* %95)
br label %97
97: ; preds = %87, %79, %71, %63, %55, %47, %39, %31
%98 = load i32, i32* %12
%99 = add nsw i32 %98, 1
store i32 %99, i32* %12
%100 = load i32, i32* %12
store i32 %100, i32* %11
br label %101
101: ; preds = %97
%102 = load i32, i32* %13
%103 = add nsw i32 %102, 1
store i32 %103, i32* %13
br label %25
104: ; preds = %25
ret void
}

LLVM IR (-O2):
define void @transf(i32 %0, i32 %1, i32 %2, double* %3, double* %4) {
%6 = alloca [37 x double]
%7 = alloca [37 x double]
%8 = bitcast [37 x double]* %6 to i8*
%9 = bitcast [37 x double]* %7 to i8*
%10 = icmp sgt i32 %1, 10
br i1 %10, label %11, label %15
11: ; preds = %5
%12 = getelementptr inbounds [37 x double], [37 x double]* %6, i64 0, i64 0
%13 = getelementptr inbounds [37 x double], [37 x double]* %7, i64 0, i64 0
%14 = call i32 @initTrig(i32 %1, double* %12, double* %13)
br label %15
15: ; preds = %11, %5
%16 = icmp sgt i32 %0, 0
br i1 %16, label %17, label %41
17: ; preds = %15
%18 = getelementptr inbounds [37 x double], [37 x double]* %6, i64 0, i64 0
%19 = getelementptr inbounds [37 x double], [37 x double]* %7, i64 0, i64 0
br label %20
20: ; preds = %17, %38
%21 = phi i32 [ 0, %17 ], [ %39, %38 ]
switch i32 %1, label %36 [
i32 2, label %22
i32 3, label %24
i32 4, label %26
i32 5, label %28
i32 7, label %30
i32 8, label %32
i32 10, label %34
]
22: ; preds = %20
%23 = call i32 @FFT_2(i32 %0, i32 2, i32 %2, i32 %21, double* %3, double* %4)
br label %38
24: ; preds = %20
%25 = call i32 @FFT_3(i32 %0, i32 3, i32 %2, i32 %21, double* %3, double* %4)
br label %38
26: ; preds = %20
%27 = call i32 @FFT_4(i32 %0, i32 4, i32 %2, i32 %21, double* %3, double* %4)
br label %38
28: ; preds = %20
%29 = call i32 @FFT_5(i32 %0, i32 5, i32 %2, i32 %21, double* %3, double* %4)
br label %38
30: ; preds = %20
%31 = call i32 @FFT_7(i32 %0, i32 7, i32 %2, i32 %21, double* %3, double* %4)
br label %38
32: ; preds = %20
%33 = call i32 @FFT_8(i32 %0, i32 8, i32 %2, i32 %21, double* %3, double* %4)
br label %38
34: ; preds = %20
%35 = call i32 @FFT_10(i32 %0, i32 10, i32 %2, i32 %21, double* %3, double* %4)
br label %38
36: ; preds = %20
%37 = call i32 @FFT_odd(i32 %0, i32 %1, i32 %2, i32 %21, double* %18, double* %19, double* %3, double* %4)
br label %38
38: ; preds = %36, %34, %32, %30, %28, %26, %24, %22
%39 = add nuw nsw i32 %21, 1
%40 = icmp eq i32 %39, %0
br i1 %40, label %41, label %20
41: ; preds = %38, %15
ret void
}