// File: 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 %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movslq 0x4(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, %ecx
cmpq $0x0, %rdx
cmovgel %ecx, %eax
movl %eax, -0x50(%rbp)
movq -0x30(%rbp), %rax
xorq -0x38(%rbp), %rax
cmpq $0x0, %rax
jl 0x367dc
cmpq $0x0, -0x30(%rbp)
jne 0x367be
cmpq $0x0, -0x38(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x369d1
cmpq $0x0, -0x38(%rbp)
jne 0x367da
cmpq $0x0, -0x30(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x369d1
jmp 0x367e7
movl -0x50(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x369d1
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
jle 0x36814
movl -0x50(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x369d1
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
jge 0x3682b
xorl %eax, %eax
subl -0x50(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x369d1
cmpq $0x0, -0x30(%rbp)
jl 0x3683c
movq -0x30(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x36846
xorl %eax, %eax
subq -0x30(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x38(%rbp)
jl 0x3685f
movq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x36869
xorl %eax, %eax
subq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x36896
jmp 0x36898
jmp 0x3689a
jmp 0x3689c
jmp 0x3689e
cmpq $0x0, -0x58(%rbp)
jne 0x368cc
movq -0x30(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x368b3
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x3689e
jmp 0x368ce
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x368db
jmp 0x368dd
jmp 0x368df
jmp 0x368e1
jmp 0x368e3
cmpq $0x0, -0x58(%rbp)
jne 0x36911
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x368f8
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x368e3
jmp 0x36913
jmp 0x36915
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
jle 0x36956
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
xorl %eax, %eax
subq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x28(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x3b060
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x369b5
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jle 0x3698e
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
xorl %eax, %eax
subq -0x30(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x30(%rbp), %rdx
callq 0x3b060
movl %eax, -0x4c(%rbp)
jmp 0x369b3
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x3b060
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
jne 0x369b1
movl $0x0, -0x4(%rbp)
jmp 0x369d1
jmp 0x369b3
jmp 0x369b5
cmpl $0x0, -0x4c(%rbp)
jle 0x369c3
movl -0x50(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x369cb
xorl %eax, %eax
subl -0x50(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)