package androidx.collection;

import java.util.Arrays;

/* loaded from: classes.dex */
public final class e0 extends l0 {
    public /* synthetic */ e0(int i10, int i11, kotlin.jvm.internal.k kVar) {
        this((i11 & 1) != 0 ? 16 : i10);
    }

    public final boolean e(Object obj) {
        g(this.f1344b + 1);
        Object[] objArr = this.f1343a;
        int i10 = this.f1344b;
        objArr[i10] = obj;
        this.f1344b = i10 + 1;
        return true;
    }

    public final void f() {
        sm.o.v(this.f1343a, null, 0, this.f1344b);
        this.f1344b = 0;
    }

    public final void g(int i10) {
        Object[] objArr = this.f1343a;
        if (objArr.length < i10) {
            Object[] copyOf = Arrays.copyOf(objArr, Math.max(i10, (objArr.length * 3) / 2));
            kotlin.jvm.internal.t.f(copyOf, "copyOf(this, newSize)");
            this.f1343a = copyOf;
        }
    }

    public final boolean h(Object obj) {
        int b10 = b(obj);
        if (b10 < 0) {
            return false;
        }
        i(b10);
        return true;
    }

    public final Object i(int i10) {
        boolean z10 = false;
        if (i10 >= 0 && i10 < this.f1344b) {
            z10 = true;
        }
        if (!z10) {
            throw new IndexOutOfBoundsException("Index " + i10 + " must be in 0.." + (this.f1344b - 1));
        }
        Object[] objArr = this.f1343a;
        Object obj = objArr[i10];
        int i11 = this.f1344b;
        if (i10 != i11 - 1) {
            sm.o.l(objArr, objArr, i10, i10 + 1, i11);
        }
        int i12 = this.f1344b - 1;
        this.f1344b = i12;
        objArr[i12] = null;
        return obj;
    }

    public e0(int i10) {
        super(i10, null);
    }
}
