package p402.p419;

import java.util.Iterator;
import java.util.NoSuchElementException;
import kotlin.TypeCastException;
import p402.InterfaceC6540;
import p402.p411.p412.InterfaceC6603;
import p402.p411.p412.InterfaceC6614;
import p402.p411.p413.C6635;
import p402.p411.p413.p414.InterfaceC6650;

/* JADX INFO: renamed from: ގ.ޓ.ށ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
@InterfaceC6540
public final class C6682<T> implements InterfaceC6684<T> {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final InterfaceC6603<T> f19426;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final InterfaceC6614<T, T> f19427;

    /* JADX INFO: renamed from: ގ.ޓ.ށ$֏, reason: contains not printable characters */
    public static final class C6683 implements Iterator<T>, InterfaceC6650 {

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public T f19428;

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public int f19429 = -2;

        public C6683() {
        }

        @Override // java.util.Iterator
        public boolean hasNext() {
            if (this.f19429 < 0) {
                m9849();
            }
            return this.f19429 == 1;
        }

        @Override // java.util.Iterator
        public T next() {
            if (this.f19429 < 0) {
                m9849();
            }
            if (this.f19429 == 0) {
                throw new NoSuchElementException();
            }
            T t = this.f19428;
            if (t == null) {
                throw new TypeCastException("null cannot be cast to non-null type T");
            }
            this.f19429 = -1;
            return t;
        }

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

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final void m9849() {
            T tMo1606;
            if (this.f19429 == -2) {
                tMo1606 = C6682.this.f19426.mo1543();
            } else {
                InterfaceC6614<T, T> interfaceC6614 = C6682.this.f19427;
                T t = this.f19428;
                if (t == null) {
                    C6635.m9822();
                    throw null;
                }
                tMo1606 = interfaceC6614.mo1606(t);
            }
            this.f19428 = tMo1606;
            this.f19429 = tMo1606 == null ? 0 : 1;
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public C6682(InterfaceC6603<? extends T> interfaceC6603, InterfaceC6614<? super T, ? extends T> interfaceC6614) {
        if (interfaceC6603 == 0) {
            C6635.m9824("getInitialValue");
            throw null;
        }
        if (interfaceC6614 == 0) {
            C6635.m9824("getNextValue");
            throw null;
        }
        this.f19426 = interfaceC6603;
        this.f19427 = interfaceC6614;
    }

    @Override // p402.p419.InterfaceC6684
    public Iterator<T> iterator() {
        return new C6683();
    }
}
