// File: /workspace/github_cpp_makefile_star2_O1/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 *0x6178(%rip)           # 0xf0a8
movq %rax, 0x8(%r14)
leaq -0x40(%rbp), %r14
movq %r15, (%r14)
movl $0x8, %edi
callq *0x6162(%rip)           # 0xf0a8
movq %rax, 0x8(%r14)
leaq -0x70(%rbp), %r14
movq %r15, (%r14)
movl $0x8, %edi
callq *0x614c(%rip)           # 0xf0a8
movq %rax, 0x8(%r14)
leaq -0x60(%rbp), %r12
movq %r15, (%r12)
movl $0x8, %edi
callq *0x6135(%rip)           # 0xf0a8
movq %rax, 0x8(%r12)
leaq 0x25ce(%rip), %rdi      # 0xb54d
callq 0x1060
movl $0xa, %edi
callq 0x1040
leaq 0x25f0(%rip), %rdi      # 0xb585
callq 0x1060
leaq 0x25f5(%rip), %rdi      # 0xb596
callq 0x1060
movl $0xa, %edi
callq 0x1040
leaq 0x1b2c(%rip), %rdi      # 0xaae3
movl %ebx, %esi
xorl %eax, %eax
callq 0x1080
leaq 0x1b35(%rip), %rdi      # 0xaafc
movl %ebx, %esi
xorl %eax, %eax
callq 0x1080
leaq 0x25d5(%rip), %rdi      # 0xb5ac
callq 0x1060
movl $0xa, %edi
callq 0x1040
leaq 0x1bf9(%rip), %rdi      # 0xabe6
callq 0x1060
leaq 0x1c12(%rip), %rdi      # 0xac0b
callq 0x1060
leaq 0x1c25(%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 0x8a84
movq %r12, %r15
leaq -0x80(%rbp), %r12
movq %r12, %rdi
movl %ebx, %esi
movl -0x2c(%rbp), %edx
callq 0x8d43
movl $0x8, %edx
movq %r14, %rdi
movq %r12, %rsi
movl $0x2, %ecx
callq 0x3ed2
movl $0x1, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movq $0x1, (%rax)
leaq -0x40(%rbp), %r14
movq %r14, %rdi
movq %r14, %rsi
movq -0x48(%rbp), %rdx
callq 0x369f
movl $0x1, %edx
movq %r14, %rdi
movq %r14, %rsi
callq 0x30c6
movl $0x1, %edx
movq %r12, %rdi
movq %r12, %rsi
callq 0x2ece
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %r12, %rcx
movl $0x2, %r8d
callq 0x39b9
leaq 0x1b88(%rip), %rdi      # 0xac49
movl %ebx, %esi
xorl %eax, %eax
callq 0x1080
leal -0x1(%rbx), %eax
testl %eax, %ebx
jne 0x9109
bsrl %ebx, %eax
xorl $0x1f, %eax
cmpl $0x1f, %eax
jne 0x90e8
movl $0x0, 0x5ffe(%rip)      # 0xf0e4
jmp 0x90ff
xorl $0x1f, %eax
movl $0x1, 0x5fef(%rip)      # 0xf0e4
movq 0x5fec(%rip), %rcx      # 0xf0e8
movq %rax, (%rcx)
movl $0x0, 0x5ffb(%rip)      # 0xf104
movl 0x5fe1(%rip), %esi      # 0xf0f0
leaq 0x1b42(%rip), %rdi      # 0xac58
xorl %eax, %eax
callq 0x1080
leaq 0x1a53(%rip), %rdi      # 0xab77
xorl %eax, %eax
callq 0x1080
movq 0x5ea6(%rip), %r13      # 0xefd8
movq (%r13), %rdi
movl $0x10, %esi
leaq -0x70(%rbp), %r14
movq %r14, %rdx
callq 0x8196
leaq 0x1b0e(%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 0x8196
movq %r15, %rdi
xorl %eax, %eax
callq 0x1080
movq (%r13), %rdi
movl $0x10, %esi
leaq 0x5f59(%rip), %rdx      # 0xf0e0
callq 0x8196
movq %r15, %rdi
xorl %eax, %eax
callq 0x1080
movq (%r13), %rdi
movl $0x10, %esi
leaq 0x5f5a(%rip), %rdx      # 0xf100
callq 0x8196
leaq 0x2401(%rip), %rdi      # 0xb5b3
callq 0x1060
incl %ebx
cmpl $0x101, %ebx            # imm = 0x101
jne 0x9028
leaq 0x1aa0(%rip), %rdi      # 0xac6c
callq 0x1060
movq -0x78(%rbp), %rdi
xorl %esi, %esi
callq *0x5edb(%rip)           # 0xf0b8
movq -0x38(%rbp), %rdi
xorl %esi, %esi
callq *0x5ecf(%rip)           # 0xf0b8
movq -0x68(%rbp), %rdi
xorl %esi, %esi
callq *0x5ec3(%rip)           # 0xf0b8
movq -0x58(%rbp), %rdi
xorl %esi, %esi
callq *0x5eb7(%rip)           # 0xf0b8
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq