package N1;

import android.text.TextUtils;
import x0.AbstractC1709a;

/* JADX INFO: loaded from: classes.dex */
public final class C0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public int f4425a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f4426b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f4427c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f4428d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f4429e;

    public static C0 b(String str) {
        AbstractC1709a.d(str.startsWith("Format:"));
        String[] strArrSplit = TextUtils.split(str.substring(7), ",");
        int i = -1;
        int i5 = -1;
        int i8 = -1;
        int i9 = -1;
        for (int i10 = 0; i10 < strArrSplit.length; i10++) {
            String strF = s7.d.F(strArrSplit[i10].trim());
            strF.getClass();
            switch (strF) {
                case "end":
                    i5 = i10;
                    break;
                case "text":
                    i8 = i10;
                    break;
                case "start":
                    i = i10;
                    break;
                case "style":
                    i9 = i10;
                    break;
            }
        }
        if (i == -1 || i5 == -1 || i8 == -1) {
            return null;
        }
        int length = strArrSplit.length;
        C0 c02 = new C0();
        c02.f4425a = i;
        c02.f4426b = i5;
        c02.f4427c = i9;
        c02.f4428d = i8;
        c02.f4429e = length;
        return c02;
    }

    public boolean a() {
        int i = this.f4425a;
        int i5 = 2;
        if ((i & 7) != 0) {
            int i8 = this.f4428d;
            int i9 = this.f4426b;
            if (((i8 > i9 ? 1 : i8 == i9 ? 2 : 4) & i) == 0) {
                return false;
            }
        }
        if ((i & 112) != 0) {
            int i10 = this.f4428d;
            int i11 = this.f4427c;
            if ((((i10 > i11 ? 1 : i10 == i11 ? 2 : 4) << 4) & i) == 0) {
                return false;
            }
        }
        if ((i & 1792) != 0) {
            int i12 = this.f4429e;
            int i13 = this.f4426b;
            if ((((i12 > i13 ? 1 : i12 == i13 ? 2 : 4) << 8) & i) == 0) {
                return false;
            }
        }
        if ((i & 28672) != 0) {
            int i14 = this.f4429e;
            int i15 = this.f4427c;
            if (i14 > i15) {
                i5 = 1;
            } else if (i14 != i15) {
                i5 = 4;
            }
            if ((i & (i5 << 12)) == 0) {
                return false;
            }
        }
        return true;
    }
}
