package jn;

import java.util.NoSuchElementException;
import sm.l0;

/* loaded from: classes3.dex */
public final class k extends l0 {

    /* renamed from: p, reason: collision with root package name */
    private final long f25094p;

    /* renamed from: q, reason: collision with root package name */
    private final long f25095q;

    /* renamed from: r, reason: collision with root package name */
    private boolean f25096r;

    /* renamed from: s, reason: collision with root package name */
    private long f25097s;

    public k(long j10, long j11, long j12) {
        this.f25094p = j12;
        this.f25095q = j11;
        boolean z10 = true;
        if (j12 <= 0 ? j10 < j11 : j10 > j11) {
            z10 = false;
        }
        this.f25096r = z10;
        this.f25097s = z10 ? j10 : j11;
    }

    @Override // sm.l0
    public long a() {
        long j10 = this.f25097s;
        if (j10 != this.f25095q) {
            this.f25097s = this.f25094p + j10;
        } else {
            if (!this.f25096r) {
                throw new NoSuchElementException();
            }
            this.f25096r = false;
        }
        return j10;
    }

    @Override // java.util.Iterator
    public boolean hasNext() {
        return this.f25096r;
    }
}
