// File: /workspace/github_c_makefile_star2_O1/pipde[P]deos-songlib/lib/rra.c
// Function: fft
static void
fft(double *data,int nn,int isign)
    {
    int n, mmax, m, j, istep, i;
    double wtemp, wr, wpr, wpi, wi, theta;
    double tempr, tempi;
    
    n = nn << 1;
    j = 1;
    for (i = 1; i < n; i += 2)
        {
        if (j > i)
            {
            tempr = data[j];     data[j] = data[i];     data[i] = tempr;
            tempr = data[j+1]; data[j+1] = data[i+1]; data[i+1] = tempr;
            }
        m = n >> 1;
        while (m >= 2 && j > m)
            {
            j -= m;
            m >>= 1;
            }
        j += m;
        }
    mmax = 2;
    while (n > mmax)
        {
        istep = 2*mmax;
        theta = TWOPI/(isign*mmax);
        wtemp = sin(0.5*theta);
        wpr = -2.0*wtemp*wtemp;
        wpi = sin(theta);
        wr = 1.0;
        wi = 0.0;
        for (m = 1; m < mmax; m += 2)
            {
            for (i = m; i <= n; i += istep)
                {
                j =i + mmax;
                tempr = wr*data[j]   - wi*data[j+1];
                tempi = wr*data[j+1] + wi*data[j];
                data[j]   = data[i]   - tempr;
                data[j+1] = data[i+1] - tempi;
                data[i] += tempr;
                data[i+1] += tempi;
                }
            wr = (wtemp = wr)*wpr - wi*wpi + wr;
            wi = wi*wpr + wtemp*wpi + wi;
            }
        mmax = istep;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebx
movq %rdi, %r14
leal (%rsi,%rsi), %ebp
cmpl $0x2, %ebp
jl 0x2cf0
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl %ebp, %eax
movl $0x1, %ecx
movl $0x1, %edx
movslq %ecx, %rdi
cmpq %rdi, %rdx
jge 0x2cc5
movsd (%r14,%rdi,8), %xmm0
movsd (%r14,%rdx,8), %xmm1
movsd %xmm1, (%r14,%rdi,8)
movsd %xmm0, (%r14,%rdx,8)
movsd 0x8(%r14,%rdi,8), %xmm0
movsd 0x8(%r14,%rdx,8), %xmm1
movsd %xmm1, 0x8(%r14,%rdi,8)
movsd %xmm0, 0x8(%r14,%rdx,8)
cmpl $0x2, %esi
jb 0x2ce3
cmpl %esi, %ecx
jle 0x2ce3
movl %esi, %edi
movl %edi, %r8d
subl %edi, %ecx
shrl %edi
cmpl $0x4, %r8d
jb 0x2ce5
cmpl %edi, %ecx
jg 0x2cd0
jmp 0x2ce5
movl %esi, %edi
addl %edi, %ecx
addq $0x2, %rdx
cmpq %rax, %rdx
jb 0x2c89
cmpl $0x3, %ebp
jl 0x2e69
addq $0x8, %r14
movl $0x2, %r15d
movl %r15d, %r12d
leal (%r12,%r12), %r15d
movl %r12d, %eax
imull %ebx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x449(%rip), %xmm1      # 0x3168
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
movapd %xmm1, %xmm0
mulsd 0x43b(%rip), %xmm0      # 0x3170
callq 0x11e0
movsd %xmm0, 0x10(%rsp)
movapd %xmm0, %xmm1
mulsd 0x42c(%rip), %xmm1      # 0x3178
movsd %xmm1, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x11e0
movsd 0x10(%rsp), %xmm9
movapd 0x3d3(%rip), %xmm8      # 0x3140
cmpl $0x2, %r12d
jl 0x2e60
mulsd 0x8(%rsp), %xmm9
movl %r15d, %eax
movl %r12d, %ecx
shlq $0x3, %rax
xorpd %xmm1, %xmm1
movl $0x1, %edx
movq %r14, %rsi
movsd 0x3b4(%rip), %xmm2      # 0x3150
cmpl %edx, %ebp
jl 0x2e1d
movapd %xmm1, %xmm3
xorpd %xmm8, %xmm3
movl %edx, %edi
movq %rsi, %r8
movsd (%r8,%rcx,8), %xmm4
movsd 0x8(%r8,%rcx,8), %xmm5
movapd %xmm5, %xmm6
mulsd %xmm3, %xmm6
movapd %xmm2, %xmm7
mulsd %xmm4, %xmm7
addsd %xmm6, %xmm7
mulsd %xmm1, %xmm4
mulsd %xmm2, %xmm5
addsd %xmm4, %xmm5
movsd (%r8), %xmm4
subsd %xmm7, %xmm4
movsd %xmm4, (%r8,%rcx,8)
movsd 0x8(%r8), %xmm4
movapd %xmm4, %xmm6
subsd %xmm5, %xmm6
movsd %xmm6, 0x8(%r8,%rcx,8)
addsd (%r8), %xmm7
movsd %xmm7, (%r8)
addsd %xmm4, %xmm5
movsd %xmm5, 0x8(%r8)
addq %rax, %r8
addl %r15d, %edi
cmpl %edi, %ebp
jge 0x2dae
movapd %xmm0, %xmm3
mulsd %xmm1, %xmm3
movapd %xmm2, %xmm4
mulsd %xmm9, %xmm4
subsd %xmm3, %xmm4
addsd %xmm2, %xmm4
mulsd %xmm0, %xmm2
movapd %xmm1, %xmm3
mulsd %xmm9, %xmm3
addsd %xmm2, %xmm3
addsd %xmm3, %xmm1
addq $0x2, %rdx
addq $0x10, %rsi
movapd %xmm4, %xmm2
cmpl %edx, %r12d
jg 0x2d9c
cmpl %r15d, %ebp
jg 0x2d03
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq