package kotlin.ranges;

import java.util.NoSuchElementException;
import o1.AbstractC0654B;

/* JADX INFO: loaded from: classes.dex */
public final class k extends AbstractC0654B {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final long f5131b;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private final long f5132g;

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

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    private long f5134x;

    public k(long j2, long j3, long j4) {
        this.f5131b = j4;
        this.f5132g = j3;
        boolean z2 = false;
        if (j4 <= 0 ? j2 >= j3 : j2 <= j3) {
            z2 = true;
        }
        this.f5133r = z2;
        this.f5134x = z2 ? j2 : j3;
    }

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

    @Override // o1.AbstractC0654B
    public long nextLong() {
        long j2 = this.f5134x;
        if (j2 != this.f5132g) {
            this.f5134x = this.f5131b + j2;
        } else {
            if (!this.f5133r) {
                throw new NoSuchElementException();
            }
            this.f5133r = false;
        }
        return j2;
    }
}
