// File: /workspace/github_cpp_makefile_star2_O2/marxn[P]pupp/3rdparty/gmp/mpf/cmp.c
// Function: _gmpf_cmp
int
mpf_cmp (mpf_srcptr u, mpf_srcptr v) __GMP_NOTHROW
{
  mp_srcptr up, vp;
  mp_size_t usize, vsize;
  mp_exp_t uexp, vexp;
  int cmp;
  int usign;

  usize = SIZ(u);
  vsize = SIZ(v);
  usign = usize >= 0 ? 1 : -1;

  /* 1. Are the signs different?  */
  if ((usize ^ vsize) >= 0)
    {
      /* U and V are both non-negative or both negative.  */
      if (usize == 0)
	/* vsize >= 0 */
	return -(vsize != 0);
      if (vsize == 0)
	/* usize >= 0 */
	return usize != 0;
      /* Fall out.  */
    }
  else
    {
      /* Either U or V is negative, but not both.  */
      return usign;
    }

  /* U and V have the same sign and are both non-zero.  */

  uexp = EXP(u);
  vexp = EXP(v);

  /* 2. Are the exponents different?  */
  if (uexp > vexp)
    return usign;
  if (uexp < vexp)
    return -usign;

  usize = ABS (usize);
  vsize = ABS (vsize);

  up = PTR (u);
  vp = PTR (v);

#define STRICT_MPF_NORMALIZATION 0
#if ! STRICT_MPF_NORMALIZATION
  /* Ignore zeroes at the low end of U and V.  */
  do {
    mp_limb_t tl;
    tl = up[0];
    MPN_STRIP_LOW_ZEROS_NOT_ZERO (up, usize, tl);
    tl = vp[0];
    MPN_STRIP_LOW_ZEROS_NOT_ZERO (vp, vsize, tl);
  } while (0);
#endif

  if (usize > vsize)
    {
      cmp = mpn_cmp (up + usize - vsize, vp, vsize);
      /* if (cmp == 0) */
      /*	return usign; */
      ++cmp;
    }
  else if (vsize > usize)
    {
      cmp = mpn_cmp (up, vp + vsize - usize, usize);
      /* if (cmp == 0) */
      /*	return -usign; */
    }
  else
    {
      cmp = mpn_cmp (up, vp, usize);
      if (cmp == 0)
	return 0;
    }
  return cmp > 0 ? usign : -usign;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movslq 0x4(%rdi), %r9
movslq 0x4(%rsi), %r10
movl %r9d, %ebx
sarl $0x1f, %ebx
orl $0x1, %ebx
movq %r10, %rax
xorq %r9, %rax
js 0x17acc
testl %r9d, %r9d
je 0x17ad3
testl %r10d, %r10d
je 0x17adf
movl %r9d, %eax
notl %eax
sarl $0x1f, %eax
orl $0x1, %eax
movq 0x8(%rsi), %rcx
cmpq %rcx, 0x8(%rdi)
jle 0x17ae7
movl %ebx, %eax
jmp 0x17bb1
xorl %eax, %eax
negl %r10d
sbbl %eax, %eax
jmp 0x17bb1
pushq $0x1
popq %rax
jmp 0x17bb1
jl 0x17bb1
movq %r9, %r11
negq %r11
movq %r9, %rdx
cmovnsq %r11, %rdx
movq 0x10(%rdi), %rdi
movq 0x10(%rsi), %rsi
movq %r10, %rax
negq %rax
cmpq %r10, %rax
cmovleq %r10, %rax
shlq $0x3, %rax
cmpq %r9, %r11
movq %r9, %rcx
cmovgq %r11, %rcx
shlq $0x3, %rcx
subq %rcx, %rax
addq %rsi, %rax
movq %rdi, %rcx
cmpq $0x0, (%rcx)
jne 0x17b3d
decq %rdx
addq $0x8, %rcx
addq $0x8, %rax
jmp 0x17b2a
movq %r10, %r14
negq %r14
movq %r10, %r8
cmovnsq %r14, %r8
cmpq %r9, %r11
cmovgq %r11, %r9
shlq $0x3, %r9
cmpq %r10, %r14
cmovleq %r10, %r14
shlq $0x3, %r14
subq %r14, %r9
addq %r9, %rdi
cmpq $0x0, (%rsi)
jne 0x17b79
decq %r8
addq $0x8, %rsi
addq $0x8, %rdi
jmp 0x17b66
cmpq %r8, %rdx
jle 0x17b8c
movq %r8, %rdx
callq 0x1ac5c
movl %eax, %ecx
incl %ecx
jmp 0x17ba8
movq %rcx, %rdi
jge 0x17b9d
movq %rax, %rsi
callq 0x1ac5c
movl %eax, %ecx
jmp 0x17ba8
callq 0x1ac5c
movl %eax, %ecx
testl %eax, %eax
je 0x17bb9
movl %ebx, %eax
negl %eax
testl %ecx, %ecx
cmovgl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
jmp 0x17bb1
nopl (%rax)