// File: /workspace/github_cpp_makefile_star2_O3/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 0x1d57d
cmpq $0x80, %rbx
jbe 0x1d595
cmpq $0x20e, %rbx            # imm = 0x20E
jbe 0x1d5af
cmpq $0x231, %rbx            # imm = 0x231
jbe 0x1d5d8
cmpq $0x167f, %rbx           # imm = 0x167F
jbe 0x1d601
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 0x1e360
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1dad0
leaq -0xc20(%rbp), %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x26b38
jmp 0x1d64e
leaq (%rbx,%rbx,2), %rax
movq %rsp, %rcx
leaq 0x20f(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, %rsp
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x26dec
jmp 0x1d64e
leaq (%rbx,%rbx,2), %rax
movq %rsp, %rcx
leaq 0x20f(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, %rsp
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x272d0
jmp 0x1d64e
movq $0x0, -0xc20(%rbp)
leal (%rbx,%rbx,4), %eax
leal (%rax,%rax,2), %eax
andl $0x1fff8, %eax          # imm = 0x1FFF8
leaq 0x1390(%rax), %rsi
cmpl $0x6b70, %eax           # imm = 0x6B70
ja 0x1d659
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 0x25a40
movq -0xc20(%rbp), %rdi
testq %rdi, %rdi
jne 0x1d66a
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0xc20(%rbp), %rdi
callq 0x2fdb0
movq %rax, %rcx
jmp 0x1d634
callq 0x2fde3
jmp 0x1d64e
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)