// File: /workspace/github_c_makefile_star2_O0/pavel-demin[P]ft8d-c/pffft.c
// Function: pffft_transform_internal
void pffft_transform_internal(PFFFT_Setup *setup, const float *finput, float *foutput, v4sf *scratch,
                             pffft_direction_t direction, int ordered) {
  int k, Ncvec   = setup->Ncvec;
  int nf_odd = (setup->ifac[1] & 1);

  // temporary buffer is allocated on the stack if the scratch pointer is NULL
  int stack_allocate = (scratch == 0 ? Ncvec*2 : 1);
  VLA_ARRAY_ON_STACK(v4sf, scratch_on_stack, stack_allocate);

  const v4sf *vinput = (const v4sf*)finput;
  v4sf *voutput      = (v4sf*)foutput;
  v4sf *buff[2]      = { voutput, scratch ? scratch : scratch_on_stack };
  int ib = (nf_odd ^ ordered ? 1 : 0);

  assert(VALIGNED(finput) && VALIGNED(foutput));

  //assert(finput != foutput);
  if (direction == PFFFT_FORWARD) {
    ib = !ib;
    if (setup->transform == PFFFT_REAL) {
      ib = (rfftf1_ps(Ncvec*2, vinput, buff[ib], buff[!ib],
                      setup->twiddle, &setup->ifac[0]) == buff[0] ? 0 : 1);
      pffft_real_finalize(Ncvec, buff[ib], buff[!ib], (v4sf*)setup->e);
    } else {
      v4sf *tmp = buff[ib];
      for (k=0; k < Ncvec; ++k) {
        UNINTERLEAVE2(vinput[k*2], vinput[k*2+1], tmp[k*2], tmp[k*2+1]);
      }
      ib = (cfftf1_ps(Ncvec, buff[ib], buff[!ib], buff[ib],
                      setup->twiddle, &setup->ifac[0], -1) == buff[0] ? 0 : 1);
      pffft_cplx_finalize(Ncvec, buff[ib], buff[!ib], (v4sf*)setup->e);
    }
    if (ordered) {
      pffft_zreorder(setup, (float*)buff[!ib], (float*)buff[ib], PFFFT_FORWARD);
    } else ib = !ib;
  } else {
    if (vinput == buff[ib]) {
      ib = !ib; // may happen when finput == foutput
    }
    if (ordered) {
      pffft_zreorder(setup, (float*)vinput, (float*)buff[ib], PFFFT_BACKWARD);
      vinput = buff[ib]; ib = !ib;
    }
    if (setup->transform == PFFFT_REAL) {
      pffft_real_preprocess(Ncvec, vinput, buff[ib], (v4sf*)setup->e);
      ib = (rfftb1_ps(Ncvec*2, buff[ib], buff[0], buff[1],
                      setup->twiddle, &setup->ifac[0]) == buff[0] ? 0 : 1);
    } else {
      pffft_cplx_preprocess(Ncvec, vinput, buff[ib], (v4sf*)setup->e);
      ib = (cfftf1_ps(Ncvec, buff[ib], buff[0], buff[1],
                      setup->twiddle, &setup->ifac[0], +1) == buff[0] ? 0 : 1);
      for (k=0; k < Ncvec; ++k) {
        INTERLEAVE2(buff[ib][k*2], buff[ib][k*2+1], buff[ib][k*2], buff[ib][k*2+1]);
      }
    }
  }

  if (buff[ib] != voutput) {
    /* extra copy required -- this situation should only happen when finput == foutput */
    assert(finput==foutput);
    for (k=0; k < Ncvec; ++k) {
      v4sf a = buff[ib][2*k], b = buff[ib][2*k+1];
      voutput[2*k] = a; voutput[2*k+1] = b;
    }
    ib = !ib;
  }
  assert(buff[ib] == voutput);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x48(%rbp)
movq %rsi, -0x50(%rbp)
movq %rdx, -0x58(%rbp)
movq %rcx, -0x60(%rbp)
movl %r8d, -0x64(%rbp)
movl %r9d, -0x68(%rbp)
movq -0x48(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x48(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x1, %eax
movl %eax, -0x74(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x8cee
movl -0x70(%rbp), %eax
shll %eax
movl %eax, -0x104(%rbp)
jmp 0x8cfb
movl $0x1, %eax
movl %eax, -0x104(%rbp)
jmp 0x8cfb
movl -0x104(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x80(%rbp)
movq %rax, %rdx
shlq $0x4, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x118(%rbp)
movq %rcx, %rsp
movq %rax, -0x88(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0xb0(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x110(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x8d76
movq -0x60(%rbp), %rax
movq %rax, -0x120(%rbp)
jmp 0x8d86
movq -0x118(%rbp), %rax
movq %rax, -0x120(%rbp)
jmp 0x8d86
movq -0x110(%rbp), %rax
movq -0x120(%rbp), %rcx
movq %rcx, (%rax)
movl -0x74(%rbp), %edx
xorl -0x68(%rbp), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0xb4(%rbp)
movq -0x50(%rbp), %rax
andq $0xf, %rax
cmpq $0x0, %rax
jne 0x8dce
movq -0x58(%rbp), %rax
andq $0xf, %rax
cmpq $0x0, %rax
jne 0x8dce
jmp 0x8ded
leaq 0xfac0(%rip), %rdi      # 0x18895
leaq 0xf402(%rip), %rsi      # 0x181de
movl $0x657, %edx            # imm = 0x657
leaq 0xfad3(%rip), %rcx      # 0x188bb
callq 0x1090
cmpl $0x0, -0x64(%rbp)
jne 0x908d
cmpl $0x0, -0xb4(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0xb4(%rbp)
movq -0x48(%rbp), %rax
cmpl $0x0, 0x44(%rax)
jne 0x8ec3
movl -0x70(%rbp), %edi
shll %edi
movq -0x90(%rbp), %rsi
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rdx
cmpl $0x0, -0xb4(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
movq -0xb0(%rbp,%rax,8), %rcx
movq -0x48(%rbp), %rax
movq 0x58(%rax), %r8
movq -0x48(%rbp), %r9
addq $0x8, %r9
callq 0x9470
movq %rax, %rdx
movq -0xb0(%rbp), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovel %ecx, %eax
movl %eax, -0xb4(%rbp)
movl -0x70(%rbp), %edi
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rsi
cmpl $0x0, -0xb4(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
movq -0xb0(%rbp,%rax,8), %rdx
movq -0x48(%rbp), %rax
movq 0x50(%rax), %rcx
callq 0x9740
jmp 0x9034
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
movq %rax, -0xc0(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x70(%rbp), %eax
jge 0x8f7d
movq -0x90(%rbp), %rax
movl -0x6c(%rbp), %ecx
addl %ecx, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
movaps (%rax,%rcx), %xmm0
movaps 0x10(%rax,%rcx), %xmm1
shufps $0x88, %xmm1, %xmm0     # xmm0 = xmm0[0,2],xmm1[0,2]
movaps %xmm0, -0xd0(%rbp)
movq -0x90(%rbp), %rax
movl -0x6c(%rbp), %ecx
addl %ecx, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
movaps (%rax,%rcx), %xmm0
movaps 0x10(%rax,%rcx), %xmm1
shufps $0xdd, %xmm1, %xmm0     # xmm0 = xmm0[1,3],xmm1[1,3]
movq -0xc0(%rbp), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movaps %xmm0, (%rax)
movaps -0xd0(%rbp), %xmm0
movq -0xc0(%rbp), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movaps %xmm0, (%rax)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x8ee0
movl -0x70(%rbp), %edi
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rsi
cmpl $0x0, -0xb4(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
movq -0xb0(%rbp,%rax,8), %rdx
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rcx
movq -0x48(%rbp), %rax
movq 0x58(%rax), %r8
movq -0x48(%rbp), %r9
addq $0x8, %r9
subq $0x10, %rsp
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
callq 0x2450
addq $0x10, %rsp
movq %rax, %rdx
movq -0xb0(%rbp), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovel %ecx, %eax
movl %eax, -0xb4(%rbp)
movl -0x70(%rbp), %edi
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rsi
cmpl $0x0, -0xb4(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
movq -0xb0(%rbp,%rax,8), %rdx
movq -0x48(%rbp), %rax
movq 0x50(%rax), %rcx
callq 0x71c0
cmpl $0x0, -0x68(%rbp)
je 0x9071
movq -0x48(%rbp), %rdi
cmpl $0x0, -0xb4(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
movq -0xb0(%rbp,%rax,8), %rsi
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rdx
xorl %ecx, %ecx
callq 0x6710
jmp 0x9088
cmpl $0x0, -0xb4(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0xb4(%rbp)
jmp 0x9309
movq -0x90(%rbp), %rax
movslq -0xb4(%rbp), %rcx
cmpq -0xb0(%rbp,%rcx,8), %rax
jne 0x90bc
cmpl $0x0, -0xb4(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0xb4(%rbp)
cmpl $0x0, -0x68(%rbp)
je 0x9113
movq -0x48(%rbp), %rdi
movq -0x90(%rbp), %rsi
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rdx
movl $0x1, %ecx
callq 0x6710
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
movq %rax, -0x90(%rbp)
cmpl $0x0, -0xb4(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0xb4(%rbp)
movq -0x48(%rbp), %rax
cmpl $0x0, 0x44(%rax)
jne 0x919c
movl -0x70(%rbp), %edi
movq -0x90(%rbp), %rsi
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rdx
movq -0x48(%rbp), %rax
movq 0x50(%rax), %rcx
callq 0xb280
movl -0x70(%rbp), %edi
shll %edi
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rsi
movq -0xb0(%rbp), %rdx
movq -0xa8(%rbp), %rcx
movq -0x48(%rbp), %rax
movq 0x58(%rax), %r8
movq -0x48(%rbp), %r9
addq $0x8, %r9
callq 0xce50
movq %rax, %rdx
movq -0xb0(%rbp), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovel %ecx, %eax
movl %eax, -0xb4(%rbp)
jmp 0x9307
movl -0x70(%rbp), %edi
movq -0x90(%rbp), %rsi
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rdx
movq -0x48(%rbp), %rax
movq 0x50(%rax), %rcx
callq 0x7f30
movl -0x70(%rbp), %edi
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rsi
movq -0xb0(%rbp), %rdx
movq -0xa8(%rbp), %rcx
movq -0x48(%rbp), %rax
movq 0x58(%rax), %r8
movq -0x48(%rbp), %r9
addq $0x8, %r9
subq $0x10, %rsp
movl $0x1, (%rsp)
callq 0x2450
addq $0x10, %rsp
movq %rax, %rdx
movq -0xb0(%rbp), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovel %ecx, %eax
movl %eax, -0xb4(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x70(%rbp), %eax
jge 0x9305
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
movl -0x6c(%rbp), %ecx
addl %ecx, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
movaps (%rax,%rcx), %xmm1
movaps 0x10(%rax,%rcx), %xmm0
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps -0x30(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movaps %xmm0, -0xe0(%rbp)
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
movl -0x6c(%rbp), %ecx
addl %ecx, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
movaps (%rax,%rcx), %xmm1
movaps 0x10(%rax,%rcx), %xmm0
movaps %xmm1, -0x10(%rbp)
movaps %xmm0, -0x20(%rbp)
movaps -0x10(%rbp), %xmm0
movaps -0x20(%rbp), %xmm1
unpckhps %xmm1, %xmm0            # xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movaps %xmm0, (%rax)
movaps -0xe0(%rbp), %xmm0
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movaps %xmm0, (%rax)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x922a
jmp 0x9307
jmp 0x9309
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
cmpq -0x98(%rbp), %rax
je 0x941e
movq -0x50(%rbp), %rax
cmpq -0x58(%rbp), %rax
jne 0x9331
jmp 0x9350
leaq 0xf5e8(%rip), %rdi      # 0x18920
leaq 0xee9f(%rip), %rsi      # 0x181de
movl $0x684, %edx            # imm = 0x684
leaq 0xf570(%rip), %rcx      # 0x188bb
callq 0x1090
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x70(%rbp), %eax
jge 0x9407
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movaps (%rax), %xmm0
movaps %xmm0, -0xf0(%rbp)
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movaps (%rax), %xmm0
movaps %xmm0, -0x100(%rbp)
movaps -0xf0(%rbp), %xmm0
movq -0x98(%rbp), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movaps %xmm0, (%rax)
movaps -0x100(%rbp), %xmm0
movq -0x98(%rbp), %rax
movl -0x6c(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movaps %xmm0, (%rax)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x9357
cmpl $0x0, -0xb4(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0xb4(%rbp)
movslq -0xb4(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rax
cmpq -0x98(%rbp), %rax
jne 0x9438
jmp 0x9457
leaq 0xf4f1(%rip), %rdi      # 0x18930
leaq 0xed98(%rip), %rsi      # 0x181de
movl $0x68b, %edx            # imm = 0x68B
leaq 0xf469(%rip), %rcx      # 0x188bb
callq 0x1090
movq -0x80(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)