package ko;

import ko.o;

/* loaded from: classes3.dex */
final class q implements p {

    /* renamed from: a, reason: collision with root package name */
    public static final q f26150a = new q();

    /* loaded from: classes3.dex */
    public /* synthetic */ class a {

        /* renamed from: a, reason: collision with root package name */
        public static final /* synthetic */ int[] f26151a;

        static {
            int[] iArr = new int[qn.h.values().length];
            try {
                iArr[qn.h.BOOLEAN.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[qn.h.CHAR.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                iArr[qn.h.BYTE.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                iArr[qn.h.SHORT.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                iArr[qn.h.INT.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                iArr[qn.h.FLOAT.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                iArr[qn.h.LONG.ordinal()] = 7;
            } catch (NoSuchFieldError unused7) {
            }
            try {
                iArr[qn.h.DOUBLE.ordinal()] = 8;
            } catch (NoSuchFieldError unused8) {
            }
            f26151a = iArr;
        }
    }

    private q() {
    }

    @Override // ko.p
    /* renamed from: g, reason: merged with bridge method [inline-methods] */
    public o d(o possiblyPrimitiveType) {
        kotlin.jvm.internal.t.g(possiblyPrimitiveType, "possiblyPrimitiveType");
        if (!(possiblyPrimitiveType instanceof o.d)) {
            return possiblyPrimitiveType;
        }
        o.d dVar = (o.d) possiblyPrimitiveType;
        if (dVar.i() == null) {
            return possiblyPrimitiveType;
        }
        String f10 = yo.d.c(dVar.i().getWrapperFqName()).f();
        kotlin.jvm.internal.t.f(f10, "getInternalName(...)");
        return c(f10);
    }

    @Override // ko.p
    /* renamed from: h, reason: merged with bridge method [inline-methods] */
    public o b(String representation) {
        yo.e eVar;
        kotlin.jvm.internal.t.g(representation, "representation");
        representation.length();
        char charAt = representation.charAt(0);
        yo.e[] values = yo.e.values();
        int length = values.length;
        int i10 = 0;
        while (true) {
            if (i10 >= length) {
                eVar = null;
                break;
            }
            eVar = values[i10];
            if (eVar.getDesc().charAt(0) == charAt) {
                break;
            }
            i10++;
        }
        if (eVar != null) {
            return new o.d(eVar);
        }
        if (charAt == 'V') {
            return new o.d(null);
        }
        if (charAt == '[') {
            String substring = representation.substring(1);
            kotlin.jvm.internal.t.f(substring, "substring(...)");
            return new o.a(b(substring));
        }
        if (charAt == 'L') {
            kotlin.text.z.X(representation, ';', false, 2, null);
        }
        String substring2 = representation.substring(1, representation.length() - 1);
        kotlin.jvm.internal.t.f(substring2, "substring(...)");
        return new o.c(substring2);
    }

    @Override // ko.p
    /* renamed from: i, reason: merged with bridge method [inline-methods] */
    public o.c c(String internalName) {
        kotlin.jvm.internal.t.g(internalName, "internalName");
        return new o.c(internalName);
    }

    @Override // ko.p
    /* renamed from: j, reason: merged with bridge method [inline-methods] */
    public o e(qn.h primitiveType) {
        kotlin.jvm.internal.t.g(primitiveType, "primitiveType");
        switch (a.f26151a[primitiveType.ordinal()]) {
            case 1:
                return o.f26138a.a();
            case 2:
                return o.f26138a.c();
            case 3:
                return o.f26138a.b();
            case 4:
                return o.f26138a.h();
            case 5:
                return o.f26138a.f();
            case 6:
                return o.f26138a.e();
            case 7:
                return o.f26138a.g();
            case 8:
                return o.f26138a.d();
            default:
                throw new rm.t();
        }
    }

    @Override // ko.p
    /* renamed from: k, reason: merged with bridge method [inline-methods] */
    public o f() {
        return c("java/lang/Class");
    }

    @Override // ko.p
    /* renamed from: l, reason: merged with bridge method [inline-methods] */
    public String a(o type) {
        String desc;
        kotlin.jvm.internal.t.g(type, "type");
        if (type instanceof o.a) {
            return '[' + a(((o.a) type).i());
        }
        if (type instanceof o.d) {
            yo.e i10 = ((o.d) type).i();
            return (i10 == null || (desc = i10.getDesc()) == null) ? "V" : desc;
        }
        if (!(type instanceof o.c)) {
            throw new rm.t();
        }
        return 'L' + ((o.c) type).i() + ';';
    }
}
