// File: /workspace/github_cpp_makefile_star2_O1/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:
movslq 0x4(%rdi), %r9
movslq 0x4(%rsi), %r8
movl %r9d, %ecx
sarl $0x1f, %ecx
orl $0x1, %ecx
movq %r8, %rax
xorq %r9, %rax
js 0x1bdd4
testl %r9d, %r9d
je 0x1bdd7
testl %r8d, %r8d
je 0x1bddf
movl %r9d, %eax
notl %eax
sarl $0x1f, %eax
orl $0x1, %eax
movq 0x8(%rsi), %rdx
cmpq %rdx, 0x8(%rdi)
jle 0x1bde5
movl %ecx, %eax
retq
xorl %eax, %eax
negl %r8d
sbbl %eax, %eax
retq
movl $0x1, %eax
retq
jge 0x1bde8
retq
movq %r9, %rdx
negq %rdx
cmovsq %r9, %rdx
movq %r8, %rax
negq %rax
cmovsq %r8, %rax
movq 0x10(%rdi), %rdi
movq 0x10(%rsi), %r8
cmpq $0x0, (%rdi)
je 0x1be0f
movq %rdi, %rsi
jmp 0x1be20
decq %rdx
leaq 0x8(%rdi), %rsi
cmpq $0x0, 0x8(%rdi)
movq %rsi, %rdi
je 0x1be0f
cmpq $0x0, (%r8)
je 0x1be2b
movq %r8, %rdi
jmp 0x1be3c
decq %rax
leaq 0x8(%r8), %rdi
cmpq $0x0, 0x8(%r8)
movq %rdi, %r8
je 0x1be2b
cmpq %rax, %rdx
jle 0x1be6c
leaq (%rsi,%rdx,8), %rdx
addq $-0x8, %rdx
testq %rax, %rax
jle 0x1be9c
movq -0x8(%rdi,%rax,8), %rsi
decq %rax
leaq -0x8(%rdx), %r8
cmpq %rsi, (%rdx)
movq %r8, %rdx
je 0x1be49
seta %al
movzbl %al, %edx
addl %edx, %edx
jmp 0x1bed7
jge 0x1bea3
leaq (%rdi,%rax,8), %rax
addq $-0x8, %rax
testq %rdx, %rdx
jle 0x1bec9
movq -0x8(%rsi,%rdx,8), %rdi
decq %rdx
movq (%rax), %r8
addq $-0x8, %rax
cmpq %r8, %rdi
je 0x1be76
xorl %edx, %edx
cmpq %rdi, %r8
adcl $-0x1, %edx
orl $0x1, %edx
jmp 0x1bed7
movl $0x1, %edx
jmp 0x1bed7
xorl %eax, %eax
testq %rdx, %rdx
jle 0x1becd
movq -0x8(%rsi,%rdx,8), %r8
movq -0x8(%rdi,%rdx,8), %r9
decq %rdx
cmpq %r9, %r8
je 0x1bea5
xorl %edx, %edx
cmpq %r8, %r9
adcl $-0x1, %edx
orl $0x1, %edx
jmp 0x1becf
xorl %edx, %edx
jmp 0x1bed7
xorl %edx, %edx
testl %edx, %edx
je 0x1bde7
movl %ecx, %eax
negl %eax
testl %edx, %edx
cmovgl %ecx, %eax
retq
nopl (%rax)