// File: /workspace/github_cpp_makefile_star2_O3/marxn[P]pupp/3rdparty/gmp/mpn/mul_fft.c
// Function: mpn_fft_fftinv
static void
mpn_fft_fftinv (mp_ptr *Ap, mp_size_t K, mp_size_t omega, mp_size_t n, mp_ptr tp)
{
  if (K == 2)
    {
      mp_limb_t cy;
#if HAVE_NATIVE_mpn_add_n_sub_n
      cy = mpn_add_n_sub_n (Ap[0], Ap[1], Ap[0], Ap[1], n + 1) & 1;
#else
      MPN_COPY (tp, Ap[0], n + 1);
      mpn_add_n (Ap[0], Ap[0], Ap[1], n + 1);
      cy = mpn_sub_n (Ap[1], tp, Ap[1], n + 1);
#endif
      if (Ap[0][n] > 1) /* can be 2 or 3 */
	Ap[0][n] = 1 - mpn_sub_1 (Ap[0], Ap[0], n, Ap[0][n] - 1);
      if (cy) /* Ap[1][n] can be -1 or -2 */
	Ap[1][n] = mpn_add_1 (Ap[1], Ap[1], n, ~Ap[1][n] + 1);
    }
  else
    {
      mp_size_t j, K2 = K >> 1;

      mpn_fft_fftinv (Ap,      K2, 2 * omega, n, tp);
      mpn_fft_fftinv (Ap + K2, K2, 2 * omega, n, tp);
      /* A[j]     <- A[j] + omega^j A[j+K/2]
	 A[j+K/2] <- A[j] + omega^(j+K/2) A[j+K/2] */
      for (j = 0; j < K2; j++, Ap++)
	{
	  /* Ap[K2] <- Ap[0] + Ap[K2] * 2^((j + K2) * omega)
	     Ap[0]  <- Ap[0] + Ap[K2] * 2^(j * omega) */
	  mpn_fft_mul_2exp_modF (tp, Ap[K2], j * omega, n);
	  mpn_fft_sub_modF (Ap[K2], Ap[0], tp, n);
	  mpn_fft_add_modF (Ap[0],  Ap[0], tp, n);
	}
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r14
movq %rcx, %rbx
movq %rdi, %rbp
cmpq $0x2, %rsi
jne 0x31fcb
movq (%rbp), %rsi
leaq 0x1(%rbx), %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x2f106
movq (%rbp), %rdi
movq 0x8(%rbp), %rdx
movq %rdi, %rsi
movq %r12, %rcx
callq 0x1ba80
movq 0x8(%rbp), %rdi
movq %r14, %rsi
movq %rdi, %rdx
movq %r12, %rcx
callq 0x1bca0
movq (%rbp), %rcx
movq (%rcx,%rbx,8), %rsi
cmpq $0x2, %rsi
jb 0x31f78
decq %rsi
movl $0x1, %edx
subq %rsi, (%rcx)
jae 0x31f74
cmpq $0x2, %rbx
movl $0x1, %edi
movl $0x1, %esi
cmovgeq %rbx, %rsi
xorl %edx, %edx
cmpq %rdi, %rsi
je 0x31f74
subq $0x1, (%rcx,%rdi,8)
leaq 0x1(%rdi), %rdi
jb 0x31f5f
movl $0x1, %edx
movq %rdx, (%rcx,%rbx,8)
testq %rax, %rax
je 0x32104
movq 0x8(%rbp), %rax
movq (%rax,%rbx,8), %rcx
movq (%rax), %rdx
subq %rcx, %rdx
negq %rcx
movq %rdx, (%rax)
cmpq %rcx, %rdx
jae 0x31fc0
cmpq $0x2, %rbx
movl $0x1, %ecx
movl $0x1, %edx
cmovgeq %rbx, %rdx
movl $0x1, %esi
cmpq %rsi, %rdx
je 0x31fc2
incq (%rax,%rsi,8)
leaq 0x1(%rsi), %rsi
je 0x31fb1
xorl %ecx, %ecx
movq %rcx, (%rax,%rbx,8)
jmp 0x32104
movq %rdx, %r15
movq %rsi, %r13
sarq %r13
leaq (%rdx,%rdx), %r12
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %rbx, %rcx
movq %r14, %r8
callq 0x31ed7
leaq (,%r13,8), %rdi
addq %rbp, %rdi
movq %rdi, 0x20(%rsp)
movq %r13, %rsi
movq %r12, %rdx
movq %rbx, %rcx
movq %r14, 0x28(%rsp)
movq %r14, %r8
callq 0x31ed7
testq %r13, %r13
jle 0x32104
xorl %edx, %edx
xorl %r14d, %r14d
movq %rbp, 0x18(%rsp)
movq %r15, 0x8(%rsp)
movq %r13, 0x10(%rsp)
movq 0x28(%rsp), %r12
movq 0x20(%rsp), %r15
movq (%r15,%r14,8), %rsi
movq %r12, %rdi
movq %rdx, 0x30(%rsp)
movq %rbx, %rcx
callq 0x319c2
movq (%r15,%r14,8), %r13
movq (%rbp,%r14,8), %rsi
movq (%rsi,%rbx,8), %rbp
movq (%r12,%rbx,8), %r15
movq %r13, %rdi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x1bca0
addq %r15, %rax
subq %rax, %rbp
movq %rbp, %rax
negq %rax
movq %rbp, %rcx
sarq $0x3f, %rcx
andq %rax, %rcx
addq %rcx, %rbp
movq %rbp, (%r13,%rbx,8)
movq 0x18(%rsp), %rbp
addq %rcx, (%r13)
jae 0x320a0
addq $0x1, 0x8(%r13)
leaq 0x8(%r13), %r13
jb 0x32095
movq (%rbp,%r14,8), %r13
movq (%r12,%rbx,8), %r15
addq (%r13,%rbx,8), %r15
movq %r13, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x1ba80
addq %r15, %rax
movq %rax, %rcx
subq $0x1, %rcx
jae 0x320cd
xorl %ecx, %ecx
movq 0x8(%rsp), %r15
subq %rcx, %rax
movq %rax, (%r13,%rbx,8)
subq %rcx, (%r13)
jae 0x320eb
subq $0x1, 0x8(%r13)
leaq 0x8(%r13), %r13
jb 0x320e0
incq %r14
movq 0x30(%rsp), %rdx
addq %r15, %rdx
movq 0x10(%rsp), %r13
cmpq %r14, %r13
jne 0x32034
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq