// File: /workspace/github_cpp_makefile_star2_O1/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 %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r14
addq $0x28, %rbx
movq -0x10(%rbx), %r15
movq %r13, %rdx
subq %r15, %rdx
ja 0x1ef05
cmpq $0x10b, %r13            # imm = 0x10B
ja 0x1eecd
movl -0x8(%rbx), %ecx
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1eb2c
cmpq $0x10b, %rdx            # imm = 0x10B
movq %r8, 0x8(%rsp)
jbe 0x1ef26
movq %r8, %rdi
movq %r12, %rsi
movq %rbx, %rcx
movq %r14, %r8
callq 0x1eeb3
jmp 0x1ef34
movl -0x8(%rbx), %ecx
movq %r8, %rdi
movq %r12, %rsi
callq 0x1eb2c
movq -0x20(%rbx), %r8
movq -0x18(%rbx), %rbp
testq %rax, %rax
movq %rax, 0x10(%rsp)
je 0x1ef66
leaq (%r14,%rbp,8), %rdi
movq -0x28(%rbx), %rcx
cmpq %rax, %r8
movq 0x8(%rsp), %r9
jle 0x1ef70
movq %rcx, %rsi
movq %r8, %rdx
movq %r9, %rcx
movq %rax, %r8
jmp 0x1ef76
addq %rbp, %r8
incq %r8
jne 0x1ef83
jmp 0x1ef94
movq %r9, %rsi
movq %rax, %rdx
callq 0x1cd58
movq %rbp, %r8
testq %rbp, %rbp
je 0x1ef94
shlq $0x3, %r8
movq %r14, %rdi
xorl %esi, %esi
movq %r8, %rdx
callq 0x6170
addq %r13, %r12
subq %r15, %r12
cmpq $0x10b, %r15            # imm = 0x10B
jbe 0x1efc8
movq -0x20(%rbx), %rax
movq 0x8(%rsp), %rdi
leaq (%rdi,%rax,8), %rax
leaq (%rax,%rbp,8), %r8
addq $0x8, %r8
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x1eeb3
jmp 0x1efdb
movl -0x8(%rbx), %ecx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1eb2c
movq %rax, %r15
testq %rax, %rax
je 0x1f00a
movq %r14, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rcx
callq 0x1bfa0
leaq (%r14,%r15,8), %rcx
addq %rax, (%rcx)
jae 0x1f00a
addq $0x1, 0x8(%rcx)
leaq 0x8(%rcx), %rcx
jb 0x1efff
addq 0x10(%rsp), %rbp
addq -0x20(%rbx), %rbp
cmpq $0x1, -0x8(%r14,%rbp,8)
sbbq $0x0, %rbp
movq %rbp, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop