package rm;

import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;

/* loaded from: classes3.dex */
public final class i0 implements Collection, en.a {

    /* renamed from: p, reason: collision with root package name */
    private final long[] f34887p;

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes3.dex */
    public static final class a implements Iterator, en.a {

        /* renamed from: p, reason: collision with root package name */
        private final long[] f34888p;

        /* renamed from: q, reason: collision with root package name */
        private int f34889q;

        public a(long[] array) {
            kotlin.jvm.internal.t.g(array, "array");
            this.f34888p = array;
        }

        public long a() {
            int i10 = this.f34889q;
            long[] jArr = this.f34888p;
            if (i10 >= jArr.length) {
                throw new NoSuchElementException(String.valueOf(this.f34889q));
            }
            this.f34889q = i10 + 1;
            return h0.e(jArr[i10]);
        }

        @Override // java.util.Iterator
        public boolean hasNext() {
            return this.f34889q < this.f34888p.length;
        }

        @Override // java.util.Iterator
        public /* bridge */ /* synthetic */ Object next() {
            return h0.a(a());
        }

        @Override // java.util.Iterator
        public void remove() {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }
    }

    private /* synthetic */ i0(long[] jArr) {
        this.f34887p = jArr;
    }

    public static final long B(long[] jArr, int i10) {
        return h0.e(jArr[i10]);
    }

    public static int D(long[] jArr) {
        return jArr.length;
    }

    public static int E(long[] jArr) {
        return Arrays.hashCode(jArr);
    }

    public static boolean F(long[] jArr) {
        return jArr.length == 0;
    }

    public static Iterator G(long[] jArr) {
        return new a(jArr);
    }

    public static final void H(long[] jArr, int i10, long j10) {
        jArr[i10] = j10;
    }

    public static String I(long[] jArr) {
        return "ULongArray(storage=" + Arrays.toString(jArr) + ')';
    }

    public static final /* synthetic */ i0 e(long[] jArr) {
        return new i0(jArr);
    }

    public static long[] g(int i10) {
        return i(new long[i10]);
    }

    public static long[] i(long[] storage) {
        kotlin.jvm.internal.t.g(storage, "storage");
        return storage;
    }

    public static boolean r(long[] jArr, long j10) {
        boolean M;
        M = sm.p.M(jArr, j10);
        return M;
    }

    /* JADX WARN: Removed duplicated region for block: B:13:0x0036 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:17:? A[LOOP:0: B:4:0x0016->B:17:?, LOOP_END, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static boolean x(long[] jArr, Collection elements) {
        boolean z10;
        boolean M;
        kotlin.jvm.internal.t.g(elements, "elements");
        Collection collection = elements;
        if (collection.isEmpty()) {
            return true;
        }
        for (Object obj : collection) {
            if (obj instanceof h0) {
                M = sm.p.M(jArr, ((h0) obj).t());
                if (M) {
                    z10 = true;
                    if (z10) {
                        return false;
                    }
                }
            }
            z10 = false;
            if (z10) {
            }
        }
        return true;
    }

    public static boolean z(long[] jArr, Object obj) {
        return (obj instanceof i0) && kotlin.jvm.internal.t.b(jArr, ((i0) obj).J());
    }

    @Override // java.util.Collection
    /* renamed from: C, reason: merged with bridge method [inline-methods] */
    public int size() {
        return D(this.f34887p);
    }

    public final /* synthetic */ long[] J() {
        return this.f34887p;
    }

    @Override // java.util.Collection
    public /* bridge */ /* synthetic */ boolean add(Object obj) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.Collection
    public boolean addAll(Collection collection) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.Collection
    public void clear() {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.Collection
    public final /* bridge */ boolean contains(Object obj) {
        if (obj instanceof h0) {
            return m(((h0) obj).t());
        }
        return false;
    }

    @Override // java.util.Collection
    public boolean containsAll(Collection elements) {
        kotlin.jvm.internal.t.g(elements, "elements");
        return x(this.f34887p, elements);
    }

    @Override // java.util.Collection
    public boolean equals(Object obj) {
        return z(this.f34887p, obj);
    }

    @Override // java.util.Collection
    public int hashCode() {
        return E(this.f34887p);
    }

    @Override // java.util.Collection
    public boolean isEmpty() {
        return F(this.f34887p);
    }

    @Override // java.util.Collection, java.lang.Iterable
    public Iterator iterator() {
        return G(this.f34887p);
    }

    public boolean m(long j10) {
        return r(this.f34887p, j10);
    }

    @Override // java.util.Collection
    public boolean remove(Object obj) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.Collection
    public boolean removeAll(Collection collection) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.Collection
    public boolean retainAll(Collection collection) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.Collection
    public Object[] toArray() {
        return kotlin.jvm.internal.j.a(this);
    }

    public String toString() {
        return I(this.f34887p);
    }

    @Override // java.util.Collection
    public Object[] toArray(Object[] array) {
        kotlin.jvm.internal.t.g(array, "array");
        return kotlin.jvm.internal.j.b(this, array);
    }
}
