// File: /workspace/github_cpp_makefile_star2_O1/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 0x319f(%rip), %rdi      # 0xc71c
callq 0x1060
movl $0xa, %edi
callq 0x1040
leaq 0x2638(%rip), %rdi      # 0xbbcb
movl %ebx, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x1090
leaq 0x2655(%rip), %rdi      # 0xbbfb
movl %ebx, -0x2c(%rbp)
movl %ebx, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x1090
leaq 0x3197(%rip), %rdi      # 0xc753
callq 0x1060
movl $0xa, %edi
callq 0x1040
leaq 0x3188(%rip), %rdi      # 0xc75a
callq 0x1060
movsd 0x1a31(%rip), %xmm0     # 0xb010
subsd 0x6b11(%rip), %xmm0     # 0x100f8
mulsd 0x1a49(%rip), %xmm0     # 0xb038
movl $0x100, %esi            # imm = 0x100
subl 0x6af6(%rip), %esi      # 0x100f0
leaq 0x2636(%rip), %rdi      # 0xbc37
movb $0x1, %al
callq 0x1090
leaq 0x3184(%rip), %rdi      # 0xc793
callq 0x1060
movl 0x6aca(%rip), %esi      # 0x100e4
leaq 0x2652(%rip), %rdi      # 0xbc73
xorl %eax, %eax
callq 0x1090
cmpl $0x0, 0x6ab5(%rip)      # 0x100e4
jle 0x9688
leaq 0x27ec(%rip), %r14      # 0xbe24
movq 0x6999(%rip), %r12      # 0xffd8
leaq 0x328e(%rip), %r15      # 0xc8d4
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r14, %rdi
xorl %eax, %eax
callq 0x1090
movq (%r12), %rdi
movq 0x6a88(%rip), %rdx      # 0x100e8
addq %r13, %rdx
movl $0x10, %esi
callq 0x8196
movq %r15, %rdi
callq 0x1060
incq %rbx
movslq 0x6a65(%rip), %rax      # 0x100e4
addq $0x10, %r13
cmpq %rax, %rbx
jl 0x964b
leaq 0x311b(%rip), %rdi      # 0xc7aa
callq 0x1060
movl $0xa, %edi
callq 0x1040
movl 0x6a60(%rip), %eax      # 0x10104
movl %eax, %ecx
sarl $0x1f, %ecx
xorl %edx, %edx
testl %eax, %eax
setne %dl
orl %ecx, %edx
je 0x96d9
leaq 0x25ce(%rip), %rdi      # 0xbc89
leaq 0x6a8e(%rip), %rsi      # 0x10150
xorl %eax, %eax
callq 0x1090
leaq 0x25e3(%rip), %rdi      # 0xbcb3
xorl %eax, %eax
callq 0x1090
jmp 0x96ed
movl 0x6af9(%rip), %esi      # 0x101d8
leaq 0x25de(%rip), %rdi      # 0xbcc4
xorl %eax, %eax
callq 0x1090
cmpl $0x0, 0x6ae8(%rip)      # 0x101dc
jle 0x975c
leaq 0x25d9(%rip), %r14      # 0xbcd6
leaq 0x25d1(%rip), %r15      # 0xbcd5
leaq 0x25c6(%rip), %r12      # 0xbcd1
xorl %r13d, %r13d
testq %r13, %r13
je 0x971d
movq %r12, %rdi
xorl %eax, %eax
callq 0x1090
movq 0x6a1c(%rip), %rax      # 0x10140
movl (%rax,%r13,8), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1090
movq 0x6a07(%rip), %rax      # 0x10140
movl 0x4(%rax,%r13,8), %esi
cmpl $0x1, %esi
je 0x974d
movq %r15, %rdi
xorl %eax, %eax
callq 0x1090
incq %r13
movslq 0x6a85(%rip), %rax      # 0x101dc
cmpq %rax, %r13
jl 0x970e
movl 0x69a2(%rip), %eax      # 0x10104
movl %eax, %ecx
sarl $0x1f, %ecx
xorl %edx, %edx
testl %eax, %eax
setne %dl
orl %ecx, %edx
leaq 0x2569(%rip), %rax      # 0xbce0
leaq 0x24f4(%rip), %rsi      # 0xbc72
cmoveq %rax, %rsi
leaq 0x2550(%rip), %rdi      # 0xbcd9
xorl %eax, %eax
callq 0x1090
movl 0x694a(%rip), %esi      # 0x100e0
leaq 0x2548(%rip), %rdi      # 0xbce5
xorl %eax, %eax
callq 0x1090
movl 0x695a(%rip), %eax      # 0x10104
movl %eax, %ecx
sarl $0x1f, %ecx
xorl %edx, %edx
testl %eax, %eax
setne %dl
orl %ecx, %edx
je 0x984a
leaq 0x253e(%rip), %rdi      # 0xbd03
xorl %eax, %eax
callq 0x1090
movq 0x6805(%rip), %r15      # 0xffd8
movq (%r15), %rdi
leaq 0x6923(%rip), %rdx      # 0x10100
movl $0x10, %esi
callq 0x8196
leaq 0x2175(%rip), %r14      # 0xb963
movq %r14, %rdi
callq 0x1060
leaq 0x2531(%rip), %rdi      # 0xbd2e
xorl %eax, %eax
callq 0x1090
movq (%r15), %rdi
leaq 0x6902(%rip), %rdx      # 0x10110
movl $0x10, %esi
callq 0x8196
movq %r14, %rdi
callq 0x1060
leaq 0x2532(%rip), %rdi      # 0xbd59
xorl %eax, %eax
callq 0x1090
movq (%r15), %rdi
leaq 0x68e8(%rip), %rdx      # 0x10120
movl $0x10, %esi
callq 0x8196
movq %r14, %rdi
callq 0x1060
movl $0xa, %edi
callq 0x1040
movl $0x1, %ebx
movq %rbx, -0x50(%rbp)
movl $0x8, %edi
callq *0x6850(%rip)           # 0x100b8
movq %rax, -0x48(%rbp)
movq %rbx, -0x40(%rbp)
movl $0x8, %edi
callq *0x683d(%rip)           # 0x100b8
movq %rax, -0x38(%rbp)
movsd 0x1789(%rip), %xmm0     # 0xb010
subsd 0x6959(%rip), %xmm0     # 0x101e8
mulsd 0x17a1(%rip), %xmm0     # 0xb038
leaq 0x24e6(%rip), %rdi      # 0xbd84
movb $0x1, %al
callq 0x1090
leaq 0x2f01(%rip), %rdi      # 0xc7ad
callq 0x1060
leaq 0x2f1b(%rip), %rdi      # 0xc7d3
callq 0x1060
leaq 0x2f35(%rip), %rdi      # 0xc7f9
callq 0x1060
movl 0x6835(%rip), %eax      # 0x10104
movl %eax, %ecx
sarl $0x1f, %ecx
xorl %edx, %edx
testl %eax, %eax
setne %dl
orl %ecx, %edx
leaq 0x2f3b(%rip), %rax      # 0xc81f
leaq 0x2f5a(%rip), %rdi      # 0xc845
cmoveq %rax, %rdi
callq 0x1060
cmpl $0x0, 0x68e5(%rip)      # 0x101e0
movl -0x2c(%rbp), %ebx
jle 0x9a67
movslq %ebx, %rax
movq %rax, -0x58(%rbp)
movl $0x18, %r13d
movq 0x66c0(%rip), %r15      # 0xffd8
leaq 0x2faf(%rip), %r14      # 0xc8ce
xorl %r12d, %r12d
leaq 0x2f7a(%rip), %rdi      # 0xc8a3
callq 0x1060
movq 0x6803(%rip), %rax      # 0x10138
movsd 0x16d3(%rip), %xmm0     # 0xb010
subsd 0x10(%rax,%r13), %xmm0
mulsd 0x16ec(%rip), %xmm0     # 0xb038
leaq 0x2464(%rip), %rdi      # 0xbdb7
movb $0x1, %al
callq 0x1090
movq 0x67d7(%rip), %rax      # 0x10138
movl -0x18(%rax,%r13), %edx
xorl %esi, %esi
cmpl %ebx, %edx
setg %sil
incl %esi
leaq 0x2468(%rip), %rdi      # 0xbddf
xorl %eax, %eax
callq 0x1090
movq (%r15), %rdi
movq 0x67b0(%rip), %rax      # 0x10138
leaq (%rax,%r13), %rdx
addq $-0x10, %rdx
movl $0x10, %esi
callq 0x8196
leaq 0x2f28(%rip), %rdi      # 0xc8c9
callq 0x1060
leaq 0x2466(%rip), %rdi      # 0xbe13
xorl %eax, %eax
callq 0x1090
movq 0x677d(%rip), %rdx      # 0x10138
cmpl %ebx, -0x18(%rdx,%r13)
jle 0x9a38
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 0x4085
movq 0x674e(%rip), %rsi      # 0x10138
addq %r13, %rsi
leaq -0x50(%rbp), %rdi
movq %r15, %rdx
movq %rbx, %r15
movl %r14d, %ebx
leaq 0x2ecd(%rip), %r14      # 0xc8ce
movl $0x2, %ecx
callq 0x3ed2
movq (%r15), %rdi
movl $0x10, %esi
leaq -0x50(%rbp), %rdx
callq 0x8196
leaq 0x23e0(%rip), %rdi      # 0xbe03
xorl %eax, %eax
callq 0x1090
movq (%r15), %rdi
movl $0x10, %esi
leaq -0x40(%rbp), %rdx
jmp 0x9a43
movq (%r15), %rdi
addq %r13, %rdx
movl $0x10, %esi
callq 0x8196
movq %r14, %rdi
callq 0x1060
incq %r12
movslq 0x6786(%rip), %rax      # 0x101e0
addq $0x30, %r13
cmpq %rax, %r12
jl 0x9922
leaq 0x2dfd(%rip), %rdi      # 0xc86b
callq 0x1060
movl $0xa, %edi
callq 0x1040
movsd 0x6763(%rip), %xmm0     # 0x101e8
mulsd 0x15b3(%rip), %xmm0     # 0xb040
mulsd 0x159b(%rip), %xmm0     # 0xb030
addsd 0x1573(%rip), %xmm0     # 0xb010
mulsd 0x1593(%rip), %xmm0     # 0xb038
leaq 0x2387(%rip), %rdi      # 0xbe33
movb $0x1, %al
callq 0x1090
movl $0xa, %edi
callq 0x1040
leaq 0x2db5(%rip), %rdi      # 0xc879
callq 0x1060
leaq 0x23ad(%rip), %rdi      # 0xbe7d
xorl %eax, %eax
callq 0x1090
cmpl $0x0, 0x6702(%rip)      # 0x101e0
jle 0x9b15
leaq 0x23b7(%rip), %rbx      # 0xbe9e
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x6644(%rip), %rax      # 0x10138
movl (%rax,%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1090
incq %r15
movslq 0x66d4(%rip), %rax      # 0x101e0
addq $0x30, %r14
cmpq %rax, %r15
jl 0x9aed
leaq 0x2d84(%rip), %rdi      # 0xc8a0
callq 0x1060
movq -0x48(%rbp), %rdi
xorl %esi, %esi
callq *0x659b(%rip)           # 0x100c8
movq -0x38(%rbp), %rdi
xorl %esi, %esi
callq *0x658f(%rip)           # 0x100c8
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq