package kotlin.ranges;

import kotlin.ranges.g;

/* JADX INFO: Access modifiers changed from: package-private */
/* JADX INFO: loaded from: classes.dex */
public abstract class o extends n {
    public static int b(int i2, int i3) {
        return i2 < i3 ? i3 : i2;
    }

    public static long c(long j2, long j3) {
        return j2 < j3 ? j3 : j2;
    }

    public static int d(int i2, int i3) {
        return i2 > i3 ? i3 : i2;
    }

    public static long e(long j2, long j3) {
        return j2 > j3 ? j3 : j2;
    }

    public static int f(int i2, int i3, int i4) {
        if (i3 <= i4) {
            return i2 < i3 ? i3 : i2 > i4 ? i4 : i2;
        }
        throw new IllegalArgumentException("Cannot coerce value to an empty range: maximum " + i4 + " is less than minimum " + i3 + '.');
    }

    public static g g(int i2, int i3) {
        return g.f5117x.a(i2, i3, -1);
    }

    public static g h(g gVar, int i2) {
        kotlin.jvm.internal.l.e(gVar, "<this>");
        n.a(i2 > 0, Integer.valueOf(i2));
        g.a aVar = g.f5117x;
        int iA = gVar.a();
        int iB = gVar.b();
        if (gVar.c() <= 0) {
            i2 = -i2;
        }
        return aVar.a(iA, iB, i2);
    }

    public static i i(int i2, int i3) {
        return i3 <= Integer.MIN_VALUE ? i.f5126y.a() : new i(i2, i3 - 1);
    }
}
