package a1;

import androidx.collection.r0;
import dn.p;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import kotlin.coroutines.jvm.internal.k;
import rm.n0;
import rm.y;
import rp.j;
import rp.l;

/* loaded from: classes.dex */
public final class d implements Set, en.a {

    /* renamed from: p, reason: collision with root package name */
    private final r0 f120p;

    /* loaded from: classes.dex */
    static final class a extends k implements p {

        /* renamed from: q, reason: collision with root package name */
        Object f121q;

        /* renamed from: r, reason: collision with root package name */
        Object f122r;

        /* renamed from: s, reason: collision with root package name */
        int f123s;

        /* renamed from: t, reason: collision with root package name */
        int f124t;

        /* renamed from: u, reason: collision with root package name */
        int f125u;

        /* renamed from: v, reason: collision with root package name */
        int f126v;

        /* renamed from: w, reason: collision with root package name */
        long f127w;

        /* renamed from: x, reason: collision with root package name */
        int f128x;

        /* renamed from: y, reason: collision with root package name */
        private /* synthetic */ Object f129y;

        a(vm.d dVar) {
            super(2, dVar);
        }

        @Override // dn.p
        /* renamed from: b, reason: merged with bridge method [inline-methods] */
        public final Object invoke(j jVar, vm.d dVar) {
            return ((a) create(jVar, dVar)).invokeSuspend(n0.f34904a);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final vm.d create(Object obj, vm.d dVar) {
            a aVar = new a(dVar);
            aVar.f129y = obj;
            return aVar;
        }

        /* JADX WARN: Code restructure failed: missing block: B:16:0x0099, code lost:
        
            if (0 != 0) goto L20;
         */
        /* JADX WARN: Removed duplicated region for block: B:17:0x009c  */
        /* JADX WARN: Removed duplicated region for block: B:20:0x00a4  */
        /* JADX WARN: Removed duplicated region for block: B:23:0x005a  */
        /* JADX WARN: Removed duplicated region for block: B:7:0x006d  */
        /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:12:0x0096 -> B:5:0x0099). Please report as a decompilation issue!!! */
        /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:21:0x0058 -> B:18:0x00a2). Please report as a decompilation issue!!! */
        /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:22:0x005a -> B:6:0x006b). Please report as a decompilation issue!!! */
        @Override // kotlin.coroutines.jvm.internal.a
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            Object f10;
            j jVar;
            Object[] objArr;
            long[] jArr;
            int length;
            int i10;
            long j10;
            f10 = wm.d.f();
            int i11 = this.f128x;
            if (i11 == 0) {
                y.b(obj);
                jVar = (j) this.f129y;
                r0 e10 = d.this.e();
                objArr = e10.f1380b;
                jArr = e10.f1379a;
                length = jArr.length - 2;
                if (length >= 0) {
                    i10 = 0;
                    j10 = jArr[i10];
                    if ((((~j10) << 7) & j10 & (-9187201950435737472L)) != -9187201950435737472L) {
                    }
                    if (i10 != length) {
                    }
                }
                return n0.f34904a;
            }
            if (i11 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            int i12 = this.f126v;
            int i13 = this.f125u;
            long j11 = this.f127w;
            i10 = this.f124t;
            int i14 = this.f123s;
            long[] jArr2 = (long[]) this.f122r;
            Object[] objArr2 = (Object[]) this.f121q;
            j jVar2 = (j) this.f129y;
            y.b(obj);
            j11 >>= 8;
            i12++;
            if (i12 < i13) {
                if (i13 == 8) {
                    length = i14;
                    jArr = jArr2;
                    objArr = objArr2;
                    jVar = jVar2;
                    if (i10 != length) {
                        i10++;
                        j10 = jArr[i10];
                        if ((((~j10) << 7) & j10 & (-9187201950435737472L)) != -9187201950435737472L) {
                            jVar2 = jVar;
                            i12 = 0;
                            jArr2 = jArr;
                            i14 = length;
                            i13 = 8 - ((~(i10 - length)) >>> 31);
                            objArr2 = objArr;
                            j11 = j10;
                            if (i12 < i13) {
                                if ((255 & j11) < 128) {
                                    if (1 != 0) {
                                        Object obj2 = objArr2[(i10 << 3) + i12];
                                        this.f129y = jVar2;
                                        this.f121q = objArr2;
                                        this.f122r = jArr2;
                                        this.f123s = i14;
                                        this.f124t = i10;
                                        this.f127w = j11;
                                        this.f125u = i13;
                                        this.f126v = i12;
                                        this.f128x = 1;
                                        if (jVar2.a(obj2, this) == f10) {
                                            return f10;
                                        }
                                    }
                                }
                                j11 >>= 8;
                                i12++;
                                if (i12 < i13) {
                                }
                            }
                        }
                        if (i10 != length) {
                        }
                    }
                }
                return n0.f34904a;
            }
        }
    }

    public d(r0 r0Var) {
        this.f120p = r0Var;
    }

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

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

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

    @Override // java.util.Set, java.util.Collection
    public boolean contains(Object obj) {
        return this.f120p.a(obj);
    }

    @Override // java.util.Set, java.util.Collection
    public boolean containsAll(Collection collection) {
        Collection collection2 = collection;
        if ((collection2 instanceof Collection) && collection2.isEmpty()) {
            return true;
        }
        Iterator it = collection2.iterator();
        while (it.hasNext()) {
            if (!this.f120p.a(it.next())) {
                return false;
            }
        }
        return true;
    }

    public final r0 e() {
        return this.f120p;
    }

    public int g() {
        return this.f120p.c();
    }

    @Override // java.util.Set, java.util.Collection
    public boolean isEmpty() {
        return this.f120p.d();
    }

    @Override // java.util.Set, java.util.Collection, java.lang.Iterable
    public Iterator iterator() {
        Iterator a10;
        a10 = l.a(new a(null));
        return a10;
    }

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

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

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

    @Override // java.util.Set, java.util.Collection
    public final /* bridge */ int size() {
        return g();
    }

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

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