package l5;

import F.g0;
import I2.W;
import T0.C0606q;
import x4.C3249o;

/* JADX INFO: renamed from: l5.c, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC2458c {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final C2457b f20332d = new C2457b(new j(false, true, "    ", "type", true, EnumC2456a.f20330b), n5.f.f21779a);

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final j f20333a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final C0606q f20334b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final l2.c f20335c = new l2.c(7);

    public AbstractC2458c(j jVar, C0606q c0606q) {
        this.f20333a = jVar;
        this.f20334b = c0606q;
    }

    public final Object a(g5.a deserializer, m element) {
        j5.c nVar;
        kotlin.jvm.internal.o.h(deserializer, "deserializer");
        kotlin.jvm.internal.o.h(element, "element");
        String str = null;
        if (element instanceof y) {
            nVar = new m5.p(this, (y) element, str, 12);
        } else if (element instanceof e) {
            nVar = new m5.q(this, (e) element);
        } else {
            if (!(element instanceof s) && !element.equals(v.INSTANCE)) {
                throw new E3.v();
            }
            nVar = new m5.n(this, (C) element, null);
        }
        return nVar.u(deserializer);
    }

    public final Object b(g5.a deserializer, String string) {
        kotlin.jvm.internal.o.h(deserializer, "deserializer");
        kotlin.jvm.internal.o.h(string, "string");
        m5.y yVar = new m5.y(string);
        Object objU = new m5.v(this, m5.A.f21228c, yVar, deserializer.getDescriptor(), null).u(deserializer);
        if (yVar.e() == 10) {
            return objU;
        }
        m5.y.m(yVar, "Expected EOF after parsing, but had " + string.charAt(yVar.f21304b - 1) + " instead", 0, null, 6);
        throw null;
    }

    public final m c(g5.a serializer, Object obj) {
        kotlin.jvm.internal.o.h(serializer, "serializer");
        kotlin.jvm.internal.C c6 = new kotlin.jvm.internal.C();
        new m5.o(this, new g0(c6, 1), 1).s(serializer, obj);
        Object obj2 = c6.f20115a;
        if (obj2 != null) {
            return (m) obj2;
        }
        kotlin.jvm.internal.o.n("result");
        throw null;
    }

    public final String d(g5.a serializer, Object obj) {
        char[] cArr;
        kotlin.jvm.internal.o.h(serializer, "serializer");
        C1.k kVar = new C1.k(5, false);
        m5.d dVar = m5.d.f21245c;
        synchronized (dVar) {
            C3249o c3249o = (C3249o) dVar.f1379b;
            cArr = null;
            char[] cArr2 = (char[]) (c3249o.isEmpty() ? null : c3249o.removeLast());
            if (cArr2 != null) {
                dVar.f1378a -= cArr2.length;
                cArr = cArr2;
            }
        }
        if (cArr == null) {
            cArr = new char[128];
        }
        kVar.f691c = cArr;
        try {
            new m5.w(new W(kVar), this, m5.A.f21228c, new q[m5.A.f21233k.size()]).s(serializer, obj);
            return kVar.toString();
        } finally {
            kVar.i();
        }
    }
}
