package o;

import com.google.firebase.messaging.FirebaseMessaging;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class CB extends Sb0 implements SC {
    public final /* synthetic */ int p;
    public int q;
    public /* synthetic */ Object r;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ CB(int i, InterfaceC0220Im interfaceC0220Im, int i2) {
        super(i, interfaceC0220Im);
        this.p = i2;
    }

    @Override // o.SC
    public final Object f(Object obj, Object obj2) {
        InterfaceC0065Cn interfaceC0065Cn = (InterfaceC0065Cn) obj;
        InterfaceC0220Im interfaceC0220Im = (InterfaceC0220Im) obj2;
        switch (this.p) {
        }
        return ((CB) l(interfaceC0065Cn, interfaceC0220Im)).n(Oh0.a);
    }

    @Override // o.AbstractC0728ad
    public final InterfaceC0220Im l(Object obj, InterfaceC0220Im interfaceC0220Im) {
        switch (this.p) {
            case 0:
                CB cb = new CB(2, interfaceC0220Im, 0);
                cb.r = obj;
                return cb;
            default:
                CB cb2 = new CB(2, interfaceC0220Im, 1);
                cb2.r = obj;
                return cb2;
        }
    }

    @Override // o.AbstractC0728ad
    public final Object n(Object obj) {
        Object h20;
        FirebaseMessaging firebaseMessaging;
        InterfaceC0065Cn interfaceC0065Cn;
        switch (this.p) {
            case 0:
                EnumC0091Dn enumC0091Dn = EnumC0091Dn.l;
                int i = this.q;
                try {
                    if (i == 0) {
                        IJ.H(obj);
                        WT wt = FirebaseMessaging.l;
                        synchronized (FirebaseMessaging.class) {
                            firebaseMessaging = FirebaseMessaging.getInstance(C0076Cy.c());
                        }
                        firebaseMessaging.getClass();
                        Qc0 qc0 = new Qc0();
                        firebaseMessaging.f.execute(new O3(12, firebaseMessaging, qc0));
                        Hw0 hw0 = qc0.a;
                        this.q = 1;
                        obj = AbstractC0249Jp.q(hw0, this);
                        if (obj == enumC0091Dn) {
                            return enumC0091Dn;
                        }
                    } else {
                        if (i != 1) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        }
                        IJ.H(obj);
                    }
                    h20 = (String) obj;
                } catch (Throwable th) {
                    h20 = new H20(th);
                }
                if (I20.a(h20) != null) {
                    h20 = "";
                }
                return h20;
            default:
                EnumC0091Dn enumC0091Dn2 = EnumC0091Dn.l;
                int i2 = this.q;
                if (i2 == 0) {
                    IJ.H(obj);
                    interfaceC0065Cn = (InterfaceC0065Cn) this.r;
                } else {
                    if (i2 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    interfaceC0065Cn = (InterfaceC0065Cn) this.r;
                    IJ.H(obj);
                }
                while (AbstractC0752ap.R(interfaceC0065Cn.i())) {
                    C1072e7 c1072e7 = new C1072e7(23);
                    this.r = interfaceC0065Cn;
                    this.q = 1;
                    if (AbstractC2539te.D(this.m).w(c1072e7, this) == enumC0091Dn2) {
                        return enumC0091Dn2;
                    }
                }
                return Oh0.a;
        }
    }
}
