package androidx.datastore.preferences.protobuf;

/* JADX INFO: loaded from: classes.dex */
public abstract class g1 {
    public abstract h1 a(Object obj);

    public abstract void b(Object obj);

    public final boolean c(int i10, y0 y0Var, Object obj) throws InvalidProtocolBufferException {
        l lVar = (l) y0Var;
        int i11 = lVar.f2107b;
        int i12 = i11 >>> 3;
        int i13 = i11 & 7;
        if (i13 == 0) {
            lVar.w(0);
            ((h1) obj).c(i12 << 3, Long.valueOf(lVar.f2106a.n()));
            return true;
        }
        if (i13 == 1) {
            lVar.w(1);
            ((h1) obj).c((i12 << 3) | 1, Long.valueOf(lVar.f2106a.k()));
            return true;
        }
        if (i13 == 2) {
            ((h1) obj).c((i12 << 3) | 2, lVar.e());
            return true;
        }
        if (i13 != 3) {
            if (i13 == 4) {
                return false;
            }
            if (i13 != 5) {
                throw InvalidProtocolBufferException.c();
            }
            lVar.w(5);
            ((h1) obj).c(5 | (i12 << 3), Integer.valueOf(lVar.f2106a.j()));
            return true;
        }
        h1 h1Var = new h1(0, new int[8], new Object[8], true);
        int i14 = i12 << 3;
        int i15 = i14 | 4;
        int i16 = i10 + 1;
        if (i16 >= 100) {
            throw new InvalidProtocolBufferException("Protocol message had too many levels of nesting.  May be malicious.  Use setRecursionLimit() to increase the recursion depth limit.");
        }
        while (lVar.a() != Integer.MAX_VALUE && c(i16, lVar, h1Var)) {
        }
        if (i15 != lVar.f2107b) {
            throw new InvalidProtocolBufferException("Protocol message end-group tag did not match expected tag.");
        }
        if (h1Var.f2080e) {
            h1Var.f2080e = false;
        }
        ((h1) obj).c(i14 | 3, h1Var);
        return true;
    }
}
