package o;

import java.nio.ByteBuffer;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.uh0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2641uh0 {
    public static final ThreadLocal d = new ThreadLocal();
    public final int a;
    public final C2062oc0 b;
    public volatile int c = 0;

    public C2641uh0(C2062oc0 c2062oc0, int i) {
        this.b = c2062oc0;
        this.a = i;
    }

    public final int a(int i) {
        C2995yP c2995yPB = b();
        int iA = c2995yPB.a(16);
        if (iA == 0) {
            return 0;
        }
        ByteBuffer byteBuffer = (ByteBuffer) c2995yPB.f756o;
        int i2 = iA + c2995yPB.l;
        return byteBuffer.getInt((i * 4) + byteBuffer.getInt(i2) + i2 + 4);
    }

    public final C2995yP b() {
        ThreadLocal threadLocal = d;
        C2995yP c2995yP = (C2995yP) threadLocal.get();
        if (c2995yP == null) {
            c2995yP = new C2995yP();
            threadLocal.set(c2995yP);
        }
        C3090zP c3090zP = (C3090zP) this.b.a;
        int iA = c3090zP.a(6);
        if (iA != 0) {
            int i = iA + c3090zP.l;
            int i2 = (this.a * 4) + ((ByteBuffer) c3090zP.f756o).getInt(i) + i + 4;
            int i3 = ((ByteBuffer) c3090zP.f756o).getInt(i2) + i2;
            ByteBuffer byteBuffer = (ByteBuffer) c3090zP.f756o;
            c2995yP.f756o = byteBuffer;
            if (byteBuffer != null) {
                c2995yP.l = i3;
                int i4 = i3 - byteBuffer.getInt(i3);
                c2995yP.m = i4;
                c2995yP.n = ((ByteBuffer) c2995yP.f756o).getShort(i4);
                return c2995yP;
            }
            c2995yP.l = 0;
            c2995yP.m = 0;
            c2995yP.n = 0;
        }
        return c2995yP;
    }

    public final String toString() {
        int i;
        StringBuilder sb = new StringBuilder();
        sb.append(super.toString());
        sb.append(", id:");
        C2995yP c2995yPB = b();
        int iA = c2995yPB.a(4);
        sb.append(Integer.toHexString(iA != 0 ? ((ByteBuffer) c2995yPB.f756o).getInt(iA + c2995yPB.l) : 0));
        sb.append(", codepoints:");
        C2995yP c2995yPB2 = b();
        int iA2 = c2995yPB2.a(16);
        if (iA2 != 0) {
            int i2 = iA2 + c2995yPB2.l;
            i = ((ByteBuffer) c2995yPB2.f756o).getInt(((ByteBuffer) c2995yPB2.f756o).getInt(i2) + i2);
        } else {
            i = 0;
        }
        for (int i3 = 0; i3 < i; i3++) {
            sb.append(Integer.toHexString(a(i3)));
            sb.append(" ");
        }
        return sb.toString();
    }
}
