package com.google.android.gms.internal.measurement; import java.io.IOException; import java.util.Iterator; import java.util.Map; /* loaded from: classes.dex */ final class zzwa implements zzwl { private final zzvv a; private final zzxd b; private final boolean c; private final zzuc d; private zzwa(zzxd zzxdVar, zzuc zzucVar, zzvv zzvvVar) { this.b = zzxdVar; this.c = zzucVar.a(zzvvVar); this.d = zzucVar; this.a = zzvvVar; } static zzwa a(zzxd zzxdVar, zzuc zzucVar, zzvv zzvvVar) { return new zzwa<>(zzxdVar, zzucVar, zzvvVar); } @Override // com.google.android.gms.internal.measurement.zzwl public final boolean b(T t) { return this.d.a(t).d(); } @Override // com.google.android.gms.internal.measurement.zzwl public final void c(T t) { this.b.f(t); this.d.c(t); } @Override // com.google.android.gms.internal.measurement.zzwl public final int d(T t) { int hashCode = this.b.c(t).hashCode(); return this.c ? (hashCode * 53) + this.d.a(t).hashCode() : hashCode; } @Override // com.google.android.gms.internal.measurement.zzwl public final boolean equals(T t, T t2) { if (!this.b.c(t).equals(this.b.c(t2))) { return false; } if (this.c) { return this.d.a(t).equals(this.d.a(t2)); } return true; } @Override // com.google.android.gms.internal.measurement.zzwl public final T newInstance() { return (T) this.a.i().e(); } @Override // com.google.android.gms.internal.measurement.zzwl public final void a(T t, T t2) { zzwn.a(this.b, t, t2); if (this.c) { zzwn.a(this.d, t, t2); } } @Override // com.google.android.gms.internal.measurement.zzwl public final void a(T t, zzxy zzxyVar) throws IOException { Iterator> e = this.d.a(t).e(); while (e.hasNext()) { Map.Entry next = e.next(); zzuh zzuhVar = (zzuh) next.getKey(); if (zzuhVar.l() == zzxx.MESSAGE && !zzuhVar.k() && !zzuhVar.b()) { if (next instanceof zzva) { zzxyVar.a(zzuhVar.zzc(), (Object) ((zzva) next).a().a()); } else { zzxyVar.a(zzuhVar.zzc(), next.getValue()); } } else { throw new IllegalStateException("Found invalid MessageSet item."); } } zzxd zzxdVar = this.b; zzxdVar.b((zzxd) zzxdVar.c(t), zzxyVar); } @Override // com.google.android.gms.internal.measurement.zzwl public final void a(T t, zzwk zzwkVar, zzub zzubVar) throws IOException { boolean z; zzxd zzxdVar = this.b; zzuc zzucVar = this.d; Object d = zzxdVar.d(t); zzuf b = zzucVar.b(t); while (zzwkVar.j() != Integer.MAX_VALUE) { try { int a = zzwkVar.a(); if (a == 11) { Object obj = null; zzte zzteVar = null; int i = 0; while (zzwkVar.j() != Integer.MAX_VALUE) { int a2 = zzwkVar.a(); if (a2 == 16) { i = zzwkVar.b(); obj = zzucVar.a(zzubVar, this.a, i); } else if (a2 == 26) { if (obj == null) { zzteVar = zzwkVar.d(); } else { zzucVar.a(zzwkVar, obj, zzubVar, b); throw null; } } else if (!zzwkVar.n()) { break; } } if (zzwkVar.a() != 12) { throw zzuv.zzwt(); } if (zzteVar != null) { if (obj == null) { zzxdVar.a((zzxd) d, i, zzteVar); } else { zzucVar.a(zzteVar, obj, zzubVar, b); throw null; } } z = true; } else if ((a & 7) == 2) { Object a3 = zzucVar.a(zzubVar, this.a, a >>> 3); if (a3 == null) { z = zzxdVar.a((zzxd) d, zzwkVar); } else { zzucVar.a(zzwkVar, a3, zzubVar, b); throw null; } } else { z = zzwkVar.n(); } if (!z) { return; } } finally { zzxdVar.b((Object) t, (T) d); } } } @Override // com.google.android.gms.internal.measurement.zzwl public final int a(T t) { zzxd zzxdVar = this.b; int e = zzxdVar.e(zzxdVar.c(t)) + 0; return this.c ? e + this.d.a(t).h() : e; } }