package c.i.e.q; import c.i.e.d; import c.i.e.k; import c.i.e.n.a; import com.google.zxing.ChecksumException; import com.google.zxing.FormatException; import com.google.zxing.NotFoundException; import com.google.zxing.Result; import java.util.ArrayList; import java.util.Map; /* compiled from: Code128Reader */ public final class b extends k { public static final int[][] a = {new int[]{2, 1, 2, 2, 2, 2}, new int[]{2, 2, 2, 1, 2, 2}, new int[]{2, 2, 2, 2, 2, 1}, new int[]{1, 2, 1, 2, 2, 3}, new int[]{1, 2, 1, 3, 2, 2}, new int[]{1, 3, 1, 2, 2, 2}, new int[]{1, 2, 2, 2, 1, 3}, new int[]{1, 2, 2, 3, 1, 2}, new int[]{1, 3, 2, 2, 1, 2}, new int[]{2, 2, 1, 2, 1, 3}, new int[]{2, 2, 1, 3, 1, 2}, new int[]{2, 3, 1, 2, 1, 2}, new int[]{1, 1, 2, 2, 3, 2}, new int[]{1, 2, 2, 1, 3, 2}, new int[]{1, 2, 2, 2, 3, 1}, new int[]{1, 1, 3, 2, 2, 2}, new int[]{1, 2, 3, 1, 2, 2}, new int[]{1, 2, 3, 2, 2, 1}, new int[]{2, 2, 3, 2, 1, 1}, new int[]{2, 2, 1, 1, 3, 2}, new int[]{2, 2, 1, 2, 3, 1}, new int[]{2, 1, 3, 2, 1, 2}, new int[]{2, 2, 3, 1, 1, 2}, new int[]{3, 1, 2, 1, 3, 1}, new int[]{3, 1, 1, 2, 2, 2}, new int[]{3, 2, 1, 1, 2, 2}, new int[]{3, 2, 1, 2, 2, 1}, new int[]{3, 1, 2, 2, 1, 2}, new int[]{3, 2, 2, 1, 1, 2}, new int[]{3, 2, 2, 2, 1, 1}, new int[]{2, 1, 2, 1, 2, 3}, new int[]{2, 1, 2, 3, 2, 1}, new int[]{2, 3, 2, 1, 2, 1}, new int[]{1, 1, 1, 3, 2, 3}, new int[]{1, 3, 1, 1, 2, 3}, new int[]{1, 3, 1, 3, 2, 1}, new int[]{1, 1, 2, 3, 1, 3}, new int[]{1, 3, 2, 1, 1, 3}, new int[]{1, 3, 2, 3, 1, 1}, new int[]{2, 1, 1, 3, 1, 3}, new int[]{2, 3, 1, 1, 1, 3}, new int[]{2, 3, 1, 3, 1, 1}, new int[]{1, 1, 2, 1, 3, 3}, new int[]{1, 1, 2, 3, 3, 1}, new int[]{1, 3, 2, 1, 3, 1}, new int[]{1, 1, 3, 1, 2, 3}, new int[]{1, 1, 3, 3, 2, 1}, new int[]{1, 3, 3, 1, 2, 1}, new int[]{3, 1, 3, 1, 2, 1}, new int[]{2, 1, 1, 3, 3, 1}, new int[]{2, 3, 1, 1, 3, 1}, new int[]{2, 1, 3, 1, 1, 3}, new int[]{2, 1, 3, 3, 1, 1}, new int[]{2, 1, 3, 1, 3, 1}, new int[]{3, 1, 1, 1, 2, 3}, new int[]{3, 1, 1, 3, 2, 1}, new int[]{3, 3, 1, 1, 2, 1}, new int[]{3, 1, 2, 1, 1, 3}, new int[]{3, 1, 2, 3, 1, 1}, new int[]{3, 3, 2, 1, 1, 1}, new int[]{3, 1, 4, 1, 1, 1}, new int[]{2, 2, 1, 4, 1, 1}, new int[]{4, 3, 1, 1, 1, 1}, new int[]{1, 1, 1, 2, 2, 4}, new int[]{1, 1, 1, 4, 2, 2}, new int[]{1, 2, 1, 1, 2, 4}, new int[]{1, 2, 1, 4, 2, 1}, new int[]{1, 4, 1, 1, 2, 2}, new int[]{1, 4, 1, 2, 2, 1}, new int[]{1, 1, 2, 2, 1, 4}, new int[]{1, 1, 2, 4, 1, 2}, new int[]{1, 2, 2, 1, 1, 4}, new int[]{1, 2, 2, 4, 1, 1}, new int[]{1, 4, 2, 1, 1, 2}, new int[]{1, 4, 2, 2, 1, 1}, new int[]{2, 4, 1, 2, 1, 1}, new int[]{2, 2, 1, 1, 1, 4}, new int[]{4, 1, 3, 1, 1, 1}, new int[]{2, 4, 1, 1, 1, 2}, new int[]{1, 3, 4, 1, 1, 1}, new int[]{1, 1, 1, 2, 4, 2}, new int[]{1, 2, 1, 1, 4, 2}, new int[]{1, 2, 1, 2, 4, 1}, new int[]{1, 1, 4, 2, 1, 2}, new int[]{1, 2, 4, 1, 1, 2}, new int[]{1, 2, 4, 2, 1, 1}, new int[]{4, 1, 1, 2, 1, 2}, new int[]{4, 2, 1, 1, 1, 2}, new int[]{4, 2, 1, 2, 1, 1}, new int[]{2, 1, 2, 1, 4, 1}, new int[]{2, 1, 4, 1, 2, 1}, new int[]{4, 1, 2, 1, 2, 1}, new int[]{1, 1, 1, 1, 4, 3}, new int[]{1, 1, 1, 3, 4, 1}, new int[]{1, 3, 1, 1, 4, 1}, new int[]{1, 1, 4, 1, 1, 3}, new int[]{1, 1, 4, 3, 1, 1}, new int[]{4, 1, 1, 1, 1, 3}, new int[]{4, 1, 1, 3, 1, 1}, new int[]{1, 1, 3, 1, 4, 1}, new int[]{1, 1, 4, 1, 3, 1}, new int[]{3, 1, 1, 1, 4, 1}, new int[]{4, 1, 1, 1, 3, 1}, new int[]{2, 1, 1, 4, 1, 2}, new int[]{2, 1, 1, 2, 1, 4}, new int[]{2, 1, 1, 2, 3, 2}, new int[]{2, 3, 3, 1, 1, 1, 2}}; /* JADX DEBUG: Failed to insert an additional move for type inference into block B:89:0x017c */ /* JADX DEBUG: Failed to insert an additional move for type inference into block B:116:0x01d1 */ /* JADX DEBUG: Multi-variable search result rejected for r27v0, resolved type: c.i.e.n.a */ /* JADX WARN: Multi-variable type inference failed */ /* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */ /* JADX WARNING: Code restructure failed: missing block: B:100:0x01a1, code lost: if (r3 != false) goto L_0x01a3; */ /* JADX WARNING: Code restructure failed: missing block: B:101:0x01a3, code lost: r3 = false; r10 = false; r12 = false; */ /* JADX WARNING: Code restructure failed: missing block: B:76:0x0150, code lost: if (r3 != false) goto L_0x01a3; */ /* JADX WARNING: Removed duplicated region for block: B:103:0x01ab A[PHI: r19 PHI: (r19v12 boolean) = (r19v16 boolean), (r19v19 boolean) binds: [B:89:0x017c, B:67:0x0130] A[DONT_GENERATE, DONT_INLINE]] */ /* JADX WARNING: Removed duplicated region for block: B:105:0x01b5 A[PHI: r3 r18 r19 PHI: (r3v16 boolean) = (r3v7 boolean), (r3v17 boolean), (r3v20 boolean), (r3v7 boolean), (r3v7 boolean), (r3v7 boolean), (r3v7 boolean), (r3v7 boolean), (r3v7 boolean), (r3v7 boolean), (r3v7 boolean), (r3v7 boolean) binds: [B:51:0x00f5, B:102:0x01a9, B:84:0x0172, B:89:0x017c, B:90:0x0180, B:94:0x018c, B:93:0x0188, B:79:0x015c, B:67:0x0130, B:68:0x0135, B:72:0x0142, B:71:0x013d] A[DONT_GENERATE, DONT_INLINE] PHI: (r18v5 boolean) = (r18v1 boolean), (r18v1 boolean), (r18v1 boolean), (r18v1 boolean), (r18v1 boolean), (r18v1 boolean), (r18v1 boolean), (r18v6 boolean), (r18v1 boolean), (r18v1 boolean), (r18v1 boolean), (r18v1 boolean) binds: [B:51:0x00f5, B:102:0x01a9, B:84:0x0172, B:89:0x017c, B:90:0x0180, B:94:0x018c, B:93:0x0188, B:79:0x015c, B:67:0x0130, B:68:0x0135, B:72:0x0142, B:71:0x013d] A[DONT_GENERATE, DONT_INLINE] PHI: (r19v11 boolean) = (r19v2 boolean), (r19v13 boolean), (r19v2 boolean), (r19v16 boolean), (r19v16 boolean), (r19v16 boolean), (r19v16 boolean), (r19v18 boolean), (r19v19 boolean), (r19v19 boolean), (r19v19 boolean), (r19v19 boolean) binds: [B:51:0x00f5, B:102:0x01a9, B:84:0x0172, B:89:0x017c, B:90:0x0180, B:94:0x018c, B:93:0x0188, B:79:0x015c, B:67:0x0130, B:68:0x0135, B:72:0x0142, B:71:0x013d] A[DONT_GENERATE, DONT_INLINE]] */ /* JADX WARNING: Unknown variable types count: 1 */ @Override // c.i.e.q.k public Result b(int i, a aVar, Map map) throws NotFoundException, FormatException, ChecksumException { float f; char c2; boolean z2; boolean z3; int i2 = 1; ?? r3 = 0; boolean z4 = map != null && map.containsKey(d.ASSUME_GS1); int i3 = aVar.j; int f2 = aVar.f(0); int i4 = 6; int[] iArr = new int[6]; int i5 = f2; boolean z5 = false; int i6 = 0; while (f2 < i3) { if (aVar.b(f2) != z5) { iArr[i6] = iArr[i6] + i2; } else { if (i6 == 5) { int i7 = 103; int i8 = -1; float f3 = 0.25f; while (true) { f = 0.7f; if (i7 > 105) { break; } float d = k.d(iArr, a[i7], 0.7f); if (d < f3) { f3 = d; i8 = i7; } i7++; } if (i8 >= 0) { int i9 = r3 == true ? 1 : 0; int i10 = r3 == true ? 1 : 0; int i11 = r3 == true ? 1 : 0; int i12 = r3 == true ? 1 : 0; int i13 = r3 == true ? 1 : 0; int i14 = r3 == true ? 1 : 0; int i15 = r3 == true ? 1 : 0; int i16 = r3 == true ? 1 : 0; int i17 = r3 == true ? 1 : 0; int i18 = r3 == true ? 1 : 0; if (aVar.h(Math.max(i9, i5 - ((f2 - i5) / 2)), i5, r3)) { int[] iArr2 = new int[3]; char c3 = r3 == true ? 1 : 0; char c4 = r3 == true ? 1 : 0; char c5 = r3 == true ? 1 : 0; char c6 = r3 == true ? 1 : 0; char c7 = r3 == true ? 1 : 0; char c8 = r3 == true ? 1 : 0; char c9 = r3 == true ? 1 : 0; char c10 = r3 == true ? 1 : 0; char c11 = r3 == true ? 1 : 0; char c12 = r3 == true ? 1 : 0; iArr2[c3] = i5; iArr2[i2] = f2; iArr2[2] = i8; int i19 = iArr2[2]; ArrayList arrayList = new ArrayList(20); arrayList.add(Byte.valueOf((byte) i19)); switch (i19) { case 103: c2 = 'e'; break; case 104: c2 = 'd'; break; case 105: c2 = 'c'; break; default: throw FormatException.a(); } StringBuilder sb = new StringBuilder(20); int i20 = iArr2[r3]; int i21 = iArr2[i2]; int[] iArr3 = new int[i4]; char c13 = c2; boolean z6 = false; boolean z7 = false; boolean z8 = true; boolean z9 = false; int i22 = 0; int i23 = 0; int i24 = 0; int i25 = i20; int i26 = i21; boolean z10 = r3; while (!z7) { k.e(aVar, i26, iArr3); int i27 = -1; int i28 = 0; float f4 = 0.25f; while (true) { int[][] iArr4 = a; if (i28 < iArr4.length) { float d2 = k.d(iArr3, iArr4[i28], f); if (d2 < f4) { f4 = d2; i27 = i28; } i28++; } else if (i27 >= 0) { arrayList.add(Byte.valueOf((byte) i27)); if (i27 != 106) { z8 = true; } if (i27 != 106) { i23++; i19 = (i23 * i27) + i19; } int i29 = i26; for (int i30 = 0; i30 < 6; i30++) { i29 += iArr3[i30]; } switch (i27) { case 103: case 104: case 105: throw FormatException.a(); default: switch (c13) { case 'c': if (i27 >= 100) { if (i27 != 106) { z8 = false; } if (i27 != 106) { switch (i27) { case 100: z2 = false; c13 = 'd'; z3 = z10; break; case 101: z2 = false; c13 = 'e'; z3 = z10; break; case 102: if (z4) { if (sb.length() == 0) { sb.append("]C1"); } else { sb.append((char) 29); } } default: z2 = false; z3 = z10; break; } } else { z2 = false; z7 = true; z3 = z10; break; } } else { if (i27 < 10) { sb.append('0'); } sb.append(i27); } z2 = false; z3 = z10; case 'd': if (i27 < 96) { if (z10 == z6) { sb.append((char) (i27 + 32)); } else { sb.append((char) (i27 + 32 + 128)); } z10 = false; z2 = false; z3 = z10; break; } else { if (i27 != 106) { z8 = false; } if (i27 != 106) { switch (i27) { case 96: case 97: default: z2 = false; z3 = z10; break; case 98: z2 = true; c13 = 'e'; z3 = z10; break; case 99: z2 = false; c13 = 'c'; z3 = z10; break; case 100: if (z6 || !z10) { if (z6) { } z10 = true; z2 = false; z3 = z10; break; } z3 = false; z2 = false; z6 = true; break; case 101: z2 = false; c13 = 'e'; z3 = z10; break; case 102: if (z4) { if (sb.length() == 0) { sb.append("]C1"); } else { sb.append((char) 29); } } z2 = false; z3 = z10; break; } } z7 = true; z2 = false; z3 = z10; } break; case 'e': if (i27 < 64) { if (z10 == z6) { sb.append((char) (i27 + 32)); } else { sb.append((char) (i27 + 32 + 128)); } } else if (i27 >= 96) { if (i27 != 106) { z8 = false; } if (i27 != 106) { switch (i27) { case 98: z2 = true; c13 = 'd'; z3 = z10; break; case 100: z2 = false; c13 = 'd'; z3 = z10; break; case 101: if (z6 || !z10) { if (z6) { } z10 = true; z2 = false; z3 = z10; break; } z3 = false; z2 = false; z6 = true; break; case 102: if (z4) { if (sb.length() == 0) { sb.append("]C1"); } else { sb.append((char) 29); } } z2 = false; z3 = z10; break; } } z7 = true; z2 = false; z3 = z10; } else if (z10 == z6) { sb.append((char) (i27 - 64)); } else { sb.append((char) (i27 + 64)); } z10 = false; z2 = false; z3 = z10; break; } if (z9) { c13 = c13 == 'e' ? 'd' : 'e'; } z9 = z2; i24 = i22; f = 0.7f; i22 = i27; i25 = i26; i26 = i29; z10 = z3; break; } } else { throw NotFoundException.k; } } } int i31 = i26 - i25; int g = aVar.g(i26); if (!aVar.h(g, Math.min(aVar.j, ((g - i25) / 2) + g), false)) { throw NotFoundException.k; } else if ((i19 - (i23 * i24)) % 103 == i24) { int length = sb.length(); if (length != 0) { if (length > 0 && z8) { if (c13 == 'c') { sb.delete(length - 2, length); } else { sb.delete(length - 1, length); } } float f5 = ((float) (iArr2[1] + iArr2[0])) / 2.0f; float f6 = (((float) i31) / 2.0f) + ((float) i25); int size = arrayList.size(); byte[] bArr = new byte[size]; for (int i32 = 0; i32 < size; i32++) { bArr[i32] = ((Byte) arrayList.get(i32)).byteValue(); } float f7 = (float) i; return new Result(sb.toString(), bArr, new k[]{new k(f5, f7), new k(f6, f7)}, c.i.e.a.CODE_128); } throw NotFoundException.k; } else { throw ChecksumException.a(); } } } i5 += iArr[0] + iArr[1]; int i33 = i6 - 1; System.arraycopy(iArr, 2, iArr, 0, i33); iArr[i33] = 0; iArr[i6] = 0; i6 = i33; } else { i6++; } iArr[i6] = 1; z5 = !z5; } f2++; i2 = 1; r3 = 0; i4 = 6; } throw NotFoundException.k; } }