package B2;

import z6.InterfaceC1796a;

/* JADX INFO: loaded from: classes.dex */
public final class a implements InterfaceC1796a {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final Object f968c = new Object();

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public volatile b f969a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public volatile Object f970b;

    public static InterfaceC1796a a(b bVar) {
        if (bVar instanceof a) {
            return bVar;
        }
        a aVar = new a();
        aVar.f970b = f968c;
        aVar.f969a = bVar;
        return aVar;
    }

    @Override // z6.InterfaceC1796a
    public final Object get() {
        Object obj;
        Object obj2 = this.f970b;
        Object obj3 = f968c;
        if (obj2 != obj3) {
            return obj2;
        }
        synchronized (this) {
            try {
                obj = this.f970b;
                if (obj == obj3) {
                    obj = this.f969a.get();
                    Object obj4 = this.f970b;
                    if (obj4 != obj3 && obj4 != obj) {
                        throw new IllegalStateException("Scoped provider was invoked recursively returning different results: " + obj4 + " & " + obj + ". This is likely due to a circular dependency.");
                    }
                    this.f970b = obj;
                    this.f969a = null;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return obj;
    }
}
