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

186 lines
4.8 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.util.Arrays;
/* renamed from: o.wdP, reason: case insensitive filesystem */
/* loaded from: classes2.dex */
public final class C17416wdP implements Cloneable {
private static final int[] b = new int[0];
public int[] a;
public int d;
public C17416wdP() {
this.d = 0;
this.a = b;
}
public C17416wdP(int i) {
this.d = i;
this.a = new int[(i + 31) / 32];
}
private C17416wdP(int[] iArr, int i) {
this.a = iArr;
this.d = i;
}
private void e(int i) {
if (i > (this.a.length << 5)) {
int[] iArr = new int[(((int) Math.ceil(i / 0.75f)) + 31) / 32];
int[] iArr2 = this.a;
System.arraycopy(iArr2, 0, iArr, 0, iArr2.length);
this.a = iArr;
}
}
public final int a(int i) {
int i2 = this.d;
if (i >= i2) {
return i2;
}
int i3 = i / 32;
int i4 = (-(1 << (i & 31))) & this.a[i3];
while (i4 == 0) {
i3++;
int[] iArr = this.a;
if (i3 == iArr.length) {
return this.d;
}
i4 = iArr[i3];
}
return Math.min((i3 << 5) + Integer.numberOfTrailingZeros(i4), this.d);
}
public final int c(int i) {
int i2 = this.d;
if (i >= i2) {
return i2;
}
int i3 = i / 32;
int i4 = (-(1 << (i & 31))) & (~this.a[i3]);
while (i4 == 0) {
i3++;
int[] iArr = this.a;
if (i3 == iArr.length) {
return this.d;
}
i4 = ~iArr[i3];
}
return Math.min((i3 << 5) + Integer.numberOfTrailingZeros(i4), this.d);
}
public final boolean d(int i, int i2) {
if (i2 < i || i < 0 || i2 > this.d) {
throw new IllegalArgumentException();
}
if (i2 == i) {
return true;
}
int i3 = i2 - 1;
int i4 = i / 32;
int i5 = i3 / 32;
int i6 = i4;
while (i6 <= i5) {
if ((((2 << (i6 >= i5 ? 31 & i3 : 31)) - (1 << (i6 > i4 ? 0 : i & 31))) & this.a[i6]) != 0) {
return false;
}
i6++;
}
return true;
}
public final void d(boolean z) {
e(this.d + 1);
if (z) {
int[] iArr = this.a;
int i = this.d;
int i2 = i / 32;
iArr[i2] = (1 << (i & 31)) | iArr[i2];
}
this.d++;
}
public final void e(int i, int i2) {
if (i2 < 0 || i2 > 32) {
throw new IllegalArgumentException("Num bits must be between 0 and 32");
}
int i3 = this.d;
e(i3 + i2);
while (true) {
i2--;
if (i2 < 0) {
this.d = i3;
return;
}
if (((1 << i2) & i) != 0) {
int[] iArr = this.a;
int i4 = i3 / 32;
iArr[i4] = (1 << (i3 & 31)) | iArr[i4];
}
i3++;
}
}
public final void e(C17416wdP c17416wdP) {
int i = c17416wdP.d;
e(this.d + i);
for (int i2 = 0; i2 < i; i2++) {
boolean z = true;
if ((c17416wdP.a[i2 / 32] & (1 << (i2 & 31))) == 0) {
z = false;
}
d(z);
}
}
public final void c() {
int[] iArr = new int[this.a.length];
int i = (this.d - 1) / 32;
int i2 = i + 1;
for (int i3 = 0; i3 < i2; i3++) {
iArr[i - i3] = Integer.reverse(this.a[i3]);
}
int i4 = this.d;
int i5 = i2 << 5;
if (i4 != i5) {
int i6 = i5 - i4;
int i7 = iArr[0] >>> i6;
for (int i8 = 1; i8 < i2; i8++) {
int i9 = iArr[i8];
iArr[i8 - 1] = i7 | (i9 << (32 - i6));
i7 = i9 >>> i6;
}
iArr[i] = i7;
}
this.a = iArr;
}
public final boolean equals(Object obj) {
if (!(obj instanceof C17416wdP)) {
return false;
}
C17416wdP c17416wdP = (C17416wdP) obj;
return this.d == c17416wdP.d && Arrays.equals(this.a, c17416wdP.a);
}
public final int hashCode() {
return (this.d * 31) + Arrays.hashCode(this.a);
}
public final String toString() {
int i = this.d;
StringBuilder sb = new StringBuilder(i + (i / 8) + 1);
for (int i2 = 0; i2 < this.d; i2++) {
if ((i2 & 7) == 0) {
sb.append(' ');
}
sb.append((this.a[i2 / 32] & (1 << (i2 & 31))) == 0 ? '.' : 'X');
}
return sb.toString();
}
public final /* synthetic */ Object clone() throws CloneNotSupportedException {
return new C17416wdP((int[]) this.a.clone(), this.d);
}
}