package androidx.datastore.preferences.protobuf;

import java.util.Map;

/* JADX INFO: loaded from: classes.dex */
public final class k0 {
    public static int a(int i10, Object obj, Object obj2) {
        MapFieldLite mapFieldLite = (MapFieldLite) obj;
        j0 j0Var = (j0) obj2;
        int iA = 0;
        if (!mapFieldLite.isEmpty()) {
            for (Map.Entry entry : mapFieldLite.entrySet()) {
                Object key = entry.getKey();
                Object value = entry.getValue();
                j0Var.getClass();
                int iY = n.y(i10);
                int iA2 = j0.a(j0Var.f2098a, key, value);
                iA += n.A(iA2) + iA2 + iY;
            }
        }
        return iA;
    }

    public static MapFieldLite b(Object obj, Object obj2) {
        MapFieldLite mapFieldLiteE = (MapFieldLite) obj;
        MapFieldLite mapFieldLite = (MapFieldLite) obj2;
        if (!mapFieldLite.isEmpty()) {
            if (!mapFieldLiteE.b()) {
                mapFieldLiteE = mapFieldLiteE.e();
            }
            mapFieldLiteE.a();
            if (!mapFieldLite.isEmpty()) {
                mapFieldLiteE.putAll(mapFieldLite);
            }
        }
        return mapFieldLiteE;
    }

    public static void c(Object obj) {
        ((MapFieldLite) obj).d();
    }
}
