package 㴹.K.Ԕ.ᨨ;

import ඓ.ⁱ.K.ඓ.C1252;

/* renamed from: 㴹.K.Ԕ.ᨨ.ῲ  reason: contains not printable characters */
/* compiled from: OpenHashSet */
public final class C2454<T> {

    /* renamed from: ʬ  reason: contains not printable characters */
    public int f8402;

    /* renamed from: ඓ  reason: contains not printable characters */
    public T[] f8403;

    /* renamed from: ῲ  reason: contains not printable characters */
    public int f8404;

    /* renamed from: K  reason: contains not printable characters */
    public final float f8405 = 0.75f;

    /* renamed from: 㸾  reason: contains not printable characters */
    public int f8406;

    public C2454() {
        int r1 = C1252.m3334(16);
        this.f8404 = r1 - 1;
        this.f8406 = (int) (0.75f * ((float) r1));
        this.f8403 = (T[]) new Object[r1];
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m6495(int i) {
        int i2 = i * -1640531527;
        return i2 ^ (i2 >>> 16);
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m6497(T t) {
        T t2;
        T[] tArr = this.f8403;
        int i = this.f8404;
        int r2 = m6495(t.hashCode()) & i;
        T t3 = tArr[r2];
        if (t3 != null) {
            if (t3.equals(t)) {
                return false;
            }
            do {
                r2 = (r2 + 1) & i;
                t2 = tArr[r2];
                if (t2 == null) {
                }
            } while (!t2.equals(t));
            return false;
        }
        tArr[r2] = t;
        int i2 = this.f8402 + 1;
        this.f8402 = i2;
        if (i2 >= this.f8406) {
            T[] tArr2 = this.f8403;
            int length = tArr2.length;
            int i3 = length << 1;
            int i4 = i3 - 1;
            T[] tArr3 = (T[]) new Object[i3];
            int i5 = this.f8402;
            while (true) {
                int i6 = i5 - 1;
                if (i5 == 0) {
                    break;
                }
                do {
                    length--;
                } while (tArr2[length] == null);
                int r5 = m6495(tArr2[length].hashCode()) & i4;
                if (tArr3[r5] != null) {
                    do {
                        r5 = (r5 + 1) & i4;
                    } while (tArr3[r5] != null);
                }
                tArr3[r5] = tArr2[length];
                i5 = i6;
            }
            this.f8404 = i4;
            this.f8406 = (int) (((float) i3) * this.f8405);
            this.f8403 = tArr3;
        }
        return true;
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m6496(int i, T[] tArr, int i2) {
        int i3;
        T t;
        this.f8402--;
        while (true) {
            int i4 = i + 1;
            while (true) {
                i3 = i4 & i2;
                t = tArr[i3];
                if (t == null) {
                    tArr[i] = null;
                    return true;
                }
                int r3 = m6495(t.hashCode()) & i2;
                if (i <= i3) {
                    if (i >= r3 || r3 > i3) {
                        break;
                    }
                    i4 = i3 + 1;
                } else {
                    if (i >= r3 && r3 > i3) {
                        break;
                    }
                    i4 = i3 + 1;
                }
            }
            tArr[i] = t;
            i = i3;
        }
    }
}
