package androidx.recyclerview.widget;

import A1.h;
import android.content.Context;
import android.graphics.PointF;
import android.graphics.Rect;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import androidx.datastore.preferences.protobuf.C0247k;
import b0.g;
import p0.AbstractC0928a;
import u0.AbstractC1035G;
import u0.C1034F;
import u0.C1036H;
import u0.C1055q;
import u0.C1056s;
import u0.C1057t;
import u0.C1058u;
import u0.M;
import u0.Q;
import u0.S;
import u0.r;

/* JADX INFO: loaded from: classes.dex */
public class LinearLayoutManager extends AbstractC1035G implements Q {

    /* JADX INFO: renamed from: A, reason: collision with root package name */
    public final C1055q f4521A;

    /* JADX INFO: renamed from: B, reason: collision with root package name */
    public final r f4522B;

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

    /* JADX INFO: renamed from: D, reason: collision with root package name */
    public final int[] f4524D;
    public int p;
    public C1056s q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public g f4525r;

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

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final boolean f4527t;

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

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

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public final boolean f4530w;

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

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

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public C1057t f4533z;

    public LinearLayoutManager(int i) {
        this.p = 1;
        this.f4527t = false;
        this.f4528u = false;
        this.f4529v = false;
        this.f4530w = true;
        this.f4531x = -1;
        this.f4532y = Integer.MIN_VALUE;
        this.f4533z = null;
        this.f4521A = new C1055q();
        this.f4522B = new r();
        this.f4523C = 2;
        this.f4524D = new int[2];
        V0(i);
        c(null);
        if (this.f4527t) {
            this.f4527t = false;
            h0();
        }
    }

    public final int A0(S s5) {
        if (v() == 0) {
            return 0;
        }
        C0();
        g gVar = this.f4525r;
        boolean z5 = !this.f4530w;
        return h.h(s5, gVar, F0(z5), E0(z5), this, this.f4530w);
    }

    public final int B0(int i) {
        return i != 1 ? i != 2 ? i != 17 ? i != 33 ? i != 66 ? (i == 130 && this.p == 1) ? 1 : Integer.MIN_VALUE : this.p == 0 ? 1 : Integer.MIN_VALUE : this.p == 1 ? -1 : Integer.MIN_VALUE : this.p == 0 ? -1 : Integer.MIN_VALUE : (this.p != 1 && O0()) ? -1 : 1 : (this.p != 1 && O0()) ? 1 : -1;
    }

    public final void C0() {
        if (this.q == null) {
            C1056s c1056s = new C1056s();
            c1056s.f10275a = true;
            c1056s.f10282h = 0;
            c1056s.i = 0;
            c1056s.f10284k = null;
            this.q = c1056s;
        }
    }

    public final int D0(M m5, C1056s c1056s, S s5, boolean z5) {
        int i;
        int i5 = c1056s.f10277c;
        int i6 = c1056s.f10281g;
        if (i6 != Integer.MIN_VALUE) {
            if (i5 < 0) {
                c1056s.f10281g = i6 + i5;
            }
            R0(m5, c1056s);
        }
        int i7 = c1056s.f10277c + c1056s.f10282h;
        while (true) {
            if ((!c1056s.f10285l && i7 <= 0) || (i = c1056s.f10278d) < 0 || i >= s5.b()) {
                break;
            }
            r rVar = this.f4522B;
            rVar.f10271a = 0;
            rVar.f10272b = false;
            rVar.f10273c = false;
            rVar.f10274d = false;
            P0(m5, s5, c1056s, rVar);
            if (!rVar.f10272b) {
                int i8 = c1056s.f10276b;
                int i9 = rVar.f10271a;
                c1056s.f10276b = (c1056s.f10280f * i9) + i8;
                if (!rVar.f10273c || c1056s.f10284k != null || !s5.f10105g) {
                    c1056s.f10277c -= i9;
                    i7 -= i9;
                }
                int i10 = c1056s.f10281g;
                if (i10 != Integer.MIN_VALUE) {
                    int i11 = i10 + i9;
                    c1056s.f10281g = i11;
                    int i12 = c1056s.f10277c;
                    if (i12 < 0) {
                        c1056s.f10281g = i11 + i12;
                    }
                    R0(m5, c1056s);
                }
                if (z5 && rVar.f10274d) {
                    break;
                }
            } else {
                break;
            }
        }
        return i5 - c1056s.f10277c;
    }

    public final View E0(boolean z5) {
        return this.f4528u ? I0(0, z5, v()) : I0(v() - 1, z5, -1);
    }

    public final View F0(boolean z5) {
        return this.f4528u ? I0(v() - 1, z5, -1) : I0(0, z5, v());
    }

    public final int G0() {
        View viewI0 = I0(v() - 1, false, -1);
        if (viewI0 == null) {
            return -1;
        }
        return AbstractC1035G.E(viewI0);
    }

    public final View H0(int i, int i5) {
        int i6;
        int i7;
        C0();
        if (i5 <= i && i5 >= i) {
            return u(i);
        }
        if (this.f4525r.e(u(i)) < this.f4525r.k()) {
            i6 = 16644;
            i7 = 16388;
        } else {
            i6 = 4161;
            i7 = 4097;
        }
        return this.p == 0 ? this.f10061c.a(i, i5, i6, i7) : this.f10062d.a(i, i5, i6, i7);
    }

    @Override // u0.AbstractC1035G
    public final boolean I() {
        return true;
    }

    public final View I0(int i, boolean z5, int i5) {
        C0();
        int i6 = z5 ? 24579 : 320;
        return this.p == 0 ? this.f10061c.a(i, i5, i6, 320) : this.f10062d.a(i, i5, i6, 320);
    }

    public View J0(M m5, S s5, int i, int i5, int i6) {
        C0();
        int iK = this.f4525r.k();
        int iG = this.f4525r.g();
        int i7 = i5 > i ? 1 : -1;
        View view = null;
        View view2 = null;
        while (i != i5) {
            View viewU = u(i);
            int iE = AbstractC1035G.E(viewU);
            if (iE >= 0 && iE < i6) {
                if (((C1036H) viewU.getLayoutParams()).f10073a.h()) {
                    if (view2 == null) {
                        view2 = viewU;
                    }
                } else {
                    if (this.f4525r.e(viewU) < iG && this.f4525r.b(viewU) >= iK) {
                        return viewU;
                    }
                    if (view == null) {
                        view = viewU;
                    }
                }
            }
            i += i7;
        }
        return view != null ? view : view2;
    }

    public final int K0(int i, M m5, S s5, boolean z5) {
        int iG;
        int iG2 = this.f4525r.g() - i;
        if (iG2 <= 0) {
            return 0;
        }
        int i5 = -U0(-iG2, m5, s5);
        int i6 = i + i5;
        if (!z5 || (iG = this.f4525r.g() - i6) <= 0) {
            return i5;
        }
        this.f4525r.o(iG);
        return iG + i5;
    }

    public final int L0(int i, M m5, S s5, boolean z5) {
        int iK;
        int iK2 = i - this.f4525r.k();
        if (iK2 <= 0) {
            return 0;
        }
        int i5 = -U0(iK2, m5, s5);
        int i6 = i + i5;
        if (!z5 || (iK = i6 - this.f4525r.k()) <= 0) {
            return i5;
        }
        this.f4525r.o(-iK);
        return i5 - iK;
    }

    public final View M0() {
        return u(this.f4528u ? 0 : v() - 1);
    }

    public final View N0() {
        return u(this.f4528u ? v() - 1 : 0);
    }

    @Override // u0.AbstractC1035G
    public View O(View view, int i, M m5, S s5) {
        int iB0;
        T0();
        if (v() != 0 && (iB0 = B0(i)) != Integer.MIN_VALUE) {
            C0();
            X0(iB0, (int) (this.f4525r.l() * 0.33333334f), false, s5);
            C1056s c1056s = this.q;
            c1056s.f10281g = Integer.MIN_VALUE;
            c1056s.f10275a = false;
            D0(m5, c1056s, s5, true);
            View viewH0 = iB0 == -1 ? this.f4528u ? H0(v() - 1, -1) : H0(0, v()) : this.f4528u ? H0(0, v()) : H0(v() - 1, -1);
            View viewN0 = iB0 == -1 ? N0() : M0();
            if (!viewN0.hasFocusable()) {
                return viewH0;
            }
            if (viewH0 != null) {
                return viewN0;
            }
        }
        return null;
    }

    public final boolean O0() {
        return z() == 1;
    }

    @Override // u0.AbstractC1035G
    public final void P(AccessibilityEvent accessibilityEvent) {
        super.P(accessibilityEvent);
        if (v() > 0) {
            View viewI0 = I0(0, false, v());
            accessibilityEvent.setFromIndex(viewI0 == null ? -1 : AbstractC1035G.E(viewI0));
            accessibilityEvent.setToIndex(G0());
        }
    }

    public void P0(M m5, S s5, C1056s c1056s, r rVar) {
        int iB;
        int i;
        int i5;
        int iD;
        View viewB = c1056s.b(m5);
        if (viewB == null) {
            rVar.f10272b = true;
            return;
        }
        C1036H c1036h = (C1036H) viewB.getLayoutParams();
        if (c1056s.f10284k == null) {
            if (this.f4528u == (c1056s.f10280f == -1)) {
                b(-1, viewB, false);
            } else {
                b(0, viewB, false);
            }
        } else {
            if (this.f4528u == (c1056s.f10280f == -1)) {
                b(-1, viewB, true);
            } else {
                b(0, viewB, true);
            }
        }
        C1036H c1036h2 = (C1036H) viewB.getLayoutParams();
        Rect rectI = this.f10060b.I(viewB);
        int i6 = rectI.left + rectI.right;
        int i7 = rectI.top + rectI.bottom;
        int iW = AbstractC1035G.w(d(), this.f10071n, this.f10069l, C() + B() + ((ViewGroup.MarginLayoutParams) c1036h2).leftMargin + ((ViewGroup.MarginLayoutParams) c1036h2).rightMargin + i6, ((ViewGroup.MarginLayoutParams) c1036h2).width);
        int iW2 = AbstractC1035G.w(e(), this.f10072o, this.f10070m, A() + D() + ((ViewGroup.MarginLayoutParams) c1036h2).topMargin + ((ViewGroup.MarginLayoutParams) c1036h2).bottomMargin + i7, ((ViewGroup.MarginLayoutParams) c1036h2).height);
        if (q0(viewB, iW, iW2, c1036h2)) {
            viewB.measure(iW, iW2);
        }
        rVar.f10271a = this.f4525r.c(viewB);
        if (this.p == 1) {
            if (O0()) {
                iD = this.f10071n - C();
                iB = iD - this.f4525r.d(viewB);
            } else {
                iB = B();
                iD = this.f4525r.d(viewB) + iB;
            }
            if (c1056s.f10280f == -1) {
                i = c1056s.f10276b;
                i5 = i - rVar.f10271a;
            } else {
                i5 = c1056s.f10276b;
                i = rVar.f10271a + i5;
            }
        } else {
            int iD2 = D();
            int iD3 = this.f4525r.d(viewB) + iD2;
            if (c1056s.f10280f == -1) {
                int i8 = c1056s.f10276b;
                int i9 = i8 - rVar.f10271a;
                iD = i8;
                i = iD3;
                iB = i9;
                i5 = iD2;
            } else {
                int i10 = c1056s.f10276b;
                int i11 = rVar.f10271a + i10;
                iB = i10;
                i = iD3;
                i5 = iD2;
                iD = i11;
            }
        }
        AbstractC1035G.K(viewB, iB, i5, iD, i);
        if (c1036h.f10073a.h() || c1036h.f10073a.k()) {
            rVar.f10273c = true;
        }
        rVar.f10274d = viewB.hasFocusable();
    }

    public final void R0(M m5, C1056s c1056s) {
        if (!c1056s.f10275a || c1056s.f10285l) {
            return;
        }
        int i = c1056s.f10281g;
        int i5 = c1056s.i;
        if (c1056s.f10280f == -1) {
            int iV = v();
            if (i < 0) {
                return;
            }
            int iF = (this.f4525r.f() - i) + i5;
            if (this.f4528u) {
                for (int i6 = 0; i6 < iV; i6++) {
                    View viewU = u(i6);
                    if (this.f4525r.e(viewU) < iF || this.f4525r.n(viewU) < iF) {
                        S0(m5, 0, i6);
                        return;
                    }
                }
                return;
            }
            int i7 = iV - 1;
            for (int i8 = i7; i8 >= 0; i8--) {
                View viewU2 = u(i8);
                if (this.f4525r.e(viewU2) < iF || this.f4525r.n(viewU2) < iF) {
                    S0(m5, i7, i8);
                    return;
                }
            }
            return;
        }
        if (i < 0) {
            return;
        }
        int i9 = i - i5;
        int iV2 = v();
        if (!this.f4528u) {
            for (int i10 = 0; i10 < iV2; i10++) {
                View viewU3 = u(i10);
                if (this.f4525r.b(viewU3) > i9 || this.f4525r.m(viewU3) > i9) {
                    S0(m5, 0, i10);
                    return;
                }
            }
            return;
        }
        int i11 = iV2 - 1;
        for (int i12 = i11; i12 >= 0; i12--) {
            View viewU4 = u(i12);
            if (this.f4525r.b(viewU4) > i9 || this.f4525r.m(viewU4) > i9) {
                S0(m5, i11, i12);
                return;
            }
        }
    }

    public final void S0(M m5, int i, int i5) {
        if (i == i5) {
            return;
        }
        if (i5 <= i) {
            while (i > i5) {
                View viewU = u(i);
                f0(i);
                m5.f(viewU);
                i--;
            }
            return;
        }
        for (int i6 = i5 - 1; i6 >= i; i6--) {
            View viewU2 = u(i6);
            f0(i6);
            m5.f(viewU2);
        }
    }

    public final void T0() {
        if (this.p == 1 || !O0()) {
            this.f4528u = this.f4527t;
        } else {
            this.f4528u = !this.f4527t;
        }
    }

    public final int U0(int i, M m5, S s5) {
        if (v() != 0 && i != 0) {
            C0();
            this.q.f10275a = true;
            int i5 = i > 0 ? 1 : -1;
            int iAbs = Math.abs(i);
            X0(i5, iAbs, true, s5);
            C1056s c1056s = this.q;
            int iD0 = D0(m5, c1056s, s5, false) + c1056s.f10281g;
            if (iD0 >= 0) {
                if (iAbs > iD0) {
                    i = i5 * iD0;
                }
                this.f4525r.o(-i);
                this.q.f10283j = i;
                return i;
            }
        }
        return 0;
    }

    public final void V0(int i) {
        if (i != 0 && i != 1) {
            throw new IllegalArgumentException(AbstractC0928a.i(i, "invalid orientation:"));
        }
        c(null);
        if (i != this.p || this.f4525r == null) {
            g gVarA = g.a(this, i);
            this.f4525r = gVarA;
            this.f4521A.f10266a = gVarA;
            this.p = i;
            h0();
        }
    }

    public void W0(boolean z5) {
        c(null);
        if (this.f4529v == z5) {
            return;
        }
        this.f4529v = z5;
        h0();
    }

    /* JADX WARN: Removed duplicated region for block: B:130:0x0243  */
    /* JADX WARN: Removed duplicated region for block: B:97:0x0192  */
    /* JADX WARN: Removed duplicated region for block: B:98:0x0196  */
    @Override // u0.AbstractC1035G
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    public void X(u0.M r18, u0.S r19) {
        /*
            Method dump skipped, instruction units count: 1173
            To view this dump change 'Code comments level' option to 'DEBUG'
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.LinearLayoutManager.X(u0.M, u0.S):void");
    }

    public final void X0(int i, int i5, boolean z5, S s5) {
        int iK;
        this.q.f10285l = this.f4525r.i() == 0 && this.f4525r.f() == 0;
        this.q.f10280f = i;
        int[] iArr = this.f4524D;
        iArr[0] = 0;
        iArr[1] = 0;
        w0(s5, iArr);
        int iMax = Math.max(0, iArr[0]);
        int iMax2 = Math.max(0, iArr[1]);
        boolean z6 = i == 1;
        C1056s c1056s = this.q;
        int i6 = z6 ? iMax2 : iMax;
        c1056s.f10282h = i6;
        if (!z6) {
            iMax = iMax2;
        }
        c1056s.i = iMax;
        if (z6) {
            c1056s.f10282h = this.f4525r.h() + i6;
            View viewM0 = M0();
            C1056s c1056s2 = this.q;
            c1056s2.f10279e = this.f4528u ? -1 : 1;
            int iE = AbstractC1035G.E(viewM0);
            C1056s c1056s3 = this.q;
            c1056s2.f10278d = iE + c1056s3.f10279e;
            c1056s3.f10276b = this.f4525r.b(viewM0);
            iK = this.f4525r.b(viewM0) - this.f4525r.g();
        } else {
            View viewN0 = N0();
            C1056s c1056s4 = this.q;
            c1056s4.f10282h = this.f4525r.k() + c1056s4.f10282h;
            C1056s c1056s5 = this.q;
            c1056s5.f10279e = this.f4528u ? 1 : -1;
            int iE2 = AbstractC1035G.E(viewN0);
            C1056s c1056s6 = this.q;
            c1056s5.f10278d = iE2 + c1056s6.f10279e;
            c1056s6.f10276b = this.f4525r.e(viewN0);
            iK = (-this.f4525r.e(viewN0)) + this.f4525r.k();
        }
        C1056s c1056s7 = this.q;
        c1056s7.f10277c = i5;
        if (z5) {
            c1056s7.f10277c = i5 - iK;
        }
        c1056s7.f10281g = iK;
    }

    @Override // u0.AbstractC1035G
    public void Y(S s5) {
        this.f4533z = null;
        this.f4531x = -1;
        this.f4532y = Integer.MIN_VALUE;
        this.f4521A.d();
    }

    public final void Y0(int i, int i5) {
        this.q.f10277c = this.f4525r.g() - i5;
        C1056s c1056s = this.q;
        c1056s.f10279e = this.f4528u ? -1 : 1;
        c1056s.f10278d = i;
        c1056s.f10280f = 1;
        c1056s.f10276b = i5;
        c1056s.f10281g = Integer.MIN_VALUE;
    }

    @Override // u0.AbstractC1035G
    public final void Z(Parcelable parcelable) {
        if (parcelable instanceof C1057t) {
            this.f4533z = (C1057t) parcelable;
            h0();
        }
    }

    public final void Z0(int i, int i5) {
        this.q.f10277c = i5 - this.f4525r.k();
        C1056s c1056s = this.q;
        c1056s.f10278d = i;
        c1056s.f10279e = this.f4528u ? 1 : -1;
        c1056s.f10280f = -1;
        c1056s.f10276b = i5;
        c1056s.f10281g = Integer.MIN_VALUE;
    }

    @Override // u0.Q
    public final PointF a(int i) {
        if (v() == 0) {
            return null;
        }
        int i5 = (i < AbstractC1035G.E(u(0))) != this.f4528u ? -1 : 1;
        return this.p == 0 ? new PointF(i5, 0.0f) : new PointF(0.0f, i5);
    }

    @Override // u0.AbstractC1035G
    public final Parcelable a0() {
        C1057t c1057t = this.f4533z;
        if (c1057t != null) {
            C1057t c1057t2 = new C1057t();
            c1057t2.f10286k = c1057t.f10286k;
            c1057t2.f10287l = c1057t.f10287l;
            c1057t2.f10288m = c1057t.f10288m;
            return c1057t2;
        }
        C1057t c1057t3 = new C1057t();
        if (v() <= 0) {
            c1057t3.f10286k = -1;
            return c1057t3;
        }
        C0();
        boolean z5 = this.f4526s ^ this.f4528u;
        c1057t3.f10288m = z5;
        if (z5) {
            View viewM0 = M0();
            c1057t3.f10287l = this.f4525r.g() - this.f4525r.b(viewM0);
            c1057t3.f10286k = AbstractC1035G.E(viewM0);
            return c1057t3;
        }
        View viewN0 = N0();
        c1057t3.f10286k = AbstractC1035G.E(viewN0);
        c1057t3.f10287l = this.f4525r.e(viewN0) - this.f4525r.k();
        return c1057t3;
    }

    @Override // u0.AbstractC1035G
    public final void c(String str) {
        if (this.f4533z == null) {
            super.c(str);
        }
    }

    @Override // u0.AbstractC1035G
    public final boolean d() {
        return this.p == 0;
    }

    @Override // u0.AbstractC1035G
    public final boolean e() {
        return this.p == 1;
    }

    @Override // u0.AbstractC1035G
    public final void h(int i, int i5, S s5, C0247k c0247k) {
        if (this.p != 0) {
            i = i5;
        }
        if (v() == 0 || i == 0) {
            return;
        }
        C0();
        X0(i > 0 ? 1 : -1, Math.abs(i), true, s5);
        x0(s5, this.q, c0247k);
    }

    @Override // u0.AbstractC1035G
    public final void i(int i, C0247k c0247k) {
        boolean z5;
        int i5;
        C1057t c1057t = this.f4533z;
        if (c1057t == null || (i5 = c1057t.f10286k) < 0) {
            T0();
            z5 = this.f4528u;
            i5 = this.f4531x;
            if (i5 == -1) {
                i5 = z5 ? i - 1 : 0;
            }
        } else {
            z5 = c1057t.f10288m;
        }
        int i6 = z5 ? -1 : 1;
        for (int i7 = 0; i7 < this.f4523C && i5 >= 0 && i5 < i; i7++) {
            c0247k.a(i5, 0);
            i5 += i6;
        }
    }

    @Override // u0.AbstractC1035G
    public int i0(int i, M m5, S s5) {
        if (this.p == 1) {
            return 0;
        }
        return U0(i, m5, s5);
    }

    @Override // u0.AbstractC1035G
    public final int j(S s5) {
        return y0(s5);
    }

    @Override // u0.AbstractC1035G
    public final void j0(int i) {
        this.f4531x = i;
        this.f4532y = Integer.MIN_VALUE;
        C1057t c1057t = this.f4533z;
        if (c1057t != null) {
            c1057t.f10286k = -1;
        }
        h0();
    }

    @Override // u0.AbstractC1035G
    public int k(S s5) {
        return z0(s5);
    }

    @Override // u0.AbstractC1035G
    public int k0(int i, M m5, S s5) {
        if (this.p == 0) {
            return 0;
        }
        return U0(i, m5, s5);
    }

    @Override // u0.AbstractC1035G
    public int l(S s5) {
        return A0(s5);
    }

    @Override // u0.AbstractC1035G
    public final int m(S s5) {
        return y0(s5);
    }

    @Override // u0.AbstractC1035G
    public int n(S s5) {
        return z0(s5);
    }

    @Override // u0.AbstractC1035G
    public int o(S s5) {
        return A0(s5);
    }

    @Override // u0.AbstractC1035G
    public final View q(int i) {
        int iV = v();
        if (iV == 0) {
            return null;
        }
        int iE = i - AbstractC1035G.E(u(0));
        if (iE >= 0 && iE < iV) {
            View viewU = u(iE);
            if (AbstractC1035G.E(viewU) == i) {
                return viewU;
            }
        }
        return super.q(i);
    }

    @Override // u0.AbstractC1035G
    public C1036H r() {
        return new C1036H(-2, -2);
    }

    @Override // u0.AbstractC1035G
    public final boolean r0() {
        if (this.f10070m != 1073741824 && this.f10069l != 1073741824) {
            int iV = v();
            for (int i = 0; i < iV; i++) {
                ViewGroup.LayoutParams layoutParams = u(i).getLayoutParams();
                if (layoutParams.width < 0 && layoutParams.height < 0) {
                    return true;
                }
            }
        }
        return false;
    }

    @Override // u0.AbstractC1035G
    public void t0(RecyclerView recyclerView, int i) {
        C1058u c1058u = new C1058u(recyclerView.getContext());
        c1058u.f10289a = i;
        u0(c1058u);
    }

    @Override // u0.AbstractC1035G
    public boolean v0() {
        return this.f4533z == null && this.f4526s == this.f4529v;
    }

    public void w0(S s5, int[] iArr) {
        int i;
        int iL = s5.f10099a != -1 ? this.f4525r.l() : 0;
        if (this.q.f10280f == -1) {
            i = 0;
        } else {
            i = iL;
            iL = 0;
        }
        iArr[0] = iL;
        iArr[1] = i;
    }

    public void x0(S s5, C1056s c1056s, C0247k c0247k) {
        int i = c1056s.f10278d;
        if (i < 0 || i >= s5.b()) {
            return;
        }
        c0247k.a(i, Math.max(0, c1056s.f10281g));
    }

    public final int y0(S s5) {
        if (v() == 0) {
            return 0;
        }
        C0();
        g gVar = this.f4525r;
        boolean z5 = !this.f4530w;
        return h.f(s5, gVar, F0(z5), E0(z5), this, this.f4530w);
    }

    public final int z0(S s5) {
        if (v() == 0) {
            return 0;
        }
        C0();
        g gVar = this.f4525r;
        boolean z5 = !this.f4530w;
        return h.g(s5, gVar, F0(z5), E0(z5), this, this.f4530w, this.f4528u);
    }

    public LinearLayoutManager(Context context, AttributeSet attributeSet, int i, int i5) {
        this.p = 1;
        this.f4527t = false;
        this.f4528u = false;
        this.f4529v = false;
        this.f4530w = true;
        this.f4531x = -1;
        this.f4532y = Integer.MIN_VALUE;
        this.f4533z = null;
        this.f4521A = new C1055q();
        this.f4522B = new r();
        this.f4523C = 2;
        this.f4524D = new int[2];
        C1034F c1034fF = AbstractC1035G.F(context, attributeSet, i, i5);
        V0(c1034fF.f10055a);
        boolean z5 = c1034fF.f10057c;
        c(null);
        if (z5 != this.f4527t) {
            this.f4527t = z5;
            h0();
        }
        W0(c1034fF.f10058d);
    }

    @Override // u0.AbstractC1035G
    public final void N(RecyclerView recyclerView) {
    }

    public void Q0(M m5, S s5, C1055q c1055q, int i) {
    }
}
