package ki;

/* loaded from: classes.dex */
public final class a implements qm.a {

    /* renamed from: c, reason: collision with root package name */
    private static final Object f25853c = new Object();

    /* renamed from: a, reason: collision with root package name */
    private volatile qm.a f25854a;

    /* renamed from: b, reason: collision with root package name */
    private volatile Object f25855b = f25853c;

    private a(qm.a aVar) {
        this.f25854a = aVar;
    }

    public static qm.a a(qm.a aVar) {
        d.b(aVar);
        return aVar instanceof a ? aVar : new a(aVar);
    }

    private static Object b(Object obj, Object obj2) {
        if (!(obj != f25853c) || obj == obj2) {
            return obj2;
        }
        throw new IllegalStateException("Scoped provider was invoked recursively returning different results: " + obj + " & " + obj2 + ". This is likely due to a circular dependency.");
    }

    @Override // qm.a
    public Object get() {
        Object obj = this.f25855b;
        Object obj2 = f25853c;
        if (obj == obj2) {
            synchronized (this) {
                obj = this.f25855b;
                if (obj == obj2) {
                    obj = this.f25854a.get();
                    this.f25855b = b(this.f25855b, obj);
                    this.f25854a = null;
                }
            }
        }
        return obj;
    }
}
