// File: /workspace/github_cpp_makefile_star2_O2/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 0x249a(%rip), %rdi      # 0xa714
callq 0x1060
pushq $0xa
popq %r15
movl %r15d, %edi
callq 0x1040
leaq 0x1939(%rip), %rdi      # 0x9bcb
movl %ebx, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x1090
leaq 0x1956(%rip), %rdi      # 0x9bfb
movl %ebx, -0x2c(%rbp)
movl %ebx, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x1090
leaq 0x2490(%rip), %rdi      # 0xa74b
callq 0x1060
movl %r15d, %edi
callq 0x1040
leaq 0x2483(%rip), %rdi      # 0xa752
callq 0x1060
movsd 0xd34(%rip), %xmm0      # 0x9010
subsd 0x5e14(%rip), %xmm0     # 0xe0f8
mulsd 0xd4c(%rip), %xmm0      # 0x9038
movl $0x100, %esi            # imm = 0x100
subl 0x5df9(%rip), %esi      # 0xe0f0
leaq 0x1939(%rip), %rdi      # 0x9c37
movb $0x1, %al
callq 0x1090
leaq 0x247f(%rip), %rdi      # 0xa78b
callq 0x1060
movl 0x5dcd(%rip), %esi      # 0xe0e4
leaq 0x1955(%rip), %rdi      # 0x9c73
xorl %eax, %eax
callq 0x1090
leaq 0x1af8(%rip), %r14      # 0x9e24
pushq $0x10
popq %r15
leaq 0x2595(%rip), %r12      # 0xa8cc
xorl %r13d, %r13d
xorl %ebx, %ebx
movslq 0x5da1(%rip), %rax      # 0xe0e4
cmpq %rax, %rbx
jge 0x837f
movq %r14, %rdi
xorl %eax, %eax
callq 0x1090
movq 0x5c7f(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movq 0x5d85(%rip), %rdx      # 0xe0e8
addq %r13, %rdx
movl %r15d, %esi
callq 0x70c6
movq %r12, %rdi
callq 0x1060
incq %rbx
addq $0x10, %r13
jmp 0x833c
leaq 0x241c(%rip), %rdi      # 0xa7a2
callq 0x1060
pushq $0xa
popq %rdi
callq 0x1040
movl 0x5d6b(%rip), %eax      # 0xe104
movl %eax, %ecx
sarl $0x1f, %ecx
xorl %edx, %edx
testl %eax, %eax
setne %dl
orl %ecx, %edx
je 0x83ce
leaq 0x18d9(%rip), %rdi      # 0x9c89
leaq 0x5d99(%rip), %rsi      # 0xe150
xorl %eax, %eax
callq 0x1090
leaq 0x18ee(%rip), %rdi      # 0x9cb3
xorl %eax, %eax
callq 0x1090
jmp 0x83e2
movl 0x5e04(%rip), %esi      # 0xe1d8
leaq 0x18e9(%rip), %rdi      # 0x9cc4
xorl %eax, %eax
callq 0x1090
movq 0x5bef(%rip), %rbx      # 0xdfd8
leaq 0x18e6(%rip), %r14      # 0x9cd6
leaq 0x18de(%rip), %r15      # 0x9cd5
leaq 0x18d3(%rip), %r12      # 0x9cd1
xorl %r13d, %r13d
movslq 0x5dd4(%rip), %rax      # 0xe1dc
cmpq %rax, %r13
jge 0x8451
testq %r13, %r13
je 0x841c
movq %r12, %rdi
xorl %eax, %eax
callq 0x1090
movq 0x5d1d(%rip), %rax      # 0xe140
movl (%rax,%r13,8), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1090
movq 0x5d08(%rip), %rax      # 0xe140
movl 0x4(%rax,%r13,8), %esi
cmpl $0x1, %esi
je 0x844c
movq %r15, %rdi
xorl %eax, %eax
callq 0x1090
incq %r13
jmp 0x8401
movl 0x5cad(%rip), %eax      # 0xe104
movl %eax, %ecx
sarl $0x1f, %ecx
xorl %edx, %edx
testl %eax, %eax
setne %dl
orl %ecx, %edx
leaq 0x1874(%rip), %rax      # 0x9ce0
leaq 0x17ff(%rip), %rsi      # 0x9c72
cmoveq %rax, %rsi
leaq 0x185b(%rip), %rdi      # 0x9cd9
xorl %eax, %eax
callq 0x1090
movl 0x5c55(%rip), %esi      # 0xe0e0
leaq 0x1853(%rip), %rdi      # 0x9ce5
xorl %eax, %eax
callq 0x1090
movl 0x5c65(%rip), %eax      # 0xe104
movl %eax, %ecx
sarl $0x1f, %ecx
xorl %edx, %edx
testl %eax, %eax
setne %dl
orl %ecx, %edx
je 0x8536
leaq 0x1849(%rip), %rdi      # 0x9d03
xorl %eax, %eax
callq 0x1090
movq (%rbx), %rdi
leaq 0x5c35(%rip), %rdx      # 0xe100
pushq $0x10
popq %r14
movl %r14d, %esi
callq 0x70c6
leaq 0x1485(%rip), %r15      # 0x9963
movq %r15, %rdi
callq 0x1060
leaq 0x1841(%rip), %rdi      # 0x9d2e
xorl %eax, %eax
callq 0x1090
movq (%rbx), %rdi
leaq 0x5c12(%rip), %rdx      # 0xe110
movl %r14d, %esi
callq 0x70c6
movq %r15, %rdi
callq 0x1060
leaq 0x1844(%rip), %rdi      # 0x9d59
xorl %eax, %eax
callq 0x1090
movq (%rbx), %rdi
leaq 0x5bfa(%rip), %rdx      # 0xe120
movl %r14d, %esi
callq 0x70c6
movq %r15, %rdi
callq 0x1060
pushq $0xa
popq %rdi
callq 0x1040
pushq $0x1
popq %rbx
leaq -0x60(%rbp), %r15
movq %rbx, (%r15)
pushq $0x8
popq %r14
movq %r14, %rdi
callq *0x5b5b(%rip)           # 0xe0b0
movq %rax, 0x8(%r15)
leaq -0x40(%rbp), %r15
movq %rbx, (%r15)
movq %r14, %rdi
callq *0x5b47(%rip)           # 0xe0b0
movq %rax, 0x8(%r15)
movsd 0xa9b(%rip), %xmm0      # 0x9010
subsd 0x5c6b(%rip), %xmm0     # 0xe1e8
mulsd 0xab3(%rip), %xmm0      # 0x9038
leaq 0x17f8(%rip), %rdi      # 0x9d84
movb $0x1, %al
callq 0x1090
leaq 0x220b(%rip), %rdi      # 0xa7a5
callq 0x1060
leaq 0x2225(%rip), %rdi      # 0xa7cb
callq 0x1060
leaq 0x223f(%rip), %rdi      # 0xa7f1
callq 0x1060
movl 0x5b47(%rip), %eax      # 0xe104
movl %eax, %ecx
sarl $0x1f, %ecx
xorl %edx, %edx
testl %eax, %eax
setne %dl
orl %ecx, %edx
leaq 0x2245(%rip), %rax      # 0xa817
leaq 0x2264(%rip), %rdi      # 0xa83d
cmoveq %rax, %rdi
callq 0x1060
movl -0x2c(%rbp), %ebx
movslq %ebx, %rax
movq %rax, -0x48(%rbp)
pushq $0x18
popq %r15
leaq 0x17c0(%rip), %r13      # 0x9db7
pushq $0x10
popq %r12
xorl %ecx, %ecx
movslq 0x5bdc(%rip), %rax      # 0xe1e0
cmpq %rax, %rcx
jge 0x8750
movq %rcx, -0x50(%rbp)
leaq 0x2283(%rip), %rdi      # 0xa89b
callq 0x1060
movq 0x5b14(%rip), %rax      # 0xe138
movsd 0x9e4(%rip), %xmm0      # 0x9010
subsd 0x10(%rax,%r15), %xmm0
mulsd 0x9fd(%rip), %xmm0      # 0x9038
movq %r13, %rdi
movb $0x1, %al
callq 0x1090
movq 0x5aec(%rip), %rax      # 0xe138
movl -0x18(%rax,%r15), %edx
xorl %esi, %esi
cmpl %ebx, %edx
setg %sil
incl %esi
leaq 0x177d(%rip), %rdi      # 0x9ddf
xorl %eax, %eax
callq 0x1090
movl %r12d, %r14d
movq 0x5965(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
movq 0x5abb(%rip), %rax      # 0xe138
leaq (%rax,%r15), %rdx
addq $-0x10, %rdx
movl %r12d, %esi
callq 0x70c6
leaq 0x222d(%rip), %rdi      # 0xa8c1
callq 0x1060
leaq 0x1773(%rip), %rdi      # 0x9e13
xorl %eax, %eax
callq 0x1090
movq 0x5a8a(%rip), %rdx      # 0xe138
cmpl %ebx, -0x18(%rdx,%r15)
jle 0x871f
addq %r15, %rdx
leaq -0x40(%rbp), %rdi
movq %rdx, %rsi
movq -0x48(%rbp), %rbx
movq %rbx, %rdx
callq 0x3b2d
movq 0x5a66(%rip), %rsi      # 0xe138
addq %r15, %rsi
movq %r13, %r12
leaq -0x60(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rdx
callq 0x38d6
movq 0x58ea(%rip), %rbx      # 0xdfd8
movq (%rbx), %rdi
movl %r14d, %esi
movq %r13, %rdx
movq %r12, %r13
movl %r14d, %r12d
callq 0x70c6
leaq 0x16fa(%rip), %rdi      # 0x9e03
xorl %eax, %eax
callq 0x1090
movq (%rbx), %rdi
movl %r14d, %esi
leaq -0x40(%rbp), %rdx
movl -0x2c(%rbp), %ebx
jmp 0x872f
movq 0x58b2(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
addq %r15, %rdx
movl %r12d, %esi
callq 0x70c6
leaq 0x218b(%rip), %rdi      # 0xa8c6
callq 0x1060
movq -0x50(%rbp), %rcx
incq %rcx
addq $0x30, %r15
jmp 0x85fd
leaq 0x210c(%rip), %rdi      # 0xa863
callq 0x1060
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x1040
movsd 0x5a7a(%rip), %xmm0     # 0xe1e8
mulsd 0x8ca(%rip), %xmm0      # 0x9040
mulsd 0x8b2(%rip), %xmm0      # 0x9030
addsd 0x88a(%rip), %xmm0      # 0x9010
mulsd 0x8aa(%rip), %xmm0      # 0x9038
leaq 0x169e(%rip), %rdi      # 0x9e33
movb $0x1, %al
callq 0x1090
movl %ebx, %edi
callq 0x1040
leaq 0x20c7(%rip), %rdi      # 0xa871
callq 0x1060
leaq 0x16c7(%rip), %rdi      # 0x9e7d
xorl %eax, %eax
callq 0x1090
leaq 0x16da(%rip), %rbx      # 0x9e9e
xorl %r14d, %r14d
xorl %r15d, %r15d
movslq 0x5a0f(%rip), %rax      # 0xe1e0
cmpq %rax, %r15
jge 0x87f4
movq 0x595b(%rip), %rax      # 0xe138
movl (%rax,%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1090
incq %r15
addq $0x30, %r14
jmp 0x87ca
leaq 0x209d(%rip), %rdi      # 0xa898
callq 0x1060
movq -0x58(%rbp), %rdi
xorl %esi, %esi
callq *0x58b4(%rip)           # 0xe0c0
movq -0x38(%rbp), %rdi
xorl %esi, %esi
callq *0x58a8(%rip)           # 0xe0c0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq