// File: /workspace/github_cpp_makefile_star2_O3/marxn[P]pupp/3rdparty/gmp/gen-psqr.c
// Function: print
void
print (int limb_bits, int nail_bits)
{
  int    i;
  mpz_t  mhi, mlo;

  printf ("/* This file generated by gen-psqr.c - DO NOT EDIT. */\n");
  printf ("\n");

  printf ("#if GMP_LIMB_BITS != %d || GMP_NAIL_BITS != %d\n",
          limb_bits, nail_bits);
  printf ("Error, error, this data is for %d bit limb and %d bit nail\n",
          limb_bits, nail_bits);
  printf ("#endif\n");
  printf ("\n");

  printf ("/* Non-zero bit indicates a quadratic residue mod 0x100.\n");
  printf ("   This test identifies %.2f%% as non-squares (%d/256). */\n",
          (1.0 - sq_res_0x100_fraction) * 100.0,
          0x100 - sq_res_0x100_num);
  printf ("static const mp_limb_t\n");
  printf ("sq_res_0x100[%d] = {\n", nsq_res_0x100);
  for (i = 0; i < nsq_res_0x100; i++)
    {
      printf ("  CNST_LIMB(0x");
      mpz_out_str (stdout, 16, sq_res_0x100[i]);
      printf ("),\n");
    }
  printf ("};\n");
  printf ("\n");

  if (mpz_sgn (pp) != 0)
    {
      printf ("/* mpn_mod_34lsub1 not used due to %s */\n", mod34_excuse);
      printf ("/* PERFSQR_PP = ");
    }
  else
    printf ("/* 2^%d-1 = ", mod34_bits);
  for (i = 0; i < nrawfactor; i++)
    {
      if (i != 0)
        printf (" * ");
      printf ("%d", rawfactor[i].divisor);
      if (rawfactor[i].multiplicity != 1)
        printf ("^%d", rawfactor[i].multiplicity);
    }
  printf (" %s*/\n", mpz_sgn (pp) == 0 ? "... " : "");

  printf ("#define PERFSQR_MOD_BITS  %d\n", mod_bits);
  if (mpz_sgn (pp) != 0)
    {
      printf ("#define PERFSQR_PP            CNST_LIMB(0x");
      mpz_out_str (stdout, 16, pp);
      printf (")\n");
      printf ("#define PERFSQR_PP_NORM       CNST_LIMB(0x");
      mpz_out_str (stdout, 16, pp_norm);
      printf (")\n");
      printf ("#define PERFSQR_PP_INVERTED   CNST_LIMB(0x");
      mpz_out_str (stdout, 16, pp_inverted);
      printf (")\n");
    }
  printf ("\n");

  mpz_init (mhi);
  mpz_init (mlo);

  printf ("/* This test identifies %.2f%% as non-squares. */\n",
          (1.0 - total_fraction) * 100.0);
  printf ("#define PERFSQR_MOD_TEST(up, usize) \\\n");
  printf ("  do {                              \\\n");
  printf ("    mp_limb_t  r;                   \\\n");
  if (mpz_sgn (pp) != 0)
    printf ("    PERFSQR_MOD_PP (r, up, usize);  \\\n");
  else
    printf ("    PERFSQR_MOD_34 (r, up, usize);  \\\n");

  for (i = 0; i < nfactor; i++)
    {
      printf ("                                    \\\n");
      printf ("    /* %5.2f%% */                    \\\n",
              (1.0 - factor[i].fraction) * 100.0);

      printf ("    PERFSQR_MOD_%d (r, CNST_LIMB(%2d), CNST_LIMB(0x",
              factor[i].divisor <= limb_bits ? 1 : 2,
              factor[i].divisor);
      mpz_out_str (stdout, 16, factor[i].inverse);
      printf ("), \\\n");
      printf ("                   CNST_LIMB(0x");

      if ( factor[i].divisor <= limb_bits)
        {
          mpz_out_str (stdout, 16, factor[i].mask);
        }
      else
        {
          mpz_tdiv_r_2exp (mlo, factor[i].mask, (unsigned long) limb_bits);
          mpz_tdiv_q_2exp (mhi, factor[i].mask, (unsigned long) limb_bits);
          mpz_out_str (stdout, 16, mhi);
          printf ("), CNST_LIMB(0x");
          mpz_out_str (stdout, 16, mlo);
        }
      printf (")); \\\n");
    }

  printf ("  } while (0)\n");
  printf ("\n");

  printf ("/* Grand total sq_res_0x100 and PERFSQR_MOD_TEST, %.2f%% non-squares. */\n",
          (1.0 - (total_fraction * 44.0/256.0)) * 100.0);
  printf ("\n");

  printf ("/* helper for tests/mpz/t-perfsqr.c */\n");
  printf ("#define PERFSQR_DIVISORS  { 256,");
  for (i = 0; i < nfactor; i++)
      printf (" %d,", factor[i].divisor);
  printf (" }\n");


  mpz_clear (mhi);
  mpz_clear (mlo);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %r14d
movl %edi, %ebx
leaq 0x22c1(%rip), %rdi      # 0xb714
callq 0x1060
movl $0xa, %edi
callq 0x1040
leaq 0x1762(%rip), %rdi      # 0xabcb
movl %ebx, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x1090
leaq 0x177f(%rip), %rdi      # 0xabfb
movl %ebx, -0x2c(%rbp)
movl %ebx, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x1090
leaq 0x22b9(%rip), %rdi      # 0xb74b
callq 0x1060
movl $0xa, %edi
callq 0x1040
leaq 0x22aa(%rip), %rdi      # 0xb752
callq 0x1060
movsd 0xb5b(%rip), %xmm0      # 0xa010
subsd 0x5c3b(%rip), %xmm0     # 0xf0f8
mulsd 0xb73(%rip), %xmm0      # 0xa038
movl $0x100, %esi            # imm = 0x100
subl 0x5c20(%rip), %esi      # 0xf0f0
leaq 0x1760(%rip), %rdi      # 0xac37
movb $0x1, %al
callq 0x1090
leaq 0x22a6(%rip), %rdi      # 0xb78b
callq 0x1060
movl 0x5bf4(%rip), %esi      # 0xf0e4
leaq 0x177c(%rip), %rdi      # 0xac73
xorl %eax, %eax
callq 0x1090
cmpl $0x0, 0x5bdf(%rip)      # 0xf0e4
jle 0x955e
leaq 0x1916(%rip), %r14      # 0xae24
movq 0x5ac3(%rip), %r12      # 0xefd8
leaq 0x23b0(%rip), %r15      # 0xb8cc
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r14, %rdi
xorl %eax, %eax
callq 0x1090
movq (%r12), %rdi
movq 0x5bb2(%rip), %rdx      # 0xf0e8
addq %r13, %rdx
movl $0x10, %esi
callq 0x802f
movq %r15, %rdi
callq 0x1060
incq %rbx
movslq 0x5b8f(%rip), %rax      # 0xf0e4
addq $0x10, %r13
cmpq %rax, %rbx
jl 0x9521
leaq 0x223d(%rip), %rdi      # 0xb7a2
callq 0x1060
movl $0xa, %edi
callq 0x1040
movl 0x5b8a(%rip), %eax      # 0xf104
movl %eax, %ecx
sarl $0x1f, %ecx
xorl %edx, %edx
testl %eax, %eax
setne %dl
orl %ecx, %edx
je 0x95af
leaq 0x16f8(%rip), %rdi      # 0xac89
leaq 0x5bb8(%rip), %rsi      # 0xf150
xorl %eax, %eax
callq 0x1090
leaq 0x170d(%rip), %rdi      # 0xacb3
xorl %eax, %eax
callq 0x1090
jmp 0x95c3
movl 0x5c23(%rip), %esi      # 0xf1d8
leaq 0x1708(%rip), %rdi      # 0xacc4
xorl %eax, %eax
callq 0x1090
cmpl $0x0, 0x5c12(%rip)      # 0xf1dc
jle 0x9632
leaq 0x1703(%rip), %r14      # 0xacd6
leaq 0x16fb(%rip), %r15      # 0xacd5
leaq 0x16f0(%rip), %r12      # 0xacd1
xorl %r13d, %r13d
testq %r13, %r13
je 0x95f3
movq %r12, %rdi
xorl %eax, %eax
callq 0x1090
movq 0x5b46(%rip), %rax      # 0xf140
movl (%rax,%r13,8), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1090
movq 0x5b31(%rip), %rax      # 0xf140
movl 0x4(%rax,%r13,8), %esi
cmpl $0x1, %esi
je 0x9623
movq %r15, %rdi
xorl %eax, %eax
callq 0x1090
incq %r13
movslq 0x5baf(%rip), %rax      # 0xf1dc
cmpq %rax, %r13
jl 0x95e4
movl 0x5acc(%rip), %eax      # 0xf104
movl %eax, %ecx
sarl $0x1f, %ecx
xorl %edx, %edx
testl %eax, %eax
setne %dl
orl %ecx, %edx
leaq 0x1693(%rip), %rax      # 0xace0
leaq 0x161e(%rip), %rsi      # 0xac72
cmoveq %rax, %rsi
leaq 0x167a(%rip), %rdi      # 0xacd9
xorl %eax, %eax
callq 0x1090
movl 0x5a74(%rip), %esi      # 0xf0e0
leaq 0x1672(%rip), %rdi      # 0xace5
xorl %eax, %eax
callq 0x1090
movl 0x5a84(%rip), %eax      # 0xf104
movl %eax, %ecx
sarl $0x1f, %ecx
xorl %edx, %edx
testl %eax, %eax
setne %dl
orl %ecx, %edx
je 0x9720
leaq 0x1668(%rip), %rdi      # 0xad03
xorl %eax, %eax
callq 0x1090
movq 0x592f(%rip), %r15      # 0xefd8
movq (%r15), %rdi
leaq 0x5a4d(%rip), %rdx      # 0xf100
movl $0x10, %esi
callq 0x802f
leaq 0x129f(%rip), %r14      # 0xa963
movq %r14, %rdi
callq 0x1060
leaq 0x165b(%rip), %rdi      # 0xad2e
xorl %eax, %eax
callq 0x1090
movq (%r15), %rdi
leaq 0x5a2c(%rip), %rdx      # 0xf110
movl $0x10, %esi
callq 0x802f
movq %r14, %rdi
callq 0x1060
leaq 0x165c(%rip), %rdi      # 0xad59
xorl %eax, %eax
callq 0x1090
movq (%r15), %rdi
leaq 0x5a12(%rip), %rdx      # 0xf120
movl $0x10, %esi
callq 0x802f
movq %r14, %rdi
callq 0x1060
movl $0xa, %edi
callq 0x1040
movl $0x1, %ebx
movq %rbx, -0x50(%rbp)
movl $0x8, %edi
callq *0x597a(%rip)           # 0xf0b8
movq %rax, -0x48(%rbp)
movq %rbx, -0x40(%rbp)
movl $0x8, %edi
callq *0x5967(%rip)           # 0xf0b8
movq %rax, -0x38(%rbp)
movsd 0x8b3(%rip), %xmm0      # 0xa010
subsd 0x5a83(%rip), %xmm0     # 0xf1e8
mulsd 0x8cb(%rip), %xmm0      # 0xa038
leaq 0x1610(%rip), %rdi      # 0xad84
movb $0x1, %al
callq 0x1090
leaq 0x2023(%rip), %rdi      # 0xb7a5
callq 0x1060
leaq 0x203d(%rip), %rdi      # 0xb7cb
callq 0x1060
leaq 0x2057(%rip), %rdi      # 0xb7f1
callq 0x1060
movl 0x595f(%rip), %eax      # 0xf104
movl %eax, %ecx
sarl $0x1f, %ecx
xorl %edx, %edx
testl %eax, %eax
setne %dl
orl %ecx, %edx
leaq 0x205d(%rip), %rax      # 0xb817
leaq 0x207c(%rip), %rdi      # 0xb83d
cmoveq %rax, %rdi
callq 0x1060
cmpl $0x0, 0x5a0f(%rip)      # 0xf1e0
movl -0x2c(%rbp), %ebx
jle 0x993d
movslq %ebx, %rax
movq %rax, -0x58(%rbp)
movl $0x18, %r13d
movq 0x57ea(%rip), %r15      # 0xefd8
leaq 0x20d1(%rip), %r14      # 0xb8c6
xorl %r12d, %r12d
leaq 0x209c(%rip), %rdi      # 0xb89b
callq 0x1060
movq 0x592d(%rip), %rax      # 0xf138
movsd 0x7fd(%rip), %xmm0      # 0xa010
subsd 0x10(%rax,%r13), %xmm0
mulsd 0x816(%rip), %xmm0      # 0xa038
leaq 0x158e(%rip), %rdi      # 0xadb7
movb $0x1, %al
callq 0x1090
movq 0x5901(%rip), %rax      # 0xf138
movl -0x18(%rax,%r13), %edx
xorl %esi, %esi
cmpl %ebx, %edx
setg %sil
incl %esi
leaq 0x1592(%rip), %rdi      # 0xaddf
xorl %eax, %eax
callq 0x1090
movq (%r15), %rdi
movq 0x58da(%rip), %rax      # 0xf138
leaq (%rax,%r13), %rdx
addq $-0x10, %rdx
movl $0x10, %esi
callq 0x802f
leaq 0x204a(%rip), %rdi      # 0xb8c1
callq 0x1060
leaq 0x1590(%rip), %rdi      # 0xae13
xorl %eax, %eax
callq 0x1090
movq 0x58a7(%rip), %rdx      # 0xf138
cmpl %ebx, -0x18(%rdx,%r13)
jle 0x990e
addq %r13, %rdx
leaq -0x40(%rbp), %rdi
movq %rdx, %rsi
movl %ebx, %r14d
movq %r15, %rbx
movq -0x58(%rbp), %r15
movq %r15, %rdx
movl $0x2, %ecx
callq 0x402e
movq 0x5878(%rip), %rsi      # 0xf138
addq %r13, %rsi
leaq -0x50(%rbp), %rdi
movq %r15, %rdx
movq %rbx, %r15
movl %r14d, %ebx
leaq 0x1fef(%rip), %r14      # 0xb8c6
movl $0x2, %ecx
callq 0x3e83
movq (%r15), %rdi
movl $0x10, %esi
leaq -0x50(%rbp), %rdx
callq 0x802f
leaq 0x150a(%rip), %rdi      # 0xae03
xorl %eax, %eax
callq 0x1090
movq (%r15), %rdi
movl $0x10, %esi
leaq -0x40(%rbp), %rdx
jmp 0x9919
movq (%r15), %rdi
addq %r13, %rdx
movl $0x10, %esi
callq 0x802f
movq %r14, %rdi
callq 0x1060
incq %r12
movslq 0x58b0(%rip), %rax      # 0xf1e0
addq $0x30, %r13
cmpq %rax, %r12
jl 0x97f8
leaq 0x1f1f(%rip), %rdi      # 0xb863
callq 0x1060
movl $0xa, %edi
callq 0x1040
movsd 0x588d(%rip), %xmm0     # 0xf1e8
mulsd 0x6dd(%rip), %xmm0      # 0xa040
mulsd 0x6c5(%rip), %xmm0      # 0xa030
addsd 0x69d(%rip), %xmm0      # 0xa010
mulsd 0x6bd(%rip), %xmm0      # 0xa038
leaq 0x14b1(%rip), %rdi      # 0xae33
movb $0x1, %al
callq 0x1090
movl $0xa, %edi
callq 0x1040
leaq 0x1ed7(%rip), %rdi      # 0xb871
callq 0x1060
leaq 0x14d7(%rip), %rdi      # 0xae7d
xorl %eax, %eax
callq 0x1090
cmpl $0x0, 0x582c(%rip)      # 0xf1e0
jle 0x99eb
leaq 0x14e1(%rip), %rbx      # 0xae9e
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x576e(%rip), %rax      # 0xf138
movl (%rax,%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1090
incq %r15
movslq 0x57fe(%rip), %rax      # 0xf1e0
addq $0x30, %r14
cmpq %rax, %r15
jl 0x99c3
leaq 0x1ea6(%rip), %rdi      # 0xb898
callq 0x1060
movq -0x48(%rbp), %rdi
xorl %esi, %esi
callq *0x56c5(%rip)           # 0xf0c8
movq -0x38(%rbp), %rdi
xorl %esi, %esi
callq *0x56b9(%rip)           # 0xf0c8
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq