package e7;

import Z6.AbstractC0378s;
import Z6.AbstractC0385z;
import Z6.C0377q;
import Z6.F;
import Z6.H;
import Z6.U;
import Z6.t0;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;

/* JADX INFO: loaded from: classes.dex */
public final class f extends H implements G6.d, E6.d {

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public static final /* synthetic */ AtomicReferenceFieldUpdater f12545x = AtomicReferenceFieldUpdater.newUpdater(f.class, Object.class, "_reusableCancellableContinuation$volatile");
    private volatile /* synthetic */ Object _reusableCancellableContinuation$volatile;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final AbstractC0378s f12546t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public final G6.c f12547u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public Object f12548v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public final Object f12549w;

    public f(AbstractC0378s abstractC0378s, G6.c cVar) {
        super(-1);
        this.f12546t = abstractC0378s;
        this.f12547u = cVar;
        this.f12548v = AbstractC0892a.f12534b;
        this.f12549w = AbstractC0892a.m(cVar.h());
    }

    @Override // G6.d
    public final G6.d f() {
        return this.f12547u;
    }

    @Override // E6.d
    public final E6.i h() {
        return this.f12547u.h();
    }

    @Override // E6.d
    public final void i(Object obj) throws F {
        Throwable thA = A6.j.a(obj);
        Object c0377q = thA == null ? obj : new C0377q(thA, false);
        G6.c cVar = this.f12547u;
        E6.i iVarH = cVar.h();
        AbstractC0378s abstractC0378s = this.f12546t;
        if (AbstractC0892a.j(abstractC0378s, iVarH)) {
            this.f12548v = c0377q;
            this.f7472s = 0;
            AbstractC0892a.i(abstractC0378s, cVar.h(), this);
            return;
        }
        U uA = t0.a();
        if (uA.f7489s >= 4294967296L) {
            this.f12548v = c0377q;
            this.f7472s = 0;
            B6.i iVar = uA.f7491u;
            if (iVar == null) {
                iVar = new B6.i();
                uA.f7491u = iVar;
            }
            iVar.addLast(this);
            return;
        }
        uA.o0(true);
        try {
            E6.i iVarH2 = cVar.h();
            Object objN = AbstractC0892a.n(iVarH2, this.f12549w);
            try {
                cVar.i(obj);
                while (uA.q0()) {
                }
            } finally {
                AbstractC0892a.g(iVarH2, objN);
            }
        } finally {
            try {
            } finally {
            }
        }
    }

    @Override // Z6.H
    public final Object l() {
        Object obj = this.f12548v;
        this.f12548v = AbstractC0892a.f12534b;
        return obj;
    }

    public final String toString() {
        return "DispatchedContinuation[" + this.f12546t + ", " + AbstractC0385z.y(this.f12547u) + ']';
    }

    @Override // Z6.H
    public final E6.d e() {
        return this;
    }
}
