package defpackage;

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

/* JADX INFO: renamed from: ᵶˋᵽˑ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC4814 extends AbstractC4474 {
    private static final Map zzb = new ConcurrentHashMap();
    protected C5037 zzc;
    private int zzd;

    public AbstractC4814() {
        this.zza = 0;
        this.zzd = -1;
        this.zzc = C5037.f19069;
    }

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public static AbstractC4814 m10033(Class cls) {
        Map map = zzb;
        AbstractC4814 abstractC4814 = (AbstractC4814) map.get(cls);
        if (abstractC4814 == null) {
            try {
                Class.forName(cls.getName(), true, cls.getClassLoader());
                abstractC4814 = (AbstractC4814) map.get(cls);
            } catch (ClassNotFoundException e) {
                C4935.m10239("Class initialization cannot fail.", e);
                return null;
            }
        }
        if (abstractC4814 != null) {
            return abstractC4814;
        }
        AbstractC4814 abstractC48142 = (AbstractC4814) ((AbstractC4814) AbstractC4892.m10163(cls)).mo1693(6);
        if (abstractC48142 != null) {
            map.put(cls, abstractC48142);
            return abstractC48142;
        }
        ᵷᵝˎ.ᵱʡˏ();
        return null;
    }

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public static Object m10034(Method method, AbstractC4814 abstractC4814, Object... objArr) {
        try {
            return method.invoke(abstractC4814, 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;
        }
    }

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public static final boolean m10035(AbstractC4814 abstractC4814, boolean z) {
        byte bByteValue = ((Byte) abstractC4814.mo1693(1)).byteValue();
        if (bByteValue == 1) {
            return true;
        }
        if (bByteValue == 0) {
            return false;
        }
        boolean zMo5379 = C5215.f19640.m10748(abstractC4814.getClass()).mo5379(abstractC4814);
        if (z) {
            abstractC4814.mo1693(2);
        }
        return zMo5379;
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public static void m10036(Class cls, AbstractC4814 abstractC4814) {
        abstractC4814.m10039();
        zzb.put(cls, abstractC4814);
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        return C5215.f19640.m10748(getClass()).mo5382(this, (AbstractC4814) obj);
    }

    public final int hashCode() {
        if (m10037()) {
            return C5215.f19640.m10748(getClass()).mo5380(this);
        }
        int i = this.zza;
        if (i != 0) {
            return i;
        }
        int iMo5380 = C5215.f19640.m10748(getClass()).mo5380(this);
        this.zza = iMo5380;
        return iMo5380;
    }

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

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public final boolean m10037() {
        return (this.zzd & Integer.MIN_VALUE) != 0;
    }

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public final AbstractC4814 m10038() {
        return (AbstractC4814) mo1693(4);
    }

    @Override // defpackage.AbstractC4474
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final int mo9524(InterfaceC5045 interfaceC5045) {
        if (m10037()) {
            int iMo5385 = interfaceC5045.mo5385(this);
            if (iMo5385 >= 0) {
                return iMo5385;
            }
            ᵕᵩʽᵲ.ᵪᵹᵥᵻ(AbstractC2704.m6517(iMo5385, "serialized size must be non-negative, was "));
            return 0;
        }
        int i = this.zzd & Integer.MAX_VALUE;
        if (i != Integer.MAX_VALUE) {
            return i;
        }
        int iMo53852 = interfaceC5045.mo5385(this);
        if (iMo53852 >= 0) {
            this.zzd = (this.zzd & Integer.MIN_VALUE) | iMo53852;
            return iMo53852;
        }
        ᵕᵩʽᵲ.ᵪᵹᵥᵻ(AbstractC2704.m6517(iMo53852, "serialized size must be non-negative, was "));
        return 0;
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final void m10039() {
        this.zzd &= Integer.MAX_VALUE;
    }

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public final AbstractC5516 m10040() {
        AbstractC5516 abstractC5516 = (AbstractC5516) mo1693(5);
        AbstractC4814 abstractC4814 = abstractC5516.f20838;
        if (!abstractC4814.getClass().isInstance(this)) {
            ᵕᵩʽᵲ.ᵮᵣᵗˈ("mergeFrom(MessageLite) can only merge messages of the same type.");
            return null;
        }
        if (!abstractC4814.equals(this)) {
            if (!abstractC5516.f20839.m10037()) {
                AbstractC4814 abstractC4814M10038 = abstractC5516.f20838.m10038();
                C5215.f19640.m10748(abstractC4814M10038.getClass()).mo5384(abstractC4814M10038, abstractC5516.f20839);
                abstractC5516.f20839 = abstractC4814M10038;
            }
            AbstractC4814 abstractC48142 = abstractC5516.f20839;
            C5215.f19640.m10748(abstractC48142.getClass()).mo5384(abstractC48142, this);
        }
        return abstractC5516;
    }

    /* JADX INFO: renamed from: ᵱᵽʡᵚ */
    public abstract Object mo1693(int i);

    @Override // defpackage.AbstractC4474
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final void mo9525(C0760 c0760) {
        InterfaceC5045 interfaceC5045M10748 = C5215.f19640.m10748(getClass());
        C2198 c2198 = (C2198) c0760.f3418;
        if (c2198 == null) {
            c2198 = new C2198(c0760);
        }
        interfaceC5045M10748.mo5386(this, c2198);
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final void m10041() {
        this.zzd = (this.zzd & Integer.MIN_VALUE) | Integer.MAX_VALUE;
    }

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public final AbstractC5516 m10042() {
        return (AbstractC5516) mo1693(5);
    }

    @Override // defpackage.AbstractC4474
    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public final int mo9526() {
        if (m10037()) {
            int iMo5385 = C5215.f19640.m10748(getClass()).mo5385(this);
            if (iMo5385 >= 0) {
                return iMo5385;
            }
            ᵕᵩʽᵲ.ᵪᵹᵥᵻ(AbstractC2704.m6517(iMo5385, "serialized size must be non-negative, was "));
            return 0;
        }
        int i = this.zzd & Integer.MAX_VALUE;
        if (i != Integer.MAX_VALUE) {
            return i;
        }
        int iMo53852 = C5215.f19640.m10748(getClass()).mo5385(this);
        if (iMo53852 >= 0) {
            this.zzd = (this.zzd & Integer.MIN_VALUE) | iMo53852;
            return iMo53852;
        }
        ᵕᵩʽᵲ.ᵪᵹᵥᵻ(AbstractC2704.m6517(iMo53852, "serialized size must be non-negative, was "));
        return 0;
    }
}
