// File: /workspace/github_cpp_makefile_star2_O3/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, -0x58(%rbp)
movq %rdx, %r13
subq %r9, %r13
jl 0x97db
movq %rdx, %r15
movq -0x8(%r8,%r9,8), %rdx
testq %rdx, %rdx
jns 0x97fa
movq %rcx, %rbx
movq 0x10(%rbp), %rax
movq %r9, %r12
decq %r9
movq -0x10(%r8,%r12,8), %r10
leaq -0x2(%r12), %rsi
movq -0x58(%rbp), %rcx
leaq (%rcx,%r9,8), %r11
movl %eax, %r14d
movq %r14, -0x88(%rbp)
shrq $0x20, %rax
movq %rax, -0x80(%rbp)
movq %rsi, -0x90(%rbp)
leaq (%rcx,%rsi,8), %rax
movq %rax, -0x50(%rbp)
movq %r10, %rax
shrq $0x20, %rax
movq %rax, -0x78(%rbp)
shlq $0x3, %r15
movq %r12, -0x48(%rbp)
leaq (,%r12,8), %rax
subq %rax, %r15
movl %r10d, %eax
movq %rax, -0x70(%rbp)
addq %rcx, %r15
movq %r8, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movq %r10, -0x60(%rbp)
movq %rdi, -0xa0(%rbp)
movq %r9, -0x68(%rbp)
movq %r11, -0x40(%rbp)
movq (%r11,%r13,8), %rax
movq %rbx, %rcx
xorq %rdx, %rcx
movq %rax, %rdx
xorq %r10, %rdx
orq %rcx, %rdx
movq -0x58(%rbp), %rcx
leaq (%rcx,%r13,8), %rdi
jne 0x95d6
movq %r11, %r14
movq $-0x1, %r12
movq %r8, %rsi
movq -0x48(%rbp), %rdx
movq $-0x1, %rcx
callq 0x18c4
movq (%r14,%r13,8), %rbx
movq -0x38(%rbp), %rdx
movq %r14, %r11
jmp 0x979d
movq %rdi, -0x98(%rbp)
movq %rbx, %rsi
shrq $0x20, %rsi
movl %ebx, %edx
movq %rdx, %r8
movq -0x88(%rbp), %rcx
imulq %rcx, %r8
movq -0x80(%rbp), %r11
imulq %r11, %rdx
movq %rsi, %r9
imulq %rcx, %r9
imulq %r11, %rsi
movl %r8d, %ecx
shrq $0x20, %r8
addq %r9, %rdx
addq %r8, %rdx
movabsq $0x100000000, %r14      # imm = 0x100000000
leaq (%rsi,%r14), %r8
cmpq %r9, %rdx
cmovaeq %rsi, %r8
movq %rdx, %r12
shrq $0x20, %r12
shlq $0x20, %rdx
orq %rdx, %rcx
addq %rbx, %r12
addq %rax, %rcx
adcq %r8, %r12
movq -0x50(%rbp), %rdx
movq (%rdx,%r13,8), %rdx
xorl %esi, %esi
subq %r10, %rdx
setb %sil
movq %r12, %r11
shrq $0x20, %r11
movl %r12d, %ebx
movq %rbx, %r10
movq %rax, %r14
movq -0x70(%rbp), %rax
imulq %rax, %r10
movq %r11, %r9
imulq %rax, %r9
movq -0x78(%rbp), %rax
imulq %rax, %rbx
movq %r10, %r8
shrq $0x20, %r8
addq %rbx, %r9
addq %r8, %r9
movq %r12, %r8
notq %r8
movq -0x38(%rbp), %rdi
imulq %rdi, %r8
imulq %rax, %r11
cmpq %rbx, %r9
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq (%r11,%rax), %rbx
cmovaeq %r11, %rbx
movq %r9, %r11
shrq $0x20, %r11
addq %rbx, %r11
movl %r10d, %r10d
shlq $0x20, %r9
orq %r9, %r10
addq %r14, %r8
subq %r11, %r8
subq %r10, %rdx
movq -0x60(%rbp), %rax
sbbq %rsi, %r8
cmpq %rcx, %r8
adcq $-0x1, %r12
cmpq %rcx, %r8
movl $0x0, %r14d
cmovaeq %rax, %r14
movl $0x0, %ebx
cmovaeq %rdi, %rbx
incq %r12
addq %rdx, %r14
adcq %r8, %rbx
cmpq %rdi, %rbx
jb 0x9719
movq %rdi, %rcx
ja 0x9705
cmpq %rax, %r14
jb 0x9719
incq %r12
subq %rax, %r14
movl $0x0, %eax
sbbq %rax, %rax
subq %rcx, %rax
addq %rax, %rbx
movq -0x30(%rbp), %rsi
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rdx
movq %r12, %rcx
callq 0x18c4
subq %rax, %r14
sbbq $0x0, %rbx
movq -0x50(%rbp), %rax
movq %r14, (%rax,%r13,8)
jae 0x9784
cmpq $0x2, -0x48(%rbp)
movq -0x68(%rbp), %r9
movq -0x40(%rbp), %r11
jl 0x978e
xorl %eax, %eax
xorl %edx, %edx
movq -0x30(%rbp), %r8
movq (%r15,%rax,8), %rsi
leaq (%rdx,%rsi), %rdi
xorl %ecx, %ecx
addq (%r8,%rax,8), %rdi
setb %cl
addq %rsi, %rdx
adcq $0x0, %rcx
movq %rdi, (%r15,%rax,8)
incq %rax
movq %rcx, %rdx
cmpq %rax, %r9
jne 0x975b
jmp 0x9790
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %r11
jmp 0x979d
xorl %ecx, %ecx
movq -0x38(%rbp), %rdx
addq %rdx, %rbx
addq %rcx, %rbx
decq %r12
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x97ad
movq %r12, (%rdi,%r13,8)
leaq -0x1(%r13), %rax
addq $-0x8, %r15
testq %r13, %r13
movq %rax, %r13
movq -0x30(%rbp), %r8
movq -0x60(%rbp), %r10
jg 0x958c
movq %rbx, (%r11)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a25(%rip), %rdi      # 0xb207
leaq 0x87b(%rip), %rsi       # 0xa064
leaq 0x1da7(%rip), %rcx      # 0xb597
movl $0x3e7, %edx            # imm = 0x3E7
callq 0x1090
leaq 0x1df1(%rip), %rdi      # 0xb5f2
leaq 0x85c(%rip), %rsi       # 0xa064
leaq 0x1d88(%rip), %rcx      # 0xb597
movl $0x3ec, %edx            # imm = 0x3EC
callq 0x1090