package defpackage;

import java.util.Arrays;

/* renamed from: ˉᵛᵨ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C1196 implements Cloneable {

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public /* synthetic */ long[] f5098;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public /* synthetic */ boolean f5099;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public /* synthetic */ int f5100;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public /* synthetic */ Object[] f5101;

    public C1196() {
        int i;
        int i2 = 4;
        while (true) {
            i = 80;
            if (i2 >= 32) {
                break;
            }
            int i3 = (1 << i2) - 12;
            if (80 <= i3) {
                i = i3;
                break;
            }
            i2++;
        }
        int i4 = i / 8;
        this.f5098 = new long[i4];
        this.f5101 = new Object[i4];
    }

    public final String toString() {
        if (m3730() <= 0) {
            return "{}";
        }
        StringBuilder sb = new StringBuilder(this.f5100 * 28);
        sb.append('{');
        int i = this.f5100;
        for (int i2 = 0; i2 < i; i2++) {
            if (i2 > 0) {
                sb.append(", ");
            }
            sb.append(m3732(i2));
            sb.append('=');
            Object objM3731 = m3731(i2);
            if (objM3731 != sb) {
                sb.append(objM3731);
            } else {
                sb.append("(this Map)");
            }
        }
        sb.append('}');
        return sb.toString();
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters and merged with bridge method [inline-methods] */
    public final C1196 clone() {
        C1196 c1196 = (C1196) super.clone();
        c1196.f5098 = (long[]) this.f5098.clone();
        c1196.f5101 = (Object[]) this.f5101.clone();
        return c1196;
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final Object m3726(long j) {
        Object obj;
        int i = ᵛᵾˏ.ˇʼʤˎ(this.f5098, this.f5100, j);
        if (i < 0 || (obj = this.f5101[i]) == ˆᴵ.ᵧᵾˀˈ) {
            return -1L;
        }
        return obj;
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final Object m3727(long j) {
        Object obj;
        int i = ᵛᵾˏ.ˇʼʤˎ(this.f5098, this.f5100, j);
        if (i < 0 || (obj = this.f5101[i]) == ˆᴵ.ᵧᵾˀˈ) {
            return null;
        }
        return obj;
    }

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final void m3728(long j, Object obj) {
        Object obj2 = ˆᴵ.ᵧᵾˀˈ;
        int i = ᵛᵾˏ.ˇʼʤˎ(this.f5098, this.f5100, j);
        if (i >= 0) {
            this.f5101[i] = obj;
            return;
        }
        int i2 = ~i;
        int i3 = this.f5100;
        if (i2 < i3) {
            Object[] objArr = this.f5101;
            if (objArr[i2] == obj2) {
                this.f5098[i2] = j;
                objArr[i2] = obj;
                return;
            }
        }
        if (this.f5099) {
            long[] jArr = this.f5098;
            if (i3 >= jArr.length) {
                Object[] objArr2 = this.f5101;
                int i4 = 0;
                for (int i5 = 0; i5 < i3; i5++) {
                    Object obj3 = objArr2[i5];
                    if (obj3 != obj2) {
                        if (i5 != i4) {
                            jArr[i4] = jArr[i5];
                            objArr2[i4] = obj3;
                            objArr2[i5] = null;
                        }
                        i4++;
                    }
                }
                this.f5099 = false;
                this.f5100 = i4;
                i2 = ~ᵛᵾˏ.ˇʼʤˎ(this.f5098, i4, j);
            }
        }
        int i6 = this.f5100;
        if (i6 >= this.f5098.length) {
            int i7 = (i6 + 1) * 8;
            int i8 = 4;
            while (true) {
                if (i8 >= 32) {
                    break;
                }
                int i9 = (1 << i8) - 12;
                if (i7 <= i9) {
                    i7 = i9;
                    break;
                }
                i8++;
            }
            int i10 = i7 / 8;
            this.f5098 = Arrays.copyOf(this.f5098, i10);
            this.f5101 = Arrays.copyOf(this.f5101, i10);
        }
        int i11 = this.f5100 - i2;
        if (i11 != 0) {
            long[] jArr2 = this.f5098;
            int i12 = i2 + 1;
            System.arraycopy(jArr2, i2, jArr2, i12, i11);
            Object[] objArr3 = this.f5101;
            AbstractC1658.m4726(i12, i2, this.f5100, objArr3, objArr3);
        }
        this.f5098[i2] = j;
        this.f5101[i2] = obj;
        this.f5100++;
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final void m3729(long j, Long l) {
        int i = this.f5100;
        if (i != 0 && j <= this.f5098[i - 1]) {
            m3728(j, l);
            return;
        }
        if (this.f5099) {
            long[] jArr = this.f5098;
            if (i >= jArr.length) {
                Object[] objArr = this.f5101;
                int i2 = 0;
                for (int i3 = 0; i3 < i; i3++) {
                    Object obj = objArr[i3];
                    if (obj != ˆᴵ.ᵧᵾˀˈ) {
                        if (i3 != i2) {
                            jArr[i2] = jArr[i3];
                            objArr[i2] = obj;
                            objArr[i3] = null;
                        }
                        i2++;
                    }
                }
                this.f5099 = false;
                this.f5100 = i2;
            }
        }
        int i4 = this.f5100;
        if (i4 >= this.f5098.length) {
            int i5 = (i4 + 1) * 8;
            int i6 = 4;
            while (true) {
                if (i6 >= 32) {
                    break;
                }
                int i7 = (1 << i6) - 12;
                if (i5 <= i7) {
                    i5 = i7;
                    break;
                }
                i6++;
            }
            int i8 = i5 / 8;
            this.f5098 = Arrays.copyOf(this.f5098, i8);
            this.f5101 = Arrays.copyOf(this.f5101, i8);
        }
        this.f5098[i4] = j;
        this.f5101[i4] = l;
        this.f5100 = i4 + 1;
    }

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final int m3730() {
        if (this.f5099) {
            int i = this.f5100;
            long[] jArr = this.f5098;
            Object[] objArr = this.f5101;
            int i2 = 0;
            for (int i3 = 0; i3 < i; i3++) {
                Object obj = objArr[i3];
                if (obj != ˆᴵ.ᵧᵾˀˈ) {
                    if (i3 != i2) {
                        jArr[i2] = jArr[i3];
                        objArr[i2] = obj;
                        objArr[i3] = null;
                    }
                    i2++;
                }
            }
            this.f5099 = false;
            this.f5100 = i2;
        }
        return this.f5100;
    }

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final Object m3731(int i) {
        int i2;
        if (i < 0 || i >= (i2 = this.f5100)) {
            ᵯᵽᵦ.ˀᵗᵩ("Expected index to be within 0..size()-1, but was " + i);
            throw null;
        }
        if (this.f5099) {
            long[] jArr = this.f5098;
            Object[] objArr = this.f5101;
            int i3 = 0;
            for (int i4 = 0; i4 < i2; i4++) {
                Object obj = objArr[i4];
                if (obj != ˆᴵ.ᵧᵾˀˈ) {
                    if (i4 != i3) {
                        jArr[i3] = jArr[i4];
                        objArr[i3] = obj;
                        objArr[i4] = null;
                    }
                    i3++;
                }
            }
            this.f5099 = false;
            this.f5100 = i3;
        }
        return this.f5101[i];
    }

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final long m3732(int i) {
        int i2;
        if (i < 0 || i >= (i2 = this.f5100)) {
            ᵯᵽᵦ.ˀᵗᵩ("Expected index to be within 0..size()-1, but was " + i);
            throw null;
        }
        if (this.f5099) {
            long[] jArr = this.f5098;
            Object[] objArr = this.f5101;
            int i3 = 0;
            for (int i4 = 0; i4 < i2; i4++) {
                Object obj = objArr[i4];
                if (obj != ˆᴵ.ᵧᵾˀˈ) {
                    if (i4 != i3) {
                        jArr[i3] = jArr[i4];
                        objArr[i3] = obj;
                        objArr[i4] = null;
                    }
                    i3++;
                }
            }
            this.f5099 = false;
            this.f5100 = i3;
        }
        return this.f5098[i];
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final void m3733() {
        int i = this.f5100;
        Object[] objArr = this.f5101;
        for (int i2 = 0; i2 < i; i2++) {
            objArr[i2] = null;
        }
        this.f5100 = 0;
        this.f5099 = false;
    }
}
