// File: /workspace/github_cpp_makefile_star2_O3/marxn[P]pupp/3rdparty/gmp/gen-bases.c
// Function: table
void
table (int limb_bits, int nail_bits)
{
  int  numb_bits = limb_bits - nail_bits;
  int  base;
  mpz_t r, t, logb2, log2b;

  mpz_init (r);
  mpz_init (t);
  mpz_init (logb2);
  mpz_init (log2b);

  printf ("/* This file generated by gen-bases.c - DO NOT EDIT. */\n");
  printf ("\n");
  printf ("#include \"gmp.h\"\n");
  printf ("#include \"gmp-impl.h\"\n");
  printf ("\n");
  printf ("#if GMP_NUMB_BITS != %d\n", numb_bits);
  printf ("Error, error, this data is for %d bits\n", numb_bits);
  printf ("#endif\n");
  printf ("\n");
  puts ("const struct bases mp_bases[257] =\n{");
  puts ("  /*   0 */ { 0, 0, 0, 0, 0 },");
  puts ("  /*   1 */ { 0, 0, 0, 0, 0 },");
  for (base = 2; base <= 256; base++)
    {
      generate (limb_bits, nail_bits, base);
      mp_2logb (r, base, limb_bits + 8);
      mpz_tdiv_q_2exp (logb2, r, 8);
      mpz_set_ui (t, 1);
      mpz_mul_2exp (t, t, 2*limb_bits + 5);
      mpz_sub_ui (t, t, 1);
      mpz_add_ui (r, r, 1);
      mpz_tdiv_q (log2b, t, r);

      printf ("  /* %3u */ { ", base);
      if (POW2_P (base))
	{
          mpz_set_ui (big_base, ulog2 (base) - 1);
	  mpz_set_ui (big_base_inverted, 0);
	}

      printf ("%u,", chars_per_limb);
      printf (" CNST_LIMB(0x");
      mpz_out_str (stdout, 16, logb2);
      printf ("), CNST_LIMB(0x");
      mpz_out_str (stdout, 16, log2b);
      printf ("), CNST_LIMB(0x");
      mpz_out_str (stdout, 16, big_base);
      printf ("), CNST_LIMB(0x");
      mpz_out_str (stdout, 16, big_base_inverted);
      printf (") },\n");
    }

  puts ("};");

  mpz_clear (r);
  mpz_clear (t);
  mpz_clear (logb2);
  mpz_clear (log2b);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edi, %r13d
movl %edi, %ebx
movl %esi, -0x30(%rbp)
subl %esi, %ebx
movl $0x1, %r15d
leaq -0x80(%rbp), %r14
movq %r15, (%r14)
movl $0x8, %edi
callq *0x62e7(%rip)           # 0xf0a8
movq %rax, 0x8(%r14)
leaq -0x40(%rbp), %r14
movq %r15, (%r14)
movl $0x8, %edi
callq *0x62d1(%rip)           # 0xf0a8
movq %rax, 0x8(%r14)
leaq -0x70(%rbp), %r14
movq %r15, (%r14)
movl $0x8, %edi
callq *0x62bb(%rip)           # 0xf0a8
movq %rax, 0x8(%r14)
leaq -0x60(%rbp), %r12
movq %r15, (%r12)
movl $0x8, %edi
callq *0x62a4(%rip)           # 0xf0a8
movq %rax, 0x8(%r12)
leaq 0x2735(%rip), %rdi      # 0xb545
callq 0x1060
movl $0xa, %edi
callq 0x1040
leaq 0x2757(%rip), %rdi      # 0xb57d
callq 0x1060
leaq 0x275c(%rip), %rdi      # 0xb58e
callq 0x1060
movl $0xa, %edi
callq 0x1040
leaq 0x1c9b(%rip), %rdi      # 0xaae3
movl %ebx, %esi
xorl %eax, %eax
callq 0x1080
leaq 0x1ca4(%rip), %rdi      # 0xaafc
movl %ebx, %esi
xorl %eax, %eax
callq 0x1080
leaq 0x273c(%rip), %rdi      # 0xb5a4
callq 0x1060
movl $0xa, %edi
callq 0x1040
leaq 0x1d68(%rip), %rdi      # 0xabe6
callq 0x1060
leaq 0x1d81(%rip), %rdi      # 0xac0b
callq 0x1060
leaq 0x1d94(%rip), %rdi      # 0xac2a
callq 0x1060
leal 0x8(%r13), %eax
movl %eax, -0x2c(%rbp)
movq %r13, -0x50(%rbp)
leal 0x5(,%r13,2), %eax
cltq
movq %rax, -0x48(%rbp)
movl $0x2, %ebx
movq -0x50(%rbp), %rdi
movl -0x30(%rbp), %esi
movl %ebx, %edx
callq 0x891a
movq %r12, %r15
leaq -0x80(%rbp), %r12
movq %r12, %rdi
movl %ebx, %esi
movl -0x2c(%rbp), %edx
callq 0x8bd9
movl $0x8, %edx
movq %r14, %rdi
movq %r12, %rsi
movl $0x2, %ecx
callq 0x3e83
movq -0x38(%rbp), %rax
movq $0x1, (%rax)
movl $0x1, -0x3c(%rbp)
leaq -0x40(%rbp), %r14
movq %r14, %rdi
movq %r14, %rsi
movq -0x48(%rbp), %rdx
callq 0x365c
movl $0x1, %edx
movq %r14, %rdi
movq %r14, %rsi
callq 0x308d
movl $0x1, %edx
movq %r12, %rdi
movq %r12, %rsi
callq 0x2e8f
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %r12, %rcx
movl $0x2, %r8d
callq 0x3973
leaq 0x1cf7(%rip), %rdi      # 0xac49
movl %ebx, %esi
xorl %eax, %eax
callq 0x1080
leal -0x1(%rbx), %eax
testl %eax, %ebx
jne 0x8f91
bsrl %ebx, %eax
xorl $0x1f, %eax
xorl %ecx, %ecx
cmpl $0x1f, %eax
je 0x8f81
xorl $0x1f, %eax
movq 0x616f(%rip), %rcx      # 0xf0e8
movq %rax, (%rcx)
movl $0x1, %ecx
movl %ecx, 0x615d(%rip)      # 0xf0e4
movl $0x0, 0x6173(%rip)      # 0xf104
movl 0x6159(%rip), %esi      # 0xf0f0
leaq 0x1cba(%rip), %rdi      # 0xac58
xorl %eax, %eax
callq 0x1080
leaq 0x1bcb(%rip), %rdi      # 0xab77
xorl %eax, %eax
callq 0x1080
movq 0x601e(%rip), %r13      # 0xefd8
movq (%r13), %rdi
movl $0x10, %esi
leaq -0x70(%rbp), %r14
movq %r14, %rdx
callq 0x802f
leaq 0x1c86(%rip), %r15      # 0xac5c
movq %r15, %rdi
xorl %eax, %eax
callq 0x1080
movq (%r13), %rdi
movl $0x10, %esi
leaq -0x60(%rbp), %r12
movq %r12, %rdx
callq 0x802f
movq %r15, %rdi
xorl %eax, %eax
callq 0x1080
movq (%r13), %rdi
movl $0x10, %esi
leaq 0x60d1(%rip), %rdx      # 0xf0e0
callq 0x802f
movq %r15, %rdi
xorl %eax, %eax
callq 0x1080
movq (%r13), %rdi
movl $0x10, %esi
leaq 0x60d2(%rip), %rdx      # 0xf100
callq 0x802f
leaq 0x2571(%rip), %rdi      # 0xb5ab
callq 0x1060
incl %ebx
cmpl $0x101, %ebx            # imm = 0x101
jne 0x8eb9
leaq 0x1c18(%rip), %rdi      # 0xac6c
callq 0x1060
movq -0x78(%rbp), %rdi
xorl %esi, %esi
callq *0x6053(%rip)           # 0xf0b8
movq -0x38(%rbp), %rdi
xorl %esi, %esi
callq *0x6047(%rip)           # 0xf0b8
movq -0x68(%rbp), %rdi
xorl %esi, %esi
callq *0x603b(%rip)           # 0xf0b8
movq -0x58(%rbp), %rdi
xorl %esi, %esi
callq *0x602f(%rip)           # 0xf0b8
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq