package o6;

import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.NoSuchElementException;

/* JADX INFO: renamed from: o6.r, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1398r implements Iterator {

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public C1400t f15896q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public C1400t f15897r = null;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public int f15898s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final /* synthetic */ C1401u f15899t;

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

    public C1398r(C1401u c1401u, int i) {
        this.f15900u = i;
        this.f15899t = c1401u;
        this.f15896q = c1401u.f15915s.f15906t;
        this.f15898s = c1401u.f15917u;
    }

    public final Object a() {
        return b();
    }

    public final C1400t b() {
        C1400t c1400t = this.f15896q;
        C1401u c1401u = this.f15899t;
        if (c1400t == c1401u.f15915s) {
            throw new NoSuchElementException();
        }
        if (c1401u.f15917u != this.f15898s) {
            throw new ConcurrentModificationException();
        }
        this.f15896q = c1400t.f15906t;
        this.f15897r = c1400t;
        return c1400t;
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        return this.f15896q != this.f15899t.f15915s;
    }

    @Override // java.util.Iterator
    public Object next() {
        switch (this.f15900u) {
            case 1:
                return b().f15908v;
            default:
                return a();
        }
    }

    @Override // java.util.Iterator
    public final void remove() {
        C1400t c1400t = this.f15897r;
        if (c1400t == null) {
            throw new IllegalStateException();
        }
        C1401u c1401u = this.f15899t;
        c1401u.c(c1400t, true);
        this.f15897r = null;
        this.f15898s = c1401u.f15917u;
    }
}
