// File: /workspace/github_cpp_makefile_star2_O2/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 0x26b8
movsd 0x6ad7(%rip), %xmm1     # 0x9008
mulsd %xmm0, %xmm1
ucomisd %xmm0, %xmm1
jne 0x2541
jnp 0x26b8
movapd 0x6ae7(%rip), %xmm6     # 0x9030
xorpd %xmm0, %xmm6
maxsd %xmm0, %xmm6
movsd 0x6ab7(%rip), %xmm7     # 0x9010
ucomisd %xmm6, %xmm7
ja 0x26b8
pushq $0x1
popq %r14
movsd 0x6aa8(%rip), %xmm8     # 0x9018
movsd 0x6aa8(%rip), %xmm1     # 0x9020
ucomisd %xmm8, %xmm6
jb 0x2588
mulsd %xmm1, %xmm6
incq %r14
jmp 0x2578
movslq (%rbx), %rax
cmpq %rax, %r14
jle 0x25c2
movq %rbx, %rdi
movq %r14, %rsi
movapd %xmm0, -0x30(%rbp)
movapd %xmm6, -0x20(%rbp)
callq 0x228f
movsd 0x6a6a(%rip), %xmm8     # 0x9018
movsd 0x6a5a(%rip), %xmm7     # 0x9010
movapd -0x20(%rbp), %xmm6
movapd -0x30(%rbp), %xmm0
jmp 0x25c6
movq 0x8(%rbx), %rax
cvttsd2si %xmm6, %rdx
movq %rdx, %rsi
movapd %xmm6, %xmm1
subsd 0x6a4e(%rip), %xmm1     # 0x9028
sarq $0x3f, %rsi
cvttsd2si %xmm1, %rcx
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, %xmm2
punpckldq 0x6a4a(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x6a52(%rip), %xmm2     # 0x9050
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
subsd %xmm1, %xmm6
ucomisd %xmm6, %xmm7
jbe 0x26c4
movsd 0x6a08(%rip), %xmm5     # 0x9028
movsd 0x6a18(%rip), %xmm1     # 0x9040
movapd 0x6a20(%rip), %xmm2     # 0x9050
movq %r14, %rdx
movq %rcx, -0x8(%rax,%rdx,8)
cmpq $0x2, %rdx
jl 0x26a7
mulsd %xmm8, %xmm6
cvttsd2si %xmm6, %rsi
movq %rsi, %rdi
sarq $0x3f, %rdi
movapd %xmm6, %xmm3
subsd %xmm5, %xmm3
cvttsd2si %xmm3, %rcx
andq %rdi, %rcx
orq %rsi, %rcx
movq %rcx, %xmm3
punpckldq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
subpd %xmm2, %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
addsd %xmm3, %xmm4
subsd %xmm4, %xmm6
decq %rdx
ucomisd %xmm6, %xmm7
ja 0x2633
leaq 0x6d77(%rip), %rdi      # 0x9406
leaq 0x69ce(%rip), %rsi      # 0x9064
leaq 0x6d71(%rip), %rcx      # 0x940e
movl $0x64f, %edx            # imm = 0x64F
callq 0x1090
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 0x6d3b(%rip), %rdi      # 0x9406
leaq 0x6992(%rip), %rsi      # 0x9064
leaq 0x6d35(%rip), %rcx      # 0x940e
movl $0x647, %edx            # imm = 0x647
callq 0x1090