package o; import com.google.zxing.ChecksumException; import com.google.zxing.FormatException; /* renamed from: o.yqB, reason: case insensitive filesystem */ /* loaded from: classes2.dex */ public final class C17683yqB { private static final lyd e = new lyd(); /* JADX WARN: Code restructure failed: missing block: B:341:0x005a, code lost: if (r5.b != r7.b) goto L22; */ /* JADX WARN: Multi-variable type inference failed */ /* JADX WARN: Removed duplicated region for block: B:10:0x008f */ /* JADX WARN: Removed duplicated region for block: B:327:0x04c6 A[SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:344:0x0068 */ /* JADX WARN: Removed duplicated region for block: B:59:0x019d */ /* JADX WARN: Removed duplicated region for block: B:60:0x01d8 */ /* JADX WARN: Type inference failed for: r9v31 */ /* JADX WARN: Type inference failed for: r9v32, types: [boolean] */ /* JADX WARN: Type inference failed for: r9v33 */ /* JADX WARN: Type inference failed for: r9v45, types: [o.iJs] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public static o.Qys a(o.C8902dZc r21, o.qCz r22, o.qCz r23, o.qCz r24, o.qCz r25, int r26, int r27) throws com.google.zxing.NotFoundException, com.google.zxing.FormatException, com.google.zxing.ChecksumException { /* Method dump skipped, instructions count: 1227 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: o.C17683yqB.a(o.dZc, o.qCz, o.qCz, o.qCz, o.qCz, int, int):o.Qys"); } private static C16621pkz e(C8902dZc c8902dZc, hOP hop, qCz qcz, boolean z, int i, int i2) { int i3; C16621pkz c16621pkz = new C16621pkz(hop, z); int i4 = 0; while (i4 < 2) { int i5 = i4 == 0 ? 1 : -1; int i6 = (int) qcz.a; for (int i7 = (int) qcz.e; i7 <= hop.d && i7 >= hop.h; i7 += i5) { vDP d = d(c8902dZc, 0, c8902dZc.e, z, i6, i7, i, i2); if (d != null) { c16621pkz.e[i7 - c16621pkz.d.h] = d; if (z) { i3 = d.d; } else { i3 = d.a; } i6 = i3; } } i4++; } return c16621pkz; } private static Qys a(int i, int[] iArr, int[] iArr2, int[] iArr3, int[][] iArr4) throws FormatException, ChecksumException { int[] iArr5; int i2; int[] iArr6; int i3; cVU cvu; int[] iArr7 = iArr3; int length = iArr7.length; int[] iArr8 = new int[length]; int i4 = 100; while (i4 > 0) { for (int i5 = 0; i5 < length; i5++) { iArr[iArr7[i5]] = iArr4[i5][iArr8[i5]]; } int i6 = 1; try { if (iArr.length == 0) { throw FormatException.c(); } int i7 = 1 << (i + 1); if ((iArr2 != null && iArr2.length > (i7 / 2) + 3) || i7 < 0 || i7 > 512) { throw ChecksumException.e(); } lyd lydVar = e; cVU cvu2 = new cVU(lydVar.b, iArr); int[] iArr9 = new int[i7]; boolean z = false; for (int i8 = i7; i8 > 0; i8--) { int d = cvu2.d(lydVar.b.d[i8]); iArr9[i7 - i8] = d; if (d != 0) { z = true; } } if (z) { cVU cvu3 = lydVar.b.a; if (iArr2 != null) { for (int i9 : iArr2) { int i10 = lydVar.b.d[(iArr.length - 1) - i9]; C5057blp c5057blp = lydVar.b; int i11 = c5057blp.e; cvu3 = cvu3.e(new cVU(c5057blp, new int[]{(i11 - i10) % i11, 1})); } } cVU cvu4 = new cVU(lydVar.b, iArr9); cVU b = lydVar.b.b(i7, 1); if (b.c.length - 1 < cvu4.c.length - 1) { b = cvu4; cvu4 = b; } cVU cvu5 = lydVar.b.i; cVU cvu6 = lydVar.b.a; while (cvu4.c.length - i6 >= i7 / 2) { if (cvu4.c[0] == 0) { throw ChecksumException.e(); } cVU cvu7 = lydVar.b.i; int length2 = cvu4.c.length - i6; int[] iArr10 = cvu4.c; int d2 = lydVar.b.d(iArr10[(iArr10.length - i6) - length2]); while (b.c.length - i6 >= cvu4.c.length - i6 && b.c[0] != 0) { int length3 = (b.c.length - i6) - (cvu4.c.length - i6); i2 = i4; try { iArr5 = iArr8; } catch (ChecksumException unused) { iArr5 = iArr8; } try { int c = lydVar.b.c(b.c[(r5.length - 1) - (b.c.length - 1)], d2); cvu7 = cvu7.b(lydVar.b.b(length3, c)); if (length3 >= 0) { if (c == 0) { cvu = cvu4.d.i; i3 = d2; } else { int length4 = cvu4.c.length; int[] iArr11 = new int[length3 + length4]; int i12 = 0; while (i12 < length4) { iArr11[i12] = cvu4.d.c(cvu4.c[i12], c); i12++; d2 = d2; } i3 = d2; cvu = new cVU(cvu4.d, iArr11); } b = b.a(cvu); i4 = i2; iArr8 = iArr5; d2 = i3; i6 = 1; } else { throw new IllegalArgumentException(); } } catch (ChecksumException unused2) { if (length == 0) { throw ChecksumException.e(); } int i13 = 0; while (true) { if (i13 >= length) { break; } int i14 = iArr5[i13]; if (i14 < iArr4[i13].length - 1) { iArr5[i13] = i14 + 1; break; } iArr5[i13] = 0; if (i13 == length - 1) { throw ChecksumException.e(); } i13++; } i4 = i2 - 1; iArr7 = iArr3; iArr8 = iArr5; } } cVU c2 = cvu7.e(cvu6).a(cvu5).c(); cvu5 = cvu6; i4 = i4; iArr8 = iArr8; i6 = 1; cvu6 = c2; cVU cvu8 = b; b = cvu4; cvu4 = cvu8; } int[] iArr12 = cvu6.c; int i15 = iArr12[iArr12.length - 1]; if (i15 == 0) { throw ChecksumException.e(); } int d3 = lydVar.b.d(i15); cVU[] cvuArr = {cvu6.a(d3), cvu4.a(d3)}; cVU cvu9 = cvuArr[0]; cVU cvu10 = cvuArr[1]; int length5 = cvu9.c.length - 1; int[] iArr13 = new int[length5]; int i16 = 0; for (int i17 = 1; i17 < lydVar.b.e && i16 < length5; i17++) { if (cvu9.d(i17) == 0) { iArr13[i16] = lydVar.b.d(i17); i16++; } } if (i16 == length5) { int length6 = cvu9.c.length - 1; if (length6 <= 0) { iArr6 = new int[0]; } else { int[] iArr14 = new int[length6]; for (int i18 = 1; i18 <= length6; i18++) { iArr14[length6 - i18] = lydVar.b.c(i18, cvu9.c[(r14.length - 1) - i18]); } cVU cvu11 = new cVU(lydVar.b, iArr14); int[] iArr15 = new int[length5]; for (int i19 = 0; i19 < length5; i19++) { int d4 = lydVar.b.d(iArr13[i19]); C5057blp c5057blp2 = lydVar.b; int d5 = cvu10.d(d4); int i20 = c5057blp2.e; iArr15[i19] = lydVar.b.c((i20 - d5) % i20, lydVar.b.d(cvu11.d(d4))); } iArr6 = iArr15; } for (int i21 = 0; i21 < length5; i21++) { int length7 = iArr.length - 1; C5057blp c5057blp3 = lydVar.b; int i22 = iArr13[i21]; if (i22 == 0) { throw new IllegalArgumentException(); } int i23 = length7 - c5057blp3.b[i22]; if (i23 >= 0) { C5057blp c5057blp4 = lydVar.b; int i24 = iArr[i23]; int i25 = iArr6[i21]; int i26 = c5057blp4.e; iArr[i23] = ((i24 + i26) - i25) % i26; } else { throw ChecksumException.e(); } } } else { throw ChecksumException.e(); } } if (iArr.length < 4) { throw FormatException.c(); } int i27 = iArr[0]; if (i27 <= iArr.length) { if (i27 == 0) { if (i7 < iArr.length) { iArr[0] = iArr.length - i7; } else { throw FormatException.c(); } } Qys a = nxY.a(iArr, String.valueOf(i)); int length8 = iArr2.length; return a; } throw FormatException.c(); } catch (ChecksumException unused3) { iArr5 = iArr8; i2 = i4; } } throw ChecksumException.e(); } private static vDP d(C8902dZc c8902dZc, int i, int i2, boolean z, int i3, int i4, int i5, int i6) { int i7; int d; int b; int b2 = b(c8902dZc, i, i2, z, i3, i4); int[] d2 = d(c8902dZc, i, i2, z, b2, i4); if (d2 == null) { return null; } int i8 = 0; for (int i9 : d2) { i8 += i9; } if (z) { i7 = b2 + i8; } else { for (int i10 = 0; i10 < d2.length / 2; i10++) { int i11 = d2[i10]; d2[i10] = d2[(d2.length - 1) - i10]; d2[(d2.length - 1) - i10] = i11; } b2 -= i8; i7 = b2; } if (i5 - 2 > i8 || i8 > i6 + 2 || (b = ULn.b((d = QTl.d(d2)))) == -1) { return null; } return new vDP(b2, i7, e(d), b); } /* JADX WARN: Removed duplicated region for block: B:17:0x0027 A[EDGE_INSN: B:17:0x0027->B:18:0x0027 BREAK A[LOOP:0: B:5:0x000c->B:13:0x000c], SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:8:0x0015 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private static int[] d(o.C8902dZc r7, int r8, int r9, boolean r10, int r11, int r12) { /* r0 = 8 int[] r1 = new int[r0] r2 = 1 if (r10 == 0) goto L9 r3 = r2 goto La L9: r3 = -1 La: r4 = 0 r5 = r10 Lc: if (r10 == 0) goto L11 if (r11 >= r9) goto L27 goto L13 L11: if (r11 < r8) goto L27 L13: if (r4 >= r0) goto L27 boolean r6 = r7.b(r11, r12) if (r6 != r5) goto L22 r6 = r1[r4] int r6 = r6 + r2 r1[r4] = r6 int r11 = r11 + r3 goto Lc L22: int r4 = r4 + 1 r5 = r5 ^ 1 goto Lc L27: if (r4 == r0) goto L33 if (r10 == 0) goto L2c r8 = r9 L2c: if (r11 != r8) goto L31 r7 = 7 if (r4 == r7) goto L33 L31: r7 = 0 return r7 L33: return r1 */ throw new UnsupportedOperationException("Method not decompiled: o.C17683yqB.d(o.dZc, int, int, boolean, int, int):int[]"); } /* JADX WARN: Code restructure failed: missing block: B:16:0x0022, code lost: continue; */ /* JADX WARN: Code restructure failed: missing block: B:18:0x0022, code lost: continue; */ /* JADX WARN: Code restructure failed: missing block: B:20:0x0022, code lost: continue; */ /* JADX WARN: Removed duplicated region for block: B:10:0x0017 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private static int b(o.C8902dZc r5, int r6, int r7, boolean r8, int r9, int r10) { /* if (r8 == 0) goto L4 r0 = -1 goto L5 L4: r0 = 1 L5: r1 = 0 r2 = r9 L7: r3 = 2 if (r1 >= r3) goto L28 La: if (r8 == 0) goto Lf if (r2 < r6) goto L22 goto L11 Lf: if (r2 >= r7) goto L22 L11: boolean r4 = r5.b(r2, r10) if (r8 != r4) goto L22 int r4 = r9 - r2 int r4 = java.lang.Math.abs(r4) if (r4 <= r3) goto L20 return r9 L20: int r2 = r2 + r0 goto La L22: int r0 = -r0 r8 = r8 ^ 1 int r1 = r1 + 1 goto L7 L28: return r2 */ throw new UnsupportedOperationException("Method not decompiled: o.C17683yqB.b(o.dZc, int, int, boolean, int, int):int"); } private static int[] d(int i) { int[] iArr = new int[8]; int i2 = 0; int i3 = 7; while (true) { int i4 = i & 1; if (i4 != i2) { i3--; if (i3 < 0) { return iArr; } i2 = i4; } iArr[i3] = iArr[i3] + 1; i >>= 1; } } private static int e(int i) { int[] d = d(i); return ((((d[0] - d[2]) + d[4]) - d[6]) + 9) % 9; } /* JADX WARN: Removed duplicated region for block: B:50:0x00f5 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private static o.hOP b(o.C16621pkz r15) throws com.google.zxing.NotFoundException { /* Method dump skipped, instructions count: 292 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: o.C17683yqB.b(o.pkz):o.hOP"); } }