// File: marxn[P]pupp/3rdparty/gmp/mpn/set_str.c
// Function: _gmpn_set_str_compute_powtab
void
mpn_set_str_compute_powtab (powers_t *powtab, mp_ptr powtab_mem, mp_size_t un, int base)
{
  mp_ptr powtab_mem_ptr;
  long i, pi;
  mp_size_t n;
  mp_ptr p, t;
  mp_limb_t big_base;
  int chars_per_limb;
  size_t digits_in_base;
  mp_size_t shift;

  powtab_mem_ptr = powtab_mem;

  chars_per_limb = mp_bases[base].chars_per_limb;
  big_base = mp_bases[base].big_base;

  p = powtab_mem_ptr;
  powtab_mem_ptr += 1;

  digits_in_base = chars_per_limb;

  p[0] = big_base;
  n = 1;

  count_leading_zeros (i, un - 1);
  i = GMP_LIMB_BITS - 1 - i;

  powtab[i].p = p;
  powtab[i].n = n;
  powtab[i].digits_in_base = digits_in_base;
  powtab[i].base = base;
  powtab[i].shift = 0;

  shift = 0;
  for (pi = i - 1; pi >= 0; pi--)
    {
      t = powtab_mem_ptr;
      powtab_mem_ptr += 2 * n;

      ASSERT_ALWAYS (powtab_mem_ptr < powtab_mem + mpn_dc_set_str_powtab_alloc (un));

      mpn_sqr (t, p, n);
      n = 2 * n - 1; n += t[n] != 0;
      digits_in_base *= 2;
#if 1
      if ((((un - 1) >> pi) & 2) == 0)
	{
	  mpn_divexact_1 (t, t, n, big_base);
	  n -= t[n - 1] == 0;
	  digits_in_base -= chars_per_limb;
	}
#else
      if (CLEVER_CONDITION_1 ())
	{
	  /* perform adjustment operation of previous */
	  cy = mpn_mul_1 (p, p, n, big_base);
	}
      if (CLEVER_CONDITION_2 ())
	{
	  /* perform adjustment operation of new */
	  cy = mpn_mul_1 (t, t, n, big_base);
	}
#endif
      shift *= 2;
      /* Strip low zero limbs, but be careful to keep the result divisible by
	 big_base.  */
      while (t[0] == 0 && (t[1] & ((big_base & -big_base) - 1)) == 0)
	{
	  t++;
	  n--;
	  shift++;
	}
      p = t;
      powtab[pi].p = p;
      powtab[pi].n = n;
      powtab[pi].digits_in_base = digits_in_base;
      powtab[pi].base = base;
      powtab[pi].shift = shift;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movslq -0x1c(%rbp), %rcx
leaq 0x26863(%rip), %rax     # 0x61260
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
movslq -0x1c(%rbp), %rcx
leaq 0x2684c(%rip), %rax     # 0x61260
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movslq -0x5c(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x58(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq $0x1, -0x40(%rbp)
jmp 0x3aa54
jmp 0x3aa56
movq -0x18(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x80(%rbp)
bsrq -0x80(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
xorq $0x3f, %rax
movq %rax, -0x30(%rbp)
movl $0x3f, %eax
subq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rcx
movq -0x8(%rbp), %rax
imulq $0x28, -0x30(%rbp), %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq -0x8(%rbp), %rax
imulq $0x28, -0x30(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x68(%rbp), %rcx
movq -0x8(%rbp), %rax
imulq $0x28, -0x30(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
imulq $0x28, -0x30(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
imulq $0x28, -0x30(%rbp), %rcx
addq %rcx, %rax
movq $0x0, 0x10(%rax)
movq $0x0, -0x70(%rbp)
movq -0x30(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jl 0x3ad10
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
shlq %rax
shlq $0x3, %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rdx
addq $0x40, %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
setb %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x3ab6e
leaq 0x28f2b(%rip), %rdi     # 0x63a88
movl $0xb2, %esi
leaq 0x28f29(%rip), %rdx     # 0x63a92
callq 0x562c0
jmp 0x3ab70
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x392b0
movq -0x40(%rbp), %rax
shlq %rax
subq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
movq -0x40(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x68(%rbp), %rax
shlq %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
subq $0x1, %rax
movq -0x38(%rbp), %rcx
sarq %cl, %rax
andq $0x2, %rax
cmpq $0x0, %rax
jne 0x3ac1e
movq -0x50(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x58(%rbp), %rcx
callq 0x569e0
movq -0x50(%rbp), %rax
movq -0x40(%rbp), %rcx
subq $0x1, %rcx
cmpq $0x0, (%rax,%rcx,8)
sete %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x40(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x40(%rbp)
movslq -0x5c(%rbp), %rcx
movq -0x68(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x70(%rbp), %rax
shlq %rax
movq %rax, -0x70(%rbp)
movq -0x50(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, -0x81(%rbp)
jne 0x3ac64
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x58(%rbp), %rcx
xorl %edx, %edx
subq -0x58(%rbp), %rdx
andq %rdx, %rcx
subq $0x1, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
sete %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x3ac70
jmp 0x3ac96
movq -0x50(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x3ac29
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rcx
movq -0x8(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq -0x8(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x68(%rbp), %rcx
movq -0x8(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x20(%rax)
movq -0x70(%rbp), %rcx
movq -0x8(%rbp), %rax
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x3aaf9
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)