package pm;

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

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

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

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

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

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

    private static Object b(Object obj, Object obj2) {
        if (!(obj != f32929c) || 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.f32931b;
        Object obj2 = f32929c;
        if (obj == obj2) {
            synchronized (this) {
                obj = this.f32931b;
                if (obj == obj2) {
                    obj = this.f32930a.get();
                    this.f32931b = b(this.f32931b, obj);
                    this.f32930a = null;
                }
            }
        }
        return obj;
    }
}
