package T4;

import z6.InterfaceC1796a;

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

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

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

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

    public a(InterfaceC1796a interfaceC1796a) {
        this.f6595a = interfaceC1796a;
    }

    public static InterfaceC1796a a(b bVar) {
        return bVar instanceof a ? bVar : new a(bVar);
    }

    @Override // z6.InterfaceC1796a
    public final Object get() {
        Object obj;
        Object obj2 = this.f6596b;
        Object obj3 = f6594c;
        if (obj2 != obj3) {
            return obj2;
        }
        synchronized (this) {
            try {
                obj = this.f6596b;
                if (obj == obj3) {
                    obj = this.f6595a.get();
                    Object obj4 = this.f6596b;
                    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.f6596b = obj;
                    this.f6595a = null;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return obj;
    }
}
