package xd;

import java.util.Iterator;

/* JADX INFO: loaded from: classes.dex */
public class a implements Iterable, td.a {

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

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

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

    public a(int i10, int i11, int i12) {
        if (i12 == 0) {
            throw new IllegalArgumentException("Step must be non-zero.");
        }
        if (i12 == Integer.MIN_VALUE) {
            throw new IllegalArgumentException("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");
        }
        this.f34807a = i10;
        this.f34808b = hb.a.d0(i10, i11, i12);
        this.f34809c = i12;
    }

    public boolean equals(Object obj) {
        if (obj instanceof a) {
            if (!isEmpty() || !((a) obj).isEmpty()) {
                a aVar = (a) obj;
                if (this.f34807a != aVar.f34807a || this.f34808b != aVar.f34808b || this.f34809c != aVar.f34809c) {
                }
            }
            return true;
        }
        return false;
    }

    public int hashCode() {
        if (isEmpty()) {
            return -1;
        }
        return (((this.f34807a * 31) + this.f34808b) * 31) + this.f34809c;
    }

    public boolean isEmpty() {
        int i10 = this.f34809c;
        int i11 = this.f34808b;
        int i12 = this.f34807a;
        if (i10 > 0) {
            if (i12 <= i11) {
                return false;
            }
        } else if (i12 >= i11) {
            return false;
        }
        return true;
    }

    @Override // java.lang.Iterable
    public final Iterator iterator() {
        return new b(this.f34807a, this.f34808b, this.f34809c);
    }

    public String toString() {
        StringBuilder sb;
        int i10 = this.f34808b;
        int i11 = this.f34807a;
        int i12 = this.f34809c;
        if (i12 > 0) {
            sb = new StringBuilder();
            sb.append(i11);
            sb.append("..");
            sb.append(i10);
            sb.append(" step ");
            sb.append(i12);
        } else {
            sb = new StringBuilder();
            sb.append(i11);
            sb.append(" downTo ");
            sb.append(i10);
            sb.append(" step ");
            sb.append(-i12);
        }
        return sb.toString();
    }
}
