// File: 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
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl -0x4(%rbp), %eax
subl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x3200
leaq -0x30(%rbp), %rdi
callq 0x3200
leaq -0x40(%rbp), %rdi
callq 0x3200
leaq -0x50(%rbp), %rdi
callq 0x3200
leaq 0x2ee2(%rip), %rdi      # 0xeb64
movb $0x0, %al
callq 0x1070
leaq 0x306e(%rip), %rdi      # 0xecfe
movb $0x0, %al
callq 0x1070
leaq 0x3039(%rip), %rdi      # 0xecd7
movb $0x0, %al
callq 0x1070
leaq 0x303d(%rip), %rdi      # 0xece9
movb $0x0, %al
callq 0x1070
leaq 0x3044(%rip), %rdi      # 0xecfe
movb $0x0, %al
callq 0x1070
movl -0xc(%rbp), %esi
leaq 0x2ed2(%rip), %rdi      # 0xeb9d
movb $0x0, %al
callq 0x1070
movl -0xc(%rbp), %esi
leaq 0x2eda(%rip), %rdi      # 0xebb6
movb $0x0, %al
callq 0x1070
leaq 0x2ef4(%rip), %rdi      # 0xebde
movb $0x0, %al
callq 0x1070
leaq 0x3006(%rip), %rdi      # 0xecfe
movb $0x0, %al
callq 0x1070
leaq 0x2ffa(%rip), %rdi      # 0xed00
callq 0x1050
leaq 0x3013(%rip), %rdi      # 0xed25
callq 0x1050
leaq 0x3026(%rip), %rdi      # 0xed44
callq 0x1050
movl $0x2, -0x10(%rbp)
cmpl $0x100, -0x10(%rbp)     # imm = 0x100
jg 0xbede
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0xb850
leaq -0x20(%rbp), %rdi
movl -0x10(%rbp), %esi
movl -0x4(%rbp), %edx
addl $0x8, %edx
callq 0xbae0
leaq -0x40(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x8, %edx
callq 0x5ba0
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x3370
leaq -0x30(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl -0x4(%rbp), %eax
shll %eax
addl $0x5, %eax
movslq %eax, %rdx
callq 0x5020
leaq -0x30(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x1, %edx
callq 0x47e0
leaq -0x20(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x4530
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x57e0
movl -0x10(%rbp), %esi
leaq 0x2f95(%rip), %rdi      # 0xed63
movb $0x0, %al
callq 0x1070
movl -0x10(%rbp), %eax
movl -0x10(%rbp), %ecx
subl $0x1, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0xbe10
movl -0x10(%rbp), %edi
callq 0xb820
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x72d5(%rip), %rdi      # 0x130d0
callq 0x3370
leaq 0x72e9(%rip), %rdi      # 0x130f0
xorl %eax, %eax
movl %eax, %esi
callq 0x3370
movl 0x72ca(%rip), %esi      # 0x130e0
leaq 0x2f55(%rip), %rdi      # 0xed72
movb $0x0, %al
callq 0x1070
leaq 0x2e3a(%rip), %rdi      # 0xec65
movb $0x0, %al
callq 0x1070
movq 0x719f(%rip), %rax      # 0x12fd8
movq (%rax), %rdi
leaq -0x40(%rbp), %rdx
movl $0x10, %esi
callq 0xacf0
leaq 0x2f25(%rip), %rdi      # 0xed76
movb $0x0, %al
callq 0x1070
movq 0x7179(%rip), %rax      # 0x12fd8
movq (%rax), %rdi
leaq -0x50(%rbp), %rdx
movl $0x10, %esi
callq 0xacf0
leaq 0x2eff(%rip), %rdi      # 0xed76
movb $0x0, %al
callq 0x1070
movq 0x7153(%rip), %rax      # 0x12fd8
movq (%rax), %rdi
movl $0x10, %esi
leaq 0x723c(%rip), %rdx      # 0x130d0
callq 0xacf0
leaq 0x2ed6(%rip), %rdi      # 0xed76
movb $0x0, %al
callq 0x1070
movq 0x712a(%rip), %rax      # 0x12fd8
movq (%rax), %rdi
movl $0x10, %esi
leaq 0x7233(%rip), %rdx      # 0x130f0
callq 0xacf0
leaq 0x2ebd(%rip), %rdi      # 0xed86
movb $0x0, %al
callq 0x1070
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xbd2a
leaq 0x2ea7(%rip), %rdi      # 0xed8c
callq 0x1050
leaq -0x20(%rbp), %rdi
callq 0x32e0
leaq -0x30(%rbp), %rdi
callq 0x32e0
leaq -0x40(%rbp), %rdi
callq 0x32e0
leaq -0x50(%rbp), %rdi
callq 0x32e0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)