// File: marxn[P]pupp/3rdparty/gmp/./mini-gmp/mini-gmp.c
// Function: mpn_limb_get_str
static size_t
mpn_limb_get_str (unsigned char *sp, mp_limb_t w,
		  const struct gmp_div_inverse *binv)
{
  mp_size_t i;
  for (i = 0; w > 0; i++)
    {
      mp_limb_t h, l, r;

      h = w >> (GMP_LIMB_BITS - binv->shift);
      l = w << binv->shift;

      gmp_udiv_qrnnd_preinv (w, r, h, l, binv->d1, binv->di);
      assert ( (r << (GMP_LIMB_BITS - binv->shift)) == 0);
      r >>= binv->shift;

      sp[i] = r;
    }
  return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
jbe 0xc4f5
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, %edx
movl $0x40, %ecx
subq %rdx, %rcx
shrq %cl, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movl (%rcx), %ecx
shlq %cl, %rax
movq %rax, -0x30(%rbp)
jmp 0xc298
movq -0x28(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x98(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0x90(%rbp), %rax
movl %eax, -0x7c(%rbp)
movq -0x90(%rbp), %rax
shrq $0x20, %rax
movl %eax, -0x84(%rbp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq -0x98(%rbp), %rax
movl %eax, -0x80(%rbp)
movq -0x98(%rbp), %rax
shrq $0x20, %rax
movl %eax, -0x88(%rbp)
movl -0x7c(%rbp), %eax
movl -0x80(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x60(%rbp)
movl -0x7c(%rbp), %eax
movl -0x88(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x68(%rbp)
movl -0x84(%rbp), %eax
movl -0x80(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x70(%rbp)
movl -0x84(%rbp), %eax
movl -0x88(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x60(%rbp), %rax
shrq $0x20, %rax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x70(%rbp), %rax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x70(%rbp), %rax
jae 0xc378
movabsq $0x100000000, %rax      # imm = 0x100000000
addq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq -0x68(%rbp), %rcx
shrq $0x20, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x68(%rbp), %rax
shlq $0x20, %rax
movabsq $0xffffffff, %rcx       # imm = 0xFFFFFFFF
andq -0x60(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
jmp 0xc3aa
movq -0x48(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
addq $0x1, %rcx
addq %rcx, %rax
movq -0xa0(%rbp), %rcx
cmpq -0x48(%rbp), %rcx
setb %cl
andb $0x1, %cl
movzbl %cl, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rdx
imulq 0x8(%rdx), %rcx
subq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
seta %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
xorl %eax, %eax
subq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x58(%rbp), %rax
movq -0x18(%rbp), %rcx
andq 0x8(%rcx), %rax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jb 0xc472
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x50(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, %edx
movl $0x40, %ecx
subq %rdx, %rcx
shlq %cl, %rax
cmpq $0x0, %rax
jne 0xc4a1
jmp 0xc4c0
leaq 0x2fb1(%rip), %rdi      # 0xf459
leaq 0x1c25(%rip), %rsi      # 0xe0d4
movl $0x4b0, %edx            # imm = 0x4B0
leaq 0x2fc8(%rip), %rcx      # 0xf483
callq 0x1070
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, %ecx
shrq %cl, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movb %al, %dl
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xc25f
movq -0x20(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)