what-the-bank/sources/o/C10628eJt.java

161 lines
4.7 KiB
Java

package o;
import com.google.common.primitives.UnsignedBytes;
import com.google.zxing.NotFoundException;
/* renamed from: o.eJt, reason: case insensitive filesystem */
/* loaded from: classes2.dex */
public class C10628eJt extends Bjk {
private static final byte[] e = new byte[0];
private byte[] a;
private final int[] c;
public C10628eJt(AbstractC13394fZQ abstractC13394fZQ) {
super(abstractC13394fZQ);
this.a = e;
this.c = new int[32];
}
@Override // o.Bjk
public Bjk d(AbstractC13394fZQ abstractC13394fZQ) {
return new C10628eJt(abstractC13394fZQ);
}
private void e(int i) {
if (this.a.length < i) {
this.a = new byte[i];
}
for (int i2 = 0; i2 < 32; i2++) {
this.c[i2] = 0;
}
}
private static int a(int[] iArr) throws NotFoundException {
int length = iArr.length;
int i = 0;
int i2 = 0;
int i3 = 0;
for (int i4 = 0; i4 < length; i4++) {
int i5 = iArr[i4];
if (i5 > i) {
i3 = i4;
i = i5;
}
if (i5 > i2) {
i2 = i5;
}
}
int i6 = 0;
int i7 = 0;
for (int i8 = 0; i8 < length; i8++) {
int i9 = i8 - i3;
int i10 = iArr[i8] * i9 * i9;
if (i10 > i7) {
i6 = i8;
i7 = i10;
}
}
if (i3 <= i6) {
int i11 = i3;
i3 = i6;
i6 = i11;
}
if (i3 - i6 <= length / 16) {
throw NotFoundException.b();
}
int i12 = i3 - 1;
int i13 = -1;
int i14 = i12;
while (i12 > i6) {
int i15 = i12 - i6;
int i16 = i15 * i15 * (i3 - i12) * (i2 - iArr[i12]);
if (i16 > i13) {
i14 = i12;
i13 = i16;
}
i12--;
}
return i14 << 3;
}
@Override // o.Bjk
public C8902dZc d() throws NotFoundException {
AbstractC13394fZQ abstractC13394fZQ = this.d;
int i = abstractC13394fZQ.a;
int i2 = abstractC13394fZQ.c;
C8902dZc c8902dZc = new C8902dZc(i, i2);
e(i);
int[] iArr = this.c;
for (int i3 = 1; i3 < 5; i3++) {
byte[] a = abstractC13394fZQ.a((i2 * i3) / 5, this.a);
int i4 = (i << 2) / 5;
for (int i5 = i / 5; i5 < i4; i5++) {
int i6 = (a[i5] & UnsignedBytes.MAX_VALUE) >> 3;
iArr[i6] = iArr[i6] + 1;
}
}
int a2 = a(iArr);
byte[] c = abstractC13394fZQ.c();
for (int i7 = 0; i7 < i2; i7++) {
for (int i8 = 0; i8 < i; i8++) {
if ((c[(i7 * i) + i8] & UnsignedBytes.MAX_VALUE) < a2) {
c8902dZc.a(i8, i7);
}
}
}
return c8902dZc;
}
@Override // o.Bjk
public final C17416wdP e(int i, C17416wdP c17416wdP) throws NotFoundException {
AbstractC13394fZQ abstractC13394fZQ = this.d;
int i2 = abstractC13394fZQ.a;
if (c17416wdP == null || c17416wdP.d < i2) {
c17416wdP = new C17416wdP(i2);
} else {
int length = c17416wdP.a.length;
for (int i3 = 0; i3 < length; i3++) {
c17416wdP.a[i3] = 0;
}
}
e(i2);
byte[] a = abstractC13394fZQ.a(i, this.a);
int[] iArr = this.c;
for (int i4 = 0; i4 < i2; i4++) {
int i5 = (a[i4] & UnsignedBytes.MAX_VALUE) >> 3;
iArr[i5] = iArr[i5] + 1;
}
int a2 = a(iArr);
if (i2 < 3) {
for (int i6 = 0; i6 < i2; i6++) {
if ((a[i6] & UnsignedBytes.MAX_VALUE) < a2) {
int[] iArr2 = c17416wdP.a;
int i7 = i6 / 32;
iArr2[i7] = (1 << (i6 & 31)) | iArr2[i7];
}
}
} else {
byte b = a[0];
byte b2 = a[1];
int i8 = b & UnsignedBytes.MAX_VALUE;
int i9 = b2 & UnsignedBytes.MAX_VALUE;
int i10 = 1;
int i11 = i8;
int i12 = i9;
while (i10 < i2 - 1) {
int i13 = i10 + 1;
int i14 = a[i13] & UnsignedBytes.MAX_VALUE;
if ((((i12 << 2) - i11) - i14) / 2 < a2) {
int[] iArr3 = c17416wdP.a;
int i15 = i10 / 32;
iArr3[i15] = (1 << (i10 & 31)) | iArr3[i15];
}
i11 = i12;
i10 = i13;
i12 = i14;
}
}
return c17416wdP;
}
}