package p037.p091.p095;

import androidx.recyclerview.widget.RecyclerView;
import p037.p057.C1719;
import p037.p091.p095.AbstractC2124;
import p037.p091.p095.C2127;
import p037.p107.p108.RunnableC2352;

/* JADX INFO: renamed from: މ.މ.ލ.ޜ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C2181 extends AbstractC2124 {

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public final AbstractC2124.C2125 f7091 = new AbstractC2124.C2125(0);

    public C2181() {
        m4104(1);
    }

    @Override // p037.p091.p095.AbstractC2124
    /* JADX INFO: renamed from: ֏ */
    public final int mo4089(boolean z, int i, int[] iArr) {
        if (iArr != null) {
            iArr[0] = 0;
            iArr[1] = i;
        }
        return this.f6889 ? ((C2127.C2129) this.f6888).m4160(i) : ((C2127.C2129) this.f6888).m4160(i) + ((C2127.C2129) this.f6888).m4163(i);
    }

    @Override // p037.p091.p095.AbstractC2124
    /* JADX INFO: renamed from: ֏ */
    public void mo4091(int i, int i2, RecyclerView.AbstractC0202.InterfaceC0205 interfaceC0205) {
        int iM4237;
        int iM4160;
        if (!this.f6889 ? i2 < 0 : i2 > 0) {
            if (this.f6893 == ((C2127.C2129) this.f6888).m4159() - 1) {
                return;
            }
            iM4237 = m4236();
            int iM4163 = ((C2127.C2129) this.f6888).m4163(this.f6893) + this.f6890;
            int iM41602 = ((C2127.C2129) this.f6888).m4160(this.f6893);
            if (this.f6889) {
                iM4163 = -iM4163;
            }
            iM4160 = iM4163 + iM41602;
        } else {
            if (this.f6892 == 0) {
                return;
            }
            iM4237 = m4237();
            iM4160 = ((C2127.C2129) this.f6888).m4160(this.f6892) + (this.f6889 ? this.f6890 : -this.f6890);
        }
        ((RunnableC2352.C2354) interfaceC0205).m4402(iM4237, Math.abs(iM4160 - i));
    }

    @Override // p037.p091.p095.AbstractC2124
    /* JADX INFO: renamed from: ֏ */
    public final boolean mo4094(int i, boolean z) {
        int iM4163;
        if (((C2127.C2129) this.f6888).m4159() == 0) {
            return false;
        }
        if (!z && m4093(i)) {
            return false;
        }
        int iM4236 = m4236();
        boolean z2 = false;
        while (iM4236 < ((C2127.C2129) this.f6888).m4159()) {
            int iM4161 = ((C2127.C2129) this.f6888).m4161(iM4236, true, this.f6887, false);
            if (this.f6892 < 0 || this.f6893 < 0) {
                iM4163 = this.f6889 ? Integer.MAX_VALUE : Integer.MIN_VALUE;
                this.f6892 = iM4236;
                this.f6893 = iM4236;
            } else {
                if (this.f6889) {
                    int i2 = iM4236 - 1;
                    iM4163 = (((C2127.C2129) this.f6888).m4160(i2) - ((C2127.C2129) this.f6888).m4163(i2)) - this.f6890;
                } else {
                    int i3 = iM4236 - 1;
                    iM4163 = this.f6890 + ((C2127.C2129) this.f6888).m4163(i3) + ((C2127.C2129) this.f6888).m4160(i3);
                }
                this.f6893 = iM4236;
            }
            ((C2127.C2129) this.f6888).m4162(this.f6887[0], iM4236, iM4161, 0, iM4163);
            if (z || m4093(i)) {
                return true;
            }
            iM4236++;
            z2 = true;
        }
        return z2;
    }

    @Override // p037.p091.p095.AbstractC2124
    /* JADX INFO: renamed from: ֏ */
    public final C1719[] mo4095(int i, int i2) {
        C1719[] c1719Arr = this.f6894;
        C1719 c1719 = c1719Arr[0];
        c1719.f5582 = c1719.f5581;
        c1719Arr[0].m3353(i);
        this.f6894[0].m3353(i2);
        return this.f6894;
    }

    @Override // p037.p091.p095.AbstractC2124
    /* JADX INFO: renamed from: ؠ */
    public final int mo4096(boolean z, int i, int[] iArr) {
        if (iArr != null) {
            iArr[0] = 0;
            iArr[1] = i;
        }
        return this.f6889 ? ((C2127.C2129) this.f6888).m4160(i) - ((C2127.C2129) this.f6888).m4163(i) : ((C2127.C2129) this.f6888).m4160(i);
    }

    @Override // p037.p091.p095.AbstractC2124
    /* JADX INFO: renamed from: ؠ */
    public final boolean mo4100(int i, boolean z) {
        int iM4160;
        if (((C2127.C2129) this.f6888).m4159() == 0) {
            return false;
        }
        if (!z && m4099(i)) {
            return false;
        }
        int i2 = C2127.this.f6905;
        int iM4237 = m4237();
        boolean z2 = false;
        while (iM4237 >= i2) {
            int iM4161 = ((C2127.C2129) this.f6888).m4161(iM4237, false, this.f6887, false);
            if (this.f6892 < 0 || this.f6893 < 0) {
                iM4160 = this.f6889 ? Integer.MIN_VALUE : Integer.MAX_VALUE;
                this.f6892 = iM4237;
                this.f6893 = iM4237;
            } else {
                iM4160 = this.f6889 ? ((C2127.C2129) this.f6888).m4160(iM4237 + 1) + this.f6890 + iM4161 : (((C2127.C2129) this.f6888).m4160(iM4237 + 1) - this.f6890) - iM4161;
                this.f6892 = iM4237;
            }
            ((C2127.C2129) this.f6888).m4162(this.f6887[0], iM4237, iM4161, 0, iM4160);
            if (z || m4099(i)) {
                return true;
            }
            iM4237--;
            z2 = true;
        }
        return z2;
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public int m4236() {
        int i = this.f6893;
        if (i >= 0) {
            return i + 1;
        }
        int i2 = this.f6895;
        if (i2 != -1) {
            return Math.min(i2, ((C2127.C2129) this.f6888).m4159() - 1);
        }
        return 0;
    }

    @Override // p037.p091.p095.AbstractC2124
    /* JADX INFO: renamed from: ހ */
    public final AbstractC2124.C2125 mo4101(int i) {
        return this.f7091;
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public int m4237() {
        int i = this.f6892;
        if (i >= 0) {
            return i - 1;
        }
        int i2 = this.f6895;
        return i2 != -1 ? Math.min(i2, ((C2127.C2129) this.f6888).m4159() - 1) : ((C2127.C2129) this.f6888).m4159() - 1;
    }
}
