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 e0 implements Collection, en.a {

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

    /* 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 byte[] f34878p;

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

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

        public byte a() {
            int i10 = this.f34879q;
            byte[] bArr = this.f34878p;
            if (i10 >= bArr.length) {
                throw new NoSuchElementException(String.valueOf(this.f34879q));
            }
            this.f34879q = i10 + 1;
            return d0.e(bArr[i10]);
        }

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

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

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

    private /* synthetic */ e0(byte[] bArr) {
        this.f34877p = bArr;
    }

    public static int C(byte[] bArr) {
        return bArr.length;
    }

    public static int D(byte[] bArr) {
        return Arrays.hashCode(bArr);
    }

    public static boolean E(byte[] bArr) {
        return bArr.length == 0;
    }

    public static Iterator F(byte[] bArr) {
        return new a(bArr);
    }

    public static final void G(byte[] bArr, int i10, byte b10) {
        bArr[i10] = b10;
    }

    public static String H(byte[] bArr) {
        return "UByteArray(storage=" + Arrays.toString(bArr) + ')';
    }

    public static final /* synthetic */ e0 e(byte[] bArr) {
        return new e0(bArr);
    }

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

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

    public static boolean r(byte[] bArr, byte b10) {
        boolean J;
        J = sm.p.J(bArr, b10);
        return J;
    }

    /* 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(byte[] bArr, Collection elements) {
        boolean z10;
        boolean J;
        kotlin.jvm.internal.t.g(elements, "elements");
        Collection collection = elements;
        if (collection.isEmpty()) {
            return true;
        }
        for (Object obj : collection) {
            if (obj instanceof d0) {
                J = sm.p.J(bArr, ((d0) obj).s());
                if (J) {
                    z10 = true;
                    if (z10) {
                        return false;
                    }
                }
            }
            z10 = false;
            if (z10) {
            }
        }
        return true;
    }

    public static boolean z(byte[] bArr, Object obj) {
        return (obj instanceof e0) && kotlin.jvm.internal.t.b(bArr, ((e0) obj).I());
    }

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

    public final /* synthetic */ byte[] I() {
        return this.f34877p;
    }

    @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 d0) {
            return m(((d0) obj).s());
        }
        return false;
    }

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

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

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

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

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

    public boolean m(byte b10) {
        return r(this.f34877p, b10);
    }

    @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 H(this.f34877p);
    }

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