// File: /workspace/github_cpp_makefile_star2_O1/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 0x1daa5
cmpq $0x80, %rbx
jle 0x1dabd
cmpq $0x20e, %rbx            # imm = 0x20E
jle 0x1dad7
cmpq $0x231, %rbx            # imm = 0x231
jle 0x1db03
cmpq $0x167f, %rbx           # imm = 0x167F
jle 0x1db2c
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 0x1e890
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1e000
leaq -0xc20(%rbp), %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x26ee4
jmp 0x1db87
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 0x271b4
jmp 0x1db87
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 0x2761c
jmp 0x1db87
movq $0x0, -0xc20(%rbp)
leaq (%rbx,%rbx,4), %rax
leaq (%rax,%rax,2), %rax
movabsq $0x7ffffffffffffff8, %rcx # imm = 0x7FFFFFFFFFFFFFF8
andq %rax, %rcx
leaq 0x1390(%rcx), %rsi
cmpq $0x6b70, %rcx           # imm = 0x6B70
ja 0x1db92
movq %rsp, %rcx
addq $0xf, %rsi
andq $-0x10, %rsi
subq %rsi, %rcx
movq %rcx, %rsp
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x25edc
movq -0xc20(%rbp), %rdi
testq %rdi, %rdi
jne 0x1dba3
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0xc20(%rbp), %rdi
callq 0x30170
movq %rax, %rcx
jmp 0x1db6d
callq 0x301a3
jmp 0x1db87
nopw (%rax,%rax)