package defpackage;

import java.io.IOException;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"La21;", "it", "Le6a;", "<anonymous>", "(La21;)V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "io.ktor.websocket.DefaultWebSocketSessionImpl$runOrCancelPinger$newPinger$1", f = "DefaultWebSocketSession.kt", i = {}, l = {310}, m = "invokeSuspend", n = {}, s = {})
final class k22 extends SuspendLambda implements gr3<a21, Continuation<? super e6a>, Object> {
    public int a;
    public /* synthetic */ Object b;
    public final /* synthetic */ g22 c;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public k22(g22 g22Var, Continuation continuation) {
        super(2, continuation);
        this.c = g22Var;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        k22 k22Var = new k22(this.c, continuation);
        k22Var.b = obj;
        return k22Var;
    }

    @Override // defpackage.gr3
    public final Object invoke(Object obj, Object obj2) {
        return ((k22) create((a21) obj, (Continuation) obj2)).invokeSuspend(e6a.a);
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) {
        ck1 ck1Var = ck1.a;
        int i = this.a;
        if (i == 0) {
            s38.b(obj);
            a21 a21Var = (a21) this.b;
            IOException iOException = new IOException("Ping timeout");
            this.a = 1;
            AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = g22.k;
            if (this.c.g(a21Var, iOException, this) == ck1Var) {
                return ck1Var;
            }
        } else {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
        }
        return e6a.a;
    }
}
