// File: /workspace/github_cpp_makefile_star2_O2/marxn[P]pupp/3rdparty/gmp/mpn/sqr.c
// Function: _gmpn_sqr
void
mpn_sqr (mp_ptr p, mp_srcptr a, mp_size_t n)
{
  ASSERT (n >= 1);
  ASSERT (! MPN_OVERLAP_P (p, 2 * n, a, n));

  if (BELOW_THRESHOLD (n, SQR_BASECASE_THRESHOLD))
    { /* mul_basecase is faster than sqr_basecase on small sizes sometimes */
      mpn_mul_basecase (p, a, n, a, n);
    }
  else if (BELOW_THRESHOLD (n, SQR_TOOM2_THRESHOLD))
    {
      mpn_sqr_basecase (p, a, n);
    }
  else if (BELOW_THRESHOLD (n, SQR_TOOM3_THRESHOLD))
    {
      /* Allocate workspace of fixed size on stack: fast! */
      mp_limb_t ws[mpn_toom2_sqr_itch (SQR_TOOM3_THRESHOLD_LIMIT-1)];
      ASSERT (SQR_TOOM3_THRESHOLD <= SQR_TOOM3_THRESHOLD_LIMIT);
      mpn_toom2_sqr (p, a, n, ws);
    }
  else if (BELOW_THRESHOLD (n, SQR_TOOM4_THRESHOLD))
    {
      mp_ptr ws;
      TMP_SDECL;
      TMP_SMARK;
      ws = TMP_SALLOC_LIMBS (mpn_toom3_sqr_itch (n));
      mpn_toom3_sqr (p, a, n, ws);
      TMP_SFREE;
    }
  else if (BELOW_THRESHOLD (n, SQR_TOOM6_THRESHOLD))
    {
      mp_ptr ws;
      TMP_SDECL;
      TMP_SMARK;
      ws = TMP_SALLOC_LIMBS (mpn_toom4_sqr_itch (n));
      mpn_toom4_sqr (p, a, n, ws);
      TMP_SFREE;
    }
  else if (BELOW_THRESHOLD (n, SQR_TOOM8_THRESHOLD))
    {
      mp_ptr ws;
      TMP_SDECL;
      TMP_SMARK;
      ws = TMP_SALLOC_LIMBS (mpn_toom6_sqr_itch (n));
      mpn_toom6_sqr (p, a, n, ws);
      TMP_SFREE;
    }
  else if (BELOW_THRESHOLD (n, SQR_FFT_THRESHOLD))
    {
      mp_ptr ws;
      TMP_DECL;
      TMP_MARK;
      ws = TMP_ALLOC_LIMBS (mpn_toom8_sqr_itch (n));
      mpn_toom8_sqr (p, a, n, ws);
      TMP_FREE;
    }
  else
    {
      /* The current FFT code allocates its own space.  That should probably
	 change.  */
      mpn_fft_mul (p, a, n, a, n);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc08, %rsp            # imm = 0xC08
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq $0x21, %rdx
jle 0x19729
cmpq $0x80, %rbx
jbe 0x19741
cmpq $0x20e, %rbx            # imm = 0x20E
jbe 0x1975b
cmpq $0x231, %rbx            # imm = 0x231
jbe 0x19782
cmpq $0x167f, %rbx           # imm = 0x167F
jbe 0x197a9
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r14, %rcx
movq %rbx, %r8
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1a500
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x19c70
leaq -0xc20(%rbp), %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x21e84
jmp 0x197f0
imulq $0x18, %rbx, %rax
movq %rsp, %rcx
addq $0x20f, %rax            # imm = 0x20F
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, %rsp
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x220b0
jmp 0x197f0
imulq $0x18, %rbx, %rax
movq %rsp, %rcx
addq $0x20f, %rax            # imm = 0x20F
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, %rsp
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x223d0
jmp 0x197f0
andq $0x0, -0xc20(%rbp)
imull $0xf, %ebx, %eax
andl $0x1fff8, %eax          # imm = 0x1FFF8
leaq 0x1390(%rax), %rsi
cmpl $0x6b70, %eax           # imm = 0x6B70
ja 0x197fb
movq %rsp, %rcx
addl $0xf, %esi
andl $-0x10, %esi
subq %rsi, %rcx
movq %rcx, %rsp
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x21038
movq -0xc20(%rbp), %rdi
testq %rdi, %rdi
jne 0x1980c
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0xc20(%rbp), %rdi
callq 0x29dc0
movq %rax, %rcx
jmp 0x197d6
callq 0x29df3
jmp 0x197f0
nopw %cs:(%rax,%rax)
nopl (%rax)