package o; import com.google.crypto.tink.shaded.protobuf.CodedOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; import o.C15775iXO; import o.LsH; import o.QWH; import o.QWH.IeS; import o.oZe; import o.qAt; import o.vAr; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes2.dex */ public final class QWH> { private static final QWH c = new QWH((byte) 0); boolean a; final qAt d; boolean e; /* loaded from: classes2.dex */ public interface IeS> extends Comparable { C15775iXO.RVV a(); vAr.Sts a(vAr.Sts sts, vAr var); boolean b(); C15775iXO.IeS c(); boolean d(); int e(); } private QWH() { this.d = (qAt) new qAt(16) { // from class: o.qAt.1 /* JADX INFO: Access modifiers changed from: package-private */ { byte b = 0; } @Override // o.qAt public final void d() { Iterable entrySet; if (!this.b) { for (int i = 0; i < this.c.size(); i++) { qAt.Sts sts = this.c.get(i); if (((QWH.IeS) sts.getKey()).b()) { sts.setValue(Collections.unmodifiableList((List) sts.getValue())); } } if (this.a.isEmpty()) { entrySet = HBt.c(); } else { entrySet = this.a.entrySet(); } for (Map.Entry entry : entrySet) { if (((QWH.IeS) entry.getKey()).b()) { entry.setValue(Collections.unmodifiableList((List) entry.getValue())); } } } super.d(); } }; } private QWH(qAt qat) { this.d = qat; if (this.a) { return; } qat.d(); this.a = true; } public final boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof QWH) { return this.d.equals(((QWH) obj).d); } return false; } public final int hashCode() { return this.d.hashCode(); } public final Iterator> c() { if (this.e) { return new LsH.Sts(this.d.entrySet().iterator()); } return this.d.entrySet().iterator(); } private void c(T t, Object obj) { if (t.b()) { if (!(obj instanceof List)) { throw new IllegalArgumentException("Wrong object type used with protocol message reflection."); } ArrayList arrayList = new ArrayList(); arrayList.addAll((List) obj); Iterator it = arrayList.iterator(); while (it.hasNext()) { e(t, it.next()); } obj = arrayList; } else { e(t, obj); } if (obj instanceof LsH) { this.e = true; } this.d.put(t, obj); } /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */ /* JADX WARN: Failed to find 'out' block for switch in B:2:0x0011. Please report as an issue. */ /* JADX WARN: Removed duplicated region for block: B:24:? A[RETURN, SYNTHETIC] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private static void e(T r2, java.lang.Object r3) { /* o.iXO$RVV r0 = r2.a() o.oZe.c(r3) int[] r1 = o.QWH.AnonymousClass4.a o.iXO$IeS r0 = r0.javaType int r0 = r0.ordinal() r0 = r1[r0] switch(r0) { case 1: goto L3f; case 2: goto L3c; case 3: goto L39; case 4: goto L36; case 5: goto L33; case 6: goto L30; case 7: goto L27; case 8: goto L1e; case 9: goto L15; default: goto L14; } L14: goto L44 L15: boolean r0 = r3 instanceof o.vAr if (r0 != 0) goto L43 boolean r0 = r3 instanceof o.LsH if (r0 == 0) goto L44 goto L43 L1e: boolean r0 = r3 instanceof java.lang.Integer if (r0 != 0) goto L43 boolean r0 = r3 instanceof o.oZe.LWm if (r0 == 0) goto L44 goto L43 L27: boolean r0 = r3 instanceof o.jra if (r0 != 0) goto L43 boolean r0 = r3 instanceof byte[] if (r0 == 0) goto L44 goto L43 L30: boolean r0 = r3 instanceof java.lang.String goto L41 L33: boolean r0 = r3 instanceof java.lang.Boolean goto L41 L36: boolean r0 = r3 instanceof java.lang.Double goto L41 L39: boolean r0 = r3 instanceof java.lang.Float goto L41 L3c: boolean r0 = r3 instanceof java.lang.Long goto L41 L3f: boolean r0 = r3 instanceof java.lang.Integer L41: if (r0 == 0) goto L44 L43: return L44: int r0 = r2.e() o.iXO$RVV r2 = r2.a() o.iXO$IeS r2 = r2.javaType java.lang.Class r3 = r3.getClass() java.lang.String r3 = r3.getName() java.lang.Integer r0 = java.lang.Integer.valueOf(r0) java.lang.Object[] r2 = new java.lang.Object[]{r0, r2, r3} java.lang.IllegalArgumentException r3 = new java.lang.IllegalArgumentException java.lang.String r0 = "Wrong object type used with protocol message reflection.\nField number: %d, field java type: %s, value type: %s\n" java.lang.String r2 = java.lang.String.format(r0, r2) r3.(r2) throw r3 */ throw new UnsupportedOperationException("Method not decompiled: o.QWH.e(o.QWH$IeS, java.lang.Object):void"); } public final boolean e() { Iterable entrySet; for (int i = 0; i < this.d.c.size(); i++) { if (!a(this.d.c.get(i))) { return false; } } qAt qat = this.d; if (qat.a.isEmpty()) { entrySet = qAt.HBt.c(); } else { entrySet = qat.a.entrySet(); } Iterator it = entrySet.iterator(); while (it.hasNext()) { if (!a((Map.Entry) it.next())) { return false; } } return true; } private static > boolean a(Map.Entry entry) { T key = entry.getKey(); if (key.c() == C15775iXO.IeS.MESSAGE) { if (key.b()) { Iterator it = ((List) entry.getValue()).iterator(); while (it.hasNext()) { if (!((vAr) it.next()).l()) { return false; } } } else { Object value = entry.getValue(); if (value instanceof vAr) { if (!((vAr) value).l()) { return false; } } else { if (value instanceof LsH) { return true; } throw new IllegalArgumentException("Wrong object type used with protocol message reflection."); } } } return true; } /* JADX INFO: Access modifiers changed from: package-private */ public final void c(Map.Entry entry) { T key = entry.getKey(); Object value = entry.getValue(); if (value instanceof LsH) { LsH lsH = (LsH) value; vAr var = lsH.a; value = lsH.b(null); } if (!key.b()) { if (key.c() == C15775iXO.IeS.MESSAGE) { Object obj = this.d.get(key); if (obj instanceof LsH) { LsH lsH2 = (LsH) obj; vAr var2 = lsH2.a; obj = lsH2.b(null); } if (obj == null) { qAt qat = this.d; if (value instanceof byte[]) { byte[] bArr = (byte[]) value; byte[] bArr2 = new byte[bArr.length]; System.arraycopy(bArr, 0, bArr2, 0, bArr.length); value = bArr2; } qat.put(key, value); return; } this.d.put(key, key.a(((vAr) obj).r(), (vAr) value).h()); return; } qAt qat2 = this.d; if (value instanceof byte[]) { byte[] bArr3 = (byte[]) value; byte[] bArr4 = new byte[bArr3.length]; System.arraycopy(bArr3, 0, bArr4, 0, bArr3.length); value = bArr4; } qat2.put(key, value); return; } Object obj2 = this.d.get(key); if (obj2 instanceof LsH) { LsH lsH3 = (LsH) obj2; vAr var3 = lsH3.a; obj2 = lsH3.b(null); } if (obj2 == null) { obj2 = new ArrayList(); } for (Object obj3 : (List) value) { List list = (List) obj2; if (obj3 instanceof byte[]) { byte[] bArr5 = (byte[]) obj3; byte[] bArr6 = new byte[bArr5.length]; System.arraycopy(bArr5, 0, bArr6, 0, bArr5.length); obj3 = bArr6; } list.add(obj3); } this.d.put(key, obj2); } /* JADX INFO: Access modifiers changed from: package-private */ public static void d(CodedOutputStream codedOutputStream, C15775iXO.RVV rvv, int i, Object obj) throws IOException { if (rvv != C15775iXO.RVV.GROUP) { codedOutputStream.g(i, rvv.wireType); switch (AnonymousClass4.e[rvv.ordinal()]) { case 1: codedOutputStream.d(Double.doubleToRawLongBits(((Double) obj).doubleValue())); return; case 2: codedOutputStream.o(Float.floatToRawIntBits(((Float) obj).floatValue())); return; case 3: codedOutputStream.e(((Long) obj).longValue()); return; case 4: codedOutputStream.e(((Long) obj).longValue()); return; case 5: codedOutputStream.q(((Integer) obj).intValue()); return; case 6: codedOutputStream.d(((Long) obj).longValue()); return; case 7: codedOutputStream.o(((Integer) obj).intValue()); return; case 8: codedOutputStream.c(((Boolean) obj).booleanValue() ? (byte) 1 : (byte) 0); return; case 9: ((vAr) obj).b(codedOutputStream); return; case 10: codedOutputStream.a((vAr) obj); return; case 11: if (obj instanceof jra) { codedOutputStream.d((jra) obj); return; } else { codedOutputStream.a((String) obj); return; } case 12: if (obj instanceof jra) { codedOutputStream.d((jra) obj); return; } else { byte[] bArr = (byte[]) obj; codedOutputStream.a(bArr, bArr.length); return; } case 13: codedOutputStream.r(((Integer) obj).intValue()); return; case 14: codedOutputStream.o(((Integer) obj).intValue()); return; case 15: codedOutputStream.d(((Long) obj).longValue()); return; case 16: int intValue = ((Integer) obj).intValue(); codedOutputStream.r((intValue << 1) ^ (intValue >> 31)); return; case 17: long longValue = ((Long) obj).longValue(); codedOutputStream.e((longValue << 1) ^ (longValue >> 63)); return; case 18: if (obj instanceof oZe.LWm) { codedOutputStream.q(((oZe.LWm) obj).a()); return; } else { codedOutputStream.q(((Integer) obj).intValue()); return; } default: return; } } codedOutputStream.g(i, 3); ((vAr) obj).b(codedOutputStream); codedOutputStream.g(i, 4); } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: o.QWH$4, reason: invalid class name */ /* loaded from: classes2.dex */ public static /* synthetic */ class AnonymousClass4 { static final int[] a; static final int[] e; static { int[] iArr = new int[C15775iXO.RVV.values().length]; e = iArr; try { iArr[C15775iXO.RVV.DOUBLE.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { e[C15775iXO.RVV.FLOAT.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { e[C15775iXO.RVV.INT64.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } try { e[C15775iXO.RVV.UINT64.ordinal()] = 4; } catch (NoSuchFieldError unused4) { } try { e[C15775iXO.RVV.INT32.ordinal()] = 5; } catch (NoSuchFieldError unused5) { } try { e[C15775iXO.RVV.FIXED64.ordinal()] = 6; } catch (NoSuchFieldError unused6) { } try { e[C15775iXO.RVV.FIXED32.ordinal()] = 7; } catch (NoSuchFieldError unused7) { } try { e[C15775iXO.RVV.BOOL.ordinal()] = 8; } catch (NoSuchFieldError unused8) { } try { e[C15775iXO.RVV.GROUP.ordinal()] = 9; } catch (NoSuchFieldError unused9) { } try { e[C15775iXO.RVV.MESSAGE.ordinal()] = 10; } catch (NoSuchFieldError unused10) { } try { e[C15775iXO.RVV.STRING.ordinal()] = 11; } catch (NoSuchFieldError unused11) { } try { e[C15775iXO.RVV.BYTES.ordinal()] = 12; } catch (NoSuchFieldError unused12) { } try { e[C15775iXO.RVV.UINT32.ordinal()] = 13; } catch (NoSuchFieldError unused13) { } try { e[C15775iXO.RVV.SFIXED32.ordinal()] = 14; } catch (NoSuchFieldError unused14) { } try { e[C15775iXO.RVV.SFIXED64.ordinal()] = 15; } catch (NoSuchFieldError unused15) { } try { e[C15775iXO.RVV.SINT32.ordinal()] = 16; } catch (NoSuchFieldError unused16) { } try { e[C15775iXO.RVV.SINT64.ordinal()] = 17; } catch (NoSuchFieldError unused17) { } try { e[C15775iXO.RVV.ENUM.ordinal()] = 18; } catch (NoSuchFieldError unused18) { } int[] iArr2 = new int[C15775iXO.IeS.values().length]; a = iArr2; try { iArr2[C15775iXO.IeS.INT.ordinal()] = 1; } catch (NoSuchFieldError unused19) { } try { a[C15775iXO.IeS.LONG.ordinal()] = 2; } catch (NoSuchFieldError unused20) { } try { a[C15775iXO.IeS.FLOAT.ordinal()] = 3; } catch (NoSuchFieldError unused21) { } try { a[C15775iXO.IeS.DOUBLE.ordinal()] = 4; } catch (NoSuchFieldError unused22) { } try { a[C15775iXO.IeS.BOOLEAN.ordinal()] = 5; } catch (NoSuchFieldError unused23) { } try { a[C15775iXO.IeS.STRING.ordinal()] = 6; } catch (NoSuchFieldError unused24) { } try { a[C15775iXO.IeS.BYTE_STRING.ordinal()] = 7; } catch (NoSuchFieldError unused25) { } try { a[C15775iXO.IeS.ENUM.ordinal()] = 8; } catch (NoSuchFieldError unused26) { } try { a[C15775iXO.IeS.MESSAGE.ordinal()] = 9; } catch (NoSuchFieldError unused27) { } } } /* JADX INFO: Access modifiers changed from: package-private */ public static int d(Map.Entry entry) { T key = entry.getKey(); Object value = entry.getValue(); if (key.c() == C15775iXO.IeS.MESSAGE && !key.b() && !key.d()) { if (value instanceof LsH) { return CodedOutputStream.b(entry.getKey().e(), (LsH) value); } return CodedOutputStream.b(entry.getKey().e(), (vAr) value); } return a(key, value); } /* JADX INFO: Access modifiers changed from: package-private */ public static int b(C15775iXO.RVV rvv, int i, Object obj) { int m = CodedOutputStream.m(i); if (rvv == C15775iXO.RVV.GROUP) { m <<= 1; } return m + d(rvv, obj); } private static int d(C15775iXO.RVV rvv, Object obj) { switch (AnonymousClass4.e[rvv.ordinal()]) { case 1: return CodedOutputStream.c(); case 2: return CodedOutputStream.f(); case 3: return CodedOutputStream.b(((Long) obj).longValue()); case 4: return CodedOutputStream.a(((Long) obj).longValue()); case 5: return CodedOutputStream.i(((Integer) obj).intValue()); case 6: return CodedOutputStream.a(); case 7: return CodedOutputStream.d(); case 8: return CodedOutputStream.e(); case 9: return CodedOutputStream.c((vAr) obj); case 10: if (obj instanceof LsH) { return CodedOutputStream.b((LsH) obj); } return CodedOutputStream.b((vAr) obj); case 11: if (obj instanceof jra) { return CodedOutputStream.c((jra) obj); } return CodedOutputStream.b((String) obj); case 12: if (obj instanceof jra) { return CodedOutputStream.c((jra) obj); } return CodedOutputStream.e((byte[]) obj); case 13: return CodedOutputStream.l(((Integer) obj).intValue()); case 14: return CodedOutputStream.g(); case 15: return CodedOutputStream.h(); case 16: return CodedOutputStream.k(((Integer) obj).intValue()); case 17: return CodedOutputStream.c(((Long) obj).longValue()); case 18: if (obj instanceof oZe.LWm) { return CodedOutputStream.d(((oZe.LWm) obj).a()); } return CodedOutputStream.d(((Integer) obj).intValue()); default: throw new RuntimeException("There is no way to get here, but the compiler thinks otherwise."); } } public static int a(IeS ieS, Object obj) { int m; int d; C15775iXO.RVV a = ieS.a(); int e = ieS.e(); if (ieS.b()) { int i = 0; if (ieS.d()) { Iterator it = ((List) obj).iterator(); while (it.hasNext()) { i += d(a, it.next()); } m = CodedOutputStream.m(e) + i; d = CodedOutputStream.f(i); } else { for (Object obj2 : (List) obj) { int m2 = CodedOutputStream.m(e); if (a == C15775iXO.RVV.GROUP) { m2 <<= 1; } i += m2 + d(a, obj2); } return i; } } else { m = CodedOutputStream.m(e); if (a == C15775iXO.RVV.GROUP) { m <<= 1; } d = d(a, obj); } return m + d; } private QWH(byte b) { this(new qAt(0) { // from class: o.qAt.1 /* JADX INFO: Access modifiers changed from: package-private */ { byte b2 = 0; } @Override // o.qAt public final void d() { Iterable entrySet; if (!this.b) { for (int i = 0; i < this.c.size(); i++) { qAt.Sts sts = this.c.get(i); if (((QWH.IeS) sts.getKey()).b()) { sts.setValue(Collections.unmodifiableList((List) sts.getValue())); } } if (this.a.isEmpty()) { entrySet = HBt.c(); } else { entrySet = this.a.entrySet(); } for (Map.Entry entry : entrySet) { if (((QWH.IeS) entry.getKey()).b()) { entry.setValue(Collections.unmodifiableList((List) entry.getValue())); } } } super.d(); } }); if (this.a) { return; } this.d.d(); this.a = true; } /* JADX WARN: Multi-variable type inference failed */ /* renamed from: b, reason: merged with bridge method [inline-methods] */ public final QWH clone() { Iterable entrySet; QWH qwh = (QWH) new QWH(); for (int i = 0; i < this.d.c.size(); i++) { qAt.Sts sts = this.d.c.get(i); qwh.c((IeS) sts.getKey(), sts.getValue()); } qAt qat = this.d; if (qat.a.isEmpty()) { entrySet = qAt.HBt.c(); } else { entrySet = qat.a.entrySet(); } for (Map.Entry entry : entrySet) { qwh.c((IeS) entry.getKey(), entry.getValue()); } qwh.e = this.e; return qwh; } public static > QWH a() { return c; } }