// File: /workspace/github_cpp_makefile_star2_O2/marxn[P]pupp/3rdparty/gmp/./mini-gmp/mini-gmp.c
// Function: mpn_div_qr_pi1
static void
mpn_div_qr_pi1 (mp_ptr qp,
		mp_ptr np, mp_size_t nn, mp_limb_t n1,
		mp_srcptr dp, mp_size_t dn,
		mp_limb_t dinv)
{
  mp_size_t i;

  mp_limb_t d1, d0;
  mp_limb_t cy, cy1;
  mp_limb_t q;

  assert (dn > 2);
  assert (nn >= dn);

  d1 = dp[dn - 1];
  d0 = dp[dn - 2];

  assert ((d1 & GMP_LIMB_HIGHBIT) != 0);
  /* Iteration variable is the index of the q limb.
   *
   * We divide <n1, np[dn-1+i], np[dn-2+i], np[dn-3+i],..., np[i]>
   * by            <d1,          d0,        dp[dn-3],  ..., dp[0] >
   */

  i = nn - dn;
  do
    {
      mp_limb_t n0 = np[dn-1+i];

      if (n1 == d1 && n0 == d0)
	{
	  q = GMP_LIMB_MAX;
	  mpn_submul_1 (np+i, dp, dn, q);
	  n1 = np[dn-1+i];	/* update n1, last loop's value will now be invalid */
	}
      else
	{
	  gmp_udiv_qr_3by2 (q, n1, n0, n1, n0, np[dn-2+i], d1, d0, dinv);

	  cy = mpn_submul_1 (np + i, dp, dn-2, q);

	  cy1 = n0 < cy;
	  n0 = n0 - cy;
	  cy = n1 < cy1;
	  n1 = n1 - cy1;
	  np[dn-2+i] = n0;

	  if (cy != 0)
	    {
	      n1 += d1 + mpn_add_n (np + i, np + i, dp, dn - 1);
	      q--;
	    }
	}

      if (qp)
	qp[i] = q;
    }
  while (--i >= 0);

  np[dn - 1] = n1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, -0x30(%rbp)
cmpq %r9, %rdx
jl 0x85b3
movq %r8, %r12
movq -0x8(%r8,%r9,8), %rax
movq %rax, -0x40(%rbp)
testq %rax, %rax
jns 0x85d2
movq %rcx, %rbx
movq %rdx, %r15
movq 0x10(%rbp), %rax
leaq -0x1(%r9), %rcx
movq %rcx, -0x70(%rbp)
movq -0x10(%r12,%r9,8), %rcx
leaq -0x2(%r9), %rdx
movq %rdx, -0x98(%rbp)
movl %eax, %edx
movq %rdx, -0x90(%rbp)
shrq $0x20, %rax
movq %rax, -0x88(%rbp)
movq %rcx, %rax
shrq $0x20, %rax
movq %rax, -0x80(%rbp)
movq %rcx, -0x38(%rbp)
movl %ecx, %eax
movq %rax, -0x78(%rbp)
movq %r9, %rax
negq %rax
movq %rax, -0xa0(%rbp)
leaq 0x1(%r15), %r10
shlq $0x3, %r15
leaq (,%r9,8), %rax
subq %rax, %r15
movq %r12, -0x50(%rbp)
movq %r9, -0x60(%rbp)
movq %rdi, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rax,%r10,8), %rax
cmpq -0x40(%rbp), %rbx
jne 0x83c0
cmpq -0x38(%rbp), %rax
jne 0x83c0
movq -0x30(%rbp), %rbx
leaq (%rbx,%r15), %rdi
movq %r12, %rsi
movq %r9, %rdx
pushq $-0x1
popq %rcx
movq %r10, %r14
movq %r9, %r13
callq 0x16f9
movq %r13, %r9
movq %r14, %r10
movq -0x10(%rbx,%r14,8), %rbx
pushq $-0x1
popq %r14
jmp 0x8571
movq %rbx, %rsi
shrq $0x20, %rsi
movl %ebx, %edx
movq %rdx, %rdi
movq -0x90(%rbp), %rcx
imulq %rcx, %rdi
movq -0x88(%rbp), %r9
imulq %r9, %rdx
movq %rsi, %r8
imulq %rcx, %r8
imulq %r9, %rsi
movl %edi, %ecx
shrq $0x20, %rdi
addq %r8, %rdx
addq %rdi, %rdx
movabsq $0x100000000, %r12      # imm = 0x100000000
leaq (%rsi,%r12), %rdi
cmpq %r8, %rdx
cmovaeq %rsi, %rdi
movq %rdx, %r14
shrq $0x20, %r14
shlq $0x20, %rdx
orq %rdx, %rcx
addq %rbx, %r14
addq %rax, %rcx
adcq %rdi, %r14
movq -0x30(%rbp), %rdx
movq %r10, -0x68(%rbp)
movq -0x18(%rdx,%r10,8), %rdx
xorl %esi, %esi
movq -0x38(%rbp), %rbx
subq %rbx, %rdx
setb %sil
movq %r14, %r10
shrq $0x20, %r10
movl %r14d, %r11d
movq %r11, %r9
movq %rax, %r12
movq -0x78(%rbp), %rax
imulq %rax, %r9
movq %r10, %r8
imulq %rax, %r8
movq -0x80(%rbp), %rax
imulq %rax, %r11
movq %r9, %rdi
shrq $0x20, %rdi
addq %r11, %r8
addq %rdi, %r8
movq %r14, %rdi
notq %rdi
movq -0x40(%rbp), %r13
imulq %r13, %rdi
imulq %rax, %r10
cmpq %r11, %r8
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq (%r10,%rax), %r11
cmovaeq %r10, %r11
movq %r8, %r10
shrq $0x20, %r10
addq %r11, %r10
movl %r9d, %r9d
shlq $0x20, %r8
orq %r8, %r9
addq %r12, %rdi
subq %r10, %rdi
subq %r9, %rdx
sbbq %rsi, %rdi
cmpq %rcx, %rdi
adcq $-0x1, %r14
cmpq %rcx, %rdi
movl $0x0, %r12d
cmovaeq %rbx, %r12
movl $0x0, %ebx
cmovaeq %r13, %rbx
incq %r14
addq %rdx, %r12
adcq %rdi, %rbx
cmpq %r13, %rbx
movq %r15, -0x58(%rbp)
jb 0x8507
ja 0x84f1
cmpq -0x38(%rbp), %r12
jb 0x8507
incq %r14
subq -0x38(%rbp), %r12
movl $0x0, %eax
sbbq %rax, %rax
subq -0x40(%rbp), %rax
addq %rax, %rbx
movq -0x30(%rbp), %r15
movq -0x58(%rbp), %rax
leaq (%r15,%rax), %r13
movq %r13, %rdi
movq -0x50(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq %r14, %rcx
callq 0x16f9
subq %rax, %r12
sbbq $0x0, %rbx
movq -0x68(%rbp), %r10
movq %r12, -0x18(%r15,%r10,8)
jae 0x8565
movq %r13, %rdi
movq %r13, %rsi
movq -0x50(%rbp), %r12
movq %r12, %rdx
movq -0x70(%rbp), %rcx
callq 0x13eb
movq -0x68(%rbp), %r10
addq -0x40(%rbp), %rbx
addq %rax, %rbx
decq %r14
movq -0x60(%rbp), %r9
jmp 0x856d
movq -0x60(%rbp), %r9
movq -0x50(%rbp), %r12
movq -0x58(%rbp), %r15
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x857e
movq %r14, (%rdi,%r15)
movq -0xa0(%rbp), %rax
addq %r10, %rax
decq %rax
decq %r10
addq $-0x8, %r15
testq %rax, %rax
jg 0x837b
movq -0x30(%rbp), %rax
movq %rbx, -0x8(%rax,%r9,8)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c4d(%rip), %rdi      # 0xa207
leaq 0xaa3(%rip), %rsi       # 0x9064
leaq 0x1fcf(%rip), %rcx      # 0xa597
movl $0x3e7, %edx            # imm = 0x3E7
callq 0x1090
leaq 0x2019(%rip), %rdi      # 0xa5f2
leaq 0xa84(%rip), %rsi       # 0x9064
leaq 0x1fb0(%rip), %rcx      # 0xa597
movl $0x3ec, %edx            # imm = 0x3EC
callq 0x1090