package androidx.lifecycle;

/* JADX INFO: loaded from: classes.dex */
public abstract class D {

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

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f12084c = -1;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ E f12085d;

    public D(E e6, G g6) {
        this.f12085d = e6;
        this.f12082a = g6;
    }

    public final void b(boolean z6) {
        if (z6 == this.f12083b) {
            return;
        }
        this.f12083b = z6;
        int i6 = z6 ? 1 : -1;
        E e6 = this.f12085d;
        int i7 = e6.f12089c;
        e6.f12089c = i6 + i7;
        if (!e6.f12090d) {
            e6.f12090d = true;
            while (true) {
                try {
                    int i8 = e6.f12089c;
                    if (i7 == i8) {
                        break;
                    }
                    boolean z7 = i7 == 0 && i8 > 0;
                    boolean z8 = i7 > 0 && i8 == 0;
                    if (z7) {
                        e6.e();
                    } else if (z8) {
                        e6.f();
                    }
                    i7 = i8;
                } catch (Throwable th) {
                    e6.f12090d = false;
                    throw th;
                }
            }
            e6.f12090d = false;
        }
        if (this.f12083b) {
            e6.c(this);
        }
    }

    public void c() {
    }

    public boolean d(InterfaceC1113w interfaceC1113w) {
        return false;
    }

    public abstract boolean e();
}
