// File: /workspace/github_cpp_makefile_star2_O3/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 0x2a09
movsd 0x77a0(%rip), %xmm1     # 0xa008
mulsd %xmm0, %xmm1
ucomisd %xmm0, %xmm1
jne 0x2878
jnp 0x2a09
movapd 0x77b0(%rip), %xmm7     # 0xa030
xorpd %xmm0, %xmm7
maxsd %xmm0, %xmm7
movsd 0x777f(%rip), %xmm8     # 0xa010
ucomisd %xmm7, %xmm8
ja 0x2a09
movl $0x1, %r14d
ucomisd 0x776e(%rip), %xmm7     # 0xa018
jb 0x28c9
movsd 0x776c(%rip), %xmm2     # 0xa020
movsd 0x775c(%rip), %xmm1     # 0xa018
mulsd %xmm2, %xmm7
incq %r14
ucomisd %xmm1, %xmm7
jae 0x28bc
movslq (%rbx), %rcx
movq 0x8(%rbx), %rax
cmpq %rcx, %r14
jle 0x2922
movapd %xmm7, -0x20(%rbp)
movapd %xmm0, -0x30(%rbp)
leaq (,%r14,8), %rdx
movq %rax, %rdi
xorl %esi, %esi
callq *0xd7b6(%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 0x290f
movl $0x0, 0x4(%rbx)
movapd -0x30(%rbp), %xmm0
movapd -0x20(%rbp), %xmm7
movsd 0x76ee(%rip), %xmm8     # 0xa010
cvttsd2si %xmm7, %rdx
movq %rdx, %rsi
movapd %xmm7, %xmm1
subsd 0x76f2(%rip), %xmm1     # 0xa028
sarq $0x3f, %rsi
cvttsd2si %xmm1, %rcx
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, %xmm2
punpckldq 0x76ee(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x76f6(%rip), %xmm2     # 0xa050
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
subsd %xmm1, %xmm7
ucomisd %xmm7, %xmm8
jbe 0x2a34
movq %rcx, -0x8(%rax,%r14,8)
cmpq $0x2, %r14
jl 0x29f8
leaq -0x1(%r14), %rcx
movsd 0x768c(%rip), %xmm6     # 0xa018
movsd 0x7694(%rip), %xmm1     # 0xa028
movq 0x76a4(%rip), %xmm2     # 0xa040
movapd 0x76ac(%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 0x2a15
movq %rdx, -0x8(%rax,%rcx,8)
decq %rcx
testq %rcx, %rcx
jg 0x29a4
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 0x79ea(%rip), %rdi      # 0xa406
leaq 0x7641(%rip), %rsi      # 0xa064
leaq 0x79e4(%rip), %rcx      # 0xa40e
movl $0x64f, %edx            # imm = 0x64F
callq 0x1090
leaq 0x79cb(%rip), %rdi      # 0xa406
leaq 0x7622(%rip), %rsi      # 0xa064
leaq 0x79c5(%rip), %rcx      # 0xa40e
movl $0x647, %edx            # imm = 0x647
callq 0x1090