package d.f;

import java.util.Iterator;

/* JADX INFO: loaded from: classes.dex */
public class a implements Iterable<Integer> {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final int f1651a;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f1653c;

    public a(int i, int i2, int i3) {
        if (i3 == 0) {
            throw new IllegalArgumentException("Step must be non-zero.");
        }
        if (i3 == Integer.MIN_VALUE) {
            throw new IllegalArgumentException("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");
        }
        this.f1651a = i;
        if (i3 > 0) {
            if (i < i2) {
                i2 -= b.f.b.b.y(b.f.b.b.y(i2, i3) - b.f.b.b.y(i, i3), i3);
            }
        } else {
            if (i3 >= 0) {
                throw new IllegalArgumentException("Step is zero.");
            }
            if (i > i2) {
                int i4 = -i3;
                i2 += b.f.b.b.y(b.f.b.b.y(i, i4) - b.f.b.b.y(i2, i4), i4);
            }
        }
        this.f1652b = i2;
        this.f1653c = i3;
    }

    public boolean equals(Object obj) {
        if (obj instanceof a) {
            if (!isEmpty() || !((a) obj).isEmpty()) {
                a aVar = (a) obj;
                if (this.f1651a != aVar.f1651a || this.f1652b != aVar.f1652b || this.f1653c != aVar.f1653c) {
                }
            }
            return true;
        }
        return false;
    }

    public int hashCode() {
        if (isEmpty()) {
            return -1;
        }
        return this.f1653c + (((this.f1651a * 31) + this.f1652b) * 31);
    }

    public boolean isEmpty() {
        if (this.f1653c > 0) {
            if (this.f1651a > this.f1652b) {
                return true;
            }
        } else if (this.f1651a < this.f1652b) {
            return true;
        }
        return false;
    }

    @Override // java.lang.Iterable
    public Iterator<Integer> iterator() {
        return new b(this.f1651a, this.f1652b, this.f1653c);
    }

    public String toString() {
        StringBuilder sb;
        int i;
        if (this.f1653c > 0) {
            sb = new StringBuilder();
            sb.append(this.f1651a);
            sb.append("..");
            sb.append(this.f1652b);
            sb.append(" step ");
            i = this.f1653c;
        } else {
            sb = new StringBuilder();
            sb.append(this.f1651a);
            sb.append(" downTo ");
            sb.append(this.f1652b);
            sb.append(" step ");
            i = -this.f1653c;
        }
        sb.append(i);
        return sb.toString();
    }
}
