#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 */
float acos(int);
float cos(int);
int /*<<< orphan*/ fftcxb(float *, float *, int, int);
int /*<<< orphan*/ fftcxf(float *, float *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ fftrxb(float *, float *, int, int);
int /*<<< orphan*/ fftrxf(float *, float *, int, int, int);
int /*<<< orphan*/ free_fvector(float *, int);
float *fvector(int, int);
int /*<<< orphan*/ phase(float *, float *, int, int /*<<< orphan*/, float, int);
float pow(float, float);
int /*<<< orphan*/ watwa_select(int, int, float *, float *, int, float, float *,
                                int /*<<< orphan*/ *);
int /*<<< orphan*/ xxrotate(float *, int, int, int);
int watwa(int cospow, int iscmplx, float *xreal, float *ximag, int isize,
          float kc, float wshift, int dspshift) {
  int k, i, kcmax = 512, is_real2complex = 0;
  float pi, fk, fks, *fcv, tmp;
  int iopt = 3;
  cospow = (((1) > (cospow)) ? (1) : (cospow));
  kc = (((1) > (kc)) ? (1) : (kc));
  kc = (((kc) < (isize / 2 - 1)) ? (kc) : (isize / 2 - 1));
  kc = (((kc) < (kcmax)) ? (kc) : (kcmax));
  pi = acos(-1.);
  k = 2 * kc + 1;
  fk = (float)k;
  fks = 0.0;
  fcv = fvector(1, k);
  for (i = 1; i <= k; i++) {
    fcv[i] = cos((i - kc - 1) * pi / fk);
    fcv[i] = pow(fcv[i], (float)cospow);
    fks += fcv[i];
  }
  for (i = 1; i <= k; i++)
    fcv[i] /= fks;
  tmp = wshift * 360;
  if (!iscmplx) {
    fftrxf(xreal, ximag, isize, 2 * isize, dspshift);
    xxrotate(xreal, 1, isize, (int)wshift);
    xxrotate(ximag, 1, isize, (int)wshift);
    fftcxb(xreal, ximag, isize, isize);
    is_real2complex = 1;
    iscmplx = 1;
  } else {
    if (dspshift) {
      xxrotate(xreal, 1, isize, dspshift);
      xxrotate(ximag, 1, isize, dspshift);
    }
    phase(xreal, ximag, isize, 0, tmp, 1);
  }
  watwa_select(iopt, iscmplx, xreal - 1, ximag - 1, isize, kc, fcv, NULL);
  free_fvector(fcv, 1);
  if (is_real2complex) {
    fftcxf(xreal, ximag, isize, isize, 0);
    xxrotate(xreal, 1, isize, (int)-wshift);
    xxrotate(ximag, 1, isize, (int)-wshift);
    fftrxb(xreal, ximag, isize, isize);
  } else {
    phase(xreal, ximag, isize, 0, -tmp, 1);
  }
  if (dspshift) {
    xxrotate(xreal, 1, isize, -dspshift);
    xxrotate(ximag, 1, isize, -dspshift);
  }
  return 1;
}


x86 assembly (clang, -O0):
<watwa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
movss  %xmm0,-0x20(%rbp)
movss  %xmm1,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
movl   $0x200,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x3,-0x58(%rbp)
mov    $0x1,%eax
cmp    -0x4(%rbp),%eax
jle    1218 <watwa+0x58>
mov    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    121e <watwa+0x5e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x4(%rbp)
movss  0xdd4(%rip),%xmm0
ucomiss -0x20(%rbp),%xmm0
jbe    1248 <watwa+0x88>
movss  0xdc2(%rip),%xmm0
movss  %xmm0,-0x60(%rbp)
jmp    1252 <watwa+0x92>
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x60(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
cvtsi2ss %eax,%xmm0
ucomiss %xmm1,%xmm0
jbe    128b <watwa+0xcb>
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x64(%rbp)
jmp    12a2 <watwa+0xe2>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0x64(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
cvtsi2ssl -0x34(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    12ce <watwa+0x10e>
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x68(%rbp)
jmp    12d8 <watwa+0x118>
cvtsi2ssl -0x34(%rbp),%xmm0
movss  %xmm0,-0x68(%rbp)
movss  -0x68(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    $0xffffffff,%edi
call   1070 <acos@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x20(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xcfe(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x2c(%rbp)
cvtsi2ssl -0x2c(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x2c(%rbp),%esi
mov    $0x1,%edi
call   1090 <fvector@plt>
mov    %rax,-0x50(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jg     13c2 <watwa+0x202>
cvtsi2ssl -0x30(%rbp),%xmm0
subss  -0x20(%rbp),%xmm0
movss  0xcab(%rip),%xmm1
subss  %xmm1,%xmm0
mulss  -0x3c(%rbp),%xmm0
divss  -0x40(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   10a0 <cos@plt>
mov    -0x50(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x50(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
call   10c0 <pow@plt>
mov    -0x50(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x50(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1337 <watwa+0x177>
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jg     13fe <watwa+0x23e>
movss  -0x44(%rbp),%xmm1
mov    -0x50(%rbp),%rax
movslq -0x30(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    13c9 <watwa+0x209>
movss  0xbfe(%rip),%xmm0
mulss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x54(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1486 <watwa+0x2c6>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x28(%rbp),%r8d
call   1080 <fftrxf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
cvttss2si -0x24(%rbp),%ecx
mov    $0x1,%esi
call   1030 <xxrotate@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
cvttss2si -0x24(%rbp),%ecx
mov    $0x1,%esi
call   1030 <xxrotate@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   10b0 <fftcxb@plt>
movl   $0x1,-0x38(%rbp)
movl   $0x1,-0x8(%rbp)
jmp    14d5 <watwa+0x315>
cmpl   $0x0,-0x28(%rbp)
je     14b8 <watwa+0x2f8>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    $0x1,%esi
call   1030 <xxrotate@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    $0x1,%esi
call   1030 <xxrotate@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
movss  -0x54(%rbp),%xmm0
xor    %ecx,%ecx
mov    $0x1,%r8d
call   10d0 <phase@plt>
mov    -0x58(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
add    $0xfffffffffffffffc,%rdx
mov    -0x18(%rbp),%rcx
add    $0xfffffffffffffffc,%rcx
mov    -0x1c(%rbp),%r8d
movss  -0x20(%rbp),%xmm0
mov    -0x50(%rbp),%r9
xor    %eax,%eax
movq   $0x0,(%rsp)
call   1050 <watwa_select@plt>
mov    -0x50(%rbp),%rdi
mov    $0x1,%esi
call   1040 <free_fvector@plt>
cmpl   $0x0,-0x38(%rbp)
je     159b <watwa+0x3db>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x1c(%rbp),%ecx
xor    %r8d,%r8d
call   10e0 <fftcxf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
movss  -0x24(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvttss2si %xmm0,%ecx
mov    $0x1,%esi
call   1030 <xxrotate@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
movss  -0x24(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvttss2si %xmm0,%ecx
mov    $0x1,%esi
call   1030 <xxrotate@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1060 <fftrxb@plt>
jmp    15c5 <watwa+0x405>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
movss  -0x54(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
xor    %ecx,%ecx
mov    $0x1,%r8d
call   10d0 <phase@plt>
cmpl   $0x0,-0x28(%rbp)
je     15fb <watwa+0x43b>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
xor    %ecx,%ecx
sub    -0x28(%rbp),%ecx
mov    $0x1,%esi
call   1030 <xxrotate@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
xor    %ecx,%ecx
sub    -0x28(%rbp),%ecx
mov    $0x1,%esi
call   1030 <xxrotate@plt>
mov    $0x1,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<watwa>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9d,0x14(%rsp)
movaps %xmm1,0x50(%rsp)
mov    %rcx,0x48(%rsp)
mov    %rdx,0x40(%rsp)
mov    %esi,%r13d
mov    %edi,%r14d
movss  0xe10(%rip),%xmm2
mov    %r8d,%eax
shr    $0x1f,%eax
mov    %r8,0x38(%rsp)
add    %r8d,%eax
sar    %eax
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
maxss  %xmm0,%xmm2
minss  %xmm1,%xmm2
minss  0xdea(%rip),%xmm2
movss  %xmm2,0xc(%rsp)
mov    $0xffffffff,%edi
call   1070 <acos@plt>
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
addss  %xmm0,%xmm0
addss  0xdbe(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
cvttss2si %xmm0,%r12d
mov    $0x1,%ebx
mov    $0x1,%edi
mov    %r12d,%esi
call   1090 <fvector@plt>
mov    %rax,%rbp
test   %r12d,%r12d
jle    1399 <watwa+0x1d9>
cvttps2dq 0x20(%rsp),%xmm0
test   %r14d,%r14d
cmovg  %r14d,%ebx
cvtdq2ps %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
movss  %xmm0,0x1c(%rsp)
lea    0x1(%r12),%r14d
xorps  %xmm3,%xmm3
mov    $0x1,%ebx
nopl   0x0(%rax)
movaps %xmm3,0x20(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
subss  0xc(%rsp),%xmm0
addss  0xd4e(%rip),%xmm0
mulss  0x10(%rsp),%xmm0
divss  0x60(%rsp),%xmm0
cvttss2si %xmm0,%edi
call   10a0 <cos@plt>
movss  0x1c(%rsp),%xmm1
call   10c0 <pow@plt>
movaps 0x20(%rsp),%xmm3
movss  %xmm0,0x0(%rbp,%rbx,4)
addss  %xmm0,%xmm3
add    $0x1,%rbx
cmp    %rbx,%r14
jne    12a0 <watwa+0xe0>
test   %r12d,%r12d
jle    1399 <watwa+0x1d9>
lea    -0x1(%r14),%rcx
mov    $0x1,%eax
cmp    $0x4,%rcx
jb     1380 <watwa+0x1c0>
mov    %rcx,%rax
and    $0xfffffffffffffffc,%rax
movaps %xmm3,%xmm0
shufps $0x0,%xmm3,%xmm0
lea    -0x4(%rax),%rsi
mov    %rsi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     158b <watwa+0x3cb>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
mov    $0x1,%esi
nopl   0x0(%rax)
movups 0x0(%rbp,%rsi,4),%xmm1
movups 0x10(%rbp,%rsi,4),%xmm2
divps  %xmm0,%xmm1
movups %xmm1,0x0(%rbp,%rsi,4)
divps  %xmm0,%xmm2
movups %xmm2,0x10(%rbp,%rsi,4)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1340 <watwa+0x180>
test   $0x1,%dl
je     1376 <watwa+0x1b6>
movups 0x0(%rbp,%rsi,4),%xmm1
divps  %xmm0,%xmm1
movups %xmm1,0x0(%rbp,%rsi,4)
cmp    %rax,%rcx
je     1399 <watwa+0x1d9>
or     $0x1,%rax
nop
movss  0x0(%rbp,%rax,4),%xmm0
divss  %xmm3,%xmm0
movss  %xmm0,0x0(%rbp,%rax,4)
add    $0x1,%rax
cmp    %rax,%r14
jne    1380 <watwa+0x1c0>
movss  0xc6b(%rip),%xmm1
movaps 0x50(%rsp),%xmm0
mulss  %xmm0,%xmm1
movaps %xmm1,0x20(%rsp)
mov    %r13d,%r15d
test   %r13d,%r13d
mov    %r13d,0x18(%rsp)
je     1418 <watwa+0x258>
mov    0x14(%rsp),%r15d
test   %r15d,%r15d
mov    0x48(%rsp),%r14
mov    0x40(%rsp),%rbx
mov    0x38(%rsp),%r12
je     13fb <watwa+0x23b>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
call   1030 <xxrotate@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
call   1030 <xxrotate@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
xor    %ecx,%ecx
movaps 0x20(%rsp),%xmm0
mov    $0x1,%r8d
call   10d0 <phase@plt>
jmp    1486 <watwa+0x2c6>
mov    0x38(%rsp),%r12
lea    (%r12,%r12,1),%ecx
mov    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    0x48(%rsp),%r14
mov    %r14,%rsi
mov    %r12d,%edx
mov    0x14(%rsp),%r15d
mov    %r15d,%r8d
call   1080 <fftrxf@plt>
cvttss2si 0x50(%rsp),%ecx
mov    %ecx,0x10(%rsp)
mov    $0x1,%r13d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
call   1030 <xxrotate@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
mov    0x10(%rsp),%ecx
call   1030 <xxrotate@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
mov    %r12d,%ecx
call   10b0 <fftcxb@plt>
movss  0xc(%rsp),%xmm0
lea    -0x4(%rbx),%rdx
lea    -0x4(%r14),%rcx
movq   $0x0,(%rsp)
mov    $0x3,%edi
mov    %r13d,%esi
mov    %r12d,%r8d
mov    %rbp,%r9
call   1050 <watwa_select@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
call   1040 <free_fvector@plt>
cmpl   $0x0,0x18(%rsp)
je     1527 <watwa+0x367>
movaps 0x20(%rsp),%xmm0
xorps  0xb41(%rip),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   10d0 <phase@plt>
test   %r15d,%r15d
je     1513 <watwa+0x353>
neg    %r15d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
call   1030 <xxrotate@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
call   1030 <xxrotate@plt>
mov    $0x1,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
mov    %r12d,%ecx
xor    %r8d,%r8d
call   10e0 <fftcxf@plt>
movaps 0x50(%rsp),%xmm0
xorps  0xac9(%rip),%xmm0
cvttss2si %xmm0,%ebp
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
call   1030 <xxrotate@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
call   1030 <xxrotate@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
mov    %r12d,%ecx
call   1060 <fftrxb@plt>
test   %r15d,%r15d
jne    14ea <watwa+0x32a>
jmp    1513 <watwa+0x353>
mov    $0x1,%esi
test   $0x1,%dl
jne    1369 <watwa+0x1a9>
jmp    1376 <watwa+0x1b6>

LLVM IR (-O0):
define i32 @watwa(i32 %0, i32 %1, float* %2, float* %3, i32 %4, float %5, float %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca float*
%12 = alloca float*
%13 = alloca i32
%14 = alloca float
%15 = alloca float
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float*
%25 = alloca float
%26 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store float* %2, float** %11
store float* %3, float** %12
store i32 %4, i32* %13
store float %5, float* %14
store float %6, float* %15
store i32 %7, i32* %16
store i32 512, i32* %19
store i32 0, i32* %20
store i32 3, i32* %26
%27 = load i32, i32* %9
%28 = icmp sgt i32 1, %27
br i1 %28, label %29, label %30
29: ; preds = %8
br label %32
30: ; preds = %8
%31 = load i32, i32* %9
br label %32
32: ; preds = %30, %29
%33 = phi i32 [ 1, %29 ], [ %31, %30 ]
store i32 %33, i32* %9
%34 = load float, float* %14
%35 = fcmp ogt float 1.000000e+00, %34
br i1 %35, label %36, label %37
36: ; preds = %32
br label %39
37: ; preds = %32
%38 = load float, float* %14
br label %39
39: ; preds = %37, %36
%40 = phi float [ 1.000000e+00, %36 ], [ %38, %37 ]
store float %40, float* %14
%41 = load float, float* %14
%42 = load i32, i32* %13
%43 = sdiv i32 %42, 2
%44 = sub nsw i32 %43, 1
%45 = sitofp i32 %44 to float
%46 = fcmp olt float %41, %45
br i1 %46, label %47, label %49
47: ; preds = %39
%48 = load float, float* %14
br label %54
49: ; preds = %39
%50 = load i32, i32* %13
%51 = sdiv i32 %50, 2
%52 = sub nsw i32 %51, 1
%53 = sitofp i32 %52 to float
br label %54
54: ; preds = %49, %47
%55 = phi float [ %48, %47 ], [ %53, %49 ]
store float %55, float* %14
%56 = load float, float* %14
%57 = load i32, i32* %19
%58 = sitofp i32 %57 to float
%59 = fcmp olt float %56, %58
br i1 %59, label %60, label %62
60: ; preds = %54
%61 = load float, float* %14
br label %65
62: ; preds = %54
%63 = load i32, i32* %19
%64 = sitofp i32 %63 to float
br label %65
65: ; preds = %62, %60
%66 = phi float [ %61, %60 ], [ %64, %62 ]
store float %66, float* %14
%67 = call float @acos(i32 -1)
store float %67, float* %21
%68 = load float, float* %14
%69 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %68, float 1.000000e+00)
%70 = fptosi float %69 to i32
store i32 %70, i32* %17
%71 = load i32, i32* %17
%72 = sitofp i32 %71 to float
store float %72, float* %22
store float 0.000000e+00, float* %23
%73 = load i32, i32* %17
%74 = call float* @fvector(i32 1, i32 %73)
store float* %74, float** %24
store i32 1, i32* %18
br label %75
75: ; preds = %114, %65
%76 = load i32, i32* %18
%77 = load i32, i32* %17
%78 = icmp sle i32 %76, %77
br i1 %78, label %79, label %117
79: ; preds = %75
%80 = load i32, i32* %18
%81 = sitofp i32 %80 to float
%82 = load float, float* %14
%83 = fsub float %81, %82
%84 = fsub float %83, 1.000000e+00
%85 = load float, float* %21
%86 = fmul float %84, %85
%87 = load float, float* %22
%88 = fdiv float %86, %87
%89 = fptosi float %88 to i32
%90 = call float @cos(i32 %89)
%91 = load float*, float** %24
%92 = load i32, i32* %18
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds float, float* %91, i64 %93
store float %90, float* %94
%95 = load float*, float** %24
%96 = load i32, i32* %18
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds float, float* %95, i64 %97
%99 = load float, float* %98
%100 = load i32, i32* %9
%101 = sitofp i32 %100 to float
%102 = call float @pow(float %99, float %101)
%103 = load float*, float** %24
%104 = load i32, i32* %18
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds float, float* %103, i64 %105
store float %102, float* %106
%107 = load float*, float** %24
%108 = load i32, i32* %18
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds float, float* %107, i64 %109
%111 = load float, float* %110
%112 = load float, float* %23
%113 = fadd float %112, %111
store float %113, float* %23
br label %114
114: ; preds = %79
%115 = load i32, i32* %18
%116 = add nsw i32 %115, 1
store i32 %116, i32* %18
br label %75
117: ; preds = %75
store i32 1, i32* %18
br label %118
118: ; preds = %130, %117
%119 = load i32, i32* %18
%120 = load i32, i32* %17
%121 = icmp sle i32 %119, %120
br i1 %121, label %122, label %133
122: ; preds = %118
%123 = load float, float* %23
%124 = load float*, float** %24
%125 = load i32, i32* %18
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds float, float* %124, i64 %126
%128 = load float, float* %127
%129 = fdiv float %128, %123
store float %129, float* %127
br label %130
130: ; preds = %122
%131 = load i32, i32* %18
%132 = add nsw i32 %131, 1
store i32 %132, i32* %18
br label %118
133: ; preds = %118
%134 = load float, float* %15
%135 = fmul float %134, 3.600000e+02
store float %135, float* %25
%136 = load i32, i32* %10
%137 = icmp ne i32 %136, 0
br i1 %137, label %161, label %138
138: ; preds = %133
%139 = load float*, float** %11
%140 = load float*, float** %12
%141 = load i32, i32* %13
%142 = load i32, i32* %13
%143 = mul nsw i32 2, %142
%144 = load i32, i32* %16
%145 = call i32 @fftrxf(float* %139, float* %140, i32 %141, i32 %143, i32 %144)
%146 = load float*, float** %11
%147 = load i32, i32* %13
%148 = load float, float* %15
%149 = fptosi float %148 to i32
%150 = call i32 @xxrotate(float* %146, i32 1, i32 %147, i32 %149)
%151 = load float*, float** %12
%152 = load i32, i32* %13
%153 = load float, float* %15
%154 = fptosi float %153 to i32
%155 = call i32 @xxrotate(float* %151, i32 1, i32 %152, i32 %154)
%156 = load float*, float** %11
%157 = load float*, float** %12
%158 = load i32, i32* %13
%159 = load i32, i32* %13
%160 = call i32 @fftcxb(float* %156, float* %157, i32 %158, i32 %159)
store i32 1, i32* %20
store i32 1, i32* %10
br label %179
161: ; preds = %133
%162 = load i32, i32* %16
%163 = icmp ne i32 %162, 0
br i1 %163, label %164, label %173
164: ; preds = %161
%165 = load float*, float** %11
%166 = load i32, i32* %13
%167 = load i32, i32* %16
%168 = call i32 @xxrotate(float* %165, i32 1, i32 %166, i32 %167)
%169 = load float*, float** %12
%170 = load i32, i32* %13
%171 = load i32, i32* %16
%172 = call i32 @xxrotate(float* %169, i32 1, i32 %170, i32 %171)
br label %173
173: ; preds = %164, %161
%174 = load float*, float** %11
%175 = load float*, float** %12
%176 = load i32, i32* %13
%177 = load float, float* %25
%178 = call i32 @phase(float* %174, float* %175, i32 %176, i32 0, float %177, i32 1)
br label %179
179: ; preds = %173, %138
%180 = load i32, i32* %26
%181 = load i32, i32* %10
%182 = load float*, float** %11
%183 = getelementptr inbounds float, float* %182, i64 -1
%184 = load float*, float** %12
%185 = getelementptr inbounds float, float* %184, i64 -1
%186 = load i32, i32* %13
%187 = load float, float* %14
%188 = load float*, float** %24
%189 = call i32 @watwa_select(i32 %180, i32 %181, float* %183, float* %185, i32 %186, float %187, float* %188, i32* null)
%190 = load float*, float** %24
%191 = call i32 @free_fvector(float* %190, i32 1)
%192 = load i32, i32* %20
%193 = icmp ne i32 %192, 0
br i1 %193, label %194, label %217
194: ; preds = %179
%195 = load float*, float** %11
%196 = load float*, float** %12
%197 = load i32, i32* %13
%198 = load i32, i32* %13
%199 = call i32 @fftcxf(float* %195, float* %196, i32 %197, i32 %198, i32 0)
%200 = load float*, float** %11
%201 = load i32, i32* %13
%202 = load float, float* %15
%203 = fneg float %202
%204 = fptosi float %203 to i32
%205 = call i32 @xxrotate(float* %200, i32 1, i32 %201, i32 %204)
%206 = load float*, float** %12
%207 = load i32, i32* %13
%208 = load float, float* %15
%209 = fneg float %208
%210 = fptosi float %209 to i32
%211 = call i32 @xxrotate(float* %206, i32 1, i32 %207, i32 %210)
%212 = load float*, float** %11
%213 = load float*, float** %12
%214 = load i32, i32* %13
%215 = load i32, i32* %13
%216 = call i32 @fftrxb(float* %212, float* %213, i32 %214, i32 %215)
br label %224
217: ; preds = %179
%218 = load float*, float** %11
%219 = load float*, float** %12
%220 = load i32, i32* %13
%221 = load float, float* %25
%222 = fneg float %221
%223 = call i32 @phase(float* %218, float* %219, i32 %220, i32 0, float %222, i32 1)
br label %224
224: ; preds = %217, %194
%225 = load i32, i32* %16
%226 = icmp ne i32 %225, 0
br i1 %226, label %227, label %238
227: ; preds = %224
%228 = load float*, float** %11
%229 = load i32, i32* %13
%230 = load i32, i32* %16
%231 = sub nsw i32 0, %230
%232 = call i32 @xxrotate(float* %228, i32 1, i32 %229, i32 %231)
%233 = load float*, float** %12
%234 = load i32, i32* %13
%235 = load i32, i32* %16
%236 = sub nsw i32 0, %235
%237 = call i32 @xxrotate(float* %233, i32 1, i32 %234, i32 %236)
br label %238
238: ; preds = %227, %224
ret i32 1
}

LLVM IR (-O2):
define i32 @watwa(i32 %0, i32 %1, float* %2, float* %3, i32 %4, float %5, float %6, i32 %7) {
%9 = fcmp olt float %5, 1.000000e+00
%10 = select i1 %9, float 1.000000e+00, float %5
%11 = sdiv i32 %4, 2
%12 = add nsw i32 %11, -1
%13 = sitofp i32 %12 to float
%14 = fcmp olt float %10, %13
%15 = select i1 %14, float %10, float %13
%16 = fcmp olt float %15, 5.120000e+02
%17 = select i1 %16, float %15, float 5.120000e+02
%18 = tail call float @acos(i32 -1)
%19 = tail call float @llvm.fmuladd.f32(float %17, float 2.000000e+00, float 1.000000e+00)
%20 = fptosi float %19 to i32
%21 = sitofp i32 %20 to float
%22 = tail call float* @fvector(i32 1, i32 %20)
%23 = icmp slt i32 %20, 1
br i1 %23, label %104, label %24
24: ; preds = %8
%25 = icmp sgt i32 %0, 1
%26 = select i1 %25, i32 %0, i32 1
%27 = sitofp i32 %26 to float
%28 = add nuw i32 %20, 1
%29 = zext i32 %28 to i64
br label %81
30: ; preds = %81
br i1 %23, label %104, label %31
31: ; preds = %30
%32 = add nuw i32 %20, 1
%33 = zext i32 %32 to i64
%34 = add nsw i64 %29, -1
%35 = icmp ult i64 %34, 4
br i1 %35, label %79, label %36
36: ; preds = %31
%37 = and i64 %34, -4
%38 = or i64 %37, 1
%39 = insertelement <4 x float> poison, float %94, i64 0
%40 = shufflevector <4 x float> %39, <4 x float> poison, <4 x i32> zeroinitializer
%41 = add nsw i64 %37, -4
%42 = lshr exact i64 %41, 2
%43 = add nuw nsw i64 %42, 1
%44 = and i64 %43, 1
%45 = icmp eq i64 %41, 0
br i1 %45, label %68, label %46
46: ; preds = %36
%47 = and i64 %43, 9223372036854775806
br label %48
48: ; preds = %48, %46
%49 = phi i64 [ 0, %46 ], [ %63, %48 ]
%50 = phi i64 [ 0, %46 ], [ %64, %48 ]
%51 = or i64 %49, 1
%52 = getelementptr inbounds float, float* %22, i64 %51
%53 = bitcast float* %52 to <4 x float>*
%54 = load <4 x float>, <4 x float>* %53
%55 = fdiv <4 x float> %54, %40
%56 = bitcast float* %52 to <4 x float>*
store <4 x float> %55, <4 x float>* %56
%57 = or i64 %49, 5
%58 = getelementptr inbounds float, float* %22, i64 %57
%59 = bitcast float* %58 to <4 x float>*
%60 = load <4 x float>, <4 x float>* %59
%61 = fdiv <4 x float> %60, %40
%62 = bitcast float* %58 to <4 x float>*
store <4 x float> %61, <4 x float>* %62
%63 = add nuw i64 %49, 8
%64 = add i64 %50, 2
%65 = icmp eq i64 %64, %47
br i1 %65, label %66, label %48
66: ; preds = %48
%67 = or i64 %63, 1
br label %68
68: ; preds = %66, %36
%69 = phi i64 [ 1, %36 ], [ %67, %66 ]
%70 = icmp eq i64 %44, 0
br i1 %70, label %77, label %71
71: ; preds = %68
%72 = getelementptr inbounds float, float* %22, i64 %69
%73 = bitcast float* %72 to <4 x float>*
%74 = load <4 x float>, <4 x float>* %73
%75 = fdiv <4 x float> %74, %40
%76 = bitcast float* %72 to <4 x float>*
store <4 x float> %75, <4 x float>* %76
br label %77
77: ; preds = %68, %71
%78 = icmp eq i64 %34, %37
br i1 %78, label %104, label %79
79: ; preds = %31, %77
%80 = phi i64 [ 1, %31 ], [ %38, %77 ]
br label %97
81: ; preds = %24, %81
%82 = phi i64 [ 1, %24 ], [ %95, %81 ]
%83 = phi float [ 0.000000e+00, %24 ], [ %94, %81 ]
%84 = trunc i64 %82 to i32
%85 = sitofp i32 %84 to float
%86 = fsub float %85, %17
%87 = fadd float %86, -1.000000e+00
%88 = fmul float %18, %87
%89 = fdiv float %88, %21
%90 = fptosi float %89 to i32
%91 = tail call float @cos(i32 %90)
%92 = getelementptr inbounds float, float* %22, i64 %82
%93 = tail call float @pow(float %91, float %27)
store float %93, float* %92
%94 = fadd float %83, %93
%95 = add nuw nsw i64 %82, 1
%96 = icmp eq i64 %95, %29
br i1 %96, label %30, label %81
97: ; preds = %79, %97
%98 = phi i64 [ %102, %97 ], [ %80, %79 ]
%99 = getelementptr inbounds float, float* %22, i64 %98
%100 = load float, float* %99
%101 = fdiv float %100, %94
store float %101, float* %99
%102 = add nuw nsw i64 %98, 1
%103 = icmp eq i64 %102, %33
br i1 %103, label %104, label %97
104: ; preds = %97, %77, %8, %30
%105 = fmul float %6, 3.600000e+02
%106 = icmp eq i32 %1, 0
br i1 %106, label %107, label %114
107: ; preds = %104
%108 = shl nsw i32 %4, 1
%109 = tail call i32 @fftrxf(float* %2, float* %3, i32 %4, i32 %108, i32 %7)
%110 = fptosi float %6 to i32
%111 = tail call i32 @xxrotate(float* %2, i32 1, i32 %4, i32 %110)
%112 = tail call i32 @xxrotate(float* %3, i32 1, i32 %4, i32 %110)
%113 = tail call i32 @fftcxb(float* %2, float* %3, i32 %4, i32 %4)
br label %121
114: ; preds = %104
%115 = icmp eq i32 %7, 0
br i1 %115, label %119, label %116
116: ; preds = %114
%117 = tail call i32 @xxrotate(float* %2, i32 1, i32 %4, i32 %7)
%118 = tail call i32 @xxrotate(float* %3, i32 1, i32 %4, i32 %7)
br label %119
119: ; preds = %116, %114
%120 = tail call i32 @phase(float* %2, float* %3, i32 %4, i32 0, float %105, i32 1)
br label %121
121: ; preds = %119, %107
%122 = phi i32 [ %1, %119 ], [ 1, %107 ]
%123 = getelementptr inbounds float, float* %2, i64 -1
%124 = getelementptr inbounds float, float* %3, i64 -1
%125 = tail call i32 @watwa_select(i32 3, i32 %122, float* %123, float* %124, i32 %4, float %17, float* %22, i32* null)
%126 = tail call i32 @free_fvector(float* %22, i32 1)
br i1 %106, label %127, label %134
127: ; preds = %121
%128 = tail call i32 @fftcxf(float* %2, float* %3, i32 %4, i32 %4, i32 0)
%129 = fneg float %6
%130 = fptosi float %129 to i32
%131 = tail call i32 @xxrotate(float* %2, i32 1, i32 %4, i32 %130)
%132 = tail call i32 @xxrotate(float* %3, i32 1, i32 %4, i32 %130)
%133 = tail call i32 @fftrxb(float* %2, float* %3, i32 %4, i32 %4)
br label %137
134: ; preds = %121
%135 = fneg float %105
%136 = tail call i32 @phase(float* %2, float* %3, i32 %4, i32 0, float %135, i32 1)
br label %137
137: ; preds = %134, %127
%138 = icmp eq i32 %7, 0
br i1 %138, label %143, label %139
139: ; preds = %137
%140 = sub nsw i32 0, %7
%141 = tail call i32 @xxrotate(float* %2, i32 1, i32 %4, i32 %140)
%142 = tail call i32 @xxrotate(float* %3, i32 1, i32 %4, i32 %140)
br label %143
143: ; preds = %139, %137
ret i32 1
}