package o; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; /* loaded from: classes.dex */ public final class ggM extends AbstractC15050gfj implements InterfaceC14922gbx, InterfaceC14907gbi { public static final AtomicReferenceFieldUpdater c = AtomicReferenceFieldUpdater.newUpdater(ggM.class, Object.class, "_reusableCancellableContinuation"); public volatile Object _reusableCancellableContinuation; public Object a; public final Object b; public final InterfaceC14907gbi e; public final AbstractC15004geU h; @Override // o.InterfaceC14922gbx public final StackTraceElement getStackTraceElement() { return null; } /* JADX WARN: Multi-variable type inference failed */ public ggM(AbstractC15004geU abstractC15004geU, InterfaceC14907gbi interfaceC14907gbi) { super(-1); this.h = abstractC15004geU; this.e = interfaceC14907gbi; this.a = C15069ggJ.c(); this.b = C15126gho.d(getContext()); this._reusableCancellableContinuation = null; } @Override // o.InterfaceC14922gbx public final InterfaceC14922gbx getCallerFrame() { InterfaceC14907gbi interfaceC14907gbi = this.e; if (interfaceC14907gbi instanceof InterfaceC14922gbx) { return (InterfaceC14922gbx) interfaceC14907gbi; } return null; } @Override // o.AbstractC15050gfj public final Object d() { Object obj = this.a; C15045gfe.b(); this.a = C15069ggJ.c(); return obj; } @Override // o.AbstractC15050gfj public final InterfaceC14907gbi b() { return this; } @Override // o.InterfaceC14907gbi public final void resumeWith(Object obj) { AbstractC15050gfj c2; InterfaceC14912gbn context = this.e.getContext(); Object e = geL.e(obj, null); if (this.h.c()) { this.a = e; this.d = 0; this.h.d(context, this); return; } C15045gfe.b(); C15039gfT c15039gfT = C15039gfT.e; AbstractC15057gfq d = C15039gfT.d(); if (d.b >= 4294967296L) { this.a = e; this.d = 0; ggM ggm = this; ggE> gge = d.e; if (gge == null) { gge = new ggE<>(); d.e = gge; } gge.b(ggm); return; } ggM ggm2 = this; d.c(true); try { InterfaceC14912gbn context2 = getContext(); Object e2 = C15126gho.e(context2, this.b); try { this.e.resumeWith(obj); C14866gag c14866gag = C14866gag.c; while (true) { ggE> gge2 = d.e; if (gge2 != null && (c2 = gge2.c()) != null) { c2.run(); } } } finally { C15126gho.c(context2, e2); } } finally { try { } finally { } } } @Override // o.AbstractC15050gfj public final void d(Object obj, Throwable th) { if (obj instanceof C14999geJ) { ((C14999geJ) obj).a.invoke(th); } } public final String toString() { StringBuilder sb = new StringBuilder("DispatchedContinuation["); sb.append(this.h); sb.append(", "); sb.append(C15041gfa.c(this.e)); sb.append(']'); return sb.toString(); } @Override // o.InterfaceC14907gbi public final InterfaceC14912gbn getContext() { return this.e.getContext(); } }