package g.j0;

/* JADX INFO: compiled from: _Ranges.kt */
/* JADX INFO: loaded from: classes.dex */
@g.i
public class l {
    public static final long a(long j2, long j3, long j4) {
        if (j3 <= j4) {
            return j2 < j3 ? j3 : j2 > j4 ? j4 : j2;
        }
        throw new IllegalArgumentException("Cannot coerce value to an empty range: maximum " + j4 + " is less than minimum " + j3 + '.');
    }

    public static final f b(int i2, int i3) {
        return new f(i2, i3, -1);
    }

    public static final f c(f fVar, int i2) {
        g.h0.c.l.f(fVar, "<this>");
        boolean z = i2 > 0;
        Integer numValueOf = Integer.valueOf(i2);
        g.h0.c.l.f(numValueOf, "step");
        if (z) {
            int i3 = fVar.f4123b;
            int i4 = fVar.f4124e;
            if (fVar.f4125f <= 0) {
                i2 = -i2;
            }
            return new f(i3, i4, i2);
        }
        throw new IllegalArgumentException("Step must be positive, was: " + numValueOf + '.');
    }

    public static final h d(int i2, int i3) {
        if (i3 > Integer.MIN_VALUE) {
            return new h(i2, i3 - 1);
        }
        h hVar = h.f4130g;
        return h.f4131h;
    }
}
