package o; import com.google.zxing.ChecksumException; import com.google.zxing.FormatException; import com.google.zxing.NotFoundException; import java.util.Map; import org.bouncycastle.crypto.tls.CipherSuite; /* loaded from: classes2.dex */ public final class JEH implements zIz { private static final qCz[] d = new qCz[0]; private final C16625pnF a = new C16625pnF(); @Override // o.zIz public final void c() { } @Override // o.zIz public final WFF a(BKc bKc) throws NotFoundException, ChecksumException, FormatException { return b(bKc, null); } @Override // o.zIz public final WFF b(BKc bKc, Map map) throws NotFoundException, ChecksumException, FormatException { byte[] bArr; if (bKc.b == null) { bKc.b = bKc.a.d(); } C8902dZc c8902dZc = bKc.b; int i = c8902dZc.e; int i2 = c8902dZc.c; int i3 = -1; int i4 = -1; for (int i5 = 0; i5 < c8902dZc.c; i5++) { int i6 = 0; while (true) { int i7 = c8902dZc.b; if (i6 < i7) { int i8 = c8902dZc.a[(i7 * i5) + i6]; if (i8 != 0) { if (i5 < i2) { i2 = i5; } if (i5 > i4) { i4 = i5; } int i9 = i6 << 5; if (i9 < i) { int i10 = 0; while ((i8 << (31 - i10)) == 0) { i10++; } int i11 = i10 + i9; if (i11 < i) { i = i11; } } if (i9 + 31 > i3) { int i12 = 31; while ((i8 >>> i12) == 0) { i12--; } int i13 = i9 + i12; if (i13 > i3) { i3 = i13; } } } i6++; } } } int[] iArr = (i3 < i || i4 < i2) ? null : new int[]{i, i2, (i3 - i) + 1, (i4 - i2) + 1}; if (iArr == null) { throw NotFoundException.b(); } int i14 = iArr[0]; int i15 = iArr[1]; int i16 = iArr[2]; int i17 = iArr[3]; int i18 = 30; C8902dZc c8902dZc2 = new C8902dZc(30, 33); int i19 = 0; while (i19 < 33) { int min = Math.min((((i19 * i17) + (i17 / 2)) / 33) + i15, i17 - 1); int i20 = 0; while (i20 < i18) { if (c8902dZc.b(Math.min((((i20 * i16) + (i16 / 2)) + (((i19 & 1) * i16) / 2)) / i18, i16 - 1) + i14, min)) { c8902dZc2.a(i20, i19); } i20++; i18 = 30; } i19++; i18 = 30; } C16625pnF c16625pnF = this.a; oLX olx = new oLX(c8902dZc2); byte[] bArr2 = new byte[CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA]; int i21 = olx.d.c; int i22 = olx.d.e; for (int i23 = 0; i23 < i21; i23++) { int[] iArr2 = oLX.c[i23]; for (int i24 = 0; i24 < i22; i24++) { int i25 = iArr2[i24]; if (i25 >= 0 && olx.d.b(i24, i23)) { int i26 = i25 / 6; bArr2[i26] = (byte) (((byte) (1 << (5 - (i25 % 6)))) | bArr2[i26]); } } } c16625pnF.e(bArr2, 0, 10, 10, 0); int i27 = bArr2[0] & 15; if (i27 == 2 || i27 == 3 || i27 == 4) { c16625pnF.e(bArr2, 20, 84, 40, 1); c16625pnF.e(bArr2, 20, 84, 40, 2); bArr = new byte[94]; } else if (i27 == 5) { c16625pnF.e(bArr2, 20, 68, 56, 1); c16625pnF.e(bArr2, 20, 68, 56, 2); bArr = new byte[78]; } else { throw FormatException.c(); } System.arraycopy(bArr2, 0, bArr, 0, 10); System.arraycopy(bArr2, 20, bArr, 10, bArr.length - 10); Qys b = wZb.b(bArr, i27); WFF wff = new WFF(b.i, b.c, d, PTS.MAXICODE); String str = b.e; if (str != null) { wff.b(MoF.ERROR_CORRECTION_LEVEL, str); } return wff; } }