package o;

import android.net.Uri;
import androidx.appcompat.widget.ActionMenuView;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.pe, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public class C2160pe implements MZ, GR, InterfaceC0998dP {
    public boolean l;
    public final Object m;

    public C2160pe(Uri uri, boolean z, boolean z2) {
        this.m = uri;
        this.l = z;
    }

    @Override // o.GR
    public long L(int i, long j, long j2) {
        if (!this.l) {
            return 0L;
        }
        C2212q50 c2212q50 = (C2212q50) this.m;
        if (c2212q50.a.b()) {
            return 0L;
        }
        return c2212q50.h(c2212q50.d(c2212q50.a.e(c2212q50.d(c2212q50.g(j2)))));
    }

    @Override // o.InterfaceC0998dP
    public void a(CO co, boolean z) {
        C1444i1 c1444i1;
        Tf0 tf0 = (Tf0) this.m;
        if (this.l) {
            return;
        }
        this.l = true;
        ActionMenuView actionMenuView = tf0.a.a.l;
        if (actionMenuView != null && (c1444i1 = actionMenuView.E) != null) {
            c1444i1.e();
            C1156f1 c1156f1 = c1444i1.E;
            if (c1156f1 != null && c1156f1.b()) {
                c1156f1.i.dismiss();
            }
        }
        tf0.b.onPanelClosed(108, co);
        this.l = false;
    }

    @Override // o.MZ
    public void b(LZ lz, int i) {
        StringBuilder sb = (StringBuilder) this.m;
        if (this.l) {
            this.l = false;
        } else {
            sb.append(", ");
        }
        sb.append(i);
    }

    public boolean c() {
        return this.l;
    }

    /* JADX WARN: Removed duplicated region for block: B:20:0x0037  */
    /* JADX WARN: Removed duplicated region for block: B:21:0x0039  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public boolean d(java.lang.CharSequence r7, int r8) {
        /*
            r6 = this;
            if (r7 == 0) goto L48
            if (r8 < 0) goto L48
            int r0 = r7.length()
            int r0 = r0 - r8
            if (r0 < 0) goto L48
            java.lang.Object r0 = r6.m
            o.ME r0 = (o.ME) r0
            if (r0 != 0) goto L16
            boolean r7 = r6.c()
            return r7
        L16:
            r0.getClass()
            r0 = 0
            r1 = 2
            r2 = r0
            r3 = r1
        L1d:
            r4 = 1
            if (r2 >= r8) goto L3d
            if (r3 != r1) goto L3d
            char r3 = r7.charAt(r2)
            byte r3 = java.lang.Character.getDirectionality(r3)
            o.pe r5 = o.Ad0.a
            if (r3 == 0) goto L39
            if (r3 == r4) goto L37
            if (r3 == r1) goto L37
            switch(r3) {
                case 14: goto L39;
                case 15: goto L39;
                case 16: goto L37;
                case 17: goto L37;
                default: goto L35;
            }
        L35:
            r3 = r1
            goto L3a
        L37:
            r3 = r0
            goto L3a
        L39:
            r3 = r4
        L3a:
            int r2 = r2 + 1
            goto L1d
        L3d:
            if (r3 == 0) goto L47
            if (r3 == r4) goto L46
            boolean r7 = r6.c()
            return r7
        L46:
            return r0
        L47:
            return r4
        L48:
            java.lang.IllegalArgumentException r7 = new java.lang.IllegalArgumentException
            r7.<init>()
            throw r7
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C2160pe.d(java.lang.CharSequence, int):boolean");
    }

    public void e() {
        this.l = false;
    }

    public void f(char c) {
        C1254g2 c1254g2 = (C1254g2) this.m;
        c1254g2.f(c1254g2.m, 1);
        char[] cArr = (char[]) c1254g2.n;
        int i = c1254g2.m;
        c1254g2.m = i + 1;
        cArr[i] = c;
    }

    public Gs0 i(String str, long j) {
        Long lValueOf = Long.valueOf(j);
        Object obj = Gs0.g;
        return new Gs0(this, str, lValueOf, 0);
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    @Override // o.GR
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public java.lang.Object j(long r4, long r6, o.InterfaceC0220Im r8) {
        /*
            r3 = this;
            boolean r4 = r8 instanceof o.C1069e50
            if (r4 == 0) goto L13
            r4 = r8
            o.e50 r4 = (o.C1069e50) r4
            int r5 = r4.r
            r0 = -2147483648(0xffffffff80000000, float:-0.0)
            r1 = r5 & r0
            if (r1 == 0) goto L13
            int r5 = r5 - r0
            r4.r = r5
            goto L1a
        L13:
            o.e50 r4 = new o.e50
            o.Lm r8 = (o.AbstractC0298Lm) r8
            r4.<init>(r3, r8)
        L1a:
            java.lang.Object r5 = r4.p
            int r8 = r4.r
            r0 = 1
            if (r8 == 0) goto L31
            if (r8 != r0) goto L29
            long r6 = r4.f501o
            o.IJ.H(r5)
            goto L50
        L29:
            java.lang.IllegalStateException r4 = new java.lang.IllegalStateException
            java.lang.String r5 = "call to 'resume' before 'invoke' with coroutine"
            r4.<init>(r5)
            throw r4
        L31:
            o.IJ.H(r5)
            boolean r5 = r3.l
            r1 = 0
            if (r5 == 0) goto L58
            java.lang.Object r5 = r3.m
            o.q50 r5 = (o.C2212q50) r5
            boolean r8 = r5.i
            if (r8 == 0) goto L43
            goto L54
        L43:
            r4.f501o = r6
            r4.r = r0
            java.lang.Object r5 = r5.a(r6, r4)
            o.Dn r4 = o.EnumC0091Dn.l
            if (r5 != r4) goto L50
            return r4
        L50:
            o.lj0 r5 = (o.C1791lj0) r5
            long r1 = r5.a
        L54:
            long r1 = o.C1791lj0.d(r6, r1)
        L58:
            o.lj0 r4 = new o.lj0
            r4.<init>(r1)
            return r4
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C2160pe.j(long, long, o.Im):java.lang.Object");
    }

    @Override // o.InterfaceC0998dP
    public boolean k(CO co) {
        ((Tf0) this.m).b.onMenuOpened(108, co);
        return true;
    }

    public Gs0 l(String str, boolean z) {
        Boolean boolValueOf = Boolean.valueOf(z);
        Object obj = Gs0.g;
        return new Gs0(this, str, boolValueOf, 1);
    }

    public Gs0 m(String str, String str2) {
        Object obj = Gs0.g;
        return new Gs0(this, str, str2, 3);
    }

    public /* synthetic */ C2160pe(Object obj) {
        this.m = obj;
        this.l = true;
    }

    public /* synthetic */ C2160pe(Object obj, byte b) {
        this.m = obj;
    }

    public /* synthetic */ C2160pe(boolean z, Object obj) {
        this.m = obj;
        this.l = z;
    }

    public C2160pe(ME me, boolean z) {
        this((Object) me, (byte) 0);
        this.l = z;
    }

    public void g() {
    }

    public void h() {
    }
}
