package o;

import com.google.android.gms.common.ConnectionResult;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.kt0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1716kt0 {
    public static final /* synthetic */ int c = 0;
    public final C2193pu0 a = new C2193pu0();
    public boolean b;

    static {
        new C1716kt0(0);
    }

    public C1716kt0() {
    }

    public static void b(Zs0 zs0, Lu0 lu0, int i, Object obj) throws C1723ky {
        if (lu0 == Lu0.f218o) {
            Charset charset = Et0.a;
            zs0.Z(i, 3);
            ((AbstractC2665ut0) ((Ns0) obj)).d(zs0);
            zs0.Z(i, 4);
            return;
        }
        zs0.Z(i, lu0.m);
        Nu0 nu0 = Nu0.l;
        switch (lu0.ordinal()) {
            case 0:
                zs0.l0(Double.doubleToRawLongBits(((Double) obj).doubleValue()));
                break;
            case 1:
                zs0.j0(Float.floatToRawIntBits(((Float) obj).floatValue()));
                break;
            case 2:
                zs0.k0(((Long) obj).longValue());
                break;
            case 3:
                zs0.k0(((Long) obj).longValue());
                break;
            case 4:
                zs0.h0(((Integer) obj).intValue());
                break;
            case 5:
                zs0.l0(((Long) obj).longValue());
                break;
            case 6:
                zs0.j0(((Integer) obj).intValue());
                break;
            case 7:
                zs0.g0(((Boolean) obj).booleanValue() ? (byte) 1 : (byte) 0);
                break;
            case 8:
                if (!(obj instanceof Ws0)) {
                    zs0.n0((String) obj);
                    break;
                } else {
                    zs0.f0((Ws0) obj);
                    break;
                }
            case ConnectionResult.SERVICE_INVALID /* 9 */:
                ((AbstractC2665ut0) ((Ns0) obj)).d(zs0);
                break;
            case 10:
                zs0.getClass();
                AbstractC2665ut0 abstractC2665ut0 = (AbstractC2665ut0) ((Ns0) obj);
                zs0.i0(abstractC2665ut0.k());
                abstractC2665ut0.d(zs0);
                break;
            case ConnectionResult.LICENSE_CHECK_FAILED /* 11 */:
                if (!(obj instanceof Ws0)) {
                    byte[] bArr = (byte[]) obj;
                    int length = bArr.length;
                    zs0.i0(length);
                    zs0.m0(length, bArr);
                    break;
                } else {
                    zs0.f0((Ws0) obj);
                    break;
                }
            case 12:
                zs0.i0(((Integer) obj).intValue());
                break;
            case 13:
                if (!(obj instanceof InterfaceC3045yt0)) {
                    zs0.h0(((Integer) obj).intValue());
                    break;
                } else {
                    zs0.h0(((InterfaceC3045yt0) obj).zza());
                    break;
                }
            case 14:
                zs0.j0(((Integer) obj).intValue());
                break;
            case 15:
                zs0.l0(((Long) obj).longValue());
                break;
            case 16:
                int iIntValue = ((Integer) obj).intValue();
                zs0.i0((iIntValue >> 31) ^ (iIntValue + iIntValue));
                break;
            case 17:
                long jLongValue = ((Long) obj).longValue();
                zs0.k0((jLongValue >> 63) ^ (jLongValue + jLongValue));
                break;
        }
    }

    public final void a() {
        if (this.b) {
            return;
        }
        C2193pu0 c2193pu0 = this.a;
        int i = c2193pu0.m;
        for (int i2 = 0; i2 < i; i2++) {
            Object obj = c2193pu0.a(i2).m;
            if (obj instanceof AbstractC2665ut0) {
                ((AbstractC2665ut0) obj).g();
            }
        }
        Iterator it = c2193pu0.b().iterator();
        while (it.hasNext()) {
            Object value = ((Map.Entry) it.next()).getValue();
            if (value instanceof AbstractC2665ut0) {
                ((AbstractC2665ut0) value).g();
            }
        }
        if (!c2193pu0.f682o) {
            if (c2193pu0.m > 0) {
                c2193pu0.a(0).l.getClass();
                throw new ClassCastException();
            }
            Iterator it2 = c2193pu0.b().iterator();
            if (it2.hasNext()) {
                ((Map.Entry) it2.next()).getKey().getClass();
                throw new ClassCastException();
            }
        }
        if (!c2193pu0.f682o) {
            c2193pu0.n = c2193pu0.n.isEmpty() ? Collections.EMPTY_MAP : Collections.unmodifiableMap(c2193pu0.n);
            c2193pu0.q = c2193pu0.q.isEmpty() ? Collections.EMPTY_MAP : Collections.unmodifiableMap(c2193pu0.q);
            c2193pu0.f682o = true;
        }
        this.b = true;
    }

    public final Object clone() {
        C1716kt0 c1716kt0 = new C1716kt0();
        C2193pu0 c2193pu0 = this.a;
        if (c2193pu0.m > 0) {
            c2193pu0.a(0).l.getClass();
            throw new ClassCastException();
        }
        Iterator it = c2193pu0.b().iterator();
        if (!it.hasNext()) {
            return c1716kt0;
        }
        Map.Entry entry = (Map.Entry) it.next();
        if (entry.getKey() != null) {
            throw new ClassCastException();
        }
        entry.getValue();
        throw null;
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof C1716kt0) {
            return this.a.equals(((C1716kt0) obj).a);
        }
        return false;
    }

    public final int hashCode() {
        return this.a.hashCode();
    }

    public C1716kt0(int i) {
        a();
        a();
    }
}
