package o; import com.google.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.C1174XdZ; import o.InterfaceC16581pUl; import o.MTP; import o.Nvr; import o.Rkw; import o.Rkw.Sts; import o.rqb; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes2.dex */ public final class Rkw> { private static final Rkw e = new Rkw((byte) 0); boolean b; final rqb c; boolean d; /* loaded from: classes2.dex */ public interface Sts> extends Comparable { Nvr.HBt a(); int b(); InterfaceC16581pUl.HBt b(InterfaceC16581pUl.HBt hBt, InterfaceC16581pUl interfaceC16581pUl); Nvr.Sts c(); boolean d(); boolean e(); } private Rkw() { final int i = 16; this.c = (rqb) new rqb(i) { // from class: o.rqb.1 /* JADX INFO: Access modifiers changed from: package-private */ { byte b = 0; } @Override // o.rqb, java.util.AbstractMap, java.util.Map public final /* synthetic */ Object put(Object obj, Object obj2) { return super.put((Rkw.Sts) obj, obj2); } @Override // o.rqb public final void d() { Iterable entrySet; if (!this.c) { for (int i2 = 0; i2 < this.e.size(); i2++) { rqb.RVV rvv = this.e.get(i2); if (((Rkw.Sts) rvv.getKey()).d()) { rvv.setValue(Collections.unmodifiableList((List) rvv.getValue())); } } if (this.b.isEmpty()) { entrySet = HBt.c(); } else { entrySet = this.b.entrySet(); } for (Map.Entry entry : entrySet) { if (((Rkw.Sts) entry.getKey()).d()) { entry.setValue(Collections.unmodifiableList((List) entry.getValue())); } } } super.d(); } }; } private Rkw(rqb rqbVar) { this.c = rqbVar; if (this.d) { return; } rqbVar.d(); this.d = true; } public final boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof Rkw) { return this.c.equals(((Rkw) obj).c); } return false; } public final int hashCode() { return this.c.hashCode(); } public final Iterator> b() { if (this.b) { return new C1174XdZ.Sts(this.c.entrySet().iterator()); } return this.c.entrySet().iterator(); } private void d(T t, Object obj) { if (t.d()) { 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 C1174XdZ) { this.b = true; } this.c.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.Nvr$HBt r0 = r2.a() o.MTP.d(r3) int[] r1 = o.Rkw.AnonymousClass1.c o.Nvr$Sts 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.InterfaceC16581pUl if (r0 != 0) goto L43 boolean r0 = r3 instanceof o.C1174XdZ 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.MTP.IeS if (r0 == 0) goto L44 goto L43 L27: boolean r0 = r3 instanceof o.QwV 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.b() o.Nvr$HBt r2 = r2.a() o.Nvr$Sts 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.Rkw.e(o.Rkw$Sts, java.lang.Object):void"); } public final boolean a() { Iterable entrySet; for (int i = 0; i < this.c.e.size(); i++) { if (!c(this.c.e.get(i))) { return false; } } rqb rqbVar = this.c; if (rqbVar.b.isEmpty()) { entrySet = rqb.HBt.c(); } else { entrySet = rqbVar.b.entrySet(); } Iterator it = entrySet.iterator(); while (it.hasNext()) { if (!c((Map.Entry) it.next())) { return false; } } return true; } private static > boolean c(Map.Entry entry) { T key = entry.getKey(); if (key.c() == Nvr.Sts.MESSAGE) { if (key.d()) { Iterator it = ((List) entry.getValue()).iterator(); while (it.hasNext()) { if (!((InterfaceC16581pUl) it.next()).isInitialized()) { return false; } } } else { Object value = entry.getValue(); if (value instanceof InterfaceC16581pUl) { if (!((InterfaceC16581pUl) value).isInitialized()) { return false; } } else { if (value instanceof C1174XdZ) { 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 a(Map.Entry entry) { T key = entry.getKey(); Object value = entry.getValue(); if (value instanceof C1174XdZ) { C1174XdZ c1174XdZ = (C1174XdZ) value; InterfaceC16581pUl interfaceC16581pUl = c1174XdZ.d; value = c1174XdZ.e(null); } if (!key.d()) { if (key.c() == Nvr.Sts.MESSAGE) { Object obj = this.c.get(key); if (obj instanceof C1174XdZ) { C1174XdZ c1174XdZ2 = (C1174XdZ) obj; InterfaceC16581pUl interfaceC16581pUl2 = c1174XdZ2.d; obj = c1174XdZ2.e(null); } if (obj == null) { rqb rqbVar = this.c; if (value instanceof byte[]) { byte[] bArr = (byte[]) value; byte[] bArr2 = new byte[bArr.length]; System.arraycopy(bArr, 0, bArr2, 0, bArr.length); value = bArr2; } rqbVar.put(key, value); return; } this.c.put(key, key.b(((InterfaceC16581pUl) obj).toBuilder(), (InterfaceC16581pUl) value).build()); return; } rqb rqbVar2 = this.c; if (value instanceof byte[]) { byte[] bArr3 = (byte[]) value; byte[] bArr4 = new byte[bArr3.length]; System.arraycopy(bArr3, 0, bArr4, 0, bArr3.length); value = bArr4; } rqbVar2.put(key, value); return; } Object obj2 = this.c.get(key); if (obj2 instanceof C1174XdZ) { C1174XdZ c1174XdZ3 = (C1174XdZ) obj2; InterfaceC16581pUl interfaceC16581pUl3 = c1174XdZ3.d; obj2 = c1174XdZ3.e(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.c.put(key, obj2); } /* JADX INFO: Access modifiers changed from: package-private */ public static void b(CodedOutputStream codedOutputStream, Nvr.HBt hBt, int i, Object obj) throws IOException { if (hBt != Nvr.HBt.GROUP) { codedOutputStream.g(i, hBt.wireType); switch (AnonymousClass1.b[hBt.ordinal()]) { case 1: codedOutputStream.e(Double.doubleToRawLongBits(((Double) obj).doubleValue())); return; case 2: codedOutputStream.p(Float.floatToRawIntBits(((Float) obj).floatValue())); return; case 3: codedOutputStream.a(((Long) obj).longValue()); return; case 4: codedOutputStream.a(((Long) obj).longValue()); return; case 5: codedOutputStream.t(((Integer) obj).intValue()); return; case 6: codedOutputStream.e(((Long) obj).longValue()); return; case 7: codedOutputStream.p(((Integer) obj).intValue()); return; case 8: codedOutputStream.a(((Boolean) obj).booleanValue() ? (byte) 1 : (byte) 0); return; case 9: ((InterfaceC16581pUl) obj).writeTo(codedOutputStream); return; case 10: codedOutputStream.b((InterfaceC16581pUl) obj); return; case 11: if (obj instanceof QwV) { codedOutputStream.c((QwV) obj); return; } else { codedOutputStream.a((String) obj); return; } case 12: if (obj instanceof QwV) { codedOutputStream.c((QwV) obj); return; } else { byte[] bArr = (byte[]) obj; codedOutputStream.d(bArr, bArr.length); return; } case 13: codedOutputStream.r(((Integer) obj).intValue()); return; case 14: codedOutputStream.p(((Integer) obj).intValue()); return; case 15: codedOutputStream.e(((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.a((longValue << 1) ^ (longValue >> 63)); return; case 18: if (obj instanceof MTP.IeS) { codedOutputStream.t(((MTP.IeS) obj).d()); return; } else { codedOutputStream.t(((Integer) obj).intValue()); return; } default: return; } } codedOutputStream.g(i, 3); ((InterfaceC16581pUl) obj).writeTo(codedOutputStream); codedOutputStream.g(i, 4); } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: o.Rkw$1, reason: invalid class name */ /* loaded from: classes2.dex */ public static /* synthetic */ class AnonymousClass1 { static final int[] b; static final int[] c; static { int[] iArr = new int[Nvr.HBt.values().length]; b = iArr; try { iArr[Nvr.HBt.DOUBLE.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { b[Nvr.HBt.FLOAT.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { b[Nvr.HBt.INT64.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } try { b[Nvr.HBt.UINT64.ordinal()] = 4; } catch (NoSuchFieldError unused4) { } try { b[Nvr.HBt.INT32.ordinal()] = 5; } catch (NoSuchFieldError unused5) { } try { b[Nvr.HBt.FIXED64.ordinal()] = 6; } catch (NoSuchFieldError unused6) { } try { b[Nvr.HBt.FIXED32.ordinal()] = 7; } catch (NoSuchFieldError unused7) { } try { b[Nvr.HBt.BOOL.ordinal()] = 8; } catch (NoSuchFieldError unused8) { } try { b[Nvr.HBt.GROUP.ordinal()] = 9; } catch (NoSuchFieldError unused9) { } try { b[Nvr.HBt.MESSAGE.ordinal()] = 10; } catch (NoSuchFieldError unused10) { } try { b[Nvr.HBt.STRING.ordinal()] = 11; } catch (NoSuchFieldError unused11) { } try { b[Nvr.HBt.BYTES.ordinal()] = 12; } catch (NoSuchFieldError unused12) { } try { b[Nvr.HBt.UINT32.ordinal()] = 13; } catch (NoSuchFieldError unused13) { } try { b[Nvr.HBt.SFIXED32.ordinal()] = 14; } catch (NoSuchFieldError unused14) { } try { b[Nvr.HBt.SFIXED64.ordinal()] = 15; } catch (NoSuchFieldError unused15) { } try { b[Nvr.HBt.SINT32.ordinal()] = 16; } catch (NoSuchFieldError unused16) { } try { b[Nvr.HBt.SINT64.ordinal()] = 17; } catch (NoSuchFieldError unused17) { } try { b[Nvr.HBt.ENUM.ordinal()] = 18; } catch (NoSuchFieldError unused18) { } int[] iArr2 = new int[Nvr.Sts.values().length]; c = iArr2; try { iArr2[Nvr.Sts.INT.ordinal()] = 1; } catch (NoSuchFieldError unused19) { } try { c[Nvr.Sts.LONG.ordinal()] = 2; } catch (NoSuchFieldError unused20) { } try { c[Nvr.Sts.FLOAT.ordinal()] = 3; } catch (NoSuchFieldError unused21) { } try { c[Nvr.Sts.DOUBLE.ordinal()] = 4; } catch (NoSuchFieldError unused22) { } try { c[Nvr.Sts.BOOLEAN.ordinal()] = 5; } catch (NoSuchFieldError unused23) { } try { c[Nvr.Sts.STRING.ordinal()] = 6; } catch (NoSuchFieldError unused24) { } try { c[Nvr.Sts.BYTE_STRING.ordinal()] = 7; } catch (NoSuchFieldError unused25) { } try { c[Nvr.Sts.ENUM.ordinal()] = 8; } catch (NoSuchFieldError unused26) { } try { c[Nvr.Sts.MESSAGE.ordinal()] = 9; } catch (NoSuchFieldError unused27) { } } } /* JADX INFO: Access modifiers changed from: package-private */ public static int b(Map.Entry entry) { T key = entry.getKey(); Object value = entry.getValue(); if (key.c() == Nvr.Sts.MESSAGE && !key.d() && !key.e()) { if (value instanceof C1174XdZ) { return CodedOutputStream.b(entry.getKey().b(), (C1174XdZ) value); } return CodedOutputStream.b(entry.getKey().b(), (InterfaceC16581pUl) value); } return a((Sts) key, value); } /* JADX INFO: Access modifiers changed from: package-private */ public static int b(Nvr.HBt hBt, int i, Object obj) { int o2 = CodedOutputStream.o(i); if (hBt == Nvr.HBt.GROUP) { o2 <<= 1; } return o2 + a(hBt, obj); } private static int a(Nvr.HBt hBt, Object obj) { switch (AnonymousClass1.b[hBt.ordinal()]) { case 1: return CodedOutputStream.d(); case 2: return CodedOutputStream.h(); case 3: return CodedOutputStream.b(((Long) obj).longValue()); case 4: return CodedOutputStream.d(((Long) obj).longValue()); case 5: return CodedOutputStream.g(((Integer) obj).intValue()); case 6: return CodedOutputStream.e(); case 7: return CodedOutputStream.b(); case 8: return CodedOutputStream.c(); case 9: return CodedOutputStream.a((InterfaceC16581pUl) obj); case 10: if (obj instanceof C1174XdZ) { return CodedOutputStream.d((C1174XdZ) obj); } return CodedOutputStream.d((InterfaceC16581pUl) obj); case 11: if (obj instanceof QwV) { return CodedOutputStream.b((QwV) obj); } return CodedOutputStream.d((String) obj); case 12: if (obj instanceof QwV) { return CodedOutputStream.b((QwV) obj); } return CodedOutputStream.b((byte[]) obj); case 13: return CodedOutputStream.k(((Integer) obj).intValue()); case 14: return CodedOutputStream.j(); case 15: return CodedOutputStream.g(); case 16: return CodedOutputStream.m(((Integer) obj).intValue()); case 17: return CodedOutputStream.c(((Long) obj).longValue()); case 18: if (obj instanceof MTP.IeS) { return CodedOutputStream.c(((MTP.IeS) obj).d()); } return CodedOutputStream.c(((Integer) obj).intValue()); default: throw new RuntimeException("There is no way to get here, but the compiler thinks otherwise."); } } public static int a(Sts sts, Object obj) { int o2; int a; Nvr.HBt a2 = sts.a(); int b = sts.b(); if (sts.d()) { int i = 0; if (sts.e()) { Iterator it = ((List) obj).iterator(); while (it.hasNext()) { i += a(a2, it.next()); } o2 = CodedOutputStream.o(b) + i; a = CodedOutputStream.j(i); } else { for (Object obj2 : (List) obj) { int o3 = CodedOutputStream.o(b); if (a2 == Nvr.HBt.GROUP) { o3 <<= 1; } i += o3 + a(a2, obj2); } return i; } } else { o2 = CodedOutputStream.o(b); if (a2 == Nvr.HBt.GROUP) { o2 <<= 1; } a = a(a2, obj); } return o2 + a; } /* JADX WARN: Illegal instructions before constructor call */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private Rkw(byte r2) { /* r1 = this; o.rqb$1 r2 = new o.rqb$1 r0 = 0 r2.(r0) r1.(r2) boolean r2 = r1.d if (r2 != 0) goto L15 o.rqb, java.lang.Object> r2 = r1.c r2.d() r2 = 1 r1.d = r2 L15: return */ throw new UnsupportedOperationException("Method not decompiled: o.Rkw.(byte):void"); } /* JADX WARN: Multi-variable type inference failed */ /* renamed from: e, reason: merged with bridge method [inline-methods] */ public final Rkw clone() { Iterable entrySet; Rkw rkw = (Rkw) new Rkw(); for (int i = 0; i < this.c.e.size(); i++) { rqb.RVV rvv = this.c.e.get(i); rkw.d((Sts) rvv.getKey(), rvv.getValue()); } rqb rqbVar = this.c; if (rqbVar.b.isEmpty()) { entrySet = rqb.HBt.c(); } else { entrySet = rqbVar.b.entrySet(); } for (Map.Entry entry : entrySet) { rkw.d((Sts) entry.getKey(), entry.getValue()); } rkw.b = this.b; return rkw; } public static > Rkw c() { return e; } }