package kotlin.ranges;

import o1.AbstractC0653A;

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

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public static final a f5117x = new a(null);

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

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private final int f5119g;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    private final int f5120r;

    public static final class a {
        public /* synthetic */ a(kotlin.jvm.internal.g gVar) {
            this();
        }

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

        private a() {
        }
    }

    public g(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.f5118b = i2;
        this.f5119g = t1.c.c(i2, i3, i4);
        this.f5120r = i4;
    }

    public final int a() {
        return this.f5118b;
    }

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

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

    @Override // java.lang.Iterable
    /* JADX INFO: renamed from: d, reason: merged with bridge method [inline-methods] */
    public AbstractC0653A iterator() {
        return new h(this.f5118b, this.f5119g, this.f5120r);
    }

    public boolean equals(Object obj) {
        if (obj instanceof g) {
            if (!isEmpty() || !((g) obj).isEmpty()) {
                g gVar = (g) obj;
                if (this.f5118b != gVar.f5118b || this.f5119g != gVar.f5119g || this.f5120r != gVar.f5120r) {
                }
            }
            return true;
        }
        return false;
    }

    public int hashCode() {
        if (isEmpty()) {
            return -1;
        }
        return (((this.f5118b * 31) + this.f5119g) * 31) + this.f5120r;
    }

    public boolean isEmpty() {
        if (this.f5120r > 0) {
            if (this.f5118b <= this.f5119g) {
                return false;
            }
        } else if (this.f5118b >= this.f5119g) {
            return false;
        }
        return true;
    }

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