package io.netty.util.internal;

/* JADX INFO: loaded from: classes.dex */
public final class MathUtil {
    static final /* synthetic */ boolean $assertionsDisabled = false;

    private MathUtil() {
    }

    public static int compare(long j2, long j3) {
        if (j2 < j3) {
            return -1;
        }
        return j2 > j3 ? 1 : 0;
    }

    public static int findNextPositivePowerOfTwo(int i2) {
        return 1 << (32 - Integer.numberOfLeadingZeros(i2 - 1));
    }

    public static boolean isOutOfBounds(int i2, int i3, int i4) {
        int i5 = i2 | i3;
        int i6 = i2 + i3;
        return ((i5 | i6) | (i4 - i6)) < 0;
    }
}
