package o;

import java.io.Serializable;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.dj, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1027dj implements InterfaceC2747vn, Serializable {
    public final InterfaceC2747vn l;
    public final InterfaceC2557tn m;

    public C1027dj(InterfaceC2747vn interfaceC2747vn, InterfaceC2557tn interfaceC2557tn) {
        this.l = interfaceC2747vn;
        this.m = interfaceC2557tn;
    }

    private final Object writeReplace() {
        int iA = a();
        InterfaceC2747vn[] interfaceC2747vnArr = new InterfaceC2747vn[iA];
        C3058z10 c3058z10 = new C3058z10();
        R(Oh0.a, new I3(3, interfaceC2747vnArr, c3058z10));
        if (c3058z10.l == iA) {
            return new C0931cj(interfaceC2747vnArr);
        }
        throw new IllegalStateException("Check failed.");
    }

    @Override // o.InterfaceC2747vn
    public final InterfaceC2747vn M(InterfaceC2747vn interfaceC2747vn) {
        return AbstractC2798wI.t(this, interfaceC2747vn);
    }

    @Override // o.InterfaceC2747vn
    public final Object R(Object obj, SC sc) {
        return sc.f(this.l.R(obj, sc), this.m);
    }

    public final int a() {
        int i = 2;
        C1027dj c1027dj = this;
        while (true) {
            InterfaceC2747vn interfaceC2747vn = c1027dj.l;
            c1027dj = interfaceC2747vn instanceof C1027dj ? (C1027dj) interfaceC2747vn : null;
            if (c1027dj == null) {
                return i;
            }
            i++;
        }
    }

    public final boolean equals(Object obj) {
        boolean zC;
        if (this == obj) {
            return true;
        }
        if (obj instanceof C1027dj) {
            C1027dj c1027dj = (C1027dj) obj;
            if (c1027dj.a() == a()) {
                C1027dj c1027dj2 = this;
                while (true) {
                    InterfaceC2557tn interfaceC2557tn = c1027dj2.m;
                    if (!F3.c(c1027dj.m(interfaceC2557tn.getKey()), interfaceC2557tn)) {
                        zC = false;
                        break;
                    }
                    InterfaceC2747vn interfaceC2747vn = c1027dj2.l;
                    if (!(interfaceC2747vn instanceof C1027dj)) {
                        InterfaceC2557tn interfaceC2557tn2 = (InterfaceC2557tn) interfaceC2747vn;
                        zC = F3.c(c1027dj.m(interfaceC2557tn2.getKey()), interfaceC2557tn2);
                        break;
                    }
                    c1027dj2 = (C1027dj) interfaceC2747vn;
                }
                if (zC) {
                    return true;
                }
            }
        }
        return false;
    }

    public final int hashCode() {
        return this.m.hashCode() + this.l.hashCode();
    }

    @Override // o.InterfaceC2747vn
    public final InterfaceC2747vn l(InterfaceC2652un interfaceC2652un) {
        InterfaceC2557tn interfaceC2557tn = this.m;
        InterfaceC2557tn interfaceC2557tnM = interfaceC2557tn.m(interfaceC2652un);
        InterfaceC2747vn interfaceC2747vn = this.l;
        if (interfaceC2557tnM != null) {
            return interfaceC2747vn;
        }
        InterfaceC2747vn interfaceC2747vnL = interfaceC2747vn.l(interfaceC2652un);
        return interfaceC2747vnL == interfaceC2747vn ? this : interfaceC2747vnL == C0281Kv.l ? interfaceC2557tn : new C1027dj(interfaceC2747vnL, interfaceC2557tn);
    }

    @Override // o.InterfaceC2747vn
    public final InterfaceC2557tn m(InterfaceC2652un interfaceC2652un) {
        C1027dj c1027dj = this;
        while (true) {
            InterfaceC2557tn interfaceC2557tnM = c1027dj.m.m(interfaceC2652un);
            if (interfaceC2557tnM != null) {
                return interfaceC2557tnM;
            }
            InterfaceC2747vn interfaceC2747vn = c1027dj.l;
            if (!(interfaceC2747vn instanceof C1027dj)) {
                return interfaceC2747vn.m(interfaceC2652un);
            }
            c1027dj = (C1027dj) interfaceC2747vn;
        }
    }

    public final String toString() {
        return AbstractC0126Ew.n(new StringBuilder("["), (String) R("", C0975d6.w), ']');
    }
}
