package d.p0;

import d.n0.c.s;
import d.p0.f;

/* JADX INFO: Access modifiers changed from: package-private */
/* JADX INFO: compiled from: _Ranges.kt */
/* JADX INFO: loaded from: classes.dex */
@d.n
public class n extends m {
    public static int b(int i, int i2) {
        return i < i2 ? i2 : i;
    }

    public static int c(int i, int i2) {
        return i > i2 ? i2 : i;
    }

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

    public static long e(long j, long j2, long j3) {
        if (j2 <= j3) {
            return j < j2 ? j2 : j > j3 ? j3 : j;
        }
        throw new IllegalArgumentException("Cannot coerce value to an empty range: maximum " + j3 + " is less than minimum " + j2 + '.');
    }

    public static f f(int i, int i2) {
        return f.f2669c.a(i, i2, -1);
    }

    public static f g(f fVar, int i) {
        s.e(fVar, "<this>");
        m.a(i > 0, Integer.valueOf(i));
        f.a aVar = f.f2669c;
        int iA = fVar.a();
        int iB = fVar.b();
        if (fVar.c() <= 0) {
            i = -i;
        }
        return aVar.a(iA, iB, i);
    }

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