package defpackage;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Looper;
import android.util.AttributeSet;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.PriorityQueue;
import java.util.WeakHashMap;

/* JADX INFO: renamed from: ᵭˈ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C4132 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final Object f15792;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final Object f15793;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public Object f15794;

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

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public Object f15796;

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public Object f15797;

    public C4132(View view) {
        this.f15795 = -1;
        this.f15792 = view;
        this.f15793 = C0359.m1680();
    }

    public C4132(Object obj, Looper looper, Looper looper2, C2353 c2353, C0103 c0103) {
        this.f15792 = c2353.m6030(looper, null);
        this.f15793 = c2353.m6030(looper2, null);
        this.f15794 = obj;
        this.f15797 = obj;
        this.f15796 = c0103;
    }

    public C4132(InterfaceC1406 interfaceC1406) {
        this.f15792 = interfaceC1406;
        this.f15793 = new ArrayDeque();
        this.f15796 = new ArrayDeque();
        this.f15794 = new PriorityQueue();
        this.f15795 = -1;
    }

    public C4132(C3129 c3129) {
        this.f15792 = new C4632(30);
        this.f15793 = new ArrayList();
        this.f15796 = new ArrayList();
        this.f15795 = 0;
        this.f15794 = c3129;
        this.f15797 = new ᵢʒʡᵟ(12, this);
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public void m9036() {
        View view = (View) this.f15792;
        Drawable background = view.getBackground();
        if (background != null) {
            if (((C2531) this.f15796) != null) {
                if (((C2531) this.f15797) == null) {
                    this.f15797 = new C2531();
                }
                C2531 c2531 = (C2531) this.f15797;
                c2531.f9796 = null;
                c2531.f9795 = false;
                c2531.f9798 = null;
                c2531.f9797 = false;
                WeakHashMap weakHashMap = AbstractC2746.f10556;
                ColorStateList backgroundTintList = view.getBackgroundTintList();
                if (backgroundTintList != null) {
                    c2531.f9795 = true;
                    c2531.f9796 = backgroundTintList;
                }
                PorterDuff.Mode backgroundTintMode = view.getBackgroundTintMode();
                if (backgroundTintMode != null) {
                    c2531.f9797 = true;
                    c2531.f9798 = backgroundTintMode;
                }
                if (c2531.f9795 || c2531.f9797) {
                    C0359.m1681(background, c2531, view.getDrawableState());
                    return;
                }
            }
            C2531 c25312 = (C2531) this.f15794;
            if (c25312 != null) {
                C0359.m1681(background, c25312, view.getDrawableState());
                return;
            }
            C2531 c25313 = (C2531) this.f15796;
            if (c25313 != null) {
                C0359.m1681(background, c25313, view.getDrawableState());
            }
        }
    }

    /* JADX INFO: renamed from: ˉᵲ, reason: contains not printable characters */
    public void m9037(ArrayList arrayList) {
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            C2112 c2112 = (C2112) arrayList.get(i);
            c2112.f8408 = null;
            ((C4632) this.f15792).mo8915(c2112);
        }
        arrayList.clear();
    }

    /* JADX WARN: Removed duplicated region for block: B:199:0x00b1 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:200:0x0132 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:203:0x0125 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:217:0x0015 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:29:0x007c  */
    /* JADX WARN: Removed duplicated region for block: B:30:0x0081  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x009d  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x00a1  */
    /* JADX WARN: Removed duplicated region for block: B:39:0x00ac  */
    /* JADX INFO: renamed from: ˊᵙᵾᵲ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void m9038() {
        int i;
        int i2;
        int i3;
        boolean z;
        byte b;
        C2112 c2112M9041;
        int i4;
        int i5;
        C2112 c2112M90412;
        boolean z2;
        boolean z3;
        Object obj;
        C2112 c2112;
        C4632 c4632 = (C4632) this.f15792;
        C3129 c3129 = (C3129) this.f15794;
        ᵢʒʡᵟ r3 = (ᵢʒʡᵟ) this.f15797;
        ArrayList arrayList = (ArrayList) this.f15793;
        r3.getClass();
        while (true) {
            int size = arrayList.size() - 1;
            boolean z4 = false;
            while (true) {
                i = 8;
                if (size < 0) {
                    size = -1;
                    break;
                }
                if (((C2112) arrayList.get(size)).f8409 != 8) {
                    z4 = true;
                } else if (z4) {
                    break;
                }
                size--;
            }
            i2 = 2;
            if (size == -1) {
                break;
            }
            int i6 = size + 1;
            C4132 c4132 = (C4132) r3.ᵜᵪʾ;
            C4632 c46322 = (C4632) c4132.f15792;
            C2112 c21122 = (C2112) arrayList.get(size);
            C2112 c21123 = (C2112) arrayList.get(i6);
            int i7 = c21123.f8409;
            if (i7 == 1) {
                int i8 = c21122.f8410;
                int i9 = c21123.f8407;
                int i10 = i8 < i9 ? -1 : 0;
                int i11 = c21122.f8407;
                if (i11 < i9) {
                    i10++;
                }
                if (i9 <= i11) {
                    c21122.f8407 = i11 + c21123.f8410;
                }
                int i12 = c21123.f8407;
                if (i12 <= i8) {
                    c21122.f8410 = i8 + c21123.f8410;
                }
                c21123.f8407 = i12 + i10;
                arrayList.set(size, c21123);
                arrayList.set(i6, c21122);
            } else if (i7 == 2) {
                int i13 = c21122.f8407;
                int i14 = c21122.f8410;
                int i15 = c21123.f8407;
                if (i13 < i14) {
                    if (i15 == i13 && c21123.f8410 == i14 - i13) {
                        z2 = false;
                        z3 = true;
                    } else {
                        z2 = false;
                        z3 = false;
                    }
                } else if (i15 == i14 + 1 && c21123.f8410 == i13 - i14) {
                    z2 = true;
                    z3 = true;
                } else {
                    z2 = true;
                    z3 = false;
                }
                if (i14 < i15) {
                    c21123.f8407 = i15 - 1;
                } else {
                    int i16 = c21123.f8410;
                    if (i14 < i15 + i16) {
                        c21123.f8410 = i16 - 1;
                        c21122.f8409 = 2;
                        c21122.f8410 = 1;
                        if (c21123.f8410 == 0) {
                            arrayList.remove(i6);
                            c21123.f8408 = null;
                            c46322.mo8915(c21123);
                        }
                    }
                }
                int i17 = c21122.f8407;
                int i18 = c21123.f8407;
                if (i17 <= i18) {
                    c21123.f8407 = i18 + 1;
                } else {
                    int i19 = i18 + c21123.f8410;
                    if (i17 < i19) {
                        obj = null;
                        C2112 c2112M90413 = c4132.m9041(null, 2, i17 + 1, i19 - i17);
                        c21123.f8410 = c21122.f8407 - c21123.f8407;
                        c2112 = c2112M90413;
                    }
                    if (z3) {
                        if (z2) {
                            if (c2112 != null) {
                                int i20 = c21122.f8407;
                                if (i20 > c2112.f8407) {
                                    c21122.f8407 = i20 - c2112.f8410;
                                }
                                int i21 = c21122.f8410;
                                if (i21 > c2112.f8407) {
                                    c21122.f8410 = i21 - c2112.f8410;
                                }
                            }
                            int i22 = c21122.f8407;
                            if (i22 > c21123.f8407) {
                                c21122.f8407 = i22 - c21123.f8410;
                            }
                            int i23 = c21122.f8410;
                            if (i23 > c21123.f8407) {
                                c21122.f8410 = i23 - c21123.f8410;
                            }
                        } else {
                            if (c2112 != null) {
                                int i24 = c21122.f8407;
                                if (i24 >= c2112.f8407) {
                                    c21122.f8407 = i24 - c2112.f8410;
                                }
                                int i25 = c21122.f8410;
                                if (i25 >= c2112.f8407) {
                                    c21122.f8410 = i25 - c2112.f8410;
                                }
                            }
                            int i26 = c21122.f8407;
                            if (i26 >= c21123.f8407) {
                                c21122.f8407 = i26 - c21123.f8410;
                            }
                            int i27 = c21122.f8410;
                            if (i27 >= c21123.f8407) {
                                c21122.f8410 = i27 - c21123.f8410;
                            }
                        }
                        arrayList.set(size, c21123);
                        if (c21122.f8407 != c21122.f8410) {
                            arrayList.set(i6, c21122);
                        } else {
                            arrayList.remove(i6);
                        }
                        if (c2112 != null) {
                            arrayList.add(size, c2112);
                        }
                    } else {
                        arrayList.set(size, c21123);
                        arrayList.remove(i6);
                        c21122.f8408 = obj;
                        c46322.mo8915(c21122);
                    }
                }
                obj = null;
                c2112 = null;
                if (z3) {
                }
            } else if (i7 == 4) {
                int i28 = c21122.f8410;
                int i29 = c21123.f8407;
                if (i28 < i29) {
                    c21123.f8407 = i29 - 1;
                } else {
                    int i30 = c21123.f8410;
                    if (i28 < i29 + i30) {
                        c21123.f8410 = i30 - 1;
                        c2112M9041 = c4132.m9041(c21123.f8408, 4, c21122.f8407, 1);
                    }
                    i4 = c21122.f8407;
                    i5 = c21123.f8407;
                    if (i4 > i5) {
                        c21123.f8407 = i5 + 1;
                    } else {
                        int i31 = i5 + c21123.f8410;
                        if (i4 < i31) {
                            int i32 = i31 - i4;
                            c2112M90412 = c4132.m9041(c21123.f8408, 4, i4 + 1, i32);
                            c21123.f8410 -= i32;
                        }
                        arrayList.set(i6, c21122);
                        if (c21123.f8410 > 0) {
                            arrayList.set(size, c21123);
                        } else {
                            arrayList.remove(size);
                            c21123.f8408 = null;
                            c46322.mo8915(c21123);
                        }
                        if (c2112M9041 != null) {
                            arrayList.add(size, c2112M9041);
                        }
                        if (c2112M90412 != null) {
                            arrayList.add(size, c2112M90412);
                        }
                    }
                    c2112M90412 = null;
                    arrayList.set(i6, c21122);
                    if (c21123.f8410 > 0) {
                    }
                    if (c2112M9041 != null) {
                    }
                    if (c2112M90412 != null) {
                    }
                }
                c2112M9041 = null;
                i4 = c21122.f8407;
                i5 = c21123.f8407;
                if (i4 > i5) {
                }
                c2112M90412 = null;
                arrayList.set(i6, c21122);
                if (c21123.f8410 > 0) {
                }
                if (c2112M9041 != null) {
                }
                if (c2112M90412 != null) {
                }
            }
        }
        int size2 = arrayList.size();
        int i33 = 0;
        while (i33 < size2) {
            C2112 c2112M90414 = (C2112) arrayList.get(i33);
            int i34 = c2112M90414.f8409;
            if (i34 == 1) {
                i3 = i2;
                m9054(c2112M90414);
            } else if (i34 == i2) {
                int i35 = c2112M90414.f8407;
                int i36 = c2112M90414.f8410 + i35;
                int i37 = i35;
                int i38 = 0;
                byte b2 = -1;
                while (i37 < i36) {
                    RecyclerView recyclerView = c3129.f11934;
                    AbstractC4793 abstractC4793M556 = recyclerView.m556(i37, true);
                    if (abstractC4793M556 == null) {
                        abstractC4793M556 = null;
                    } else {
                        if (((ArrayList) recyclerView.f924.f8726).contains(abstractC4793M556.f18236)) {
                            boolean z5 = RecyclerView.f848;
                            abstractC4793M556 = null;
                        }
                    }
                    if (abstractC4793M556 != null || m9044(i37)) {
                        if (b2 == 0) {
                            m9061(m9041(null, 2, i35, i38));
                            z = true;
                        } else {
                            z = false;
                        }
                        b = 1;
                    } else {
                        if (b2 == 1) {
                            m9054(m9041(null, 2, i35, i38));
                            z = true;
                        } else {
                            z = false;
                        }
                        b = 0;
                    }
                    if (z) {
                        i37 -= i38;
                        i36 -= i38;
                        i38 = 1;
                    } else {
                        i38++;
                    }
                    i37++;
                    b2 = b;
                }
                if (i38 != c2112M90414.f8410) {
                    c2112M90414.f8408 = null;
                    c4632.mo8915(c2112M90414);
                    i3 = 2;
                    c2112M90414 = m9041(null, 2, i35, i38);
                } else {
                    i3 = 2;
                }
                if (b2 == 0) {
                    m9061(c2112M90414);
                } else {
                    m9054(c2112M90414);
                }
            } else if (i34 != 4) {
                if (i34 == i) {
                    m9054(c2112M90414);
                }
                i3 = i2;
            } else {
                int i39 = c2112M90414.f8407;
                int i40 = c2112M90414.f8410 + i39;
                int i41 = i39;
                int i42 = 0;
                byte b3 = -1;
                while (i39 < i40) {
                    RecyclerView recyclerView2 = c3129.f11934;
                    AbstractC4793 abstractC4793M5562 = recyclerView2.m556(i39, true);
                    if (abstractC4793M5562 == null) {
                        abstractC4793M5562 = null;
                    } else {
                        if (((ArrayList) recyclerView2.f924.f8726).contains(abstractC4793M5562.f18236)) {
                            boolean z6 = RecyclerView.f848;
                            abstractC4793M5562 = null;
                        }
                    }
                    if (abstractC4793M5562 != null || m9044(i39)) {
                        if (b3 == 0) {
                            m9061(m9041(c2112M90414.f8408, 4, i41, i42));
                            i41 = i39;
                            i42 = 0;
                        }
                        b3 = 1;
                    } else {
                        if (b3 == 1) {
                            m9054(m9041(c2112M90414.f8408, 4, i41, i42));
                            i41 = i39;
                            i42 = 0;
                        }
                        b3 = 0;
                    }
                    i42++;
                    i39++;
                }
                if (i42 != c2112M90414.f8410) {
                    Object obj2 = c2112M90414.f8408;
                    c2112M90414.f8408 = null;
                    c4632.mo8915(c2112M90414);
                    c2112M90414 = m9041(obj2, 4, i41, i42);
                }
                if (b3 == 0) {
                    m9061(c2112M90414);
                } else {
                    m9054(c2112M90414);
                }
                i3 = 2;
            }
            i33++;
            i2 = i3;
            i = 8;
        }
        arrayList.clear();
    }

    /* JADX INFO: renamed from: ˊᵨᵧ, reason: contains not printable characters */
    public void m9039(ColorStateList colorStateList) {
        if (colorStateList != null) {
            if (((C2531) this.f15796) == null) {
                this.f15796 = new C2531();
            }
            C2531 c2531 = (C2531) this.f15796;
            c2531.f9796 = colorStateList;
            c2531.f9795 = true;
        } else {
            this.f15796 = null;
        }
        m9036();
    }

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public int m9040(int i, int i2) {
        ArrayList arrayList = (ArrayList) this.f15796;
        int size = arrayList.size();
        while (i2 < size) {
            C2112 c2112 = (C2112) arrayList.get(i2);
            int i3 = c2112.f8409;
            int i4 = c2112.f8407;
            if (i3 == 8) {
                if (i4 == i) {
                    i = c2112.f8410;
                } else {
                    if (i4 < i) {
                        i--;
                    }
                    if (c2112.f8410 <= i) {
                        i++;
                    }
                }
            } else if (i4 > i) {
                continue;
            } else if (i3 == 2) {
                int i5 = c2112.f8410;
                if (i < i4 + i5) {
                    return -1;
                }
                i -= i5;
            } else if (i3 == 1) {
                i += c2112.f8410;
            }
            i2++;
        }
        return i;
    }

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public C2112 m9041(Object obj, int i, int i2, int i3) {
        C2112 c2112 = (C2112) ((C4632) this.f15792).mo8914();
        if (c2112 != null) {
            c2112.f8409 = i;
            c2112.f8407 = i2;
            c2112.f8410 = i3;
            c2112.f8408 = obj;
            return c2112;
        }
        C2112 c21122 = new C2112();
        c21122.f8409 = i;
        c21122.f8407 = i2;
        c21122.f8410 = i3;
        c21122.f8408 = obj;
        return c21122;
    }

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public void m9042(int i) {
        ᵻᵪ.ˌᴵ(i >= 0);
        this.f15795 = i;
        m9060(i);
    }

    /* JADX INFO: renamed from: ˏːˆ, reason: contains not printable characters */
    public void m9043(Runnable runnable) {
        C3086 c3086 = (C3086) this.f15792;
        if (c3086.f11775.getLooper().getThread().isAlive()) {
            c3086.m7175(runnable);
        }
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public boolean m9044(int i) {
        ArrayList arrayList = (ArrayList) this.f15796;
        int size = arrayList.size();
        for (int i2 = 0; i2 < size; i2++) {
            C2112 c2112 = (C2112) arrayList.get(i2);
            int i3 = c2112.f8409;
            if (i3 != 8) {
                if (i3 == 1) {
                    int i4 = c2112.f8407;
                    int i5 = c2112.f8410 + i4;
                    while (i4 < i5) {
                        if (m9040(i4, i2 + 1) == i) {
                            return true;
                        }
                        i4++;
                    }
                } else {
                    continue;
                }
            } else {
                if (m9040(c2112.f8410, i2 + 1) == i) {
                    return true;
                }
            }
        }
        return false;
    }

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public void m9045(PorterDuff.Mode mode) {
        if (((C2531) this.f15794) == null) {
            this.f15794 = new C2531();
        }
        C2531 c2531 = (C2531) this.f15794;
        c2531.f9798 = mode;
        c2531.f9797 = true;
        m9036();
    }

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public void m9046(ColorStateList colorStateList) {
        if (((C2531) this.f15794) == null) {
            this.f15794 = new C2531();
        }
        C2531 c2531 = (C2531) this.f15794;
        c2531.f9796 = colorStateList;
        c2531.f9795 = true;
        m9036();
    }

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public void m9047(AttributeSet attributeSet, int i) {
        ColorStateList colorStateListM10918;
        View view = (View) this.f15792;
        Context context = view.getContext();
        int[] iArr = AbstractC0430.f2394;
        C5398 c5398M11010 = C5398.m11010(context, attributeSet, iArr, i);
        TypedArray typedArray = (TypedArray) c5398M11010.f20483;
        View view2 = (View) this.f15792;
        AbstractC2746.m6646(view2, view2.getContext(), iArr, attributeSet, (TypedArray) c5398M11010.f20483, i);
        try {
            if (typedArray.hasValue(0)) {
                this.f15795 = typedArray.getResourceId(0, -1);
                C0359 c0359 = (C0359) this.f15793;
                Context context2 = view.getContext();
                int i2 = this.f15795;
                synchronized (c0359) {
                    colorStateListM10918 = c0359.f2163.m10918(context2, i2);
                }
                if (colorStateListM10918 != null) {
                    m9039(colorStateListM10918);
                }
            }
            if (typedArray.hasValue(1)) {
                view.setBackgroundTintList(c5398M11010.m11016(1));
            }
            if (typedArray.hasValue(2)) {
                view.setBackgroundTintMode(AbstractC0912.m3159(typedArray.getInt(2, -1), null));
            }
            c5398M11010.m11012();
        } catch (Throwable th) {
            c5398M11010.m11012();
            throw th;
        }
    }

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public void m9048(int i) {
        ColorStateList colorStateListM10918;
        this.f15795 = i;
        C0359 c0359 = (C0359) this.f15793;
        if (c0359 != null) {
            Context context = ((View) this.f15792).getContext();
            synchronized (c0359) {
                colorStateListM10918 = c0359.f2163.m10918(context, i);
            }
        } else {
            colorStateListM10918 = null;
        }
        m9039(colorStateListM10918);
        m9036();
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public void m9049() {
        C3129 c3129 = (C3129) this.f15794;
        m9059();
        ArrayList arrayList = (ArrayList) this.f15793;
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            C2112 c2112 = (C2112) arrayList.get(i);
            int i2 = c2112.f8409;
            if (i2 == 1) {
                c3129.m7237(c2112);
                c3129.m7235(c2112.f8407, c2112.f8410);
            } else if (i2 == 2) {
                c3129.m7237(c2112);
                int i3 = c2112.f8407;
                int i4 = c2112.f8410;
                RecyclerView recyclerView = c3129.f11934;
                recyclerView.m547(i3, i4, true);
                recyclerView.f901 = true;
                recyclerView.f899.f6047 += i4;
            } else if (i2 == 4) {
                c3129.m7237(c2112);
                c3129.m7234(c2112.f8407, c2112.f8410, c2112.f8408);
            } else if (i2 == 8) {
                c3129.m7237(c2112);
                c3129.m7238(c2112.f8407, c2112.f8410);
            }
        }
        m9037(arrayList);
        this.f15795 = 0;
    }

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public int m9050(int i, int i2) {
        int i3;
        int i4;
        C4632 c4632 = (C4632) this.f15792;
        ArrayList arrayList = (ArrayList) this.f15796;
        for (int size = arrayList.size() - 1; size >= 0; size--) {
            C2112 c2112 = (C2112) arrayList.get(size);
            int i5 = c2112.f8409;
            int i6 = c2112.f8407;
            if (i5 == 8) {
                int i7 = c2112.f8410;
                if (i6 < i7) {
                    i4 = i7;
                    i3 = i6;
                } else {
                    i3 = i7;
                    i4 = i6;
                }
                if (i < i3 || i > i4) {
                    if (i < i6) {
                        if (i2 == 1) {
                            c2112.f8407 = i6 + 1;
                            c2112.f8410 = i7 + 1;
                        } else if (i2 == 2) {
                            c2112.f8407 = i6 - 1;
                            c2112.f8410 = i7 - 1;
                        }
                    }
                } else if (i3 == i6) {
                    if (i2 == 1) {
                        c2112.f8410 = i7 + 1;
                    } else if (i2 == 2) {
                        c2112.f8410 = i7 - 1;
                    }
                    i++;
                } else {
                    if (i2 == 1) {
                        c2112.f8407 = i6 + 1;
                    } else if (i2 == 2) {
                        c2112.f8407 = i6 - 1;
                    }
                    i--;
                }
            } else if (i6 <= i) {
                if (i5 == 1) {
                    i -= c2112.f8410;
                } else if (i5 == 2) {
                    i += c2112.f8410;
                }
            } else if (i2 == 1) {
                c2112.f8407 = i6 + 1;
            } else if (i2 == 2) {
                c2112.f8407 = i6 - 1;
            }
        }
        for (int size2 = arrayList.size() - 1; size2 >= 0; size2--) {
            C2112 c21122 = (C2112) arrayList.get(size2);
            int i8 = c21122.f8409;
            int i9 = c21122.f8410;
            if (i8 == 8) {
                if (i9 == c21122.f8407 || i9 < 0) {
                    arrayList.remove(size2);
                    c21122.f8408 = null;
                    c4632.mo8915(c21122);
                }
            } else if (i9 <= 0) {
                arrayList.remove(size2);
                c21122.f8408 = null;
                c4632.mo8915(c21122);
            }
        }
        return i;
    }

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public void m9051() {
        this.f15795 = -1;
        m9039(null);
        m9036();
    }

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public boolean m9052() {
        return ((ArrayList) this.f15793).size() > 0;
    }

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public void m9053(Object obj) {
        Object obj2 = this.f15794;
        this.f15794 = obj;
        if (obj2.equals(obj)) {
            return;
        }
        C3262 c3262 = ((C0103) this.f15796).f1377;
        ((Integer) obj2).getClass();
        Integer num = (Integer) obj;
        int iIntValue = num.intValue();
        c3262.m7468();
        c3262.m7476(1, 10, num);
        c3262.m7476(2, 10, num);
        c3262.f12452.m7412(21, new C2741(iIntValue, 2));
    }

    /* JADX INFO: renamed from: ᵱʡˏ, reason: contains not printable characters */
    public void m9054(C2112 c2112) {
        C3129 c3129 = (C3129) this.f15794;
        ((ArrayList) this.f15796).add(c2112);
        int i = c2112.f8409;
        if (i == 1) {
            c3129.m7235(c2112.f8407, c2112.f8410);
            return;
        }
        if (i == 2) {
            int i2 = c2112.f8407;
            int i3 = c2112.f8410;
            RecyclerView recyclerView = c3129.f11934;
            recyclerView.m547(i2, i3, false);
            recyclerView.f901 = true;
            return;
        }
        if (i == 4) {
            c3129.m7234(c2112.f8407, c2112.f8410, c2112.f8408);
        } else if (i == 8) {
            c3129.m7238(c2112.f8407, c2112.f8410);
        } else {
            ᵷᵝˎ.ˉᵲ(c2112, "Unknown update op type for ");
        }
    }

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public ColorStateList m9055() {
        C2531 c2531 = (C2531) this.f15794;
        if (c2531 != null) {
            return (ColorStateList) c2531.f9796;
        }
        return null;
    }

    /* JADX WARN: Code restructure failed: missing block: B:11:0x002c, code lost:
    
        if (r10 < r3.f3330) goto L34;
     */
    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void m9056(long j, C4545 c4545) {
        int i;
        ArrayDeque arrayDeque = (ArrayDeque) this.f15796;
        PriorityQueue priorityQueue = (PriorityQueue) this.f15794;
        if (j != -9223372036854775807L && (i = this.f15795) != 0) {
            if (i != -1 && priorityQueue.size() >= this.f15795) {
                C0740 c0740 = (C0740) priorityQueue.peek();
                String str = AbstractC0956.f4222;
            }
            ArrayDeque arrayDeque2 = (ArrayDeque) this.f15793;
            C4545 c45452 = arrayDeque2.isEmpty() ? new C4545() : (C4545) arrayDeque2.pop();
            c45452.m9603(c4545.m9623());
            System.arraycopy(c4545.f17284, c4545.f17282, c45452.f17284, 0, c45452.m9623());
            C0740 c07402 = (C0740) this.f15797;
            if (c07402 != null && j == c07402.f3330) {
                c07402.f3329.add(c45452);
                return;
            }
            C0740 c07403 = arrayDeque.isEmpty() ? new C0740() : (C0740) arrayDeque.pop();
            ArrayList arrayList = c07403.f3329;
            ᵻᵪ.ᵱᵽʡᵚ(j != -9223372036854775807L);
            ᵻᵪ.ˌᴵ(arrayList.isEmpty());
            c07403.f3330 = j;
            arrayList.add(c45452);
            priorityQueue.add(c07403);
            this.f15797 = c07403;
            int i2 = this.f15795;
            if (i2 != -1) {
                m9060(i2);
                return;
            }
            return;
        }
        ((InterfaceC1406) this.f15792).m4060(j, c4545);
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public void m9057(C2112 c2112, int i) {
        C3129 c3129 = (C3129) this.f15794;
        c3129.m7237(c2112);
        int i2 = c2112.f8409;
        if (i2 != 2) {
            if (i2 == 4) {
                c3129.m7234(i, c2112.f8410, c2112.f8408);
                return;
            } else {
                ᵕᵩʽᵲ.ᵮᵣᵗˈ("only remove and update ops can be dispatched in first pass");
                return;
            }
        }
        int i3 = c2112.f8410;
        RecyclerView recyclerView = c3129.f11934;
        recyclerView.m547(i, i3, true);
        recyclerView.f901 = true;
        recyclerView.f899.f6047 += i3;
    }

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public PorterDuff.Mode m9058() {
        C2531 c2531 = (C2531) this.f15794;
        if (c2531 != null) {
            return (PorterDuff.Mode) c2531.f9798;
        }
        return null;
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public void m9059() {
        ArrayList arrayList = (ArrayList) this.f15796;
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            ((C3129) this.f15794).m7237((C2112) arrayList.get(i));
        }
        m9037(arrayList);
        this.f15795 = 0;
    }

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public void m9060(int i) {
        ArrayList arrayList;
        PriorityQueue priorityQueue = (PriorityQueue) this.f15794;
        while (priorityQueue.size() > i) {
            C0740 c0740 = (C0740) priorityQueue.poll();
            String str = AbstractC0956.f4222;
            int i2 = 0;
            while (true) {
                arrayList = c0740.f3329;
                if (i2 >= arrayList.size()) {
                    break;
                }
                ((InterfaceC1406) this.f15792).m4060(c0740.f3330, (C4545) arrayList.get(i2));
                ((ArrayDeque) this.f15793).push((C4545) arrayList.get(i2));
                i2++;
            }
            arrayList.clear();
            C0740 c07402 = (C0740) this.f15797;
            if (c07402 != null && c07402.f3330 == c0740.f3330) {
                this.f15797 = null;
            }
            ((ArrayDeque) this.f15796).push(c0740);
        }
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public void m9061(C2112 c2112) {
        int i;
        C4632 c4632 = (C4632) this.f15792;
        int i2 = c2112.f8409;
        if (i2 == 1 || i2 == 8) {
            ᵕᵩʽᵲ.ᵮᵣᵗˈ("should not dispatch add or move for pre layout");
            return;
        }
        int iM9050 = m9050(c2112.f8407, i2);
        int i3 = c2112.f8407;
        int i4 = c2112.f8409;
        if (i4 == 2) {
            i = 0;
        } else {
            if (i4 != 4) {
                ᵷᵝˎ.ˉᵲ(c2112, "op should be remove or update.");
                return;
            }
            i = 1;
        }
        int i5 = 1;
        for (int i6 = 1; i6 < c2112.f8410; i6++) {
            int iM90502 = m9050((i * i6) + c2112.f8407, c2112.f8409);
            int i7 = c2112.f8409;
            if (i7 == 2 ? iM90502 != iM9050 : !(i7 == 4 && iM90502 == iM9050 + 1)) {
                C2112 c2112M9041 = m9041(c2112.f8408, i7, iM9050, i5);
                m9057(c2112M9041, i3);
                c2112M9041.f8408 = null;
                c4632.mo8915(c2112M9041);
                if (c2112.f8409 == 4) {
                    i3 += i5;
                }
                i5 = 1;
                iM9050 = iM90502;
            } else {
                i5++;
            }
        }
        Object obj = c2112.f8408;
        c2112.f8408 = null;
        c4632.mo8915(c2112);
        if (i5 > 0) {
            C2112 c2112M90412 = m9041(obj, c2112.f8409, iM9050, i5);
            m9057(c2112M90412, i3);
            c2112M90412.f8408 = null;
            c4632.mo8915(c2112M90412);
        }
    }
}
