package defpackage;

import com.google.android.gms.internal.measurement.zzaeg;
import com.google.android.gms.internal.measurement.zzaeh;

/* JADX INFO: renamed from: ᵰʽᵝ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C4349 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public int f16538;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public int f16539;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public Object f16540;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final /* synthetic */ int f16541;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public int f16542;

    public /* synthetic */ C4349(byte b, int i) {
        this.f16541 = i;
    }

    public C4349(int i) {
        this.f16541 = 0;
        if (i < 1) {
            AbstractC3481.m7945("capacity must be >= 1");
            throw null;
        }
        if (i > 1073741824) {
            AbstractC3481.m7945("capacity must be <= 2^30");
            throw null;
        }
        i = Integer.bitCount(i) != 1 ? Integer.highestOneBit(i - 1) << 1 : i;
        this.f16542 = i - 1;
        this.f16540 = new Object[i];
    }

    public C4349(AbstractC5456 abstractC5456) {
        this.f16541 = 3;
        this.f16542 = 0;
        this.f16540 = abstractC5456;
        abstractC5456.f20658 = this;
    }

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public static final void m9338(int i) throws zzaeh {
        if ((i & 3) == 0) {
            return;
        }
        C1974.m5334("Failed to parse the message.");
    }

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public static final void m9339(int i) throws zzaeh {
        if ((i & 7) == 0) {
            return;
        }
        C1974.m5334("Failed to parse the message.");
    }

    public String toString() {
        switch (this.f16541) {
            case 2:
                return "NegotiatedProtocol{dialect=" + ((EnumC3519) this.f16540) + ", maxTransactSize=" + this.f16538 + ", maxReadSize=" + this.f16539 + ", maxWriteSize=" + this.f16542 + '}';
            default:
                return super.toString();
        }
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public void m9340(Object obj) {
        Object[] objArr = (Object[]) this.f16540;
        int i = this.f16539;
        objArr[i] = obj;
        int i2 = this.f16542 & (i + 1);
        this.f16539 = i2;
        if (i2 == this.f16538) {
            m9350();
        }
    }

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public void m9341(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        int i = this.f16538 & 7;
        if (i == 1) {
            do {
                interfaceC1603.add(Double.valueOf(abstractC5456.mo4134()));
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo4126 = abstractC5456.mo4126();
                }
            } while (iMo4126 == this.f16538);
            this.f16542 = iMo4126;
            return;
        }
        if (i != 2) {
            C1974.m5335();
            return;
        }
        int iMo4127 = abstractC5456.mo4127();
        m9339(iMo4127);
        int iMo4149 = abstractC5456.mo4149() + iMo4127;
        do {
            interfaceC1603.add(Double.valueOf(abstractC5456.mo4134()));
        } while (abstractC5456.mo4149() < iMo4149);
    }

    /* JADX INFO: renamed from: ˉᵲ, reason: contains not printable characters */
    public void m9342(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        int iMo41262;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        boolean z = interfaceC1603 instanceof C2383;
        int i = this.f16538;
        if (z) {
            C2383 c2383 = (C2383) interfaceC1603;
            int i2 = i & 7;
            if (i2 != 1) {
                if (i2 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo4127 = abstractC5456.mo4127();
                m9339(iMo4127);
                int iMo4149 = abstractC5456.mo4149() + iMo4127;
                do {
                    c2383.m6102(abstractC5456.mo4132());
                } while (abstractC5456.mo4149() < iMo4149);
                return;
            }
            do {
                c2383.m6102(abstractC5456.mo4132());
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo41262 = abstractC5456.mo4126();
                }
            } while (iMo41262 == this.f16538);
        } else {
            int i3 = i & 7;
            if (i3 != 1) {
                if (i3 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo41272 = abstractC5456.mo4127();
                m9339(iMo41272);
                int iMo41492 = abstractC5456.mo4149() + iMo41272;
                do {
                    interfaceC1603.add(Long.valueOf(abstractC5456.mo4132()));
                } while (abstractC5456.mo4149() < iMo41492);
                return;
            }
            do {
                interfaceC1603.add(Long.valueOf(abstractC5456.mo4132()));
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo4126 = abstractC5456.mo4126();
                }
            } while (iMo4126 == this.f16538);
            iMo41262 = iMo4126;
        }
        this.f16542 = iMo41262;
    }

    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public void m9343(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        int iMo41262;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        boolean z = interfaceC1603 instanceof C2383;
        int i = this.f16538;
        if (z) {
            C2383 c2383 = (C2383) interfaceC1603;
            int i2 = i & 7;
            if (i2 != 0) {
                if (i2 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo4149 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    c2383.m6102(abstractC5456.mo4140());
                } while (abstractC5456.mo4149() < iMo4149);
                m9366(iMo4149);
                return;
            }
            do {
                c2383.m6102(abstractC5456.mo4140());
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo41262 = abstractC5456.mo4126();
                }
            } while (iMo41262 == this.f16538);
        } else {
            int i3 = i & 7;
            if (i3 != 0) {
                if (i3 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo41492 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    interfaceC1603.add(Long.valueOf(abstractC5456.mo4140()));
                } while (abstractC5456.mo4149() < iMo41492);
                m9366(iMo41492);
                return;
            }
            do {
                interfaceC1603.add(Long.valueOf(abstractC5456.mo4140()));
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo4126 = abstractC5456.mo4126();
                }
            } while (iMo4126 == this.f16538);
            iMo41262 = iMo4126;
        }
        this.f16542 = iMo41262;
    }

    /* JADX INFO: renamed from: ˊᵙᵾᵲ, reason: contains not printable characters */
    public void m9344(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        int iMo41262;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        boolean z = interfaceC1603 instanceof C3201;
        int i = this.f16538;
        if (z) {
            C3201 c3201 = (C3201) interfaceC1603;
            int i2 = i & 7;
            if (i2 == 2) {
                int iMo4127 = abstractC5456.mo4127();
                m9338(iMo4127);
                int iMo4149 = abstractC5456.mo4149() + iMo4127;
                do {
                    c3201.m7338(abstractC5456.mo4121());
                } while (abstractC5456.mo4149() < iMo4149);
                return;
            }
            if (i2 != 5) {
                C1974.m5335();
                return;
            }
            do {
                c3201.m7338(abstractC5456.mo4121());
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo41262 = abstractC5456.mo4126();
                }
            } while (iMo41262 == this.f16538);
        } else {
            int i3 = i & 7;
            if (i3 == 2) {
                int iMo41272 = abstractC5456.mo4127();
                m9338(iMo41272);
                int iMo41492 = abstractC5456.mo4149() + iMo41272;
                do {
                    interfaceC1603.add(Integer.valueOf(abstractC5456.mo4121()));
                } while (abstractC5456.mo4149() < iMo41492);
                return;
            }
            if (i3 != 5) {
                C1974.m5335();
                return;
            }
            do {
                interfaceC1603.add(Integer.valueOf(abstractC5456.mo4121()));
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo4126 = abstractC5456.mo4126();
                }
            } while (iMo4126 == this.f16538);
            iMo41262 = iMo4126;
        }
        this.f16542 = iMo41262;
    }

    /* JADX INFO: renamed from: ˊᵨᵧ, reason: contains not printable characters */
    public void m9345(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        int iMo41262;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        boolean z = interfaceC1603 instanceof C2383;
        int i = this.f16538;
        if (z) {
            C2383 c2383 = (C2383) interfaceC1603;
            int i2 = i & 7;
            if (i2 != 0) {
                if (i2 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo4149 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    c2383.m6102(abstractC5456.mo4142());
                } while (abstractC5456.mo4149() < iMo4149);
                m9366(iMo4149);
                return;
            }
            do {
                c2383.m6102(abstractC5456.mo4142());
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo41262 = abstractC5456.mo4126();
                }
            } while (iMo41262 == this.f16538);
        } else {
            int i3 = i & 7;
            if (i3 != 0) {
                if (i3 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo41492 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    interfaceC1603.add(Long.valueOf(abstractC5456.mo4142()));
                } while (abstractC5456.mo4149() < iMo41492);
                m9366(iMo41492);
                return;
            }
            do {
                interfaceC1603.add(Long.valueOf(abstractC5456.mo4142()));
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo4126 = abstractC5456.mo4126();
                }
            } while (iMo4126 == this.f16538);
            iMo41262 = iMo4126;
        }
        this.f16542 = iMo41262;
    }

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public void m9346(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        int iMo41262;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        boolean z = interfaceC1603 instanceof C3201;
        int i = this.f16538;
        if (z) {
            C3201 c3201 = (C3201) interfaceC1603;
            int i2 = i & 7;
            if (i2 != 0) {
                if (i2 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo4149 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    c3201.m7338(abstractC5456.mo4150());
                } while (abstractC5456.mo4149() < iMo4149);
                m9366(iMo4149);
                return;
            }
            do {
                c3201.m7338(abstractC5456.mo4150());
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo41262 = abstractC5456.mo4126();
                }
            } while (iMo41262 == this.f16538);
        } else {
            int i3 = i & 7;
            if (i3 != 0) {
                if (i3 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo41492 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    interfaceC1603.add(Integer.valueOf(abstractC5456.mo4150()));
                } while (abstractC5456.mo4149() < iMo41492);
                m9366(iMo41492);
                return;
            }
            do {
                interfaceC1603.add(Integer.valueOf(abstractC5456.mo4150()));
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo4126 = abstractC5456.mo4126();
                }
            } while (iMo4126 == this.f16538);
            iMo41262 = iMo4126;
        }
        this.f16542 = iMo41262;
    }

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public void m9347(InterfaceC1603 interfaceC1603, InterfaceC0245 interfaceC0245, C1743 c1743) throws zzaeg {
        int iMo4126;
        int i = this.f16538;
        if ((i & 7) != 3) {
            C1974.m5335();
            return;
        }
        do {
            AbstractC4729 abstractC4729Mo1455 = interfaceC0245.mo1455();
            m9358(abstractC4729Mo1455, interfaceC0245, c1743);
            interfaceC0245.mo1450(abstractC4729Mo1455);
            interfaceC1603.add(abstractC4729Mo1455);
            AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
            if (abstractC5456.mo4151() || this.f16542 != 0) {
                return;
            } else {
                iMo4126 = abstractC5456.mo4126();
            }
        } while (iMo4126 == i);
        this.f16542 = iMo4126;
    }

    /* JADX WARN: Code restructure failed: missing block: B:39:0x007e, code lost:
    
        r12.put(r4, r5);
     */
    /* JADX WARN: Code restructure failed: missing block: B:40:0x0081, code lost:
    
        r1.mo4131(r2);
     */
    /* JADX WARN: Code restructure failed: missing block: B:41:0x0084, code lost:
    
        return;
     */
    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void m9348(C0686 c0686, C5398 c5398, C1743 c1743) throws zzaeg {
        int i;
        int i2;
        m9353(2);
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        int iMo4153 = abstractC5456.mo4153(abstractC5456.mo4127());
        Object obj = c5398.f20485;
        Object objM9361 = "";
        Object objM93612 = obj;
        while (true) {
            try {
                int iM9369 = m9369();
                if (iM9369 == Integer.MAX_VALUE || abstractC5456.mo4151()) {
                    break;
                }
                boolean zMo4130 = false;
                if (iM9369 == 1) {
                    objM9361 = m9361((EnumC1856) c5398.f20484, null, null);
                } else if (iM9369 != 2) {
                    try {
                        if (!((abstractC5456.mo4151() || (i2 = this.f16538) == this.f16539) ? false : abstractC5456.mo4130(i2))) {
                            throw new zzaeh("Unable to parse map entry.");
                        }
                    } catch (zzaeg e) {
                        if (!abstractC5456.mo4151() && (i = this.f16538) != this.f16539) {
                            zMo4130 = abstractC5456.mo4130(i);
                        }
                        if (!zMo4130) {
                            throw new zzaeh("Unable to parse map entry.", e);
                        }
                    }
                } else {
                    objM93612 = m9361((EnumC1856) c5398.f20483, obj.getClass(), c1743);
                }
            } catch (Throwable th) {
                abstractC5456.mo4131(iMo4153);
                throw th;
            }
        }
    }

    /* JADX INFO: renamed from: ˏːˆ, reason: contains not printable characters */
    public void m9349(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        int iMo41262;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        boolean z = interfaceC1603 instanceof C3201;
        int i = this.f16538;
        if (z) {
            C3201 c3201 = (C3201) interfaceC1603;
            int i2 = i & 7;
            if (i2 != 0) {
                if (i2 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo4149 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    c3201.m7338(abstractC5456.mo4129());
                } while (abstractC5456.mo4149() < iMo4149);
                m9366(iMo4149);
                return;
            }
            do {
                c3201.m7338(abstractC5456.mo4129());
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo41262 = abstractC5456.mo4126();
                }
            } while (iMo41262 == this.f16538);
        } else {
            int i3 = i & 7;
            if (i3 != 0) {
                if (i3 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo41492 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    interfaceC1603.add(Integer.valueOf(abstractC5456.mo4129()));
                } while (abstractC5456.mo4149() < iMo41492);
                m9366(iMo41492);
                return;
            }
            do {
                interfaceC1603.add(Integer.valueOf(abstractC5456.mo4129()));
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo4126 = abstractC5456.mo4126();
                }
            } while (iMo4126 == this.f16538);
            iMo41262 = iMo4126;
        }
        this.f16542 = iMo41262;
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public void m9350() {
        Object[] objArr = (Object[]) this.f16540;
        int length = objArr.length;
        int i = this.f16538;
        int i2 = length - i;
        int i3 = length << 1;
        if (i3 < 0) {
            C4935.m10237("Max array capacity exceeded");
            return;
        }
        Object[] objArr2 = new Object[i3];
        AbstractC3761.m8436(0, i, length, objArr, objArr2);
        AbstractC3761.m8436(i2, 0, this.f16538, (Object[]) this.f16540, objArr2);
        this.f16540 = objArr2;
        this.f16538 = 0;
        this.f16539 = length;
        this.f16542 = i3 - 1;
    }

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public AbstractC4667 m9351() throws zzaeg {
        m9353(2);
        return ((AbstractC5456) this.f16540).mo4119();
    }

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public void m9352(Object obj, InterfaceC0245 interfaceC0245, C1743 c1743) throws zzaeh {
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        int iMo4127 = abstractC5456.mo4127();
        if (abstractC5456.f20657 + abstractC5456.f20659 >= 100) {
            C1974.m5334("Protocol message had too many levels of nesting.  May be malicious.  Use setRecursionLimit() to increase the recursion depth limit.");
            return;
        }
        int iMo4153 = abstractC5456.mo4153(iMo4127);
        abstractC5456.f20657++;
        interfaceC0245.mo1458(obj, this, c1743);
        abstractC5456.mo4136(0);
        abstractC5456.f20657--;
        abstractC5456.mo4131(iMo4153);
    }

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public void m9353(int i) throws zzaeg {
        if ((this.f16538 & 7) == i) {
            return;
        }
        C1974.m5335();
    }

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public void m9354(InterfaceC1603 interfaceC1603, InterfaceC0245 interfaceC0245, C1743 c1743) throws zzaeh {
        int iMo4126;
        int i = this.f16538;
        if ((i & 7) != 2) {
            C1974.m5335();
            return;
        }
        do {
            AbstractC4729 abstractC4729Mo1455 = interfaceC0245.mo1455();
            m9352(abstractC4729Mo1455, interfaceC0245, c1743);
            interfaceC0245.mo1450(abstractC4729Mo1455);
            interfaceC1603.add(abstractC4729Mo1455);
            AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
            if (abstractC5456.mo4151() || this.f16542 != 0) {
                return;
            } else {
                iMo4126 = abstractC5456.mo4126();
            }
        } while (iMo4126 == i);
        this.f16542 = iMo4126;
    }

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public void m9355(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        int iMo41262;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        boolean z = interfaceC1603 instanceof C3201;
        int i = this.f16538;
        if (z) {
            C3201 c3201 = (C3201) interfaceC1603;
            int i2 = i & 7;
            if (i2 != 0) {
                if (i2 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo4149 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    c3201.m7338(abstractC5456.mo4127());
                } while (abstractC5456.mo4149() < iMo4149);
                m9366(iMo4149);
                return;
            }
            do {
                c3201.m7338(abstractC5456.mo4127());
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo41262 = abstractC5456.mo4126();
                }
            } while (iMo41262 == this.f16538);
        } else {
            int i3 = i & 7;
            if (i3 != 0) {
                if (i3 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo41492 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    interfaceC1603.add(Integer.valueOf(abstractC5456.mo4127()));
                } while (abstractC5456.mo4149() < iMo41492);
                m9366(iMo41492);
                return;
            }
            do {
                interfaceC1603.add(Integer.valueOf(abstractC5456.mo4127()));
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo4126 = abstractC5456.mo4126();
                }
            } while (iMo4126 == this.f16538);
            iMo41262 = iMo4126;
        }
        this.f16542 = iMo41262;
    }

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public void m9356(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        int i = this.f16538 & 7;
        if (i == 2) {
            int iMo4127 = abstractC5456.mo4127();
            m9338(iMo4127);
            int iMo4149 = abstractC5456.mo4149() + iMo4127;
            do {
                interfaceC1603.add(Float.valueOf(abstractC5456.mo4143()));
            } while (abstractC5456.mo4149() < iMo4149);
            return;
        }
        if (i != 5) {
            C1974.m5335();
            return;
        }
        do {
            interfaceC1603.add(Float.valueOf(abstractC5456.mo4143()));
            if (abstractC5456.mo4151()) {
                return;
            } else {
                iMo4126 = abstractC5456.mo4126();
            }
        } while (iMo4126 == this.f16538);
        this.f16542 = iMo4126;
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public void m9357(int i) {
        if (i <= 0) {
            return;
        }
        if (i > m9371()) {
            throw new ArrayIndexOutOfBoundsException();
        }
        int length = ((Object[]) this.f16540).length;
        int i2 = this.f16538;
        if (i < length - i2) {
            length = i2 + i;
        }
        while (i2 < length) {
            ((Object[]) this.f16540)[i2] = null;
            i2++;
        }
        int i3 = this.f16538;
        int i4 = length - i3;
        int i5 = i - i4;
        this.f16538 = this.f16542 & (i3 + i4);
        if (i5 > 0) {
            for (int i6 = 0; i6 < i5; i6++) {
                ((Object[]) this.f16540)[i6] = null;
            }
            this.f16538 = i5;
        }
    }

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public void m9358(Object obj, InterfaceC0245 interfaceC0245, C1743 c1743) {
        int i = this.f16539;
        this.f16539 = ((this.f16538 >>> 3) << 3) | 4;
        try {
            interfaceC0245.mo1458(obj, this, c1743);
            if (this.f16538 == this.f16539) {
            } else {
                throw new zzaeh("Failed to parse the message.");
            }
        } finally {
            this.f16539 = i;
        }
    }

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public void m9359(InterfaceC1603 interfaceC1603) throws zzaeg {
        int iMo4126;
        if ((this.f16538 & 7) != 2) {
            C1974.m5335();
            return;
        }
        do {
            interfaceC1603.add(m9351());
            AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
            if (abstractC5456.mo4151()) {
                return;
            } else {
                iMo4126 = abstractC5456.mo4126();
            }
        } while (iMo4126 == this.f16538);
        this.f16542 = iMo4126;
    }

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public void m9360(InterfaceC1603 interfaceC1603, boolean z) throws zzaeg {
        String strMo4155;
        int iMo4126;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        if ((this.f16538 & 7) != 2) {
            C1974.m5335();
            return;
        }
        do {
            if (z) {
                m9353(2);
                strMo4155 = abstractC5456.mo4139();
            } else {
                m9353(2);
                strMo4155 = abstractC5456.mo4155();
            }
            interfaceC1603.add(strMo4155);
            if (abstractC5456.mo4151()) {
                return;
            } else {
                iMo4126 = abstractC5456.mo4126();
            }
        } while (iMo4126 == this.f16538);
        this.f16542 = iMo4126;
    }

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public Object m9361(EnumC1856 enumC1856, Class cls, C1743 c1743) throws zzaeh {
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        EnumC1856 enumC18562 = EnumC1856.f7333;
        switch (enumC1856.ordinal()) {
            case 0:
                m9353(1);
                return Double.valueOf(abstractC5456.mo4134());
            case 1:
                m9353(5);
                return Float.valueOf(abstractC5456.mo4143());
            case 2:
                m9353(0);
                return Long.valueOf(abstractC5456.mo4148());
            case 3:
                m9353(0);
                return Long.valueOf(abstractC5456.mo4140());
            case 4:
                m9353(0);
                return Integer.valueOf(abstractC5456.mo4150());
            case 5:
                m9353(1);
                return Long.valueOf(abstractC5456.mo4154());
            case C5224.STRING_SET_FIELD_NUMBER /* 6 */:
                m9353(5);
                return Integer.valueOf(abstractC5456.mo4124());
            case C5224.DOUBLE_FIELD_NUMBER /* 7 */:
                m9353(0);
                return Boolean.valueOf(abstractC5456.mo4135());
            case C5224.BYTES_FIELD_NUMBER /* 8 */:
                m9353(2);
                return abstractC5456.mo4139();
            case 9:
            default:
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("unsupported field type.");
                return null;
            case 10:
                m9353(2);
                InterfaceC0245 interfaceC0245M8590 = C3884.f14820.m8590(cls);
                AbstractC4729 abstractC4729Mo1455 = interfaceC0245M8590.mo1455();
                m9352(abstractC4729Mo1455, interfaceC0245M8590, c1743);
                interfaceC0245M8590.mo1450(abstractC4729Mo1455);
                return abstractC4729Mo1455;
            case 11:
                return m9351();
            case 12:
                m9353(0);
                return Integer.valueOf(abstractC5456.mo4127());
            case 13:
                m9353(0);
                return Integer.valueOf(abstractC5456.mo4123());
            case 14:
                m9353(5);
                return Integer.valueOf(abstractC5456.mo4121());
            case 15:
                m9353(1);
                return Long.valueOf(abstractC5456.mo4132());
            case 16:
                m9353(0);
                return Integer.valueOf(abstractC5456.mo4129());
            case 17:
                m9353(0);
                return Long.valueOf(abstractC5456.mo4142());
        }
    }

    /* JADX INFO: renamed from: ᵱʡˏ, reason: contains not printable characters */
    public void m9362(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        int iMo41262;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        boolean z = interfaceC1603 instanceof C3201;
        int i = this.f16538;
        if (z) {
            C3201 c3201 = (C3201) interfaceC1603;
            int i2 = i & 7;
            if (i2 != 0) {
                if (i2 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo4149 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    c3201.m7338(abstractC5456.mo4123());
                } while (abstractC5456.mo4149() < iMo4149);
                m9366(iMo4149);
                return;
            }
            do {
                c3201.m7338(abstractC5456.mo4123());
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo41262 = abstractC5456.mo4126();
                }
            } while (iMo41262 == this.f16538);
        } else {
            int i3 = i & 7;
            if (i3 != 0) {
                if (i3 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo41492 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    interfaceC1603.add(Integer.valueOf(abstractC5456.mo4123()));
                } while (abstractC5456.mo4149() < iMo41492);
                m9366(iMo41492);
                return;
            }
            do {
                interfaceC1603.add(Integer.valueOf(abstractC5456.mo4123()));
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo4126 = abstractC5456.mo4126();
                }
            } while (iMo4126 == this.f16538);
            iMo41262 = iMo4126;
        }
        this.f16542 = iMo41262;
    }

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public void m9363(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        int iMo41262;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        boolean z = interfaceC1603 instanceof C3201;
        int i = this.f16538;
        if (z) {
            C3201 c3201 = (C3201) interfaceC1603;
            int i2 = i & 7;
            if (i2 == 2) {
                int iMo4127 = abstractC5456.mo4127();
                m9338(iMo4127);
                int iMo4149 = abstractC5456.mo4149() + iMo4127;
                do {
                    c3201.m7338(abstractC5456.mo4124());
                } while (abstractC5456.mo4149() < iMo4149);
                return;
            }
            if (i2 != 5) {
                C1974.m5335();
                return;
            }
            do {
                c3201.m7338(abstractC5456.mo4124());
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo41262 = abstractC5456.mo4126();
                }
            } while (iMo41262 == this.f16538);
        } else {
            int i3 = i & 7;
            if (i3 == 2) {
                int iMo41272 = abstractC5456.mo4127();
                m9338(iMo41272);
                int iMo41492 = abstractC5456.mo4149() + iMo41272;
                do {
                    interfaceC1603.add(Integer.valueOf(abstractC5456.mo4124()));
                } while (abstractC5456.mo4149() < iMo41492);
                return;
            }
            if (i3 != 5) {
                C1974.m5335();
                return;
            }
            do {
                interfaceC1603.add(Integer.valueOf(abstractC5456.mo4124()));
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo4126 = abstractC5456.mo4126();
                }
            } while (iMo4126 == this.f16538);
            iMo41262 = iMo4126;
        }
        this.f16542 = iMo41262;
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public void m9364(C4088 c4088) {
        c4088.f15681 = null;
        c4088.f15679 = null;
        c4088.f15682 = null;
        c4088.f15686 = 1;
        int i = this.f16538;
        if (i > 0) {
            int i2 = this.f16542;
            if ((i2 & 1) == 0) {
                this.f16542 = i2 + 1;
                this.f16538 = i - 1;
                this.f16539++;
            }
        }
        c4088.f15679 = (C4088) this.f16540;
        this.f16540 = c4088;
        int i3 = this.f16542;
        int i4 = i3 + 1;
        this.f16542 = i4;
        int i5 = this.f16538;
        if (i5 > 0 && (i4 & 1) == 0) {
            this.f16542 = i3 + 2;
            this.f16538 = i5 - 1;
            this.f16539++;
        }
        int i6 = 4;
        while (true) {
            int i7 = i6 - 1;
            if ((this.f16542 & i7) != i7) {
                return;
            }
            int i8 = this.f16539;
            if (i8 == 0) {
                C4088 c40882 = (C4088) this.f16540;
                C4088 c40883 = c40882.f15679;
                C4088 c40884 = c40883.f15679;
                c40883.f15679 = c40884.f15679;
                this.f16540 = c40883;
                c40883.f15682 = c40884;
                c40883.f15681 = c40882;
                c40883.f15686 = c40882.f15686 + 1;
                c40884.f15679 = c40883;
                c40882.f15679 = c40883;
            } else if (i8 == 1) {
                C4088 c40885 = (C4088) this.f16540;
                C4088 c40886 = c40885.f15679;
                this.f16540 = c40886;
                c40886.f15681 = c40885;
                c40886.f15686 = c40885.f15686 + 1;
                c40885.f15679 = c40886;
                this.f16539 = 0;
            } else if (i8 == 2) {
                this.f16539 = 0;
            }
            i6 *= 2;
        }
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public void m9365(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        int iMo41262;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        boolean z = interfaceC1603 instanceof C2383;
        int i = this.f16538;
        if (z) {
            C2383 c2383 = (C2383) interfaceC1603;
            int i2 = i & 7;
            if (i2 != 0) {
                if (i2 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo4149 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    c2383.m6102(abstractC5456.mo4148());
                } while (abstractC5456.mo4149() < iMo4149);
                m9366(iMo4149);
                return;
            }
            do {
                c2383.m6102(abstractC5456.mo4148());
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo41262 = abstractC5456.mo4126();
                }
            } while (iMo41262 == this.f16538);
        } else {
            int i3 = i & 7;
            if (i3 != 0) {
                if (i3 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo41492 = abstractC5456.mo4149() + abstractC5456.mo4127();
                do {
                    interfaceC1603.add(Long.valueOf(abstractC5456.mo4148()));
                } while (abstractC5456.mo4149() < iMo41492);
                m9366(iMo41492);
                return;
            }
            do {
                interfaceC1603.add(Long.valueOf(abstractC5456.mo4148()));
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo4126 = abstractC5456.mo4126();
                }
            } while (iMo4126 == this.f16538);
            iMo41262 = iMo4126;
        }
        this.f16542 = iMo41262;
    }

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public void m9366(int i) throws zzaeh {
        if (((AbstractC5456) this.f16540).mo4149() == i) {
            return;
        }
        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.");
    }

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public void m9367(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        int i = this.f16538 & 7;
        if (i == 0) {
            do {
                interfaceC1603.add(Boolean.valueOf(abstractC5456.mo4135()));
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo4126 = abstractC5456.mo4126();
                }
            } while (iMo4126 == this.f16538);
            this.f16542 = iMo4126;
            return;
        }
        if (i != 2) {
            C1974.m5335();
            return;
        }
        int iMo4149 = abstractC5456.mo4149() + abstractC5456.mo4127();
        do {
            interfaceC1603.add(Boolean.valueOf(abstractC5456.mo4135()));
        } while (abstractC5456.mo4149() < iMo4149);
        m9366(iMo4149);
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public void m9368(int i) {
        if (i <= 0) {
            return;
        }
        if (i > m9371()) {
            throw new ArrayIndexOutOfBoundsException();
        }
        int i2 = this.f16539;
        int i3 = i < i2 ? i2 - i : 0;
        for (int i4 = i3; i4 < i2; i4++) {
            ((Object[]) this.f16540)[i4] = null;
        }
        int i5 = this.f16539;
        int i6 = i5 - i3;
        int i7 = i - i6;
        this.f16539 = i5 - i6;
        if (i7 > 0) {
            int length = ((Object[]) this.f16540).length;
            this.f16539 = length;
            int i8 = length - i7;
            for (int i9 = i8; i9 < length; i9++) {
                ((Object[]) this.f16540)[i9] = null;
            }
            this.f16539 = i8;
        }
    }

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public int m9369() {
        int iMo4126 = this.f16542;
        if (iMo4126 != 0) {
            this.f16538 = iMo4126;
            this.f16542 = 0;
        } else {
            iMo4126 = ((AbstractC5456) this.f16540).mo4126();
            this.f16538 = iMo4126;
        }
        if (iMo4126 == 0 || iMo4126 == this.f16539) {
            return Integer.MAX_VALUE;
        }
        return iMo4126 >>> 3;
    }

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public void m9370(InterfaceC1603 interfaceC1603) throws zzaeh {
        int iMo4126;
        int iMo41262;
        AbstractC5456 abstractC5456 = (AbstractC5456) this.f16540;
        boolean z = interfaceC1603 instanceof C2383;
        int i = this.f16538;
        if (z) {
            C2383 c2383 = (C2383) interfaceC1603;
            int i2 = i & 7;
            if (i2 != 1) {
                if (i2 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo4127 = abstractC5456.mo4127();
                m9339(iMo4127);
                int iMo4149 = abstractC5456.mo4149() + iMo4127;
                do {
                    c2383.m6102(abstractC5456.mo4154());
                } while (abstractC5456.mo4149() < iMo4149);
                return;
            }
            do {
                c2383.m6102(abstractC5456.mo4154());
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo41262 = abstractC5456.mo4126();
                }
            } while (iMo41262 == this.f16538);
        } else {
            int i3 = i & 7;
            if (i3 != 1) {
                if (i3 != 2) {
                    C1974.m5335();
                    return;
                }
                int iMo41272 = abstractC5456.mo4127();
                m9339(iMo41272);
                int iMo41492 = abstractC5456.mo4149() + iMo41272;
                do {
                    interfaceC1603.add(Long.valueOf(abstractC5456.mo4154()));
                } while (abstractC5456.mo4149() < iMo41492);
                return;
            }
            do {
                interfaceC1603.add(Long.valueOf(abstractC5456.mo4154()));
                if (abstractC5456.mo4151()) {
                    return;
                } else {
                    iMo4126 = abstractC5456.mo4126();
                }
            } while (iMo4126 == this.f16538);
            iMo41262 = iMo4126;
        }
        this.f16542 = iMo41262;
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public int m9371() {
        return this.f16542 & (this.f16539 - this.f16538);
    }
}
