package l;

import androidx.exifinterface.media.ExifInterface;
import androidx.media3.session.SessionToken;
import com.jsyn.unitgen.u;
import d.AbstractC0421a;
import d.C0422b;
import d.C0424d;
import d.C0425e;
import d.C0426f;
import d.EnumC0439l;
import e.InterfaceC0451b;
import g.C0474a;
import g.EnumC0475b;
import h.o;
import h.t;
import i.C0536p;
import i.a0;
import i.f0;
import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Proxy;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.file.Path;
import java.security.AccessControlException;
import java.sql.Clob;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Currency;
import java.util.Date;
import java.util.Deque;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.UUID;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import kotlin.ranges.c;
import kotlin.ranges.i;
import kotlin.ranges.l;
import okhttp3.HttpUrl;

/* JADX INFO: loaded from: classes.dex */
public abstract class l {

    /* JADX INFO: renamed from: A, reason: collision with root package name */
    private static volatile Map f5315A;

    /* JADX INFO: renamed from: B, reason: collision with root package name */
    private static volatile boolean f5316B;

    /* JADX INFO: renamed from: D, reason: collision with root package name */
    private static Class f5318D;

    /* JADX INFO: renamed from: P, reason: collision with root package name */
    private static Class f5330P;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static boolean f5332b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static boolean f5333c;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private static Method f5336f;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private static Method f5338h;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private static Class f5340j;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    private static Class f5342l;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    private static volatile Class f5349s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    private static volatile boolean f5350t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    private static volatile boolean f5351u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    private static volatile Constructor f5352v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    private static volatile Method f5353w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    private static volatile Method f5354x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    private static volatile Method f5355y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    private static volatile boolean f5356z;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private static final Pattern f5331a = Pattern.compile("\\.0*$");

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private static boolean f5334d = true;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private static boolean f5335e = false;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private static boolean f5337g = false;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private static boolean f5339i = false;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    private static boolean f5341k = false;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    private static Class f5343m = null;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    private static boolean f5344n = false;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    private static Class f5345o = null;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    private static boolean f5346p = false;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    private static Method f5347q = null;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    private static boolean f5348r = false;

    /* JADX INFO: renamed from: C, reason: collision with root package name */
    private static ConcurrentMap f5317C = new ConcurrentHashMap(256, 0.75f, 1);

    /* JADX INFO: renamed from: E, reason: collision with root package name */
    private static boolean f5319E = false;

    /* JADX INFO: renamed from: F, reason: collision with root package name */
    private static Class f5320F = null;

    /* JADX INFO: renamed from: G, reason: collision with root package name */
    private static boolean f5321G = false;

    /* JADX INFO: renamed from: H, reason: collision with root package name */
    private static volatile Class f5322H = null;

    /* JADX INFO: renamed from: I, reason: collision with root package name */
    private static volatile boolean f5323I = false;

    /* JADX INFO: renamed from: J, reason: collision with root package name */
    private static volatile Class f5324J = null;

    /* JADX INFO: renamed from: K, reason: collision with root package name */
    private static volatile Class f5325K = null;

    /* JADX INFO: renamed from: L, reason: collision with root package name */
    private static volatile boolean f5326L = false;

    /* JADX INFO: renamed from: M, reason: collision with root package name */
    private static volatile Method f5327M = null;

    /* JADX INFO: renamed from: N, reason: collision with root package name */
    private static volatile Field f5328N = null;

    /* JADX INFO: renamed from: O, reason: collision with root package name */
    private static volatile Object f5329O = null;

    static {
        f5332b = false;
        f5333c = false;
        f5330P = null;
        try {
            f5332b = "true".equals(AbstractC0613e.g("fastjson.compatibleWithJavaBean"));
            f5333c = "true".equals(AbstractC0613e.g("fastjson.compatibleWithFieldName"));
        } catch (Throwable unused) {
        }
        try {
            f5330P = Deque.class;
        } catch (Throwable unused2) {
        }
        a();
    }

    public static String A(Object obj) {
        if (obj == null) {
            return null;
        }
        return obj.toString();
    }

    public static Class A0(String str, ClassLoader classLoader) {
        return B0(str, classLoader, false);
    }

    public static Timestamp B(Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof Calendar) {
            return new Timestamp(((Calendar) obj).getTimeInMillis());
        }
        if (obj instanceof Timestamp) {
            return (Timestamp) obj;
        }
        if (obj instanceof Date) {
            return new Timestamp(((Date) obj).getTime());
        }
        long jD0 = obj instanceof BigDecimal ? D0((BigDecimal) obj) : obj instanceof Number ? ((Number) obj).longValue() : 0L;
        if (obj instanceof String) {
            String strSubstring = (String) obj;
            if (strSubstring.length() == 0 || "null".equals(strSubstring) || "NULL".equals(strSubstring)) {
                return null;
            }
            if (strSubstring.endsWith(".000000000")) {
                strSubstring = strSubstring.substring(0, strSubstring.length() - 10);
            } else if (strSubstring.endsWith(".000000")) {
                strSubstring = strSubstring.substring(0, strSubstring.length() - 7);
            }
            if (strSubstring.length() == 29 && strSubstring.charAt(4) == '-' && strSubstring.charAt(7) == '-' && strSubstring.charAt(10) == ' ' && strSubstring.charAt(13) == ':' && strSubstring.charAt(16) == ':' && strSubstring.charAt(19) == '.') {
                return new Timestamp(G0(strSubstring.charAt(0), strSubstring.charAt(1), strSubstring.charAt(2), strSubstring.charAt(3)) - 1900, F0(strSubstring.charAt(5), strSubstring.charAt(6)) - 1, F0(strSubstring.charAt(8), strSubstring.charAt(9)), F0(strSubstring.charAt(11), strSubstring.charAt(12)), F0(strSubstring.charAt(14), strSubstring.charAt(15)), F0(strSubstring.charAt(17), strSubstring.charAt(18)), H0(strSubstring.charAt(20), strSubstring.charAt(21), strSubstring.charAt(22), strSubstring.charAt(23), strSubstring.charAt(24), strSubstring.charAt(25), strSubstring.charAt(26), strSubstring.charAt(27), strSubstring.charAt(28)));
            }
            if (u0(strSubstring)) {
                jD0 = Long.parseLong(strSubstring);
            } else {
                g.f fVar = new g.f(strSubstring);
                if (!fVar.Y0(false)) {
                    throw new C0424d("can not cast to Timestamp, value : " + strSubstring);
                }
                jD0 = fVar.k0().getTime().getTime();
            }
        }
        if (jD0 >= 0) {
            return new Timestamp(jD0);
        }
        throw new C0424d("can not cast to Timestamp, value : " + obj);
    }

    public static Class B0(String str, ClassLoader classLoader, boolean z2) {
        if (str == null || str.length() == 0 || str.length() > 128) {
            return null;
        }
        Class<?> clsLoadClass = (Class) f5317C.get(str);
        if (clsLoadClass != null) {
            return clsLoadClass;
        }
        if (str.charAt(0) == '[') {
            return Array.newInstance((Class<?>) A0(str.substring(1), classLoader), 0).getClass();
        }
        if (str.startsWith("L") && str.endsWith(";")) {
            return A0(str.substring(1, str.length() - 1), classLoader);
        }
        if (classLoader != null) {
            try {
                clsLoadClass = classLoader.loadClass(str);
                if (z2) {
                    f5317C.put(str, clsLoadClass);
                }
                return clsLoadClass;
            } catch (Throwable th) {
                th.printStackTrace();
            }
        }
        try {
            ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
            if (contextClassLoader != null && contextClassLoader != classLoader) {
                clsLoadClass = contextClassLoader.loadClass(str);
                if (z2) {
                    f5317C.put(str, clsLoadClass);
                }
                return clsLoadClass;
            }
        } catch (Throwable unused) {
        }
        try {
            clsLoadClass = Class.forName(str);
            if (z2) {
                f5317C.put(str, clsLoadClass);
            }
        } catch (Throwable unused2) {
        }
        return clsLoadClass;
    }

    private static void C(Class cls, Map map, EnumC0439l enumC0439l, Map map2, Field[] fieldArr) {
        String strLabel;
        int i2;
        int i3;
        int i4;
        for (Field field : fieldArr) {
            if (!Modifier.isStatic(field.getModifiers())) {
                InterfaceC0451b interfaceC0451b = (InterfaceC0451b) N(field, InterfaceC0451b.class);
                String name = field.getName();
                if (interfaceC0451b == null) {
                    strLabel = null;
                    i2 = 0;
                    i3 = 0;
                    i4 = 0;
                } else if (interfaceC0451b.serialize()) {
                    int iOrdinal = interfaceC0451b.ordinal();
                    int iOf = f0.of(interfaceC0451b.serialzeFeatures());
                    int iOf2 = EnumC0475b.of(interfaceC0451b.parseFeatures());
                    if (interfaceC0451b.name().length() != 0) {
                        name = interfaceC0451b.name();
                    }
                    strLabel = interfaceC0451b.label().length() != 0 ? interfaceC0451b.label() : null;
                    i2 = iOrdinal;
                    i3 = iOf;
                    i4 = iOf2;
                }
                if (map == null || (name = (String) map.get(name)) != null) {
                    if (enumC0439l != null) {
                        name = enumC0439l.translate(name);
                    }
                    String str = name;
                    if (!map2.containsKey(str)) {
                        map2.put(str, new C0611c(str, null, field, cls, null, i2, i3, i4, null, interfaceC0451b, strLabel));
                    }
                }
            }
        }
    }

    public static long C0(Number number) {
        return number instanceof BigDecimal ? ((BigDecimal) number).longValueExact() : number.longValue();
    }

    /* JADX WARN: Code restructure failed: missing block: B:138:0x02ad, code lost:
    
        if (r2 == null) goto L97;
     */
    /* JADX WARN: Code restructure failed: missing block: B:243:0x04ba, code lost:
    
        if (r1 == null) goto L197;
     */
    /* JADX WARN: Removed duplicated region for block: B:148:0x02ce  */
    /* JADX WARN: Removed duplicated region for block: B:196:0x03e3  */
    /* JADX WARN: Removed duplicated region for block: B:228:0x046e  */
    /* JADX WARN: Removed duplicated region for block: B:97:0x01f8 A[PHI: r9 r13 r31 r32
      0x01f8: PHI (r9v8 java.util.LinkedHashMap) = 
      (r9v4 java.util.LinkedHashMap)
      (r9v4 java.util.LinkedHashMap)
      (r9v4 java.util.LinkedHashMap)
      (r9v4 java.util.LinkedHashMap)
      (r9v4 java.util.LinkedHashMap)
      (r9v4 java.util.LinkedHashMap)
      (r9v11 java.util.LinkedHashMap)
     binds: [B:106:0x0239, B:109:0x0242, B:146:0x02ca, B:164:0x0307, B:138:0x02ad, B:114:0x0251, B:96:0x01ca] A[DONT_GENERATE, DONT_INLINE]
      0x01f8: PHI (r13v25 int) = (r13v4 int), (r13v4 int), (r13v4 int), (r13v4 int), (r13v4 int), (r13v4 int), (r13v29 int) binds: [B:106:0x0239, B:109:0x0242, B:146:0x02ca, B:164:0x0307, B:138:0x02ad, B:114:0x0251, B:96:0x01ca] A[DONT_GENERATE, DONT_INLINE]
      0x01f8: PHI (r31v4 int) = (r31v3 int), (r31v3 int), (r31v3 int), (r31v3 int), (r31v3 int), (r31v3 int), (r31v7 int) binds: [B:106:0x0239, B:109:0x0242, B:146:0x02ca, B:164:0x0307, B:138:0x02ad, B:114:0x0251, B:96:0x01ca] A[DONT_GENERATE, DONT_INLINE]
      0x01f8: PHI (r32v4 java.lang.reflect.Method[]) = 
      (r32v3 java.lang.reflect.Method[])
      (r32v3 java.lang.reflect.Method[])
      (r32v3 java.lang.reflect.Method[])
      (r32v3 java.lang.reflect.Method[])
      (r32v3 java.lang.reflect.Method[])
      (r32v3 java.lang.reflect.Method[])
      (r32v7 java.lang.reflect.Method[])
     binds: [B:106:0x0239, B:109:0x0242, B:146:0x02ca, B:164:0x0307, B:138:0x02ad, B:114:0x0251, B:96:0x01ca] A[DONT_GENERATE, DONT_INLINE]] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static java.util.List D(java.lang.Class r39, e.d r40, java.util.Map r41, java.util.Map r42, boolean r43, d.EnumC0439l r44) {
        /*
            Method dump skipped, instruction units count: 1352
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: l.l.D(java.lang.Class, e.d, java.util.Map, java.util.Map, boolean, d.l):java.util.List");
    }

    public static long D0(BigDecimal bigDecimal) {
        if (bigDecimal == null) {
            return 0L;
        }
        int iScale = bigDecimal.scale();
        return (iScale < -100 || iScale > 100) ? bigDecimal.longValueExact() : bigDecimal.longValue();
    }

    public static List E(Class cls, Map map, boolean z2, EnumC0439l enumC0439l) {
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        for (Class superclass = cls; superclass != null; superclass = superclass.getSuperclass()) {
            C(superclass, map, enumC0439l, linkedHashMap, superclass.getDeclaredFields());
        }
        return X(cls, z2, linkedHashMap);
    }

    private static ParameterizedType E0(Class cls, Type[] typeArr, Map map) {
        int length = typeArr.length;
        Type[] typeArr2 = new Type[length];
        for (int i2 = 0; i2 < length; i2++) {
            typeArr2[i2] = L(typeArr[i2], map);
        }
        return new C0616h(typeArr2, null, cls);
    }

    private static Map F(TypeVariable[] typeVariableArr, Type[] typeArr) {
        int length = typeVariableArr.length;
        HashMap map = new HashMap(length);
        for (int i2 = 0; i2 < length; i2++) {
            map.put(typeVariableArr[i2], typeArr[i2]);
        }
        return map;
    }

    static int F0(char c2, char c3) {
        if (c2 < '0' || c2 > '9' || c3 < '0' || c3 > '9') {
            return -1;
        }
        return ((c2 - '0') * 10) + (c3 - '0');
    }

    public static Collection G(Type type) {
        Class<?> cls;
        Class clsH0 = h0(type);
        if (clsH0 == AbstractCollection.class || clsH0 == Collection.class) {
            return new ArrayList();
        }
        if (clsH0.isAssignableFrom(HashSet.class)) {
            return new HashSet();
        }
        if (clsH0.isAssignableFrom(LinkedHashSet.class)) {
            return new LinkedHashSet();
        }
        if (clsH0.isAssignableFrom(TreeSet.class)) {
            return new TreeSet();
        }
        if (clsH0.isAssignableFrom(ArrayList.class)) {
            return new ArrayList();
        }
        if (clsH0.isAssignableFrom(EnumSet.class)) {
            return EnumSet.noneOf((Class) (type instanceof ParameterizedType ? ((ParameterizedType) type).getActualTypeArguments()[0] : Object.class));
        }
        if (clsH0.isAssignableFrom(Queue.class) || ((cls = f5330P) != null && clsH0.isAssignableFrom(cls))) {
            return new LinkedList();
        }
        try {
            return (Collection) clsH0.newInstance();
        } catch (Exception unused) {
            throw new C0424d("create instance error, class " + clsH0.getName());
        }
    }

    static int G0(char c2, char c3, char c4, char c5) {
        if (c2 < '0' || c2 > '9' || c3 < '0' || c3 > '9' || c4 < '0' || c4 > '9' || c5 < '0' || c5 > '9') {
            return -1;
        }
        return ((c2 - '0') * 1000) + ((c3 - '0') * 100) + ((c4 - '0') * 10) + (c5 - '0');
    }

    public static String H(String str) {
        if (str == null || str.length() == 0) {
            return str;
        }
        if (str.length() > 1 && Character.isUpperCase(str.charAt(1)) && Character.isUpperCase(str.charAt(0))) {
            return str;
        }
        char[] charArray = str.toCharArray();
        charArray[0] = Character.toLowerCase(charArray[0]);
        return new String(charArray);
    }

    static int H0(char c2, char c3, char c4, char c5, char c6, char c7, char c8, char c9, char c10) {
        if (c2 < '0' || c2 > '9' || c3 < '0' || c3 > '9' || c4 < '0' || c4 > '9' || c5 < '0' || c5 > '9' || c6 < '0' || c6 > '9' || c7 < '0' || c7 > '9' || c8 < '0' || c8 > '9' || c9 < '0' || c9 > '9' || c10 < '0' || c10 > '9') {
            return -1;
        }
        return ((c2 - '0') * 100000000) + ((c3 - '0') * 10000000) + ((c4 - '0') * SessionToken.UNKNOWN_SESSION_VERSION) + ((c5 - '0') * 100000) + ((c6 - '0') * 10000) + ((c7 - '0') * 1000) + ((c8 - '0') * 100) + ((c9 - '0') * 10) + (c10 - '0');
    }

    public static long I(String str) {
        long jCharAt = -3750763034362895579L;
        for (int i2 = 0; i2 < str.length(); i2++) {
            jCharAt = (jCharAt ^ ((long) str.charAt(i2))) * 1099511628211L;
        }
        return jCharAt;
    }

    public static double I0(String str) {
        double d2;
        double d3;
        int length = str.length();
        if (length > 10) {
            return Double.parseDouble(str);
        }
        long j2 = 0;
        boolean z2 = false;
        int i2 = 0;
        for (int i3 = 0; i3 < length; i3++) {
            char cCharAt = str.charAt(i3);
            if (cCharAt == '-' && i3 == 0) {
                z2 = true;
            } else if (cCharAt == '.') {
                if (i2 != 0) {
                    return Double.parseDouble(str);
                }
                i2 = (length - i3) - 1;
            } else {
                if (cCharAt < '0' || cCharAt > '9') {
                    return Double.parseDouble(str);
                }
                j2 = (j2 * 10) + ((long) (cCharAt - '0'));
            }
        }
        if (z2) {
            j2 = -j2;
        }
        switch (i2) {
            case 0:
                return j2;
            case 1:
                d2 = j2;
                d3 = 10.0d;
                break;
            case 2:
                d2 = j2;
                d3 = 100.0d;
                break;
            case 3:
                d2 = j2;
                d3 = 1000.0d;
                break;
            case 4:
                d2 = j2;
                d3 = 10000.0d;
                break;
            case 5:
                d2 = j2;
                d3 = 100000.0d;
                break;
            case 6:
                d2 = j2;
                d3 = 1000000.0d;
                break;
            case 7:
                d2 = j2;
                d3 = 1.0E7d;
                break;
            case 8:
                d2 = j2;
                d3 = 1.0E8d;
                break;
            case 9:
                d2 = j2;
                d3 = 1.0E9d;
                break;
            default:
                return Double.parseDouble(str);
        }
        return d2 / d3;
    }

    public static long J(String str) {
        long jCharAt = -3750763034362895579L;
        for (int i2 = 0; i2 < str.length(); i2++) {
            jCharAt = (jCharAt ^ ((long) str.charAt(i2))) * 1099511628211L;
        }
        return jCharAt;
    }

    public static float J0(String str) {
        float f2;
        float f3;
        int length = str.length();
        if (length >= 10) {
            return Float.parseFloat(str);
        }
        long j2 = 0;
        boolean z2 = false;
        int i2 = 0;
        for (int i3 = 0; i3 < length; i3++) {
            char cCharAt = str.charAt(i3);
            if (cCharAt == '-' && i3 == 0) {
                z2 = true;
            } else if (cCharAt == '.') {
                if (i2 != 0) {
                    return Float.parseFloat(str);
                }
                i2 = (length - i3) - 1;
            } else {
                if (cCharAt < '0' || cCharAt > '9') {
                    return Float.parseFloat(str);
                }
                j2 = (j2 * 10) + ((long) (cCharAt - '0'));
            }
        }
        if (z2) {
            j2 = -j2;
        }
        switch (i2) {
            case 0:
                return j2;
            case 1:
                f2 = j2;
                f3 = 10.0f;
                break;
            case 2:
                f2 = j2;
                f3 = 100.0f;
                break;
            case 3:
                f2 = j2;
                f3 = 1000.0f;
                break;
            case 4:
                f2 = j2;
                f3 = 10000.0f;
                break;
            case 5:
                f2 = j2;
                f3 = 100000.0f;
                break;
            case 6:
                f2 = j2;
                f3 = 1000000.0f;
                break;
            case 7:
                f2 = j2;
                f3 = 1.0E7f;
                break;
            case 8:
                f2 = j2;
                f3 = 1.0E8f;
                break;
            case 9:
                f2 = j2;
                f3 = 1.0E9f;
                break;
            default:
                return Float.parseFloat(str);
        }
        return f2 / f3;
    }

    public static long K(String str) {
        long j2 = -3750763034362895579L;
        for (int i2 = 0; i2 < str.length(); i2++) {
            char cCharAt = str.charAt(i2);
            if (cCharAt != '_' && cCharAt != '-') {
                if (cCharAt >= 'A' && cCharAt <= 'Z') {
                    cCharAt = (char) (cCharAt + ' ');
                }
                j2 = (j2 ^ ((long) cCharAt)) * 1099511628211L;
            }
        }
        return j2;
    }

    static void K0(AccessibleObject accessibleObject) {
        if (f5334d && !accessibleObject.isAccessible()) {
            try {
                accessibleObject.setAccessible(true);
            } catch (AccessControlException unused) {
                f5334d = false;
            }
        }
    }

    private static Type L(Type type, Map map) {
        return type instanceof TypeVariable ? (Type) map.get(type) : type instanceof ParameterizedType ? E0(h0(type), ((ParameterizedType) type).getActualTypeArguments(), map) : type instanceof GenericArrayType ? new C0612d(L(((GenericArrayType) type).getGenericComponentType(), map)) : type;
    }

    public static short L0(BigDecimal bigDecimal) {
        if (bigDecimal == null) {
            return (short) 0;
        }
        int iScale = bigDecimal.scale();
        return (iScale < -100 || iScale > 100) ? bigDecimal.shortValueExact() : bigDecimal.shortValue();
    }

    public static Annotation M(Class cls, Class cls2) {
        Annotation annotation = cls.getAnnotation(cls2);
        Type typeD = AbstractC0421a.d(cls);
        Class cls3 = typeD instanceof Class ? (Class) typeD : null;
        if (cls3 != null) {
            Annotation annotation2 = cls3.getAnnotation(cls2);
            if (annotation2 == null && cls3.getAnnotations().length > 0) {
                for (Annotation annotation3 : cls3.getAnnotations()) {
                    annotation2 = annotation3.annotationType().getAnnotation(cls2);
                    if (annotation2 != null) {
                        break;
                    }
                }
            }
            if (annotation2 != null) {
                return annotation2;
            }
        }
        if (annotation == null && cls.getAnnotations().length > 0) {
            for (Annotation annotation4 : cls.getAnnotations()) {
                annotation = annotation4.annotationType().getAnnotation(cls2);
                if (annotation != null) {
                    break;
                }
            }
        }
        return annotation;
    }

    public static Locale M0(String str) {
        String[] strArrSplit = str.split("_");
        return strArrSplit.length == 1 ? new Locale(strArrSplit[0]) : strArrSplit.length == 2 ? new Locale(strArrSplit[0], strArrSplit[1]) : new Locale(strArrSplit[0], strArrSplit[1], strArrSplit[2]);
    }

    public static Annotation N(Field field, Class cls) {
        Annotation annotation;
        Annotation annotation2 = field.getAnnotation(cls);
        Type typeD = AbstractC0421a.d(field.getDeclaringClass());
        Field declaredField = null;
        Class superclass = typeD instanceof Class ? (Class) typeD : null;
        if (superclass != null) {
            String name = field.getName();
            while (superclass != null && superclass != Object.class) {
                try {
                    declaredField = superclass.getDeclaredField(name);
                    break;
                } catch (NoSuchFieldException unused) {
                    superclass = superclass.getSuperclass();
                }
            }
            if (declaredField != null && (annotation = declaredField.getAnnotation(cls)) != null) {
                return annotation;
            }
        }
        return annotation2;
    }

    public static Type N0(Type type) {
        if (!f5339i) {
            try {
                f5340j = Class.forName("java.util.Optional");
            } catch (Exception unused) {
            } catch (Throwable th) {
                f5339i = true;
                throw th;
            }
            f5339i = true;
        }
        if (!(type instanceof ParameterizedType)) {
            return type;
        }
        ParameterizedType parameterizedType = (ParameterizedType) type;
        return parameterizedType.getRawType() == f5340j ? parameterizedType.getActualTypeArguments()[0] : type;
    }

    public static Annotation O(Method method, Class cls) {
        Annotation annotation;
        Annotation annotation2 = method.getAnnotation(cls);
        Type typeD = AbstractC0421a.d(method.getDeclaringClass());
        Method declaredMethod = null;
        Class superclass = typeD instanceof Class ? (Class) typeD : null;
        if (superclass != null) {
            String name = method.getName();
            Class<?>[] parameterTypes = method.getParameterTypes();
            while (superclass != null && superclass != Object.class) {
                try {
                    declaredMethod = superclass.getDeclaredMethod(name, parameterTypes);
                    break;
                } catch (NoSuchMethodException unused) {
                    superclass = superclass.getSuperclass();
                }
            }
            if (declaredMethod != null && (annotation = declaredMethod.getAnnotation(cls)) != null) {
                return annotation;
            }
        }
        return annotation2;
    }

    public static Class P(Type type) {
        if (type.getClass() == Class.class) {
            return (Class) type;
        }
        if (type instanceof ParameterizedType) {
            return P(((ParameterizedType) type).getRawType());
        }
        if (type instanceof TypeVariable) {
            Type type2 = ((TypeVariable) type).getBounds()[0];
            return type2 instanceof Class ? (Class) type2 : P(type2);
        }
        if (!(type instanceof WildcardType)) {
            return Object.class;
        }
        Type[] upperBounds = ((WildcardType) type).getUpperBounds();
        return upperBounds.length == 1 ? P(upperBounds[0]) : Object.class;
    }

    public static Class Q(String str) {
        return (Class) f5317C.get(str);
    }

    public static Class R(Type type) {
        if (!(type instanceof ParameterizedType)) {
            return Object.class;
        }
        Type type2 = ((ParameterizedType) type).getActualTypeArguments()[0];
        if (type2 instanceof WildcardType) {
            Type[] upperBounds = ((WildcardType) type2).getUpperBounds();
            if (upperBounds.length == 1) {
                type2 = upperBounds[0];
            }
        }
        if (!(type2 instanceof Class)) {
            throw new C0424d("can not create ASMParser");
        }
        Class cls = (Class) type2;
        if (Modifier.isPublic(cls.getModifiers())) {
            return cls;
        }
        throw new C0424d("can not create ASMParser");
    }

    private static Type S(Class cls) {
        return cls.getName().startsWith("java.") ? Object.class : U(V(cls));
    }

    private static Type T(ParameterizedType parameterizedType) {
        Type rawType = parameterizedType.getRawType();
        Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
        if (rawType == Collection.class) {
            return j0(actualTypeArguments[0]);
        }
        Class cls = (Class) rawType;
        Map mapF = F(cls.getTypeParameters(), actualTypeArguments);
        Type typeV = V(cls);
        if (!(typeV instanceof ParameterizedType)) {
            return S((Class) typeV);
        }
        Class clsH0 = h0(typeV);
        Type[] actualTypeArguments2 = ((ParameterizedType) typeV).getActualTypeArguments();
        return actualTypeArguments2.length > 0 ? T(E0(clsH0, actualTypeArguments2, mapF)) : S(clsH0);
    }

    public static Type U(Type type) {
        return type instanceof ParameterizedType ? T((ParameterizedType) type) : type instanceof Class ? S((Class) type) : Object.class;
    }

    private static Type V(Class cls) {
        Type type = null;
        for (Type type2 : cls.getGenericInterfaces()) {
            Class clsH0 = h0(type2);
            if (clsH0 == Collection.class) {
                return type2;
            }
            if (Collection.class.isAssignableFrom(clsH0)) {
                type = type2;
            }
        }
        return type == null ? cls.getGenericSuperclass() : type;
    }

    public static Field W(Class cls, String str, Field[] fieldArr) {
        char cCharAt;
        char cCharAt2;
        for (Field field : fieldArr) {
            String name = field.getName();
            if (str.equals(name)) {
                return field;
            }
            if (str.length() > 2 && (cCharAt = str.charAt(0)) >= 'a' && cCharAt <= 'z' && (cCharAt2 = str.charAt(1)) >= 'A' && cCharAt2 <= 'Z' && str.equalsIgnoreCase(name)) {
                return field;
            }
        }
        Class superclass = cls.getSuperclass();
        if (superclass == null || superclass == Object.class) {
            return null;
        }
        return W(superclass, str, superclass.getDeclaredFields());
    }

    private static List X(Class cls, boolean z2, Map map) {
        ArrayList arrayList = new ArrayList();
        e.d dVar = (e.d) M(cls, e.d.class);
        String[] strArrOrders = dVar != null ? dVar.orders() : null;
        if (strArrOrders == null || strArrOrders.length <= 0) {
            Iterator it = map.values().iterator();
            while (it.hasNext()) {
                arrayList.add((C0611c) it.next());
            }
            if (z2) {
                Collections.sort(arrayList);
            }
        } else {
            LinkedHashMap linkedHashMap = new LinkedHashMap(arrayList.size());
            for (C0611c c0611c : map.values()) {
                linkedHashMap.put(c0611c.f5250b, c0611c);
            }
            for (String str : strArrOrders) {
                C0611c c0611c2 = (C0611c) linkedHashMap.get(str);
                if (c0611c2 != null) {
                    arrayList.add(c0611c2);
                    linkedHashMap.remove(str);
                }
            }
            Iterator it2 = linkedHashMap.values().iterator();
            while (it2.hasNext()) {
                arrayList.add((C0611c) it2.next());
            }
        }
        return arrayList;
    }

    public static Type Y(Type type) {
        return (!(type instanceof ParameterizedType) && (type instanceof Class)) ? Y(((Class) type).getGenericSuperclass()) : type;
    }

    public static String[] Z(Class cls) {
        if (f5352v == null && !f5351u) {
            try {
                f5352v = Class.forName("kotlin.reflect.jvm.internal.KClassImpl").getConstructor(Class.class);
            } catch (Throwable unused) {
                f5351u = true;
            }
        }
        if (f5352v == null) {
            return null;
        }
        if (f5353w == null && !f5351u) {
            try {
                f5353w = Class.forName("kotlin.reflect.jvm.internal.KClassImpl").getMethod("getConstructors", null);
            } catch (Throwable unused2) {
                f5351u = true;
            }
        }
        if (f5354x == null && !f5351u) {
            try {
                f5354x = C1.e.class.getMethod("getParameters", null);
            } catch (Throwable unused3) {
                f5351u = true;
            }
        }
        if (f5355y == null && !f5351u) {
            try {
                f5355y = C1.h.class.getMethod("getName", null);
            } catch (Throwable unused4) {
                f5351u = true;
            }
        }
        if (f5356z) {
            return null;
        }
        try {
            Iterator it = ((Iterable) f5353w.invoke(f5352v.newInstance(cls), null)).iterator();
            Object obj = null;
            while (it.hasNext()) {
                Object next = it.next();
                List list = (List) f5354x.invoke(next, null);
                if (obj == null || list.size() != 0) {
                    obj = next;
                }
                it.hasNext();
            }
            if (obj == null) {
                return null;
            }
            List list2 = (List) f5354x.invoke(obj, null);
            String[] strArr = new String[list2.size()];
            for (int i2 = 0; i2 < list2.size(); i2++) {
                strArr[i2] = (String) f5355y.invoke(list2.get(i2), null);
            }
            return strArr;
        } catch (Throwable th) {
            th.printStackTrace();
            f5356z = true;
            return null;
        }
    }

    private static void a() {
        f5317C.put("byte", Byte.TYPE);
        f5317C.put("short", Short.TYPE);
        f5317C.put("int", Integer.TYPE);
        f5317C.put("long", Long.TYPE);
        f5317C.put("float", Float.TYPE);
        f5317C.put("double", Double.TYPE);
        f5317C.put("boolean", Boolean.TYPE);
        f5317C.put("char", Character.TYPE);
        f5317C.put("[byte", byte[].class);
        f5317C.put("[short", short[].class);
        f5317C.put("[int", int[].class);
        f5317C.put("[long", long[].class);
        f5317C.put("[float", float[].class);
        f5317C.put("[double", double[].class);
        f5317C.put("[boolean", boolean[].class);
        f5317C.put("[char", char[].class);
        f5317C.put("[B", byte[].class);
        f5317C.put("[S", short[].class);
        f5317C.put("[I", int[].class);
        f5317C.put("[J", long[].class);
        f5317C.put("[F", float[].class);
        f5317C.put("[D", double[].class);
        f5317C.put("[C", char[].class);
        f5317C.put("[Z", boolean[].class);
        Class[] clsArr = {Object.class, Cloneable.class, z0("java.lang.AutoCloseable"), Exception.class, RuntimeException.class, IllegalAccessError.class, IllegalAccessException.class, IllegalArgumentException.class, IllegalMonitorStateException.class, IllegalStateException.class, IllegalThreadStateException.class, IndexOutOfBoundsException.class, InstantiationError.class, InstantiationException.class, InternalError.class, InterruptedException.class, LinkageError.class, NegativeArraySizeException.class, NoClassDefFoundError.class, NoSuchFieldError.class, NoSuchFieldException.class, NoSuchMethodError.class, NoSuchMethodException.class, NullPointerException.class, NumberFormatException.class, OutOfMemoryError.class, SecurityException.class, StackOverflowError.class, StringIndexOutOfBoundsException.class, TypeNotPresentException.class, VerifyError.class, StackTraceElement.class, HashMap.class, Hashtable.class, TreeMap.class, IdentityHashMap.class, WeakHashMap.class, LinkedHashMap.class, HashSet.class, LinkedHashSet.class, TreeSet.class, ArrayList.class, TimeUnit.class, ConcurrentHashMap.class, AtomicInteger.class, AtomicLong.class, Collections.EMPTY_MAP.getClass(), Boolean.class, Character.class, Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class, Number.class, String.class, BigDecimal.class, BigInteger.class, BitSet.class, Calendar.class, Date.class, Locale.class, UUID.class, Time.class, java.sql.Date.class, Timestamp.class, SimpleDateFormat.class, C0425e.class, C0426f.class, C0422b.class};
        for (int i2 = 0; i2 < 71; i2++) {
            Class cls = clsArr[i2];
            if (cls != null) {
                f5317C.put(cls.getName(), cls);
            }
        }
    }

    public static Constructor a0(Constructor[] constructorArr) {
        return b0(constructorArr, null);
    }

    public static void b(String str, Class cls) {
        f5317C.put(str, cls);
    }

    public static Constructor b0(Constructor[] constructorArr, String[] strArr) {
        Constructor constructor = null;
        for (Constructor constructor2 : constructorArr) {
            Class<?>[] parameterTypes = constructor2.getParameterTypes();
            if ((strArr == null || parameterTypes.length == strArr.length) && ((parameterTypes.length <= 0 || !parameterTypes[parameterTypes.length - 1].getName().equals("kotlin.jvm.internal.g")) && (constructor == null || constructor.getParameterTypes().length < parameterTypes.length))) {
                constructor = constructor2;
            }
        }
        return constructor;
    }

    public static a0 c(Class cls, Map map, EnumC0439l enumC0439l) {
        return d(cls, map, enumC0439l, false);
    }

    public static Annotation[][] c0(Constructor constructor) {
        Annotation[][] parameterAnnotations;
        Constructor declaredConstructor;
        Annotation[][] parameterAnnotations2 = constructor.getParameterAnnotations();
        Type typeD = AbstractC0421a.d(constructor.getDeclaringClass());
        Constructor constructor2 = null;
        Class cls = typeD instanceof Class ? (Class) typeD : null;
        if (cls != null) {
            Class<?>[] parameterTypes = constructor.getParameterTypes();
            ArrayList arrayList = new ArrayList(2);
            for (Class<?> enclosingClass = cls.getEnclosingClass(); enclosingClass != null; enclosingClass = enclosingClass.getEnclosingClass()) {
                arrayList.add(enclosingClass);
            }
            int size = arrayList.size();
            Class superclass = cls;
            while (true) {
                if (superclass == null || superclass == Object.class) {
                    break;
                }
                try {
                    if (size != 0) {
                        Class<?>[] clsArr = new Class[parameterTypes.length + size];
                        System.arraycopy(parameterTypes, 0, clsArr, size, parameterTypes.length);
                        for (int i2 = size; i2 > 0; i2--) {
                            int i3 = i2 - 1;
                            clsArr[i3] = (Class) arrayList.get(i3);
                        }
                        declaredConstructor = cls.getDeclaredConstructor(clsArr);
                    } else {
                        declaredConstructor = cls.getDeclaredConstructor(parameterTypes);
                    }
                    constructor2 = declaredConstructor;
                } catch (NoSuchMethodException unused) {
                    size--;
                    superclass = superclass.getSuperclass();
                }
            }
            if (constructor2 != null && (parameterAnnotations = constructor2.getParameterAnnotations()) != null) {
                return parameterAnnotations;
            }
        }
        return parameterAnnotations2;
    }

    public static a0 d(Class cls, Map map, EnumC0439l enumC0439l, boolean z2) {
        EnumC0439l enumC0439l2;
        int i2;
        String[] strArr;
        String str;
        String str2;
        List listE;
        e.d dVar = (e.d) M(cls, e.d.class);
        if (dVar != null) {
            String[] strArrOrders = dVar.orders();
            String strTypeName = dVar.typeName();
            if (strTypeName.length() == 0) {
                strTypeName = null;
            }
            EnumC0439l enumC0439lNaming = dVar.naming();
            if (enumC0439lNaming == EnumC0439l.CamelCase) {
                enumC0439lNaming = enumC0439l;
            }
            int iOf = f0.of(dVar.serialzeFeatures());
            String strTypeKey = null;
            for (Class superclass = cls.getSuperclass(); superclass != null && superclass != Object.class; superclass = superclass.getSuperclass()) {
                e.d dVar2 = (e.d) M(superclass, e.d.class);
                if (dVar2 == null) {
                    break;
                }
                strTypeKey = dVar2.typeKey();
                if (strTypeKey.length() != 0) {
                    break;
                }
            }
            for (Class<?> cls2 : cls.getInterfaces()) {
                e.d dVar3 = (e.d) M(cls2, e.d.class);
                if (dVar3 != null) {
                    strTypeKey = dVar3.typeKey();
                    if (strTypeKey.length() != 0) {
                        break;
                    }
                }
            }
            str2 = (strTypeKey == null || strTypeKey.length() != 0) ? strTypeKey : null;
            str = strTypeName;
            enumC0439l2 = enumC0439lNaming;
            i2 = iOf;
            strArr = strArrOrders;
        } else {
            enumC0439l2 = enumC0439l;
            i2 = 0;
            strArr = null;
            str = null;
            str2 = null;
        }
        HashMap map2 = new HashMap();
        g.i.v(cls, map2);
        List listE2 = z2 ? E(cls, map, false, enumC0439l2) : D(cls, dVar, map, map2, false, enumC0439l2);
        C0611c[] c0611cArr = new C0611c[listE2.size()];
        listE2.toArray(c0611cArr);
        if (strArr == null || strArr.length == 0) {
            ArrayList arrayList = new ArrayList(listE2);
            Collections.sort(arrayList);
            listE = arrayList;
        } else {
            listE = z2 ? E(cls, map, true, enumC0439l2) : D(cls, dVar, map, map2, true, enumC0439l2);
        }
        C0611c[] c0611cArr2 = new C0611c[listE.size()];
        listE.toArray(c0611cArr2);
        return new a0(cls, dVar, str, str2, i2, c0611cArr, Arrays.equals(c0611cArr2, c0611cArr) ? c0611cArr : c0611cArr2);
    }

    public static Annotation[][] d0(Method method) {
        Annotation[][] parameterAnnotations;
        Annotation[][] parameterAnnotations2 = method.getParameterAnnotations();
        Type typeD = AbstractC0421a.d(method.getDeclaringClass());
        Method declaredMethod = null;
        Class superclass = typeD instanceof Class ? (Class) typeD : null;
        if (superclass != null) {
            String name = method.getName();
            Class<?>[] parameterTypes = method.getParameterTypes();
            while (superclass != null && superclass != Object.class) {
                try {
                    declaredMethod = superclass.getDeclaredMethod(name, parameterTypes);
                    break;
                } catch (NoSuchMethodException unused) {
                    superclass = superclass.getSuperclass();
                }
            }
            if (declaredMethod != null && (parameterAnnotations = declaredMethod.getParameterAnnotations()) != null) {
                return parameterAnnotations;
            }
        }
        return parameterAnnotations2;
    }

    public static byte e(BigDecimal bigDecimal) {
        if (bigDecimal == null) {
            return (byte) 0;
        }
        int iScale = bigDecimal.scale();
        return (iScale < -100 || iScale > 100) ? bigDecimal.byteValueExact() : bigDecimal.byteValue();
    }

    public static int e0(Class cls) {
        e.d dVar = (e.d) M(cls, e.d.class);
        if (dVar == null) {
            return 0;
        }
        return EnumC0475b.of(dVar.parseFeatures());
    }

    public static Object f(Object obj, Class cls, g.i iVar) {
        Calendar calendar;
        int i2 = 0;
        if (obj == null) {
            if (cls == Integer.TYPE) {
                return 0;
            }
            if (cls == Long.TYPE) {
                return 0L;
            }
            if (cls == Short.TYPE) {
                return (short) 0;
            }
            if (cls == Byte.TYPE) {
                return (byte) 0;
            }
            if (cls == Float.TYPE) {
                return Float.valueOf(0.0f);
            }
            if (cls == Double.TYPE) {
                return Double.valueOf(u.FALSE);
            }
            if (cls == Boolean.TYPE) {
                return Boolean.FALSE;
            }
            return null;
        }
        if (cls == null) {
            throw new IllegalArgumentException("clazz is null");
        }
        if (cls == obj.getClass()) {
            return obj;
        }
        if (obj instanceof Map) {
            if (cls == Map.class) {
                return obj;
            }
            Map map = (Map) obj;
            return (cls != Object.class || map.containsKey(AbstractC0421a.f3675r)) ? u(map, cls, iVar) : obj;
        }
        if (cls.isArray()) {
            if (obj instanceof Collection) {
                Collection collection = (Collection) obj;
                Object objNewInstance = Array.newInstance(cls.getComponentType(), collection.size());
                Iterator it = collection.iterator();
                while (it.hasNext()) {
                    Array.set(objNewInstance, i2, f(it.next(), cls.getComponentType(), iVar));
                    i2++;
                }
                return objNewInstance;
            }
            if (cls == byte[].class) {
                return m(obj);
            }
        }
        if (cls.isAssignableFrom(obj.getClass())) {
            return obj;
        }
        if (cls == Boolean.TYPE || cls == Boolean.class) {
            return k(obj);
        }
        if (cls == Byte.TYPE || cls == Byte.class) {
            return l(obj);
        }
        if (cls == Character.TYPE || cls == Character.class) {
            return n(obj);
        }
        if (cls == Short.TYPE || cls == Short.class) {
            return x(obj);
        }
        if (cls == Integer.TYPE || cls == Integer.class) {
            return t(obj);
        }
        if (cls == Long.TYPE || cls == Long.class) {
            return w(obj);
        }
        if (cls == Float.TYPE || cls == Float.class) {
            return s(obj);
        }
        if (cls == Double.TYPE || cls == Double.class) {
            return q(obj);
        }
        if (cls == String.class) {
            return A(obj);
        }
        if (cls == BigDecimal.class) {
            return i(obj);
        }
        if (cls == BigInteger.class) {
            return j(obj);
        }
        if (cls == Date.class) {
            return o(obj);
        }
        if (cls == java.sql.Date.class) {
            return y(obj);
        }
        if (cls == Time.class) {
            return z(obj);
        }
        if (cls == Timestamp.class) {
            return B(obj);
        }
        if (cls.isEnum()) {
            return r(obj, cls, iVar);
        }
        if (Calendar.class.isAssignableFrom(cls)) {
            Date dateO = o(obj);
            if (cls == Calendar.class) {
                calendar = Calendar.getInstance(AbstractC0421a.f3673b, AbstractC0421a.f3674g);
            } else {
                try {
                    calendar = (Calendar) cls.newInstance();
                } catch (Exception e2) {
                    throw new C0424d("can not cast to : " + cls.getName(), e2);
                }
            }
            calendar.setTime(dateO);
            return calendar;
        }
        String name = cls.getName();
        if (name.equals("javax.xml.datatype.XMLGregorianCalendar")) {
            Date dateO2 = o(obj);
            Calendar calendar2 = Calendar.getInstance(AbstractC0421a.f3673b, AbstractC0421a.f3674g);
            calendar2.setTime(dateO2);
            return C0536p.f4376b.f(calendar2);
        }
        if (obj instanceof String) {
            String str = (String) obj;
            if (str.length() == 0 || "null".equals(str) || "NULL".equals(str)) {
                return null;
            }
            if (cls == Currency.class) {
                return Currency.getInstance(str);
            }
            if (cls == Locale.class) {
                return M0(str);
            }
            if (name.startsWith("java.time.")) {
                return AbstractC0421a.i(AbstractC0421a.n(str), cls);
            }
        }
        if (iVar.k(cls) != null) {
            return AbstractC0421a.i(AbstractC0421a.n(obj), cls);
        }
        throw new C0424d("can not cast to : " + cls.getName());
    }

    private static String f0(Map map, String str, String str2, int i2) {
        if (!f5333c || map.containsKey(str2)) {
            return str2;
        }
        String strSubstring = str.substring(i2);
        return map.containsKey(strSubstring) ? strSubstring : str2;
    }

    public static Object g(Object obj, ParameterizedType parameterizedType, g.i iVar) {
        Type rawType = parameterizedType.getRawType();
        if (rawType == List.class || rawType == ArrayList.class) {
            Type type = parameterizedType.getActualTypeArguments()[0];
            if (obj instanceof List) {
                List list = (List) obj;
                ArrayList arrayList = new ArrayList(list.size());
                for (int i2 = 0; i2 < list.size(); i2++) {
                    Object obj2 = list.get(i2);
                    arrayList.add(type instanceof Class ? (obj2 == null || obj2.getClass() != C0425e.class) ? f(obj2, (Class) type, iVar) : ((C0425e) obj2).u((Class) type, iVar, 0) : h(obj2, type, iVar));
                }
                return arrayList;
            }
        }
        if (rawType == Set.class || rawType == HashSet.class || rawType == TreeSet.class || rawType == Collection.class || rawType == List.class || rawType == ArrayList.class) {
            Type type2 = parameterizedType.getActualTypeArguments()[0];
            if (obj instanceof Iterable) {
                Collection hashSet = (rawType == Set.class || rawType == HashSet.class) ? new HashSet() : rawType == TreeSet.class ? new TreeSet() : new ArrayList();
                Iterator it = ((Iterable) obj).iterator();
                while (it.hasNext()) {
                    Object next = it.next();
                    hashSet.add(type2 instanceof Class ? (next == null || next.getClass() != C0425e.class) ? f(next, (Class) type2, iVar) : ((C0425e) next).u((Class) type2, iVar, 0) : h(next, type2, iVar));
                }
                return hashSet;
            }
        }
        if (rawType == Map.class || rawType == HashMap.class) {
            Type type3 = parameterizedType.getActualTypeArguments()[0];
            Type type4 = parameterizedType.getActualTypeArguments()[1];
            if (obj instanceof Map) {
                HashMap map = new HashMap();
                for (Map.Entry entry : ((Map) obj).entrySet()) {
                    map.put(h(entry.getKey(), type3, iVar), h(entry.getValue(), type4, iVar));
                }
                return map;
            }
        }
        if ((obj instanceof String) && ((String) obj).length() == 0) {
            return null;
        }
        Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
        if (actualTypeArguments.length == 1 && (parameterizedType.getActualTypeArguments()[0] instanceof WildcardType)) {
            return h(obj, rawType, iVar);
        }
        if (rawType == Map.Entry.class && (obj instanceof Map)) {
            Map map2 = (Map) obj;
            if (map2.size() == 1) {
                Map.Entry entry2 = (Map.Entry) map2.entrySet().iterator().next();
                Object value = entry2.getValue();
                if (actualTypeArguments.length == 2 && (value instanceof Map)) {
                    entry2.setValue(h(value, actualTypeArguments[1], iVar));
                }
                return entry2;
            }
        }
        if (rawType instanceof Class) {
            if (iVar == null) {
                iVar = g.i.f3999y;
            }
            t tVarN = iVar.n(rawType);
            if (tVarN != null) {
                return tVarN.b(new C0474a(AbstractC0421a.n(obj), iVar), parameterizedType, null);
            }
        }
        throw new C0424d("can not cast to : " + parameterizedType);
    }

    public static String g0(String str) {
        return Character.toLowerCase(str.charAt(3)) + str.substring(4);
    }

    public static Object h(Object obj, Type type, g.i iVar) {
        if (obj == null) {
            return null;
        }
        if (type instanceof Class) {
            return f(obj, (Class) type, iVar);
        }
        if (type instanceof ParameterizedType) {
            return g(obj, (ParameterizedType) type, iVar);
        }
        if (obj instanceof String) {
            String str = (String) obj;
            if (str.length() == 0 || "null".equals(str) || "NULL".equals(str)) {
                return null;
            }
        }
        if (type instanceof TypeVariable) {
            return obj;
        }
        throw new C0424d("can not cast to : " + type);
    }

    public static Class h0(Type type) {
        if (type instanceof Class) {
            return (Class) type;
        }
        if (type instanceof ParameterizedType) {
            return h0(((ParameterizedType) type).getRawType());
        }
        if (!(type instanceof WildcardType)) {
            throw new C0424d("TODO");
        }
        Type[] upperBounds = ((WildcardType) type).getUpperBounds();
        if (upperBounds.length == 1) {
            return h0(upperBounds[0]);
        }
        throw new C0424d("TODO");
    }

    public static BigDecimal i(Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof BigDecimal) {
            return (BigDecimal) obj;
        }
        if (obj instanceof BigInteger) {
            return new BigDecimal((BigInteger) obj);
        }
        String string = obj.toString();
        if (string.length() == 0) {
            return null;
        }
        if ((obj instanceof Map) && ((Map) obj).size() == 0) {
            return null;
        }
        if (string.length() <= 65535) {
            return new BigDecimal(string);
        }
        throw new C0424d("decimal overflow");
    }

    public static InterfaceC0451b i0(Class cls, Method method) {
        Class<?>[] interfaces = cls.getInterfaces();
        if (interfaces.length > 0) {
            Class<?>[] parameterTypes = method.getParameterTypes();
            for (Class<?> cls2 : interfaces) {
                for (Method method2 : cls2.getMethods()) {
                    Class<?>[] parameterTypes2 = method2.getParameterTypes();
                    if (parameterTypes2.length == parameterTypes.length && method2.getName().equals(method.getName())) {
                        int i2 = 0;
                        while (true) {
                            if (i2 >= parameterTypes.length) {
                                InterfaceC0451b interfaceC0451b = (InterfaceC0451b) O(method2, InterfaceC0451b.class);
                                if (interfaceC0451b != null) {
                                    return interfaceC0451b;
                                }
                            } else {
                                if (!parameterTypes2[i2].equals(parameterTypes[i2])) {
                                    break;
                                }
                                i2++;
                            }
                        }
                    }
                }
            }
        }
        Class superclass = cls.getSuperclass();
        if (superclass != null && Modifier.isAbstract(superclass.getModifiers())) {
            Class<?>[] parameterTypes3 = method.getParameterTypes();
            for (Method method3 : superclass.getMethods()) {
                Class<?>[] parameterTypes4 = method3.getParameterTypes();
                if (parameterTypes4.length == parameterTypes3.length && method3.getName().equals(method.getName())) {
                    int i3 = 0;
                    while (true) {
                        if (i3 >= parameterTypes3.length) {
                            InterfaceC0451b interfaceC0451b2 = (InterfaceC0451b) O(method3, InterfaceC0451b.class);
                            if (interfaceC0451b2 != null) {
                                return interfaceC0451b2;
                            }
                        } else {
                            if (!parameterTypes4[i3].equals(parameterTypes3[i3])) {
                                break;
                            }
                            i3++;
                        }
                    }
                }
            }
        }
        return null;
    }

    public static BigInteger j(Object obj) {
        BigDecimal bigDecimal;
        int iScale;
        if (obj == null) {
            return null;
        }
        if (obj instanceof BigInteger) {
            return (BigInteger) obj;
        }
        if ((obj instanceof Float) || (obj instanceof Double)) {
            return BigInteger.valueOf(((Number) obj).longValue());
        }
        if ((obj instanceof BigDecimal) && (iScale = (bigDecimal = (BigDecimal) obj).scale()) > -1000 && iScale < 1000) {
            return bigDecimal.toBigInteger();
        }
        String string = obj.toString();
        if (string.length() == 0 || "null".equals(string) || "NULL".equals(string)) {
            return null;
        }
        if (string.length() <= 65535) {
            return new BigInteger(string);
        }
        throw new C0424d("decimal overflow");
    }

    private static Type j0(Type type) {
        if (!(type instanceof WildcardType)) {
            return type;
        }
        Type[] upperBounds = ((WildcardType) type).getUpperBounds();
        return upperBounds.length > 0 ? upperBounds[0] : Object.class;
    }

    public static Boolean k(Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof Boolean) {
            return (Boolean) obj;
        }
        if (obj instanceof BigDecimal) {
            return Boolean.valueOf(k0((BigDecimal) obj) == 1);
        }
        if (obj instanceof Number) {
            return Boolean.valueOf(((Number) obj).intValue() == 1);
        }
        if (obj instanceof String) {
            String str = (String) obj;
            if (str.length() == 0 || "null".equals(str) || "NULL".equals(str)) {
                return null;
            }
            if ("true".equalsIgnoreCase(str) || "1".equals(str)) {
                return Boolean.TRUE;
            }
            if ("false".equalsIgnoreCase(str) || "0".equals(str)) {
                return Boolean.FALSE;
            }
            if ("Y".equalsIgnoreCase(str) || ExifInterface.GPS_DIRECTION_TRUE.equals(str)) {
                return Boolean.TRUE;
            }
            if ("F".equalsIgnoreCase(str) || "N".equals(str)) {
                return Boolean.FALSE;
            }
        }
        throw new C0424d("can not cast to boolean, value : " + obj);
    }

    public static int k0(BigDecimal bigDecimal) {
        if (bigDecimal == null) {
            return 0;
        }
        int iScale = bigDecimal.scale();
        return (iScale < -100 || iScale > 100) ? bigDecimal.intValueExact() : bigDecimal.intValue();
    }

    public static Byte l(Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof BigDecimal) {
            return Byte.valueOf(e((BigDecimal) obj));
        }
        if (obj instanceof Number) {
            return Byte.valueOf(((Number) obj).byteValue());
        }
        if (!(obj instanceof String)) {
            throw new C0424d("can not cast to byte, value : " + obj);
        }
        String str = (String) obj;
        if (str.length() == 0 || "null".equals(str) || "NULL".equals(str)) {
            return null;
        }
        return Byte.valueOf(Byte.parseByte(str));
    }

    public static boolean l0(Method method) {
        if (method == null) {
            return false;
        }
        if (f5345o == null && !f5346p) {
            try {
                f5345o = Class.forName("javax.persistence.ManyToMany");
            } catch (Throwable unused) {
                f5346p = true;
            }
        }
        if (f5345o != null) {
            return method.isAnnotationPresent(f5343m) || method.isAnnotationPresent(f5345o);
        }
        return false;
    }

    public static byte[] m(Object obj) {
        if (obj instanceof byte[]) {
            return (byte[]) obj;
        }
        if (obj instanceof String) {
            return AbstractC0613e.b((String) obj);
        }
        throw new C0424d("can not cast to byte[], value : " + obj);
    }

    public static boolean m0(Method method) {
        if (method == null) {
            return false;
        }
        if (f5343m == null && !f5344n) {
            try {
                f5343m = Class.forName("javax.persistence.OneToMany");
            } catch (Throwable unused) {
                f5344n = true;
            }
        }
        Class<? extends Annotation> cls = f5343m;
        return cls != null && method.isAnnotationPresent(cls);
    }

    public static Character n(Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof Character) {
            return (Character) obj;
        }
        if (!(obj instanceof String)) {
            throw new C0424d("can not cast to char, value : " + obj);
        }
        String str = (String) obj;
        if (str.length() == 0) {
            return null;
        }
        if (str.length() == 1) {
            return Character.valueOf(str.charAt(0));
        }
        throw new C0424d("can not cast to char, value : " + obj);
    }

    public static boolean n0(Class cls) {
        if (f5322H == null && !f5323I) {
            try {
                f5322H = Clob.class;
            } catch (Throwable unused) {
                f5323I = true;
            }
        }
        if (f5322H == null) {
            return false;
        }
        return f5322H.isAssignableFrom(cls);
    }

    public static Date o(Object obj) {
        return p(obj, null);
    }

    public static boolean o0(Type type) {
        if (type instanceof ParameterizedType) {
            return true;
        }
        if (!(type instanceof Class)) {
            return false;
        }
        Type genericSuperclass = ((Class) type).getGenericSuperclass();
        return genericSuperclass != Object.class && o0(genericSuperclass);
    }

    public static Date p(Object obj, String str) {
        long j2;
        if (obj == null) {
            return null;
        }
        if (obj instanceof Date) {
            return (Date) obj;
        }
        if (obj instanceof Calendar) {
            return ((Calendar) obj).getTime();
        }
        if (obj instanceof BigDecimal) {
            return new Date(D0((BigDecimal) obj));
        }
        if (obj instanceof Number) {
            long jLongValue = ((Number) obj).longValue();
            if ("unixtime".equals(str)) {
                jLongValue *= 1000;
            }
            return new Date(jLongValue);
        }
        if (obj instanceof String) {
            String strSubstring = (String) obj;
            g.f fVar = new g.f(strSubstring);
            try {
                if (fVar.Y0(false)) {
                    return fVar.k0().getTime();
                }
                fVar.close();
                if (strSubstring.startsWith("/Date(") && strSubstring.endsWith(")/")) {
                    strSubstring = strSubstring.substring(6, strSubstring.length() - 2);
                }
                if (strSubstring.indexOf(45) > 0 || strSubstring.indexOf(43) > 0) {
                    if (str == null) {
                        str = (strSubstring.length() == AbstractC0421a.f3677y.length() || (strSubstring.length() == 22 && AbstractC0421a.f3677y.equals("yyyyMMddHHmmssSSSZ"))) ? AbstractC0421a.f3677y : strSubstring.length() == 10 ? "yyyy-MM-dd" : strSubstring.length() == 19 ? "yyyy-MM-dd HH:mm:ss" : (strSubstring.length() == 29 && strSubstring.charAt(26) == ':' && strSubstring.charAt(28) == '0') ? "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" : (strSubstring.length() == 23 && strSubstring.charAt(19) == ',') ? "yyyy-MM-dd HH:mm:ss,SSS" : "yyyy-MM-dd HH:mm:ss.SSS";
                    }
                    SimpleDateFormat simpleDateFormat = new SimpleDateFormat(str, AbstractC0421a.f3674g);
                    simpleDateFormat.setTimeZone(AbstractC0421a.f3673b);
                    try {
                        return simpleDateFormat.parse(strSubstring);
                    } catch (ParseException unused) {
                        throw new C0424d("can not cast to Date, value : " + strSubstring);
                    }
                }
                if (strSubstring.length() == 0) {
                    return null;
                }
                j2 = Long.parseLong(strSubstring);
            } finally {
                fVar.close();
            }
        } else {
            j2 = -1;
        }
        if (j2 != -1) {
            return new Date(j2);
        }
        Class<?> cls = obj.getClass();
        if ("oracle.sql.TIMESTAMP".equals(cls.getName())) {
            if (f5336f == null && !f5335e) {
                try {
                    f5336f = cls.getMethod("toJdbc", null);
                } catch (NoSuchMethodException unused2) {
                } catch (Throwable th) {
                    f5335e = true;
                    throw th;
                }
                f5335e = true;
            }
            try {
                return (Date) f5336f.invoke(obj, null);
            } catch (Exception e2) {
                throw new C0424d("can not cast oracle.sql.TIMESTAMP to Date", e2);
            }
        }
        if (!"oracle.sql.DATE".equals(cls.getName())) {
            throw new C0424d("can not cast to Date, value : " + obj);
        }
        if (f5338h == null && !f5337g) {
            try {
                f5338h = cls.getMethod("toJdbc", null);
            } catch (NoSuchMethodException unused3) {
            } catch (Throwable th2) {
                f5337g = true;
                throw th2;
            }
            f5337g = true;
        }
        try {
            return (Date) f5338h.invoke(obj, null);
        } catch (Exception e3) {
            throw new C0424d("can not cast oracle.sql.DATE to Date", e3);
        }
    }

    public static boolean p0(Object obj) {
        if (obj == null) {
            return false;
        }
        if (f5347q == null && !f5348r) {
            try {
                f5347q = Class.forName("org.hibernate.Hibernate").getMethod("isInitialized", Object.class);
            } catch (Throwable unused) {
                f5348r = true;
            }
        }
        Method method = f5347q;
        if (method != null) {
            try {
                return ((Boolean) method.invoke(null, obj)).booleanValue();
            } catch (Throwable unused2) {
            }
        }
        return true;
    }

    public static Double q(Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof Number) {
            return Double.valueOf(((Number) obj).doubleValue());
        }
        if (!(obj instanceof String)) {
            throw new C0424d("can not cast to double, value : " + obj);
        }
        String string = obj.toString();
        if (string.length() == 0 || "null".equals(string) || "NULL".equals(string)) {
            return null;
        }
        if (string.indexOf(44) != -1) {
            string = string.replaceAll(",", HttpUrl.FRAGMENT_ENCODE_SET);
        }
        return Double.valueOf(Double.parseDouble(string));
    }

    private static boolean q0(Class cls, String str) {
        e.d dVar = (e.d) M(cls, e.d.class);
        if (dVar != null) {
            String[] strArrIncludes = dVar.includes();
            if (strArrIncludes.length > 0) {
                for (String str2 : strArrIncludes) {
                    if (str.equals(str2)) {
                        return false;
                    }
                }
                return true;
            }
            for (String str3 : dVar.ignores()) {
                if (str.equals(str3)) {
                    return true;
                }
            }
        }
        if (cls.getSuperclass() == Object.class || cls.getSuperclass() == null) {
            return false;
        }
        return q0(cls.getSuperclass(), str);
    }

    public static Object r(Object obj, Class cls, g.i iVar) {
        try {
            if (obj instanceof String) {
                String str = (String) obj;
                if (str.length() == 0) {
                    return null;
                }
                if (iVar == null) {
                    iVar = g.i.r();
                }
                t tVarN = iVar.n(cls);
                return tVarN instanceof h.h ? ((h.h) tVarN).a(I(str)) : Enum.valueOf(cls, str);
            }
            if (obj instanceof BigDecimal) {
                int iK0 = k0((BigDecimal) obj);
                Object[] enumConstants = cls.getEnumConstants();
                if (iK0 < enumConstants.length) {
                    return enumConstants[iK0];
                }
            }
            if (obj instanceof Number) {
                int iIntValue = ((Number) obj).intValue();
                Object[] enumConstants2 = cls.getEnumConstants();
                if (iIntValue < enumConstants2.length) {
                    return enumConstants2[iIntValue];
                }
            }
            throw new C0424d("can not cast to : " + cls.getName());
        } catch (Exception e2) {
            throw new C0424d("can not cast to : " + cls.getName(), e2);
        }
    }

    public static boolean r0(Method method) {
        if (method == null) {
            return false;
        }
        if (f5320F == null && !f5321G) {
            try {
                f5320F = Class.forName("com.fasterxml.jackson.annotation.JsonCreator");
            } catch (Throwable unused) {
                f5321G = true;
            }
        }
        Class<? extends Annotation> cls = f5320F;
        return cls != null && method.isAnnotationPresent(cls);
    }

    public static Float s(Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof Number) {
            return Float.valueOf(((Number) obj).floatValue());
        }
        if (!(obj instanceof String)) {
            throw new C0424d("can not cast to float, value : " + obj);
        }
        String string = obj.toString();
        if (string.length() == 0 || "null".equals(string) || "NULL".equals(string)) {
            return null;
        }
        if (string.indexOf(44) != -1) {
            string = string.replaceAll(",", HttpUrl.FRAGMENT_ENCODE_SET);
        }
        return Float.valueOf(Float.parseFloat(string));
    }

    public static boolean s0(Class cls) {
        if (f5349s == null && !f5350t) {
            try {
                f5349s = n1.i.class;
            } catch (Throwable unused) {
                f5350t = true;
            }
        }
        return f5349s != null && cls.isAnnotationPresent(f5349s);
    }

    public static Integer t(Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof Integer) {
            return (Integer) obj;
        }
        if (obj instanceof BigDecimal) {
            return Integer.valueOf(k0((BigDecimal) obj));
        }
        if (obj instanceof Number) {
            return Integer.valueOf(((Number) obj).intValue());
        }
        if (obj instanceof String) {
            String strReplaceAll = (String) obj;
            if (strReplaceAll.length() == 0 || "null".equals(strReplaceAll) || "NULL".equals(strReplaceAll)) {
                return null;
            }
            if (strReplaceAll.indexOf(44) != -1) {
                strReplaceAll = strReplaceAll.replaceAll(",", HttpUrl.FRAGMENT_ENCODE_SET);
            }
            Matcher matcher = f5331a.matcher(strReplaceAll);
            if (matcher.find()) {
                strReplaceAll = matcher.replaceAll(HttpUrl.FRAGMENT_ENCODE_SET);
            }
            return Integer.valueOf(Integer.parseInt(strReplaceAll));
        }
        if (obj instanceof Boolean) {
            return Integer.valueOf(((Boolean) obj).booleanValue() ? 1 : 0);
        }
        if (obj instanceof Map) {
            Map map = (Map) obj;
            if (map.size() == 2 && map.containsKey("andIncrement") && map.containsKey("andDecrement")) {
                Iterator it = map.values().iterator();
                it.next();
                return t(it.next());
            }
        }
        throw new C0424d("can not cast to int, value : " + obj);
    }

    private static boolean t0(Class cls, String str) {
        if (f5315A == null && !f5316B) {
            try {
                HashMap map = new HashMap();
                c.a aVar = kotlin.ranges.c.f5116y;
                map.put(kotlin.ranges.c.class, new String[]{"getEndInclusive", "isEmpty"});
                i.a aVar2 = kotlin.ranges.i.f5126y;
                map.put(kotlin.ranges.i.class, new String[]{"getEndInclusive", "isEmpty"});
                l.a aVar3 = kotlin.ranges.l.f5136y;
                map.put(kotlin.ranges.l.class, new String[]{"getEndInclusive", "isEmpty"});
                map.put(Class.forName("kotlin.ranges.e"), new String[]{"getEndInclusive", "isEmpty"});
                map.put(Class.forName("kotlin.ranges.d"), new String[]{"getEndInclusive", "isEmpty"});
                f5315A = map;
            } catch (Throwable unused) {
                f5316B = true;
            }
        }
        if (f5315A == null) {
            return false;
        }
        String[] strArr = (String[]) f5315A.get(cls);
        return strArr != null && Arrays.binarySearch(strArr, str) >= 0;
    }

    public static Object u(Map map, Class cls, g.i iVar) {
        try {
            if (cls == StackTraceElement.class) {
                String str = (String) map.get("className");
                String str2 = (String) map.get("methodName");
                String str3 = (String) map.get("fileName");
                Number number = (Number) map.get("lineNumber");
                return new StackTraceElement(str, str2, str3, number == null ? 0 : number instanceof BigDecimal ? ((BigDecimal) number).intValueExact() : number.intValue());
            }
            Object obj = map.get(AbstractC0421a.f3675r);
            if (obj instanceof String) {
                String str4 = (String) obj;
                if (iVar == null) {
                    iVar = g.i.f3999y;
                }
                Class clsG = iVar.g(str4, null);
                if (clsG == null) {
                    throw new ClassNotFoundException(str4 + " not found");
                }
                if (!clsG.equals(cls)) {
                    return u(map, clsG, iVar);
                }
            }
            if (cls.isInterface()) {
                C0425e c0425e = map instanceof C0425e ? (C0425e) map : new C0425e(map);
                if (iVar == null) {
                    iVar = g.i.r();
                }
                return iVar.k(cls) != null ? AbstractC0421a.i(AbstractC0421a.n(c0425e), cls) : Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[]{cls}, c0425e);
            }
            if (cls == Locale.class) {
                Object obj2 = map.get("language");
                Object obj3 = map.get("country");
                if (obj2 instanceof String) {
                    String str5 = (String) obj2;
                    if (obj3 instanceof String) {
                        return new Locale(str5, (String) obj3);
                    }
                    if (obj3 == null) {
                        return new Locale(str5);
                    }
                }
            }
            if (cls == String.class && (map instanceof C0425e)) {
                return map.toString();
            }
            if (cls == AbstractC0421a.class && (map instanceof C0425e)) {
                return map;
            }
            if (cls == LinkedHashMap.class && (map instanceof C0425e)) {
                Map mapR = ((C0425e) map).r();
                if (mapR instanceof LinkedHashMap) {
                    return mapR;
                }
                new LinkedHashMap().putAll(mapR);
            }
            if (cls.isInstance(map)) {
                return map;
            }
            if (cls == C0425e.class) {
                return new C0425e(map);
            }
            if (iVar == null) {
                iVar = g.i.r();
            }
            t tVarN = iVar.n(cls);
            o oVar = tVarN instanceof o ? (o) tVarN : null;
            if (oVar != null) {
                return oVar.f(map, iVar);
            }
            throw new C0424d("can not get javaBeanDeserializer. " + cls.getName());
        } catch (Exception e2) {
            throw new C0424d(e2.getMessage(), e2);
        }
    }

    public static boolean u0(String str) {
        for (int i2 = 0; i2 < str.length(); i2++) {
            char cCharAt = str.charAt(i2);
            if (cCharAt == '+' || cCharAt == '-') {
                if (i2 != 0) {
                    return false;
                }
            } else if (cCharAt < '0' || cCharAt > '9') {
                return false;
            }
        }
        return true;
    }

    public static LocalDateTime v(Object obj, String str) {
        if (obj == null) {
            return null;
        }
        if (str == null) {
            str = "yyyy-MM-dd HH:mm:ss";
        }
        return LocalDateTime.parse(obj.toString(), DateTimeFormatter.ofPattern(str));
    }

    public static boolean v0(Class cls) {
        if (f5318D == null && !f5319E) {
            try {
                f5318D = Path.class;
            } catch (Throwable unused) {
                f5319E = true;
            }
        }
        Class cls2 = f5318D;
        if (cls2 != null) {
            return cls2.isAssignableFrom(cls);
        }
        return false;
    }

    public static Long w(Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof BigDecimal) {
            return Long.valueOf(D0((BigDecimal) obj));
        }
        if (obj instanceof Number) {
            return Long.valueOf(((Number) obj).longValue());
        }
        if (obj instanceof String) {
            String strReplaceAll = (String) obj;
            if (strReplaceAll.length() == 0 || "null".equals(strReplaceAll) || "NULL".equals(strReplaceAll)) {
                return null;
            }
            if (strReplaceAll.indexOf(44) != -1) {
                strReplaceAll = strReplaceAll.replaceAll(",", HttpUrl.FRAGMENT_ENCODE_SET);
            }
            try {
                return Long.valueOf(Long.parseLong(strReplaceAll));
            } catch (NumberFormatException unused) {
                g.f fVar = new g.f(strReplaceAll);
                Calendar calendarK0 = fVar.Y0(false) ? fVar.k0() : null;
                fVar.close();
                if (calendarK0 != null) {
                    return Long.valueOf(calendarK0.getTimeInMillis());
                }
            }
        }
        if (obj instanceof Map) {
            Map map = (Map) obj;
            if (map.size() == 2 && map.containsKey("andIncrement") && map.containsKey("andDecrement")) {
                Iterator it = map.values().iterator();
                it.next();
                return w(it.next());
            }
        }
        throw new C0424d("can not cast to long, value : " + obj);
    }

    public static boolean w0(Class cls) {
        for (Class<?> cls2 : cls.getInterfaces()) {
            String name = cls2.getName();
            if (name.equals("net.sf.cglib.proxy.Factory") || name.equals("org.springframework.cglib.proxy.Factory") || name.equals("javassist.util.proxy.ProxyObject") || name.equals("org.apache.ibatis.javassist.util.proxy.ProxyObject") || name.equals("org.hibernate.proxy.HibernateProxy")) {
                return true;
            }
        }
        return false;
    }

    public static Short x(Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof BigDecimal) {
            return Short.valueOf(L0((BigDecimal) obj));
        }
        if (obj instanceof Number) {
            return Short.valueOf(((Number) obj).shortValue());
        }
        if (!(obj instanceof String)) {
            throw new C0424d("can not cast to short, value : " + obj);
        }
        String str = (String) obj;
        if (str.length() == 0 || "null".equals(str) || "NULL".equals(str)) {
            return null;
        }
        return Short.valueOf(Short.parseShort(str));
    }

    public static boolean x0(Method method) {
        if (method == null) {
            return false;
        }
        if (!f5341k) {
            try {
                f5342l = Class.forName("java.beans.Transient");
            } catch (Exception unused) {
            } catch (Throwable th) {
                f5341k = true;
                throw th;
            }
            f5341k = true;
        }
        Class cls = f5342l;
        return (cls == null || O(method, cls) == null) ? false : true;
    }

    public static java.sql.Date y(Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof java.sql.Date) {
            return (java.sql.Date) obj;
        }
        if (obj instanceof Date) {
            return new java.sql.Date(((Date) obj).getTime());
        }
        if (obj instanceof Calendar) {
            return new java.sql.Date(((Calendar) obj).getTimeInMillis());
        }
        long jD0 = obj instanceof BigDecimal ? D0((BigDecimal) obj) : obj instanceof Number ? ((Number) obj).longValue() : 0L;
        if (obj instanceof String) {
            String str = (String) obj;
            if (str.length() == 0 || "null".equals(str) || "NULL".equals(str)) {
                return null;
            }
            if (u0(str)) {
                jD0 = Long.parseLong(str);
            } else {
                g.f fVar = new g.f(str);
                if (!fVar.Y0(false)) {
                    throw new C0424d("can not cast to Timestamp, value : " + str);
                }
                jD0 = fVar.k0().getTime().getTime();
            }
        }
        if (jD0 > 0) {
            return new java.sql.Date(jD0);
        }
        throw new C0424d("can not cast to Date, value : " + obj);
    }

    public static boolean y0(Class cls) {
        Annotation annotationM;
        Object objInvoke;
        if (f5325K == null && !f5326L) {
            try {
                f5325K = Class.forName("javax.xml.bind.annotation.XmlAccessorType");
            } catch (Throwable unused) {
                f5326L = true;
            }
        }
        if (f5325K == null || (annotationM = M(cls, f5325K)) == null) {
            return false;
        }
        if (f5327M == null && !f5326L) {
            try {
                f5327M = f5325K.getMethod("value", null);
            } catch (Throwable unused2) {
                f5326L = true;
            }
        }
        if (f5327M == null) {
            return false;
        }
        if (f5326L) {
            objInvoke = null;
        } else {
            try {
                objInvoke = f5327M.invoke(annotationM, null);
            } catch (Throwable unused3) {
                f5326L = true;
                objInvoke = null;
            }
        }
        if (objInvoke == null) {
            return false;
        }
        if (f5324J == null && !f5326L) {
            try {
                f5324J = Class.forName("javax.xml.bind.annotation.XmlAccessType");
                f5328N = f5324J.getField("FIELD");
                f5329O = f5328N.get(null);
            } catch (Throwable unused4) {
                f5326L = true;
            }
        }
        return objInvoke == f5329O;
    }

    public static Time z(Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof Time) {
            return (Time) obj;
        }
        if (obj instanceof Date) {
            return new Time(((Date) obj).getTime());
        }
        if (obj instanceof Calendar) {
            return new Time(((Calendar) obj).getTimeInMillis());
        }
        long jD0 = obj instanceof BigDecimal ? D0((BigDecimal) obj) : obj instanceof Number ? ((Number) obj).longValue() : 0L;
        if (obj instanceof String) {
            String str = (String) obj;
            if (str.length() == 0 || "null".equalsIgnoreCase(str)) {
                return null;
            }
            if (u0(str)) {
                jD0 = Long.parseLong(str);
            } else {
                g.f fVar = new g.f(str);
                if (!fVar.Y0(false)) {
                    throw new C0424d("can not cast to Timestamp, value : " + str);
                }
                jD0 = fVar.k0().getTime().getTime();
            }
        }
        if (jD0 > 0) {
            return new Time(jD0);
        }
        throw new C0424d("can not cast to Date, value : " + obj);
    }

    public static Class z0(String str) {
        return A0(str, null);
    }
}
