package o;

import java.util.Arrays;
import java.util.List;
import java.util.logging.Logger;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public abstract class L40 {
    public static final Class a;
    public static final Qh0 b;
    public static final Qh0 c;

    static {
        Class<?> cls;
        Class<?> cls2;
        C2530tZ c2530tZ = C2530tZ.c;
        Qh0 qh0 = null;
        try {
            cls = Class.forName("androidx.datastore.preferences.protobuf.GeneratedMessage");
        } catch (Throwable unused) {
            cls = null;
        }
        a = cls;
        try {
            C2530tZ c2530tZ2 = C2530tZ.c;
            try {
                cls2 = Class.forName("androidx.datastore.preferences.protobuf.UnknownFieldSetSchema");
            } catch (Throwable unused2) {
                cls2 = null;
            }
            if (cls2 != null) {
                qh0 = (Qh0) cls2.getConstructor(null).newInstance(null);
            }
        } catch (Throwable unused3) {
        }
        b = qh0;
        c = new Qh0();
    }

    public static int a(List list) {
        int size = list.size();
        if (size == 0) {
            return 0;
        }
        int iP = 0;
        for (int i = 0; i < size; i++) {
            iP += C2832wi.P(((Integer) list.get(i)).intValue());
        }
        return iP;
    }

    public static int b(int i, List list) {
        int size = list.size();
        if (size == 0) {
            return 0;
        }
        return (C2832wi.N(i) + 4) * size;
    }

    public static int c(int i, List list) {
        int size = list.size();
        if (size == 0) {
            return 0;
        }
        return (C2832wi.N(i) + 8) * size;
    }

    public static int d(List list) {
        int size = list.size();
        if (size == 0) {
            return 0;
        }
        int iP = 0;
        for (int i = 0; i < size; i++) {
            iP += C2832wi.P(((Integer) list.get(i)).intValue());
        }
        return iP;
    }

    public static int e(List list) {
        int size = list.size();
        if (size == 0) {
            return 0;
        }
        int iP = 0;
        for (int i = 0; i < size; i++) {
            iP += C2832wi.P(((Long) list.get(i)).longValue());
        }
        return iP;
    }

    public static int f(List list) {
        int size = list.size();
        if (size == 0) {
            return 0;
        }
        int iO = 0;
        for (int i = 0; i < size; i++) {
            int iIntValue = ((Integer) list.get(i)).intValue();
            iO += C2832wi.O((iIntValue >> 31) ^ (iIntValue << 1));
        }
        return iO;
    }

    public static int g(List list) {
        int size = list.size();
        if (size == 0) {
            return 0;
        }
        int iP = 0;
        for (int i = 0; i < size; i++) {
            long jLongValue = ((Long) list.get(i)).longValue();
            iP += C2832wi.P((jLongValue >> 63) ^ (jLongValue << 1));
        }
        return iP;
    }

    public static int h(List list) {
        int size = list.size();
        if (size == 0) {
            return 0;
        }
        int iO = 0;
        for (int i = 0; i < size; i++) {
            iO += C2832wi.O(((Integer) list.get(i)).intValue());
        }
        return iO;
    }

    public static int i(List list) {
        int size = list.size();
        if (size == 0) {
            return 0;
        }
        int iP = 0;
        for (int i = 0; i < size; i++) {
            iP += C2832wi.P(((Long) list.get(i)).longValue());
        }
        return iP;
    }

    public static void k(Qh0 qh0, Object obj, Object obj2) {
        qh0.getClass();
        DD dd = (DD) obj;
        Ph0 ph0 = dd.unknownFields;
        Ph0 ph02 = ((DD) obj2).unknownFields;
        Ph0 ph03 = Ph0.f;
        if (!ph03.equals(ph02)) {
            if (ph03.equals(ph0)) {
                int i = ph0.a + ph02.a;
                int[] iArrCopyOf = Arrays.copyOf(ph0.b, i);
                System.arraycopy(ph02.b, 0, iArrCopyOf, ph0.a, ph02.a);
                Object[] objArrCopyOf = Arrays.copyOf(ph0.c, i);
                System.arraycopy(ph02.c, 0, objArrCopyOf, ph0.a, ph02.a);
                ph0 = new Ph0(i, iArrCopyOf, objArrCopyOf, true);
            } else {
                ph0.getClass();
                if (!ph02.equals(ph03)) {
                    if (!ph0.e) {
                        throw new UnsupportedOperationException();
                    }
                    int i2 = ph0.a + ph02.a;
                    ph0.a(i2);
                    System.arraycopy(ph02.b, 0, ph0.b, ph0.a, ph02.a);
                    System.arraycopy(ph02.c, 0, ph0.c, ph0.a, ph02.a);
                    ph0.a = i2;
                }
            }
        }
        dd.unknownFields = ph0;
    }

    public static boolean l(Object obj, Object obj2) {
        if (obj != obj2) {
            return obj != null && obj.equals(obj2);
        }
        return true;
    }

    public static void m(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                c2832wi.U(i, ((Boolean) list.get(i2)).booleanValue());
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int i3 = 0;
        for (int i4 = 0; i4 < list.size(); i4++) {
            ((Boolean) list.get(i4)).getClass();
            Logger logger = C2832wi.f777o;
            i3++;
        }
        c2832wi.i0(i3);
        while (i2 < list.size()) {
            c2832wi.S(((Boolean) list.get(i2)).booleanValue() ? (byte) 1 : (byte) 0);
            i2++;
        }
    }

    public static void n(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                double dDoubleValue = ((Double) list.get(i2)).doubleValue();
                c2832wi.getClass();
                c2832wi.Z(i, Double.doubleToRawLongBits(dDoubleValue));
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int i3 = 0;
        for (int i4 = 0; i4 < list.size(); i4++) {
            ((Double) list.get(i4)).getClass();
            Logger logger = C2832wi.f777o;
            i3 += 8;
        }
        c2832wi.i0(i3);
        while (i2 < list.size()) {
            c2832wi.a0(Double.doubleToRawLongBits(((Double) list.get(i2)).doubleValue()));
            i2++;
        }
    }

    public static void o(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                c2832wi.b0(i, ((Integer) list.get(i2)).intValue());
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int iP = 0;
        for (int i3 = 0; i3 < list.size(); i3++) {
            iP += C2832wi.P(((Integer) list.get(i3)).intValue());
        }
        c2832wi.i0(iP);
        while (i2 < list.size()) {
            c2832wi.c0(((Integer) list.get(i2)).intValue());
            i2++;
        }
    }

    public static void p(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                c2832wi.X(i, ((Integer) list.get(i2)).intValue());
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int i3 = 0;
        for (int i4 = 0; i4 < list.size(); i4++) {
            ((Integer) list.get(i4)).getClass();
            Logger logger = C2832wi.f777o;
            i3 += 4;
        }
        c2832wi.i0(i3);
        while (i2 < list.size()) {
            c2832wi.Y(((Integer) list.get(i2)).intValue());
            i2++;
        }
    }

    public static void q(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                c2832wi.Z(i, ((Long) list.get(i2)).longValue());
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int i3 = 0;
        for (int i4 = 0; i4 < list.size(); i4++) {
            ((Long) list.get(i4)).getClass();
            Logger logger = C2832wi.f777o;
            i3 += 8;
        }
        c2832wi.i0(i3);
        while (i2 < list.size()) {
            c2832wi.a0(((Long) list.get(i2)).longValue());
            i2++;
        }
    }

    public static void r(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                float fFloatValue = ((Float) list.get(i2)).floatValue();
                c2832wi.getClass();
                c2832wi.X(i, Float.floatToRawIntBits(fFloatValue));
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int i3 = 0;
        for (int i4 = 0; i4 < list.size(); i4++) {
            ((Float) list.get(i4)).getClass();
            Logger logger = C2832wi.f777o;
            i3 += 4;
        }
        c2832wi.i0(i3);
        while (i2 < list.size()) {
            c2832wi.Y(Float.floatToRawIntBits(((Float) list.get(i2)).floatValue()));
            i2++;
        }
    }

    public static void s(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                c2832wi.b0(i, ((Integer) list.get(i2)).intValue());
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int iP = 0;
        for (int i3 = 0; i3 < list.size(); i3++) {
            iP += C2832wi.P(((Integer) list.get(i3)).intValue());
        }
        c2832wi.i0(iP);
        while (i2 < list.size()) {
            c2832wi.c0(((Integer) list.get(i2)).intValue());
            i2++;
        }
    }

    public static void t(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                c2832wi.j0(i, ((Long) list.get(i2)).longValue());
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int iP = 0;
        for (int i3 = 0; i3 < list.size(); i3++) {
            iP += C2832wi.P(((Long) list.get(i3)).longValue());
        }
        c2832wi.i0(iP);
        while (i2 < list.size()) {
            c2832wi.k0(((Long) list.get(i2)).longValue());
            i2++;
        }
    }

    public static void u(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                c2832wi.X(i, ((Integer) list.get(i2)).intValue());
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int i3 = 0;
        for (int i4 = 0; i4 < list.size(); i4++) {
            ((Integer) list.get(i4)).getClass();
            Logger logger = C2832wi.f777o;
            i3 += 4;
        }
        c2832wi.i0(i3);
        while (i2 < list.size()) {
            c2832wi.Y(((Integer) list.get(i2)).intValue());
            i2++;
        }
    }

    public static void v(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                c2832wi.Z(i, ((Long) list.get(i2)).longValue());
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int i3 = 0;
        for (int i4 = 0; i4 < list.size(); i4++) {
            ((Long) list.get(i4)).getClass();
            Logger logger = C2832wi.f777o;
            i3 += 8;
        }
        c2832wi.i0(i3);
        while (i2 < list.size()) {
            c2832wi.a0(((Long) list.get(i2)).longValue());
            i2++;
        }
    }

    public static void w(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                int iIntValue = ((Integer) list.get(i2)).intValue();
                c2832wi.h0(i, (iIntValue >> 31) ^ (iIntValue << 1));
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int iO = 0;
        for (int i3 = 0; i3 < list.size(); i3++) {
            int iIntValue2 = ((Integer) list.get(i3)).intValue();
            iO += C2832wi.O((iIntValue2 >> 31) ^ (iIntValue2 << 1));
        }
        c2832wi.i0(iO);
        while (i2 < list.size()) {
            int iIntValue3 = ((Integer) list.get(i2)).intValue();
            c2832wi.i0((iIntValue3 >> 31) ^ (iIntValue3 << 1));
            i2++;
        }
    }

    public static void x(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                long jLongValue = ((Long) list.get(i2)).longValue();
                c2832wi.j0(i, (jLongValue >> 63) ^ (jLongValue << 1));
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int iP = 0;
        for (int i3 = 0; i3 < list.size(); i3++) {
            long jLongValue2 = ((Long) list.get(i3)).longValue();
            iP += C2832wi.P((jLongValue2 >> 63) ^ (jLongValue2 << 1));
        }
        c2832wi.i0(iP);
        while (i2 < list.size()) {
            long jLongValue3 = ((Long) list.get(i2)).longValue();
            c2832wi.k0((jLongValue3 >> 63) ^ (jLongValue3 << 1));
            i2++;
        }
    }

    public static void y(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                c2832wi.h0(i, ((Integer) list.get(i2)).intValue());
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int iO = 0;
        for (int i3 = 0; i3 < list.size(); i3++) {
            iO += C2832wi.O(((Integer) list.get(i3)).intValue());
        }
        c2832wi.i0(iO);
        while (i2 < list.size()) {
            c2832wi.i0(((Integer) list.get(i2)).intValue());
            i2++;
        }
    }

    public static void z(int i, List list, OD od, boolean z) {
        if (list == null || list.isEmpty()) {
            return;
        }
        C2832wi c2832wi = (C2832wi) od.m;
        int i2 = 0;
        if (!z) {
            while (i2 < list.size()) {
                c2832wi.j0(i, ((Long) list.get(i2)).longValue());
                i2++;
            }
            return;
        }
        c2832wi.g0(i, 2);
        int iP = 0;
        for (int i3 = 0; i3 < list.size(); i3++) {
            iP += C2832wi.P(((Long) list.get(i3)).longValue());
        }
        c2832wi.i0(iP);
        while (i2 < list.size()) {
            c2832wi.k0(((Long) list.get(i2)).longValue());
            i2++;
        }
    }

    public static Object j(Object obj, int i, InterfaceC2323rI interfaceC2323rI, Object obj2, Qh0 qh0) {
        return obj2;
    }
}
