package i;

import d.C0424d;
import g.C0474a;
import g.InterfaceC0476c;
import java.lang.reflect.Type;
import java.math.BigInteger;

/* JADX INFO: renamed from: i.m, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public class C0533m implements U, h.t {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private static final BigInteger f4371a = BigInteger.valueOf(-9007199254740991L);

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private static final BigInteger f4372b = BigInteger.valueOf(9007199254740991L);

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final C0533m f4373c = new C0533m();

    public static Object e(C0474a c0474a) {
        InterfaceC0476c interfaceC0476c = c0474a.f3944H;
        if (interfaceC0476c.F() != 2) {
            Object objA = c0474a.A();
            if (objA == null) {
                return null;
            }
            return l.l.j(objA);
        }
        String strA0 = interfaceC0476c.a0();
        interfaceC0476c.s(16);
        if (strA0.length() <= 65535) {
            return new BigInteger(strA0);
        }
        throw new C0424d("decimal overflow");
    }

    @Override // i.U
    public void a(C0516I c0516i, Object obj, Object obj2, Type type, int i2) {
        e0 e0Var = c0516i.f4223k;
        if (obj == null) {
            e0Var.N(f0.WriteNullNumberAsZero);
            return;
        }
        BigInteger bigInteger = (BigInteger) obj;
        String string = bigInteger.toString();
        if (string.length() < 16 || !f0.isEnabled(i2, e0Var.f4356r, f0.BrowserCompatible) || (bigInteger.compareTo(f4371a) >= 0 && bigInteger.compareTo(f4372b) <= 0)) {
            e0Var.write(string);
        } else {
            e0Var.O(string);
        }
    }

    @Override // h.t
    public Object b(C0474a c0474a, Type type, Object obj) {
        return e(c0474a);
    }

    @Override // h.t
    public int d() {
        return 2;
    }
}
