package defpackage;

import j$.util.concurrent.ConcurrentHashMap;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Map;

/* renamed from: ᵺʾˎʽ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public abstract class AbstractC5102 extends AbstractC2299 {
    private static final Map zzb = new ConcurrentHashMap();
    protected C4013 zzc;
    private int zzd;

    public AbstractC5102() {
        this.zza = 0;
        this.zzd = -1;
        this.zzc = C4013.f15093;
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public static void m10565(Class cls, AbstractC5102 abstractC5102) {
        abstractC5102.m10569();
        zzb.put(cls, abstractC5102);
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public static final boolean m10566(AbstractC5102 abstractC5102, boolean z) {
        byte bByteValue = ((Byte) abstractC5102.mo1084(1)).byteValue();
        if (bByteValue == 1) {
            return true;
        }
        if (bByteValue == 0) {
            return false;
        }
        boolean zMo2837 = C0842.f3872.m2966(abstractC5102.getClass()).mo2837(abstractC5102);
        if (z) {
            abstractC5102.mo1084(2);
        }
        return zMo2837;
    }

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public static AbstractC5102 m10567(Class cls) throws ClassNotFoundException {
        Map map = zzb;
        AbstractC5102 abstractC5102 = (AbstractC5102) map.get(cls);
        if (abstractC5102 == null) {
            try {
                Class.forName(cls.getName(), true, cls.getClassLoader());
                abstractC5102 = (AbstractC5102) map.get(cls);
            } catch (ClassNotFoundException e) {
                C1260.m3810("Class initialization cannot fail.", e);
                return null;
            }
        }
        if (abstractC5102 != null) {
            return abstractC5102;
        }
        AbstractC5102 abstractC51022 = (AbstractC5102) ((AbstractC5102) AbstractC4335.m9304(cls)).mo1084(6);
        if (abstractC51022 != null) {
            map.put(cls, abstractC51022);
            return abstractC51022;
        }
        ᵨᴵᵺ.ˌʾˀ();
        return null;
    }

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public static Object m10568(Method method, AbstractC5102 abstractC5102, Object... objArr) {
        try {
            return method.invoke(abstractC5102, objArr);
        } catch (IllegalAccessException e) {
            ᵨᴵᵺ.ᵪʩ("Couldn't use Java reflection to implement protocol message reflection.", e);
            return null;
        } catch (InvocationTargetException e2) {
            Throwable cause = e2.getCause();
            if (cause instanceof RuntimeException) {
                throw ((RuntimeException) cause);
            }
            if (cause instanceof Error) {
                throw ((Error) cause);
            }
            ᵨᴵᵺ.ᵪʩ("Unexpected exception thrown by generated accessor method.", cause);
            return null;
        }
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        return C0842.f3872.m2966(getClass()).mo2839(this, (AbstractC5102) obj);
    }

    public final int hashCode() {
        if (m10574()) {
            return C0842.f3872.m2966(getClass()).mo2831(this);
        }
        int i = this.zza;
        if (i != 0) {
            return i;
        }
        int iMo2831 = C0842.f3872.m2966(getClass()).mo2831(this);
        this.zza = iMo2831;
        return iMo2831;
    }

    public final String toString() {
        String string = super.toString();
        char[] cArr = AbstractC2529.f9877;
        StringBuilder sb = new StringBuilder();
        sb.append("# ");
        sb.append(string);
        AbstractC2529.m6373(this, sb, 0);
        return sb.toString();
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final void m10569() {
        this.zzd &= Integer.MAX_VALUE;
    }

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final AbstractC4935 m10570() {
        AbstractC4935 abstractC4935 = (AbstractC4935) mo1084(5);
        if (!abstractC4935.f18338.equals(this)) {
            if (!abstractC4935.f18337.m10574()) {
                AbstractC5102 abstractC5102M10572 = abstractC4935.f18338.m10572();
                C0842.f3872.m2966(abstractC5102M10572.getClass()).mo2832(abstractC5102M10572, abstractC4935.f18337);
                abstractC4935.f18337 = abstractC5102M10572;
            }
            AbstractC5102 abstractC5102 = abstractC4935.f18337;
            C0842.f3872.m2966(abstractC5102.getClass()).mo2832(abstractC5102, this);
        }
        return abstractC4935;
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final void m10571() {
        this.zzd = (this.zzd & Integer.MIN_VALUE) | Integer.MAX_VALUE;
    }

    @Override // defpackage.AbstractC2299
    /* renamed from: ˏᵙ */
    public final int mo6005(InterfaceC0760 interfaceC0760) {
        if (m10574()) {
            int iMo2835 = interfaceC0760.mo2835(this);
            if (iMo2835 >= 0) {
                return iMo2835;
            }
            ᵹˉᵞ.ᵳٴᵶ(AbstractC2990.m7313(iMo2835, "serialized size must be non-negative, was "));
            return 0;
        }
        int i = this.zzd & Integer.MAX_VALUE;
        if (i != Integer.MAX_VALUE) {
            return i;
        }
        int iMo28352 = interfaceC0760.mo2835(this);
        if (iMo28352 >= 0) {
            this.zzd = (this.zzd & Integer.MIN_VALUE) | iMo28352;
            return iMo28352;
        }
        ᵹˉᵞ.ᵳٴᵶ(AbstractC2990.m7313(iMo28352, "serialized size must be non-negative, was "));
        return 0;
    }

    @Override // defpackage.AbstractC2299
    /* renamed from: ᵥᵯˎ */
    public final void mo6006(C2629 c2629) {
        InterfaceC0760 interfaceC0760M2966 = C0842.f3872.m2966(getClass());
        C4457 c4457 = c2629.f10207;
        if (c4457 == null) {
            c4457 = new C4457(c2629);
        }
        interfaceC0760M2966.mo2838(this, c4457);
    }

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public final AbstractC5102 m10572() {
        return (AbstractC5102) mo1084(4);
    }

    /* renamed from: ᵶᵷᵕ */
    public abstract Object mo1084(int i);

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final AbstractC4935 m10573() {
        return (AbstractC4935) mo1084(5);
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final boolean m10574() {
        return (this.zzd & Integer.MIN_VALUE) != 0;
    }

    @Override // defpackage.AbstractC2299
    /* renamed from: ᵻᵢﹳᵰ */
    public final int mo6008() {
        if (m10574()) {
            int iMo2835 = C0842.f3872.m2966(getClass()).mo2835(this);
            if (iMo2835 >= 0) {
                return iMo2835;
            }
            ᵹˉᵞ.ᵳٴᵶ(AbstractC2990.m7313(iMo2835, "serialized size must be non-negative, was "));
            return 0;
        }
        int i = this.zzd & Integer.MAX_VALUE;
        if (i != Integer.MAX_VALUE) {
            return i;
        }
        int iMo28352 = C0842.f3872.m2966(getClass()).mo2835(this);
        if (iMo28352 >= 0) {
            this.zzd = (this.zzd & Integer.MIN_VALUE) | iMo28352;
            return iMo28352;
        }
        ᵹˉᵞ.ᵳٴᵶ(AbstractC2990.m7313(iMo28352, "serialized size must be non-negative, was "));
        return 0;
    }
}
