package g.j0;

import java.util.Iterator;

/* JADX INFO: compiled from: Progressions.kt */
/* JADX INFO: loaded from: classes.dex */
@g.i
public class i implements Iterable<Long>, g.h0.c.g0.a {

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final long f4133e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final long f4134f;

    public i(long j2, long j3, long j4) {
        if (j4 == 0) {
            throw new IllegalArgumentException("Step must be non-zero.");
        }
        if (j4 == Long.MIN_VALUE) {
            throw new IllegalArgumentException("Step must be greater than Long.MIN_VALUE to avoid overflow on negation.");
        }
        this.f4132b = j2;
        if (j4 > 0) {
            if (j2 < j3) {
                j3 -= f.a.y.a.B0(f.a.y.a.B0(j3, j4) - f.a.y.a.B0(j2, j4), j4);
            }
        } else {
            if (j4 >= 0) {
                throw new IllegalArgumentException("Step is zero.");
            }
            if (j2 > j3) {
                long j5 = -j4;
                j3 += f.a.y.a.B0(f.a.y.a.B0(j2, j5) - f.a.y.a.B0(j3, j5), j5);
            }
        }
        this.f4133e = j3;
        this.f4134f = j4;
    }

    @Override // java.lang.Iterable
    public Iterator<Long> iterator() {
        return new j(this.f4132b, this.f4133e, this.f4134f);
    }
}
