package n;

import java.util.Iterator;

/* JADX INFO: loaded from: classes.dex */
public abstract class e extends f implements Iterator {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public c f30711a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public c f30712b;

    @Override // n.f
    public final void a(c cVar) {
        c cVar2;
        c cVar3;
        c cVar4 = null;
        if (this.f30711a == cVar && cVar == this.f30712b) {
            this.f30712b = null;
            this.f30711a = null;
        }
        c cVar5 = this.f30711a;
        if (cVar5 == cVar) {
            switch (((b) this).f30703c) {
                case 0:
                    cVar3 = cVar5.f30707d;
                    break;
                default:
                    cVar3 = cVar5.f30706c;
                    break;
            }
            this.f30711a = cVar3;
        }
        c cVar6 = this.f30712b;
        if (cVar6 == cVar) {
            c cVar7 = this.f30711a;
            if (cVar6 != cVar7 && cVar7 != null) {
                switch (((b) this).f30703c) {
                    case 0:
                        cVar2 = cVar6.f30706c;
                        break;
                    default:
                        cVar2 = cVar6.f30707d;
                        break;
                }
                cVar4 = cVar2;
            }
            this.f30712b = cVar4;
        }
    }

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

    @Override // java.util.Iterator
    public final Object next() {
        c cVar;
        c cVar2 = this.f30712b;
        c cVar3 = this.f30711a;
        if (cVar2 != cVar3 && cVar3 != null) {
            switch (((b) this).f30703c) {
                case 0:
                    cVar = cVar2.f30706c;
                    break;
                default:
                    cVar = cVar2.f30707d;
                    break;
            }
        } else {
            cVar = null;
        }
        this.f30712b = cVar;
        return cVar2;
    }
}
