// File: marxn[P]pupp/3rdparty/gmp/mpn/dcpi1_divappr_q.c
// Function: _gmpn_dcpi1_divappr_q
mp_limb_t
mpn_dcpi1_divappr_q (mp_ptr qp, mp_ptr np, mp_size_t nn,
		     mp_srcptr dp, mp_size_t dn, gmp_pi1_t *dinv)
{
  mp_size_t qn;
  mp_limb_t qh, cy, qsave;
  mp_ptr tp;
  TMP_DECL;

  TMP_MARK;

  ASSERT (dn >= 6);
  ASSERT (nn > dn);
  ASSERT (dp[dn-1] & GMP_NUMB_HIGHBIT);

  qn = nn - dn;
  qp += qn;
  np += nn;
  dp += dn;

  if (qn >= dn)
    {
      qn++;			/* pretend we'll need an extra limb */
      /* Reduce qn mod dn without division, optimizing small operations.  */
      do
	qn -= dn;
      while (qn > dn);

      qp -= qn;			/* point at low limb of next quotient block */
      np -= qn;			/* point in the middle of partial remainder */

      tp = TMP_SALLOC_LIMBS (dn);

      /* Perform the typically smaller block first.  */
      if (qn == 1)
	{
	  mp_limb_t q, n2, n1, n0, d1, d0;

	  /* Handle qh up front, for simplicity. */
	  qh = mpn_cmp (np - dn + 1, dp - dn, dn) >= 0;
	  if (qh)
	    ASSERT_NOCARRY (mpn_sub_n (np - dn + 1, np - dn + 1, dp - dn, dn));

	  /* A single iteration of schoolbook: One 3/2 division,
	     followed by the bignum update and adjustment. */
	  n2 = np[0];
	  n1 = np[-1];
	  n0 = np[-2];
	  d1 = dp[-1];
	  d0 = dp[-2];

	  ASSERT (n2 < d1 || (n2 == d1 && n1 <= d0));

	  if (UNLIKELY (n2 == d1) && n1 == d0)
	    {
	      q = GMP_NUMB_MASK;
	      cy = mpn_submul_1 (np - dn, dp - dn, dn, q);
	      ASSERT (cy == n2);
	    }
	  else
	    {
	      udiv_qr_3by2 (q, n1, n0, n2, n1, n0, d1, d0, dinv->inv32);

	      if (dn > 2)
		{
		  mp_limb_t cy, cy1;
		  cy = mpn_submul_1 (np - dn, dp - dn, dn - 2, q);

		  cy1 = n0 < cy;
		  n0 = (n0 - cy) & GMP_NUMB_MASK;
		  cy = n1 < cy1;
		  n1 = (n1 - cy1) & GMP_NUMB_MASK;
		  np[-2] = n0;

		  if (UNLIKELY (cy != 0))
		    {
		      n1 += d1 + mpn_add_n (np - dn, np - dn, dp - dn, dn - 1);
		      qh -= (q == 0);
		      q = (q - 1) & GMP_NUMB_MASK;
		    }
		}
	      else
		np[-2] = n0;

	      np[-1] = n1;
	    }
	  qp[0] = q;
	}
      else
	{
	  if (qn == 2)
	    qh = mpn_divrem_2 (qp, 0L, np - 2, 4, dp - 2);
	  else if (BELOW_THRESHOLD (qn, DC_DIV_QR_THRESHOLD))
	    qh = mpn_sbpi1_div_qr (qp, np - qn, 2 * qn, dp - qn, qn, dinv->inv32);
	  else
	    qh = mpn_dcpi1_div_qr_n (qp, np - qn, dp - qn, qn, dinv, tp);

	  if (qn != dn)
	    {
	      if (qn > dn - qn)
		mpn_mul (tp, qp, qn, dp - dn, dn - qn);
	      else
		mpn_mul (tp, dp - dn, dn - qn, qp, qn);

	      cy = mpn_sub_n (np - dn, np - dn, tp, dn);
	      if (qh != 0)
		cy += mpn_sub_n (np - dn + qn, np - dn + qn, dp - dn, dn - qn);

	      while (cy != 0)
		{
		  qh -= mpn_sub_1 (qp, qp, qn, 1);
		  cy -= mpn_add_n (np - dn, np - dn, dp - dn, dn);
		}
	    }
	}
      qn = nn - dn - qn + 1;
      while (qn > dn)
	{
	  qp -= dn;
	  np -= dn;
	  mpn_dcpi1_div_qr_n (qp, np - dn, dp - dn, dn, dinv, tp);
	  qn -= dn;
	}

      /* Since we pretended we'd need an extra quotient limb before, we now
	 have made sure the code above left just dn-1=qn quotient limbs to
	 develop.  Develop that plus a guard limb. */
      qn--;
      qp -= qn;
      np -= dn;
      qsave = qp[qn];
      mpn_dcpi1_divappr_q_n (qp, np - dn, dp - dn, dn, dinv, tp);
      MPN_COPY_INCR (qp, qp + 1, qn);
      qp[qn] = qsave;
    }
  else    /* (qn < dn) */
    {
      mp_ptr q2p;
#if 0				/* not possible since we demand nn > dn */
      if (qn == 0)
	{
	  qh = mpn_cmp (np - dn, dp - dn, dn) >= 0;
	  if (qh)
	    mpn_sub_n (np - dn, np - dn, dp - dn, dn);
	  TMP_FREE;
	  return qh;
	}
#endif

      qp -= qn;			/* point at low limb of next quotient block */
      np -= qn;			/* point in the middle of partial remainder */

      q2p = TMP_SALLOC_LIMBS (qn + 1);
      /* Should we at all check DC_DIVAPPR_Q_THRESHOLD here, or reply on
	 callers not to be silly?  */
      if (BELOW_THRESHOLD (qn, DC_DIVAPPR_Q_THRESHOLD))
	{
	  qh = mpn_sbpi1_divappr_q (q2p, np - qn - 2, 2 * (qn + 1),
				    dp - (qn + 1), qn + 1, dinv->inv32);
	}
      else
	{
	  /* It is tempting to use qp for recursive scratch and put quotient in
	     tp, but the recursive scratch needs one limb too many.  */
	  tp = TMP_SALLOC_LIMBS (qn + 1);
	  qh = mpn_dcpi1_divappr_q_n (q2p, np - qn - 2, dp - (qn + 1), qn + 1, dinv, tp);
	}
      MPN_COPY (qp, q2p + 1, qn);
    }

  TMP_FREE;
  return qh;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x60(%rbp)
jmp 0x52c2d
jmp 0x52c2f
jmp 0x52c31
jmp 0x52c33
jmp 0x52c35
movq -0x18(%rbp), %rax
subq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
shlq $0x3, %rax
addq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
shlq $0x3, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rax
shlq $0x3, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jl 0x53575
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jg 0x52c8b
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
shlq $0x3, %rcx
subq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
shlq $0x3, %rcx
subq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rax
leaq 0xf(,%rax,8), %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x58(%rbp)
cmpq $0x1, -0x38(%rbp)
jne 0x531e4
movq -0x10(%rbp), %rdi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
addq $0x8, %rdi
movq -0x20(%rbp), %rsi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x28(%rbp), %rdx
callq 0x3b060
cmpl $0x0, %eax
setge %al
andb $0x1, %al
movzbl %al, %eax
cltq
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x52d7d
movq -0x10(%rbp), %rdi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
addq $0x8, %rsi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x28(%rbp), %rcx
callq 0x36fe0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq -0x10(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rax), %rax
movq %rax, -0x90(%rbp)
jmp 0x52dc0
movq -0x70(%rbp), %rax
cmpq -0x88(%rbp), %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x52e35
movq -0x78(%rbp), %rax
cmpq -0x90(%rbp), %rax
jne 0x52e35
movq $-0x1, -0x68(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x28(%rbp), %rdx
movq -0x68(%rbp), %rcx
callq 0x56760
movq %rax, -0x48(%rbp)
jmp 0x52e30
jmp 0x531d4
jmp 0x52e37
movq -0x70(%rbp), %rax
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, -0x118(%rbp)
mulq -0x118(%rbp)
movq %rax, -0x98(%rbp)
movq %rdx, -0x68(%rbp)
movq -0x68(%rbp), %rcx
movq -0x70(%rbp), %rsi
movq -0x98(%rbp), %rax
movq -0x78(%rbp), %rdx
movq %rsi, -0x108(%rbp)
movq %rdx, -0x110(%rbp)
addq -0x110(%rbp), %rax
adcq -0x108(%rbp), %rcx
movq %rcx, -0x68(%rbp)
movq %rax, -0x98(%rbp)
movq -0x78(%rbp), %rax
movq -0x88(%rbp), %rcx
imulq -0x68(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rcx
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rax
movq -0x90(%rbp), %rdx
movq %rsi, -0xf8(%rbp)
movq %rdx, -0x100(%rbp)
subq -0x100(%rbp), %rax
sbbq -0xf8(%rbp), %rcx
movq %rcx, -0x78(%rbp)
movq %rax, -0x80(%rbp)
movq -0x90(%rbp), %rax
movq -0x68(%rbp), %rcx
movq %rcx, -0xf0(%rbp)
mulq -0xf0(%rbp)
movq %rax, -0xa8(%rbp)
movq %rdx, -0xa0(%rbp)
movq -0x78(%rbp), %rcx
movq -0xa0(%rbp), %rsi
movq -0x80(%rbp), %rax
movq -0xa8(%rbp), %rdx
movq %rsi, -0xe0(%rbp)
movq %rdx, -0xe8(%rbp)
subq -0xe8(%rbp), %rax
sbbq -0xe0(%rbp), %rcx
movq %rcx, -0x78(%rbp)
movq %rax, -0x80(%rbp)
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x98(%rbp), %rax
setae %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
xorl %eax, %eax
subq %rcx, %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x78(%rbp), %rcx
movq -0xb0(%rbp), %rsi
andq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rax
movq -0xb0(%rbp), %rdx
andq -0x90(%rbp), %rdx
movq %rsi, -0xd0(%rbp)
movq %rdx, -0xd8(%rbp)
addq -0xd8(%rbp), %rax
adcq -0xd0(%rbp), %rcx
movq %rcx, -0x78(%rbp)
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x88(%rbp), %rax
setae %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x53054
movq -0x78(%rbp), %rax
cmpq -0x88(%rbp), %rax
ja 0x5300c
movq -0x80(%rbp), %rax
cmpq -0x90(%rbp), %rax
jb 0x53052
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
movq -0x78(%rbp), %rcx
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rax
movq -0x90(%rbp), %rdx
movq %rsi, -0x120(%rbp)
movq %rdx, -0x128(%rbp)
subq -0x128(%rbp), %rax
sbbq -0x120(%rbp), %rcx
movq %rcx, -0x78(%rbp)
movq %rax, -0x80(%rbp)
jmp 0x53054
jmp 0x53056
cmpq $0x2, -0x28(%rbp)
jle 0x531bc
movq -0x10(%rbp), %rdi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x28(%rbp), %rdx
subq $0x2, %rdx
movq -0x68(%rbp), %rcx
callq 0x56760
movq %rax, -0xb8(%rbp)
movq -0x80(%rbp), %rax
cmpq -0xb8(%rbp), %rax
setb %al
andb $0x1, %al
movzbl %al, %eax
cltq
movq %rax, -0xc0(%rbp)
movq -0x80(%rbp), %rax
subq -0xb8(%rbp), %rax
andq $-0x1, %rax
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rax
cmpq -0xc0(%rbp), %rax
setb %al
andb $0x1, %al
movzbl %al, %eax
cltq
movq %rax, -0xb8(%rbp)
movq -0x78(%rbp), %rax
subq -0xc0(%rbp), %rax
andq $-0x1, %rax
movq %rax, -0x78(%rbp)
movq -0x80(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, -0x10(%rax)
cmpq $0x0, -0xb8(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x531ba
movq -0x88(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
callq 0x36c80
movq %rax, %rcx
movq -0x130(%rbp), %rax
addq %rcx, %rax
addq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x68(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x40(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x68(%rbp), %rax
subq $0x1, %rax
andq $-0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x531c8
movq -0x80(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, -0x10(%rax)
movq -0x78(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, -0x8(%rax)
movq -0x68(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
jmp 0x53427
cmpq $0x2, -0x38(%rbp)
jne 0x53216
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $-0x10, %rdx
movq -0x20(%rbp), %r8
addq $-0x10, %r8
xorl %eax, %eax
movl %eax, %esi
movl $0x4, %ecx
callq 0x37dc0
movq %rax, -0x40(%rbp)
jmp 0x5329d
cmpq $0x33, -0x38(%rbp)
jge 0x53260
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
subq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x38(%rbp), %rdx
shlq %rdx
movq -0x20(%rbp), %rcx
xorl %eax, %eax
subq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rcx
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %rax
movq (%rax), %r9
callq 0x505f0
movq %rax, -0x40(%rbp)
jmp 0x5329b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
subq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
subq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x58(%rbp), %r9
callq 0x51ab0
movq %rax, -0x40(%rbp)
jmp 0x5329d
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x53425
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
subq -0x38(%rbp), %rcx
cmpq %rcx, %rax
jle 0x532e8
movq -0x58(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x20(%rbp), %rcx
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rcx
movq -0x28(%rbp), %r8
subq -0x38(%rbp), %r8
callq 0x37f00
jmp 0x53312
movq -0x58(%rbp), %rdi
movq -0x20(%rbp), %rsi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x28(%rbp), %rdx
subq -0x38(%rbp), %rdx
movq -0x8(%rbp), %rcx
movq -0x38(%rbp), %r8
callq 0x37f00
movq -0x10(%rbp), %rdi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x58(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x36fe0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x533aa
movq -0x10(%rbp), %rdi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x28(%rbp), %rcx
subq -0x38(%rbp), %rcx
callq 0x36fe0
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x533ac
cmpq $0x0, -0x48(%rbp)
je 0x53423
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x38(%rbp), %rdx
movl $0x1, %ecx
callq 0x36e60
movq %rax, %rcx
movq -0x40(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x28(%rbp), %rcx
callq 0x36c80
movq %rax, %rcx
movq -0x48(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x48(%rbp)
jmp 0x533ac
jmp 0x53425
jmp 0x53427
movq -0x18(%rbp), %rax
subq -0x28(%rbp), %rax
subq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jle 0x534c0
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x58(%rbp), %r9
callq 0x51ab0
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x38(%rbp)
jmp 0x5343b
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdx
movq -0x8(%rbp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
subq -0x28(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x58(%rbp), %r9
callq 0x52940
jmp 0x53545
jmp 0x53547
jmp 0x53549
jmp 0x5354b
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x8, %rsi
movq -0x38(%rbp), %rdx
callq 0x554c6
movq -0x50(%rbp), %rdx
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x536b4
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
shlq $0x3, %rcx
subq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
shlq $0x3, %rcx
subq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x38(%rbp), %rax
leaq 0x17(,%rax,8), %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0xc8(%rbp)
cmpq $0x108, -0x38(%rbp)     # imm = 0x108
jge 0x5361e
movq -0xc8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
subq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
addq $-0x10, %rsi
movq -0x38(%rbp), %rdx
addq $0x1, %rdx
shlq %rdx
movq -0x20(%rbp), %rcx
movq -0x38(%rbp), %r8
addq $0x1, %r8
xorl %eax, %eax
subq %r8, %rax
shlq $0x3, %rax
addq %rax, %rcx
movq -0x38(%rbp), %r8
addq $0x1, %r8
movq -0x30(%rbp), %rax
movq (%rax), %r9
callq 0x50ac0
movq %rax, -0x40(%rbp)
jmp 0x53688
movq -0x38(%rbp), %rax
leaq 0x17(,%rax,8), %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x58(%rbp)
movq -0xc8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
subq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
addq $-0x10, %rsi
movq -0x20(%rbp), %rdx
movq -0x38(%rbp), %rcx
addq $0x1, %rcx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x3, %rax
addq %rax, %rdx
movq -0x38(%rbp), %rcx
addq $0x1, %rcx
movq -0x30(%rbp), %r8
movq -0x58(%rbp), %r9
callq 0x52940
movq %rax, -0x40(%rbp)
jmp 0x5368a
jmp 0x5368c
jmp 0x5368e
jmp 0x53690
jmp 0x53692
jmp 0x53694
jmp 0x53696
jmp 0x53698
movq -0x8(%rbp), %rdi
movq -0xc8(%rbp), %rsi
addq $0x8, %rsi
movq -0x38(%rbp), %rdx
callq 0x554c6
jmp 0x536b2
jmp 0x536b4
jmp 0x536b6
cmpq $0x0, -0x60(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x536df
movq -0x60(%rbp), %rdi
callq 0x564a0
jmp 0x536e1
movq -0x40(%rbp), %rax
movq %rbp, %rsp
popq %rbp
retq
nopw (%rax,%rax)