package defpackage;

import java.util.AbstractList;
import java.util.Arrays;
import java.util.Collection;
import java.util.RandomAccess;

/* renamed from: ᵥᵟʿʽ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3523 extends AbstractC1528 implements RandomAccess, InterfaceC4536 {

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public static final C3523 f13226;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public static final int[] f13227;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public int[] f13228;

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

    static {
        int[] iArr = new int[0];
        f13227 = iArr;
        f13226 = new C3523(iArr, 0, false);
    }

    public C3523(int[] iArr, int i, boolean z) {
        super(z);
        this.f13228 = iArr;
        this.f13229 = i;
    }

    @Override // java.util.AbstractList, java.util.List
    public final void add(int i, Object obj) {
        int i2;
        int iIntValue = ((Integer) obj).intValue();
        m4452();
        if (i < 0 || i > (i2 = this.f13229)) {
            C2585.m6491(AbstractC1327.m4091(i, this.f13229, "Index:", ", Size:"));
            return;
        }
        int i3 = i + 1;
        int[] iArr = this.f13228;
        int length = iArr.length;
        if (i2 < length) {
            System.arraycopy(iArr, i, iArr, i3, i2 - i);
        } else {
            int[] iArr2 = new int[AbstractC4737.m10017(length, 3, 2, 1, 10)];
            System.arraycopy(this.f13228, 0, iArr2, 0, i);
            System.arraycopy(this.f13228, i, iArr2, i3, this.f13229 - i);
            this.f13228 = iArr2;
        }
        this.f13228[i] = iIntValue;
        this.f13229++;
        ((AbstractList) this).modCount++;
    }

    @Override // java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
    public final /* bridge */ /* synthetic */ boolean add(Object obj) {
        m8047(((Integer) obj).intValue());
        return true;
    }

    @Override // defpackage.AbstractC1528, java.util.AbstractCollection, java.util.Collection, java.util.List
    public final boolean addAll(Collection collection) {
        m4452();
        collection.getClass();
        if (!(collection instanceof C3523)) {
            return super.addAll(collection);
        }
        C3523 c3523 = (C3523) collection;
        int i = c3523.f13229;
        if (i == 0) {
            return false;
        }
        int i2 = this.f13229;
        if (Integer.MAX_VALUE - i2 < i) {
            throw new OutOfMemoryError();
        }
        int i3 = i2 + i;
        int[] iArr = this.f13228;
        if (i3 > iArr.length) {
            this.f13228 = Arrays.copyOf(iArr, i3);
        }
        System.arraycopy(c3523.f13228, 0, this.f13228, this.f13229, c3523.f13229);
        this.f13229 = i3;
        ((AbstractList) this).modCount++;
        return true;
    }

    @Override // java.util.AbstractCollection, java.util.Collection, java.util.List
    public final boolean contains(Object obj) {
        return indexOf(obj) != -1;
    }

    @Override // defpackage.AbstractC1528, java.util.AbstractList, java.util.Collection, java.util.List
    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof C3523)) {
            return super.equals(obj);
        }
        C3523 c3523 = (C3523) obj;
        if (this.f13229 != c3523.f13229) {
            return false;
        }
        int[] iArr = c3523.f13228;
        for (int i = 0; i < this.f13229; i++) {
            if (this.f13228[i] != iArr[i]) {
                return false;
            }
        }
        return true;
    }

    @Override // java.util.AbstractList, java.util.List
    public final /* synthetic */ Object get(int i) {
        m8048(i);
        return Integer.valueOf(this.f13228[i]);
    }

    @Override // java.util.AbstractList, java.util.Collection, java.util.List
    public final int hashCode() {
        int i = 1;
        for (int i2 = 0; i2 < this.f13229; i2++) {
            i = (i * 31) + this.f13228[i2];
        }
        return i;
    }

    @Override // java.util.AbstractList, java.util.List
    public final int indexOf(Object obj) {
        if (!(obj instanceof Integer)) {
            return -1;
        }
        int iIntValue = ((Integer) obj).intValue();
        int i = this.f13229;
        for (int i2 = 0; i2 < i; i2++) {
            if (this.f13228[i2] == iIntValue) {
                return i2;
            }
        }
        return -1;
    }

    @Override // defpackage.AbstractC1528, java.util.AbstractList, java.util.List
    public final /* bridge */ /* synthetic */ Object remove(int i) {
        m4452();
        m8048(i);
        int[] iArr = this.f13228;
        int i2 = iArr[i];
        if (i < this.f13229 - 1) {
            System.arraycopy(iArr, i + 1, iArr, i, (r2 - i) - 1);
        }
        this.f13229--;
        ((AbstractList) this).modCount++;
        return Integer.valueOf(i2);
    }

    @Override // java.util.AbstractList
    public final void removeRange(int i, int i2) {
        m4452();
        if (i2 < i) {
            C2585.m6491("toIndex < fromIndex");
            return;
        }
        int[] iArr = this.f13228;
        System.arraycopy(iArr, i2, iArr, i, this.f13229 - i2);
        this.f13229 -= i2 - i;
        ((AbstractList) this).modCount++;
    }

    @Override // java.util.AbstractList, java.util.List
    public final /* bridge */ /* synthetic */ Object set(int i, Object obj) {
        int iIntValue = ((Integer) obj).intValue();
        m4452();
        m8048(i);
        int[] iArr = this.f13228;
        int i2 = iArr[i];
        iArr[i] = iIntValue;
        return Integer.valueOf(i2);
    }

    @Override // java.util.AbstractCollection, java.util.Collection, java.util.List
    public final int size() {
        return this.f13229;
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final void m8047(int i) {
        m4452();
        int i2 = this.f13229;
        int length = this.f13228.length;
        if (i2 == length) {
            int[] iArr = new int[AbstractC4737.m10017(length, 3, 2, 1, 10)];
            System.arraycopy(this.f13228, 0, iArr, 0, this.f13229);
            this.f13228 = iArr;
        }
        int[] iArr2 = this.f13228;
        int i3 = this.f13229;
        this.f13229 = i3 + 1;
        iArr2[i3] = i;
    }

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final void m8048(int i) {
        if (i < 0 || i >= this.f13229) {
            C2585.m6491(AbstractC1327.m4091(i, this.f13229, "Index:", ", Size:"));
        }
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final int m8049(int i) {
        m8048(i);
        return this.f13228[i];
    }

    @Override // defpackage.InterfaceC1752
    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters and merged with bridge method [inline-methods] */
    public final C3523 mo4968(int i) {
        if (i >= this.f13229) {
            return new C3523(i == 0 ? f13227 : Arrays.copyOf(this.f13228, i), this.f13229, true);
        }
        ᵨᴵᵺ.ᵻᵢﹳᵰ();
        return null;
    }
}
