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;

/* JADX INFO: renamed from: ᵵـﹶˌ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC4729 extends AbstractC3365 {
    public static final /* synthetic */ int zzd = 0;
    private static final Map zze = new ConcurrentHashMap();
    private int zzb;
    protected C0882 zzc;

    public AbstractC4729() {
        this.zza = 0;
        this.zzb = -1;
        this.zzc = C0882.f3893;
    }

    /* JADX INFO: renamed from: ˊᵙᵾᵲ, reason: contains not printable characters */
    public static void m9873(AbstractC4729 abstractC4729) throws zzaeh {
        if (abstractC4729 != null && !m9878(abstractC4729, true)) {
            throw new zzafy().m810();
        }
    }

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public static AbstractC4729 m9874(Class cls) {
        Map map = zze;
        AbstractC4729 abstractC4729 = (AbstractC4729) map.get(cls);
        if (abstractC4729 == null) {
            try {
                Class.forName(cls.getName(), true, cls.getClassLoader());
                abstractC4729 = (AbstractC4729) map.get(cls);
            } catch (ClassNotFoundException e) {
                C4935.m10239("Class initialization cannot fail.", e);
                return null;
            }
        }
        if (abstractC4729 != null) {
            return abstractC4729;
        }
        AbstractC4729 abstractC47292 = (AbstractC4729) ((AbstractC4729) AbstractC4609.m9718(cls)).mo1186(6);
        if (abstractC47292 != null) {
            map.put(cls, abstractC47292);
            return abstractC47292;
        }
        ᵷᵝˎ.ᵱʡˏ();
        return null;
    }

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public static Object m9875(Method method, AbstractC4729 abstractC4729, Object... objArr) {
        try {
            return method.invoke(abstractC4729, 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 AbstractC4729 m9876(AbstractC4729 abstractC4729, byte[] bArr, C1743 c1743) throws zzaeh {
        int length = bArr.length;
        if (length != 0) {
            AbstractC4729 abstractC4729M9885 = abstractC4729.m9885();
            try {
                InterfaceC0245 interfaceC0245M8590 = C3884.f14820.m8590(abstractC4729M9885.getClass());
                interfaceC0245M8590.mo1456(abstractC4729M9885, bArr, 0, length, new C4449(c1743));
                interfaceC0245M8590.mo1450(abstractC4729M9885);
                abstractC4729 = abstractC4729M9885;
            } catch (zzaeh e) {
                if (e.f1025) {
                    throw new zzaeh(e.getMessage(), e);
                }
                throw e;
            } catch (zzafy e2) {
                throw e2.m810();
            } catch (IOException e3) {
                if (e3.getCause() instanceof zzaeh) {
                    throw ((zzaeh) e3.getCause());
                }
                throw new zzaeh(e3.getMessage(), e3);
            } catch (IndexOutOfBoundsException unused) {
                C1974.m5334("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;
            }
        }
        m9873(abstractC4729);
        return abstractC4729;
    }

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public static void m9877(Class cls, AbstractC4729 abstractC4729) {
        abstractC4729.m9879();
        zze.put(cls, abstractC4729);
    }

    /* JADX INFO: renamed from: ᵱʡˏ, reason: contains not printable characters */
    public static final boolean m9878(AbstractC4729 abstractC4729, boolean z) {
        byte bByteValue = ((Byte) abstractC4729.mo1186(1)).byteValue();
        if (bByteValue == 1) {
            return true;
        }
        if (bByteValue == 0) {
            return false;
        }
        boolean zMo1453 = C3884.f14820.m8590(abstractC4729.getClass()).mo1453(abstractC4729);
        if (z) {
            abstractC4729.mo1186(2);
        }
        return zMo1453;
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        return C3884.f14820.m8590(getClass()).mo1454(this, (AbstractC4729) obj);
    }

    public final int hashCode() {
        if (m9883()) {
            return C3884.f14820.m8590(getClass()).mo1459(this);
        }
        int i = this.zza;
        if (i != 0) {
            return i;
        }
        int iMo1459 = C3884.f14820.m8590(getClass()).mo1459(this);
        this.zza = iMo1459;
        return iMo1459;
    }

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

    /* JADX INFO: renamed from: ˉᵲ */
    public abstract Object mo1186(int i);

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public final void m9879() {
        this.zzb &= Integer.MAX_VALUE;
    }

    @Override // defpackage.AbstractC3365
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final int mo7713(InterfaceC0245 interfaceC0245) {
        if (m9883()) {
            int iMo1457 = interfaceC0245.mo1457(this);
            if (iMo1457 >= 0) {
                return iMo1457;
            }
            C1974.m5332(String.valueOf(iMo1457).length() + 42, iMo1457);
            return 0;
        }
        int i = this.zzb & Integer.MAX_VALUE;
        if (i != Integer.MAX_VALUE) {
            return i;
        }
        int iMo14572 = interfaceC0245.mo1457(this);
        if (iMo14572 >= 0) {
            this.zzb = (this.zzb & Integer.MIN_VALUE) | iMo14572;
            return iMo14572;
        }
        C1974.m5332(String.valueOf(iMo14572).length() + 42, iMo14572);
        return 0;
    }

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public final int m9880() {
        if (m9883()) {
            int iMo1457 = C3884.f14820.m8590(getClass()).mo1457(this);
            if (iMo1457 >= 0) {
                return iMo1457;
            }
            C1974.m5332(String.valueOf(iMo1457).length() + 42, iMo1457);
            return 0;
        }
        int i = this.zzb & Integer.MAX_VALUE;
        if (i != Integer.MAX_VALUE) {
            return i;
        }
        int iMo14572 = C3884.f14820.m8590(getClass()).mo1457(this);
        if (iMo14572 >= 0) {
            this.zzb = (this.zzb & Integer.MIN_VALUE) | iMo14572;
            return iMo14572;
        }
        C1974.m5332(String.valueOf(iMo14572).length() + 42, iMo14572);
        return 0;
    }

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public final void m9881() {
        this.zzb = (this.zzb & Integer.MIN_VALUE) | Integer.MAX_VALUE;
    }

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public final AbstractC4714 m9882() {
        return (AbstractC4714) mo1186(5);
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final boolean m9883() {
        return (this.zzb & Integer.MIN_VALUE) != 0;
    }

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public final AbstractC4714 m9884() {
        AbstractC4714 abstractC4714 = (AbstractC4714) mo1186(5);
        abstractC4714.m9867(this);
        return abstractC4714;
    }

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public final AbstractC4729 m9885() {
        return (AbstractC4729) mo1186(4);
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public final void m9886(AbstractC0857 abstractC0857) {
        InterfaceC0245 interfaceC0245M8590 = C3884.f14820.m8590(getClass());
        ᵷˇ r1 = abstractC0857.f3799;
        if (r1 == null) {
            r1 = new ᵷˇ(abstractC0857);
        }
        interfaceC0245M8590.mo1451(this, r1);
    }
}
