package W;

import com.google.android.gms.internal.measurement.C1;
import java.util.concurrent.atomic.AtomicInteger;

/* JADX INFO: loaded from: classes.dex */
public final class J extends G6.i implements O6.p {

    /* JADX INFO: renamed from: A, reason: collision with root package name */
    public final /* synthetic */ boolean f6928A;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public P6.k f6929u;

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

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

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public final /* synthetic */ P6.k f6932x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public final /* synthetic */ K f6933y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public final /* synthetic */ Object f6934z;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public J(P6.k kVar, K k8, Object obj, boolean z8, E6.d dVar) {
        super(2, dVar);
        this.f6932x = kVar;
        this.f6933y = k8;
        this.f6934z = obj;
        this.f6928A = z8;
    }

    @Override // O6.p
    public final Object k(Object obj, Object obj2) {
        return ((J) m((E6.d) obj2, (Y.k) obj)).p(A6.n.f457a);
    }

    @Override // G6.a
    public final E6.d m(E6.d dVar, Object obj) {
        J j8 = new J(this.f6932x, this.f6933y, this.f6934z, this.f6928A, dVar);
        j8.f6931w = obj;
        return j8;
    }

    /* JADX WARN: Code restructure failed: missing block: B:15:0x0062, code lost:
    
        if (r6.b(r3, r7) == r0) goto L16;
     */
    @Override // G6.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object p(Object obj) throws Throwable {
        Y.k kVar;
        P6.k kVar2;
        F6.a aVar = F6.a.f2580q;
        int i = this.f6930v;
        P6.k kVar3 = this.f6932x;
        Object obj2 = this.f6934z;
        K k8 = this.f6933y;
        if (i == 0) {
            C1.N(obj);
            Y.k kVar4 = (Y.k) this.f6931w;
            U uH = k8.h();
            this.f6931w = kVar4;
            this.f6929u = kVar3;
            this.f6930v = 1;
            Integer num = new Integer(((AtomicInteger) uH.f6971b.f5246r).incrementAndGet());
            if (num != aVar) {
                kVar = kVar4;
                obj = num;
                kVar2 = kVar3;
            }
            return aVar;
        }
        if (i != 1) {
            if (i != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            C1.N(obj);
            if (this.f6928A) {
                k8.f6942h.c(new C0336c(obj2 != null ? obj2.hashCode() : 0, kVar3.f5533q, obj2));
            }
            return A6.n.f457a;
        }
        kVar2 = this.f6929u;
        kVar = (Y.k) this.f6931w;
        C1.N(obj);
        kVar2.f5533q = ((Number) obj).intValue();
        this.f6931w = null;
        this.f6929u = null;
        this.f6930v = 2;
    }
}
