// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
addl %esi, %ebp
movl %ebp, %eax
sarl %eax
movslq %ebp, %r15
pushq $0x1
popq %rdx
pushq $0x1
popq %rcx
cmpq %r15, %rcx
jge 0x2b62
movslq %edx, %rsi
cmpq %rsi, %rcx
jge 0x2b47
movsd (%r14,%rsi,8), %xmm0
movsd (%r14,%rcx,8), %xmm1
movsd %xmm1, (%r14,%rsi,8)
movsd %xmm0, (%r14,%rcx,8)
movsd 0x8(%r14,%rsi,8), %xmm0
movsd 0x8(%r14,%rcx,8), %xmm1
movsd %xmm1, 0x8(%r14,%rsi,8)
movsd %xmm0, 0x8(%r14,%rcx,8)
movl %eax, %esi
cmpl $0x2, %esi
jl 0x2b5a
movl %edx, %edi
subl %esi, %edi
jle 0x2b5a
shrl %esi
movl %edi, %edx
jmp 0x2b49
addl %esi, %edx
addq $0x2, %rcx
jmp 0x2b06
pushq $0x2
popq %r12
cmpl %r12d, %ebp
jle 0x2caa
leal (%r12,%r12), %r13d
movl %r12d, %eax
imull %ebx, %eax
cvtsi2sd %eax, %xmm0
movsd 0x5e3(%rip), %xmm1      # 0x3168
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movapd %xmm1, %xmm0
mulsd 0x5d5(%rip), %xmm0      # 0x3170
callq 0x11e0
movapd %xmm0, %xmm1
mulsd 0x5cc(%rip), %xmm1      # 0x3178
mulsd %xmm0, %xmm1
movapd %xmm1, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x11e0
movapd 0x10(%rsp), %xmm10
movapd 0x56f(%rip), %xmm9      # 0x3140
movslq %r13d, %rax
movslq %r12d, %rcx
leaq (%r14,%rcx,8), %rcx
unpcklpd %xmm10, %xmm10          # xmm10 = xmm10[0,0]
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
pushq $0x1
popq %rdx
movsd 0x561(%rip), %xmm1      # 0x3150
cmpl %edx, %r12d
jle 0x2ca2
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
xorpd %xmm9, %xmm2
movapd %xmm1, %xmm3
unpcklpd %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0]
movapd %xmm1, %xmm4
shufpd $0x1, %xmm2, %xmm4      # xmm4 = xmm4[1],xmm2[0]
movq %rdx, %rsi
cmpq %r15, %rsi
jg 0x2c80
movsd (%r14,%rsi,8), %xmm5
movupd (%rcx,%rsi,8), %xmm6
movapd %xmm6, %xmm7
mulpd %xmm4, %xmm7
shufpd $0x1, %xmm7, %xmm7      # xmm7 = xmm7[1,0]
mulpd %xmm3, %xmm6
addpd %xmm7, %xmm6
subsd %xmm6, %xmm5
movsd %xmm5, (%rcx,%rsi,8)
movsd 0x8(%r14,%rsi,8), %xmm5
movapd %xmm6, %xmm7
unpckhpd %xmm6, %xmm7            # xmm7 = xmm7[1],xmm6[1]
movapd %xmm5, %xmm8
subsd %xmm7, %xmm8
movsd %xmm8, 0x8(%rcx,%rsi,8)
movsd (%r14,%rsi,8), %xmm7
unpcklpd %xmm5, %xmm7            # xmm7 = xmm7[0],xmm5[0]
addpd %xmm6, %xmm7
movupd %xmm7, (%r14,%rsi,8)
addq %rax, %rsi
jmp 0x2c19
movsd %xmm2, %xmm3            # xmm3 = xmm2[0],xmm3[1]
mulpd %xmm0, %xmm3
movapd %xmm1, %xmm2
mulpd %xmm10, %xmm2
addpd %xmm3, %xmm2
addpd %xmm2, %xmm1
addq $0x2, %rdx
jmp 0x2bef
movl %r13d, %r12d
jmp 0x2b66
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq