package bk;

/* loaded from: classes3.dex */
public final class i implements m {

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

    /* renamed from: a, reason: collision with root package name */
    private volatile m f6958a;

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

    private i(m mVar) {
        this.f6958a = mVar;
    }

    public static m b(m mVar) {
        return mVar instanceof i ? mVar : new i(mVar);
    }

    @Override // bk.m
    public final Object a() {
        Object obj = this.f6959b;
        Object obj2 = f6957c;
        if (obj == obj2) {
            synchronized (this) {
                obj = this.f6959b;
                if (obj == obj2) {
                    obj = this.f6958a.a();
                    Object obj3 = this.f6959b;
                    if (obj3 != obj2 && obj3 != obj) {
                        throw new IllegalStateException("Scoped provider was invoked recursively returning different results: " + obj3 + " & " + obj + ". This is likely due to a circular dependency.");
                    }
                    this.f6959b = obj;
                    this.f6958a = null;
                }
            }
        }
        return obj;
    }
}
