package C0;

import I0.AbstractC0300j0;
import O1.C0564d;
import O1.C0570j;
import O1.C0573m;
import V4.C0763h0;
import V4.C0781t;
import V4.InterfaceC0765i0;
import X3.f0;
import X3.r0;
import android.graphics.Typeface;
import android.util.SparseArray;
import android.view.autofill.AutofillId;
import android.view.autofill.AutofillManager;
import androidx.lifecycle.g0;
import androidx.lifecycle.h0;
import androidx.lifecycle.i0;
import d2.AbstractC1866c;
import d2.C1867d;
import f2.C2034c;
import j0.C2314k;
import j0.InterfaceC2310g;
import java.nio.ByteBuffer;
import java.security.GeneralSecurityException;
import java.security.InvalidAlgorithmParameterException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import m3.AbstractC2467b;
import m4.K0;
import m4.S0;
import m4.c2;
import m4.i2;
import m4.k2;
import n.C2578e;
import n.C2592t;
import p.AbstractC2658b;
import p.c0;
import p.d0;
import q.AbstractC2798s;
import t3.InterfaceC2949b;
import v4.InterfaceC3128a;
import w4.C3137A;
import x3.C3218c;
import x3.C3223h;
import x4.AbstractC3251q;
import y3.InterfaceC3267d;

/* JADX INFO: loaded from: classes.dex */
public final class J implements InterfaceC2310g, InterfaceC2949b {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f532a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public Object f533b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public Object f534c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public Object f535d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public Object f536e;

    public /* synthetic */ J(int i6, boolean z6) {
        this.f532a = i6;
    }

    public void a(Object obj, Object obj2, f0 f0Var, boolean z6) {
        byte[] bArrArray;
        if (((ConcurrentHashMap) this.f534c) == null) {
            throw new IllegalStateException("addPrimitive cannot be called after build");
        }
        if (obj == null && obj2 == null) {
            throw new GeneralSecurityException("at least one of the `fullPrimitive` or `primitive` must be set");
        }
        if (f0Var.C() != X3.Z.ENABLED) {
            throw new GeneralSecurityException("only ENABLED key is allowed");
        }
        ConcurrentHashMap concurrentHashMap = (ConcurrentHashMap) this.f534c;
        Integer numValueOf = Integer.valueOf(f0Var.A());
        if (f0Var.B() == r0.RAW) {
            numValueOf = null;
        }
        L3.b bVarA = S3.i.f6231b.a(S3.o.a(f0Var.z().A(), f0Var.z().B(), f0Var.z().z(), f0Var.B(), numValueOf));
        int iOrdinal = f0Var.B().ordinal();
        if (iOrdinal == 1) {
            bArrArray = ByteBuffer.allocate(5).put((byte) 1).putInt(f0Var.A()).array();
        } else if (iOrdinal == 2) {
            bArrArray = ByteBuffer.allocate(5).put((byte) 0).putInt(f0Var.A()).array();
        } else if (iOrdinal != 3) {
            if (iOrdinal != 4) {
                throw new GeneralSecurityException("unknown output prefix type");
            }
            bArrArray = ByteBuffer.allocate(5).put((byte) 0).putInt(f0Var.A()).array();
        } else {
            bArrArray = L3.b.f4165a;
        }
        L3.k kVar = new L3.k(obj, obj2, bArrArray, f0Var.C(), f0Var.B(), f0Var.A(), f0Var.z().A(), bVarA);
        ArrayList arrayList = new ArrayList();
        arrayList.add(kVar);
        byte[] bArr = kVar.f4179c;
        L3.l lVar = new L3.l(bArr != null ? Arrays.copyOf(bArr, bArr.length) : null);
        List list = (List) concurrentHashMap.put(lVar, Collections.unmodifiableList(arrayList));
        if (list != null) {
            ArrayList arrayList2 = new ArrayList();
            arrayList2.addAll(list);
            arrayList2.add(kVar);
            concurrentHashMap.put(lVar, Collections.unmodifiableList(arrayList2));
        }
        if (z6) {
            if (((L3.k) this.f535d) != null) {
                throw new IllegalStateException("you cannot set two primary primitives");
            }
            this.f535d = kVar;
        }
    }

    public T3.k b() {
        Integer num = (Integer) this.f533b;
        if (num == null) {
            throw new GeneralSecurityException("key size is not set");
        }
        if (((Integer) this.f534c) == null) {
            throw new GeneralSecurityException("tag size is not set");
        }
        if (((T3.d) this.f535d) == null) {
            throw new GeneralSecurityException("hash type is not set");
        }
        if (((T3.d) this.f536e) == null) {
            throw new GeneralSecurityException("variant is not set");
        }
        if (num.intValue() < 16) {
            throw new InvalidAlgorithmParameterException(String.format("Invalid key size in bytes %d; must be at least 16 bytes", (Integer) this.f533b));
        }
        Integer num2 = (Integer) this.f534c;
        int iIntValue = num2.intValue();
        T3.d dVar = (T3.d) this.f535d;
        if (iIntValue < 10) {
            throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; must be at least 10 bytes", num2));
        }
        if (dVar == T3.d.f6675g) {
            if (iIntValue > 20) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 20 bytes for SHA1", num2));
            }
        } else if (dVar == T3.d.f6676h) {
            if (iIntValue > 28) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 28 bytes for SHA224", num2));
            }
        } else if (dVar == T3.d.f6677i) {
            if (iIntValue > 32) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 32 bytes for SHA256", num2));
            }
        } else if (dVar == T3.d.f6678j) {
            if (iIntValue > 48) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 48 bytes for SHA384", num2));
            }
        } else {
            if (dVar != T3.d.f6679k) {
                throw new GeneralSecurityException("unknown hash type; must be SHA256, SHA384 or SHA512");
            }
            if (iIntValue > 64) {
                throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; can be at most 64 bytes for SHA512", num2));
            }
        }
        return new T3.k(((Integer) this.f533b).intValue(), ((Integer) this.f534c).intValue(), (T3.d) this.f536e, (T3.d) this.f535d);
    }

    /* JADX WARN: Type inference failed for: r0v0, types: [java.lang.Object, java.util.Collection, java.util.List] */
    public void c(C0116q c0116q, boolean z6) {
        ?? r02 = c0116q.f627a;
        int size = r02.size();
        for (int i6 = 0; i6 < size; i6++) {
            if (((C0124z) r02.get(i6)).b()) {
                n(c0116q);
                return;
            }
        }
        AbstractC0300j0 abstractC0300j0 = (AbstractC0300j0) this.f533b;
        if (abstractC0300j0 == null) {
            throw new IllegalStateException("layoutCoordinates not set");
        }
        AbstractC0123y.i(c0116q, abstractC0300j0.e0(0L), new H(0, this, (K) this.f536e), false);
        if (((G) this.f534c) == G.f524b) {
            if (z6) {
                int size2 = r02.size();
                for (int i7 = 0; i7 < size2; i7++) {
                    ((C0124z) r02.get(i7)).a();
                }
            }
            C0109j c0109j = c0116q.f628b;
            if (c0109j != null) {
                c0109j.f606b = !r5.f539c;
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object d(C4.c cVar) {
        C0570j c0570j;
        J j4;
        C0564d c0564d;
        if (cVar instanceof C0570j) {
            c0570j = (C0570j) cVar;
            int i6 = c0570j.f5418d;
            if ((i6 & Integer.MIN_VALUE) != 0) {
                c0570j.f5418d = i6 - Integer.MIN_VALUE;
            } else {
                c0570j = new C0570j(this, cVar);
            }
        }
        Object objD = c0570j.f5416b;
        B4.a aVar = B4.a.f492a;
        int i7 = c0570j.f5418d;
        if (i7 == 0) {
            AbstractC2467b.l(objD);
            List list = (List) this.f535d;
            O1.O o6 = (O1.O) this.f536e;
            if (list == null || list.isEmpty()) {
                c0570j.f5415a = this;
                c0570j.f5418d = 1;
                objD = O1.O.d(o6, false, c0570j);
                if (objD != aVar) {
                    j4 = this;
                    c0564d = (C0564d) objD;
                }
            } else {
                O1.Y yE = o6.e();
                C0573m c0573m = new C0573m(o6, this, null);
                c0570j.f5415a = this;
                c0570j.f5418d = 2;
                objD = yE.b(c0573m, c0570j);
                if (objD != aVar) {
                    j4 = this;
                    c0564d = (C0564d) objD;
                }
            }
            return aVar;
        }
        if (i7 == 1) {
            j4 = c0570j.f5415a;
            AbstractC2467b.l(objD);
            c0564d = (C0564d) objD;
        } else {
            if (i7 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            j4 = c0570j.f5415a;
            AbstractC2467b.l(objD);
            c0564d = (C0564d) objD;
        }
        ((O1.O) j4.f536e).f5360g.x(c0564d);
        return C3137A.f25453a;
    }

    public AbstractC2798s e(AbstractC2798s abstractC2798s, AbstractC2798s abstractC2798s2) {
        if (((AbstractC2798s) this.f536e) == null) {
            this.f536e = abstractC2798s.c();
        }
        AbstractC2798s abstractC2798s3 = (AbstractC2798s) this.f536e;
        if (abstractC2798s3 == null) {
            kotlin.jvm.internal.o.n("targetVector");
            throw null;
        }
        int i6 = 0;
        for (int iB = abstractC2798s3.b(); i6 < iB; iB = iB) {
            AbstractC2798s abstractC2798s4 = (AbstractC2798s) this.f536e;
            if (abstractC2798s4 == null) {
                kotlin.jvm.internal.o.n("targetVector");
                throw null;
            }
            float fA = abstractC2798s.a(i6);
            float fA2 = abstractC2798s2.a(i6);
            c0 c0Var = (c0) ((l2.c) this.f533b).f20267b;
            double dB = c0Var.b(fA2);
            double d6 = d0.f22723a;
            float f6 = c0Var.f22713a * c0Var.f22714b;
            abstractC2798s4.e((Math.signum(fA2) * ((float) (Math.exp((d6 / (d6 - 1.0d)) * dB) * ((double) f6)))) + fA, i6);
            i6++;
        }
        AbstractC2798s abstractC2798s5 = (AbstractC2798s) this.f536e;
        if (abstractC2798s5 != null) {
            return abstractC2798s5;
        }
        kotlin.jvm.internal.o.n("targetVector");
        throw null;
    }

    public AbstractC2798s f(long j4, AbstractC2798s abstractC2798s, AbstractC2798s abstractC2798s2) {
        if (((AbstractC2798s) this.f535d) == null) {
            this.f535d = abstractC2798s.c();
        }
        AbstractC2798s abstractC2798s3 = (AbstractC2798s) this.f535d;
        if (abstractC2798s3 == null) {
            kotlin.jvm.internal.o.n("velocityVector");
            throw null;
        }
        int iB = abstractC2798s3.b();
        for (int i6 = 0; i6 < iB; i6++) {
            AbstractC2798s abstractC2798s4 = (AbstractC2798s) this.f535d;
            if (abstractC2798s4 == null) {
                kotlin.jvm.internal.o.n("velocityVector");
                throw null;
            }
            abstractC2798s.getClass();
            long j6 = j4 / 1000000;
            p.b0 b0VarA = ((c0) ((l2.c) this.f533b).f20267b).a(abstractC2798s2.a(i6));
            long j7 = b0VarA.f22701c;
            abstractC2798s4.e((((Math.signum(b0VarA.f22699a) * AbstractC2658b.a(j7 > 0 ? j6 / j7 : 1.0f).f22696b) * b0VarA.f22700b) / j7) * 1000.0f, i6);
        }
        AbstractC2798s abstractC2798s5 = (AbstractC2798s) this.f535d;
        if (abstractC2798s5 != null) {
            return abstractC2798s5;
        }
        kotlin.jvm.internal.o.n("velocityVector");
        throw null;
    }

    public androidx.lifecycle.b0 g(kotlin.jvm.internal.g gVar, String key) {
        androidx.lifecycle.b0 viewModel;
        androidx.lifecycle.b0 b0VarCreate;
        kotlin.jvm.internal.o.h(key, "key");
        synchronized (((C2034c) this.f536e)) {
            try {
                i0 i0Var = (i0) this.f533b;
                i0Var.getClass();
                viewModel = (androidx.lifecycle.b0) i0Var.f12176a.get(key);
                if (gVar.d(viewModel)) {
                    Object obj = (androidx.lifecycle.d0) this.f534c;
                    if (obj instanceof g0) {
                        kotlin.jvm.internal.o.e(viewModel);
                        ((g0) obj).a(viewModel);
                    }
                    kotlin.jvm.internal.o.f(viewModel, "null cannot be cast to non-null type T of androidx.lifecycle.viewmodel.ViewModelProviderImpl.getViewModel");
                } else {
                    C1867d c1867d = new C1867d((AbstractC1866c) this.f535d);
                    c1867d.f15010a.put(h0.f12174b, key);
                    androidx.lifecycle.d0 factory = (androidx.lifecycle.d0) this.f534c;
                    kotlin.jvm.internal.o.h(factory, "factory");
                    try {
                        try {
                            b0VarCreate = factory.create(gVar, c1867d);
                        } catch (AbstractMethodError unused) {
                            b0VarCreate = factory.create(e4.C.D(gVar), c1867d);
                        }
                    } catch (AbstractMethodError unused2) {
                        b0VarCreate = factory.create(e4.C.D(gVar));
                    }
                    viewModel = b0VarCreate;
                    i0 i0Var2 = (i0) this.f533b;
                    i0Var2.getClass();
                    kotlin.jvm.internal.o.h(viewModel, "viewModel");
                    androidx.lifecycle.b0 b0Var = (androidx.lifecycle.b0) i0Var2.f12176a.put(key, viewModel);
                    if (b0Var != null) {
                        b0Var.clear$lifecycle_viewmodel_release();
                    }
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return viewModel;
    }

    @Override // v4.InterfaceC3128a
    public Object get() {
        return new C3223h((Executor) ((InterfaceC3128a) this.f533b).get(), (InterfaceC3267d) ((InterfaceC3128a) this.f534c).get(), (C3218c) ((o4.f) this.f535d).get(), (z3.c) ((InterfaceC3128a) this.f536e).get());
    }

    public void h(k4.r0 r0Var) {
        synchronized (this.f533b) {
            try {
                if (((k4.r0) this.f535d) != null) {
                    return;
                }
                this.f535d = r0Var;
                boolean zIsEmpty = ((HashSet) this.f534c).isEmpty();
                if (zIsEmpty) {
                    ((S0) this.f536e).f20766E.d(r0Var);
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public void i(S3.a aVar) throws GeneralSecurityException {
        aVar.getClass();
        S3.q qVar = new S3.q(S3.o.class, aVar.f6218a);
        HashMap map = (HashMap) this.f534c;
        if (!map.containsKey(qVar)) {
            map.put(qVar, aVar);
            return;
        }
        S3.a aVar2 = (S3.a) map.get(qVar);
        if (aVar2.equals(aVar) && aVar.equals(aVar2)) {
            return;
        }
        throw new GeneralSecurityException("Attempt to register non-equal parser for already existing object of type: " + qVar);
    }

    public void j(S3.b bVar) throws GeneralSecurityException {
        S3.r rVar = new S3.r(bVar.f6220a, S3.o.class);
        HashMap map = (HashMap) this.f533b;
        if (!map.containsKey(rVar)) {
            map.put(rVar, bVar);
            return;
        }
        S3.b bVar2 = (S3.b) map.get(rVar);
        if (bVar2.equals(bVar) && bVar.equals(bVar2)) {
            return;
        }
        throw new GeneralSecurityException("Attempt to register non-equal serializer for already existing object of type: " + rVar);
    }

    public void k(S3.j jVar) throws GeneralSecurityException {
        jVar.getClass();
        S3.q qVar = new S3.q(S3.p.class, jVar.f6233a);
        HashMap map = (HashMap) this.f536e;
        if (!map.containsKey(qVar)) {
            map.put(qVar, jVar);
            return;
        }
        S3.j jVar2 = (S3.j) map.get(qVar);
        if (jVar2.equals(jVar) && jVar.equals(jVar2)) {
            return;
        }
        throw new GeneralSecurityException("Attempt to register non-equal parser for already existing object of type: " + qVar);
    }

    public void l(S3.k kVar) throws GeneralSecurityException {
        S3.r rVar = new S3.r(kVar.f6234a, S3.p.class);
        HashMap map = (HashMap) this.f535d;
        if (!map.containsKey(rVar)) {
            map.put(rVar, kVar);
            return;
        }
        S3.k kVar2 = (S3.k) map.get(rVar);
        if (kVar2.equals(kVar) && kVar.equals(kVar2)) {
            return;
        }
        throw new GeneralSecurityException("Attempt to register non-equal serializer for already existing object of type: " + rVar);
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object m(C4.c cVar) throws Throwable {
        O1.T t6;
        J j4;
        e5.a aVar;
        e5.a aVar2;
        Throwable th;
        J j6;
        if (cVar instanceof O1.T) {
            t6 = (O1.T) cVar;
            int i6 = t6.f5375e;
            if ((i6 & Integer.MIN_VALUE) != 0) {
                t6.f5375e = i6 - Integer.MIN_VALUE;
            } else {
                t6 = new O1.T(this, cVar);
            }
        }
        Object obj = t6.f5373c;
        B4.a aVar3 = B4.a.f492a;
        int i7 = t6.f5375e;
        C3137A c3137a = C3137A.f25453a;
        try {
            if (i7 == 0) {
                AbstractC2467b.l(obj);
                if (((C0781t) this.f534c).E()) {
                    return c3137a;
                }
                t6.f5371a = this;
                e5.c cVar2 = (e5.c) this.f533b;
                t6.f5372b = cVar2;
                t6.f5375e = 1;
                if (cVar2.e(t6) != aVar3) {
                    j4 = this;
                    aVar = cVar2;
                }
                return aVar3;
            }
            if (i7 != 1) {
                if (i7 != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                aVar2 = t6.f5372b;
                j6 = t6.f5371a;
                try {
                    AbstractC2467b.l(obj);
                    aVar2 = aVar2;
                    ((C0781t) j6.f534c).G(c3137a);
                    ((e5.c) aVar2).g(null);
                    return c3137a;
                } catch (Throwable th2) {
                    th = th2;
                    ((e5.c) aVar2).g(null);
                    throw th;
                }
            }
            e5.a aVar4 = t6.f5372b;
            j4 = t6.f5371a;
            AbstractC2467b.l(obj);
            aVar = aVar4;
            if (((C0781t) j4.f534c).E()) {
                ((e5.c) aVar).g(null);
                return c3137a;
            }
            t6.f5371a = j4;
            t6.f5372b = aVar;
            t6.f5375e = 2;
            if (j4.d(t6) != aVar3) {
                aVar2 = aVar;
                j6 = j4;
                ((C0781t) j6.f534c).G(c3137a);
                ((e5.c) aVar2).g(null);
                return c3137a;
            }
            return aVar3;
        } catch (Throwable th3) {
            aVar2 = aVar;
            th = th3;
            ((e5.c) aVar2).g(null);
            throw th;
        }
    }

    public void n(C0116q c0116q) {
        if (((G) this.f534c) == G.f524b) {
            AbstractC0300j0 abstractC0300j0 = (AbstractC0300j0) this.f533b;
            if (abstractC0300j0 == null) {
                throw new IllegalStateException("layoutCoordinates not set");
            }
            AbstractC0123y.i(c0116q, abstractC0300j0.e0(0L), new I((K) this.f536e, 1), true);
        }
        this.f534c = G.f525c;
    }

    public String toString() {
        switch (this.f532a) {
            case 9:
                return "horizontal=" + ((androidx.leanback.widget.X) this.f534c) + "; vertical=" + ((androidx.leanback.widget.X) this.f533b);
            default:
                return super.toString();
        }
    }

    public /* synthetic */ J(Object obj, Object obj2, Object obj3, Object obj4, int i6) {
        this.f532a = i6;
        this.f533b = obj;
        this.f534c = obj2;
        this.f535d = obj3;
        this.f536e = obj4;
    }

    public J(V4.C c6, Z z6, O1.L l) {
        this.f532a = 4;
        this.f533b = c6;
        this.f534c = l;
        this.f535d = W.a.I(Integer.MAX_VALUE, 6, null);
        this.f536e = new B(13);
        InterfaceC0765i0 interfaceC0765i0 = (InterfaceC0765i0) c6.getCoroutineContext().get(C0763h0.f8306a);
        if (interfaceC0765i0 != null) {
            interfaceC0765i0.invokeOnCompletion(new H(8, z6, this));
        }
    }

    public J(i0 store, androidx.lifecycle.d0 factory, AbstractC1866c defaultExtras) {
        this.f532a = 10;
        kotlin.jvm.internal.o.h(store, "store");
        kotlin.jvm.internal.o.h(factory, "factory");
        kotlin.jvm.internal.o.h(defaultExtras, "defaultExtras");
        this.f533b = store;
        this.f534c = factory;
        this.f535d = defaultExtras;
        this.f536e = new C2034c();
    }

    public J(J0.A a6, C2314k c2314k) {
        this.f532a = 11;
        this.f533b = a6;
        this.f534c = c2314k;
        AutofillManager autofillManagerH = coil.decode.a.h(a6.getContext().getSystemService(coil.decode.a.n()));
        if (autofillManagerH != null) {
            this.f535d = autofillManagerH;
            a6.setImportantForAutofill(1);
            M0.a aVarG = A4.g.G(a6);
            AutofillId autofillIdI = aVarG != null ? G1.c.i(aVarG.f4197a) : null;
            if (autofillIdI != null) {
                this.f536e = autofillIdI;
                return;
            }
            throw com.google.android.recaptcha.internal.a.g("Required value was null.");
        }
        throw new IllegalStateException("Autofill service could not be located.");
    }

    public J(K k6) {
        this.f532a = 0;
        this.f536e = k6;
        this.f534c = G.f523a;
    }

    public J(int i6) {
        this.f532a = i6;
        switch (i6) {
            case 9:
                androidx.leanback.widget.X x6 = new androidx.leanback.widget.X();
                this.f533b = x6;
                androidx.leanback.widget.X x7 = new androidx.leanback.widget.X();
                this.f534c = x7;
                this.f535d = x7;
                this.f536e = x6;
                break;
            case 13:
                i2 i2Var = i2.f21060b;
                this.f534c = c2.o();
                this.f535d = c2.o();
                this.f536e = c2.o();
                this.f533b = i2Var;
                break;
            case 17:
                this.f533b = new C2578e(0);
                this.f534c = new SparseArray();
                this.f535d = new C2592t((Object) null);
                this.f536e = new C2578e(0);
                break;
            default:
                this.f533b = new HashMap();
                this.f534c = new HashMap();
                this.f535d = new HashMap();
                this.f536e = new HashMap();
                break;
        }
    }

    public J(S3.s sVar) {
        this.f532a = 5;
        this.f533b = new HashMap(sVar.f6252a);
        this.f534c = new HashMap(sVar.f6253b);
        this.f535d = new HashMap(sVar.f6254c);
        this.f536e = new HashMap(sVar.f6255d);
    }

    public J(Typeface typeface, U1.b bVar) {
        int i6;
        int i7;
        int i8;
        int i9;
        this.f532a = 6;
        this.f536e = typeface;
        this.f533b = bVar;
        this.f535d = new T1.q(1024);
        int iA = bVar.a(6);
        if (iA != 0) {
            int i10 = iA + bVar.f6861a;
            i6 = ((ByteBuffer) bVar.f6864d).getInt(((ByteBuffer) bVar.f6864d).getInt(i10) + i10);
        } else {
            i6 = 0;
        }
        this.f534c = new char[i6 * 2];
        int iA2 = bVar.a(6);
        if (iA2 != 0) {
            int i11 = iA2 + bVar.f6861a;
            i7 = ((ByteBuffer) bVar.f6864d).getInt(((ByteBuffer) bVar.f6864d).getInt(i11) + i11);
        } else {
            i7 = 0;
        }
        for (int i12 = 0; i12 < i7; i12++) {
            T1.r rVar = new T1.r(this, i12);
            U1.a aVarB = rVar.b();
            int iA3 = aVarB.a(4);
            Character.toChars(iA3 != 0 ? ((ByteBuffer) aVarB.f6864d).getInt(iA3 + aVarB.f6861a) : 0, (char[]) this.f534c, i12 * 2);
            U1.a aVarB2 = rVar.b();
            int iA4 = aVarB2.a(16);
            if (iA4 != 0) {
                int i13 = iA4 + aVarB2.f6861a;
                i8 = ((ByteBuffer) aVarB2.f6864d).getInt(((ByteBuffer) aVarB2.f6864d).getInt(i13) + i13);
            } else {
                i8 = 0;
            }
            if (i8 > 0) {
                U1.a aVarB3 = rVar.b();
                int iA5 = aVarB3.a(16);
                if (iA5 != 0) {
                    int i14 = iA5 + aVarB3.f6861a;
                    i9 = ((ByteBuffer) aVarB3.f6864d).getInt(((ByteBuffer) aVarB3.f6864d).getInt(i14) + i14);
                } else {
                    i9 = 0;
                }
                ((T1.q) this.f535d).a(rVar, 0, i9 - 1);
            } else {
                throw new IllegalArgumentException("invalid metadata codepoint length");
            }
        }
    }

    public J(k2 k2Var, K0 k02) {
        this.f532a = 12;
        this.f536e = k2Var;
        this.f533b = k02;
        k4.V v3 = (k4.V) k2Var.f21087b;
        String str = (String) k2Var.f21088c;
        k4.U uB = v3.b(str);
        this.f535d = uB;
        if (uB != null) {
            this.f534c = uB.b(k02);
            return;
        }
        throw new IllegalStateException(Z0.o.o("Could not find policy '", str, "'. Make sure its implementation is either registered to LoadBalancerRegistry or included in META-INF/services/io.grpc.LoadBalancerProvider from your jar files."));
    }

    public J(l2.c cVar) {
        this.f532a = 15;
        this.f533b = cVar;
    }

    public J(Class cls) {
        this.f532a = 2;
        this.f534c = new ConcurrentHashMap();
        this.f533b = cls;
        this.f536e = V3.a.f8217b;
    }

    public J(O1.O o6, List list) {
        this.f532a = 3;
        this.f536e = o6;
        this.f533b = e5.d.a();
        this.f534c = V4.E.b();
        this.f535d = AbstractC3251q.C0(list);
    }

    public J(S0 s02) {
        this.f532a = 14;
        this.f536e = s02;
        this.f533b = new Object();
        this.f534c = new HashSet();
    }
}
