package androidx.recyclerview.widget;

import android.view.View;
import q.AbstractC2761L;

/* JADX INFO: renamed from: androidx.recyclerview.widget.s, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1168s {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public T1.f f13168a;

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public boolean f13171d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f13172e;

    public C1168s() {
        d();
    }

    public final void a() {
        this.f13170c = this.f13171d ? this.f13168a.g() : this.f13168a.k();
    }

    public final void b(int i6, View view) {
        if (this.f13171d) {
            int iB = this.f13168a.b(view);
            T1.f fVar = this.f13168a;
            this.f13170c = (Integer.MIN_VALUE == fVar.f6580a ? 0 : fVar.l() - fVar.f6580a) + iB;
        } else {
            this.f13170c = this.f13168a.e(view);
        }
        this.f13169b = i6;
    }

    public final void c(int i6, View view) {
        T1.f fVar = this.f13168a;
        int iL = Integer.MIN_VALUE == fVar.f6580a ? 0 : fVar.l() - fVar.f6580a;
        if (iL >= 0) {
            b(i6, view);
            return;
        }
        this.f13169b = i6;
        if (!this.f13171d) {
            int iE = this.f13168a.e(view);
            int iK = iE - this.f13168a.k();
            this.f13170c = iE;
            if (iK > 0) {
                int iG = (this.f13168a.g() - Math.min(0, (this.f13168a.g() - iL) - this.f13168a.b(view))) - (this.f13168a.c(view) + iE);
                if (iG < 0) {
                    this.f13170c -= Math.min(iK, -iG);
                    return;
                }
                return;
            }
            return;
        }
        int iG2 = (this.f13168a.g() - iL) - this.f13168a.b(view);
        this.f13170c = this.f13168a.g() - iG2;
        if (iG2 > 0) {
            int iC = this.f13170c - this.f13168a.c(view);
            int iK2 = this.f13168a.k();
            int iMin = iC - (Math.min(this.f13168a.e(view) - iK2, 0) + iK2);
            if (iMin < 0) {
                this.f13170c = Math.min(iG2, -iMin) + this.f13170c;
            }
        }
    }

    public final void d() {
        this.f13169b = -1;
        this.f13170c = Integer.MIN_VALUE;
        this.f13171d = false;
        this.f13172e = false;
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder("AnchorInfo{mPosition=");
        sb.append(this.f13169b);
        sb.append(", mCoordinate=");
        sb.append(this.f13170c);
        sb.append(", mLayoutFromEnd=");
        sb.append(this.f13171d);
        sb.append(", mValid=");
        return AbstractC2761L.h(sb, this.f13172e, '}');
    }
}
