package C0;

import L0.C;
import u0.Q;
import u0.S;

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

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final String f1108a;

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final C f1111d;

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public boolean f1113f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final /* synthetic */ h f1114g;

    public g(h hVar, String str, int i, C c3) {
        this.f1114g = hVar;
        this.f1108a = str;
        this.f1109b = i;
        this.f1110c = c3 == null ? -1L : c3.f3628d;
        if (c3 == null || !c3.b()) {
            return;
        }
        this.f1111d = c3;
    }

    public final boolean a(a aVar) {
        C c3 = aVar.f1085d;
        if (c3 == null) {
            return this.f1109b != aVar.f1084c;
        }
        long j8 = this.f1110c;
        if (j8 == -1) {
            return false;
        }
        if (c3.f3628d > j8) {
            return true;
        }
        C c8 = this.f1111d;
        if (c8 == null) {
            return false;
        }
        S s8 = aVar.f1083b;
        int iB = s8.b(c3.f3625a);
        int iB2 = s8.b(c8.f3625a);
        if (c3.f3628d < c8.f3628d || iB < iB2) {
            return false;
        }
        if (iB > iB2) {
            return true;
        }
        boolean zB = c3.b();
        int i = c8.f3626b;
        if (!zB) {
            int i5 = c3.f3629e;
            return i5 == -1 || i5 > i;
        }
        int i8 = c3.f3626b;
        if (i8 > i) {
            return true;
        }
        if (i8 == i) {
            return c3.f3627c > c8.f3627c;
        }
        return false;
    }

    public final boolean b(S s8, S s9) {
        C c3;
        int i = this.f1109b;
        if (i < s8.o()) {
            h hVar = this.f1114g;
            s8.n(i, hVar.f1116a);
            Q q8 = hVar.f1116a;
            for (int i5 = q8.f17196n; i5 <= q8.f17197o; i5++) {
                int iB = s9.b(s8.l(i5));
                if (iB != -1) {
                    i = s9.f(iB, hVar.f1117b, false).f17177c;
                    break;
                }
            }
            i = -1;
        } else if (i >= s9.o()) {
            i = -1;
        }
        this.f1109b = i;
        return i != -1 && ((c3 = this.f1111d) == null || s9.b(c3.f3625a) != -1);
    }
}
