package o;

import java.util.Collections;
import java.util.List;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Yd0 {
    public final C0977d7 a;
    public final long b;
    public final Ne0 c;
    public final InterfaceC1955nT d;
    public final Te0 e;
    public long f;
    public final C0977d7 g;
    public final C2730ve0 h;
    public final Oe0 i;

    public Yd0(C2730ve0 c2730ve0, InterfaceC1955nT interfaceC1955nT, Oe0 oe0, Te0 te0) {
        C0977d7 c0977d7 = c2730ve0.a;
        long j = c2730ve0.b;
        Ne0 ne0 = oe0 != null ? oe0.a : null;
        this.a = c0977d7;
        this.b = j;
        this.c = ne0;
        this.d = interfaceC1955nT;
        this.e = te0;
        this.f = j;
        this.g = c0977d7;
        this.h = c2730ve0;
        this.i = oe0;
    }

    public final List a(OC oc) {
        if (!Ue0.c(this.f)) {
            return AbstractC0008Ai.S(new C1314gj("", 0), new C2500t70(Ue0.f(this.f), Ue0.f(this.f)));
        }
        InterfaceC0764av interfaceC0764av = (InterfaceC0764av) oc.g(this);
        if (interfaceC0764av != null) {
            return Collections.singletonList(interfaceC0764av);
        }
        return null;
    }

    public final Integer b() {
        Ne0 ne0 = this.c;
        if (ne0 == null) {
            return null;
        }
        C2331rQ c2331rQ = ne0.b;
        int iE = Ue0.e(this.f);
        InterfaceC1955nT interfaceC1955nT = this.d;
        return Integer.valueOf(interfaceC1955nT.n(c2331rQ.c(c2331rQ.d(interfaceC1955nT.p(iE)), true)));
    }

    public final Integer c() {
        Ne0 ne0 = this.c;
        if (ne0 == null) {
            return null;
        }
        int iF = Ue0.f(this.f);
        InterfaceC1955nT interfaceC1955nT = this.d;
        return Integer.valueOf(interfaceC1955nT.n(ne0.g(ne0.b.d(interfaceC1955nT.p(iF)))));
    }

    public final Integer d() {
        int length;
        Ne0 ne0 = this.c;
        if (ne0 == null) {
            return null;
        }
        int iR = r();
        while (true) {
            C0977d7 c0977d7 = this.a;
            if (iR < c0977d7.m.length()) {
                int length2 = this.g.m.length() - 1;
                if (iR <= length2) {
                    length2 = iR;
                }
                long j = ne0.j(length2);
                int i = Ue0.c;
                int i2 = (int) (j & 4294967295L);
                if (i2 > iR) {
                    length = this.d.n(i2);
                    break;
                }
                iR++;
            } else {
                length = c0977d7.m.length();
                break;
            }
        }
        return Integer.valueOf(length);
    }

    public final Integer e() {
        int iN;
        Ne0 ne0 = this.c;
        if (ne0 == null) {
            return null;
        }
        int iR = r();
        while (true) {
            if (iR <= 0) {
                iN = 0;
                break;
            }
            int length = this.g.m.length() - 1;
            if (iR <= length) {
                length = iR;
            }
            long j = ne0.j(length);
            int i = Ue0.c;
            int i2 = (int) (j >> 32);
            if (i2 < iR) {
                iN = this.d.n(i2);
                break;
            }
            iR--;
        }
        return Integer.valueOf(iN);
    }

    public final boolean f() {
        Ne0 ne0 = this.c;
        return (ne0 != null ? ne0.h(r()) : 0) != 2;
    }

    public final int g(Ne0 ne0, int i) {
        int iR = r();
        Te0 te0 = this.e;
        if (te0.a == null) {
            te0.a = Float.valueOf(ne0.c(iR).a);
        }
        C2331rQ c2331rQ = ne0.b;
        int iD = c2331rQ.d(iR) + i;
        if (iD < 0) {
            return 0;
        }
        if (iD >= c2331rQ.f) {
            return this.g.m.length();
        }
        float fB = c2331rQ.b(iD) - 1;
        Float f = te0.a;
        float fFloatValue = f.floatValue();
        if ((f() && fFloatValue >= ne0.f(iD)) || (!f() && fFloatValue <= ne0.e(iD))) {
            return c2331rQ.c(iD, true);
        }
        return this.d.n(c2331rQ.g((Float.floatToRawIntBits(fB) & 4294967295L) | (Float.floatToRawIntBits(f.floatValue()) << 32)));
    }

    /* JADX WARN: Removed duplicated region for block: B:9:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final int h(o.Oe0 r9, int r10) {
        /*
            r8 = this;
            o.fK r0 = r9.b
            o.Ne0 r1 = r9.a
            if (r0 == 0) goto L13
            o.fK r9 = r9.c
            if (r9 == 0) goto L10
            r2 = 1
            o.T00 r9 = r9.h(r0, r2)
            goto L11
        L10:
            r9 = 0
        L11:
            if (r9 != 0) goto L15
        L13:
            o.T00 r9 = o.T00.e
        L15:
            o.ve0 r0 = r8.h
            long r2 = r0.b
            int r0 = o.Ue0.c
            r4 = 4294967295(0xffffffff, double:2.1219957905E-314)
            long r2 = r2 & r4
            int r0 = (int) r2
            o.nT r2 = r8.d
            int r0 = r2.p(r0)
            o.T00 r0 = r1.c(r0)
            float r3 = r0.a
            float r0 = r0.b
            long r6 = r9.b()
            long r6 = r6 & r4
            int r9 = (int) r6
            float r9 = java.lang.Float.intBitsToFloat(r9)
            float r10 = (float) r10
            float r9 = r9 * r10
            float r9 = r9 + r0
            int r10 = java.lang.Float.floatToRawIntBits(r3)
            long r6 = (long) r10
            int r9 = java.lang.Float.floatToRawIntBits(r9)
            long r9 = (long) r9
            r0 = 32
            long r6 = r6 << r0
            long r9 = r9 & r4
            long r9 = r9 | r6
            o.rQ r0 = r1.b
            int r9 = r0.g(r9)
            int r9 = r2.n(r9)
            return r9
        */
        throw new UnsupportedOperationException("Method not decompiled: o.Yd0.h(o.Oe0, int):int");
    }

    public final void i() {
        Te0 te0 = this.e;
        te0.a = null;
        C0977d7 c0977d7 = this.g;
        if (c0977d7.m.length() > 0) {
            if (f()) {
                k();
                return;
            }
            te0.a = null;
            if (c0977d7.m.length() > 0) {
                String str = c0977d7.m;
                long j = this.f;
                int i = Ue0.c;
                int iQ = AbstractC2841wm0.q((int) (j & 4294967295L), str);
                if (iQ != -1) {
                    q(iQ, iQ);
                }
            }
        }
    }

    public final void j() {
        this.e.a = null;
        C0977d7 c0977d7 = this.g;
        String str = c0977d7.m;
        String str2 = c0977d7.m;
        if (str.length() > 0) {
            int iN = AbstractC2461sm0.n(str2, Ue0.e(this.f));
            if (iN == Ue0.e(this.f) && iN != str2.length()) {
                iN = AbstractC2461sm0.n(str2, iN + 1);
            }
            q(iN, iN);
        }
    }

    public final void k() {
        this.e.a = null;
        C0977d7 c0977d7 = this.g;
        if (c0977d7.m.length() > 0) {
            String str = c0977d7.m;
            long j = this.f;
            int i = Ue0.c;
            int iR = AbstractC2841wm0.r((int) (j & 4294967295L), str);
            if (iR != -1) {
                q(iR, iR);
            }
        }
    }

    public final void l() {
        this.e.a = null;
        C0977d7 c0977d7 = this.g;
        String str = c0977d7.m;
        String str2 = c0977d7.m;
        if (str.length() > 0) {
            int iO = AbstractC2461sm0.o(str2, Ue0.f(this.f));
            if (iO == Ue0.f(this.f) && iO != 0) {
                iO = AbstractC2461sm0.o(str2, iO - 1);
            }
            q(iO, iO);
        }
    }

    public final void m() {
        Te0 te0 = this.e;
        te0.a = null;
        C0977d7 c0977d7 = this.g;
        if (c0977d7.m.length() > 0) {
            if (!f()) {
                k();
                return;
            }
            te0.a = null;
            if (c0977d7.m.length() > 0) {
                String str = c0977d7.m;
                long j = this.f;
                int i = Ue0.c;
                int iQ = AbstractC2841wm0.q((int) (j & 4294967295L), str);
                if (iQ != -1) {
                    q(iQ, iQ);
                }
            }
        }
    }

    public final void n() {
        Integer numB;
        this.e.a = null;
        if (this.g.m.length() <= 0 || (numB = b()) == null) {
            return;
        }
        int iIntValue = numB.intValue();
        q(iIntValue, iIntValue);
    }

    public final void o() {
        Integer numC;
        this.e.a = null;
        if (this.g.m.length() <= 0 || (numC = c()) == null) {
            return;
        }
        int iIntValue = numC.intValue();
        q(iIntValue, iIntValue);
    }

    public final void p() {
        if (this.g.m.length() > 0) {
            int i = Ue0.c;
            this.f = AbstractC2378rs0.u((int) (this.b >> 32), (int) (this.f & 4294967295L));
        }
    }

    public final void q(int i, int i2) {
        this.f = AbstractC2378rs0.u(i, i2);
    }

    public final int r() {
        long j = this.f;
        int i = Ue0.c;
        return this.d.p((int) (j & 4294967295L));
    }
}
