package j.r0;

import j.k0.e0;

/* JADX INFO: compiled from: Progressions.kt */
/* JADX INFO: loaded from: classes.dex */
public class f implements Iterable<Integer>, j.p0.d.i0.a {
    public static final a f = new a(null);
    private final int b;
    private final int d;
    private final int e;

    /* JADX INFO: compiled from: Progressions.kt */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(j.p0.d.j jVar) {
            this();
        }

        public final f a(int i2, int i3, int i4) {
            return new f(i2, i3, i4);
        }
    }

    public f(int i2, int i3, int i4) {
        if (i4 == 0) {
            throw new IllegalArgumentException("Step must be non-zero.");
        }
        if (i4 == Integer.MIN_VALUE) {
            throw new IllegalArgumentException("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");
        }
        this.b = i2;
        this.d = j.n0.c.c(i2, i3, i4);
        this.e = i4;
    }

    public final int b() {
        return this.b;
    }

    public final int c() {
        return this.d;
    }

    public final int d() {
        return this.e;
    }

    @Override // java.lang.Iterable
    /* JADX INFO: renamed from: e, reason: merged with bridge method [inline-methods] */
    public e0 iterator() {
        return new g(this.b, this.d, this.e);
    }

    public boolean equals(Object obj) {
        if (obj instanceof f) {
            if (!isEmpty() || !((f) obj).isEmpty()) {
                f fVar = (f) obj;
                if (this.b != fVar.b || this.d != fVar.d || this.e != fVar.e) {
                }
            }
            return true;
        }
        return false;
    }

    public int hashCode() {
        if (isEmpty()) {
            return -1;
        }
        return (((this.b * 31) + this.d) * 31) + this.e;
    }

    public boolean isEmpty() {
        if (this.e > 0) {
            if (this.b > this.d) {
                return true;
            }
        } else if (this.b < this.d) {
            return true;
        }
        return false;
    }

    public String toString() {
        StringBuilder sb;
        int i2;
        if (this.e > 0) {
            sb = new StringBuilder();
            sb.append(this.b);
            sb.append("..");
            sb.append(this.d);
            sb.append(" step ");
            i2 = this.e;
        } else {
            sb = new StringBuilder();
            sb.append(this.b);
            sb.append(" downTo ");
            sb.append(this.d);
            sb.append(" step ");
            i2 = -this.e;
        }
        sb.append(i2);
        return sb.toString();
    }
}
