package C2;

import A6.n;
import C3.E;
import C3.G;
import C3.W;
import E1.C0108o;
import E1.C0111s;
import F7.C0118b;
import F7.C0119c;
import F7.ExecutorC0117a;
import F7.M;
import F7.V;
import L0.n0;
import N1.C0203d0;
import N1.p0;
import N1.t0;
import O1.C0225a;
import O1.ServiceConnectionC0237m;
import O3.k;
import O3.l;
import O3.m;
import O3.q;
import O3.r;
import O3.s;
import O3.t;
import O3.u;
import P2.w;
import Q4.a0;
import T0.H;
import T3.f0;
import T3.r0;
import W.C0336c;
import W.C0342i;
import W.C0345l;
import W.K;
import W.O;
import W.U;
import Z6.AbstractC0385z;
import Z6.C0375o;
import Z6.C0379t;
import Z6.InterfaceC0382w;
import Z6.d0;
import a.AbstractC0386a;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Message;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.View;
import android.view.ViewGroup;
import androidx.leanback.widget.R0;
import androidx.lifecycle.P;
import androidx.lifecycle.T;
import androidx.lifecycle.Y;
import c0.C0575l;
import com.google.android.gms.internal.measurement.AbstractC0707u1;
import com.google.android.gms.internal.measurement.C0621d;
import com.google.android.gms.internal.measurement.C0631f;
import com.google.android.gms.internal.measurement.C0636g;
import com.google.android.gms.internal.measurement.C0666m;
import com.google.android.gms.internal.measurement.C0674n2;
import com.google.android.gms.internal.measurement.C0676o;
import com.google.android.gms.internal.measurement.C0692r1;
import com.google.android.gms.internal.measurement.C0700t;
import com.google.android.gms.internal.measurement.C1;
import com.google.android.gms.internal.measurement.CallableC0622d0;
import com.google.android.gms.internal.measurement.InterfaceC0671n;
import com.google.android.gms.internal.measurement.J3;
import com.google.android.gms.internal.measurement.X1;
import com.google.android.gms.internal.measurement.o4;
import com.martsnew.domain.model.Shortcut;
import com.rubensousa.dpadrecyclerview.layoutmanager.PivotLayoutManager;
import d0.C0760a;
import d0.C0761b;
import d3.C;
import d3.C0785g0;
import d3.C0817r0;
import d3.I;
import d3.Z;
import d5.AbstractC0844a;
import e6.C0890b;
import e6.C0891c;
import f5.C0924A;
import f5.C0926C;
import f5.C0949j;
import f5.C0957r;
import f6.C0966a;
import h0.ComponentCallbacksC1023x;
import h0.S;
import h5.AbstractC1033b;
import j5.C1074e;
import j5.C1075f;
import j5.C1076g;
import java.io.InterruptedIOException;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
import java.security.InvalidAlgorithmParameterException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.zip.Inflater;
import k5.C1104d;
import k7.p;
import n4.u0;
import o5.C1372k;
import o6.x;
import o7.i;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import q1.C1444a;
import q1.C1455l;
import q1.InterfaceC1447d;
import q1.InterfaceC1456m;
import r0.AbstractC1483b;
import r0.C1484c;
import t1.C1533a;
import x0.AbstractC1709a;
import x0.o;
import x0.v;
import y1.C1738a;

/* JADX INFO: loaded from: classes.dex */
public final class a implements InterfaceC1456m {

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

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

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

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

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

    public /* synthetic */ a(int i, boolean z8) {
        this.f1156q = i;
    }

    private final /* synthetic */ void G() {
    }

    private final /* synthetic */ void H() {
    }

    public static final Message b(a aVar, ArrayList arrayList, int i) {
        Object obj;
        aVar.getClass();
        ArrayList arrayList2 = new ArrayList();
        int size = arrayList.size();
        int i5 = 0;
        while (i5 < size) {
            Object obj2 = arrayList.get(i5);
            i5++;
            if (((Message) obj2).what == i) {
                arrayList2.add(obj2);
            }
        }
        Iterator it = arrayList2.iterator();
        if (it.hasNext()) {
            Object next = it.next();
            if (it.hasNext()) {
                long when = ((Message) next).getWhen();
                do {
                    Object next2 = it.next();
                    long when2 = ((Message) next2).getWhen();
                    if (when < when2) {
                        next = next2;
                        when = when2;
                    }
                } while (it.hasNext());
            }
            obj = next;
        } else {
            obj = null;
        }
        return (Message) obj;
    }

    public void A() {
        byte[] bArr = l7.b.f14412a;
        ArrayList arrayList = new ArrayList();
        synchronized (this) {
            try {
                Iterator it = ((ArrayDeque) this.f1157r).iterator();
                P6.g.d(it, "readyAsyncCalls.iterator()");
                while (it.hasNext()) {
                    o7.f fVar = (o7.f) it.next();
                    if (((ArrayDeque) this.f1159t).size() >= 64) {
                        break;
                    }
                    if (fVar.f15961r.get() < 5) {
                        it.remove();
                        fVar.f15961r.incrementAndGet();
                        arrayList.add(fVar);
                        ((ArrayDeque) this.f1159t).add(fVar);
                    }
                }
                J();
            } catch (Throwable th) {
                throw th;
            }
        }
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            o7.f fVar2 = (o7.f) arrayList.get(i);
            ExecutorService executorServiceL = l();
            fVar2.getClass();
            i iVar = fVar2.f15962s;
            a aVar = iVar.f15969q.f14184q;
            byte[] bArr2 = l7.b.f14412a;
            try {
                try {
                    ((ThreadPoolExecutor) executorServiceL).execute(fVar2);
                } catch (RejectedExecutionException e8) {
                    InterruptedIOException interruptedIOException = new InterruptedIOException("executor rejected");
                    interruptedIOException.initCause(e8);
                    iVar.l(interruptedIOException);
                    fVar2.f15960q.x(iVar, interruptedIOException);
                    iVar.f15969q.f14184q.p(fVar2);
                }
            } catch (Throwable th2) {
                iVar.f15969q.f14184q.p(fVar2);
                throw th2;
            }
        }
    }

    public void B(Message message) {
        LinkedBlockingDeque linkedBlockingDeque = (LinkedBlockingDeque) this.f1159t;
        if (!linkedBlockingDeque.offer(message)) {
            Log.d("SessionLifecycleClient", "Failed to enqueue message " + message.what + ". Dropping.");
            return;
        }
        Log.d("SessionLifecycleClient", "Queued message " + message.what + ". Queue size " + linkedBlockingDeque.size());
    }

    public void C(O3.a aVar) throws GeneralSecurityException {
        aVar.getClass();
        s sVar = new s(q.class, aVar.f5141a);
        HashMap map = (HashMap) this.f1157r;
        if (!map.containsKey(sVar)) {
            map.put(sVar, aVar);
            return;
        }
        O3.a aVar2 = (O3.a) map.get(sVar);
        if (aVar2.equals(aVar) && aVar.equals(aVar2)) {
            return;
        }
        throw new GeneralSecurityException("Attempt to register non-equal parser for already existing object of type: " + sVar);
    }

    public void D(O3.c cVar) throws GeneralSecurityException {
        t tVar = new t(cVar.f5143a, q.class);
        HashMap map = (HashMap) this.f1158s;
        if (!map.containsKey(tVar)) {
            map.put(tVar, cVar);
            return;
        }
        O3.c cVar2 = (O3.c) map.get(tVar);
        if (cVar2.equals(cVar) && cVar.equals(cVar2)) {
            return;
        }
        throw new GeneralSecurityException("Attempt to register non-equal serializer for already existing object of type: " + tVar);
    }

    public void E(l lVar) throws GeneralSecurityException {
        lVar.getClass();
        s sVar = new s(r.class, lVar.f5157a);
        HashMap map = (HashMap) this.f1160u;
        if (!map.containsKey(sVar)) {
            map.put(sVar, lVar);
            return;
        }
        l lVar2 = (l) map.get(sVar);
        if (lVar2.equals(lVar) && lVar.equals(lVar2)) {
            return;
        }
        throw new GeneralSecurityException("Attempt to register non-equal parser for already existing object of type: " + sVar);
    }

    public void F(m mVar) throws GeneralSecurityException {
        t tVar = new t(mVar.f5158a, r.class);
        HashMap map = (HashMap) this.f1159t;
        if (!map.containsKey(tVar)) {
            map.put(tVar, mVar);
            return;
        }
        m mVar2 = (m) map.get(tVar);
        if (mVar2.equals(mVar) && mVar.equals(mVar2)) {
            return;
        }
        throw new GeneralSecurityException("Attempt to register non-equal serializer for already existing object of type: " + tVar);
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object I(G6.c cVar) throws Throwable {
        O o8;
        i7.a aVar;
        a aVar2;
        i7.a aVar3;
        Throwable th;
        a aVar4;
        if (cVar instanceof O) {
            o8 = (O) cVar;
            int i = o8.f6956x;
            if ((i & Integer.MIN_VALUE) != 0) {
                o8.f6956x = i - Integer.MIN_VALUE;
            } else {
                o8 = new O(this, cVar);
            }
        }
        Object obj = o8.f6954v;
        F6.a aVar5 = F6.a.f2580q;
        int i5 = o8.f6956x;
        n nVar = n.f457a;
        try {
            if (i5 == 0) {
                C1.N(obj);
                if (((C0375o) this.f1157r).N()) {
                    return nVar;
                }
                o8.f6952t = this;
                aVar = (i7.d) this.f1158s;
                o8.f6953u = aVar;
                o8.f6956x = 1;
                if (aVar.b(o8) != aVar5) {
                    aVar2 = this;
                }
                return aVar5;
            }
            if (i5 != 1) {
                if (i5 != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                aVar3 = o8.f6953u;
                aVar4 = o8.f6952t;
                try {
                    C1.N(obj);
                    ((C0375o) aVar4.f1157r).R(nVar);
                    aVar3.a(null);
                    return nVar;
                } catch (Throwable th2) {
                    th = th2;
                    aVar3.a(null);
                    throw th;
                }
            }
            i7.a aVar6 = o8.f6953u;
            aVar2 = o8.f6952t;
            C1.N(obj);
            aVar = aVar6;
            if (((C0375o) aVar2.f1157r).N()) {
                aVar.a(null);
                return nVar;
            }
            o8.f6952t = aVar2;
            o8.f6953u = aVar;
            o8.f6956x = 2;
            if (aVar2.k(o8) != aVar5) {
                aVar3 = aVar;
                aVar4 = aVar2;
                ((C0375o) aVar4.f1157r).R(nVar);
                aVar3.a(null);
                return nVar;
            }
            return aVar5;
        } catch (Throwable th3) {
            aVar3 = aVar;
            th = th3;
            aVar3.a(null);
            throw th;
        }
    }

    public synchronized int J() {
        return ((ArrayDeque) this.f1159t).size() + ((ArrayDeque) this.f1160u).size();
    }

    public void K(int i) {
        ArrayList arrayList = new ArrayList();
        ((LinkedBlockingDeque) this.f1159t).drainTo(arrayList);
        Message messageObtain = Message.obtain(null, i, 0, 0);
        P6.g.d(messageObtain, "obtain(null, messageCode, 0, 0)");
        arrayList.add(messageObtain);
        AbstractC0385z.r(AbstractC0385z.b((E6.i) this.f1158s), null, new a0(this, arrayList, null), 3);
    }

    public Bundle L(String str, Bundle bundle) {
        HashMap map = (HashMap) this.f1159t;
        return bundle != null ? (Bundle) map.put(str, bundle) : (Bundle) map.remove(str);
    }

    public a M() {
        return new a(this, (C0700t) this.f1157r);
    }

    /* JADX WARN: Removed duplicated region for block: B:37:0x0090  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x0095  */
    /* JADX WARN: Removed duplicated region for block: B:59:0x011b A[Catch: NumberFormatException | JSONException -> 0x0123, NumberFormatException | JSONException -> 0x0123, TRY_LEAVE, TryCatch #0 {NumberFormatException | JSONException -> 0x0123, blocks: (B:10:0x0031, B:44:0x009d, B:44:0x009d, B:45:0x00ab, B:45:0x00ab, B:47:0x00b8, B:47:0x00b8, B:49:0x00ca, B:49:0x00ca, B:50:0x00d3, B:50:0x00d3, B:51:0x00d7, B:51:0x00d7, B:53:0x00e4, B:53:0x00e4, B:55:0x00f6, B:55:0x00f6, B:56:0x00ff, B:56:0x00ff, B:57:0x0103, B:57:0x0103, B:58:0x010f, B:58:0x010f, B:59:0x011b, B:59:0x011b), top: B:71:0x0031, outer: #1 }] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Bundle N() {
        byte b8;
        if (((Bundle) this.f1157r) == null) {
            C0785g0 c0785g0 = (C0785g0) this.f1159t;
            SharedPreferences sharedPreferencesJ = c0785g0.J();
            C0817r0 c0817r0 = (C0817r0) c0785g0.f5146q;
            String string = sharedPreferencesJ.getString((String) this.f1160u, null);
            if (string != null) {
                try {
                    Bundle bundle = new Bundle();
                    JSONArray jSONArray = new JSONArray(string);
                    for (int i = 0; i < jSONArray.length(); i++) {
                        try {
                            JSONObject jSONObject = jSONArray.getJSONObject(i);
                            String string2 = jSONObject.getString("n");
                            String string3 = jSONObject.getString("t");
                            int iHashCode = string3.hashCode();
                            if (iHashCode == 100) {
                                if (string3.equals("d")) {
                                    b8 = 1;
                                }
                                if (b8 == 0) {
                                }
                            } else if (iHashCode == 108) {
                                if (string3.equals("l")) {
                                    b8 = 2;
                                }
                                if (b8 == 0) {
                                }
                            } else if (iHashCode == 115) {
                                if (string3.equals("s")) {
                                    b8 = 0;
                                }
                                if (b8 == 0) {
                                }
                            } else if (iHashCode != 3352) {
                                b8 = (iHashCode == 3445 && string3.equals("la")) ? (byte) 4 : (byte) -1;
                                if (b8 == 0) {
                                    bundle.putString(string2, jSONObject.getString("v"));
                                } else if (b8 == 1) {
                                    bundle.putDouble(string2, Double.parseDouble(jSONObject.getString("v")));
                                } else if (b8 == 2) {
                                    bundle.putLong(string2, Long.parseLong(jSONObject.getString("v")));
                                } else if (b8 == 3) {
                                    J3.b();
                                    if (c0817r0.f12148w.R(null, I.f11529X0)) {
                                        JSONArray jSONArray2 = new JSONArray(jSONObject.getString("v"));
                                        int length = jSONArray2.length();
                                        int[] iArr = new int[length];
                                        for (int i5 = 0; i5 < length; i5++) {
                                            iArr[i5] = jSONArray2.optInt(i5);
                                        }
                                        bundle.putIntArray(string2, iArr);
                                    }
                                } else if (b8 != 4) {
                                    Z z8 = c0817r0.f12150y;
                                    C0817r0.k(z8);
                                    z8.f11875v.c(string3, "Unrecognized persisted bundle type. Type");
                                } else {
                                    J3.b();
                                    if (c0817r0.f12148w.R(null, I.f11529X0)) {
                                        JSONArray jSONArray3 = new JSONArray(jSONObject.getString("v"));
                                        int length2 = jSONArray3.length();
                                        long[] jArr = new long[length2];
                                        for (int i8 = 0; i8 < length2; i8++) {
                                            jArr[i8] = jSONArray3.optLong(i8);
                                        }
                                        bundle.putLongArray(string2, jArr);
                                    }
                                }
                            } else {
                                if (string3.equals("ia")) {
                                    b8 = 3;
                                }
                                if (b8 == 0) {
                                }
                            }
                        } catch (NumberFormatException | JSONException unused) {
                            Z z9 = c0817r0.f12150y;
                            C0817r0.k(z9);
                            z9.f11875v.b("Error reading value from SharedPreferences. Value dropped");
                        }
                    }
                    this.f1157r = bundle;
                } catch (JSONException unused2) {
                    Z z10 = c0817r0.f12150y;
                    C0817r0.k(z10);
                    z10.f11875v.b("Error loading bundle from SharedPreferences. Values will be lost");
                }
            }
            if (((Bundle) this.f1157r) == null) {
                this.f1157r = (Bundle) this.f1158s;
            }
        }
        Bundle bundle2 = (Bundle) this.f1157r;
        w.f(bundle2);
        return new Bundle(bundle2);
    }

    public InterfaceC0671n O(a aVar, C0692r1... c0692r1Arr) {
        InterfaceC0671n interfaceC0671nR = InterfaceC0671n.f9919g;
        for (C0692r1 c0692r1 : c0692r1Arr) {
            interfaceC0671nR = C1.R(c0692r1);
            AbstractC0707u1.u((a) this.f1159t);
            if ((interfaceC0671nR instanceof C0676o) || (interfaceC0671nR instanceof C0666m)) {
                interfaceC0671nR = ((C0700t) this.f1158s).a(aVar, interfaceC0671nR);
            }
        }
        return interfaceC0671nR;
    }

    public InterfaceC0671n P(InterfaceC0671n interfaceC0671n) {
        return ((C0700t) this.f1157r).a(this, interfaceC0671n);
    }

    public void Q(Bundle bundle) {
        Iterator<String> it;
        JSONObject jSONObject;
        boolean zR;
        Z z8;
        Bundle bundle2 = bundle == null ? new Bundle() : new Bundle(bundle);
        C0785g0 c0785g0 = (C0785g0) this.f1159t;
        SharedPreferences sharedPreferencesJ = c0785g0.J();
        C0817r0 c0817r0 = (C0817r0) c0785g0.f5146q;
        SharedPreferences.Editor editorEdit = sharedPreferencesJ.edit();
        int size = bundle2.size();
        String str = (String) this.f1160u;
        if (size == 0) {
            editorEdit.remove(str);
        } else {
            JSONArray jSONArray = new JSONArray();
            Iterator<String> it2 = bundle2.keySet().iterator();
            while (it2.hasNext()) {
                String next = it2.next();
                Object obj = bundle2.get(next);
                if (obj != null) {
                    try {
                        jSONObject = new JSONObject();
                        jSONObject.put("n", next);
                        J3.b();
                        zR = c0817r0.f12148w.R(null, I.f11529X0);
                        z8 = c0817r0.f12150y;
                    } catch (JSONException e8) {
                        e = e8;
                        it = it2;
                    }
                    if (zR) {
                        it = it2;
                        try {
                        } catch (JSONException e9) {
                            e = e9;
                            Z z9 = c0817r0.f12150y;
                            C0817r0.k(z9);
                            z9.f11875v.c(e, "Cannot serialize bundle value to SharedPreferences");
                        }
                        if (obj instanceof String) {
                            jSONObject.put("v", obj.toString());
                            jSONObject.put("t", "s");
                        } else if (obj instanceof Long) {
                            jSONObject.put("v", obj.toString());
                            jSONObject.put("t", "l");
                        } else if (obj instanceof int[]) {
                            jSONObject.put("v", Arrays.toString((int[]) obj));
                            jSONObject.put("t", "ia");
                        } else if (obj instanceof long[]) {
                            jSONObject.put("v", Arrays.toString((long[]) obj));
                            jSONObject.put("t", "la");
                        } else if (obj instanceof Double) {
                            jSONObject.put("v", obj.toString());
                            jSONObject.put("t", "d");
                        } else {
                            C0817r0.k(z8);
                            z8.f11875v.c(obj.getClass(), "Cannot serialize bundle value to SharedPreferences. Type");
                            it2 = it;
                        }
                        jSONArray.put(jSONObject);
                        it2 = it;
                    } else {
                        it = it2;
                        jSONObject.put("v", obj.toString());
                        if (obj instanceof String) {
                            jSONObject.put("t", "s");
                        } else if (obj instanceof Long) {
                            jSONObject.put("t", "l");
                        } else if (obj instanceof Double) {
                            jSONObject.put("t", "d");
                        } else {
                            C0817r0.k(z8);
                            z8.f11875v.c(obj.getClass(), "Cannot serialize bundle value to SharedPreferences. Type");
                            it2 = it;
                        }
                        jSONArray.put(jSONObject);
                        it2 = it;
                    }
                }
            }
            editorEdit.putString(str, jSONArray.toString());
        }
        editorEdit.apply();
        this.f1157r = bundle2;
    }

    public InterfaceC0671n R(C0621d c0621d) {
        InterfaceC0671n interfaceC0671nA = InterfaceC0671n.f9919g;
        Iterator itP = c0621d.p();
        while (itP.hasNext()) {
            interfaceC0671nA = ((C0700t) this.f1157r).a(this, c0621d.n(((Integer) itP.next()).intValue()));
            if (interfaceC0671nA instanceof C0631f) {
                break;
            }
        }
        return interfaceC0671nA;
    }

    public InterfaceC0671n S(String str) {
        HashMap map = (HashMap) this.f1159t;
        if (map.containsKey(str)) {
            return (InterfaceC0671n) map.get(str);
        }
        a aVar = (a) this.f1158s;
        if (aVar != null) {
            return aVar.S(str);
        }
        throw new IllegalArgumentException(AbstractC0844a.l(str, " is not defined"));
    }

    public void T(String str, InterfaceC0671n interfaceC0671n) {
        if (((HashMap) this.f1160u).containsKey(str)) {
            return;
        }
        HashMap map = (HashMap) this.f1159t;
        if (interfaceC0671n == null) {
            map.remove(str);
        } else {
            map.put(str, interfaceC0671n);
        }
    }

    public void U(String str, InterfaceC0671n interfaceC0671n) {
        a aVar;
        HashMap map = (HashMap) this.f1159t;
        if (!map.containsKey(str) && (aVar = (a) this.f1158s) != null && aVar.V(str)) {
            aVar.U(str, interfaceC0671n);
        } else {
            if (((HashMap) this.f1160u).containsKey(str)) {
                return;
            }
            if (interfaceC0671n == null) {
                map.remove(str);
            } else {
                map.put(str, interfaceC0671n);
            }
        }
    }

    public boolean V(String str) {
        if (((HashMap) this.f1159t).containsKey(str)) {
            return true;
        }
        a aVar = (a) this.f1158s;
        if (aVar != null) {
            return aVar.V(str);
        }
        return false;
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:69:0x0208  */
    /* JADX WARN: Removed duplicated region for block: B:96:0x02ac A[PHI: r17
      0x02ac: PHI (r17v10 int) = 
      (r17v1 int)
      (r17v1 int)
      (r17v4 int)
      (r17v4 int)
      (r17v4 int)
      (r17v6 int)
      (r17v7 int)
      (r17v8 int)
      (r17v1 int)
      (r17v1 int)
     binds: [B:95:0x02a9, B:123:0x0331, B:119:0x031b, B:120:0x031d, B:121:0x031f, B:115:0x02fc, B:112:0x02f2, B:103:0x02db, B:98:0x02b6, B:100:0x02b9] A[DONT_GENERATE, DONT_INLINE]] */
    @Override // q1.InterfaceC1456m
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void a(byte[] bArr, int i, int i5, C1455l c1455l, x0.d dVar) {
        ArrayList arrayList;
        o oVar;
        int i8;
        int i9;
        w0.b bVar;
        int i10;
        int i11;
        int i12;
        w0.b bVar2;
        int i13;
        w0.b bVar3;
        W wP;
        Rect rect;
        int i14;
        int i15 = 128;
        int i16 = 3;
        int i17 = 2;
        int i18 = 0;
        int i19 = 1;
        int i20 = 4;
        switch (this.f1156q) {
            case 22:
                int i21 = 4;
                o oVar2 = (o) this.f1158s;
                oVar2.D(i + i5, bArr);
                oVar2.F(i);
                if (((Inflater) this.f1160u) == null) {
                    this.f1160u = new Inflater();
                }
                Inflater inflater = (Inflater) this.f1160u;
                int i22 = v.f18553a;
                if (oVar2.a() > 0 && (oVar2.f18539a[oVar2.f18540b] & 255) == 120) {
                    o oVar3 = (o) this.f1157r;
                    if (v.F(oVar2, oVar3, inflater)) {
                        oVar2.D(oVar3.f18541c, oVar3.f18539a);
                    }
                }
                C1533a c1533a = (C1533a) this.f1159t;
                c1533a.f16950d = 0;
                c1533a.f16951e = 0;
                c1533a.f16952f = 0;
                c1533a.f16953g = 0;
                c1533a.f16954h = 0;
                c1533a.i = 0;
                o oVar4 = c1533a.f16947a;
                oVar4.C(0);
                c1533a.f16949c = false;
                ArrayList arrayList2 = new ArrayList();
                while (oVar2.a() >= i16) {
                    int i23 = oVar2.f18541c;
                    int iT = oVar2.t();
                    int iZ = oVar2.z();
                    int i24 = oVar2.f18540b + iZ;
                    if (i24 > i23) {
                        oVar2.F(i23);
                        arrayList = arrayList2;
                        i10 = i18;
                        i9 = i19;
                        i8 = i15;
                        bVar2 = null;
                    } else {
                        int[] iArr = c1533a.f16948b;
                        if (iT != i15) {
                            switch (iT) {
                                case 20:
                                    if (iZ % 5 == i17) {
                                        oVar2.G(i17);
                                        Arrays.fill(iArr, i18);
                                        int i25 = iZ / 5;
                                        int i26 = i18;
                                        while (i26 < i25) {
                                            int iT2 = oVar2.t();
                                            int i27 = i15;
                                            double dT = oVar2.t();
                                            int i28 = i19;
                                            double dT2 = oVar2.t() - 128;
                                            int[] iArr2 = iArr;
                                            double dT3 = oVar2.t() - 128;
                                            iArr2[iT2] = v.i((int) ((dT3 * 1.772d) + dT), 0, 255) | (oVar2.t() << 24) | (v.i((int) ((1.402d * dT2) + dT), 0, 255) << 16) | (v.i((int) ((dT - (0.34414d * dT3)) - (dT2 * 0.71414d)), 0, 255) << 8);
                                            i26++;
                                            iArr = iArr2;
                                            arrayList2 = arrayList2;
                                            oVar2 = oVar2;
                                            i19 = i28;
                                            i15 = i27;
                                        }
                                        i13 = i15;
                                        arrayList = arrayList2;
                                        oVar = oVar2;
                                        c1533a.f16949c = i19;
                                    } else {
                                        i13 = i15;
                                        arrayList = arrayList2;
                                        oVar = oVar2;
                                    }
                                    break;
                                case 21:
                                    int i29 = i21;
                                    if (iZ < i29) {
                                        i21 = i29;
                                    } else {
                                        oVar2.G(i16);
                                        int i30 = iZ - 4;
                                        if (((oVar2.t() & i15) != 0 ? i19 : i18) == 0) {
                                            i21 = 4;
                                        } else if (i30 < 7) {
                                            i21 = 4;
                                        } else {
                                            int iW = oVar2.w();
                                            if (iW < 4) {
                                                i21 = 4;
                                            } else {
                                                c1533a.f16954h = oVar2.z();
                                                c1533a.i = oVar2.z();
                                                oVar4.C(iW - 4);
                                                i21 = 4;
                                                i30 = iZ - 11;
                                            }
                                        }
                                        int i31 = oVar4.f18540b;
                                        int i32 = oVar4.f18541c;
                                        if (i31 < i32 && i30 > 0) {
                                            int iMin = Math.min(i30, i32 - i31);
                                            oVar2.e(oVar4.f18539a, i31, iMin);
                                            oVar4.F(i31 + iMin);
                                        }
                                    }
                                    i13 = i15;
                                    arrayList = arrayList2;
                                    oVar = oVar2;
                                    break;
                                case 22:
                                    if (iZ >= 19) {
                                        c1533a.f16950d = oVar2.z();
                                        c1533a.f16951e = oVar2.z();
                                        oVar2.G(11);
                                        c1533a.f16952f = oVar2.z();
                                        c1533a.f16953g = oVar2.z();
                                    }
                                    i13 = i15;
                                    arrayList = arrayList2;
                                    oVar = oVar2;
                                    break;
                            }
                            i8 = i13;
                            i10 = 0;
                            i9 = 1;
                            bVar = null;
                        } else {
                            int i33 = i15;
                            arrayList = arrayList2;
                            oVar = oVar2;
                            if (c1533a.f16950d == 0 || c1533a.f16951e == 0 || c1533a.f16954h == 0 || c1533a.i == 0 || (i11 = oVar4.f18541c) == 0 || oVar4.f18540b != i11 || !c1533a.f16949c) {
                                i8 = i33;
                                i9 = 1;
                                bVar = null;
                            } else {
                                oVar4.F(0);
                                int i34 = c1533a.f16954h * c1533a.i;
                                int[] iArr3 = new int[i34];
                                int i35 = 0;
                                while (i35 < i34) {
                                    int iT3 = oVar4.t();
                                    if (iT3 != 0) {
                                        iArr3[i35] = iArr[iT3];
                                        i35++;
                                    } else {
                                        int iT4 = oVar4.t();
                                        if (iT4 != 0) {
                                            int iT5 = (iT4 & 64) == 0 ? iT4 & 63 : ((iT4 & 63) << 8) | oVar4.t();
                                            i12 = i33;
                                            int i36 = (iT4 & i12) == 0 ? iArr[0] : iArr[oVar4.t()];
                                            int i37 = iT5 + i35;
                                            Arrays.fill(iArr3, i35, i37, i36);
                                            i35 = i37;
                                        }
                                        i33 = i12;
                                    }
                                    i12 = i33;
                                    i33 = i12;
                                }
                                i8 = i33;
                                i9 = 1;
                                Bitmap bitmapCreateBitmap = Bitmap.createBitmap(iArr3, c1533a.f16954h, c1533a.i, Bitmap.Config.ARGB_8888);
                                float f3 = c1533a.f16952f;
                                float f7 = c1533a.f16950d;
                                float f8 = f3 / f7;
                                float f9 = c1533a.f16953g;
                                float f10 = c1533a.f16951e;
                                bVar = new w0.b(null, null, null, bitmapCreateBitmap, f9 / f10, 0, 0, f8, 0, Integer.MIN_VALUE, -3.4028235E38f, c1533a.f16954h / f7, c1533a.i / f10, false, -16777216, Integer.MIN_VALUE, 0.0f);
                            }
                            i10 = 0;
                            c1533a.f16950d = 0;
                            c1533a.f16951e = 0;
                            c1533a.f16952f = 0;
                            c1533a.f16953g = 0;
                            c1533a.f16954h = 0;
                            c1533a.i = 0;
                            oVar4.C(0);
                            c1533a.f16949c = false;
                        }
                        oVar2 = oVar;
                        oVar2.F(i24);
                        bVar2 = bVar;
                    }
                    ArrayList arrayList3 = arrayList;
                    if (bVar2 != null) {
                        arrayList3.add(bVar2);
                    }
                    arrayList2 = arrayList3;
                    i18 = i10;
                    i15 = i8;
                    i19 = i9;
                    i16 = 3;
                    i17 = 2;
                }
                dVar.a(new C1444a(-9223372036854775807L, -9223372036854775807L, arrayList2));
                break;
            default:
                o oVar5 = (o) this.f1158s;
                oVar5.D(i + i5, bArr);
                oVar5.F(i);
                if (((Inflater) this.f1160u) == null) {
                    this.f1160u = new Inflater();
                }
                Inflater inflater2 = (Inflater) this.f1160u;
                int i38 = v.f18553a;
                if (oVar5.a() > 0 && (oVar5.f18539a[oVar5.f18540b] & 255) == 120) {
                    o oVar6 = (o) this.f1157r;
                    if (v.F(oVar5, oVar6, inflater2)) {
                        oVar5.D(oVar6.f18541c, oVar6.f18539a);
                    }
                }
                C1738a c1738a = (C1738a) this.f1159t;
                c1738a.f18880c = false;
                c1738a.f18884g = null;
                c1738a.f18885h = -1;
                c1738a.i = -1;
                int iA = oVar5.a();
                if (iA < 2 || oVar5.z() != iA) {
                    bVar3 = null;
                } else {
                    int[] iArr4 = c1738a.f18881d;
                    if (iArr4 != null && c1738a.f18879b) {
                        oVar5.G(oVar5.z() - 2);
                        int iZ2 = oVar5.z();
                        while (oVar5.f18540b < iZ2 && oVar5.a() > 0) {
                            int iT6 = oVar5.t();
                            int[] iArr5 = c1738a.f18878a;
                            switch (iT6) {
                                case 3:
                                    i14 = i20;
                                    if (oVar5.a() >= 2) {
                                        int iT7 = oVar5.t();
                                        int iT8 = oVar5.t();
                                        iArr5[3] = C1738a.a(iArr4, iT7 >> 4);
                                        iArr5[2] = C1738a.a(iArr4, iT7 & 15);
                                        iArr5[1] = C1738a.a(iArr4, iT8 >> 4);
                                        iArr5[0] = C1738a.a(iArr4, iT8 & 15);
                                        c1738a.f18880c = true;
                                        i20 = i14;
                                    }
                                    break;
                                case 4:
                                    i14 = i20;
                                    if (oVar5.a() >= 2 && c1738a.f18880c) {
                                        int iT9 = oVar5.t();
                                        int iT10 = oVar5.t();
                                        iArr5[3] = C1738a.c(iArr5[3], iT9 >> 4);
                                        iArr5[2] = C1738a.c(iArr5[2], iT9 & 15);
                                        iArr5[1] = C1738a.c(iArr5[1], iT10 >> 4);
                                        iArr5[0] = C1738a.c(iArr5[0], iT10 & 15);
                                        i20 = i14;
                                    }
                                    break;
                                case 5:
                                    if (oVar5.a() >= 6) {
                                        int iT11 = oVar5.t();
                                        int iT12 = oVar5.t();
                                        int i39 = (iT11 << i20) | (iT12 >> 4);
                                        int iT13 = ((iT12 & 15) << 8) | oVar5.t();
                                        int iT14 = oVar5.t();
                                        int iT15 = oVar5.t();
                                        i14 = i20;
                                        c1738a.f18884g = new Rect(i39, (iT14 << i20) | (iT15 >> 4), iT13 + 1, (((iT15 & 15) << 8) | oVar5.t()) + 1);
                                        i20 = i14;
                                    }
                                    break;
                                case Z.g.STRING_SET_FIELD_NUMBER /* 6 */:
                                    if (oVar5.a() >= i20) {
                                        c1738a.f18885h = oVar5.z();
                                        c1738a.i = oVar5.z();
                                    }
                                    break;
                            }
                        }
                    }
                    if (c1738a.f18881d != null && c1738a.f18879b && c1738a.f18880c && (rect = c1738a.f18884g) != null && c1738a.f18885h != -1 && c1738a.i != -1 && rect.width() >= 2 && c1738a.f18884g.height() >= 2) {
                        Rect rect2 = c1738a.f18884g;
                        int[] iArr6 = new int[rect2.height() * rect2.width()];
                        H h8 = new H();
                        oVar5.F(c1738a.f18885h);
                        h8.p(oVar5);
                        c1738a.b(h8, true, rect2, iArr6);
                        oVar5.F(c1738a.i);
                        h8.p(oVar5);
                        c1738a.b(h8, false, rect2, iArr6);
                        bVar3 = new w0.b(null, null, null, Bitmap.createBitmap(iArr6, rect2.width(), rect2.height(), Bitmap.Config.ARGB_8888), rect2.top / c1738a.f18883f, 0, 0, rect2.left / c1738a.f18882e, 0, Integer.MIN_VALUE, -3.4028235E38f, rect2.width() / c1738a.f18882e, rect2.height() / c1738a.f18883f, false, -16777216, Integer.MIN_VALUE, 0.0f);
                    }
                }
                if (bVar3 != null) {
                    wP = G.p(bVar3);
                } else {
                    E e8 = G.f1197r;
                    wP = W.f1225u;
                }
                dVar.a(new C1444a(-9223372036854775807L, 5000000L, wP));
                break;
        }
    }

    public void c(ComponentCallbacksC1023x componentCallbacksC1023x) {
        if (((ArrayList) this.f1157r).contains(componentCallbacksC1023x)) {
            throw new IllegalStateException("Fragment already added: " + componentCallbacksC1023x);
        }
        synchronized (((ArrayList) this.f1157r)) {
            ((ArrayList) this.f1157r).add(componentCallbacksC1023x);
        }
        componentCallbacksC1023x.f13257A = true;
    }

    @Override // q1.InterfaceC1456m
    public /* synthetic */ InterfaceC1447d d(byte[] bArr, int i, int i5) {
        int i8 = this.f1156q;
        return AbstractC0844a.a(this, bArr, i5);
    }

    public void e(Object obj, Object obj2, f0 f0Var, boolean z8) throws GeneralSecurityException {
        byte[] bArrArray;
        if (((ConcurrentHashMap) this.f1157r) == 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.D() != T3.Z.f6580s) {
            throw new GeneralSecurityException("only ENABLED key is allowed");
        }
        ConcurrentHashMap concurrentHashMap = (ConcurrentHashMap) this.f1157r;
        Integer numValueOf = Integer.valueOf(f0Var.B());
        if (f0Var.C() == r0.f6589u) {
            numValueOf = null;
        }
        H3.b bVarA = k.f5155b.a(q.c(f0Var.A().B(), f0Var.A().C(), f0Var.A().A(), f0Var.C(), numValueOf));
        int iOrdinal = f0Var.C().ordinal();
        if (iOrdinal == 1) {
            bArrArray = ByteBuffer.allocate(5).put((byte) 1).putInt(f0Var.B()).array();
        } else if (iOrdinal == 2) {
            bArrArray = ByteBuffer.allocate(5).put((byte) 0).putInt(f0Var.B()).array();
        } else if (iOrdinal != 3) {
            if (iOrdinal != 4) {
                throw new GeneralSecurityException("unknown output prefix type");
            }
            bArrArray = ByteBuffer.allocate(5).put((byte) 0).putInt(f0Var.B()).array();
        } else {
            bArrArray = H3.b.f3072a;
        }
        H3.k kVar = new H3.k(obj, obj2, bArrArray, f0Var.D(), f0Var.C(), f0Var.B(), f0Var.A().B(), bVarA);
        ArrayList arrayList = new ArrayList();
        arrayList.add(kVar);
        byte[] bArr = kVar.f3086c;
        H3.l lVar = new H3.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 (z8) {
            if (((H3.k) this.f1159t) != null) {
                throw new IllegalStateException("you cannot set two primary primitives");
            }
            this.f1159t = kVar;
        }
    }

    public void f(String str) {
        Objects.requireNonNull(str, "baseUrl == null");
        p pVar = new p();
        pVar.c(null, str);
        k7.q qVarA = pVar.a();
        if ("".equals(qVarA.f14126f.get(r0.size() - 1))) {
            this.f1159t = qVarA;
        } else {
            throw new IllegalArgumentException("baseUrl must end in /: " + qVarA);
        }
    }

    public V g() {
        if (((k7.q) this.f1159t) == null) {
            throw new IllegalStateException("Base URL required.");
        }
        k7.w wVar = (k7.w) this.f1158s;
        if (wVar == null) {
            wVar = new k7.w();
        }
        ExecutorC0117a executorC0117a = M.f2622a;
        C0118b c0118b = M.f2624c;
        ArrayList arrayList = new ArrayList((ArrayList) this.f1160u);
        List listA = c0118b.a(executorC0117a);
        arrayList.addAll(listA);
        List listB = c0118b.b();
        int size = listB.size();
        ArrayList arrayList2 = (ArrayList) this.f1157r;
        ArrayList arrayList3 = new ArrayList(arrayList2.size() + 1 + size);
        arrayList3.add(new C0119c(0));
        arrayList3.addAll(arrayList2);
        arrayList3.addAll(listB);
        k7.q qVar = (k7.q) this.f1159t;
        List listUnmodifiableList = Collections.unmodifiableList(arrayList3);
        List listUnmodifiableList2 = Collections.unmodifiableList(arrayList);
        listA.size();
        return new V(wVar, qVar, listUnmodifiableList, listUnmodifiableList2);
    }

    public P3.k h() throws GeneralSecurityException {
        Integer num = (Integer) this.f1158s;
        if (num == null) {
            throw new GeneralSecurityException("key size is not set");
        }
        if (((Integer) this.f1157r) == null) {
            throw new GeneralSecurityException("tag size is not set");
        }
        if (((P3.d) this.f1159t) == null) {
            throw new GeneralSecurityException("hash type is not set");
        }
        if (((P3.d) this.f1160u) == 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.f1158s));
        }
        Integer num2 = (Integer) this.f1157r;
        int iIntValue = num2.intValue();
        P3.d dVar = (P3.d) this.f1159t;
        if (iIntValue < 10) {
            throw new GeneralSecurityException(String.format("Invalid tag size in bytes %d; must be at least 10 bytes", num2));
        }
        if (dVar == P3.d.f5456g) {
            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 == P3.d.f5457h) {
            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 == P3.d.i) {
            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 == P3.d.f5458j) {
            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 != P3.d.f5459k) {
                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 P3.k(((Integer) this.f1158s).intValue(), ((Integer) this.f1157r).intValue(), (P3.d) this.f1160u, (P3.d) this.f1159t);
    }

    public void i(int i) {
        boolean zJ;
        LinkedList linkedList = (LinkedList) this.f1160u;
        m6.f fVar = (m6.f) linkedList.peekLast();
        if (fVar != null) {
            if (fVar.f14678c != Integer.signum(i)) {
                linkedList.removeLast();
            }
        }
        Iterator it = linkedList.iterator();
        P6.g.d(it, "iterator(...)");
        while (it.hasNext()) {
            Object next = it.next();
            P6.g.d(next, "next(...)");
            m6.f fVar2 = (m6.f) next;
            C0966a c0966a = (C0966a) this.f1157r;
            View view = fVar2.f14676a;
            int iE = c0966a.e(view, fVar2.f14677b);
            if (iE != 0 && Integer.signum(iE) == fVar2.f14678c) {
                t0 t0VarE = ((i6.c) this.f1159t).e(view);
                if (t0VarE == null) {
                    zJ = true;
                } else {
                    ViewGroup.LayoutParams layoutParams = t0VarE.f4654a.getLayoutParams();
                    P6.g.c(layoutParams, "null cannot be cast to non-null type androidx.recyclerview.widget.RecyclerView.LayoutParams");
                    zJ = ((C0203d0) layoutParams).f4520q.j();
                }
                if (zJ) {
                }
            }
            it.remove();
        }
    }

    public void j(Object obj, ArrayList arrayList, HashSet hashSet) {
        if (arrayList.contains(obj)) {
            return;
        }
        if (hashSet.contains(obj)) {
            throw new RuntimeException("This graph contains cyclic dependencies");
        }
        hashSet.add(obj);
        ArrayList arrayList2 = (ArrayList) ((q.i) this.f1159t).get(obj);
        if (arrayList2 != null) {
            int size = arrayList2.size();
            for (int i = 0; i < size; i++) {
                j(arrayList2.get(i), arrayList, hashSet);
            }
        }
        hashSet.remove(obj);
        arrayList.add(obj);
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object k(G6.c cVar) throws Throwable {
        C0342i c0342i;
        a aVar;
        C0336c c0336c;
        if (cVar instanceof C0342i) {
            c0342i = (C0342i) cVar;
            int i = c0342i.f6997w;
            if ((i & Integer.MIN_VALUE) != 0) {
                c0342i.f6997w = i - Integer.MIN_VALUE;
            } else {
                c0342i = new C0342i(this, cVar);
            }
        }
        Object objG = c0342i.f6995u;
        F6.a aVar2 = F6.a.f2580q;
        int i5 = c0342i.f6997w;
        if (i5 == 0) {
            C1.N(objG);
            List list = (List) this.f1159t;
            K k8 = (K) this.f1160u;
            if (list == null || list.isEmpty()) {
                c0342i.f6994t = this;
                c0342i.f6997w = 1;
                objG = K.g(k8, false, c0342i);
                if (objG != aVar2) {
                    aVar = this;
                    c0336c = (C0336c) objG;
                }
            } else {
                U uH = k8.h();
                C0345l c0345l = new C0345l(k8, this, null);
                c0342i.f6994t = this;
                c0342i.f6997w = 2;
                objG = uH.b(c0345l, c0342i);
                if (objG != aVar2) {
                    aVar = this;
                    c0336c = (C0336c) objG;
                }
            }
            return aVar2;
        }
        if (i5 == 1) {
            aVar = c0342i.f6994t;
            C1.N(objG);
            c0336c = (C0336c) objG;
        } else {
            if (i5 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            aVar = c0342i.f6994t;
            C1.N(objG);
            c0336c = (C0336c) objG;
        }
        ((K) aVar.f1160u).f6942h.c(c0336c);
        return n.f457a;
    }

    public synchronized ExecutorService l() {
        ThreadPoolExecutor threadPoolExecutor;
        try {
            if (((ThreadPoolExecutor) this.f1158s) == null) {
                TimeUnit timeUnit = TimeUnit.SECONDS;
                SynchronousQueue synchronousQueue = new SynchronousQueue();
                String str = l7.b.f14418g + " Dispatcher";
                P6.g.e(str, "name");
                this.f1158s = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L, timeUnit, synchronousQueue, new l7.a(str, false));
            }
            threadPoolExecutor = (ThreadPoolExecutor) this.f1158s;
            P6.g.b(threadPoolExecutor);
        } catch (Throwable th) {
            throw th;
        }
        return threadPoolExecutor;
    }

    public ComponentCallbacksC1023x m(String str) {
        h0.W w4 = (h0.W) ((HashMap) this.f1158s).get(str);
        if (w4 != null) {
            return w4.f13125c;
        }
        return null;
    }

    public ComponentCallbacksC1023x n(String str) {
        for (h0.W w4 : ((HashMap) this.f1158s).values()) {
            if (w4 != null) {
                ComponentCallbacksC1023x componentCallbacksC1023xN = w4.f13125c;
                if (!str.equals(componentCallbacksC1023xN.f13297u)) {
                    componentCallbacksC1023xN = componentCallbacksC1023xN.f13267M.f13069c.n(str);
                }
                if (componentCallbacksC1023xN != null) {
                    return componentCallbacksC1023xN;
                }
            }
        }
        return null;
    }

    public void o(ArrayDeque arrayDeque, Object obj) {
        synchronized (this) {
            if (!arrayDeque.remove(obj)) {
                throw new AssertionError("Call wasn't in-flight!");
            }
        }
        A();
    }

    public void p(o7.f fVar) {
        fVar.f15961r.decrementAndGet();
        o((ArrayDeque) this.f1159t, fVar);
    }

    public ArrayList q() {
        ArrayList arrayList = new ArrayList();
        for (h0.W w4 : ((HashMap) this.f1158s).values()) {
            if (w4 != null) {
                arrayList.add(w4);
            }
        }
        return arrayList;
    }

    public ArrayList r() {
        ArrayList arrayList = new ArrayList();
        for (h0.W w4 : ((HashMap) this.f1158s).values()) {
            if (w4 != null) {
                arrayList.add(w4.f13125c);
            } else {
                arrayList.add(null);
            }
        }
        return arrayList;
    }

    @Override // q1.InterfaceC1456m
    public /* synthetic */ void reset() {
        int i = this.f1156q;
    }

    public int s(p0 p0Var) {
        P6.g.e(p0Var, "state");
        C0890b c0890b = (C0890b) this.f1158s;
        if (c0890b.b()) {
            return c0890b.f12500b;
        }
        if (p0Var.b() < 1) {
            return 0;
        }
        return ((i6.c) this.f1157r).j(p0Var.b() - 1) + 1;
    }

    public List t() {
        ArrayList arrayList;
        if (((ArrayList) this.f1157r).isEmpty()) {
            return Collections.EMPTY_LIST;
        }
        synchronized (((ArrayList) this.f1157r)) {
            arrayList = new ArrayList((ArrayList) this.f1157r);
        }
        return arrayList;
    }

    public String toString() {
        switch (this.f1156q) {
            case 10:
                return "horizontal=" + ((R0) this.f1157r) + "; vertical=" + ((R0) this.f1158s);
            default:
                return super.toString();
        }
    }

    public int u(p0 p0Var) {
        P6.g.e(p0Var, "state");
        C0890b c0890b = (C0890b) this.f1158s;
        if (c0890b.a()) {
            return c0890b.f12500b;
        }
        if (p0Var.b() < 1) {
            return 0;
        }
        return ((i6.c) this.f1157r).j(p0Var.b() - 1) + 1;
    }

    public androidx.lifecycle.W v(P6.d dVar, String str) {
        androidx.lifecycle.W w4;
        androidx.lifecycle.W wA;
        P6.g.e(str, "key");
        synchronized (((C) this.f1160u)) {
            try {
                androidx.lifecycle.Z z8 = (androidx.lifecycle.Z) this.f1158s;
                z8.getClass();
                w4 = (androidx.lifecycle.W) z8.f8821a.get(str);
                if (dVar.d(w4)) {
                    Y y8 = (Y) this.f1157r;
                    if (y8 instanceof T) {
                        T t6 = (T) y8;
                        P6.g.b(w4);
                        O3.e eVar = t6.f8810d;
                        if (eVar != null) {
                            C0225a c0225a = t6.f8811e;
                            P6.g.b(c0225a);
                            P.a(w4, c0225a, eVar);
                        }
                    }
                    P6.g.c(w4, "null cannot be cast to non-null type T of androidx.lifecycle.viewmodel.ViewModelProviderImpl.getViewModel");
                } else {
                    C1484c c1484c = new C1484c((AbstractC1483b) this.f1159t);
                    c1484c.f16348a.put(P.f8801e, str);
                    Y y9 = (Y) this.f1157r;
                    try {
                        try {
                            wA = y9.c(dVar, c1484c);
                        } catch (AbstractMethodError unused) {
                            wA = y9.b(X1.m(dVar), c1484c);
                        }
                    } catch (AbstractMethodError unused2) {
                        wA = y9.a(X1.m(dVar));
                    }
                    w4 = wA;
                    androidx.lifecycle.Z z9 = (androidx.lifecycle.Z) this.f1158s;
                    z9.getClass();
                    P6.g.e(w4, "viewModel");
                    androidx.lifecycle.W w6 = (androidx.lifecycle.W) z9.f8821a.put(str, w4);
                    if (w6 != null) {
                        w6.b();
                    }
                }
            } catch (Throwable th) {
                throw th;
            }
        }
        return w4;
    }

    public boolean w() {
        C0890b c0890b = (C0890b) this.f1158s;
        return c0890b.f12512o && c0890b.f12514q != Integer.MAX_VALUE;
    }

    /* JADX WARN: Removed duplicated region for block: B:26:0x006f  */
    /* JADX WARN: Removed duplicated region for block: B:28:0x0078  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x00c4  */
    /* JADX WARN: Removed duplicated region for block: B:42:0x00cd  */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Object x(boolean z8, G6.c cVar) throws Throwable {
        C1372k c1372k;
        a aVar;
        a aVar2;
        X4.c cVar2;
        X4.c cVar3;
        a aVar3;
        X4.c cVar4;
        if (cVar instanceof C1372k) {
            c1372k = (C1372k) cVar;
            int i = c1372k.f15776x;
            if ((i & Integer.MIN_VALUE) != 0) {
                c1372k.f15776x = i - Integer.MIN_VALUE;
            } else {
                c1372k = new C1372k(this, cVar);
            }
        }
        Object objA = c1372k.f15774v;
        F6.a aVar4 = F6.a.f2580q;
        int i5 = c1372k.f15776x;
        int i8 = 4;
        if (i5 == 0) {
            C1.N(objA);
            C0926C c0926c = (C0926C) this.f1158s;
            if (z8) {
                c1372k.f15772t = this;
                c1372k.f15776x = 1;
                c0926c.getClass();
                x xVar = AbstractC1033b.f13423a;
                objA = AbstractC1033b.a(new C0957r(c0926c, null), c1372k);
                if (objA != aVar4) {
                    aVar2 = this;
                    cVar2 = (X4.c) objA;
                    if (!(cVar2 instanceof X4.a)) {
                    }
                }
            } else {
                c1372k.f15772t = this;
                c1372k.f15776x = 2;
                c0926c.getClass();
                x xVar2 = AbstractC1033b.f13423a;
                objA = AbstractC1033b.a(new C0949j(c0926c, null), c1372k);
                if (objA != aVar4) {
                    aVar = this;
                    cVar3 = (X4.c) objA;
                    if (!(cVar3 instanceof X4.a)) {
                    }
                }
            }
            return aVar4;
        }
        if (i5 == 1) {
            aVar2 = c1372k.f15772t;
            C1.N(objA);
            cVar2 = (X4.c) objA;
            if (!(cVar2 instanceof X4.a)) {
                return C1.j(((X4.a) cVar2).f7227a);
            }
            if (!(cVar2 instanceof X4.b)) {
                throw new A6.b();
            }
            C1075f c1075f = (C1075f) aVar2.f1159t;
            List list = (List) ((X4.b) cVar2).f7228a;
            c1075f.getClass();
            List listU = u0.u(c1075f, list);
            g6.o oVar = g6.o.f12958a;
            return new C1104d(new Shortcut(i8, oVar.o(), oVar.p()), listU);
        }
        if (i5 != 2) {
            if (i5 != 3) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            cVar4 = c1372k.f15773u;
            aVar3 = c1372k.f15772t;
            C1.N(objA);
            C1076g c1076g = (C1076g) aVar3.f1157r;
            List list2 = (List) ((X4.b) cVar4).f7228a;
            c1076g.getClass();
            List listU2 = u0.u(c1076g, list2);
            g6.o oVar2 = g6.o.f12958a;
            return new C1104d(new Shortcut(i8, oVar2.o(), oVar2.p()), listU2);
        }
        aVar = c1372k.f15772t;
        C1.N(objA);
        cVar3 = (X4.c) objA;
        if (!(cVar3 instanceof X4.a)) {
            return C1.j(((X4.a) cVar3).f7227a);
        }
        if (!(cVar3 instanceof X4.b)) {
            throw new A6.b();
        }
        C0926C c0926c2 = (C0926C) aVar.f1158s;
        List list3 = (List) ((X4.b) cVar3).f7228a;
        C1074e c1074e = (C1074e) aVar.f1160u;
        c1074e.getClass();
        List listU3 = u0.u(c1074e, list3);
        c1372k.f15772t = aVar;
        c1372k.f15773u = (X4.b) cVar3;
        c1372k.f15776x = 3;
        c0926c2.getClass();
        x xVar3 = AbstractC1033b.f13423a;
        if (AbstractC1033b.a(new C0924A(c0926c2, listU3, null), c1372k) != aVar4) {
            aVar3 = aVar;
            cVar4 = cVar3;
            C1076g c1076g2 = (C1076g) aVar3.f1157r;
            List list22 = (List) ((X4.b) cVar4).f7228a;
            c1076g2.getClass();
            List listU22 = u0.u(c1076g2, list22);
            g6.o oVar22 = g6.o.f12958a;
            return new C1104d(new Shortcut(i8, oVar22.o(), oVar22.p()), listU22);
        }
        return aVar4;
    }

    public void y(h0.W w4) {
        ComponentCallbacksC1023x componentCallbacksC1023x = w4.f13125c;
        String str = componentCallbacksC1023x.f13297u;
        HashMap map = (HashMap) this.f1158s;
        if (map.get(str) != null) {
            return;
        }
        map.put(componentCallbacksC1023x.f13297u, w4);
        if (h0.P.L(2)) {
            Log.v("FragmentManager", "Added fragment to active set " + componentCallbacksC1023x);
        }
    }

    public void z(h0.W w4) {
        ComponentCallbacksC1023x componentCallbacksC1023x = w4.f13125c;
        if (componentCallbacksC1023x.f13274T) {
            ((S) this.f1160u).h(componentCallbacksC1023x);
        }
        HashMap map = (HashMap) this.f1158s;
        if (map.get(componentCallbacksC1023x.f13297u) == w4 && ((h0.W) map.put(componentCallbacksC1023x.f13297u, null)) != null && h0.P.L(2)) {
            Log.v("FragmentManager", "Removed fragment from active set " + componentCallbacksC1023x);
        }
    }

    public a(a aVar, C0700t c0700t) {
        this.f1156q = 13;
        this.f1159t = new HashMap();
        this.f1160u = new HashMap();
        this.f1158s = aVar;
        this.f1157r = c0700t;
    }

    public a(C0785g0 c0785g0, String str) {
        this.f1156q = 14;
        this.f1159t = c0785g0;
        w.c(str);
        this.f1160u = str;
        this.f1158s = new Bundle();
    }

    public a(C0890b c0890b, C0966a c0966a, i6.c cVar) {
        this.f1156q = 19;
        this.f1158s = c0890b;
        this.f1157r = c0966a;
        this.f1159t = cVar;
        this.f1160u = new LinkedList();
    }

    public a(C0926C c0926c, C1076g c1076g, C1075f c1075f, C1074e c1074e) {
        this.f1156q = 20;
        P6.g.e(c0926c, "movieRepository");
        P6.g.e(c1076g, "continueWatchMapper");
        P6.g.e(c1075f, "continueLocalWatchMapper");
        P6.g.e(c1074e, "continueWatchEntityMapper");
        this.f1158s = c0926c;
        this.f1157r = c1076g;
        this.f1159t = c1075f;
        this.f1160u = c1074e;
    }

    public a(PivotLayoutManager pivotLayoutManager) {
        this.f1156q = 17;
        this.f1158s = pivotLayoutManager;
        this.f1157r = new SparseIntArray();
        this.f1159t = new SparseIntArray();
        this.f1160u = new SparseIntArray();
    }

    public a(InterfaceC0382w interfaceC0382w, C0111s c0111s, W.H h8) {
        this.f1156q = 9;
        this.f1158s = interfaceC0382w;
        this.f1157r = h8;
        this.f1159t = AbstractC0386a.e(Integer.MAX_VALUE, 6, null);
        this.f1160u = new P.g(10);
        d0 d0Var = (d0) interfaceC0382w.u().K(C0379t.f7546r);
        if (d0Var != null) {
            d0Var.Q(new C0108o(c0111s, 3, this));
        }
    }

    public a(PivotLayoutManager pivotLayoutManager, C0890b c0890b, i6.c cVar, C0891c c0891c, m6.d dVar) {
        this.f1156q = 15;
        this.f1158s = c0890b;
        this.f1157r = cVar;
        this.f1159t = c0891c;
        this.f1160u = dVar;
    }

    public a(androidx.lifecycle.Z z8, Y y8, AbstractC1483b abstractC1483b) {
        this.f1156q = 21;
        P6.g.e(z8, "store");
        P6.g.e(abstractC1483b, "defaultExtras");
        this.f1158s = z8;
        this.f1157r = y8;
        this.f1159t = abstractC1483b;
        this.f1160u = new C(14);
    }

    public a(String str, String str2, StackTraceElement[] stackTraceElementArr, a aVar) {
        this.f1156q = 23;
        this.f1160u = str;
        this.f1158s = str2;
        this.f1157r = stackTraceElementArr;
        this.f1159t = aVar;
    }

    public a(E6.i iVar) {
        this.f1156q = 7;
        P6.g.e(iVar, "backgroundDispatcher");
        this.f1158s = iVar;
        this.f1159t = new LinkedBlockingDeque(20);
        this.f1160u = new ServiceConnectionC0237m(1, this);
    }

    public a(u uVar) {
        this.f1156q = 5;
        this.f1158s = new HashMap(uVar.f5176a);
        this.f1157r = new HashMap(uVar.f5177b);
        this.f1159t = new HashMap(uVar.f5178c);
        this.f1160u = new HashMap(uVar.f5179d);
    }

    public a(List list) {
        int i;
        this.f1156q = 26;
        this.f1158s = new o();
        this.f1157r = new o();
        C1738a c1738a = new C1738a();
        this.f1159t = c1738a;
        String strTrim = new String((byte[]) list.get(0), StandardCharsets.UTF_8).trim();
        int i5 = v.f18553a;
        for (String str : strTrim.split("\\r?\\n", -1)) {
            if (str.startsWith("palette: ")) {
                String[] strArrSplit = str.substring(9).split(",", -1);
                c1738a.f18881d = new int[strArrSplit.length];
                for (int i8 = 0; i8 < strArrSplit.length; i8++) {
                    int[] iArr = c1738a.f18881d;
                    try {
                        i = Integer.parseInt(strArrSplit[i8].trim(), 16);
                    } catch (RuntimeException unused) {
                        i = 0;
                    }
                    iArr[i8] = i;
                }
            } else if (str.startsWith("size: ")) {
                String[] strArrSplit2 = str.substring(6).trim().split("x", -1);
                if (strArrSplit2.length == 2) {
                    try {
                        c1738a.f18882e = Integer.parseInt(strArrSplit2[0]);
                        c1738a.f18883f = Integer.parseInt(strArrSplit2[1]);
                        c1738a.f18879b = true;
                    } catch (RuntimeException e8) {
                        AbstractC1709a.C("VobsubParser", "Parsing IDX failed", e8);
                    }
                }
            }
        }
    }

    public a(Typeface typeface, C0761b c0761b) {
        int i;
        int i5;
        int i8;
        int i9;
        this.f1156q = 11;
        this.f1160u = typeface;
        this.f1158s = c0761b;
        this.f1159t = new c0.p(1024);
        int iA = c0761b.a(6);
        if (iA != 0) {
            int i10 = iA + c0761b.f1390q;
            i = ((ByteBuffer) c0761b.f1393t).getInt(((ByteBuffer) c0761b.f1393t).getInt(i10) + i10);
        } else {
            i = 0;
        }
        this.f1157r = new char[i * 2];
        int iA2 = c0761b.a(6);
        if (iA2 != 0) {
            int i11 = iA2 + c0761b.f1390q;
            i5 = ((ByteBuffer) c0761b.f1393t).getInt(((ByteBuffer) c0761b.f1393t).getInt(i11) + i11);
        } else {
            i5 = 0;
        }
        for (int i12 = 0; i12 < i5; i12++) {
            C0575l c0575l = new C0575l(this, i12);
            C0760a c0760aB = c0575l.b();
            int iA3 = c0760aB.a(4);
            Character.toChars(iA3 != 0 ? ((ByteBuffer) c0760aB.f1393t).getInt(iA3 + c0760aB.f1390q) : 0, (char[]) this.f1157r, i12 * 2);
            C0760a c0760aB2 = c0575l.b();
            int iA4 = c0760aB2.a(16);
            if (iA4 != 0) {
                int i13 = iA4 + c0760aB2.f1390q;
                i8 = ((ByteBuffer) c0760aB2.f1393t).getInt(((ByteBuffer) c0760aB2.f1393t).getInt(i13) + i13);
            } else {
                i8 = 0;
            }
            AbstractC0386a.f("invalid metadata codepoint length", i8 > 0);
            C0760a c0760aB3 = c0575l.b();
            int iA5 = c0760aB3.a(16);
            if (iA5 != 0) {
                int i14 = iA5 + c0760aB3.f1390q;
                i9 = ((ByteBuffer) c0760aB3.f1393t).getInt(((ByteBuffer) c0760aB3.f1393t).getInt(i14) + i14);
            } else {
                i9 = 0;
            }
            ((c0.p) this.f1159t).a(c0575l, 0, i9 - 1);
        }
    }

    public a(W w4, y0.i iVar, y0.i iVar2, y0.i iVar3) {
        Object objK;
        this.f1156q = 25;
        if (w4 != null) {
            objK = G.k(w4);
        } else {
            E e8 = G.f1197r;
            objK = W.f1225u;
        }
        this.f1158s = objK;
        this.f1157r = iVar;
        this.f1159t = iVar2;
        this.f1160u = iVar3;
    }

    public a(Class cls) {
        this.f1156q = 2;
        this.f1157r = new ConcurrentHashMap();
        this.f1158s = cls;
        this.f1160u = R3.a.f6057b;
    }

    public a(K k8, List list) {
        this.f1156q = 8;
        this.f1160u = k8;
        this.f1158s = i7.e.a();
        this.f1157r = AbstractC0385z.a();
        this.f1159t = B6.k.x0(list);
    }

    public a(int i) {
        this.f1156q = i;
        switch (i) {
            case 5:
                this.f1158s = new HashMap();
                this.f1157r = new HashMap();
                this.f1159t = new HashMap();
                this.f1160u = new HashMap();
                break;
            case 10:
                R0 r02 = new R0();
                this.f1158s = r02;
                R0 r03 = new R0();
                this.f1157r = r03;
                this.f1159t = r03;
                this.f1160u = r02;
                break;
            case 12:
                C0700t c0700t = new C0700t(0);
                this.f1158s = c0700t;
                a aVar = new a((a) null, c0700t);
                this.f1159t = aVar;
                this.f1157r = aVar.M();
                C0674n2 c0674n2 = new C0674n2(1);
                this.f1160u = c0674n2;
                aVar.U("require", new o4(c0674n2));
                ((HashMap) c0674n2.f9927a).put("internal.platform", new CallableC0622d0());
                aVar.U("runtime.counter", new C0636g(Double.valueOf(0.0d)));
                break;
            case 16:
                this.f1157r = new ArrayList();
                this.f1158s = new HashMap();
                this.f1159t = new HashMap();
                break;
            case 18:
                this.f1157r = new ArrayDeque();
                this.f1159t = new ArrayDeque();
                this.f1160u = new ArrayDeque();
                break;
            case 22:
                this.f1158s = new o();
                this.f1157r = new o();
                this.f1159t = new C1533a();
                break;
            case 27:
                this.f1158s = new L.b(10);
                this.f1159t = new q.i(0);
                this.f1157r = new ArrayList();
                this.f1160u = new HashSet();
                break;
            default:
                this.f1157r = new ArrayList();
                this.f1160u = new ArrayList();
                break;
        }
    }

    public a(n0 n0Var, boolean[] zArr) {
        this.f1156q = 3;
        this.f1158s = n0Var;
        this.f1157r = zArr;
        int i = n0Var.f3883a;
        this.f1159t = new boolean[i];
        this.f1160u = new boolean[i];
    }
}
