package K;

import G0.InterfaceC0279y;
import o0.C2632c;

/* JADX INFO: loaded from: classes.dex */
public final class S0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final T0.L f3742a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public InterfaceC0279y f3743b = null;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public InterfaceC0279y f3744c;

    public S0(T0.L l, InterfaceC0279y interfaceC0279y) {
        this.f3742a = l;
        this.f3744c = interfaceC0279y;
    }

    public final long a(long j4) {
        C2632c c2632cD0;
        InterfaceC0279y interfaceC0279y = this.f3743b;
        C2632c c2632c = C2632c.f21786e;
        if (interfaceC0279y != null) {
            if (interfaceC0279y.w()) {
                InterfaceC0279y interfaceC0279y2 = this.f3744c;
                c2632cD0 = interfaceC0279y2 != null ? interfaceC0279y2.d0(interfaceC0279y, true) : null;
            } else {
                c2632cD0 = c2632c;
            }
            if (c2632cD0 != null) {
                c2632c = c2632cD0;
            }
        }
        int i6 = (int) (j4 >> 32);
        float fIntBitsToFloat = Float.intBitsToFloat(i6);
        float fIntBitsToFloat2 = c2632c.f21787a;
        if (fIntBitsToFloat >= fIntBitsToFloat2) {
            float fIntBitsToFloat3 = Float.intBitsToFloat(i6);
            fIntBitsToFloat2 = c2632c.f21789c;
            if (fIntBitsToFloat3 <= fIntBitsToFloat2) {
                fIntBitsToFloat2 = Float.intBitsToFloat(i6);
            }
        }
        int i7 = (int) (j4 & 4294967295L);
        float fIntBitsToFloat4 = Float.intBitsToFloat(i7);
        float fIntBitsToFloat5 = c2632c.f21788b;
        if (fIntBitsToFloat4 >= fIntBitsToFloat5) {
            float fIntBitsToFloat6 = Float.intBitsToFloat(i7);
            fIntBitsToFloat5 = c2632c.f21790d;
            if (fIntBitsToFloat6 <= fIntBitsToFloat5) {
                fIntBitsToFloat5 = Float.intBitsToFloat(i7);
            }
        }
        return (((long) Float.floatToRawIntBits(fIntBitsToFloat2)) << 32) | (((long) Float.floatToRawIntBits(fIntBitsToFloat5)) & 4294967295L);
    }

    public final int b(long j4, boolean z6) {
        if (z6) {
            j4 = a(j4);
        }
        return this.f3742a.f6472b.g(d(j4));
    }

    public final boolean c(long j4) {
        long jD = d(a(j4));
        float fIntBitsToFloat = Float.intBitsToFloat((int) (4294967295L & jD));
        T0.L l = this.f3742a;
        int iE = l.f6472b.e(fIntBitsToFloat);
        int i6 = (int) (jD >> 32);
        return Float.intBitsToFloat(i6) >= l.d(iE) && Float.intBitsToFloat(i6) <= l.e(iE);
    }

    public final long d(long j4) {
        InterfaceC0279y interfaceC0279y;
        InterfaceC0279y interfaceC0279y2 = this.f3743b;
        if (interfaceC0279y2 == null) {
            return j4;
        }
        if (!interfaceC0279y2.w()) {
            interfaceC0279y2 = null;
        }
        if (interfaceC0279y2 == null || (interfaceC0279y = this.f3744c) == null) {
            return j4;
        }
        InterfaceC0279y interfaceC0279y3 = interfaceC0279y.w() ? interfaceC0279y : null;
        return interfaceC0279y3 == null ? j4 : interfaceC0279y2.f0(interfaceC0279y3, j4);
    }

    public final long e(long j4) {
        InterfaceC0279y interfaceC0279y;
        InterfaceC0279y interfaceC0279y2 = this.f3743b;
        if (interfaceC0279y2 == null) {
            return j4;
        }
        if (!interfaceC0279y2.w()) {
            interfaceC0279y2 = null;
        }
        if (interfaceC0279y2 == null || (interfaceC0279y = this.f3744c) == null) {
            return j4;
        }
        InterfaceC0279y interfaceC0279y3 = interfaceC0279y.w() ? interfaceC0279y : null;
        return interfaceC0279y3 == null ? j4 : interfaceC0279y3.f0(interfaceC0279y2, j4);
    }
}
