// File: /workspace/github_cpp_makefile_star2_O3/marxn[P]pupp/3rdparty/gmp/mpn/set_str.c
// Function: _gmpn_dc_set_str
mp_size_t
mpn_dc_set_str (mp_ptr rp, const unsigned char *str, size_t str_len,
		const powers_t *powtab, mp_ptr tp)
{
  size_t len_lo, len_hi;
  mp_limb_t cy;
  mp_size_t ln, hn, n, sn;

  len_lo = powtab->digits_in_base;

  if (str_len <= len_lo)
    {
      if (BELOW_THRESHOLD (str_len, SET_STR_DC_THRESHOLD))
	return mpn_bc_set_str (rp, str, str_len, powtab->base);
      else
	return mpn_dc_set_str (rp, str, str_len, powtab + 1, tp);
    }

  len_hi = str_len - len_lo;
  ASSERT (len_lo >= len_hi);

  if (BELOW_THRESHOLD (len_hi, SET_STR_DC_THRESHOLD))
    hn = mpn_bc_set_str (tp, str, len_hi, powtab->base);
  else
    hn = mpn_dc_set_str (tp, str, len_hi, powtab + 1, rp);

  sn = powtab->shift;

  if (hn == 0)
    {
      /* Zero +1 limb here, to avoid reading an allocated but uninitialised
	 limb in mpn_incr_u below.  */
      MPN_ZERO (rp, powtab->n + sn + 1);
    }
  else
    {
      if (powtab->n > hn)
	mpn_mul (rp + sn, powtab->p, powtab->n, tp, hn);
      else
	mpn_mul (rp + sn, tp, hn, powtab->p, powtab->n);
      MPN_ZERO (rp, sn);
    }

  str = str + str_len - len_lo;
  if (BELOW_THRESHOLD (len_lo, SET_STR_DC_THRESHOLD))
    ln = mpn_bc_set_str (tp, str, len_lo, powtab->base);
  else
    ln = mpn_dc_set_str (tp, str, len_lo, powtab + 1, tp + powtab->n + sn + 1);

  if (ln != 0)
    {
      cy = mpn_add_n (rp, rp, tp, ln);
      mpn_incr_u (rp + ln, cy);
    }
  n = hn + powtab->n + sn;
  return n - (rp[n - 1] == 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x8(%rsp)
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
movq 0x18(%rcx), %r12
cmpq %rdx, %r12
jae 0x1e9b4
movq %rcx, %rbp
jmp 0x1e9cd
movq %rcx, %rbp
cmpq $0x10b, %r13            # imm = 0x10B
jbe 0x1ea3b
movq 0x40(%rbp), %r12
addq $0x28, %rbp
cmpq %r13, %r12
jae 0x1e9b7
movq %r13, %rdx
subq %r12, %rdx
cmpq $0x10b, %rdx            # imm = 0x10B
jbe 0x1e9f2
leaq 0x28(%rbp), %rcx
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %r8
callq 0x1e98a
jmp 0x1ea02
movl 0x20(%rbp), %ecx
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x1e5f9
movq 0x8(%rbp), %r8
movq 0x10(%rbp), %r14
testq %rax, %rax
movq %rax, 0x10(%rsp)
je 0x1ea31
leaq (%rbx,%r14,8), %rdi
movq (%rbp), %rcx
cmpq %rax, %r8
jle 0x1ea5a
movq %rcx, %rsi
movq %r8, %rdx
movq 0x8(%rsp), %rcx
movq %rax, %r8
jmp 0x1ea62
addq %r14, %r8
incq %r8
jne 0x1ea6f
jmp 0x1ea80
movl 0x20(%rcx), %ecx
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1e5f9
movq 0x8(%rsp), %rsi
movq %rax, %rdx
callq 0x1c838
movq %r14, %r8
testq %r14, %r14
je 0x1ea80
shlq $0x3, %r8
movq %rbx, %rdi
xorl %esi, %esi
movq %r8, %rdx
callq 0x6170
addq %r13, %r15
subq %r12, %r15
cmpq $0x10b, %r12            # imm = 0x10B
jbe 0x1eab5
leaq 0x28(%rbp), %rcx
movq 0x8(%rbp), %rax
movq 0x8(%rsp), %rdi
leaq (%rdi,%rax,8), %rax
leaq (%rax,%r14,8), %r8
addq $0x8, %r8
movq %r15, %rsi
movq %r12, %rdx
callq 0x1e98a
jmp 0x1eac8
movl 0x20(%rbp), %ecx
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1e5f9
movq %rax, %r15
testq %rax, %rax
je 0x1eaf7
movq %rbx, %rdi
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rcx
callq 0x1ba80
leaq (%rbx,%r15,8), %rcx
addq %rax, (%rcx)
jae 0x1eaf7
addq $0x1, 0x8(%rcx)
leaq 0x8(%rcx), %rcx
jb 0x1eaec
addq 0x10(%rsp), %r14
addq 0x8(%rbp), %r14
cmpq $0x1, -0x8(%rbx,%r14,8)
sbbq $0x0, %r14
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq