package com.google.android.gms.internal.measurement; import com.google.android.gms.internal.measurement.zzuh; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; /* loaded from: classes.dex */ final class zzuf> { private static final zzuf d = new zzuf(true); private boolean b; private boolean c = false; private final zzwo a = zzwo.b(16); private zzuf() { } public static > zzuf i() { return d; } final Iterator> a() { return this.c ? new zzvb(this.a.e().iterator()) : this.a.e().iterator(); } final boolean b() { return this.a.isEmpty(); } public final boolean c() { return this.b; } public final /* synthetic */ Object clone() throws CloneNotSupportedException { zzuf zzufVar = new zzuf(); for (int i = 0; i < this.a.c(); i++) { Map.Entry a = this.a.a(i); zzufVar.a((zzuf) a.getKey(), a.getValue()); } for (Map.Entry entry : this.a.d()) { zzufVar.a((zzuf) entry.getKey(), entry.getValue()); } zzufVar.c = this.c; return zzufVar; } public final boolean d() { for (int i = 0; i < this.a.c(); i++) { if (!a((Map.Entry) this.a.a(i))) { return false; } } Iterator> it = this.a.d().iterator(); while (it.hasNext()) { if (!a((Map.Entry) it.next())) { return false; } } return true; } public final Iterator> e() { return this.c ? new zzvb(this.a.entrySet().iterator()) : this.a.entrySet().iterator(); } public final boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof zzuf) { return this.a.equals(((zzuf) obj).a); } return false; } public final void f() { if (this.b) { return; } this.a.b(); this.b = true; } public final int g() { int i = 0; for (int i2 = 0; i2 < this.a.c(); i2++) { Map.Entry a = this.a.a(i2); i += b((zzuh) a.getKey(), a.getValue()); } for (Map.Entry entry : this.a.d()) { i += b((zzuh) entry.getKey(), entry.getValue()); } return i; } public final int h() { int i = 0; for (int i2 = 0; i2 < this.a.c(); i2++) { i += c(this.a.a(i2)); } Iterator> it = this.a.d().iterator(); while (it.hasNext()) { i += c(it.next()); } return i; } public final int hashCode() { return this.a.hashCode(); } private final void b(Map.Entry entry) { FieldDescriptorType key = entry.getKey(); Object value = entry.getValue(); if (value instanceof zzuy) { zzuy.c(); throw null; } if (key.k()) { Object a = a((zzuf) key); if (a == null) { a = new ArrayList(); } Iterator it = ((List) value).iterator(); while (it.hasNext()) { ((List) a).add(a(it.next())); } this.a.a((zzwo) key, (FieldDescriptorType) a); return; } if (key.l() != zzxx.MESSAGE) { this.a.a((zzwo) key, (FieldDescriptorType) a(value)); return; } Object a2 = a((zzuf) key); if (a2 == null) { this.a.a((zzwo) key, (FieldDescriptorType) a(value)); } else { this.a.a((zzwo) key, (FieldDescriptorType) (a2 instanceof zzwb ? key.a((zzwb) a2, (zzwb) value) : key.a(((zzvv) a2).f(), (zzvv) value).d())); } } private static int c(Map.Entry entry) { FieldDescriptorType key = entry.getKey(); Object value = entry.getValue(); return (key.l() != zzxx.MESSAGE || key.k() || key.b()) ? b((zzuh) key, value) : value instanceof zzuy ? zztv.b(entry.getKey().zzc(), (zzuy) value) : zztv.d(entry.getKey().zzc(), (zzvv) value); } private zzuf(boolean z) { f(); } private final Object a(FieldDescriptorType fielddescriptortype) { Object obj = this.a.get(fielddescriptortype); if (!(obj instanceof zzuy)) { return obj; } zzuy.c(); throw null; } private final void a(FieldDescriptorType fielddescriptortype, Object obj) { if (fielddescriptortype.k()) { if (obj instanceof List) { ArrayList arrayList = new ArrayList(); arrayList.addAll((List) obj); int size = arrayList.size(); int i = 0; while (i < size) { Object obj2 = arrayList.get(i); i++; a(fielddescriptortype.j(), obj2); } obj = arrayList; } else { throw new IllegalArgumentException("Wrong object type used with protocol message reflection."); } } else { a(fielddescriptortype.j(), obj); } if (obj instanceof zzuy) { this.c = true; } this.a.a((zzwo) fielddescriptortype, (FieldDescriptorType) obj); } /* JADX WARN: Code restructure failed: missing block: B:11:0x0024, code lost: if ((r3 instanceof com.google.android.gms.internal.measurement.zzur) == false) goto L27; */ /* JADX WARN: Code restructure failed: missing block: B:15:0x002e, code lost: if ((r3 instanceof byte[]) == false) goto L27; */ /* JADX WARN: Code restructure failed: missing block: B:6:0x001b, code lost: if ((r3 instanceof com.google.android.gms.internal.measurement.zzuy) == false) goto L27; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ private static void a(com.google.android.gms.internal.measurement.zzxs r2, java.lang.Object r3) { /* com.google.android.gms.internal.measurement.zzuq.a(r3) int[] r0 = com.google.android.gms.internal.measurement.zzug.a com.google.android.gms.internal.measurement.zzxx r2 = r2.zzyv() int r2 = r2.ordinal() r2 = r0[r2] r0 = 1 r1 = 0 switch(r2) { case 1: goto L40; case 2: goto L3d; case 3: goto L3a; case 4: goto L37; case 5: goto L34; case 6: goto L31; case 7: goto L28; case 8: goto L1e; case 9: goto L15; default: goto L14; } L14: goto L43 L15: boolean r2 = r3 instanceof com.google.android.gms.internal.measurement.zzvv if (r2 != 0) goto L26 boolean r2 = r3 instanceof com.google.android.gms.internal.measurement.zzuy if (r2 == 0) goto L43 goto L26 L1e: boolean r2 = r3 instanceof java.lang.Integer if (r2 != 0) goto L26 boolean r2 = r3 instanceof com.google.android.gms.internal.measurement.zzur if (r2 == 0) goto L43 L26: r1 = 1 goto L43 L28: boolean r2 = r3 instanceof com.google.android.gms.internal.measurement.zzte if (r2 != 0) goto L26 boolean r2 = r3 instanceof byte[] if (r2 == 0) goto L43 goto L26 L31: boolean r0 = r3 instanceof java.lang.String goto L42 L34: boolean r0 = r3 instanceof java.lang.Boolean goto L42 L37: boolean r0 = r3 instanceof java.lang.Double goto L42 L3a: boolean r0 = r3 instanceof java.lang.Float goto L42 L3d: boolean r0 = r3 instanceof java.lang.Long goto L42 L40: boolean r0 = r3 instanceof java.lang.Integer L42: r1 = r0 L43: if (r1 == 0) goto L46 return L46: java.lang.IllegalArgumentException r2 = new java.lang.IllegalArgumentException java.lang.String r3 = "Wrong object type used with protocol message reflection." r2.(r3) throw r2 */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.internal.measurement.zzuf.a(com.google.android.gms.internal.measurement.zzxs, java.lang.Object):void"); } private static int b(zzxs zzxsVar, Object obj) { switch (zzug.b[zzxsVar.ordinal()]) { case 1: return zztv.b(((Double) obj).doubleValue()); case 2: return zztv.b(((Float) obj).floatValue()); case 3: return zztv.d(((Long) obj).longValue()); case 4: return zztv.e(((Long) obj).longValue()); case 5: return zztv.f(((Integer) obj).intValue()); case 6: return zztv.g(((Long) obj).longValue()); case 7: return zztv.i(((Integer) obj).intValue()); case 8: return zztv.b(((Boolean) obj).booleanValue()); case 9: return zztv.b((zzvv) obj); case 10: if (obj instanceof zzuy) { return zztv.a((zzuy) obj); } return zztv.a((zzvv) obj); case 11: if (obj instanceof zzte) { return zztv.a((zzte) obj); } return zztv.a((String) obj); case 12: if (obj instanceof zzte) { return zztv.a((zzte) obj); } return zztv.b((byte[]) obj); case 13: return zztv.g(((Integer) obj).intValue()); case 14: return zztv.j(((Integer) obj).intValue()); case 15: return zztv.h(((Long) obj).longValue()); case 16: return zztv.h(((Integer) obj).intValue()); case 17: return zztv.f(((Long) obj).longValue()); case 18: if (obj instanceof zzur) { return zztv.k(((zzur) obj).zzc()); } return zztv.k(((Integer) obj).intValue()); default: throw new RuntimeException("There is no way to get here, but the compiler thinks otherwise."); } } private static boolean a(Map.Entry entry) { FieldDescriptorType key = entry.getKey(); if (key.l() == zzxx.MESSAGE) { if (key.k()) { Iterator it = ((List) entry.getValue()).iterator(); while (it.hasNext()) { if (!((zzvv) it.next()).a()) { return false; } } } else { Object value = entry.getValue(); if (value instanceof zzvv) { if (!((zzvv) value).a()) { return false; } } else { if (value instanceof zzuy) { return true; } throw new IllegalArgumentException("Wrong object type used with protocol message reflection."); } } } return true; } public final void a(zzuf zzufVar) { for (int i = 0; i < zzufVar.a.c(); i++) { b(zzufVar.a.a(i)); } Iterator> it = zzufVar.a.d().iterator(); while (it.hasNext()) { b(it.next()); } } private static Object a(Object obj) { if (obj instanceof zzwb) { return ((zzwb) obj).c(); } if (!(obj instanceof byte[])) { return obj; } byte[] bArr = (byte[]) obj; byte[] bArr2 = new byte[bArr.length]; System.arraycopy(bArr, 0, bArr2, 0, bArr.length); return bArr2; } static int a(zzxs zzxsVar, int i, Object obj) { int e = zztv.e(i); if (zzxsVar == zzxs.zzcdq) { zzuq.a((zzvv) obj); e <<= 1; } return e + b(zzxsVar, obj); } private static int b(zzuh zzuhVar, Object obj) { zzxs j = zzuhVar.j(); int zzc = zzuhVar.zzc(); if (zzuhVar.k()) { int i = 0; if (zzuhVar.b()) { Iterator it = ((List) obj).iterator(); while (it.hasNext()) { i += b(j, it.next()); } return zztv.e(zzc) + i + zztv.m(i); } Iterator it2 = ((List) obj).iterator(); while (it2.hasNext()) { i += a(j, zzc, it2.next()); } return i; } return a(j, zzc, obj); } }