package FSaI4_7.FSaI4_7;
/* compiled from: progressionUtil.kt */
/* loaded from: classes.dex */
public final class KQgRr5e_0 {
    public static final int KQgRr5e_0(int i, int i2) {
        int i3 = i % i2;
        return i3 >= 0 ? i3 : i3 + i2;
    }

    public static final int QxJ9d_1(int i, int i2, int i3) {
        if (i3 > 0) {
            return i >= i2 ? i2 : i2 - KQgRr5e_0(i2, i, i3);
        } else if (i3 < 0) {
            return i <= i2 ? i2 : i2 + KQgRr5e_0(i, i2, -i3);
        } else {
            throw new IllegalArgumentException("Step is zero.");
        }
    }

    public static final int KQgRr5e_0(int i, int i2, int i3) {
        return KQgRr5e_0(KQgRr5e_0(i, i3) - KQgRr5e_0(i2, i3), i3);
    }
}
