package defpackage;

import com.google.android.gms.internal.measurement.zzaeh;
import com.google.android.gms.internal.measurement.zzafy;
import j$.util.concurrent.ConcurrentHashMap;
import java.io.IOException;
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 AbstractC4985 extends AbstractC1126 {
    public static final /* synthetic */ int zzd = 0;
    private static final Map zze = new ConcurrentHashMap();
    private int zzb;
    protected C1057 zzc;

    public AbstractC4985() {
        this.zza = 0;
        this.zzb = -1;
        this.zzc = C1057.f4583;
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public static AbstractC4985 m10426(AbstractC4985 abstractC4985, byte[] bArr, C1037 c1037) throws zzaeh {
        int length = bArr.length;
        if (length != 0) {
            AbstractC4985 abstractC4985M10435 = abstractC4985.m10435();
            try {
                InterfaceC1461 interfaceC1461M11073 = C5430.f20370.m11073(abstractC4985M10435.getClass());
                interfaceC1461M11073.mo3037(abstractC4985M10435, bArr, 0, length, new C4572(c1037));
                interfaceC1461M11073.mo3035(abstractC4985M10435);
                abstractC4985 = abstractC4985M10435;
            } catch (zzaeh e) {
                if (e.f1025) {
                    throw new zzaeh(e.getMessage(), e);
                }
                throw e;
            } catch (zzafy e2) {
                throw e2.m809();
            } catch (IOException e3) {
                if (e3.getCause() instanceof zzaeh) {
                    throw ((zzaeh) e3.getCause());
                }
                throw new zzaeh(e3.getMessage(), e3);
            } catch (IndexOutOfBoundsException unused) {
                C1499.m4426("While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.");
                return null;
            }
        }
        m10431(abstractC4985);
        return abstractC4985;
    }

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public static Object m10427(Method method, AbstractC4985 abstractC4985, Object... objArr) {
        try {
            return method.invoke(abstractC4985, 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;
        }
    }

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public static final boolean m10428(AbstractC4985 abstractC4985, boolean z) {
        byte bByteValue = ((Byte) abstractC4985.mo1179(1)).byteValue();
        if (bByteValue == 1) {
            return true;
        }
        if (bByteValue == 0) {
            return false;
        }
        boolean zMo3031 = C5430.f20370.m11073(abstractC4985.getClass()).mo3031(abstractC4985);
        if (z) {
            abstractC4985.mo1179(2);
        }
        return zMo3031;
    }

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public static AbstractC4985 m10429(Class cls) throws ClassNotFoundException {
        Map map = zze;
        AbstractC4985 abstractC4985 = (AbstractC4985) map.get(cls);
        if (abstractC4985 == null) {
            try {
                Class.forName(cls.getName(), true, cls.getClassLoader());
                abstractC4985 = (AbstractC4985) map.get(cls);
            } catch (ClassNotFoundException e) {
                C1260.m3810("Class initialization cannot fail.", e);
                return null;
            }
        }
        if (abstractC4985 != null) {
            return abstractC4985;
        }
        AbstractC4985 abstractC49852 = (AbstractC4985) ((AbstractC4985) AbstractC0109.m1212(cls)).mo1179(6);
        if (abstractC49852 != null) {
            map.put(cls, abstractC49852);
            return abstractC49852;
        }
        ᵨᴵᵺ.ˌʾˀ();
        return null;
    }

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public static void m10430(Class cls, AbstractC4985 abstractC4985) {
        abstractC4985.m10439();
        zze.put(cls, abstractC4985);
    }

    /* renamed from: ᵸʓᵠ, reason: contains not printable characters */
    public static void m10431(AbstractC4985 abstractC4985) throws zzaeh {
        if (abstractC4985 != null && !m10428(abstractC4985, true)) {
            throw new zzafy().m809();
        }
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        return C5430.f20370.m11073(getClass()).mo3036(this, (AbstractC4985) obj);
    }

    public final int hashCode() {
        if (m10433()) {
            return C5430.f20370.m11073(getClass()).mo3030(this);
        }
        int i = this.zza;
        if (i != 0) {
            return i;
        }
        int iMo3030 = C5430.f20370.m11073(getClass()).mo3030(this);
        this.zza = iMo3030;
        return iMo3030;
    }

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

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final void m10432() {
        this.zzb = (this.zzb & Integer.MIN_VALUE) | Integer.MAX_VALUE;
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final boolean m10433() {
        return (this.zzb & Integer.MIN_VALUE) != 0;
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final void m10434(AbstractC4357 abstractC4357) {
        InterfaceC1461 interfaceC1461M11073 = C5430.f20370.m11073(getClass());
        C2954 c2954 = abstractC4357.f16303;
        if (c2954 == null) {
            c2954 = new C2954(abstractC4357);
        }
        interfaceC1461M11073.mo3032(this, c2954);
    }

    @Override // defpackage.AbstractC1126
    /* renamed from: ˏᵙ */
    public final int mo3564(InterfaceC1461 interfaceC1461) {
        if (m10433()) {
            int iMo3029 = interfaceC1461.mo3029(this);
            if (iMo3029 >= 0) {
                return iMo3029;
            }
            C1499.m4429(String.valueOf(iMo3029).length() + 42, iMo3029);
            return 0;
        }
        int i = this.zzb & Integer.MAX_VALUE;
        if (i != Integer.MAX_VALUE) {
            return i;
        }
        int iMo30292 = interfaceC1461.mo3029(this);
        if (iMo30292 >= 0) {
            this.zzb = (this.zzb & Integer.MIN_VALUE) | iMo30292;
            return iMo30292;
        }
        C1499.m4429(String.valueOf(iMo30292).length() + 42, iMo30292);
        return 0;
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final AbstractC4985 m10435() {
        return (AbstractC4985) mo1179(4);
    }

    /* renamed from: ᵞʡ */
    public abstract Object mo1179(int i);

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final int m10436() {
        if (m10433()) {
            int iMo3029 = C5430.f20370.m11073(getClass()).mo3029(this);
            if (iMo3029 >= 0) {
                return iMo3029;
            }
            C1499.m4429(String.valueOf(iMo3029).length() + 42, iMo3029);
            return 0;
        }
        int i = this.zzb & Integer.MAX_VALUE;
        if (i != Integer.MAX_VALUE) {
            return i;
        }
        int iMo30292 = C5430.f20370.m11073(getClass()).mo3029(this);
        if (iMo30292 >= 0) {
            this.zzb = (this.zzb & Integer.MIN_VALUE) | iMo30292;
            return iMo30292;
        }
        C1499.m4429(String.valueOf(iMo30292).length() + 42, iMo30292);
        return 0;
    }

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final AbstractC5490 m10437() {
        return (AbstractC5490) mo1179(5);
    }

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final AbstractC5490 m10438() {
        AbstractC5490 abstractC5490 = (AbstractC5490) mo1179(5);
        abstractC5490.m11117(this);
        return abstractC5490;
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final void m10439() {
        this.zzb &= Integer.MAX_VALUE;
    }
}
