package B0;

import x0.AbstractC1709a;

/* JADX INFO: loaded from: classes.dex */
public final class r0 {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final r0 f886c;

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

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

    static {
        r0 r0Var = new r0(0L, 0L);
        new r0(Long.MAX_VALUE, Long.MAX_VALUE);
        new r0(Long.MAX_VALUE, 0L);
        new r0(0L, Long.MAX_VALUE);
        f886c = r0Var;
    }

    public r0(long j8, long j9) {
        AbstractC1709a.d(j8 >= 0);
        AbstractC1709a.d(j9 >= 0);
        this.f887a = j8;
        this.f888b = j9;
    }

    /* JADX WARN: Removed duplicated region for block: B:32:0x005c A[RETURN] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final long a(long j8, long j9, long j10) {
        long j11 = this.f887a;
        long j12 = this.f888b;
        if (j11 == 0 && j12 == 0) {
            return j8;
        }
        int i = x0.v.f18553a;
        long j13 = j8 - j11;
        if (((j11 ^ j8) & (j8 ^ j13)) < 0) {
            j13 = Long.MIN_VALUE;
        }
        long j14 = j8 + j12;
        if (((j12 ^ j14) & (j8 ^ j14)) < 0) {
            j14 = Long.MAX_VALUE;
        }
        boolean z8 = false;
        boolean z9 = j13 <= j9 && j9 <= j14;
        if (j13 <= j10 && j10 <= j14) {
            z8 = true;
        }
        if (!z9 || !z8) {
            if (!z9) {
                return z8 ? j10 : j13;
            }
            return j9;
        }
        if (Math.abs(j9 - j8) <= Math.abs(j10 - j8)) {
            return j9;
        }
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && r0.class == obj.getClass()) {
            r0 r0Var = (r0) obj;
            if (this.f887a == r0Var.f887a && this.f888b == r0Var.f888b) {
                return true;
            }
        }
        return false;
    }

    public final int hashCode() {
        return (((int) this.f887a) * 31) + ((int) this.f888b);
    }
}
