package androidx.datastore.preferences.protobuf;

/* JADX INFO: loaded from: classes.dex */
public final class c0 {
    public static b0 a(Object obj) {
        AbstractC0442u abstractC0442u = (AbstractC0442u) obj;
        b0 b0Var = abstractC0442u.unknownFields;
        if (b0Var != b0.f8053f) {
            return b0Var;
        }
        b0 b0Var2 = new b0(0, new int[8], new Object[8], true);
        abstractC0442u.unknownFields = b0Var2;
        return b0Var2;
    }

    public static boolean b(int i, C0432j c0432j, Object obj) throws C0446y, com.google.crypto.tink.shaded.protobuf.A {
        int i5 = c0432j.f8096b;
        int i8 = i5 >>> 3;
        int i9 = i5 & 7;
        J3.e eVar = (J3.e) c0432j.f8099e;
        if (i9 == 0) {
            c0432j.W(0);
            ((b0) obj).c(i8 << 3, Long.valueOf(eVar.v()));
            return true;
        }
        if (i9 == 1) {
            c0432j.W(1);
            ((b0) obj).c((i8 << 3) | 1, Long.valueOf(eVar.s()));
            return true;
        }
        if (i9 == 2) {
            ((b0) obj).c((i8 << 3) | 2, c0432j.l());
            return true;
        }
        if (i9 != 3) {
            if (i9 == 4) {
                return false;
            }
            if (i9 != 5) {
                throw C0446y.b();
            }
            c0432j.W(5);
            ((b0) obj).c(5 | (i8 << 3), Integer.valueOf(eVar.r()));
            return true;
        }
        b0 b0Var = new b0(0, new int[8], new Object[8], true);
        int i10 = i8 << 3;
        int i11 = i10 | 4;
        int i12 = i + 1;
        if (i12 >= 100) {
            throw new C0446y("Protocol message had too many levels of nesting.  May be malicious.  Use setRecursionLimit() to increase the recursion depth limit.");
        }
        while (c0432j.e() != Integer.MAX_VALUE && b(i12, c0432j, b0Var)) {
        }
        if (i11 != c0432j.f8096b) {
            throw new C0446y("Protocol message end-group tag did not match expected tag.");
        }
        if (b0Var.f8058e) {
            b0Var.f8058e = false;
        }
        ((b0) obj).c(i10 | 3, b0Var);
        return true;
    }
}
