public static int compare(final long a, final long b) {
    // Perform arithmetic comparison first, resulting in -1, 0 or 1 if
    // the second value is less than, equal or larger than the first,
    // respectively.
    final int result = Long.compare(a, b);

    // If both values have the same sign value, return the result.
    // Otherwise, one of the two values was negative and we need to "flip"
    // the result.
    return (a & 0x8000000000000000L) == (b & 0x8000000000000000L) ? result : -result;
  }
Compares two Java {@code long} values for order, treating the values as unsigned. Returns a
negative integer, zero, or a positive integer as the first specified value is less than, equal
to, or greater than the second specified value.

@param a the first address to compare
@param b the second address to compare
@return a negative integer, zero, or a positive integer as this object is less than, equal to,
    or greater than the specified object.
java/zylib/src/main/java/com/google/security/zynamics/zylib/disassembly/CAddress.java