// File: /workspace/github_cpp_makefile_star2_O2/marxn[P]pupp/3rdparty/gmp/./mini-gmp/mini-gmp.c
// Function: mpz_import
void
mpz_import (mpz_t r, size_t count, int order, size_t size, int endian,
	    size_t nails, const void *src)
{
  const unsigned char *p;
  ptrdiff_t word_step;
  mp_ptr rp;
  mp_size_t rn;

  /* The current (partial) limb. */
  mp_limb_t limb;
  /* The number of bytes already copied to this limb (starting from
     the low end). */
  size_t bytes;
  /* The index where the limb should be stored, when completed. */
  mp_size_t i;

  if (nails != 0)
    gmp_die ("mpz_import: Nails not supported.");

  assert (order == 1 || order == -1);
  assert (endian >= -1 && endian <= 1);

  if (endian == 0)
    endian = gmp_detect_endian ();

  p = (unsigned char *) src;

  word_step = (order != endian) ? 2 * size : 0;

  /* Process bytes from the least significant end, so point p at the
     least significant word. */
  if (order == 1)
    {
      p += size * (count - 1);
      word_step = - word_step;
    }

  /* And at least significant byte of that word. */
  if (endian == 1)
    p += (size - 1);

  rn = (size * count + sizeof(mp_limb_t) - 1) / sizeof(mp_limb_t);
  rp = MPZ_REALLOC (r, rn);

  for (limb = 0, bytes = 0, i = 0; count > 0; count--, p += word_step)
    {
      size_t j;
      for (j = 0; j < size; j++, p -= (ptrdiff_t) endian)
	{
	  limb |= (mp_limb_t) *p << (bytes++ * CHAR_BIT);
	  if (bytes == sizeof(mp_limb_t))
	    {
	      rp[i++] = limb;
	      bytes = 0;
	      limb = 0;
	    }
	}
    }
  assert (i + (bytes > 0) == rn);
  if (limb != 0)
    rp[i++] = limb;
  else
    i = mpn_normalized_size (rp, i);

  r->_mp_size = i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %r9, %r9
jne 0x7224
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %r11
cmpl $-0x1, %edx
je 0x710a
cmpl $0x1, %edx
jne 0x726e
leal 0x1(%r8), %eax
cmpl $0x3, %eax
jae 0x7230
xorl %eax, %eax
cmpl $0x1, %r8d
movl $0x0, %r12d
sbbl %r12d, %r12d
orl %r8d, %r12d
leaq (%r14,%r14), %rcx
cmpl %edx, %r12d
cmoveq %rax, %rcx
leaq -0x1(%r15), %rsi
imulq %r14, %rsi
movq %rcx, %r13
negq %r13
cmpl $0x1, %edx
cmovneq %rax, %rsi
cmovneq %rcx, %r13
addq 0x10(%rbp), %rsi
cmpl $0x1, %r12d
leaq -0x1(%r14,%rsi), %rbx
cmovneq %rsi, %rbx
movq %r14, %rcx
imulq %r15, %rcx
addq $0x7, %rcx
shrq $0x3, %rcx
movslq (%r11), %rax
cmpq %rax, %rcx
movq %rcx, -0x38(%rbp)
jle 0x718e
movq %r11, %rdi
movq %rcx, %rsi
movq %r11, -0x30(%rbp)
callq 0x228f
movq -0x30(%rbp), %r11
jmp 0x7192
movq 0x8(%r11), %rax
movslq %r12d, %rdx
negq %rdx
xorl %edi, %edi
xorl %ecx, %ecx
xorl %esi, %esi
subq $0x1, %r15
jb 0x71e1
movq %r14, %r8
subq $0x1, %r8
jb 0x71dc
movzbl (%rbx), %r9d
leaq 0x1(%rcx), %r10
shll $0x3, %ecx
shlq %cl, %r9
orq %rdi, %r9
cmpq $0x8, %r10
jne 0x71d1
movq %r9, (%rax,%rsi,8)
incq %rsi
xorl %r9d, %r9d
xorl %r10d, %r10d
addq %rdx, %rbx
movq %r9, %rdi
movq %r10, %rcx
jmp 0x71a7
addq %r13, %rbx
jmp 0x719e
cmpq $0x1, %rcx
movq %rsi, %rcx
sbbq $-0x1, %rcx
cmpq -0x38(%rbp), %rcx
jne 0x724f
testq %rdi, %rdi
je 0x7200
movq %rdi, (%rax,%rsi,8)
incq %rsi
jmp 0x7211
movq %rax, %rdi
movq %r11, %rbx
callq 0x1369
movq %rbx, %r11
movq %rax, %rsi
movl %esi, 0x4(%r11)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x268f(%rip), %rdi      # 0x98ba
callq 0x4fde
leaq 0x270e(%rip), %rdi      # 0x9945
leaq 0x1e26(%rip), %rsi      # 0x9064
leaq 0x26b0(%rip), %rcx      # 0x98f5
movl $0x1090, %edx           # imm = 0x1090
callq 0x1090
leaq 0x270b(%rip), %rdi      # 0x9961
leaq 0x1e07(%rip), %rsi      # 0x9064
leaq 0x2691(%rip), %rcx      # 0x98f5
movl $0x10b6, %edx           # imm = 0x10B6
callq 0x1090
leaq 0x2666(%rip), %rdi      # 0x98db
leaq 0x1de8(%rip), %rsi      # 0x9064
leaq 0x2672(%rip), %rcx      # 0x98f5
movl $0x108f, %edx           # imm = 0x108F
callq 0x1090