// File: /workspace/github_cpp_makefile_star2_O2/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 $0x68, %rsp
movq %rdi, -0x38(%rbp)
movl %edi, %ebx
movl %esi, -0x30(%rbp)
subl %esi, %ebx
pushq $0x1
popq %r14
leaq -0x80(%rbp), %r12
movq %r14, (%r12)
pushq $0x8
popq %r13
movq %r13, %rdi
callq *0x6400(%rip)           # 0xe0a0
movq %rax, 0x8(%r12)
leaq -0x50(%rbp), %r12
movq %r14, (%r12)
movq %r13, %rdi
callq *0x63ea(%rip)           # 0xe0a0
movq %rax, 0x8(%r12)
leaq -0x90(%rbp), %r12
movq %r14, (%r12)
movq %r13, %rdi
callq *0x63d1(%rip)           # 0xe0a0
movq %rax, 0x8(%r12)
leaq -0x60(%rbp), %r15
movq %r14, (%r15)
movq %r13, %rdi
callq *0x63bc(%rip)           # 0xe0a0
movq %rax, 0x8(%r15)
leaq 0x2856(%rip), %rdi      # 0xa545
callq 0x1060
pushq $0xa
popq %r14
movl %r14d, %edi
callq 0x1040
leaq 0x2876(%rip), %rdi      # 0xa57d
callq 0x1060
leaq 0x287b(%rip), %rdi      # 0xa58e
callq 0x1060
movl %r14d, %edi
callq 0x1040
leaq 0x1dbc(%rip), %rdi      # 0x9ae3
movl %ebx, %esi
xorl %eax, %eax
callq 0x1080
leaq 0x1dc5(%rip), %rdi      # 0x9afc
movl %ebx, %esi
xorl %eax, %eax
callq 0x1080
leaq 0x285d(%rip), %rdi      # 0xa5a4
callq 0x1060
movl %r14d, %edi
callq 0x1040
leaq 0x1e8b(%rip), %rdi      # 0x9be6
callq 0x1060
leaq 0x1ea4(%rip), %rdi      # 0x9c0b
callq 0x1060
leaq 0x1eb7(%rip), %rdi      # 0x9c2a
callq 0x1060
movq -0x38(%rbp), %rcx
leal 0x8(%rcx), %eax
movl %eax, -0x2c(%rbp)
leal 0x5(,%rcx,2), %eax
cltq
movq %rax, -0x68(%rbp)
pushq $0x2
popq %r15
cmpl $0x101, %r15d           # imm = 0x101
je 0x7f16
movq -0x38(%rbp), %rdi
movl -0x30(%rbp), %esi
movl %r15d, %edx
callq 0x78a0
leaq -0x80(%rbp), %r13
movq %r13, %rdi
movl %r15d, %esi
movl -0x2c(%rbp), %edx
callq 0x7adf
movq %r12, %r14
movq %r12, %rdi
movq %r13, %rsi
pushq $0x8
popq %rdx
callq 0x38b6
movq -0x48(%rbp), %rax
movq $0x1, (%rax)
movl $0x1, -0x4c(%rbp)
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
movq %rbx, %rsi
movq -0x68(%rbp), %rdx
callq 0x305c
movq %rbx, %rdi
movq %rbx, %rsi
pushq $0x1
popq %r12
movq %r12, %rdx
callq 0x2be7
movq %r13, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x2a9e
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x36d3
leaq 0x1e1c(%rip), %rdi      # 0x9c49
movl %r15d, %esi
xorl %eax, %eax
callq 0x1080
leal -0x1(%r15), %eax
testl %eax, %r15d
jne 0x7e6c
movl %r15d, %edi
callq 0x788e
decl %eax
je 0x7e5d
movl %eax, %eax
movq 0x6293(%rip), %rcx      # 0xe0e8
movq %rax, (%rcx)
pushq $0x1
popq %rax
jmp 0x7e5f
xorl %eax, %eax
movl %eax, 0x627f(%rip)      # 0xe0e4
andl $0x0, 0x6298(%rip)      # 0xe104
movl 0x627e(%rip), %esi      # 0xe0f0
leaq 0x1ddf(%rip), %rdi      # 0x9c58
xorl %eax, %eax
callq 0x1080
leaq 0x1cf0(%rip), %rdi      # 0x9b77
xorl %eax, %eax
callq 0x1080
movq 0x6143(%rip), %rbx      # 0xdfd8
movq (%rbx), %rdi
pushq $0x10
popq %r13
movl %r13d, %esi
movq %r14, %r12
movq %r14, %rdx
callq 0x70a6
leaq 0x1dab(%rip), %r14      # 0x9c5c
movq %r14, %rdi
xorl %eax, %eax
callq 0x1080
movq (%rbx), %rdi
movl %r13d, %esi
leaq -0x60(%rbp), %rdx
callq 0x70a6
movq %r14, %rdi
xorl %eax, %eax
callq 0x1080
movq (%rbx), %rdi
movl %r13d, %esi
leaq 0x61ff(%rip), %rdx      # 0xe0e0
callq 0x70a6
movq %r14, %rdi
xorl %eax, %eax
callq 0x1080
movq (%rbx), %rdi
movl %r13d, %esi
leaq 0x6203(%rip), %rdx      # 0xe100
callq 0x70a6
leaq 0x26a2(%rip), %rdi      # 0xa5ab
callq 0x1060
incl %r15d
jmp 0x7d93
leaq 0x1d4f(%rip), %rdi      # 0x9c6c
callq 0x1060
movq -0x78(%rbp), %rdi
xorl %esi, %esi
callq *0x6182(%rip)           # 0xe0b0
movq -0x48(%rbp), %rdi
xorl %esi, %esi
callq *0x6176(%rip)           # 0xe0b0
movq -0x88(%rbp), %rdi
xorl %esi, %esi
callq *0x6167(%rip)           # 0xe0b0
movq -0x58(%rbp), %rdi
xorl %esi, %esi
callq *0x615b(%rip)           # 0xe0b0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq