package o;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.s0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2390s0 extends AbstractC2201q0 {
    public static C2390s0 e;
    public Ne0 c;
    public R50 d;

    @Override // o.AbstractC2201q0
    public final int[] e(int i) {
        int iE;
        String str = (String) this.a;
        if (str == null) {
            str = null;
        }
        if (str.length() > 0) {
            String str2 = (String) this.a;
            if (str2 == null) {
                str2 = null;
            }
            if (i < str2.length()) {
                try {
                    R50 r50 = this.d;
                    if (r50 == null) {
                        r50 = null;
                    }
                    T00 t00G = r50.g();
                    int iRound = Math.round(t00G.d - t00G.b);
                    if (i <= 0) {
                        i = 0;
                    }
                    Ne0 ne0 = this.c;
                    if (ne0 == null) {
                        ne0 = null;
                    }
                    int iD = ne0.b.d(i);
                    Ne0 ne02 = this.c;
                    if (ne02 == null) {
                        ne02 = null;
                    }
                    float f = ne02.b.f(iD) + iRound;
                    Ne0 ne03 = this.c;
                    Ne0 ne04 = ne03 == null ? null : ne03;
                    if (ne03 == null) {
                        ne03 = null;
                    }
                    if (f < ne04.b.f(ne03.b.f - 1)) {
                        Ne0 ne05 = this.c;
                        iE = (ne05 != null ? ne05 : null).b.e(f);
                    } else {
                        Ne0 ne06 = this.c;
                        iE = (ne06 != null ? ne06 : null).b.f;
                    }
                    return h(i, l(iE - 1, 1) + 1);
                } catch (IllegalStateException unused) {
                }
            }
        }
        return null;
    }

    @Override // o.AbstractC2201q0
    public final int[] j(int i) {
        int iE;
        String str = (String) this.a;
        if (str == null) {
            str = null;
        }
        if (str.length() > 0 && i > 0) {
            try {
                R50 r50 = this.d;
                if (r50 == null) {
                    r50 = null;
                }
                T00 t00G = r50.g();
                int iRound = Math.round(t00G.d - t00G.b);
                String str2 = (String) this.a;
                if (str2 == null) {
                    str2 = null;
                }
                int length = str2.length();
                if (length <= i) {
                    i = length;
                }
                Ne0 ne0 = this.c;
                if (ne0 == null) {
                    ne0 = null;
                }
                int iD = ne0.b.d(i);
                Ne0 ne02 = this.c;
                if (ne02 == null) {
                    ne02 = null;
                }
                float f = ne02.b.f(iD) - iRound;
                if (f > 0.0f) {
                    Ne0 ne03 = this.c;
                    if (ne03 == null) {
                        ne03 = null;
                    }
                    iE = ne03.b.e(f);
                } else {
                    iE = 0;
                }
                String str3 = (String) this.a;
                if (i == (str3 != null ? str3 : null).length() && iE < iD) {
                    iE++;
                }
                return h(l(iE, 2), i);
            } catch (IllegalStateException unused) {
            }
        }
        return null;
    }

    public final int l(int i, int i2) {
        Ne0 ne0 = this.c;
        if (ne0 == null) {
            ne0 = null;
        }
        int iG = ne0.g(i);
        Ne0 ne02 = this.c;
        if (ne02 == null) {
            ne02 = null;
        }
        if (i2 != ne02.h(iG)) {
            Ne0 ne03 = this.c;
            return (ne03 != null ? ne03 : null).g(i);
        }
        return Ne0.d(this.c != null ? r5 : null, i) - 1;
    }
}
