Compare two unsigned integers.
344763
private static int compareUnsigned(int left, int right) {
    // NOTE: JDK 7 does not have a built-in operation for this, other than casting to longs.
    //       In JDK 8 it's just Integer.compareUnsigned(left, right).  For now we emulate it
    //       by shifting the sign bit away, with a fallback second compare only if needed.
    int diff = (left >>> 2) - (right >>> 2);
    return diff != 0 ? diff : (left & 3) - (right & 3);
  }
822331
def extern_equals(self, context_handle, val1, val2):
    """"""
    return self._ffi.from_handle(val1[0]) == self._ffi.from_handle(val2[0])
346753
def _get_int(data, position, dummy0, dummy1, dummy2):
    """"""
    end = position + 4
    return _UNPACK_INT(data[position:end])[0], end
1209780
def amod(a, b):
    ''''''
    modded = int(a % b)
    return b if modded is 0 else modded
1205937
public static int equal(int b, int c) {
    int result = 0;
    int xor = b ^ c;
    for (int i = 0; i < 8; i++) {
      result |= xor >> i;
    }
    return (result ^ 0x01) & 0x01;
  }
278633
private static short unsignedValueOf(byte value) {
        short result;
        if ((value & 0x80) != 0) {
            result = (short) (value & 0x7F);
            result |= 0x80;
        } else {
            result = value;
        }
        return result;
    }
117220
def ULE(a: BitVec, b: BitVec) -> Bool:
    
    return Or(ULT(a, b), a == b)
253561
public static int compare(Number a, Number b) 
  {
    int aType = getType(a);
    int bType = getType(b);
    
    int compType = (aType >= bType) ? aType : bType;
    switch (compType) 
    {
      case INT :
        int li = a.intValue();
        int ri = b.intValue();
        return (li < ri) ? -1 : (li == ri) ? 0 : 1;
      case LONG :
        long ll = a.longValue();
        long rl = b.longValue();
        return (ll < rl) ? -1 : (ll == rl) ? 0 : 1;
      case FLOAT :
        float lf = a.floatValue();
        float rf = b.floatValue();
        return (lf < rf) ? -1 : (lf == rf) ? 0 : 1;
      case DOUBLE :
        double ld = a.doubleValue();
        double rd = b.doubleValue();
        return (ld < rd) ? -1 : (ld == rd) ? 0 : 1;
      default :
        throw new IllegalStateException();
    }
  }
431029
public static int dataCompare(final Bits left, final Bits right) {
    for (int i = 0; i < left.bytes.length; i++) {
      if (right.bytes.length <= i) {
        return 1;
      }
      final int a = left.bytes[i] & 0xFF;
      final int b = right.bytes[i] & 0xFF;
      if (a < b) {
        return -1;
      }
      if (a > b) {
        return 1;
      }
    }
    if (left.bitLength < right.bitLength) {
      return -1;
    }
    if (left.bitLength > right.bitLength) {
      return 1;
    }
    return 0;
  }
1153217
private Number sum(Number a, Number b) {
    if (a instanceof Integer) {
      return Integer.valueOf(a.intValue() + b.intValue());
    }
    else if (a instanceof Float) {
      return new Float(a.floatValue() + b.floatValue());
    }
    else if (a instanceof Short) {
      return Short.valueOf((short)(a.shortValue() + b.shortValue()));
    }
    else if (a instanceof Byte) {
      return Byte.valueOf((byte)(a.byteValue() + b.byteValue()));
    }
    else if (a instanceof Long) {
      return Long.valueOf((a.longValue() + b.longValue()));
    }
    else {
      // should never happen
      throw new MetricsException("Invalid number type");
    }
            
  }
689923
def _check_for_int(x):
    
    try:
        y = int(x)
    except (OverflowError, ValueError):
        pass
    else:
        # There is no way in AMF0 to distinguish between integers and floats
        if x == x and y == x:
            return y

    return x
1089118
private static boolean arrayCompare(byte[] a, int offset1, byte[] a2, int offset2, int length) {
        for (int i = 0; i < length; i++) {
            if (a[offset1++] != a2[offset2++]) return false;
        }
        return true;
    }
1108891
private static int compareNumeric(BitVector a, BitVector b) {
		final int aSize = a.size();
		final int bSize = b.size();
		if (aSize != bSize && !b.isAllZerosAdj(b.finish - bSize + aSize, b.finish)) return -1;
		// more optimizations are possible but probably not worthwhile
		if (a.isAligned() && b.isAligned()) {
			int pos = aSize & ~ADDRESS_MASK;
			if (pos != aSize) {
				int bits = aSize - pos;
				long aBits = a.getBitsAdj(pos, bits);
				long bBits = b.getBitsAdj(pos, bits);
				if (aBits != bBits) {
					return aBits < bBits ? -1 : 1;
				}
			}
			final long[] aArr = a.bits;
			final long[] bArr = b.bits;
			for (int i = (pos >> ADDRESS_BITS) - 1; i >= 0; i--) {
				long aBits = aArr[i];
				long bBits = bArr[i];
				if (aBits == bBits) continue;
				boolean aNeg = aBits < 0L;
				boolean bNeg = bBits < 0L;
				if (bNeg && !aNeg) return -1;
				if (aNeg && !bNeg) return 1;
				return aBits < bBits ? -1 : 1;
			}
			return 0;
		} else {
			final int aStart = a.start;
			final int bStart = b.start;
			int offset;
			for (offset = aSize - ADDRESS_SIZE; offset >= 0; offset -= ADDRESS_SIZE) {
				long aBits = a.getBitsAdj(offset + aStart, ADDRESS_SIZE);
				long bBits = b.getBitsAdj(offset + bStart, ADDRESS_SIZE);
				if (aBits == bBits) continue;
				boolean aNeg = aBits < 0L;
				boolean bNeg = bBits < 0L;
				if (bNeg && !aNeg) return -1;
				if (aNeg && !bNeg) return 1;
				return aBits < bBits ? -1 : 1;
			}
			if (offset != 0) {
				long aBits = a.getBitsAdj(aStart, ADDRESS_SIZE + offset);
				long bBits = b.getBitsAdj(bStart, ADDRESS_SIZE + offset);
				if (aBits == bBits) return 0;
				return aBits < bBits ? -1 : 1;
			}
			return 0;
		}
	}
938083
def UDiv(a: BitVec, b: BitVec) -> BitVec:
    
    return _arithmetic_helper(a, b, z3.UDiv)
606293
private static final int compareInt64AsUnsigned(long a, long b) {
        a += 0x8000000000000000L;
        b += 0x8000000000000000L;
        if(a < b) {
            return -1;
        } else if(a > b) {
            return 1;
        } else {
            return 0;
        }
    }
608909
private static int compare(byte[] s1, int start1, int lens1, byte[] s2, int start2, int lens2) {
    final int max = Math.min(lens1, lens2);

    for (int i = 0; i < max; i++) {
      final byte c1 = s1[start1++];
      final byte c2 = s2[start2++];
      if (c1 != c2)
        return (c1 & 0xff) - (c2 & 0xff);
    }

    return lens1 - lens2;
  }
1030922
private int ssCompare(int pa, int pb, int p2, int depth) {
        int U1, U2, U1n, U2n;// pointers to T

        for (U1 = depth + pa, U2 = depth + SA[p2], U1n = pb + 2, U2n = SA[p2 + 1] + 2; (U1 < U1n)
            && (U2 < U2n) && (T[start + U1] == T[start + U2]); ++U1, ++U2) {
        }

        return U1 < U1n ? (U2 < U2n ? T[start + U1] - T[start + U2] : 1) : (U2 < U2n ? -1
            : 0);
    }