// File: /workspace/github_cpp_makefile_star2_O1/marxn[P]pupp/3rdparty/gmp/./mini-gmp/mini-gmp.c
// Function: mpz_set_d
void
mpz_set_d (mpz_t r, double x)
{
  int sign;
  mp_ptr rp;
  mp_size_t rn, i;
  double B;
  double Bi;
  mp_limb_t f;

  /* x != x is true when x is a NaN, and x == x * 0.5 is true when x is
     zero or infinity. */
  if (x != x || x == x * 0.5)
    {
      r->_mp_size = 0;
      return;
    }

  sign = x < 0.0 ;
  if (sign)
    x = - x;

  if (x < 1.0)
    {
      r->_mp_size = 0;
      return;
    }
  B = 2.0 * (double) GMP_LIMB_HIGHBIT;
  Bi = 1.0 / B;
  for (rn = 1; x >= B; rn++)
    x *= Bi;

  rp = MPZ_REALLOC (r, rn);

  f = (mp_limb_t) x;
  x -= f;
  assert (x < 1.0);
  i = rn-1;
  rp[i] = f;
  while (--i >= 0)
    {
      x = B * x;
      f = (mp_limb_t) x;
      x -= f;
      assert (x < 1.0);
      rp[i] = f;
    }

  r->_mp_size = sign ? - rn : rn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorl %eax, %eax
ucomisd %xmm0, %xmm0
jp 0x2a36
movsd 0x7773(%rip), %xmm1     # 0xa008
mulsd %xmm0, %xmm1
ucomisd %xmm0, %xmm1
jne 0x28a5
jnp 0x2a36
movapd 0x7783(%rip), %xmm7     # 0xa030
xorpd %xmm0, %xmm7
maxsd %xmm0, %xmm7
movsd 0x7752(%rip), %xmm8     # 0xa010
ucomisd %xmm7, %xmm8
ja 0x2a36
movl $0x1, %r14d
ucomisd 0x7741(%rip), %xmm7     # 0xa018
jb 0x28f6
movsd 0x773f(%rip), %xmm2     # 0xa020
movsd 0x772f(%rip), %xmm1     # 0xa018
mulsd %xmm2, %xmm7
incq %r14
ucomisd %xmm1, %xmm7
jae 0x28e9
movslq (%rbx), %rcx
movq 0x8(%rbx), %rax
cmpq %rcx, %r14
jle 0x294f
movapd %xmm7, -0x20(%rbp)
movapd %xmm0, -0x30(%rbp)
leaq (,%r14,8), %rdx
movq %rax, %rdi
xorl %esi, %esi
callq *0xd789(%rip)           # 0x100a8
movq %rax, 0x8(%rbx)
movl %r14d, (%rbx)
movl 0x4(%rbx), %ecx
movl %ecx, %edx
negl %edx
cmovsl %ecx, %edx
cmpq %rdx, %r14
jae 0x293c
movl $0x0, 0x4(%rbx)
movapd -0x30(%rbp), %xmm0
movapd -0x20(%rbp), %xmm7
movsd 0x76c1(%rip), %xmm8     # 0xa010
cvttsd2si %xmm7, %rdx
movq %rdx, %rsi
movapd %xmm7, %xmm1
subsd 0x76c5(%rip), %xmm1     # 0xa028
sarq $0x3f, %rsi
cvttsd2si %xmm1, %rcx
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, %xmm2
punpckldq 0x76c1(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x76c9(%rip), %xmm2     # 0xa050
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
subsd %xmm1, %xmm7
ucomisd %xmm7, %xmm8
jbe 0x2a61
movq %rcx, -0x8(%rax,%r14,8)
cmpq $0x2, %r14
jl 0x2a25
leaq -0x1(%r14), %rcx
movsd 0x765f(%rip), %xmm6     # 0xa018
movsd 0x7667(%rip), %xmm1     # 0xa028
movq 0x7677(%rip), %xmm2     # 0xa040
movapd 0x767f(%rip), %xmm3     # 0xa050
mulsd %xmm6, %xmm7
cvttsd2si %xmm7, %rsi
movq %rsi, %rdi
movapd %xmm7, %xmm4
subsd %xmm1, %xmm4
cvttsd2si %xmm4, %rdx
sarq $0x3f, %rdi
andq %rdi, %rdx
orq %rsi, %rdx
movq %rdx, %xmm4
punpckldq %xmm2, %xmm4    # xmm4 = xmm4[0],xmm2[0],xmm4[1],xmm2[1]
subpd %xmm3, %xmm4
movapd %xmm4, %xmm5
unpckhpd %xmm4, %xmm5            # xmm5 = xmm5[1],xmm4[1]
addsd %xmm4, %xmm5
subsd %xmm5, %xmm7
ucomisd %xmm7, %xmm8
jbe 0x2a42
movq %rdx, -0x8(%rax,%rcx,8)
decq %rcx
testq %rcx, %rcx
jg 0x29d1
movl %r14d, %eax
negl %eax
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
cmovbel %r14d, %eax
movl %eax, 0x4(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x79bd(%rip), %rdi      # 0xa406
leaq 0x7614(%rip), %rsi      # 0xa064
leaq 0x79b7(%rip), %rcx      # 0xa40e
movl $0x64f, %edx            # imm = 0x64F
callq 0x1090
leaq 0x799e(%rip), %rdi      # 0xa406
leaq 0x75f5(%rip), %rsi      # 0xa064
leaq 0x7998(%rip), %rcx      # 0xa40e
movl $0x647, %edx            # imm = 0x647
callq 0x1090