package c3;

import com.google.firebase.perf.util.Constants;

/* loaded from: classes.dex */
public abstract class c {
    public static final long a(int i10, int i11, int i12, int i13) {
        if (!(i11 >= i10)) {
            m.a("maxWidth(" + i11 + ") must be >= than minWidth(" + i10 + ')');
        }
        if (!(i13 >= i12)) {
            m.a("maxHeight(" + i13 + ") must be >= than minHeight(" + i12 + ')');
        }
        if (!(i10 >= 0 && i12 >= 0)) {
            m.a("minWidth(" + i10 + ") and minHeight(" + i12 + ") must be >= 0");
        }
        return j(i10, i11, i12, i13);
    }

    public static /* synthetic */ long b(int i10, int i11, int i12, int i13, int i14, Object obj) {
        if ((i14 & 1) != 0) {
            i10 = 0;
        }
        if ((i14 & 2) != 0) {
            i11 = Integer.MAX_VALUE;
        }
        if ((i14 & 4) != 0) {
            i12 = 0;
        }
        if ((i14 & 8) != 0) {
            i13 = Integer.MAX_VALUE;
        }
        return a(i10, i11, i12, i13);
    }

    private static final int d(int i10, int i11) {
        int d10;
        if (i10 == Integer.MAX_VALUE) {
            return i10;
        }
        d10 = jn.o.d(i10 + i11, 0);
        return d10;
    }

    private static final int e(int i10) {
        if (i10 < 8191) {
            return 13;
        }
        if (i10 < 32767) {
            return 15;
        }
        if (i10 < 65535) {
            return 16;
        }
        if (i10 < 262143) {
            return 18;
        }
        return Constants.MAX_HOST_LENGTH;
    }

    public static final long f(long j10, long j11) {
        int k10;
        int k11;
        k10 = jn.o.k(r.g(j11), b.n(j10), b.l(j10));
        k11 = jn.o.k(r.f(j11), b.m(j10), b.k(j10));
        return s.a(k10, k11);
    }

    public static final long g(long j10, long j11) {
        int k10;
        int k11;
        int k12;
        int k13;
        k10 = jn.o.k(b.n(j11), b.n(j10), b.l(j10));
        k11 = jn.o.k(b.l(j11), b.n(j10), b.l(j10));
        k12 = jn.o.k(b.m(j11), b.m(j10), b.k(j10));
        k13 = jn.o.k(b.k(j11), b.m(j10), b.k(j10));
        return a(k10, k11, k12, k13);
    }

    public static final int h(long j10, int i10) {
        int k10;
        k10 = jn.o.k(i10, b.m(j10), b.k(j10));
        return k10;
    }

    public static final int i(long j10, int i10) {
        int k10;
        k10 = jn.o.k(i10, b.n(j10), b.l(j10));
        return k10;
    }

    public static final long j(int i10, int i11, int i12, int i13) {
        int i14 = i13 == Integer.MAX_VALUE ? i12 : i13;
        int e10 = e(i14);
        int i15 = i11 == Integer.MAX_VALUE ? i10 : i11;
        int e11 = e(i15);
        if (e10 + e11 > 31) {
            k(i15, i14);
        }
        int i16 = i11 + 1;
        int i17 = i16 & (~(i16 >> 31));
        int i18 = i13 + 1;
        int i19 = i18 & (~(i18 >> 31));
        int i20 = 0;
        if (e11 != 13) {
            if (e11 == 18) {
                i20 = 3;
            } else if (e11 == 15) {
                i20 = 1;
            } else if (e11 == 16) {
                i20 = 2;
            }
        }
        int i21 = ((i20 & 1) << 1) + (((i20 & 2) >> 1) * 3) + 15;
        return b.b((i17 << 33) | i20 | (i10 << 2) | (i12 << i21) | (i19 << (i21 + 31)));
    }

    private static final void k(int i10, int i11) {
        throw new IllegalArgumentException("Can't represent a width of " + i10 + " and height of " + i11 + " in Constraints");
    }

    private static final Void l(int i10) {
        throw new IllegalArgumentException("Can't represent a size of " + i10 + " in Constraints");
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final int m(int i10) {
        if (i10 < 8191) {
            return 262142;
        }
        if (i10 < 32767) {
            return 65534;
        }
        if (i10 < 65535) {
            return 32766;
        }
        if (i10 < 262143) {
            return 8190;
        }
        l(i10);
        throw new rm.k();
    }

    public static final long n(long j10, int i10, int i11) {
        int d10;
        int d11;
        d10 = jn.o.d(b.n(j10) + i10, 0);
        int d12 = d(b.l(j10), i10);
        d11 = jn.o.d(b.m(j10) + i11, 0);
        return a(d10, d12, d11, d(b.k(j10), i11));
    }

    public static /* synthetic */ long o(long j10, int i10, int i11, int i12, Object obj) {
        if ((i12 & 1) != 0) {
            i10 = 0;
        }
        if ((i12 & 2) != 0) {
            i11 = 0;
        }
        return n(j10, i10, i11);
    }
}
