package o;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Zd0 extends Sb0 implements SC {
    public InterfaceC1191fR p;
    public int q;
    public final /* synthetic */ InterfaceC1191fR r;
    public final /* synthetic */ boolean s;
    public final /* synthetic */ KQ t;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public Zd0(InterfaceC1191fR interfaceC1191fR, boolean z, KQ kq, InterfaceC0220Im interfaceC0220Im) {
        super(2, interfaceC0220Im);
        this.r = interfaceC1191fR;
        this.s = z;
        this.t = kq;
    }

    @Override // o.SC
    public final Object f(Object obj, Object obj2) {
        return ((Zd0) l((InterfaceC0065Cn) obj, (InterfaceC0220Im) obj2)).n(Oh0.a);
    }

    @Override // o.AbstractC0728ad
    public final InterfaceC0220Im l(Object obj, InterfaceC0220Im interfaceC0220Im) {
        return new Zd0(this.r, this.s, this.t, interfaceC0220Im);
    }

    @Override // o.AbstractC0728ad
    public final Object n(Object obj) throws Throwable {
        InterfaceC1191fR interfaceC1191fR;
        int i = this.q;
        if (i == 0) {
            IJ.H(obj);
            interfaceC1191fR = this.r;
            AY ay = (AY) interfaceC1191fR.getValue();
            if (ay != null) {
                InterfaceC1849mI by = this.s ? new BY(ay) : new C3099zY(ay);
                KQ kq = this.t;
                if (kq != null) {
                    this.p = interfaceC1191fR;
                    this.q = 1;
                    Object objA = kq.a(by, this);
                    EnumC0091Dn enumC0091Dn = EnumC0091Dn.l;
                    if (objA == enumC0091Dn) {
                        return enumC0091Dn;
                    }
                }
            }
            return Oh0.a;
        }
        if (i != 1) {
            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
        }
        interfaceC1191fR = this.p;
        IJ.H(obj);
        interfaceC1191fR.setValue(null);
        return Oh0.a;
    }
}
