package W6;

import M.C0188s;
import java.util.Iterator;
import java.util.NoSuchElementException;
import n4.u0;

/* JADX INFO: loaded from: classes.dex */
public final class e implements Iterator, Q6.a {

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final Iterator f7197r;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public Object f7199t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public final /* synthetic */ h f7200u;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final /* synthetic */ int f7196q = 0;

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

    public e(f fVar) {
        this.f7200u = fVar;
        this.f7197r = new C0188s((f) fVar.f7202b);
    }

    public void a() {
        Object next;
        do {
            Iterator it = this.f7197r;
            if (!it.hasNext()) {
                this.f7198s = 0;
                return;
            }
            next = it.next();
        } while (((Boolean) ((M5.b) ((f) this.f7200u).f7203c).b(next)).booleanValue());
        this.f7199t = next;
        this.f7198s = 1;
    }

    /* JADX WARN: Type inference failed for: r1v4, types: [O6.l, P6.h] */
    public void b() {
        Iterator it = this.f7197r;
        if (it.hasNext()) {
            Object next = it.next();
            if (((Boolean) ((P6.h) ((f) this.f7200u).f7203c).b(next)).booleanValue()) {
                this.f7198s = 1;
                this.f7199t = next;
                return;
            }
        }
        this.f7198s = 0;
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        switch (this.f7196q) {
            case u0.f15495q /* 0 */:
                if (this.f7198s == -1) {
                    a();
                }
                if (this.f7198s == 1) {
                }
                break;
            default:
                if (this.f7198s == -1) {
                    b();
                }
                if (this.f7198s == 1) {
                }
                break;
        }
        return true;
    }

    @Override // java.util.Iterator
    public final Object next() {
        switch (this.f7196q) {
            case u0.f15495q /* 0 */:
                if (this.f7198s == -1) {
                    a();
                }
                if (this.f7198s == 0) {
                    throw new NoSuchElementException();
                }
                Object obj = this.f7199t;
                this.f7199t = null;
                this.f7198s = -1;
                return obj;
            default:
                if (this.f7198s == -1) {
                    b();
                }
                if (this.f7198s == 0) {
                    throw new NoSuchElementException();
                }
                Object obj2 = this.f7199t;
                this.f7199t = null;
                this.f7198s = -1;
                return obj2;
        }
    }

    @Override // java.util.Iterator
    public final void remove() {
        switch (this.f7196q) {
            case u0.f15495q /* 0 */:
                throw new UnsupportedOperationException("Operation is not supported for read-only collection");
            default:
                throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }
    }

    public e(f fVar, byte b8) {
        this.f7200u = fVar;
        this.f7197r = ((h) fVar.f7202b).iterator();
    }
}
