package o;

import java.util.Arrays;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Jd, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C0237Jd implements Cloneable {
    public static final int[] n = new int[0];
    public int m = 0;
    public int[] l = n;

    public final void a(boolean z) {
        c(this.m + 1);
        if (z) {
            int[] iArr = this.l;
            int i = this.m;
            int i2 = i / 32;
            iArr[i2] = (1 << (i & 31)) | iArr[i2];
        }
        this.m++;
    }

    public final void b(int i, int i2) {
        if (i2 < 0 || i2 > 32) {
            throw new IllegalArgumentException("Num bits must be between 0 and 32");
        }
        int i3 = this.m;
        c(i3 + i2);
        for (int i4 = i2 - 1; i4 >= 0; i4--) {
            if (((1 << i4) & i) != 0) {
                int[] iArr = this.l;
                int i5 = i3 / 32;
                iArr[i5] = iArr[i5] | (1 << (i3 & 31));
            }
            i3++;
        }
        this.m = i3;
    }

    public final void c(int i) {
        if (i > this.l.length * 32) {
            int[] iArr = new int[(((int) Math.ceil(i / 0.75f)) + 31) / 32];
            int[] iArr2 = this.l;
            System.arraycopy(iArr2, 0, iArr, 0, iArr2.length);
            this.l = iArr;
        }
    }

    public final Object clone() {
        int[] iArr = (int[]) this.l.clone();
        int i = this.m;
        C0237Jd c0237Jd = new C0237Jd();
        c0237Jd.l = iArr;
        c0237Jd.m = i;
        return c0237Jd;
    }

    public final boolean d(int i) {
        return ((1 << (i & 31)) & this.l[i / 32]) != 0;
    }

    public final int e() {
        return (this.m + 7) / 8;
    }

    public final boolean equals(Object obj) {
        if (!(obj instanceof C0237Jd)) {
            return false;
        }
        C0237Jd c0237Jd = (C0237Jd) obj;
        return this.m == c0237Jd.m && Arrays.equals(this.l, c0237Jd.l);
    }

    public final int hashCode() {
        return Arrays.hashCode(this.l) + (this.m * 31);
    }

    public final String toString() {
        int i = this.m;
        StringBuilder sb = new StringBuilder((i / 8) + i + 1);
        for (int i2 = 0; i2 < this.m; i2++) {
            if ((i2 & 7) == 0) {
                sb.append(' ');
            }
            sb.append(d(i2) ? 'X' : '.');
        }
        return sb.toString();
    }
}
