// File: /workspace/github_c_makefile_star2_O1/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 $0x10, %rsp
movq %rdi, -0x80(%rsp)
imull %edi, %esi
movq %rsi, -0x78(%rsp)
movslq %esi, %rsi
movq %rsi, %rax
shlq $0x4, %rax
movq %rsi, (%rsp)
testl %esi, %esi
jle 0x57f2
leaq (%rdx,%rax), %r13
movq -0x78(%rsp), %rsi
leal (%rsi,%rsi), %ebp
leal (%rsi,%rsi,2), %esi
movq -0x80(%rsp), %r11
leal (%r11,%r11), %edi
movslq %edi, %rdi
leal (,%r11,4), %r10d
movslq %r11d, %r11
movslq %r10d, %r10
leal -0x2(,%r11,2), %ebx
leal -0x4(,%r11,4), %r14d
shlq $0x4, %r11
shlq $0x4, %rsi
shlq $0x4, %rbp
movslq %ebx, %rbx
shlq $0x4, %rbx
shlq $0x4, %r10
shlq $0x4, %rdi
movslq %r14d, %r14
shlq $0x4, %r14
movq %rcx, %r15
movq %rdx, %r12
movaps (%r12), %xmm0
movaps (%r12,%rax), %xmm1
movaps (%r12,%rbp), %xmm2
movaps (%r12,%rsi), %xmm3
movaps %xmm1, %xmm4
addps %xmm3, %xmm4
movaps %xmm0, %xmm5
addps %xmm2, %xmm5
subps %xmm2, %xmm0
movaps %xmm0, 0x10(%r15,%rbx)
subps %xmm1, %xmm3
movaps %xmm3, (%r15,%rdi)
movaps %xmm5, %xmm0
addps %xmm4, %xmm0
movaps %xmm0, (%r15)
subps %xmm4, %xmm5
movaps %xmm5, 0x30(%r15,%r14)
addq %r11, %r12
addq %r10, %r15
cmpq %r13, %r12
jb 0x57a3
movq -0x80(%rsp), %r12
cmpl $0x2, %r12d
movq -0x78(%rsp), %r15
jl 0x5c0d
jne 0x5816
testl %r15d, %r15d
jg 0x5b57
jmp 0x5c0d
movq %r8, -0x10(%rsp)
movq %r9, -0x8(%rsp)
movq %rdx, -0x58(%rsp)
movq %rcx, -0x70(%rsp)
testl %r15d, %r15d
jle 0x5b2e
movq -0x58(%rsp), %r15
leaq 0x10(%r15), %r11
movq -0x78(%rsp), %rdx
movl %edx, %ecx
shlq $0x4, %rcx
leal (%rdx,%rdx), %esi
leal (%rdx,%rdx,2), %edi
leal (%rdx,%rdx,2), %edx
incl %edx
movq -0x80(%rsp), %r13
leal (%r13,%r13,2), %r10d
leal (,%r13,2), %ebx
movl %r13d, %r9d
shlq $0x4, %rbx
movq -0x70(%rsp), %r12
leaq (%rbx,%r12), %r14
addq $0x20, %r14
movq %r9, %rbx
movq %r9, %r8
shlq $0x6, %r8
movq %r8, -0x18(%rsp)
leal -0x3(,%r13,2), %r8d
leal (,%r13,4), %r9d
movl %r9d, -0x64(%rsp)
movq %rbx, %r9
shlq $0x5, %r9
addq $-0x20, %r9
movq %r9, -0x20(%rsp)
shlq $0x2, %r10
leaq (%r10,%rbx,4), %r9
addq $-0x8, %r9
movq %r9, -0x28(%rsp)
addq %r15, %rax
addq $0x10, %rax
movq %rbx, %r9
shlq $0x4, %r9
movq %r9, -0x30(%rsp)
leaq (%rcx,%r15), %r9
addq $0x20, %r9
shlq $0x4, %rsi
addq %r15, %rsi
addq $0x20, %rsi
shlq $0x4, %rdi
addq %r15, %rdi
addq $0x10, %rdi
shlq $0x4, %rdx
addq %r15, %rdx
addq $0x10, %rdx
leal -0x3(,%r13,4), %r15d
xorl %r10d, %r10d
movq %r12, %rcx
movq %r9, -0x50(%rsp)
movq %rdi, -0x48(%rsp)
movq %rax, -0x40(%rsp)
movq %rdx, -0x38(%rsp)
movq %r10, 0x8(%rsp)
movl $0x2, %ebp
movq -0x28(%rsp), %r10
movq -0x20(%rsp), %rdx
movl %r15d, -0x60(%rsp)
movl %r15d, %r12d
movl %r8d, -0x5c(%rsp)
movl %r8d, %r13d
xorl %eax, %eax
movq -0x70(%rsp), %rdi
movq -0x8(%rsp), %r9
movq -0x10(%rsp), %r8
movq -0x40(%rsp), %r15
movaps (%r15,%rax,4), %xmm2
movq -0x50(%rsp), %r15
movaps (%r15,%rax,4), %xmm3
movss (%r8,%rax), %xmm1
movss 0x4(%r8,%rax), %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(%rsi,%rax,4), %xmm4
movaps (%rsi,%rax,4), %xmm3
movss (%r9,%rax), %xmm2
movss 0x4(%r9,%rax), %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 -0x48(%rsp), %r15
movaps (%r15,%rax,4), %xmm8
movq -0x38(%rsp), %r15
movaps (%r15,%rax,4), %xmm9
movq 0x48(%rsp), %r15
movss (%r15,%rax), %xmm6
movss 0x4(%r15,%rax), %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 (%r11,%rax,4), %xmm9
movaps %xmm7, %xmm10
addps %xmm9, %xmm10
subps %xmm7, %xmm9
movaps %xmm10, %xmm7
addps %xmm8, %xmm7
movaps %xmm7, 0x10(%rcx,%rax,4)
subps %xmm8, %xmm10
movslq %r12d, %r12
movq %rbx, %r15
movq %r12, %rbx
shlq $0x4, %rbx
movaps %xmm10, (%rdi,%rbx)
movaps %xmm1, %xmm7
subps %xmm6, %xmm1
movaps %xmm9, %xmm8
addps %xmm1, %xmm8
movaps %xmm8, -0x10(%r14,%rax,4)
subps %xmm1, %xmm9
movslq %r13d, %r13
movq %r13, %rbx
shlq $0x4, %rbx
movaps %xmm9, (%rdi,%rbx)
movq %r15, %rbx
mulps %xmm3, %xmm2
subps %xmm5, %xmm2
subps %xmm0, %xmm4
addps %xmm6, %xmm7
movaps 0x10(%r11,%rax,4), %xmm0
movaps %xmm2, %xmm1
addps %xmm0, %xmm1
subps %xmm2, %xmm0
movaps %xmm7, %xmm2
addps %xmm1, %xmm2
movaps %xmm2, 0x20(%rcx,%rax,4)
subps %xmm1, %xmm7
movaps %xmm7, (%rcx,%r10,4)
movaps %xmm4, %xmm1
addps %xmm0, %xmm1
movaps %xmm1, (%r14,%rax,4)
subps %xmm0, %xmm4
movaps %xmm4, (%rcx,%rdx)
addq $0x2, %rbp
addq $0x8, %rax
addl $-0x2, %r13d
addl $-0x2, %r12d
addq $-0x20, %rdx
addq $-0x8, %r10
cmpq %r15, %rbp
jb 0x5950
movq 0x8(%rsp), %r10
addq %rbx, %r10
movq -0x18(%rsp), %rax
addq %rax, %r14
addq %rax, %rcx
movl -0x5c(%rsp), %r8d
movl -0x64(%rsp), %eax
addl %eax, %r8d
movl -0x60(%rsp), %r15d
addl %eax, %r15d
movq -0x30(%rsp), %rax
movq -0x40(%rsp), %rdi
addq %rax, %rdi
movq -0x50(%rsp), %r9
addq %rax, %r9
addq %rax, %rsi
movq -0x48(%rsp), %r12
addq %rax, %r12
movq -0x38(%rsp), %rdx
addq %rax, %rdx
addq %rax, %r11
cmpq (%rsp), %r10
movq %rdi, %rax
movq %r12, %rdi
jb 0x5907
movq -0x80(%rsp), %r12
testb $0x1, %r12b
sete %al
movq -0x78(%rsp), %r15
testl %r15d, %r15d
setg %cl
testb %cl, %al
movq -0x70(%rsp), %rcx
movq -0x58(%rsp), %rdx
je 0x5c0d
leal -0x1(%r12), %r8d
leal (%r15,%r15,2), %eax
leal (%r15,%r15), %ebx
leal (%r12,%r12,2), %r14d
movl %r12d, %esi
movl %r15d, %edi
shlq $0x4, %rbx
shlq $0x4, %r8
addq %r8, %rdx
shlq $0x4, %rsi
shlq $0x4, %rax
shlq $0x4, %rdi
leal (,%r12,4), %r8d
xorl %r9d, %r9d
movaps 0x2639(%rip), %xmm0     # 0x81d0
movl %r12d, %r10d
movaps (%rdx,%rdi), %xmm3
movaps (%rdx,%rax), %xmm4
movaps (%rdx), %xmm5
movaps (%rdx,%rbx), %xmm2
movaps %xmm3, %xmm1
addps %xmm4, %xmm1
mulps %xmm0, %xmm1
subps %xmm3, %xmm4
mulps %xmm0, %xmm4
movaps %xmm5, %xmm3
addps %xmm4, %xmm3
leal -0x1(%r10), %r11d
shlq $0x4, %r11
movaps %xmm3, (%rcx,%r11)
subps %xmm4, %xmm5
leal -0x1(%r14), %r11d
shlq $0x4, %r11
movaps %xmm5, (%rcx,%r11)
movaps %xmm1, %xmm3
subps %xmm2, %xmm3
movl %r10d, %r11d
shlq $0x4, %r11
movaps %xmm3, (%rcx,%r11)
addps %xmm2, %xmm1
movl %r14d, %r11d
shlq $0x4, %r11
movaps %xmm1, (%rcx,%r11)
addq %rsi, %rdx
addl %r8d, %r10d
addl %r8d, %r14d
addl %r12d, %r9d
cmpl %r9d, %r15d
jg 0x5b9a
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq