// File: 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
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
ucomisd -0x10(%rbp), %xmm0
jne 0x39a9
jp 0x39a9
movsd -0x10(%rbp), %xmm0
movsd 0xa66c(%rip), %xmm1     # 0xe008
mulsd -0x10(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jne 0x39b9
jp 0x39b9
movq -0x8(%rbp), %rax
movl $0x0, 0x4(%rax)
jmp 0x3c42
xorps %xmm0, %xmm0
ucomisd -0x10(%rbp), %xmm0
seta %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x39f3
movsd -0x10(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd 0xa615(%rip), %xmm0     # 0xe010
ucomisd -0x10(%rbp), %xmm0
jbe 0x3a12
movq -0x8(%rbp), %rax
movl $0x0, 0x4(%rax)
jmp 0x3c42
movsd 0xa5fe(%rip), %xmm0     # 0xe018
movsd %xmm0, -0x38(%rbp)
movsd 0xa5e9(%rip), %xmm0     # 0xe010
divsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movq $0x1, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
ucomisd -0x38(%rbp), %xmm0
jb 0x3a62
movsd -0x40(%rbp), %xmm0
mulsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x3a39
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jle 0x3a85
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x3440
movq %rax, -0x50(%rbp)
jmp 0x3a91
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0xa57a(%rip), %xmm2     # 0xe020
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rcx
cvttsd2si %xmm0, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x48(%rbp)
movaps 0xa561(%rip), %xmm0     # 0xe030
movq -0x48(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0xa560(%rip), %xmm0     # 0xe040
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd -0x10(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd 0xa50b(%rip), %xmm0     # 0xe010
ucomisd -0x10(%rbp), %xmm0
jbe 0x3b0e
jmp 0x3b2d
leaq 0xa961(%rip), %rdi      # 0xe476
leaq 0xa5b8(%rip), %rsi      # 0xe0d4
movl $0x647, %edx            # imm = 0x647
leaq 0xa956(%rip), %rcx      # 0xe47e
callq 0x1070
movq -0x28(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rdx
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jl 0x3c1b
movsd -0x38(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0xa4a1(%rip), %xmm2     # 0xe020
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rcx
cvttsd2si %xmm0, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x48(%rbp)
movaps 0xa488(%rip), %xmm0     # 0xe030
movq -0x48(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0xa487(%rip), %xmm0     # 0xe040
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd -0x10(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd 0xa432(%rip), %xmm0     # 0xe010
ucomisd -0x10(%rbp), %xmm0
jbe 0x3be7
jmp 0x3c06
leaq 0xa888(%rip), %rdi      # 0xe476
leaq 0xa4df(%rip), %rsi      # 0xe0d4
movl $0x64f, %edx            # imm = 0x64F
leaq 0xa87d(%rip), %rcx      # 0xe47e
callq 0x1070
movq -0x48(%rbp), %rdx
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x3b49
cmpl $0x0, -0x14(%rbp)
je 0x3c2d
xorl %eax, %eax
subq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x3c35
movq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)