package kotlin.ranges;

import java.util.NoSuchElementException;
import o1.AbstractC0653A;

/* JADX INFO: loaded from: classes.dex */
public final class h extends AbstractC0653A {

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

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

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

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

    public h(int i2, int i3, int i4) {
        this.f5121b = i4;
        this.f5122g = i3;
        boolean z2 = false;
        if (i4 <= 0 ? i2 >= i3 : i2 <= i3) {
            z2 = true;
        }
        this.f5123r = z2;
        this.f5124x = z2 ? i2 : i3;
    }

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

    @Override // o1.AbstractC0653A
    public int nextInt() {
        int i2 = this.f5124x;
        if (i2 != this.f5122g) {
            this.f5124x = this.f5121b + i2;
        } else {
            if (!this.f5123r) {
                throw new NoSuchElementException();
            }
            this.f5123r = false;
        }
        return i2;
    }
}
