package o;

import java.util.ArrayDeque;
import java.util.List;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.tI, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2513tI {
    public final /* synthetic */ int a;
    public boolean b;
    public Object c;
    public Object d;

    public C2513tI() {
        this.a = 3;
        this.c = new Object();
    }

    public boolean a(long j) {
        Object obj;
        List list = (List) ((C1390hY) this.d).m;
        int size = list.size();
        int i = 0;
        while (true) {
            if (i >= size) {
                obj = null;
                break;
            }
            obj = list.get(i);
            if (AbstractC2001nt0.t(((KX) obj).a, j)) {
                break;
            }
            i++;
        }
        KX kx = (KX) obj;
        if (kx != null) {
            return kx.h;
        }
        return false;
    }

    public int b() {
        C2642ui c2642ui = (C2642ui) this.d;
        int i = c2642ui.b;
        int i2 = c2642ui.c;
        if (i < i2) {
            return 2;
        }
        return i > i2 ? 1 : 3;
    }

    public void c() {
        if (this.b) {
            C2066oe0.a((C2066oe0) this.d, (Ue0) this.c);
        }
    }

    public long d(C2730ve0 c2730ve0, long j, boolean z, C0387Oy c0387Oy) {
        C2066oe0 c2066oe0 = (C2066oe0) this.d;
        long jC = C2066oe0.c(c2066oe0, c2730ve0, j, z, false, c0387Oy, false);
        if (!Ue0.a(jC, (Ue0) this.c)) {
            this.b = false;
        }
        c2066oe0.p(Ue0.c(jC) ? EnumC3079zE.n : EnumC3079zE.m);
        return jC;
    }

    public void e(Hv0 hv0) {
        synchronized (this.c) {
            try {
                if (((ArrayDeque) this.d) == null) {
                    this.d = new ArrayDeque();
                }
                ((ArrayDeque) this.d).add(hv0);
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public void f(Pc0 pc0) {
        Hv0 hv0;
        synchronized (this.c) {
            if (((ArrayDeque) this.d) != null && !this.b) {
                this.b = true;
                while (true) {
                    synchronized (this.c) {
                        try {
                            hv0 = (Hv0) ((ArrayDeque) this.d).poll();
                            if (hv0 == null) {
                                this.b = false;
                                return;
                            }
                        } finally {
                        }
                    }
                    hv0.a(pc0);
                }
            }
        }
    }

    public String toString() {
        switch (this.a) {
            case 1:
                StringBuilder sb = new StringBuilder("SingleSelectionLayout(isStartHandle=");
                sb.append(this.b);
                sb.append(", crossed=");
                int iB = b();
                sb.append(iB != 1 ? iB != 2 ? iB != 3 ? "null" : "COLLAPSED" : "NOT_CROSSED" : "CROSSED");
                sb.append(", info=\n\t");
                sb.append((C2642ui) this.d);
                sb.append(')');
                return sb.toString();
            default:
                return super.toString();
        }
    }

    public C2513tI(UM um, C1390hY c1390hY) {
        this.a = 0;
        this.c = um;
        this.d = c1390hY;
    }

    public C2513tI(boolean z, A50 a50, C2642ui c2642ui) {
        this.a = 1;
        this.b = z;
        this.c = a50;
        this.d = c2642ui;
    }

    public C2513tI(C2066oe0 c2066oe0) {
        this.a = 2;
        this.d = c2066oe0;
        this.b = true;
    }
}
