package kotlin.reflect.w.internal.y0.h;

import io.netty.handler.codec.dns.DefaultDnsRecordDecoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.o;

/* JADX INFO: loaded from: classes2.dex */
public final class d {
    public static final e a = e.k("<root>");

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final Pattern f8189b = Pattern.compile("\\.");

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final Function1<String, e> f8190c = new a();

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final String f8191d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public transient c f8192e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public transient d f8193f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public transient e f8194g;

    public static class a implements Function1<String, e> {
        @Override // kotlin.jvm.functions.Function1
        public e invoke(String str) {
            return e.h(str);
        }
    }

    public d(String str) {
        if (str != null) {
            this.f8191d = str;
        } else {
            a(2);
            throw null;
        }
    }

    public d(String str, c cVar) {
        if (str == null) {
            a(0);
            throw null;
        }
        this.f8191d = str;
        this.f8192e = cVar;
    }

    public d(String str, d dVar, e eVar) {
        if (str == null) {
            a(3);
            throw null;
        }
        this.f8191d = str;
        this.f8193f = dVar;
        this.f8194g = eVar;
    }

    public static /* synthetic */ void a(int i2) {
        String str;
        int i3;
        switch (i2) {
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 10:
            case 11:
            case 12:
            case 13:
            case 14:
            case 17:
                str = "@NotNull method %s.%s must not return null";
                break;
            case 9:
            case 15:
            case 16:
            default:
                str = "Argument for @NotNull parameter '%s' of %s.%s must not be null";
                break;
        }
        switch (i2) {
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 10:
            case 11:
            case 12:
            case 13:
            case 14:
            case 17:
                i3 = 2;
                break;
            case 9:
            case 15:
            case 16:
            default:
                i3 = 3;
                break;
        }
        Object[] objArr = new Object[i3];
        if (i2 != 1) {
            switch (i2) {
                case 4:
                case 5:
                case 6:
                case 7:
                case 8:
                case 10:
                case 11:
                case 12:
                case 13:
                case 14:
                case 17:
                    objArr[0] = "kotlin/reflect/jvm/internal/impl/name/FqNameUnsafe";
                    break;
                case 9:
                    objArr[0] = "name";
                    break;
                case 15:
                    objArr[0] = "segment";
                    break;
                case 16:
                    objArr[0] = "shortName";
                    break;
                default:
                    objArr[0] = "fqName";
                    break;
            }
        } else {
            objArr[0] = "safe";
        }
        switch (i2) {
            case 4:
                objArr[1] = "asString";
                break;
            case 5:
            case 6:
                objArr[1] = "toSafe";
                break;
            case 7:
            case 8:
                objArr[1] = "parent";
                break;
            case 9:
            case 15:
            case 16:
            default:
                objArr[1] = "kotlin/reflect/jvm/internal/impl/name/FqNameUnsafe";
                break;
            case 10:
            case 11:
                objArr[1] = "shortName";
                break;
            case 12:
            case 13:
                objArr[1] = "shortNameOrSpecial";
                break;
            case 14:
                objArr[1] = "pathSegments";
                break;
            case 17:
                objArr[1] = "toString";
                break;
        }
        switch (i2) {
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 10:
            case 11:
            case 12:
            case 13:
            case 14:
            case 17:
                break;
            case 9:
                objArr[2] = "child";
                break;
            case 15:
                objArr[2] = "startsWith";
                break;
            case 16:
                objArr[2] = "topLevel";
                break;
            default:
                objArr[2] = "<init>";
                break;
        }
        String str2 = String.format(str, objArr);
        switch (i2) {
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 10:
            case 11:
            case 12:
            case 13:
            case 14:
            case 17:
                throw new IllegalStateException(str2);
            case 9:
            case 15:
            case 16:
            default:
                throw new IllegalArgumentException(str2);
        }
    }

    public String b() {
        String str = this.f8191d;
        if (str != null) {
            return str;
        }
        a(4);
        throw null;
    }

    public d c(e eVar) {
        String strE;
        if (eVar == null) {
            a(9);
            throw null;
        }
        if (e()) {
            strE = eVar.e();
        } else {
            strE = this.f8191d + DefaultDnsRecordDecoder.ROOT + eVar.e();
        }
        return new d(strE, this, eVar);
    }

    public final void d() {
        int iLastIndexOf = this.f8191d.lastIndexOf(46);
        if (iLastIndexOf >= 0) {
            this.f8194g = e.h(this.f8191d.substring(iLastIndexOf + 1));
            this.f8193f = new d(this.f8191d.substring(0, iLastIndexOf));
        } else {
            this.f8194g = e.h(this.f8191d);
            this.f8193f = c.a.j();
        }
    }

    public boolean e() {
        return this.f8191d.isEmpty();
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        return (obj instanceof d) && this.f8191d.equals(((d) obj).f8191d);
    }

    public boolean f() {
        return this.f8192e != null || b().indexOf(60) < 0;
    }

    public List<e> g() {
        List<e> listEmptyList;
        if (e()) {
            listEmptyList = Collections.emptyList();
        } else {
            String[] strArrSplit = f8189b.split(this.f8191d);
            Function1<String, e> function1 = f8190c;
            o.f(strArrSplit, "<this>");
            o.f(function1, "transform");
            ArrayList arrayList = new ArrayList(strArrSplit.length);
            for (String str : strArrSplit) {
                arrayList.add(function1.invoke(str));
            }
            listEmptyList = arrayList;
        }
        if (listEmptyList != null) {
            return listEmptyList;
        }
        a(14);
        throw null;
    }

    public e h() {
        e eVar = this.f8194g;
        if (eVar != null) {
            if (eVar != null) {
                return eVar;
            }
            a(10);
            throw null;
        }
        if (e()) {
            throw new IllegalStateException("root");
        }
        d();
        e eVar2 = this.f8194g;
        if (eVar2 != null) {
            return eVar2;
        }
        a(11);
        throw null;
    }

    public int hashCode() {
        return this.f8191d.hashCode();
    }

    public c i() {
        c cVar = this.f8192e;
        if (cVar != null) {
            if (cVar != null) {
                return cVar;
            }
            a(5);
            throw null;
        }
        c cVar2 = new c(this);
        this.f8192e = cVar2;
        if (cVar2 != null) {
            return cVar2;
        }
        a(6);
        throw null;
    }

    public String toString() {
        String strE = e() ? a.e() : this.f8191d;
        if (strE != null) {
            return strE;
        }
        a(17);
        throw null;
    }
}
