package l0;

import C0.B;
import I0.AbstractC0303l;
import I0.I0;
import I0.InterfaceC0314x;
import e.C1950d;
import i0.AbstractC2254r;
import kotlin.jvm.internal.C;
import kotlin.jvm.internal.o;

/* JADX INFO: loaded from: classes.dex */
public final class f extends AbstractC2254r implements I0, InterfaceC0314x {

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

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

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

    @Override // I0.I0
    public final Object i() {
        return e.f20139a;
    }

    @Override // I0.InterfaceC0314x
    public final void m(long j4) {
        this.f20142c = j4;
    }

    @Override // i0.AbstractC2254r
    public final void onDetach() {
        this.f20141b = null;
        this.f20140a = null;
    }

    public final boolean t0(B b5) {
        f fVar = this.f20140a;
        if (fVar != null) {
            return fVar.t0(b5);
        }
        f fVar2 = this.f20141b;
        if (fVar2 != null) {
            return fVar2.t0(b5);
        }
        return false;
    }

    public final void u0(B b5) {
        f fVar = this.f20141b;
        if (fVar != null) {
            fVar.u0(b5);
            return;
        }
        f fVar2 = this.f20140a;
        if (fVar2 != null) {
            fVar2.u0(b5);
        }
    }

    public final void v0(B b5) {
        f fVar = this.f20141b;
        if (fVar != null) {
            fVar.v0(b5);
        }
        f fVar2 = this.f20140a;
        if (fVar2 != null) {
            fVar2.v0(b5);
        }
        this.f20140a = null;
    }

    public final void w0(B b5) {
        I0 i02;
        f fVar;
        f fVar2 = this.f20140a;
        if (fVar2 == null || !W0.e.e(fVar2, W.a.h0(b5))) {
            if (getNode().isAttached()) {
                C c6 = new C();
                AbstractC0303l.z(this, new C1950d(c6, this, b5, 4));
                i02 = (I0) c6.f20115a;
            } else {
                i02 = null;
            }
            fVar = (f) i02;
        } else {
            fVar = fVar2;
        }
        if (fVar != null && fVar2 == null) {
            fVar.u0(b5);
            fVar.w0(b5);
            f fVar3 = this.f20141b;
            if (fVar3 != null) {
                fVar3.v0(b5);
            }
        } else if (fVar == null && fVar2 != null) {
            f fVar4 = this.f20141b;
            if (fVar4 != null) {
                fVar4.u0(b5);
                fVar4.w0(b5);
            }
            fVar2.v0(b5);
        } else if (!o.c(fVar, fVar2)) {
            if (fVar != null) {
                fVar.u0(b5);
                fVar.w0(b5);
            }
            if (fVar2 != null) {
                fVar2.v0(b5);
            }
        } else if (fVar != null) {
            fVar.w0(b5);
        } else {
            f fVar5 = this.f20141b;
            if (fVar5 != null) {
                fVar5.w0(b5);
            }
        }
        this.f20140a = fVar;
    }

    public final void x0(B b5) {
        f fVar = this.f20141b;
        if (fVar != null) {
            fVar.x0(b5);
            return;
        }
        f fVar2 = this.f20140a;
        if (fVar2 != null) {
            fVar2.x0(b5);
        }
    }
}
