// File: marxn[P]pupp/3rdparty/gmp/./mini-gmp/mini-gmp.c
// Function: mpn_div_qr_invert
static void
mpn_div_qr_invert (struct gmp_div_inverse *inv,
		   mp_srcptr dp, mp_size_t dn)
{
  assert (dn > 0);

  if (dn == 1)
    mpn_div_qr_1_invert (inv, dp[0]);
  else if (dn == 2)
    mpn_div_qr_2_invert (inv, dp[1], dp[0]);
  else
    {
      unsigned shift;
      mp_limb_t d1, d0;

      d1 = dp[dn-1];
      d0 = dp[dn-2];
      assert (d1 > 0);
      gmp_clz (shift, d1);
      inv->shift = shift;
      if (shift > 0)
	{
	  d1 = (d1 << shift) | (d0 >> (GMP_LIMB_BITS - shift));
	  d0 = (d0 << shift) | (dp[dn-3] >> (GMP_LIMB_BITS - shift));
	}
      inv->d1 = d1;
      inv->d0 = d0;
      inv->di = mpn_invert_3by2 (d1, d0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jle 0x7b9d
jmp 0x7bbc
leaq 0x7a90(%rip), %rdi      # 0xf634
leaq 0x6529(%rip), %rsi      # 0xe0d4
movl $0x33e, %edx            # imm = 0x33E
leaq 0x7c88(%rip), %rcx      # 0xf83f
callq 0x1070
cmpq $0x1, -0x18(%rbp)
jne 0x7bd8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0xa2a0
jmp 0x7d57
cmpq $0x2, -0x18(%rbp)
jne 0x7bfc
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
callq 0xc6a0
jmp 0x7d55
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
subq $0x2, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
jbe 0x7c2d
jmp 0x7c4c
leaq 0x7c52(%rip), %rdi      # 0xf886
leaq 0x6499(%rip), %rsi      # 0xe0d4
movl $0x34b, %edx            # imm = 0x34B
leaq 0x7bf8(%rip), %rcx      # 0xf83f
callq 0x1070
jmp 0x7c4e
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movabsq $-0x100000000000000, %rax # imm = 0xFF00000000000000
andq -0x38(%rbp), %rax
cmpq $0x0, %rax
jne 0x7c88
movq -0x38(%rbp), %rax
shlq $0x8, %rax
movq %rax, -0x38(%rbp)
movl -0x3c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x3c(%rbp)
jmp 0x7c5d
jmp 0x7c8a
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
andq -0x38(%rbp), %rax
cmpq $0x0, %rax
jne 0x7cb4
movq -0x38(%rbp), %rax
shlq %rax
movq %rax, -0x38(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x7c8a
movl -0x3c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x0, -0x1c(%rbp)
jbe 0x7d25
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
shlq %cl, %rax
movq -0x30(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
movl $0x40, %ecx
subq %rsi, %rcx
shrq %cl, %rdx
movq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
movl -0x1c(%rbp), %ecx
shlq %cl, %rax
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rdx
subq $0x3, %rdx
movq (%rcx,%rdx,8), %rdx
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
movl $0x40, %ecx
subq %rsi, %rcx
shrq %cl, %rdx
movq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x25e0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x7d57
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)