// File: marxn[P]pupp/3rdparty/gmp/./mini-gmp/mini-gmp.c
// Function: mpz_div_q_2exp
static void
mpz_div_q_2exp (mpz_t q, const mpz_t u, mp_bitcnt_t bit_index,
		enum mpz_div_round_mode mode)
{
  mp_size_t un, qn;
  mp_size_t limb_cnt;
  mp_ptr qp;
  int adjust;

  un = u->_mp_size;
  if (un == 0)
    {
      q->_mp_size = 0;
      return;
    }
  limb_cnt = bit_index / GMP_LIMB_BITS;
  qn = GMP_ABS (un) - limb_cnt;
  bit_index %= GMP_LIMB_BITS;

  if (mode == ((un > 0) ? GMP_DIV_CEIL : GMP_DIV_FLOOR)) /* un != 0 here. */
    /* Note: Below, the final indexing at limb_cnt is valid because at
       that point we have qn > 0. */
    adjust = (qn <= 0
	      || !mpn_zero_p (u->_mp_d, limb_cnt)
	      || (u->_mp_d[limb_cnt]
		  & (((mp_limb_t) 1 << bit_index) - 1)));
  else
    adjust = 0;

  if (qn <= 0)
    qn = 0;

  else
    {
      qp = MPZ_REALLOC (q, qn);

      if (bit_index != 0)
	{
	  mpn_rshift (qp, u->_mp_d + limb_cnt, qn, bit_index);
	  qn -= qp[qn - 1] == 0;
	}
      else
	{
	  mpn_copyi (qp, u->_mp_d + limb_cnt, qn);
	}
    }

  q->_mp_size = qn;

  if (adjust)
    mpz_add_ui (q, q, 1);
  if (un < 0)
    mpz_neg (q, q);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x597a
movq -0x8(%rbp), %rax
movl $0x0, 0x4(%rax)
jmp 0x5b3b
movq -0x18(%rbp), %rax
shrq $0x6, %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
jl 0x5997
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x59a1
xorl %eax, %eax
subq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
subq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
andq $0x3f, %rax
movq %rax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
movq -0x28(%rbp), %rsi
xorl %ecx, %ecx
movl $0x1, %edx
cmpq $0x0, %rsi
cmovgl %edx, %ecx
cmpl %ecx, %eax
jne 0x5a38
movb $0x1, %al
cmpq $0x0, -0x30(%rbp)
movb %al, -0x51(%rbp)
jle 0x5a2b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x38(%rbp), %rsi
callq 0x14a0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x51(%rbp)
je 0x5a2b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x18(%rbp), %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
subq $0x1, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
setne %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x44(%rbp)
jmp 0x5a3f
movl $0x0, -0x44(%rbp)
cmpq $0x0, -0x30(%rbp)
jg 0x5a53
movq $0x0, -0x30(%rbp)
jmp 0x5b02
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jle 0x5a76
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x3440
movq %rax, -0x60(%rbp)
jmp 0x5a82
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x5ae0
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rax
movl %eax, %ecx
callq 0x2230
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
subq $0x1, %rcx
cmpq $0x0, (%rax,%rcx,8)
sete %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x30(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x30(%rbp)
jmp 0x5b00
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x30(%rbp), %rdx
callq 0x1390
jmp 0x5b02
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
cmpl $0x0, -0x44(%rbp)
je 0x5b27
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x1, %edx
callq 0x4510
cmpq $0x0, -0x28(%rbp)
jge 0x5b3b
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x4440
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)