package Y4;

import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: loaded from: classes3.dex */
public final class X extends C4.j implements J4.f {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public /* synthetic */ InterfaceC0844j f8909b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public /* synthetic */ int f8910c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ Z f8911d;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public X(Z z6, A4.d dVar) {
        super(3, dVar);
        this.f8911d = z6;
    }

    @Override // J4.f
    public final Object invoke(Object obj, Object obj2, Object obj3) {
        int iIntValue = ((Number) obj2).intValue();
        X x6 = new X(this.f8911d, (A4.d) obj3);
        x6.f8909b = (InterfaceC0844j) obj;
        x6.f8910c = iIntValue;
        return x6.invokeSuspend(C3137A.f25453a);
    }

    /* JADX WARN: Code restructure failed: missing block: B:19:0x0047, code lost:
    
        if (r1.emit(r11, r10) == r0) goto L34;
     */
    /* JADX WARN: Code restructure failed: missing block: B:33:0x0084, code lost:
    
        if (r1.emit(r11, r10) != r0) goto L35;
     */
    /* JADX WARN: Removed duplicated region for block: B:26:0x005f  */
    /* JADX WARN: Removed duplicated region for block: B:32:0x0079 A[PHI: r1
      0x0079: PHI (r1v4 Y4.j) = (r1v2 Y4.j), (r1v3 Y4.j), (r1v7 Y4.j) binds: [B:25:0x005d, B:30:0x0076, B:12:0x0020] A[DONT_GENERATE, DONT_INLINE]] */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        InterfaceC0844j interfaceC0844j;
        long j4;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f8908a;
        Z z6 = this.f8911d;
        if (i6 == 0) {
            AbstractC2467b.l(obj);
            interfaceC0844j = this.f8909b;
            if (this.f8910c > 0) {
                Q q6 = Q.f8895a;
                this.f8908a = 1;
            } else {
                long j6 = z6.f8913a;
                this.f8909b = interfaceC0844j;
                this.f8908a = 2;
                if (V4.E.l(j6, this) != aVar) {
                    if (z6.f8914b <= 0) {
                    }
                }
            }
            return aVar;
        }
        if (i6 != 1) {
            if (i6 == 2) {
                interfaceC0844j = this.f8909b;
                AbstractC2467b.l(obj);
                if (z6.f8914b <= 0) {
                    Q q7 = Q.f8896b;
                    this.f8909b = interfaceC0844j;
                    this.f8908a = 3;
                    if (interfaceC0844j.emit(q7, this) != aVar) {
                        j4 = z6.f8914b;
                        this.f8909b = interfaceC0844j;
                        this.f8908a = 4;
                        if (V4.E.l(j4, this) != aVar) {
                        }
                    }
                }
                return aVar;
            }
            if (i6 == 3) {
                interfaceC0844j = this.f8909b;
                AbstractC2467b.l(obj);
                j4 = z6.f8914b;
                this.f8909b = interfaceC0844j;
                this.f8908a = 4;
                if (V4.E.l(j4, this) != aVar) {
                    Q q8 = Q.f8897c;
                    this.f8909b = null;
                    this.f8908a = 5;
                }
                return aVar;
            }
            if (i6 == 4) {
                interfaceC0844j = this.f8909b;
                AbstractC2467b.l(obj);
                Q q82 = Q.f8897c;
                this.f8909b = null;
                this.f8908a = 5;
            } else if (i6 != 5) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
        }
        AbstractC2467b.l(obj);
        return C3137A.f25453a;
    }
}
