// File: marxn[P]pupp/3rdparty/gmp/mpf/get_str.c
// Function: mpn_pow_1_highpart
static mp_size_t
mpn_pow_1_highpart (mp_ptr rp, mp_size_t *ignp,
		    mp_limb_t base, unsigned long exp,
		    mp_size_t prec, mp_ptr tp)
{
  mp_size_t ign;		/* counts number of ignored low limbs in r */
  mp_size_t off;		/* keeps track of offset where value starts */
  mp_ptr passed_rp = rp;
  mp_size_t rn;
  int cnt;
  int i;

  if (exp == 0)
    {
      rp[0] = 1;
      *ignp = 0;
      return 1;
    }

  rp[0] = base;
  rn = 1;
  off = 0;
  ign = 0;
  count_leading_zeros (cnt, exp);
  for (i = GMP_LIMB_BITS - cnt - 2; i >= 0; i--)
    {
      mpn_sqr (tp, rp + off, rn);
      rn = 2 * rn;
      rn -= tp[rn - 1] == 0;
      ign <<= 1;

      off = 0;
      if (rn > prec)
	{
	  ign += rn - prec;
	  off = rn - prec;
	  rn = prec;
	}
      MP_PTR_SWAP (rp, tp);

      if (((exp >> i) & 1) != 0)
	{
	  mp_limb_t cy;
	  cy = mpn_mul_1 (rp, rp + off, rn, base);
	  rp[rn] = cy;
	  rn += cy != 0;
	  off = 0;
	}
    }

  if (rn > prec)
    {
      ASSERT (rn == prec + 1);

      ign += rn - prec;
      rp += rn - prec;
      rn = prec;
    }

  /* With somewhat less than 50% probability, we can skip this copy.  */
  if (passed_rp != rp + off)
    MPN_COPY_INCR (passed_rp, rp + off, rn);
  *ignp = ign;
  return rn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x5d085
movq -0x10(%rbp), %rax
movq $0x1, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq $0x1, -0x8(%rbp)
jmp 0x5d28d
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq $0x1, -0x58(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
jmp 0x5d0aa
jmp 0x5d0ac
movq -0x28(%rbp), %rax
movq %rax, -0x80(%rbp)
bsrq -0x80(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
xorq $0x3f, %rax
movl %eax, -0x5c(%rbp)
movl $0x40, %eax
subl -0x5c(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x60(%rbp)
cmpl $0x0, -0x60(%rbp)
jl 0x5d200
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x48(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x58(%rbp), %rdx
callq 0x392b0
movq -0x58(%rbp), %rax
shlq %rax
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movq -0x58(%rbp), %rcx
subq $0x1, %rcx
cmpq $0x0, (%rax,%rcx,8)
sete %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x58(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
shlq %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x30(%rbp), %rax
jle 0x5d16f
movq -0x58(%rbp), %rax
subq -0x30(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x58(%rbp), %rax
subq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x5d171
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movl -0x60(%rbp), %ecx
shrq %cl, %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x5d1f0
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x48(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x58(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x37206
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdx
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
cmpq $0x0, -0x78(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x48(%rbp)
jmp 0x5d1f2
movl -0x60(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x5d0d6
movq -0x58(%rbp), %rax
cmpq -0x30(%rbp), %rax
jle 0x5d23a
jmp 0x5d20c
jmp 0x5d20e
movq -0x58(%rbp), %rax
subq -0x30(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x58(%rbp), %rax
subq -0x30(%rbp), %rax
shlq $0x3, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x48(%rbp), %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
je 0x5d27a
jmp 0x5d254
jmp 0x5d256
jmp 0x5d258
jmp 0x5d25a
jmp 0x5d25c
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x48(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x58(%rbp), %rdx
callq 0x554c6
jmp 0x5d27a
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)