package J0;

import I0.AbstractC0303l;
import androidx.compose.runtime.CompositionLocalKt;
import androidx.compose.runtime.ProvidableCompositionLocal;
import m3.AbstractC2467b;

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

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final ProvidableCompositionLocal f2963a = CompositionLocalKt.staticCompositionLocalOf(T0.f2949b);

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final void a(T.s sVar, T.d dVar, C4.c cVar) {
        U0 u02;
        if (cVar instanceof U0) {
            u02 = (U0) cVar;
            int i6 = u02.f2954b;
            if ((i6 & Integer.MIN_VALUE) != 0) {
                u02.f2954b = i6 - Integer.MIN_VALUE;
            } else {
                u02 = new U0(cVar);
            }
        }
        Object obj = u02.f2953a;
        B4.a aVar = B4.a.f492a;
        int i7 = u02.f2954b;
        if (i7 != 0) {
            if (i7 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            AbstractC2467b.l(obj);
            throw new E3.v();
        }
        AbstractC2467b.l(obj);
        if (!sVar.getNode().isAttached()) {
            throw new IllegalArgumentException("establishTextInputSession called from an unattached node");
        }
        I0.t0 t0VarU = AbstractC0303l.u(sVar);
        if (AbstractC0303l.t(sVar).f2158F.get(f2963a) != null) {
            throw new ClassCastException();
        }
        u02.f2954b = 1;
        b(t0VarU, dVar, u02);
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final void b(I0.t0 t0Var, T.d dVar, C4.c cVar) {
        V0 v02;
        if (cVar instanceof V0) {
            v02 = (V0) cVar;
            int i6 = v02.f2959b;
            if ((i6 & Integer.MIN_VALUE) != 0) {
                v02.f2959b = i6 - Integer.MIN_VALUE;
            } else {
                v02 = new V0(cVar);
            }
        }
        Object obj = v02.f2958a;
        B4.a aVar = B4.a.f492a;
        int i7 = v02.f2959b;
        if (i7 == 0) {
            AbstractC2467b.l(obj);
            v02.f2959b = 1;
            ((A) t0Var).J(dVar, v02);
        } else {
            if (i7 == 1) {
                AbstractC2467b.l(obj);
                throw new E3.v();
            }
            if (i7 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            AbstractC2467b.l(obj);
            throw new E3.v();
        }
    }
}
