package kotlin.reflect.w.internal;

import java.lang.ref.SoftReference;
import kotlin.jvm.functions.Function0;

/* JADX INFO: loaded from: classes.dex */
public class n0<T> extends p0<T> implements Function0<T> {

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final Function0<T> f6362m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public volatile SoftReference<Object> f6363n;

    public n0(T t2, Function0<T> function0) {
        if (function0 == null) {
            throw new IllegalArgumentException(String.format("Argument for @NotNull parameter '%s' of %s.%s must not be null", "initializer", "kotlin/reflect/jvm/internal/ReflectProperties$LazySoftVal", "<init>"));
        }
        this.f6363n = null;
        this.f6362m = function0;
        if (t2 != null) {
            this.f6363n = new SoftReference<>(t2);
        }
    }

    @Override // kotlin.jvm.functions.Function0
    public T invoke() {
        T t2;
        SoftReference<Object> softReference = this.f6363n;
        if (softReference == null || (t2 = (T) softReference.get()) == null) {
            T tInvoke = this.f6362m.invoke();
            this.f6363n = new SoftReference<>(tInvoke == null ? p0.f6375f : tInvoke);
            return tInvoke;
        }
        if (t2 == p0.f6375f) {
            return null;
        }
        return t2;
    }
}
