package defpackage;

import java.util.Arrays;

/* renamed from: ˀˈ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C0525 implements Cloneable {

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

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public /* synthetic */ int[] f2741;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public /* synthetic */ int f2742;

    public C0525() {
        int i;
        int i2 = 4;
        while (true) {
            i = 40;
            if (i2 >= 32) {
                break;
            }
            int i3 = (1 << i2) - 12;
            if (40 <= i3) {
                i = i3;
                break;
            }
            i2++;
        }
        int i4 = i / 4;
        this.f2741 = new int[i4];
        this.f2740 = new Object[i4];
    }

    public final String toString() {
        int i = this.f2742;
        if (i <= 0) {
            return "{}";
        }
        StringBuilder sb = new StringBuilder(i * 28);
        sb.append('{');
        int i2 = this.f2742;
        for (int i3 = 0; i3 < i2; i3++) {
            if (i3 > 0) {
                sb.append(", ");
            }
            if (i3 >= this.f2742 || i3 < 0) {
                throw new ArrayIndexOutOfBoundsException();
            }
            sb.append(this.f2741[i3]);
            sb.append('=');
            Object objM2317 = m2317(i3);
            if (objM2317 != this) {
                sb.append(objM2317);
            } else {
                sb.append("(this Map)");
            }
        }
        sb.append('}');
        return sb.toString();
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final void m2316(int i, Object obj) {
        int i2 = ᵛᵾˏ.ᵻᵢﹳᵰ(this.f2741, this.f2742, i);
        if (i2 >= 0) {
            this.f2740[i2] = obj;
            return;
        }
        int i3 = ~i2;
        int i4 = this.f2742;
        if (i3 < i4) {
            Object[] objArr = this.f2740;
            if (objArr[i3] == ᵲᵝᵪ.ᵴᵳ) {
                this.f2741[i3] = i;
                objArr[i3] = obj;
                return;
            }
        }
        if (i4 >= this.f2741.length) {
            int i5 = (i4 + 1) * 4;
            int i6 = 4;
            while (true) {
                if (i6 >= 32) {
                    break;
                }
                int i7 = (1 << i6) - 12;
                if (i5 <= i7) {
                    i5 = i7;
                    break;
                }
                i6++;
            }
            int i8 = i5 / 4;
            this.f2741 = Arrays.copyOf(this.f2741, i8);
            this.f2740 = Arrays.copyOf(this.f2740, i8);
        }
        int i9 = this.f2742;
        if (i9 - i3 != 0) {
            int[] iArr = this.f2741;
            int i10 = i3 + 1;
            AbstractC1658.m4716(i10, i3, i9, iArr, iArr);
            Object[] objArr2 = this.f2740;
            AbstractC1658.m4726(i10, i3, this.f2742, objArr2, objArr2);
        }
        this.f2741[i3] = i;
        this.f2740[i3] = obj;
        this.f2742++;
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final Object m2317(int i) {
        if (i >= this.f2742 || i < 0) {
            throw new ArrayIndexOutOfBoundsException();
        }
        return this.f2740[i];
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final void m2318(int i, Object obj) {
        int i2 = this.f2742;
        if (i2 != 0 && i <= this.f2741[i2 - 1]) {
            m2316(i, obj);
            return;
        }
        if (i2 >= this.f2741.length) {
            int i3 = (i2 + 1) * 4;
            int i4 = 4;
            while (true) {
                if (i4 >= 32) {
                    break;
                }
                int i5 = (1 << i4) - 12;
                if (i3 <= i5) {
                    i3 = i5;
                    break;
                }
                i4++;
            }
            int i6 = i3 / 4;
            this.f2741 = Arrays.copyOf(this.f2741, i6);
            this.f2740 = Arrays.copyOf(this.f2740, i6);
        }
        this.f2741[i2] = i;
        this.f2740[i2] = obj;
        this.f2742 = i2 + 1;
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters and merged with bridge method [inline-methods] */
    public final C0525 clone() {
        C0525 c0525 = (C0525) super.clone();
        c0525.f2741 = (int[]) this.f2741.clone();
        c0525.f2740 = (Object[]) this.f2740.clone();
        return c0525;
    }
}
