package defpackage;

import android.view.animation.Interpolator;
import androidx.recyclerview.widget.RecyclerView;
import java.util.Arrays;

/* JADX INFO: renamed from: ᴵˑ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2197 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public int f8728;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public int f8729;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public boolean f8730 = true;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public int f8731 = 65536;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public int f8732 = 0;

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public Object f8733 = new C1196[100];

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public synchronized void m5752(C1196 c1196) {
        C1196[] c1196Arr = (C1196[]) this.f8733;
        int i = this.f8732;
        this.f8732 = i + 1;
        c1196Arr[i] = c1196;
        this.f8729--;
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public synchronized void m5753(C1889 c1889) {
        while (c1889 != null) {
            C1196[] c1196Arr = (C1196[]) this.f8733;
            int i = this.f8732;
            this.f8732 = i + 1;
            C1196 c1196 = (C1196) c1889.f7486;
            c1196.getClass();
            c1196Arr[i] = c1196;
            this.f8729--;
            c1889 = (C1889) c1889.f7488;
            if (c1889 == null || ((C1196) c1889.f7486) == null) {
                c1889 = null;
            }
        }
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public synchronized void m5754(int i) {
        boolean z = i < this.f8728;
        this.f8728 = i;
        if (z) {
            m5757();
        }
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public synchronized C1196 m5755() {
        C1196 c1196;
        try {
            int i = this.f8729 + 1;
            this.f8729 = i;
            int i2 = this.f8732;
            if (i2 > 0) {
                C1196[] c1196Arr = (C1196[]) this.f8733;
                int i3 = i2 - 1;
                this.f8732 = i3;
                c1196 = c1196Arr[i3];
                c1196.getClass();
                ((C1196[]) this.f8733)[this.f8732] = null;
            } else {
                C1196 c11962 = new C1196(0, new byte[this.f8731]);
                C1196[] c1196Arr2 = (C1196[]) this.f8733;
                if (i > c1196Arr2.length) {
                    this.f8733 = (C1196[]) Arrays.copyOf(c1196Arr2, c1196Arr2.length * 2);
                }
                c1196 = c11962;
            }
        } catch (Throwable th) {
            throw th;
        }
        return c1196;
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public void m5756(RecyclerView recyclerView) {
        int i = this.f8732;
        if (i >= 0) {
            this.f8732 = -1;
            recyclerView.m581(i);
            this.f8730 = false;
        } else if (this.f8730) {
            Interpolator interpolator = (Interpolator) this.f8733;
            if (interpolator != null && this.f8729 < 1) {
                ᵕᵩʽᵲ.ᵪᵹᵥᵻ("If you provide an interpolator, you must set a positive duration");
                return;
            }
            int i2 = this.f8729;
            if (i2 < 1) {
                ᵕᵩʽᵲ.ᵪᵹᵥᵻ("Scroll duration must be a positive number");
            } else {
                recyclerView.f921.m10093(this.f8731, this.f8728, i2, interpolator);
                this.f8730 = false;
            }
        }
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public synchronized void m5757() {
        int iMax = Math.max(0, AbstractC0956.m3265(this.f8728, this.f8731) - this.f8729);
        int i = this.f8732;
        if (iMax >= i) {
            return;
        }
        Arrays.fill((C1196[]) this.f8733, iMax, i, (Object) null);
        this.f8732 = iMax;
    }
}
