// File: /workspace/github_c_makefile_star2_O3/pavel-demin[P]ft8d-c/pffft.c
// Function: radf4_ps
static NEVER_INLINE(void) radf4_ps(int ido, int l1, const v4sf *RESTRICT cc, v4sf * RESTRICT ch,
                                   const float * RESTRICT wa1, const float * RESTRICT wa2, const float * RESTRICT wa3)
{
  static const float minus_hsqt2 = (float)-0.7071067811865475;
  int i, k, l1ido = l1*ido;
  {
    const v4sf *RESTRICT cc_ = cc, * RESTRICT cc_end = cc + l1ido;
    v4sf * RESTRICT ch_ = ch;
    while (cc < cc_end) {
      // this loop represents between 25% and 40% of total radf4_ps cost !
      v4sf a0 = cc[0], a1 = cc[l1ido];
      v4sf a2 = cc[2*l1ido], a3 = cc[3*l1ido];
      v4sf tr1 = VADD(a1, a3);
      v4sf tr2 = VADD(a0, a2);
      ch[2*ido-1] = VSUB(a0, a2);
      ch[2*ido  ] = VSUB(a3, a1);
      ch[0      ] = VADD(tr1, tr2);
      ch[4*ido-1] = VSUB(tr2, tr1);
      cc += ido; ch += 4*ido;
    }
    cc = cc_; ch = ch_;
  }
  if (ido < 2) return;
  if (ido != 2) {
    for (k = 0; k < l1ido; k += ido) {
      const v4sf * RESTRICT pc = (v4sf*)(cc + 1 + k);
      for (i=2; i<ido; i += 2, pc += 2) {
        int ic = ido - i;
        v4sf wr, wi, cr2, ci2, cr3, ci3, cr4, ci4;
        v4sf tr1, ti1, tr2, ti2, tr3, ti3, tr4, ti4;

        cr2 = pc[1*l1ido+0];
        ci2 = pc[1*l1ido+1];
        wr=LD_PS1(wa1[i - 2]);
        wi=LD_PS1(wa1[i - 1]);
        VCPLXMULCONJ(cr2,ci2,wr,wi);

        cr3 = pc[2*l1ido+0];
        ci3 = pc[2*l1ido+1];
        wr = LD_PS1(wa2[i-2]);
        wi = LD_PS1(wa2[i-1]);
        VCPLXMULCONJ(cr3, ci3, wr, wi);

        cr4 = pc[3*l1ido];
        ci4 = pc[3*l1ido+1];
        wr = LD_PS1(wa3[i-2]);
        wi = LD_PS1(wa3[i-1]);
        VCPLXMULCONJ(cr4, ci4, wr, wi);

        /* at this point, on SSE, five of "cr2 cr3 cr4 ci2 ci3 ci4" should be loaded in registers */

        tr1 = VADD(cr2,cr4);
        tr4 = VSUB(cr4,cr2);
        tr2 = VADD(pc[0],cr3);
        tr3 = VSUB(pc[0],cr3);
        ch[i - 1 + 4*k] = VADD(tr1,tr2);
        ch[ic - 1 + 4*k + 3*ido] = VSUB(tr2,tr1); // at this point tr1 and tr2 can be disposed
        ti1 = VADD(ci2,ci4);
        ti4 = VSUB(ci2,ci4);
        ch[i - 1 + 4*k + 2*ido] = VADD(ti4,tr3);
        ch[ic - 1 + 4*k + 1*ido] = VSUB(tr3,ti4); // dispose tr3, ti4
        ti2 = VADD(pc[1],ci3);
        ti3 = VSUB(pc[1],ci3);
        ch[i + 4*k] = VADD(ti1, ti2);
        ch[ic + 4*k + 3*ido] = VSUB(ti1, ti2);
        ch[i + 4*k + 2*ido] = VADD(tr4, ti3);
        ch[ic + 4*k + 1*ido] = VSUB(tr4, ti3);
      }
    }
    if (ido % 2 == 1) return;
  }
  for (k=0; k<l1ido; k += ido) {
    v4sf a = cc[ido-1 + k + l1ido], b = cc[ido-1 + k + 3*l1ido];
    v4sf c = cc[ido-1 + k], d = cc[ido-1 + k + 2*l1ido];
    v4sf ti1 = SVMUL(minus_hsqt2, VADD(a, b));
    v4sf tr1 = SVMUL(minus_hsqt2, VSUB(b, a));
    ch[ido-1 + 4*k] = VADD(tr1, c);
    ch[ido-1 + 4*k + 2*ido] = VSUB(c, tr1);
    ch[4*k + 1*ido] = VSUB(ti1, d);
    ch[4*k + 3*ido] = VADD(ti1, d);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, (%rsp)
movq %rdi, -0x80(%rsp)
imull %edi, %esi
movq %rsi, %r9
movslq %esi, %rsi
movq %rsi, %rax
shlq $0x4, %rax
movq %rsi, 0x8(%rsp)
testl %esi, %esi
jle 0x560e
leaq (%rdx,%rax), %rsi
leal (%r9,%r9), %r12d
leal (%r9,%r9,2), %r13d
movq -0x80(%rsp), %r10
leal (%r10,%r10), %edi
movslq %edi, %rbp
leal (,%r10,4), %edi
movslq %r10d, %r10
movslq %edi, %rdi
leal -0x2(,%r10,2), %r11d
leal -0x4(,%r10,4), %ebx
shlq $0x4, %r10
shlq $0x4, %r13
shlq $0x4, %r12
movslq %r11d, %r11
shlq $0x4, %r11
shlq $0x4, %rdi
shlq $0x4, %rbp
movslq %ebx, %rbx
shlq $0x4, %rbx
movq %rcx, %r14
movq %rdx, %r15
movaps (%r15), %xmm0
movaps (%r15,%rax), %xmm1
movaps (%r15,%r12), %xmm2
movaps (%r15,%r13), %xmm3
movaps %xmm1, %xmm4
addps %xmm3, %xmm4
movaps %xmm0, %xmm5
addps %xmm2, %xmm5
subps %xmm2, %xmm0
movaps %xmm0, 0x10(%r14,%r11)
subps %xmm1, %xmm3
movaps %xmm3, (%r14,%rbp)
movaps %xmm5, %xmm0
addps %xmm4, %xmm0
movaps %xmm0, (%r14)
subps %xmm4, %xmm5
movaps %xmm5, 0x30(%r14,%rbx)
addq %r10, %r15
addq %rdi, %r14
cmpq %rsi, %r15
jb 0x55c0
movq -0x80(%rsp), %r13
cmpl $0x2, %r13d
jl 0x5a1c
movq %rax, %rbp
movq %r9, %rsi
jne 0x5632
testl %esi, %esi
jg 0x596e
jmp 0x5a1c
testl %esi, %esi
jle 0x5a1c
movq %r8, -0x8(%rsp)
leaq 0x10(%rdx), %rbx
movl %esi, %eax
shlq $0x4, %rax
leal (%rsi,%rsi), %r14d
leal (%rsi,%rsi,2), %r12d
movq %rsi, -0x38(%rsp)
leal (%rsi,%rsi,2), %r11d
incl %r11d
leal (%r13,%r13,2), %edi
leal (,%r13,2), %r10d
movl %r13d, %esi
shlq $0x4, %r10
leaq (%r10,%rcx), %r15
addq $0x20, %r15
movq %rsi, %r8
shlq $0x6, %r8
movq %r8, -0x10(%rsp)
leal -0x3(,%r13,2), %r8d
leal (,%r13,4), %r9d
movl %r9d, -0x74(%rsp)
leal -0x3(,%r13,4), %r9d
movq %rsi, %r10
shlq $0x5, %r10
addq $-0x20, %r10
movq %r10, -0x18(%rsp)
shlq $0x2, %rdi
leaq (%rdi,%rsi,4), %rdi
addq $-0x8, %rdi
movq %rdi, -0x20(%rsp)
movq %rsi, %rdi
shlq $0x4, %rdi
movq %rdi, -0x28(%rsp)
addq %rdx, %rax
addq $0x20, %rax
shlq $0x4, %r14
leaq (%r14,%rdx), %rdi
addq $0x20, %rdi
movq %rsi, %r14
shlq $0x4, %r12
leaq (%rdx,%r12), %rsi
addq $0x10, %rsi
shlq $0x4, %r11
leaq (%rdx,%r11), %r10
addq $0x10, %r10
movq %rdx, -0x30(%rsp)
movq %rbp, -0x40(%rsp)
addq %rbp, %rdx
addq $0x10, %rdx
xorl %r11d, %r11d
movq %rcx, -0x68(%rsp)
movq %rsi, -0x60(%rsp)
movq %rax, -0x58(%rsp)
movq %r10, -0x50(%rsp)
movq %rdx, -0x48(%rsp)
movq %r11, 0x10(%rsp)
movl $0x2, %ebp
movq -0x20(%rsp), %r11
movq -0x18(%rsp), %rdx
movl %r9d, -0x70(%rsp)
movl %r9d, %r12d
movl %r8d, -0x6c(%rsp)
movl %r8d, %r10d
xorl %esi, %esi
movq -0x68(%rsp), %rax
movq (%rsp), %r9
movq -0x8(%rsp), %r8
movq -0x48(%rsp), %r13
movaps (%r13,%rsi,4), %xmm2
movq -0x58(%rsp), %r13
movaps (%r13,%rsi,4), %xmm3
movss (%r8,%rsi), %xmm1
movss 0x4(%r8,%rsi), %xmm0
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movaps %xmm2, %xmm4
mulps %xmm0, %xmm4
mulps %xmm1, %xmm2
mulps %xmm3, %xmm0
addps %xmm2, %xmm0
mulps %xmm3, %xmm1
subps %xmm4, %xmm1
movaps -0x10(%rdi,%rsi,4), %xmm4
movaps (%rdi,%rsi,4), %xmm3
movss (%r9,%rsi), %xmm2
movss 0x4(%r9,%rsi), %xmm7
shufps $0x0, %xmm2, %xmm2      # xmm2 = xmm2[0,0,0,0]
shufps $0x0, %xmm7, %xmm7      # xmm7 = xmm7[0,0,0,0]
movaps %xmm4, %xmm5
mulps %xmm7, %xmm5
mulps %xmm2, %xmm4
mulps %xmm3, %xmm7
addps %xmm4, %xmm7
movq -0x60(%rsp), %r13
movaps (%r13,%rsi,4), %xmm8
movq -0x50(%rsp), %r13
movaps (%r13,%rsi,4), %xmm9
movq 0x50(%rsp), %r13
movss (%r13,%rsi), %xmm6
movss 0x4(%r13,%rsi), %xmm4
shufps $0x0, %xmm6, %xmm6      # xmm6 = xmm6[0,0,0,0]
shufps $0x0, %xmm4, %xmm4      # xmm4 = xmm4[0,0,0,0]
movaps %xmm8, %xmm10
mulps %xmm4, %xmm10
mulps %xmm6, %xmm8
mulps %xmm9, %xmm4
addps %xmm8, %xmm4
mulps %xmm9, %xmm6
subps %xmm10, %xmm6
movaps %xmm0, %xmm8
addps %xmm4, %xmm8
movaps (%rbx,%rsi,4), %xmm9
movaps %xmm7, %xmm10
addps %xmm9, %xmm10
subps %xmm7, %xmm9
movaps %xmm10, %xmm7
addps %xmm8, %xmm7
movaps %xmm7, 0x10(%rcx,%rsi,4)
subps %xmm8, %xmm10
movslq %r12d, %r12
movq %r14, %r13
movq %r12, %r14
shlq $0x4, %r14
movaps %xmm10, (%rax,%r14)
movaps %xmm1, %xmm7
subps %xmm6, %xmm1
movaps %xmm9, %xmm8
addps %xmm1, %xmm8
movaps %xmm8, -0x10(%r15,%rsi,4)
subps %xmm1, %xmm9
movslq %r10d, %r10
movq %r10, %r14
shlq $0x4, %r14
movaps %xmm9, (%rax,%r14)
movq %r13, %r14
mulps %xmm3, %xmm2
subps %xmm5, %xmm2
subps %xmm0, %xmm4
addps %xmm6, %xmm7
movaps 0x10(%rbx,%rsi,4), %xmm0
movaps %xmm2, %xmm1
addps %xmm0, %xmm1
subps %xmm2, %xmm0
movaps %xmm7, %xmm2
addps %xmm1, %xmm2
movaps %xmm2, 0x20(%rcx,%rsi,4)
subps %xmm1, %xmm7
movaps %xmm7, (%rcx,%r11,4)
movaps %xmm4, %xmm1
addps %xmm0, %xmm1
movaps %xmm1, (%r15,%rsi,4)
subps %xmm0, %xmm4
movaps %xmm4, (%rcx,%rdx)
addq $0x2, %rbp
addq $0x8, %rsi
addl $-0x2, %r10d
addl $-0x2, %r12d
addq $-0x20, %rdx
addq $-0x8, %r11
cmpq %r13, %rbp
jb 0x575e
movq 0x10(%rsp), %r11
addq %r14, %r11
movq -0x10(%rsp), %rax
addq %rax, %r15
addq %rax, %rcx
movl -0x6c(%rsp), %r8d
movl -0x74(%rsp), %eax
addl %eax, %r8d
movl -0x70(%rsp), %r9d
addl %eax, %r9d
movq -0x28(%rsp), %rax
movq -0x48(%rsp), %rdx
addq %rax, %rdx
movq -0x58(%rsp), %rsi
addq %rax, %rsi
addq %rax, %rdi
movq -0x60(%rsp), %r12
addq %rax, %r12
movq -0x50(%rsp), %r10
addq %rax, %r10
addq %rax, %rbx
cmpq 0x8(%rsp), %r11
movq %rsi, %rax
movq %r12, %rsi
jl 0x5716
movq -0x38(%rsp), %rsi
testl %esi, %esi
setg %al
movq -0x80(%rsp), %r13
testb $0x1, %r13b
sete %cl
testb %al, %cl
movq -0x68(%rsp), %rcx
movq -0x30(%rsp), %rdx
movq -0x40(%rsp), %rbp
je 0x5a1c
leal -0x1(%r13), %edi
leal (%rsi,%rsi,2), %eax
leal (%rsi,%rsi), %r11d
leal (%r13,%r13,2), %ebx
movl %r13d, %r14d
shlq $0x4, %r11
shlq $0x4, %rdi
addq %rdi, %rdx
shlq $0x4, %r14
shlq $0x4, %rax
leal (,%r13,4), %edi
xorl %r8d, %r8d
movaps 0x284a(%rip), %xmm0     # 0x81f0
movl %r13d, %r9d
movaps (%rdx,%rbp), %xmm3
movaps (%rdx,%rax), %xmm4
movaps (%rdx), %xmm5
movaps (%rdx,%r11), %xmm2
movaps %xmm3, %xmm1
addps %xmm4, %xmm1
mulps %xmm0, %xmm1
subps %xmm3, %xmm4
mulps %xmm0, %xmm4
movaps %xmm5, %xmm3
addps %xmm4, %xmm3
leal -0x1(%r9), %r10d
shlq $0x4, %r10
movaps %xmm3, (%rcx,%r10)
subps %xmm4, %xmm5
leal -0x1(%rbx), %r10d
shlq $0x4, %r10
movaps %xmm5, (%rcx,%r10)
movaps %xmm1, %xmm3
subps %xmm2, %xmm3
movl %r9d, %r10d
shlq $0x4, %r10
movaps %xmm3, (%rcx,%r10)
addps %xmm2, %xmm1
movl %ebx, %r10d
shlq $0x4, %r10
movaps %xmm1, (%rcx,%r10)
addq %r14, %rdx
addl %edi, %r9d
addl %edi, %ebx
addl %r13d, %r8d
cmpl %r8d, %esi
jg 0x59a9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq