package o; import com.google.zxing.FormatException; import com.google.zxing.NotFoundException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; import org.bouncycastle.asn1.x509.DisplayText; import org.bouncycastle.crypto.tls.CipherSuite; import org.bouncycastle.math.Primes; import org.jmrtd.cbeff.ISO781611; /* loaded from: classes2.dex */ public final class Qdn extends AYU { private boolean i; private static final int[] c = {7, 5, 4, 3, 1}; private static final int[] d = {4, 20, 52, 104, 204}; private static final int[] a = {0, 348, 1388, 2948, 3988}; private static final int[][] e = {new int[]{1, 8, 4, 1}, new int[]{3, 6, 4, 1}, new int[]{3, 4, 6, 1}, new int[]{3, 2, 8, 1}, new int[]{2, 6, 5, 1}, new int[]{2, 2, 9, 1}}; private static final int[][] f = {new int[]{1, 3, 9, 27, 81, 32, 96, 77}, new int[]{20, 60, CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA256, 118, CipherSuite.TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA, 7, 21, 63}, new int[]{CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256, CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA, 13, 39, 117, CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA, 209, 205}, new int[]{CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256, CipherSuite.TLS_RSA_WITH_AES_256_GCM_SHA384, 49, CipherSuite.TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA, 19, 57, CipherSuite.TLS_DHE_PSK_WITH_AES_256_GCM_SHA384, 91}, new int[]{62, CipherSuite.TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256, 136, CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256, CipherSuite.TLS_PSK_WITH_AES_256_GCM_SHA384, 85, 44, CipherSuite.TLS_RSA_WITH_CAMELLIA_256_CBC_SHA}, new int[]{CipherSuite.TLS_RSA_PSK_WITH_NULL_SHA384, 133, 188, 142, 4, 12, 36, 108}, new int[]{113, 128, CipherSuite.TLS_RSA_PSK_WITH_AES_256_GCM_SHA384, 97, 80, 29, 87, 50}, new int[]{CipherSuite.TLS_RSA_WITH_SEED_CBC_SHA, 28, 84, 41, 123, 158, 52, CipherSuite.TLS_RSA_WITH_AES_128_GCM_SHA256}, new int[]{46, CipherSuite.TLS_PSK_WITH_RC4_128_SHA, 203, CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256, CipherSuite.TLS_PSK_WITH_3DES_EDE_CBC_SHA, 206, CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256, CipherSuite.TLS_DH_anon_WITH_AES_128_GCM_SHA256}, new int[]{76, 17, 51, 153, 37, 111, 122, CipherSuite.TLS_DH_anon_WITH_SEED_CBC_SHA}, new int[]{43, 129, CipherSuite.TLS_PSK_WITH_NULL_SHA256, 106, 107, 110, 119, CipherSuite.TLS_RSA_PSK_WITH_RC4_128_SHA}, new int[]{16, 48, CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA, 10, 30, 90, 59, CipherSuite.TLS_PSK_WITH_NULL_SHA384}, new int[]{109, 116, CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA, DisplayText.DISPLAY_TEXT_MAXIMUM_SIZE, CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA256, 112, 125, CipherSuite.TLS_DH_DSS_WITH_AES_128_GCM_SHA256}, new int[]{70, 210, 208, 202, CipherSuite.TLS_RSA_PSK_WITH_NULL_SHA256, ISO781611.BIOMETRIC_SUBTYPE_TAG, CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA384, 115}, new int[]{134, CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256, 151, 31, 93, 68, 204, CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256}, new int[]{CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA, 22, 66, 198, CipherSuite.TLS_RSA_PSK_WITH_AES_128_GCM_SHA256, 94, 71, 2}, new int[]{6, 18, 54, CipherSuite.TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, 64, 192, CipherSuite.TLS_DHE_RSA_WITH_SEED_CBC_SHA, 40}, new int[]{120, CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA, 25, 75, 14, 42, 126, CipherSuite.TLS_DH_anon_WITH_AES_256_GCM_SHA384}, new int[]{79, 26, 78, 23, 69, 207, 199, CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA384}, new int[]{103, 98, 83, 38, 114, ISO781611.CREATION_DATE_AND_TIME_TAG, CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA256, 124}, new int[]{CipherSuite.TLS_DH_RSA_WITH_AES_256_GCM_SHA384, 61, CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA384, 127, CipherSuite.TLS_DHE_PSK_WITH_AES_128_GCM_SHA256, 88, 53, CipherSuite.TLS_DHE_RSA_WITH_AES_256_GCM_SHA384}, new int[]{55, CipherSuite.TLS_DH_DSS_WITH_AES_256_GCM_SHA384, 73, 8, 24, 72, 5, 15}, new int[]{45, 135, CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256, 160, 58, CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA256, 100, 89}}; private static final int[][] b = {new int[]{0, 0}, new int[]{0, 1, 1}, new int[]{0, 2, 1, 3}, new int[]{0, 4, 1, 3, 2}, new int[]{0, 4, 1, 3, 3, 5}, new int[]{0, 4, 1, 3, 4, 5, 5}, new int[]{0, 0, 1, 1, 2, 2, 3, 3}, new int[]{0, 0, 1, 1, 2, 2, 3, 4, 4}, new int[]{0, 0, 1, 1, 2, 2, 3, 4, 5, 5}, new int[]{0, 0, 1, 1, 2, 3, 3, 4, 4, 5, 5}}; private final List g = new ArrayList(11); private final List h = new ArrayList(); private final int[] j = new int[2]; @Override // o.xue public final WFF d(int i, C17416wdP c17416wdP, Map map) throws NotFoundException, FormatException { this.g.clear(); this.i = false; try { return d(e(i, c17416wdP)); } catch (NotFoundException unused) { this.g.clear(); this.i = true; return d(e(i, c17416wdP)); } } @Override // o.xue, o.zIz public final void c() { this.g.clear(); this.h.clear(); } /* JADX WARN: Code restructure failed: missing block: B:30:0x0048, code lost: if (r4.b.equals(r10.g) == false) goto L25; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private java.util.List e(int r11, o.C17416wdP r12) throws com.google.zxing.NotFoundException { /* Method dump skipped, instructions count: 247 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: o.Qdn.e(int, o.wdP):java.util.List"); } private List d(boolean z) { List list = null; if (this.h.size() > 25) { this.h.clear(); return null; } this.g.clear(); if (z) { Collections.reverse(this.h); } try { list = b(new ArrayList(), 0); } catch (NotFoundException unused) { } if (z) { Collections.reverse(this.h); } return list; } /* JADX WARN: Code restructure failed: missing block: B:22:0x0074, code lost: if (f() == false) goto L22; */ /* JADX WARN: Code restructure failed: missing block: B:23:0x0079, code lost: r1 = new java.util.ArrayList(r13); r1.add(r0); */ /* JADX WARN: Code restructure failed: missing block: B:28:0x0087, code lost: return b(r1, r14 + 1); */ /* JADX WARN: Code restructure failed: missing block: B:30:0x008b, code lost: continue; */ /* JADX WARN: Code restructure failed: missing block: B:31:0x008b, code lost: r14 = r14 + 1; */ /* JADX WARN: Code restructure failed: missing block: B:34:0x0078, code lost: return r12.g; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private java.util.List b(java.util.List r13, int r14) throws com.google.zxing.NotFoundException { /* r12 = this; L0: java.util.List r0 = r12.h int r0 = r0.size() if (r14 >= r0) goto L8f java.util.List r0 = r12.h java.lang.Object r0 = r0.get(r14) o.XHj r0 = (o.C1164XHj) r0 java.util.List r1 = r12.g r1.clear() java.util.Iterator r1 = r13.iterator() L19: boolean r2 = r1.hasNext() if (r2 == 0) goto L2d java.lang.Object r2 = r1.next() o.XHj r2 = (o.C1164XHj) r2 java.util.List r3 = r12.g java.util.List r2 = r2.b r3.addAll(r2) goto L19 L2d: java.util.List r1 = r12.g java.util.List r2 = r0.b r1.addAll(r2) java.util.List r1 = r12.g int[][] r2 = o.Qdn.b int r3 = r2.length r4 = 0 r5 = r4 L3b: if (r5 >= r3) goto L8b r6 = r2[r5] int r7 = r1.size() int r8 = r6.length if (r7 > r8) goto L88 r7 = r4 L47: int r8 = r1.size() if (r7 >= r8) goto L70 java.lang.Object r8 = r1.get(r7) o.xCL r8 = (o.xCL) r8 java.lang.Object[] r9 = new java.lang.Object[]{r8} int r8 = java.lang.System.identityHashCode(r8) r10 = -1474737539(0xffffffffa8194a7d, float:-8.509358E-15) r11 = 1474737539(0x57e6b583, float:5.0733452E14) java.lang.Object r8 = o.xCL.a(r9, r10, r11, r8) o.vbq r8 = (o.C17296vbq) r8 int r8 = r8.e r9 = r6[r7] if (r8 != r9) goto L88 int r7 = r7 + 1 goto L47 L70: boolean r1 = r12.f() if (r1 == 0) goto L79 java.util.List r13 = r12.g return r13 L79: java.util.ArrayList r1 = new java.util.ArrayList r1.(r13) r1.add(r0) int r0 = r14 + 1 java.util.List r13 = r12.b(r1, r0) // Catch: com.google.zxing.NotFoundException -> L8b return r13 L88: int r5 = r5 + 1 goto L3b L8b: int r14 = r14 + 1 goto L0 L8f: com.google.zxing.NotFoundException r13 = com.google.zxing.NotFoundException.b() throw r13 */ throw new UnsupportedOperationException("Method not decompiled: o.Qdn.b(java.util.List, int):java.util.List"); } private boolean f() { xCL xcl = this.g.get(0); RHO a2 = xcl.a(); RHO e2 = xcl.e(); if (e2 == null) { return false; } int i = e2.a; int i2 = 2; for (int i3 = 1; i3 < this.g.size(); i3++) { xCL xcl2 = this.g.get(i3); i += xcl2.a().a; RHO e3 = xcl2.e(); if (e3 != null) { i += e3.a; i2 += 2; } else { i2++; } } return ((i2 + (-4)) * Primes.SMALL_FACTOR_LIMIT) + (i % Primes.SMALL_FACTOR_LIMIT) == a2.d; } private xCL b(C17416wdP c17416wdP, List list, int i) throws NotFoundException { int i2; RHO rho; int a2; int i3 = 2; int i4 = 0; boolean z = list.size() % 2 == 0; if (this.i) { z = !z; } int i5 = -1; boolean z2 = true; while (true) { int[] d2 = d(); d2[i4] = i4; d2[1] = i4; d2[i3] = i4; d2[3] = i4; int i6 = c17416wdP.d; if (i5 >= 0) { i2 = i5; } else if (list.isEmpty()) { i2 = i4; } else { xCL xcl = list.get(list.size() - 1); Object[] objArr = {xcl}; System.identityHashCode(xcl); i2 = ((C17296vbq) xCL.d(objArr)).b[1]; } int i7 = list.size() % i3 != 0 ? 1 : i4; if (this.i) { i7 ^= 1; } int i8 = i4; while (i2 < i6) { i8 = ((c17416wdP.a[i2 / 32] & (1 << (i2 & 31))) == 0 ? i4 : 1) ^ 1; if (i8 == 0) { break; } i2++; } int i9 = i4; int i10 = i8; int i11 = i2; while (i2 < i6) { if ((((1 << (i2 & 31)) & c17416wdP.a[i2 / 32]) == 0 ? 0 : 1) != i10) { d2[i9] = d2[i9] + 1; } else { if (i9 == 3) { if (i7 != 0) { c(d2); } if (b(d2)) { int[] iArr = this.j; iArr[0] = i11; iArr[1] = i2; C17296vbq a3 = a(c17416wdP, i, z); if (a3 == null) { int i12 = this.j[0]; if ((c17416wdP.a[i12 / 32] & (1 << (i12 & 31))) != 0) { a2 = c17416wdP.a(c17416wdP.c(i12)); } else { a2 = c17416wdP.c(c17416wdP.a(i12)); } i5 = a2; } else { z2 = false; } if (!z2) { RHO b2 = b(c17416wdP, a3, z, true); if (!list.isEmpty() && list.get(list.size() - 1).c()) { throw NotFoundException.b(); } try { rho = b(c17416wdP, a3, z, false); } catch (NotFoundException unused) { rho = null; } return new xCL(b2, rho, a3); } i3 = 2; i4 = 0; } else { if (i7 != 0) { c(d2); } i11 += d2[0] + d2[1]; d2[0] = d2[2]; d2[1] = d2[3]; d2[2] = 0; d2[3] = 0; i9--; } } else { i9++; } d2[i9] = 1; i10 ^= 1; } i2++; } throw NotFoundException.b(); } } private static void c(int[] iArr) { int length = iArr.length; for (int i = 0; i < length / 2; i++) { int i2 = iArr[i]; int i3 = (length - i) - 1; iArr[i] = iArr[i3]; iArr[i3] = i2; } } private C17296vbq a(C17416wdP c17416wdP, int i, boolean z) { int i2; int i3; int i4; if (z) { int i5 = this.j[0] - 1; while (i5 >= 0 && (c17416wdP.a[i5 / 32] & (1 << (i5 & 31))) == 0) { i5--; } int i6 = i5 + 1; int[] iArr = this.j; i4 = iArr[0] - i6; i2 = iArr[1]; i3 = i6; } else { int[] iArr2 = this.j; int i7 = iArr2[0]; int c2 = c17416wdP.c(iArr2[1] + 1); i2 = c2; i3 = i7; i4 = c2 - this.j[1]; } int[] d2 = d(); System.arraycopy(d2, 0, d2, 1, d2.length - 1); d2[0] = i4; try { return new C17296vbq(c(d2, e), new int[]{i3, i2}, i3, i2, i); } catch (NotFoundException unused) { return null; } } private RHO b(C17416wdP c17416wdP, C17296vbq c17296vbq, boolean z, boolean z2) throws NotFoundException { boolean z3; boolean z4; boolean z5; boolean z6; int[] b2 = b(); Arrays.fill(b2, 0); if (z2) { a(c17416wdP, c17296vbq.b[0], b2); } else { b(c17416wdP, c17296vbq.b[1], b2); int i = 0; for (int length = b2.length - 1; i < length; length--) { int i2 = b2[i]; b2[i] = b2[length]; b2[length] = i2; i++; } } int i3 = 0; for (int i4 : b2) { i3 += i4; } float f2 = i3 / 17.0f; float f3 = (c17296vbq.b[1] - c17296vbq.b[0]) / 15.0f; if (Math.abs(f2 - f3) / f3 > 0.3f) { throw NotFoundException.b(); } int[] h = h(); int[] e2 = e(); float[] i5 = i(); float[] a2 = a(); for (int i6 = 0; i6 < b2.length; i6++) { float f4 = b2[i6] / f2; int i7 = (int) (0.5f + f4); if (i7 <= 0) { if (f4 < 0.3f) { throw NotFoundException.b(); } i7 = 1; } else if (i7 > 8) { if (f4 > 8.7f) { throw NotFoundException.b(); } i7 = 8; } int i8 = i6 / 2; if ((i6 & 1) == 0) { h[i8] = i7; i5[i8] = f4 - i7; } else { e2[i8] = i7; a2[i8] = f4 - i7; } } int i9 = 0; for (int i10 : h()) { i9 += i10; } int i11 = 0; for (int i12 : e()) { i11 += i12; } if (i9 > 13) { z3 = false; z4 = true; } else { boolean z7 = false; if (i9 < 4) { z3 = true; z4 = z7; } else { z3 = false; z4 = z7; } } if (i11 > 13) { z5 = false; z6 = true; } else if (i11 < 4) { z6 = false; z5 = true; } else { z5 = false; z6 = false; } int i13 = (i9 + i11) - 17; boolean z8 = (i9 & 1) == 1; boolean z9 = (i11 & 1) == 0; boolean z10 = z4; boolean z11 = z3; boolean z12 = z5; boolean z13 = z6; if (i13 != -1) { if (i13 != 0) { if (i13 != 1) { throw NotFoundException.b(); } if (z8) { if (z9) { throw NotFoundException.b(); } z10 = true; z11 = z3; z12 = z5; z13 = z6; } else { if (!z9) { throw NotFoundException.b(); } z13 = true; z10 = z4; z11 = z3; z12 = z5; } } else if (z8) { if (!z9) { throw NotFoundException.b(); } if (i9 < i11) { z11 = true; z13 = true; z10 = z4; z12 = z5; } else { z10 = true; z12 = true; z11 = z3; z13 = z6; } } else if (z9) { throw NotFoundException.b(); } } else if (z8) { if (z9) { throw NotFoundException.b(); } z11 = true; z10 = z4; z12 = z5; z13 = z6; } else { if (!z9) { throw NotFoundException.b(); } z12 = true; z10 = z4; z11 = z3; z13 = z6; } if (z11) { if (z10) { throw NotFoundException.b(); } d(h(), i()); } if (z10) { c(h(), i()); } if (z12) { if (z13) { throw NotFoundException.b(); } d(e(), i()); } if (z13) { c(e(), a()); } int i14 = (((c17296vbq.e << 2) + (z ? 0 : 2)) + (!z2 ? 1 : 0)) - 1; int i15 = 0; int i16 = 0; for (int length2 = h.length - 1; length2 >= 0; length2--) { if (c17296vbq.e != 0 || !z || !z2) { i15 += h[length2] * f[i14][length2 << 1]; } i16 += h[length2]; } int i17 = 0; for (int length3 = e2.length - 1; length3 >= 0; length3--) { if (c17296vbq.e != 0 || !z || !z2) { i17 += e2[length3] * f[i14][(length3 << 1) + 1]; } } if ((i16 & 1) != 0 || i16 > 13 || i16 < 4) { throw NotFoundException.b(); } int i18 = (13 - i16) / 2; int i19 = c[i18]; return new RHO((Udf.d(h, i19, true) * d[i18]) + Udf.d(e2, 9 - i19, false) + a[i18], i15 + i17); } private static WFF d(List list) throws NotFoundException, FormatException { SpN c3757bFs; int size = list.size() << 1; int i = size - 1; if (list.get(list.size() - 1).e() == null) { i = size - 2; } C17416wdP c17416wdP = new C17416wdP(i * 12); int i2 = list.get(0).e().d; int i3 = 0; for (int i4 = 11; i4 >= 0; i4--) { if (((1 << i4) & i2) != 0) { int[] iArr = c17416wdP.a; int i5 = i3 / 32; iArr[i5] = (1 << (i3 & 31)) | iArr[i5]; } i3++; } for (int i6 = 1; i6 < list.size(); i6++) { xCL xcl = list.get(i6); int i7 = xcl.a().d; for (int i8 = 11; i8 >= 0; i8--) { if (((1 << i8) & i7) != 0) { int[] iArr2 = c17416wdP.a; int i9 = i3 / 32; iArr2[i9] = (1 << (i3 & 31)) | iArr2[i9]; } i3++; } if (xcl.e() != null) { int i10 = xcl.e().d; for (int i11 = 11; i11 >= 0; i11--) { if (((1 << i11) & i10) != 0) { int[] iArr3 = c17416wdP.a; int i12 = i3 / 32; iArr3[i12] = (1 << (i3 & 31)) | iArr3[i12]; } i3++; } } } if ((c17416wdP.a[0] & 2) != 0) { c3757bFs = new C3757bFs(c17416wdP); } else if ((c17416wdP.a[0] & 4) == 0) { c3757bFs = new C0160Alx(c17416wdP); } else { int d2 = itT.d(c17416wdP, 1, 4); if (d2 == 4) { c3757bFs = new lbE(c17416wdP); } else if (d2 == 5) { c3757bFs = new DIn(c17416wdP); } else { int d3 = itT.d(c17416wdP, 1, 5); if (d3 == 12) { c3757bFs = new kRf(c17416wdP); } else if (d3 == 13) { c3757bFs = new uZT(c17416wdP); } else { switch (itT.d(c17416wdP, 1, 7)) { case 56: c3757bFs = new Bzp(c17416wdP, "310", "11"); break; case 57: c3757bFs = new Bzp(c17416wdP, "320", "11"); break; case 58: c3757bFs = new Bzp(c17416wdP, "310", "13"); break; case 59: c3757bFs = new Bzp(c17416wdP, "320", "13"); break; case 60: c3757bFs = new Bzp(c17416wdP, "310", "15"); break; case 61: c3757bFs = new Bzp(c17416wdP, "320", "15"); break; case 62: c3757bFs = new Bzp(c17416wdP, "310", "17"); break; case 63: c3757bFs = new Bzp(c17416wdP, "320", "17"); break; default: throw new IllegalStateException("unknown decoder: ".concat(String.valueOf(c17416wdP))); } } } } String a2 = c3757bFs.a(); xCL xcl2 = list.get(0); Object[] objArr = {xcl2}; System.identityHashCode(xcl2); qCz[] qczArr = ((C17296vbq) xCL.d(objArr)).d; xCL xcl3 = list.get(list.size() - 1); Object[] objArr2 = {xcl3}; System.identityHashCode(xcl3); qCz[] qczArr2 = ((C17296vbq) xCL.d(objArr2)).d; WFF wff = new WFF(a2, null, new qCz[]{qczArr[0], qczArr[1], qczArr2[0], qczArr2[1]}, PTS.RSS_EXPANDED); wff.b(MoF.SYMBOLOGY_IDENTIFIER, "]e0"); return wff; } }