package Q;

import V.Y;
import V.Z;
import V4.C;
import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final class k extends C4.j implements J4.e {

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

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ l f5711c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ R.f f5712d;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public k(l lVar, R.f fVar, A4.d dVar) {
        super(2, dVar);
        this.f5711c = lVar;
        this.f5712d = fVar;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        return new k(this.f5711c, this.f5712d, dVar);
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        return ((k) create((C) obj, (A4.d) obj2)).invokeSuspend(C3137A.f25453a);
    }

    /* JADX WARN: Removed duplicated region for block: B:28:0x0051  */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) throws Throwable {
        Throwable th;
        Z z6;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f5710b;
        C3137A c3137a = C3137A.f25453a;
        l lVar = this.f5711c;
        try {
        } catch (Throwable th2) {
            Z z7 = lVar.f5715e;
            if (z7 == null) {
                throw th2;
            }
            this.f5709a = th2;
            this.f5710b = 4;
            z7.invoke(this);
            if (c3137a != aVar) {
                th = th2;
            }
            return aVar;
        }
        if (i6 == 0) {
            AbstractC2467b.l(obj);
            Y y6 = lVar.f5714d;
            if (y6 != null) {
                this.f5710b = 1;
                if (y6.invoke(this) == aVar) {
                }
                return aVar;
            }
        } else {
            if (i6 != 1) {
                if (i6 != 2) {
                    if (i6 == 3) {
                        AbstractC2467b.l(obj);
                        return c3137a;
                    }
                    if (i6 != 4) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    th = this.f5709a;
                    AbstractC2467b.l(obj);
                    throw th;
                }
                AbstractC2467b.l(obj);
                z6 = lVar.f5715e;
                if (z6 != null) {
                    this.f5710b = 3;
                    z6.invoke(this);
                    if (c3137a == aVar) {
                        return aVar;
                    }
                }
                return c3137a;
            }
            AbstractC2467b.l(obj);
        }
        R.f fVar = this.f5712d;
        this.f5710b = 2;
        if (fVar.a(lVar, this) != aVar) {
            z6 = lVar.f5715e;
            if (z6 != null) {
            }
            return c3137a;
        }
        return aVar;
    }
}
