package I0;

import i0.AbstractC2254r;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.function.UnaryOperator;
import n.C2568C;
import o.AbstractC2628a;
import x4.AbstractC3250p;
import x4.AbstractC3252r;

/* JADX INFO: loaded from: classes.dex */
public final class r implements List, K4.a {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final n.J f2455a = new n.J(16);

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final C2568C f2456b = new C2568C(16);

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f2457c = -1;

    @Override // java.util.List
    public final /* bridge */ /* synthetic */ void add(int i6, Object obj) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

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

    public final /* bridge */ /* synthetic */ void addFirst(Object obj) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    public final /* bridge */ /* synthetic */ void addLast(Object obj) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List, java.util.Collection
    public final void clear() {
        this.f2457c = -1;
        this.f2455a.j();
        this.f2456b.f21318b = 0;
    }

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

    @Override // java.util.List, java.util.Collection
    public final boolean containsAll(Collection collection) {
        Iterator it = collection.iterator();
        while (it.hasNext()) {
            if (!contains((AbstractC2254r) it.next())) {
                return false;
            }
        }
        return true;
    }

    /* JADX WARN: Code restructure failed: missing block: B:20:0x003d, code lost:
    
        o.AbstractC2628a.d("Index must be between 0 and size");
     */
    /* JADX WARN: Code restructure failed: missing block: B:21:0x0043, code lost:
    
        throw null;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final long g() {
        long jA = AbstractC0303l.a(Float.POSITIVE_INFINITY, false, false);
        int i6 = this.f2457c + 1;
        int iA = AbstractC3252r.A(this);
        if (i6 > iA) {
            return jA;
        }
        while (true) {
            C2568C c2568c = this.f2456b;
            if (i6 < 0) {
                c2568c.getClass();
                break;
            }
            if (i6 >= c2568c.f21318b) {
                break;
            }
            long j4 = c2568c.f21317a[i6];
            if (AbstractC0303l.g(j4, jA) < 0) {
                jA = j4;
            }
            if ((AbstractC0303l.j(jA) < 0.0f && AbstractC0303l.m(jA)) || i6 == iA) {
                break;
            }
            i6++;
        }
        return jA;
    }

    @Override // java.util.List
    public final Object get(int i6) {
        Object objB = this.f2455a.b(i6);
        kotlin.jvm.internal.o.f(objB, "null cannot be cast to non-null type androidx.compose.ui.Modifier.Node");
        return (AbstractC2254r) objB;
    }

    public final void h(int i6, int i7) {
        if (i6 >= i7) {
            return;
        }
        this.f2455a.m(i6, i7);
        C2568C c2568c = this.f2456b;
        if (i6 >= 0) {
            int i8 = c2568c.f21318b;
            if (i6 <= i8 && i7 >= 0 && i7 <= i8) {
                if (i7 < i6) {
                    AbstractC2628a.c("The end index must be < start index");
                    throw null;
                }
                if (i7 != i6) {
                    if (i7 < i8) {
                        long[] jArr = c2568c.f21317a;
                        AbstractC3250p.A(jArr, jArr, i6, i7, i8);
                    }
                    c2568c.f21318b -= i7 - i6;
                    return;
                }
                return;
            }
        } else {
            c2568c.getClass();
        }
        AbstractC2628a.d("Index must be between 0 and size");
        throw null;
    }

    @Override // java.util.List
    public final int indexOf(Object obj) {
        if (!(obj instanceof AbstractC2254r)) {
            return -1;
        }
        AbstractC2254r abstractC2254r = (AbstractC2254r) obj;
        int iA = AbstractC3252r.A(this);
        if (iA >= 0) {
            int i6 = 0;
            while (!kotlin.jvm.internal.o.c(this.f2455a.b(i6), abstractC2254r)) {
                if (i6 != iA) {
                    i6++;
                }
            }
            return i6;
        }
        return -1;
    }

    @Override // java.util.List, java.util.Collection
    public final boolean isEmpty() {
        return this.f2455a.d();
    }

    @Override // java.util.List, java.util.Collection, java.lang.Iterable
    public final Iterator iterator() {
        return new C0307p(this, 0, 7);
    }

    @Override // java.util.List
    public final int lastIndexOf(Object obj) {
        if (!(obj instanceof AbstractC2254r)) {
            return -1;
        }
        AbstractC2254r abstractC2254r = (AbstractC2254r) obj;
        for (int iA = AbstractC3252r.A(this); -1 < iA; iA--) {
            if (kotlin.jvm.internal.o.c(this.f2455a.b(iA), abstractC2254r)) {
                return iA;
            }
        }
        return -1;
    }

    @Override // java.util.List
    public final ListIterator listIterator() {
        return new C0307p(this, 0, 7);
    }

    @Override // java.util.List
    public final /* bridge */ /* synthetic */ Object remove(int i6) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

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

    public final /* bridge */ /* synthetic */ Object removeFirst() {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    public final /* bridge */ /* synthetic */ Object removeLast() {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List
    public final void replaceAll(UnaryOperator unaryOperator) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

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

    @Override // java.util.List
    public final /* bridge */ /* synthetic */ Object set(int i6, Object obj) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

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

    @Override // java.util.List
    public final void sort(Comparator comparator) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List
    public final List subList(int i6, int i7) {
        return new C0308q(this, i6, i7);
    }

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

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

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

    @Override // java.util.List
    public final ListIterator listIterator(int i6) {
        return new C0307p(this, i6, 6);
    }

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

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