package P4;

import e4.C;
import java.util.Iterator;

/* JADX INFO: loaded from: classes3.dex */
public class e implements Iterable, K4.a {

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

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

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

    public e(int i6, int i7, int i8) {
        if (i8 == 0) {
            throw new IllegalArgumentException("Step must be non-zero.");
        }
        if (i8 == Integer.MIN_VALUE) {
            throw new IllegalArgumentException("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");
        }
        this.f5676a = i6;
        this.f5677b = C.L(i6, i7, i8);
        this.f5678c = i8;
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof e)) {
            return false;
        }
        if (isEmpty() && ((e) obj).isEmpty()) {
            return true;
        }
        e eVar = (e) obj;
        return this.f5676a == eVar.f5676a && this.f5677b == eVar.f5677b && this.f5678c == eVar.f5678c;
    }

    public int hashCode() {
        if (isEmpty()) {
            return -1;
        }
        return (((this.f5676a * 31) + this.f5677b) * 31) + this.f5678c;
    }

    public boolean isEmpty() {
        int i6 = this.f5678c;
        int i7 = this.f5677b;
        int i8 = this.f5676a;
        return i6 > 0 ? i8 > i7 : i8 < i7;
    }

    @Override // java.lang.Iterable
    public final Iterator iterator() {
        return new f(this.f5676a, this.f5677b, this.f5678c);
    }

    public String toString() {
        StringBuilder sb;
        int i6 = this.f5677b;
        int i7 = this.f5676a;
        int i8 = this.f5678c;
        if (i8 > 0) {
            sb = new StringBuilder();
            sb.append(i7);
            sb.append("..");
            sb.append(i6);
            sb.append(" step ");
            sb.append(i8);
        } else {
            sb = new StringBuilder();
            sb.append(i7);
            sb.append(" downTo ");
            sb.append(i6);
            sb.append(" step ");
            sb.append(-i8);
        }
        return sb.toString();
    }
}
