package C3;

/* JADX INFO: loaded from: classes3.dex */
public final class h implements k {

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

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

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

    /* JADX WARN: Multi-variable type inference failed */
    public static h b(i iVar) {
        if (iVar instanceof h) {
            return (h) iVar;
        }
        h hVar = new h();
        hVar.f732b = f730c;
        hVar.f731a = iVar;
        return hVar;
    }

    @Override // C3.k
    public final Object a() {
        Object objA;
        Object obj = this.f732b;
        Object obj2 = f730c;
        if (obj != obj2) {
            return obj;
        }
        synchronized (this) {
            try {
                objA = this.f732b;
                if (objA == obj2) {
                    objA = this.f731a.a();
                    Object obj3 = this.f732b;
                    if (obj3 != obj2 && obj3 != objA) {
                        throw new IllegalStateException("Scoped provider was invoked recursively returning different results: " + obj3 + " & " + objA + ". This is likely due to a circular dependency.");
                    }
                    this.f732b = objA;
                    this.f731a = null;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return objA;
    }
}
