package com.google.android.gms.internal.gtm; import java.io.IOException; import java.util.Iterator; import java.util.List; import java.util.RandomAccess; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes2.dex */ public final class zztb { private static final Class zzbdu = zzqy(); private static final zztr zzbdv = zzl(false); private static final zztr zzbdw = zzl(true); private static final zztr zzbdx = new zztt(); public static void zzj(Class cls) { Class cls2; if (!zzrc.class.isAssignableFrom(cls) && (cls2 = zzbdu) != null && !cls2.isAssignableFrom(cls)) { throw new IllegalArgumentException("Message classes must extend GeneratedMessage or GeneratedMessageLite"); } } public static void zza(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzg(i, list, z); } public static void zzb(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzf(i, list, z); } public static void zzc(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzc(i, list, z); } public static void zzd(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzd(i, list, z); } public static void zze(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzn(i, list, z); } public static void zzf(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zze(i, list, z); } public static void zzg(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzl(i, list, z); } public static void zzh(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zza(i, list, z); } public static void zzi(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzj(i, list, z); } public static void zzj(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzm(i, list, z); } public static void zzk(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzb(i, list, z); } public static void zzl(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzk(i, list, z); } public static void zzm(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzh(i, list, z); } public static void zzn(int i, List list, zzum zzumVar, boolean z) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzi(i, list, z); } public static void zza(int i, List list, zzum zzumVar) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zza(i, list); } public static void zzb(int i, List list, zzum zzumVar) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzb(i, list); } public static void zza(int i, List list, zzum zzumVar, zzsz zzszVar) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zza(i, list, zzszVar); } public static void zzb(int i, List list, zzum zzumVar, zzsz zzszVar) throws IOException { if (list == null || list.isEmpty()) { return; } zzumVar.zzb(i, list, zzszVar); } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzw(List list) { int size = list.size(); int i = 0; if (size == 0) { return 0; } if (list instanceof zzry) { zzry zzryVar = (zzry) list; for (int i2 = 0; i2 < size; i2++) { i += zzqj.zzs(zzryVar.getLong(i2)); } } else { for (int i3 = 0; i3 < size; i3++) { i += zzqj.zzs(list.get(i3).longValue()); } } return i; } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzo(int i, List list, boolean z) { if (list.size() == 0) { return 0; } return zzw(list) + (list.size() * zzqj.zzbb(i)); } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzx(List list) { int size = list.size(); int i = 0; if (size == 0) { return 0; } if (list instanceof zzry) { zzry zzryVar = (zzry) list; for (int i2 = 0; i2 < size; i2++) { i += zzqj.zzt(zzryVar.getLong(i2)); } } else { for (int i3 = 0; i3 < size; i3++) { i += zzqj.zzt(list.get(i3).longValue()); } } return i; } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzp(int i, List list, boolean z) { int size = list.size(); if (size == 0) { return 0; } return zzx(list) + (size * zzqj.zzbb(i)); } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzy(List list) { int size = list.size(); int i = 0; if (size == 0) { return 0; } if (list instanceof zzry) { zzry zzryVar = (zzry) list; for (int i2 = 0; i2 < size; i2++) { i += zzqj.zzu(zzryVar.getLong(i2)); } } else { for (int i3 = 0; i3 < size; i3++) { i += zzqj.zzu(list.get(i3).longValue()); } } return i; } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzq(int i, List list, boolean z) { int size = list.size(); if (size == 0) { return 0; } return zzy(list) + (size * zzqj.zzbb(i)); } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzz(List list) { int size = list.size(); int i = 0; if (size == 0) { return 0; } if (list instanceof zzrd) { zzrd zzrdVar = (zzrd) list; for (int i2 = 0; i2 < size; i2++) { i += zzqj.zzbh(zzrdVar.getInt(i2)); } } else { for (int i3 = 0; i3 < size; i3++) { i += zzqj.zzbh(list.get(i3).intValue()); } } return i; } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzr(int i, List list, boolean z) { int size = list.size(); if (size == 0) { return 0; } return zzz(list) + (size * zzqj.zzbb(i)); } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzaa(List list) { int size = list.size(); int i = 0; if (size == 0) { return 0; } if (list instanceof zzrd) { zzrd zzrdVar = (zzrd) list; for (int i2 = 0; i2 < size; i2++) { i += zzqj.zzbc(zzrdVar.getInt(i2)); } } else { for (int i3 = 0; i3 < size; i3++) { i += zzqj.zzbc(list.get(i3).intValue()); } } return i; } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzs(int i, List list, boolean z) { int size = list.size(); if (size == 0) { return 0; } return zzaa(list) + (size * zzqj.zzbb(i)); } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzab(List list) { int size = list.size(); int i = 0; if (size == 0) { return 0; } if (list instanceof zzrd) { zzrd zzrdVar = (zzrd) list; for (int i2 = 0; i2 < size; i2++) { i += zzqj.zzbd(zzrdVar.getInt(i2)); } } else { for (int i3 = 0; i3 < size; i3++) { i += zzqj.zzbd(list.get(i3).intValue()); } } return i; } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzt(int i, List list, boolean z) { int size = list.size(); if (size == 0) { return 0; } return zzab(list) + (size * zzqj.zzbb(i)); } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzac(List list) { int size = list.size(); int i = 0; if (size == 0) { return 0; } if (list instanceof zzrd) { zzrd zzrdVar = (zzrd) list; for (int i2 = 0; i2 < size; i2++) { i += zzqj.zzbe(zzrdVar.getInt(i2)); } } else { for (int i3 = 0; i3 < size; i3++) { i += zzqj.zzbe(list.get(i3).intValue()); } } return i; } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzu(int i, List list, boolean z) { int size = list.size(); if (size == 0) { return 0; } return zzac(list) + (size * zzqj.zzbb(i)); } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzad(List list) { return list.size() << 2; } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzv(int i, List list, boolean z) { int size = list.size(); if (size == 0) { return 0; } return size * zzqj.zzl(i, 0); } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzae(List list) { return list.size() << 3; } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzw(int i, List list, boolean z) { int size = list.size(); if (size == 0) { return 0; } return size * zzqj.zzg(i, 0L); } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzaf(List list) { return list.size(); } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzx(int i, List list, boolean z) { int size = list.size(); if (size == 0) { return 0; } return size * zzqj.zzc(i, true); } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzc(int i, List list) { int zzda; int zzda2; int size = list.size(); int i2 = 0; if (size == 0) { return 0; } int zzbb = zzqj.zzbb(i) * size; if (list instanceof zzrt) { zzrt zzrtVar = (zzrt) list; while (i2 < size) { Object zzbn = zzrtVar.zzbn(i2); if (zzbn instanceof zzps) { zzda2 = zzqj.zzb((zzps) zzbn); } else { zzda2 = zzqj.zzda((String) zzbn); } zzbb += zzda2; i2++; } } else { while (i2 < size) { Object obj = list.get(i2); if (obj instanceof zzps) { zzda = zzqj.zzb((zzps) obj); } else { zzda = zzqj.zzda((String) obj); } zzbb += zzda; i2++; } } return zzbb; } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzc(int i, Object obj, zzsz zzszVar) { if (obj instanceof zzrr) { return zzqj.zza(i, (zzrr) obj); } return zzqj.zzb(i, (zzsk) obj, zzszVar); } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzc(int i, List list, zzsz zzszVar) { int zzb; int size = list.size(); if (size == 0) { return 0; } int zzbb = zzqj.zzbb(i) * size; for (int i2 = 0; i2 < size; i2++) { Object obj = list.get(i2); if (obj instanceof zzrr) { zzb = zzqj.zza((zzrr) obj); } else { zzb = zzqj.zzb((zzsk) obj, zzszVar); } zzbb += zzb; } return zzbb; } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzd(int i, List list) { int size = list.size(); if (size == 0) { return 0; } int zzbb = size * zzqj.zzbb(i); for (int i2 = 0; i2 < list.size(); i2++) { zzbb += zzqj.zzb(list.get(i2)); } return zzbb; } /* JADX INFO: Access modifiers changed from: package-private */ public static int zzd(int i, List list, zzsz zzszVar) { int size = list.size(); if (size == 0) { return 0; } int i2 = 0; for (int i3 = 0; i3 < size; i3++) { i2 += zzqj.zzc(i, list.get(i3), zzszVar); } return i2; } private static zztr zzl(boolean z) { try { Class zzqz = zzqz(); if (zzqz == null) { return null; } return (zztr) zzqz.getConstructor(Boolean.TYPE).newInstance(Boolean.valueOf(z)); } catch (Throwable unused) { return null; } } private static Class zzqy() { try { return Class.forName("com.google.protobuf.GeneratedMessage"); } catch (Throwable unused) { return null; } } private static Class zzqz() { try { return Class.forName("com.google.protobuf.UnknownFieldSetSchema"); } catch (Throwable unused) { return null; } } /* JADX INFO: Access modifiers changed from: package-private */ public static boolean zze(Object obj, Object obj2) { if (obj != obj2) { return obj != null && obj.equals(obj2); } return true; } /* JADX INFO: Access modifiers changed from: package-private */ public static void zza(zzsf zzsfVar, T t, T t2, long j) { zztx.zza(t, j, zzsfVar.zzc(zztx.zzp(t, j), zztx.zzp(t2, j))); } /* JADX INFO: Access modifiers changed from: package-private */ public static > void zza(zzqq zzqqVar, T t, T t2) { zzqt zzr = zzqqVar.zzr(t2); if (zzr.zzaxo.isEmpty()) { return; } zzqqVar.zzs(t).zza(zzr); } /* JADX INFO: Access modifiers changed from: package-private */ public static void zza(zztr zztrVar, T t, T t2) { zztrVar.zzf(t, zztrVar.zzh(zztrVar.zzag(t), zztrVar.zzag(t2))); } /* JADX INFO: Access modifiers changed from: package-private */ public static UB zza(int i, List list, zzrh zzrhVar, UB ub, zztr zztrVar) { if (zzrhVar == null) { return ub; } if (list instanceof RandomAccess) { int size = list.size(); int i2 = 0; for (int i3 = 0; i3 < size; i3++) { int intValue = list.get(i3).intValue(); if (zzrhVar.zzb(intValue)) { if (i3 != i2) { list.set(i2, Integer.valueOf(intValue)); } i2++; } else { ub = (UB) zza(i, intValue, ub, zztrVar); } } if (i2 != size) { list.subList(i2, size).clear(); } } else { Iterator it = list.iterator(); while (it.hasNext()) { int intValue2 = it.next().intValue(); if (!zzrhVar.zzb(intValue2)) { ub = (UB) zza(i, intValue2, ub, zztrVar); it.remove(); } } } return ub; } /* JADX INFO: Access modifiers changed from: package-private */ public static UB zza(int i, int i2, UB ub, zztr zztrVar) { if (ub == null) { ub = zztrVar.zzri(); } zztrVar.zza((zztr) ub, i, i2); return ub; } public static zztr zzqx() { return zzbdx; } public static zztr zzqw() { return zzbdw; } public static zztr zzqv() { return zzbdv; } }