package jn;

import java.util.NoSuchElementException;
import jn.g;
import kotlin.jvm.internal.t;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public abstract class o extends n {
    public static float c(float f10, float f11) {
        return f10 < f11 ? f11 : f10;
    }

    public static int d(int i10, int i11) {
        return i10 < i11 ? i11 : i10;
    }

    public static long e(long j10, long j11) {
        return j10 < j11 ? j11 : j10;
    }

    public static float f(float f10, float f11) {
        return f10 > f11 ? f11 : f10;
    }

    public static int g(int i10, int i11) {
        return i10 > i11 ? i11 : i10;
    }

    public static long h(long j10, long j11) {
        return j10 > j11 ? j11 : j10;
    }

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

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

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

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

    public static g m(int i10, int i11) {
        return g.f25080s.a(i10, i11, -1);
    }

    public static int n(i iVar, hn.c random) {
        t.g(iVar, "<this>");
        t.g(random, "random");
        try {
            return hn.d.d(random, iVar);
        } catch (IllegalArgumentException e10) {
            throw new NoSuchElementException(e10.getMessage());
        }
    }

    public static g o(g gVar) {
        t.g(gVar, "<this>");
        return g.f25080s.a(gVar.m(), gVar.g(), -gVar.r());
    }

    public static g p(g gVar, int i10) {
        t.g(gVar, "<this>");
        n.a(i10 > 0, Integer.valueOf(i10));
        g.a aVar = g.f25080s;
        int g10 = gVar.g();
        int m10 = gVar.m();
        if (gVar.r() <= 0) {
            i10 = -i10;
        }
        return aVar.a(g10, m10, i10);
    }

    public static i q(int i10, int i11) {
        return i11 <= Integer.MIN_VALUE ? i.f25088t.a() : new i(i10, i11 - 1);
    }
}
