package o;

import android.app.ActivityManager;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.ParcelFileDescriptor;
import android.os.Parcelable;
import android.os.Process;
import android.os.StrictMode;
import android.view.View;
import android.view.ViewParent;
import androidx.compose.foundation.layout.FillElement;
import androidx.compose.ui.input.pointer.PointerInputEventHandler;
import androidx.work.impl.WorkDatabase;
import androidx.work.impl.background.systemjob.SystemJobService;
import com.google.android.gms.common.R;
import com.google.android.gms.common.api.Api;
import com.google.android.gms.common.api.CommonStatusCodes;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.text.BreakIterator;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.wm0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public abstract class AbstractC2841wm0 {
    public static final C2943xq b;
    public static final C2943xq c;
    public static final C2943xq d;
    public static final C2943xq e;
    public static final C2943xq f;
    public static final C2943xq g;
    public static final C0203Hv h = new C0203Hv(false);
    public static final C0203Hv i = new C0203Hv(true);
    public static final C3025yj0 j = new C3025yj0(1);
    public static final String[] k = {"ad_activeview", "ad_click", "ad_exposure", "ad_query", "ad_reward", "adunit_exposure", "app_clear_data", "app_exception", "app_remove", "app_store_refund", "app_store_subscription_cancel", "app_store_subscription_convert", "app_store_subscription_renew", "app_upgrade", "app_update", "ga_campaign", "error", "first_open", "first_visit", "in_app_purchase", "notification_dismiss", "notification_foreground", "notification_open", "notification_receive", "os_update", "session_start", "session_start_with_rollout", "user_engagement", "ad_impression", "screen_view", "ga_extra_parameter", "app_background", "firebase_campaign"};
    public static final String[] l = {"ad_impression"};
    public static final String[] m = {"_aa", "_ac", "_xa", "_aq", "_ar", "_xu", "_cd", "_ae", "_ui", "app_store_refund", "app_store_subscription_cancel", "app_store_subscription_convert", "app_store_subscription_renew", "_ug", "_au", "_cmp", "_err", "_f", "_v", "_iap", "_nd", "_nf", "_no", "_nr", "_ou", "_s", "_ssr", "_e", "_ai", "_vs", "_ep", "_ab", "_cmp"};
    public static final String[] n = {"purchase", "refund", "add_payment_info", "add_shipping_info", "add_to_cart", "add_to_wishlist", "begin_checkout", "remove_from_cart", "select_item", "select_promotion", "view_cart", "view_item", "view_item_list", "view_promotion", "ecommerce_purchase", "purchase_refund", "set_checkout_option", "checkout_progress", "select_content", "view_search_results"};

    /* renamed from: o, reason: collision with root package name */
    public static CG f779o;
    public static C2493t4 p;
    public static T2 q;
    public static C3113zg r;
    public static CG s;
    public static CG t;
    public final /* synthetic */ int a = 21;

    static {
        int i2 = 4;
        b = new C2943xq("CLOSED", i2);
        c = new C2943xq("COMPLETING_ALREADY", i2);
        d = new C2943xq("COMPLETING_WAITING_CHILDREN", i2);
        e = new C2943xq("COMPLETING_RETRY", i2);
        f = new C2943xq("TOO_LATE_TO_CANCEL", i2);
        g = new C2943xq("SEALED", i2);
    }

    /* JADX WARN: Multi-variable type inference failed */
    public static final void A(LP lp, NC nc) {
        C1670kT c1670kT = lp.r;
        if (c1670kT == null) {
            c1670kT = new C1670kT((InterfaceC1575jT) lp);
            lp.r = c1670kT;
        }
        ((C2207q3) AbstractC2539te.T(lp)).getSnapshotObserver().a(c1670kT, C2291qw.z, nc);
    }

    public static final C1563jH B(String str, C0321Mk c0321Mk, int i2) {
        Object objK = c0321Mk.K();
        if (objK == C0140Fk.a) {
            objK = new C1563jH();
            c0321Mk.f0(objK);
        }
        C1563jH c1563jH = (C1563jH) objK;
        c1563jH.a(0, c0321Mk);
        return c1563jH;
    }

    public static final void C(View view, InterfaceC1925n40 interfaceC1925n40) {
        view.setTag(R.id.view_tree_saved_state_registry_owner, interfaceC1925n40);
    }

    public static void D(View view, C1092eO c1092eO) {
        C1338gv c1338gv = c1092eO.l.b;
        if (c1338gv == null || !c1338gv.a) {
            return;
        }
        float fE = 0.0f;
        for (ViewParent parent = view.getParent(); parent instanceof View; parent = parent.getParent()) {
            WeakHashMap weakHashMap = Oj0.a;
            fE += Gj0.e((View) parent);
        }
        C0997dO c0997dO = c1092eO.l;
        if (c0997dO.l != fE) {
            c0997dO.l = fE;
            c1092eO.m();
        }
    }

    public static void E(Drawable drawable, int i2) {
        drawable.setTint(i2);
    }

    public static void F(Drawable drawable, ColorStateList colorStateList) {
        drawable.setTintList(colorStateList);
    }

    public static void G(Drawable drawable, PorterDuff.Mode mode) {
        drawable.setTintMode(mode);
    }

    public static final Ma0 H(NC nc) {
        return new Ma0(nc);
    }

    public static final void I(String str) {
        throw new IllegalArgumentException(str);
    }

    public static final void J(String str) {
        throw new IndexOutOfBoundsException(str);
    }

    public static final Object K(Object obj) {
        WG wg;
        XG xg = obj instanceof XG ? (XG) obj : null;
        return (xg == null || (wg = xg.a) == null) ? obj : wg;
    }

    /* JADX WARN: Removed duplicated region for block: B:24:0x003e  */
    /* JADX WARN: Removed duplicated region for block: B:30:0x0082 A[Catch: SQLiteException -> 0x00b7, TryCatch #1 {SQLiteException -> 0x00b7, blocks: (B:26:0x0044, B:28:0x0074, B:30:0x0082, B:32:0x008a, B:33:0x008d, B:34:0x00b6, B:38:0x00bc, B:40:0x00bf, B:42:0x00c7, B:43:0x00ce, B:44:0x00d1, B:46:0x00d7, B:49:0x00e6, B:50:0x00ea, B:27:0x006d), top: B:60:0x0044, inners: #3 }] */
    /* JADX WARN: Removed duplicated region for block: B:38:0x00bc A[Catch: SQLiteException -> 0x00b7, LOOP:1: B:38:0x00bc->B:43:0x00ce, LOOP_START, PHI: r1
      0x00bc: PHI (r1v5 int) = (r1v4 int), (r1v6 int) binds: [B:37:0x00ba, B:43:0x00ce] A[DONT_GENERATE, DONT_INLINE], TryCatch #1 {SQLiteException -> 0x00b7, blocks: (B:26:0x0044, B:28:0x0074, B:30:0x0082, B:32:0x008a, B:33:0x008d, B:34:0x00b6, B:38:0x00bc, B:40:0x00bf, B:42:0x00c7, B:43:0x00ce, B:44:0x00d1, B:46:0x00d7, B:49:0x00e6, B:50:0x00ea, B:27:0x006d), top: B:60:0x0044, inners: #3 }] */
    /* JADX WARN: Removed duplicated region for block: B:46:0x00d7 A[Catch: SQLiteException -> 0x00b7, TryCatch #1 {SQLiteException -> 0x00b7, blocks: (B:26:0x0044, B:28:0x0074, B:30:0x0082, B:32:0x008a, B:33:0x008d, B:34:0x00b6, B:38:0x00bc, B:40:0x00bf, B:42:0x00c7, B:43:0x00ce, B:44:0x00d1, B:46:0x00d7, B:49:0x00e6, B:50:0x00ea, B:27:0x006d), top: B:60:0x0044, inners: #3 }] */
    /* JADX WARN: Removed duplicated region for block: B:54:0x00f5  */
    /* JADX WARN: Removed duplicated region for block: B:73:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:74:? A[SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static void L(o.Nq0 r10, android.database.sqlite.SQLiteDatabase r11, java.lang.String r12, java.lang.String r13, java.lang.String r14, java.lang.String[] r15) throws java.lang.Throwable {
        /*
            Method dump skipped, instructions count: 257
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: o.AbstractC2841wm0.L(o.Nq0, android.database.sqlite.SQLiteDatabase, java.lang.String, java.lang.String, java.lang.String, java.lang.String[]):void");
    }

    public static void M(Nq0 nq0, SQLiteDatabase sQLiteDatabase) {
        if (nq0 == null) {
            throw new IllegalArgumentException("Monitor must not be null");
        }
        C1984nl c1984nl = nq0.i;
        File file = new File(sQLiteDatabase.getPath());
        if (!file.setReadable(false, false)) {
            c1984nl.b("Failed to turn off database read permission");
        }
        if (!file.setWritable(false, false)) {
            c1984nl.b("Failed to turn off database write permission");
        }
        if (!file.setReadable(true, true)) {
            c1984nl.b("Failed to turn on database read permission for owner");
        }
        if (file.setWritable(true, true)) {
            return;
        }
        c1984nl.b("Failed to turn on database write permission for owner");
    }

    public static C1210ff a(int i2, int i3, int i4) {
        if ((i4 & 1) != 0) {
            i2 = 0;
        }
        if ((i4 & 2) != 0) {
            i3 = 1;
        }
        if (i2 == -2) {
            if (i3 != 1) {
                return new C1604jl(1, i3);
            }
            InterfaceC0736ah.a.getClass();
            return new C1210ff(C0655Zg.b);
        }
        if (i2 != -1) {
            return i2 != 0 ? i2 != Integer.MAX_VALUE ? i3 == 1 ? new C1210ff(i2) : new C1604jl(i2, i3) : new C1210ff(Api.BaseClientBuilder.API_PRIORITY_OTHER) : i3 == 1 ? new C1210ff(0) : new C1604jl(1, i3);
        }
        if (i3 == 1) {
            return new C1604jl(1, 2);
        }
        throw new IllegalArgumentException("CONFLATED capacity cannot be used with non-default onBufferOverflow");
    }

    /* JADX WARN: Removed duplicated region for block: B:46:0x00c0  */
    /* JADX WARN: Removed duplicated region for block: B:49:0x00cb  */
    /* JADX WARN: Removed duplicated region for block: B:51:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static final void b(o.A7 r11, o.SC r12, o.C0321Mk r13, int r14) {
        /*
            r0 = -149765515(0xfffffffff712c275, float:-2.9766383E33)
            r13.X(r0)
            o.jI r0 = r13.w
            o.AW r1 = r13.l()
            r2 = 201(0xc9, float:2.82E-43)
            o.XT r3 = o.AbstractC0373Ok.b
            r13.T(r2, r3)
            java.lang.Object r2 = r13.K()
            o.J7 r3 = o.C0140Fk.a
            boolean r3 = o.F3.c(r2, r3)
            r4 = 0
            if (r3 == 0) goto L22
            r2 = r4
            goto L24
        L22:
            o.zi0 r2 = (o.InterfaceC3118zi0) r2
        L24:
            java.lang.Object r3 = r11.f
            o.yZ r3 = (o.AbstractC3005yZ) r3
            o.zi0 r5 = r3.c(r11, r2)
            boolean r2 = r5.equals(r2)
            if (r2 != 0) goto L35
            r13.f0(r5)
        L35:
            boolean r6 = r13.Q
            r7 = 1
            r8 = 0
            if (r6 == 0) goto L52
            boolean r2 = r11.e
            if (r2 != 0) goto L48
            r2 = r1
            o.zW r2 = (o.C3097zW) r2
            boolean r2 = r2.containsKey(r3)
            if (r2 != 0) goto L4e
        L48:
            o.zW r1 = (o.C3097zW) r1
            o.zW r1 = r1.b(r3, r5)
        L4e:
            r13.I = r7
        L50:
            r2 = r8
            goto L8f
        L52:
            o.d90 r6 = r13.F
            int r9 = r6.g
            int[] r10 = r6.b
            java.lang.Object r6 = r6.b(r10, r9)
            o.AW r6 = (o.AW) r6
            boolean r9 = r13.z()
            if (r9 == 0) goto L66
            if (r2 != 0) goto L74
        L66:
            boolean r9 = r11.e
            if (r9 != 0) goto L82
            r9 = r1
            o.zW r9 = (o.C3097zW) r9
            boolean r9 = r9.containsKey(r3)
            if (r9 != 0) goto L74
            goto L82
        L74:
            if (r2 == 0) goto L7b
            boolean r2 = r13.v
            if (r2 != 0) goto L7b
            goto L80
        L7b:
            boolean r2 = r13.v
            if (r2 == 0) goto L80
            goto L88
        L80:
            r1 = r6
            goto L88
        L82:
            o.zW r1 = (o.C3097zW) r1
            o.zW r1 = r1.b(r3, r5)
        L88:
            boolean r2 = r13.x
            if (r2 != 0) goto L8e
            if (r6 == r1) goto L50
        L8e:
            r2 = r7
        L8f:
            if (r2 == 0) goto L98
            boolean r3 = r13.Q
            if (r3 != 0) goto L98
            r13.I(r1)
        L98:
            boolean r3 = r13.v
            r0.c(r3)
            r13.v = r2
            r13.J = r1
            r2 = 202(0xca, float:2.83E-43)
            o.XT r3 = o.AbstractC0373Ok.c
            r13.R(r2, r3, r8, r1)
            int r1 = r14 >> 3
            r1 = r1 & 14
            java.lang.Integer r1 = java.lang.Integer.valueOf(r1)
            r12.f(r13, r1)
            r13.q(r8)
            r13.q(r8)
            int r0 = r0.b()
            if (r0 == 0) goto Lc0
            goto Lc1
        Lc0:
            r7 = r8
        Lc1:
            r13.v = r7
            r13.J = r4
            o.L00 r13 = r13.s()
            if (r13 == 0) goto Ld3
            o.Tj r0 = new o.Tj
            r1 = 1
            r0.<init>(r14, r1, r11, r12)
            r13.d = r0
        Ld3:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: o.AbstractC2841wm0.b(o.A7, o.SC, o.Mk, int):void");
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:26:0x009d  */
    /* JADX WARN: Removed duplicated region for block: B:29:0x00a9  */
    /* JADX WARN: Removed duplicated region for block: B:31:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Type inference failed for: r2v4, types: [java.lang.Object, o.AW] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static final void c(o.A7[] r8, o.SC r9, o.C0321Mk r10, int r11) {
        /*
            r0 = 415205898(0x18bf8a0a, float:4.9511727E-24)
            r10.X(r0)
            o.jI r0 = r10.w
            o.AW r1 = r10.l()
            r2 = 201(0xc9, float:2.82E-43)
            o.XT r3 = o.AbstractC0373Ok.b
            r10.T(r2, r3)
            boolean r2 = r10.Q
            r3 = 1
            r4 = 0
            if (r2 == 0) goto L27
            o.zW r2 = o.C3097zW.f825o
            o.zW r2 = o.AbstractC0940cn0.L(r8, r1, r2)
            o.zW r1 = r10.e0(r1, r2)
            r10.I = r3
        L25:
            r2 = r4
            goto L6c
        L27:
            o.d90 r2 = r10.F
            int r5 = r2.g
            java.lang.Object r2 = r2.h(r5, r4)
            o.AW r2 = (o.AW) r2
            o.d90 r5 = r10.F
            int r6 = r5.g
            java.lang.Object r5 = r5.h(r6, r3)
            o.AW r5 = (o.AW) r5
            o.zW r6 = o.AbstractC0940cn0.L(r8, r1, r5)
            boolean r7 = r10.z()
            if (r7 == 0) goto L5d
            boolean r7 = r10.x
            if (r7 != 0) goto L5d
            boolean r5 = o.F3.c(r5, r6)
            if (r5 != 0) goto L50
            goto L5d
        L50:
            int r1 = r10.k
            o.d90 r5 = r10.F
            int r5 = r5.s()
            int r5 = r5 + r1
            r10.k = r5
            r1 = r2
            goto L25
        L5d:
            o.zW r1 = r10.e0(r1, r6)
            boolean r5 = r10.x
            if (r5 != 0) goto L6b
            boolean r2 = o.F3.c(r1, r2)
            if (r2 != 0) goto L25
        L6b:
            r2 = r3
        L6c:
            if (r2 == 0) goto L75
            boolean r5 = r10.Q
            if (r5 != 0) goto L75
            r10.I(r1)
        L75:
            boolean r5 = r10.v
            r0.c(r5)
            r10.v = r2
            r10.J = r1
            r2 = 202(0xca, float:2.83E-43)
            o.XT r5 = o.AbstractC0373Ok.c
            r10.R(r2, r5, r4, r1)
            int r1 = r11 >> 3
            r1 = r1 & 14
            java.lang.Integer r1 = java.lang.Integer.valueOf(r1)
            r9.f(r10, r1)
            r10.q(r4)
            r10.q(r4)
            int r0 = r0.b()
            if (r0 == 0) goto L9d
            goto L9e
        L9d:
            r3 = r4
        L9e:
            r10.v = r3
            r0 = 0
            r10.J = r0
            o.L00 r10 = r10.s()
            if (r10 == 0) goto Lb1
            o.Tj r0 = new o.Tj
            r1 = 2
            r0.<init>(r11, r1, r8, r9)
            r10.d = r0
        Lb1:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: o.AbstractC2841wm0.c(o.A7[], o.SC, o.Mk, int):void");
    }

    public static final void d(Boolean bool, MP mp, InterfaceC3052yy interfaceC3052yy, String str, C0554Vj c0554Vj, C0321Mk c0321Mk, int i2) {
        MP mp2;
        InterfaceC3052yy interfaceC3052yy2;
        String str2;
        c0321Mk.X(-513216493);
        int i3 = i2 | (c0321Mk.f(bool) ? 4 : 2) | 3504;
        if (c0321Mk.N(i3 & 1, (i3 & 9363) != 9362)) {
            C1311gh0 c1311gh0K = IJ.K(0, 7, null);
            C3114zg0 c3114zg0D = Eg0.d(bool, "Crossfade", c0321Mk, (i3 & 14) | 48, 0);
            JP jp = JP.a;
            e(c3114zg0D, jp, c1311gh0K, null, c0554Vj, c0321Mk, 25008);
            mp2 = jp;
            interfaceC3052yy2 = c1311gh0K;
            str2 = "Crossfade";
        } else {
            c0321Mk.Q();
            mp2 = mp;
            interfaceC3052yy2 = interfaceC3052yy;
            str2 = str;
        }
        L00 l00S = c0321Mk.s();
        if (l00S != null) {
            l00S.d = new K6(bool, mp2, interfaceC3052yy2, str2, c0554Vj, i2);
        }
    }

    public static final void e(C3114zg0 c3114zg0, MP mp, InterfaceC3052yy interfaceC3052yy, OC oc, C0554Vj c0554Vj, C0321Mk c0321Mk, int i2) {
        Object obj;
        OC oc2;
        boolean z;
        int i3;
        boolean z2;
        int iR;
        c0321Mk.X(-1877370462);
        int i4 = (i2 & 6) == 0 ? (c0321Mk.f(c3114zg0) ? 4 : 2) | i2 : i2;
        if ((i2 & 48) == 0) {
            i4 |= c0321Mk.f(mp) ? 32 : 16;
        }
        if ((i2 & 384) == 0) {
            i4 |= c0321Mk.h(interfaceC3052yy) ? 256 : 128;
        }
        int i5 = i4 | 3072;
        if ((i2 & 24576) == 0) {
            obj = c0554Vj;
            i5 |= c0321Mk.h(obj) ? 16384 : 8192;
        } else {
            obj = c0554Vj;
        }
        if (c0321Mk.N(i5 & 1, (i5 & 9363) != 9362)) {
            Object objK = c0321Mk.K();
            Object obj2 = C0140Fk.a;
            if (objK == obj2) {
                objK = C1160f3.K;
                c0321Mk.f0(objK);
            }
            OC oc3 = (OC) objK;
            Object objK2 = c0321Mk.K();
            Object obj3 = objK2;
            if (objK2 == obj2) {
                H90 h90 = new H90();
                h90.add(c3114zg0.c());
                c0321Mk.f0(h90);
                obj3 = h90;
            }
            H90 h902 = (H90) obj3;
            Object objK3 = c0321Mk.K();
            if (objK3 == obj2) {
                long[] jArr = AbstractC3064z40.a;
                objK3 = new ZQ();
                c0321Mk.f0(objK3);
            }
            ZQ zq = (ZQ) objK3;
            Object objC = c3114zg0.c();
            MV mv = c3114zg0.d;
            if (F3.c(objC, mv.getValue())) {
                c0321Mk.V(321189832);
                if (h902.size() == 1 && F3.c(h902.get(0), mv.getValue())) {
                    c0321Mk.V(321514464);
                    c0321Mk.q(false);
                    z2 = false;
                } else {
                    c0321Mk.V(321324186);
                    boolean z3 = (i5 & 14) == 4;
                    Object objK4 = c0321Mk.K();
                    if (z3 || objK4 == obj2) {
                        objK4 = new C2769w(12, c3114zg0);
                        c0321Mk.f0(objK4);
                    }
                    OC oc4 = (OC) objK4;
                    int iR2 = AbstractC0008Ai.R(h902);
                    if (iR2 >= 0) {
                        int i6 = 0;
                        i3 = 0;
                        while (true) {
                            Object obj4 = h902.get(i6);
                            if (!((Boolean) oc4.g(obj4)).booleanValue()) {
                                if (i3 != i6) {
                                    h902.set(i3, obj4);
                                }
                                i3++;
                            }
                            if (i6 == iR2) {
                                break;
                            } else {
                                i6++;
                            }
                        }
                    } else {
                        i3 = 0;
                    }
                    if (i3 < h902.size() && i3 <= (iR = AbstractC0008Ai.R(h902))) {
                        while (true) {
                            h902.remove(iR);
                            if (iR == i3) {
                                break;
                            } else {
                                iR--;
                            }
                        }
                    }
                    zq.a();
                    z2 = false;
                    c0321Mk.q(false);
                }
                c0321Mk.q(z2);
            } else {
                c0321Mk.V(321520416);
                c0321Mk.q(false);
            }
            if (zq.b(mv.getValue())) {
                z = false;
                c0321Mk.V(322323936);
                c0321Mk.q(false);
            } else {
                c0321Mk.V(321581083);
                ListIterator listIterator = h902.listIterator();
                int i7 = 0;
                while (true) {
                    C1083eF c1083eF = (C1083eF) listIterator;
                    if (!c1083eF.hasNext()) {
                        i7 = -1;
                        break;
                    } else if (F3.c(oc3.g(c1083eF.next()), oc3.g(mv.getValue()))) {
                        break;
                    } else {
                        i7++;
                    }
                }
                if (i7 == -1) {
                    h902.add(mv.getValue());
                } else {
                    h902.set(i7, mv.getValue());
                }
                zq.a();
                int size = h902.size();
                int i8 = 0;
                while (i8 < size) {
                    Object obj5 = h902.get(i8);
                    zq.m(obj5, C2887xC.y(-934471669, new C0196Ho(c3114zg0, interfaceC3052yy, obj5, obj, 0), c0321Mk));
                    i8++;
                    obj = c0554Vj;
                }
                z = false;
                c0321Mk.q(false);
            }
            InterfaceC2235qO interfaceC2235qOD = AbstractC3109ze.d(C0669Zu.m, z);
            int iHashCode = Long.hashCode(c0321Mk.R);
            AW awL = c0321Mk.l();
            MP mpF = AbstractC1692kh0.F(c0321Mk, mp);
            InterfaceC0062Ck.b.getClass();
            NC nc = C0036Bk.b;
            c0321Mk.Y();
            if (c0321Mk.Q) {
                c0321Mk.k(nc);
            } else {
                c0321Mk.i0();
            }
            AbstractC2378rs0.f0(interfaceC2235qOD, c0321Mk, C0036Bk.f);
            AbstractC2378rs0.f0(awL, c0321Mk, C0036Bk.e);
            C0975d6 c0975d6 = C0036Bk.i;
            if (c0321Mk.Q || !F3.c(c0321Mk.K(), Integer.valueOf(iHashCode))) {
                AbstractC2462sn.r(iHashCode, c0321Mk, iHashCode, c0975d6);
            }
            AbstractC2378rs0.f0(mpF, c0321Mk, C0036Bk.c);
            c0321Mk.V(-1312707512);
            int size2 = h902.size();
            for (int i9 = 0; i9 < size2; i9++) {
                Object obj6 = h902.get(i9);
                c0321Mk.R(1171574969, oc3.g(obj6), 0, null);
                SC sc = (SC) zq.g(obj6);
                if (sc == null) {
                    c0321Mk.V(1959122128);
                } else {
                    c0321Mk.V(1171576145);
                    sc.f(c0321Mk, 0);
                }
                c0321Mk.q(false);
                c0321Mk.q(false);
            }
            c0321Mk.q(false);
            c0321Mk.q(true);
            oc2 = oc3;
        } else {
            c0321Mk.Q();
            oc2 = oc;
        }
        L00 l00S = c0321Mk.s();
        if (l00S != null) {
            l00S.d = new C2497t6(c3114zg0, mp, interfaceC3052yy, oc2, c0554Vj, i2);
        }
    }

    public static final void f(int i2, C0321Mk c0321Mk) {
        C0321Mk c0321Mk2 = c0321Mk;
        c0321Mk2.X(1076713085);
        if (i2 == 0 && c0321Mk2.z()) {
            c0321Mk2.Q();
        } else {
            Context context = (Context) c0321Mk2.j(N3.b);
            C1563jH c1563jHB = B("success_pulse", c0321Mk2, 0);
            C1373hH c1373hHI = i(c1563jHB, 0.85f, 1.1f, IJ.w(IJ.K(1300, 2, AbstractC0590Wt.a), 4), "success_scale", c0321Mk2, 29112, 0);
            c0321Mk2.V(982818053);
            C0991dI c0991dI = new C0991dI(0, 2, 1);
            ArrayList arrayList = new ArrayList(AbstractC0034Bi.W(c0991dI, 10));
            Iterator it = c0991dI.iterator();
            while (true) {
                C0895cI c0895cI = (C0895cI) it;
                if (!c0895cI.n) {
                    break;
                }
                int iNextInt = c0895cI.nextInt();
                arrayList.add(i(c1563jHB, 0.0f, -6.0f, IJ.w(new C1311gh0(500, iNextInt * 120, AbstractC0590Wt.b), 4), AbstractC0126Ew.j(iNextInt, "dots_"), c0321Mk2, 4152, 0));
            }
            c0321Mk2.q(false);
            FillElement fillElement = androidx.compose.foundation.layout.c.b;
            MP mpB = androidx.compose.foundation.a.b(fillElement, AbstractC0752ap.c(4293980917L), j);
            C0159Gd c0159Gd = C0669Zu.m;
            InterfaceC2235qO interfaceC2235qOD = AbstractC3109ze.d(c0159Gd, false);
            int iHashCode = Long.hashCode(c0321Mk2.R);
            AW awL = c0321Mk2.l();
            MP mpF = AbstractC1692kh0.F(c0321Mk2, mpB);
            InterfaceC0062Ck.b.getClass();
            C0744al c0744al = C0036Bk.b;
            c0321Mk2.Y();
            if (c0321Mk2.Q) {
                c0321Mk2.k(c0744al);
            } else {
                c0321Mk2.i0();
            }
            C0975d6 c0975d6 = C0036Bk.f;
            AbstractC2378rs0.f0(interfaceC2235qOD, c0321Mk2, c0975d6);
            C0975d6 c0975d62 = C0036Bk.e;
            AbstractC2378rs0.f0(awL, c0321Mk2, c0975d62);
            C0975d6 c0975d63 = C0036Bk.i;
            if (c0321Mk2.Q || !F3.c(c0321Mk2.K(), Integer.valueOf(iHashCode))) {
                AbstractC2462sn.r(iHashCode, c0321Mk2, iHashCode, c0975d63);
            }
            C0975d6 c0975d64 = C0036Bk.c;
            AbstractC2378rs0.f0(mpF, c0321Mk2, c0975d64);
            C0579Wi c0579WiA = AbstractC0527Ui.a(AbstractC0981d9.c, C0669Zu.y, c0321Mk2, 0);
            int iHashCode2 = Long.hashCode(c0321Mk2.R);
            AW awL2 = c0321Mk2.l();
            MP mpF2 = AbstractC1692kh0.F(c0321Mk2, fillElement);
            c0321Mk2.Y();
            if (c0321Mk2.Q) {
                c0321Mk2.k(c0744al);
            } else {
                c0321Mk2.i0();
            }
            AbstractC2378rs0.f0(c0579WiA, c0321Mk2, c0975d6);
            AbstractC2378rs0.f0(awL2, c0321Mk2, c0975d62);
            if (c0321Mk2.Q || !F3.c(c0321Mk2.K(), Integer.valueOf(iHashCode2))) {
                AbstractC2462sn.r(iHashCode2, c0321Mk2, iHashCode2, c0975d63);
            }
            AbstractC2378rs0.f0(mpF2, c0321Mk2, c0975d64);
            JP jp = JP.a;
            MP mpG = AbstractC2378rs0.G(androidx.compose.foundation.layout.c.c(androidx.compose.foundation.layout.c.b(jp, 1.0f), 280));
            InterfaceC2235qO interfaceC2235qOD2 = AbstractC3109ze.d(c0159Gd, false);
            int iHashCode3 = Long.hashCode(c0321Mk2.R);
            AW awL3 = c0321Mk2.l();
            MP mpF3 = AbstractC1692kh0.F(c0321Mk2, mpG);
            c0321Mk2.Y();
            if (c0321Mk2.Q) {
                c0321Mk2.k(c0744al);
            } else {
                c0321Mk2.i0();
            }
            AbstractC2378rs0.f0(interfaceC2235qOD2, c0321Mk2, c0975d6);
            AbstractC2378rs0.f0(awL3, c0321Mk2, c0975d62);
            if (c0321Mk2.Q || !F3.c(c0321Mk2.K(), Integer.valueOf(iHashCode3))) {
                AbstractC2462sn.r(iHashCode3, c0321Mk2, iHashCode3, c0975d63);
            }
            AbstractC2378rs0.f0(mpF3, c0321Mk2, c0975d64);
            c0321Mk2.V(473822464);
            boolean zH = c0321Mk2.h(context);
            Object objK = c0321Mk2.K();
            if (zH || objK == C0140Fk.a) {
                objK = new C2672uy(context, 0);
                c0321Mk2.f0(objK);
            }
            c0321Mk2.q(false);
            androidx.compose.ui.viewinterop.a.b((OC) objK, AbstractC2378rs0.G(fillElement), null, c0321Mk2, 48);
            long j2 = C0190Hi.b;
            AbstractC3109ze.a(androidx.compose.foundation.a.a(fillElement, J7.t(AbstractC0008Ai.S(new C0190Hi(C0190Hi.b(0.75f, j2)), new C0190Hi(C0190Hi.b(0.45f, j2)), new C0190Hi(C0190Hi.f)))), c0321Mk2, 6);
            MP mpG2 = androidx.compose.foundation.layout.b.g(androidx.compose.foundation.layout.a.a.a(jp, C0669Zu.q), 24, 0.0f, 2);
            InterfaceC2235qO interfaceC2235qOD3 = AbstractC3109ze.d(c0159Gd, false);
            int iHashCode4 = Long.hashCode(c0321Mk2.R);
            AW awL4 = c0321Mk2.l();
            MP mpF4 = AbstractC1692kh0.F(c0321Mk2, mpG2);
            c0321Mk2.Y();
            if (c0321Mk2.Q) {
                c0321Mk2.k(c0744al);
            } else {
                c0321Mk2.i0();
            }
            AbstractC2378rs0.f0(interfaceC2235qOD3, c0321Mk2, c0975d6);
            AbstractC2378rs0.f0(awL4, c0321Mk2, c0975d62);
            if (c0321Mk2.Q || !F3.c(c0321Mk2.K(), Integer.valueOf(iHashCode4))) {
                AbstractC2462sn.r(iHashCode4, c0321Mk2, iHashCode4, c0975d63);
            }
            AbstractC2378rs0.f0(mpF4, c0321Mk2, c0975d64);
            Nb0.a(null, AbstractC2397s30.a(18), C0190Hi.b(0.55f, j2), 0L, 0, 8, null, C2887xC.y(-1598364573, new C2862wy(c1373hHI, 0), c0321Mk2), c0321Mk, 12804480, 73);
            c0321Mk.q(true);
            c0321Mk.q(true);
            float f2 = 32;
            Nb0.a(fillElement, AbstractC2397s30.b(f2, f2), AbstractC0752ap.c(4294507002L), 0L, 0.0f, 12, null, C2887xC.y(-1144332986, new C0296Lk(3, arrayList), c0321Mk), c0321Mk, 12779910, 88);
            c0321Mk2 = c0321Mk;
            c0321Mk2.q(true);
            c0321Mk2.q(true);
        }
        L00 l00S = c0321Mk2.s();
        if (l00S != null) {
            l00S.d = new X8(i2, 11);
        }
    }

    public static final void g(final boolean z, final int i2, final C2066oe0 c2066oe0, C0321Mk c0321Mk, final int i3) {
        int i4;
        Oe0 oe0D;
        c0321Mk.X(-1344558920);
        if ((i3 & 6) == 0) {
            i4 = (c0321Mk.g(z) ? 4 : 2) | i3;
        } else {
            i4 = i3;
        }
        if ((i3 & 48) == 0) {
            i4 |= c0321Mk.d(AbstractC2462sn.w(i2)) ? 32 : 16;
        }
        if ((i3 & 384) == 0) {
            i4 |= c0321Mk.h(c2066oe0) ? 256 : 128;
        }
        if (c0321Mk.N(i4 & 1, (i4 & 147) != 146)) {
            int i5 = i4 & 14;
            boolean zF = (i5 == 4) | c0321Mk.f(c2066oe0);
            Object objK = c0321Mk.K();
            J7 j7 = C0140Fk.a;
            if (zF || objK == j7) {
                objK = new C1686ke0(c2066oe0, z);
                c0321Mk.f0(objK);
            }
            Bd0 bd0 = (Bd0) objK;
            boolean zH = (i5 == 4) | c0321Mk.h(c2066oe0);
            Object objK2 = c0321Mk.K();
            if (zH || objK2 == j7) {
                objK2 = new C2256qe0(c2066oe0, z);
                c0321Mk.f0(objK2);
            }
            InterfaceC2145pT interfaceC2145pT = (InterfaceC2145pT) objK2;
            boolean zG = Ue0.g(c2066oe0.m().b);
            int i6 = (int) (z ? c2066oe0.m().b >> 32 : c2066oe0.m().b & 4294967295L);
            MK mk = c2066oe0.d;
            float fE = 0.0f;
            if (mk != null && (oe0D = mk.d()) != null) {
                Ne0 ne0 = oe0D.a;
                if (i6 >= 0) {
                    Me0 me0 = ne0.a;
                    C2331rQ c2331rQ = ne0.b;
                    if (me0.a.m.length() != 0) {
                        int iMin = Math.min(c2331rQ.d(i6), Math.min(c2331rQ.b - 1, c2331rQ.f - 1));
                        if (i6 <= c2331rQ.c(iMin, false)) {
                            c2331rQ.l(iMin);
                            ArrayList arrayList = c2331rQ.h;
                            BV bv = (BV) arrayList.get(AbstractC0249Jp.G(iMin, arrayList));
                            J4 j4 = bv.a;
                            int i7 = iMin - bv.d;
                            Le0 le0 = j4.d;
                            fE = le0.e(i7) - le0.g(i7);
                        }
                    }
                }
            }
            float f2 = fE;
            boolean zH2 = c0321Mk.h(bd0);
            Object objK3 = c0321Mk.K();
            if (zH2 || objK3 == j7) {
                objK3 = new C1639k4(5, bd0);
                c0321Mk.f0(objK3);
            }
            AbstractC0752ap.i(interfaceC2145pT, z, i2, zG, 0L, f2, Tb0.a(JP.a, bd0, (PointerInputEventHandler) objK3), c0321Mk, (i4 << 3) & 1008);
        } else {
            c0321Mk.Q();
        }
        L00 l00S = c0321Mk.s();
        if (l00S != null) {
            l00S.d = new SC() { // from class: o.pe0
                @Override // o.SC
                public final Object f(Object obj, Object obj2) {
                    ((Integer) obj2).getClass();
                    int iD = AbstractC1904ms0.D(i3 | 1);
                    AbstractC2841wm0.g(z, i2, c2066oe0, (C0321Mk) obj, iD);
                    return Oh0.a;
                }
            };
        }
    }

    public static final void h(H0 h0, R50 r50) {
        if (Co0.f(r50)) {
            N50 n50 = r50.d;
            Object objG = n50.l.g(M50.g);
            if (objG == null) {
                objG = null;
            }
            C1726l0 c1726l0 = (C1726l0) objG;
            if (c1726l0 != null) {
                h0.b(new C0(android.R.id.accessibilityActionSetProgress, c1726l0.a));
            }
        }
    }

    public static final C1373hH i(C1563jH c1563jH, float f2, float f3, C1277gH c1277gH, String str, C0321Mk c0321Mk, int i2, int i3) {
        Float fValueOf = Float.valueOf(f2);
        Float fValueOf2 = Float.valueOf(f3);
        int i4 = (i2 & 1022) | 32768 | ((i2 << 3) & 458752);
        Object objK = c0321Mk.K();
        Object obj = C0140Fk.a;
        if (objK == obj) {
            objK = new C1373hH(c1563jH, fValueOf, fValueOf2, c1277gH);
            c0321Mk.f0(objK);
        }
        C1373hH c1373hH = (C1373hH) objK;
        boolean zH = ((((i4 & 896) ^ 384) > 256 && c0321Mk.h(fValueOf2)) || (i4 & 384) == 256) | c0321Mk.h(c1277gH);
        Object objK2 = c0321Mk.K();
        if (zH || objK2 == obj) {
            Object c0513Tu = new C0513Tu(fValueOf, c1373hH, fValueOf2, c1277gH, 2);
            c0321Mk.f0(c0513Tu);
            objK2 = c0513Tu;
        }
        AbstractC0249Jp.k((NC) objK2, c0321Mk);
        boolean zH2 = c0321Mk.h(c1563jH);
        Object objK3 = c0321Mk.K();
        if (zH2 || objK3 == obj) {
            objK3 = new C1590je(7, c1563jH, c1373hH);
            c0321Mk.f0(objK3);
        }
        AbstractC0249Jp.b(c1373hH, (OC) objK3, c0321Mk);
        return c1373hH;
    }

    public static final T00 j(InterfaceC1184fK interfaceC1184fK) {
        InterfaceC1184fK interfaceC1184fKL = interfaceC1184fK.l();
        return interfaceC1184fKL != null ? interfaceC1184fKL.h(interfaceC1184fK, true) : new T00(0.0f, 0.0f, (int) (interfaceC1184fK.K() >> 32), (int) (interfaceC1184fK.K() & 4294967295L));
    }

    public static final T00 k(InterfaceC1184fK interfaceC1184fK) {
        InterfaceC1184fK interfaceC1184fKS = s(interfaceC1184fK);
        float fK = (int) (interfaceC1184fKS.K() >> 32);
        float fK2 = (int) (interfaceC1184fKS.K() & 4294967295L);
        T00 t00H = interfaceC1184fKS.h(interfaceC1184fK, true);
        float f2 = t00H.a;
        if (f2 < 0.0f) {
            f2 = 0.0f;
        }
        if (f2 > fK) {
            f2 = fK;
        }
        float f3 = t00H.b;
        if (f3 < 0.0f) {
            f3 = 0.0f;
        }
        if (f3 > fK2) {
            f3 = fK2;
        }
        float f4 = t00H.c;
        if (f4 < 0.0f) {
            f4 = 0.0f;
        }
        if (f4 <= fK) {
            fK = f4;
        }
        float f5 = t00H.d;
        float f6 = f5 >= 0.0f ? f5 : 0.0f;
        if (f6 <= fK2) {
            fK2 = f6;
        }
        if (f2 == fK || f3 == fK2) {
            return T00.e;
        }
        long jI = interfaceC1184fKS.i((Float.floatToRawIntBits(f2) << 32) | (Float.floatToRawIntBits(f3) & 4294967295L));
        long jI2 = interfaceC1184fKS.i((Float.floatToRawIntBits(f3) & 4294967295L) | (Float.floatToRawIntBits(fK) << 32));
        long jI3 = interfaceC1184fKS.i((Float.floatToRawIntBits(fK) << 32) | (Float.floatToRawIntBits(fK2) & 4294967295L));
        long jI4 = interfaceC1184fKS.i((Float.floatToRawIntBits(fK2) & 4294967295L) | (Float.floatToRawIntBits(f2) << 32));
        float fIntBitsToFloat = Float.intBitsToFloat((int) (jI >> 32));
        float fIntBitsToFloat2 = Float.intBitsToFloat((int) (jI2 >> 32));
        float fIntBitsToFloat3 = Float.intBitsToFloat((int) (jI4 >> 32));
        float fIntBitsToFloat4 = Float.intBitsToFloat((int) (jI3 >> 32));
        float fMin = Math.min(fIntBitsToFloat, Math.min(fIntBitsToFloat2, Math.min(fIntBitsToFloat3, fIntBitsToFloat4)));
        float fMax = Math.max(fIntBitsToFloat, Math.max(fIntBitsToFloat2, Math.max(fIntBitsToFloat3, fIntBitsToFloat4)));
        float fIntBitsToFloat5 = Float.intBitsToFloat((int) (jI & 4294967295L));
        float fIntBitsToFloat6 = Float.intBitsToFloat((int) (jI2 & 4294967295L));
        float fIntBitsToFloat7 = Float.intBitsToFloat((int) (jI4 & 4294967295L));
        float fIntBitsToFloat8 = Float.intBitsToFloat((int) (jI3 & 4294967295L));
        return new T00(fMin, Math.min(fIntBitsToFloat5, Math.min(fIntBitsToFloat6, Math.min(fIntBitsToFloat7, fIntBitsToFloat8))), fMax, Math.max(fIntBitsToFloat5, Math.max(fIntBitsToFloat6, Math.max(fIntBitsToFloat7, fIntBitsToFloat8))));
    }

    public static void l(Closeable closeable) throws IOException {
        if (closeable != null) {
            try {
                closeable.close();
            } catch (IOException unused) {
            }
        }
    }

    public static boolean m(File file, Resources resources, int i2) throws Throwable {
        InputStream inputStreamOpenRawResource;
        try {
            inputStreamOpenRawResource = resources.openRawResource(i2);
            try {
                boolean zN = n(file, inputStreamOpenRawResource);
                l(inputStreamOpenRawResource);
                return zN;
            } catch (Throwable th) {
                th = th;
                l(inputStreamOpenRawResource);
                throw th;
            }
        } catch (Throwable th2) {
            th = th2;
            inputStreamOpenRawResource = null;
        }
    }

    public static boolean n(File file, InputStream inputStream) throws Throwable {
        FileOutputStream fileOutputStream;
        StrictMode.ThreadPolicy threadPolicyAllowThreadDiskWrites = StrictMode.allowThreadDiskWrites();
        FileOutputStream fileOutputStream2 = null;
        try {
            try {
                fileOutputStream = new FileOutputStream(file, false);
            } catch (IOException e2) {
                e = e2;
            }
        } catch (Throwable th) {
            th = th;
        }
        try {
            byte[] bArr = new byte[1024];
            while (true) {
                int i2 = inputStream.read(bArr);
                if (i2 == -1) {
                    l(fileOutputStream);
                    StrictMode.setThreadPolicy(threadPolicyAllowThreadDiskWrites);
                    return true;
                }
                fileOutputStream.write(bArr, 0, i2);
            }
        } catch (IOException e3) {
            e = e3;
            fileOutputStream2 = fileOutputStream;
            e.getMessage();
            l(fileOutputStream2);
            StrictMode.setThreadPolicy(threadPolicyAllowThreadDiskWrites);
            return false;
        } catch (Throwable th2) {
            th = th2;
            fileOutputStream2 = fileOutputStream;
            l(fileOutputStream2);
            StrictMode.setThreadPolicy(threadPolicyAllowThreadDiskWrites);
            throw th;
        }
    }

    public static AbstractC0752ap o(int i2) {
        return i2 != 0 ? i2 != 1 ? new C2492t30() : new C0351No() : new C2492t30();
    }

    public static final C2651um0 p(Context context, C1414hl c1414hl) {
        C1353h30 c1353h30;
        Hb0 hb0;
        boolean zContainsKey;
        boolean z;
        C2062oc0 c2062oc0 = new C2062oc0((ExecutorService) c1414hl.e);
        Context applicationContext = context.getApplicationContext();
        E7 e7 = (E7) c2062oc0.a;
        BP bp = (BP) c1414hl.f;
        if (context.getResources().getBoolean(R.bool.workmanager_test_configuration)) {
            c1353h30 = new C1353h30(applicationContext, null);
            c1353h30.i = true;
        } else {
            if (Za0.Y("androidx.work.workdb")) {
                throw new IllegalArgumentException("Cannot build a database with null or empty name. If you are trying to create an in memory database, use Room.inMemoryDatabaseBuilder");
            }
            C1353h30 c1353h302 = new C1353h30(applicationContext, "androidx.work.workdb");
            c1353h302.h = new G1(21, applicationContext);
            c1353h30 = c1353h302;
        }
        c1353h30.f = e7;
        C0578Wh c0578Wh = new C0578Wh(bp);
        ArrayList arrayList = c1353h30.c;
        arrayList.add(c0578Wh);
        c1353h30.a(DP.h);
        c1353h30.a(new C2111p20(applicationContext, 2, 3));
        c1353h30.a(DP.i);
        c1353h30.a(DP.j);
        c1353h30.a(new C2111p20(applicationContext, 5, 6));
        c1353h30.a(DP.k);
        c1353h30.a(DP.l);
        c1353h30.a(DP.m);
        c1353h30.a(new C2111p20(applicationContext));
        c1353h30.a(new C2111p20(applicationContext, 10, 11));
        c1353h30.a(DP.d);
        c1353h30.a(DP.e);
        c1353h30.a(DP.f);
        c1353h30.a(DP.g);
        c1353h30.k = false;
        c1353h30.l = true;
        Executor executor = c1353h30.f;
        if (executor == null && c1353h30.g == null) {
            V8 v8 = W8.h;
            c1353h30.g = v8;
            c1353h30.f = v8;
        } else if (executor != null && c1353h30.g == null) {
            c1353h30.g = executor;
        } else if (executor == null) {
            c1353h30.f = c1353h30.g;
        }
        HashSet hashSet = c1353h30.p;
        LinkedHashSet linkedHashSet = c1353h30.f552o;
        if (hashSet != null) {
            Iterator it = hashSet.iterator();
            while (it.hasNext()) {
                int iIntValue = ((Number) it.next()).intValue();
                if (linkedHashSet.contains(Integer.valueOf(iIntValue))) {
                    throw new IllegalArgumentException(AbstractC0126Ew.j(iIntValue, "Inconsistency detected. A Migration was supplied to addMigration(Migration... migrations) that has a start or end version equal to a start version supplied to fallbackToDestructiveMigrationFrom(int... startVersions). Start version: ").toString());
                }
            }
        }
        Gb0 c0688a6 = c1353h30.h;
        if (c0688a6 == null) {
            c0688a6 = new C0688a6(23);
        }
        Gb0 gb0 = c0688a6;
        if (c1353h30.m > 0) {
            if (c1353h30.b != null) {
                throw new IllegalArgumentException("Required value was null.");
            }
            throw new IllegalArgumentException("Cannot create auto-closing database for an in-memory database.");
        }
        boolean z2 = c1353h30.i;
        int i2 = c1353h30.j;
        if (i2 == 0) {
            throw null;
        }
        Context context2 = c1353h30.a;
        if (i2 != 1) {
            hb0 = null;
        } else if (((ActivityManager) context2.getSystemService("activity")).isLowRamDevice()) {
            hb0 = null;
            i2 = 2;
        } else {
            hb0 = null;
            i2 = 3;
        }
        Executor executor2 = c1353h30.f;
        if (executor2 == null) {
            throw new IllegalArgumentException("Required value was null.");
        }
        Executor executor3 = c1353h30.g;
        if (executor3 == null) {
            throw new IllegalArgumentException("Required value was null.");
        }
        boolean z3 = c1353h30.k;
        boolean z4 = c1353h30.l;
        String str = c1353h30.b;
        int i3 = i2;
        C1379hN c1379hN = c1353h30.n;
        ArrayList arrayList2 = c1353h30.d;
        ArrayList arrayList3 = c1353h30.e;
        boolean z5 = false;
        C0093Dp c0093Dp = new C0093Dp(context2, str, gb0, c1379hN, arrayList, z2, i3, executor2, executor3, z3, z4, linkedHashSet, arrayList2, arrayList3);
        String name = WorkDatabase.class.getPackage().getName();
        String canonicalName = WorkDatabase.class.getCanonicalName();
        if (name.length() != 0) {
            canonicalName = canonicalName.substring(name.length() + 1);
        }
        String strConcat = canonicalName.replace('.', '_').concat("_Impl");
        try {
            WorkDatabase workDatabase = (WorkDatabase) Class.forName(name.length() == 0 ? strConcat : name + '.' + strConcat, true, WorkDatabase.class.getClassLoader()).newInstance();
            II ii = workDatabase.d;
            LinkedHashMap linkedHashMap = workDatabase.g;
            workDatabase.c = workDatabase.e(c0093Dp);
            Set setH = workDatabase.h();
            BitSet bitSet = new BitSet();
            Iterator it2 = setH.iterator();
            while (true) {
                int i4 = -1;
                if (!it2.hasNext()) {
                    boolean z6 = z5;
                    int size = arrayList3.size() - 1;
                    if (size >= 0) {
                        while (true) {
                            int i5 = size - 1;
                            if (!bitSet.get(size)) {
                                throw new IllegalArgumentException("Unexpected auto migration specs found. Annotate AutoMigrationSpec implementation with @ProvidedAutoMigrationSpec annotation or remove this spec from the builder.");
                            }
                            if (i5 < 0) {
                                break;
                            }
                            size = i5;
                        }
                    }
                    for (CP cp : workDatabase.g()) {
                        int i6 = cp.a;
                        int i7 = cp.b;
                        LinkedHashMap linkedHashMap2 = c1379hN.a;
                        if (linkedHashMap2.containsKey(Integer.valueOf(i6))) {
                            Map map = (Map) linkedHashMap2.get(Integer.valueOf(i6));
                            if (map == null) {
                                map = C0358Nv.l;
                            }
                            zContainsKey = map.containsKey(Integer.valueOf(i7));
                        } else {
                            zContainsKey = z6 ? 1 : 0;
                        }
                        if (!zContainsKey) {
                            c1379hN.a(cp);
                        }
                    }
                    Hb0 hb02 = workDatabase.c;
                    if (hb02 == null) {
                        hb02 = hb0;
                    }
                    Hb0 hb03 = workDatabase.c;
                    if (hb03 == null) {
                        hb03 = hb0;
                    }
                    boolean z7 = c0093Dp.g == 3 ? true : z6 ? 1 : 0;
                    Hb0 hb04 = workDatabase.c;
                    if (hb04 == null) {
                        hb04 = hb0;
                    }
                    hb04.setWriteAheadLoggingEnabled(z7);
                    workDatabase.f = c0093Dp.e;
                    workDatabase.b = c0093Dp.h;
                    new ArrayDeque();
                    workDatabase.e = c0093Dp.f;
                    Map mapI = workDatabase.i();
                    BitSet bitSet2 = new BitSet();
                    for (Map.Entry entry : mapI.entrySet()) {
                        Class cls = (Class) entry.getKey();
                        for (Class cls2 : (List) entry.getValue()) {
                            int size2 = arrayList2.size() - 1;
                            if (size2 >= 0) {
                                while (true) {
                                    int i8 = size2 - 1;
                                    if (cls2.isAssignableFrom(arrayList2.get(size2).getClass())) {
                                        bitSet2.set(size2);
                                        break;
                                    }
                                    if (i8 < 0) {
                                        break;
                                    }
                                    size2 = i8;
                                }
                                size2 = -1;
                            } else {
                                size2 = -1;
                            }
                            if (!(size2 >= 0 ? true : z6 ? 1 : 0)) {
                                throw new IllegalArgumentException(("A required type converter (" + cls2 + ") for " + cls.getCanonicalName() + " is missing in the database configuration.").toString());
                            }
                            workDatabase.j.put(cls2, arrayList2.get(size2));
                        }
                    }
                    int size3 = arrayList2.size() - 1;
                    if (size3 >= 0) {
                        while (true) {
                            int i9 = size3 - 1;
                            if (!bitSet2.get(size3)) {
                                throw new IllegalArgumentException("Unexpected type converter " + arrayList2.get(size3) + ". Annotate TypeConverter class with @ProvidedTypeConverter annotation or remove this converter from the builder.");
                            }
                            if (i9 < 0) {
                                break;
                            }
                            size3 = i9;
                        }
                    }
                    C2062oc0 c2062oc02 = new C2062oc0(context.getApplicationContext(), c2062oc0);
                    XY xy = new XY(context.getApplicationContext(), c1414hl, c2062oc0, workDatabase);
                    int i10 = C2746vm0.t;
                    int i11 = H40.a;
                    C2252qc0 c2252qc0 = new C2252qc0(context, workDatabase, c1414hl);
                    AbstractC1862mV.a(context, SystemJobService.class, true);
                    C0669Zu.e().getClass();
                    C1940nE c1940nE = new C1940nE(context, c1414hl, c2062oc02, xy, new C1390hY(14, xy, c2062oc0), c2062oc0);
                    D40[] d40Arr = new D40[2];
                    d40Arr[z6 ? 1 : 0] = c2252qc0;
                    d40Arr[1] = c1940nE;
                    return new C2651um0(context.getApplicationContext(), c1414hl, c2062oc0, workDatabase, AbstractC0008Ai.S(d40Arr), xy, c2062oc02);
                }
                Class cls3 = (Class) it2.next();
                int size4 = arrayList3.size() - 1;
                if (size4 >= 0) {
                    while (true) {
                        int i12 = size4 - 1;
                        z = z5;
                        if (cls3.isAssignableFrom(arrayList3.get(size4).getClass())) {
                            bitSet.set(size4);
                            i4 = size4;
                            break;
                        }
                        if (i12 < 0) {
                            break;
                        }
                        size4 = i12;
                        z5 = z;
                    }
                } else {
                    z = z5;
                }
                if (i4 < 0) {
                    throw new IllegalArgumentException(("A required auto migration spec (" + cls3.getCanonicalName() + ") is missing in the database configuration.").toString());
                }
                linkedHashMap.put(cls3, arrayList3.get(i4));
                z5 = z;
            }
        } catch (ClassNotFoundException unused) {
            throw new RuntimeException("Cannot find implementation for " + WorkDatabase.class.getCanonicalName() + ". " + strConcat + " does not exist");
        } catch (IllegalAccessException unused2) {
            throw new RuntimeException("Cannot access the constructor " + WorkDatabase.class + ".canonicalName");
        } catch (InstantiationException unused3) {
            throw new RuntimeException("Failed to create an instance of " + WorkDatabase.class + ".canonicalName");
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:19:0x0049  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static final int q(int r11, java.lang.String r12) {
        /*
            o.nv r0 = v()
            r1 = 0
            if (r0 == 0) goto L7e
            int r2 = r0.c()
            r3 = 0
            r4 = 1
            if (r2 != r4) goto L10
            goto L11
        L10:
            r4 = r3
        L11:
            if (r4 == 0) goto L76
            java.lang.String r2 = "charSequence cannot be null"
            o.AbstractC0249Jp.x(r12, r2)
            o.D2 r0 = r0.e
            java.lang.Object r0 = r0.b
            r4 = r0
            o.zm0 r4 = (o.C3126zm0) r4
            r4.getClass()
            r0 = -1
            if (r11 < 0) goto L2b
            int r2 = r12.length()
            if (r11 < r2) goto L2d
        L2b:
            r5 = r12
            goto L6c
        L2d:
            boolean r2 = r12 instanceof android.text.Spanned
            if (r2 == 0) goto L49
            r2 = r12
            android.text.Spanned r2 = (android.text.Spanned) r2
            int r5 = r11 + 1
            java.lang.Class<o.vh0> r6 = o.C2736vh0.class
            java.lang.Object[] r5 = r2.getSpans(r11, r5, r6)
            o.vh0[] r5 = (o.C2736vh0[]) r5
            int r6 = r5.length
            if (r6 <= 0) goto L49
            r3 = r5[r3]
            int r2 = r2.getSpanEnd(r3)
            r5 = r12
            goto L6d
        L49:
            int r2 = r11 + (-16)
            int r6 = java.lang.Math.max(r3, r2)
            int r2 = r12.length()
            int r3 = r11 + 16
            int r7 = java.lang.Math.min(r2, r3)
            o.zv r10 = new o.zv
            r10.<init>(r11)
            r8 = 2147483647(0x7fffffff, float:NaN)
            r9 = 1
            r5 = r12
            java.lang.Object r12 = r4.N(r5, r6, r7, r8, r9, r10)
            o.zv r12 = (o.C3143zv) r12
            int r2 = r12.n
            goto L6d
        L6c:
            r2 = r0
        L6d:
            java.lang.Integer r12 = java.lang.Integer.valueOf(r2)
            if (r2 != r0) goto L74
            goto L7f
        L74:
            r1 = r12
            goto L7f
        L76:
            java.lang.IllegalStateException r11 = new java.lang.IllegalStateException
            java.lang.String r12 = "Not initialized yet"
            r11.<init>(r12)
            throw r11
        L7e:
            r5 = r12
        L7f:
            if (r1 == 0) goto L86
            int r11 = r1.intValue()
            return r11
        L86:
            java.text.BreakIterator r12 = java.text.BreakIterator.getCharacterInstance()
            r12.setText(r5)
            int r11 = r12.following(r11)
            return r11
        */
        throw new UnsupportedOperationException("Method not decompiled: o.AbstractC2841wm0.q(int, java.lang.String):int");
    }

    public static final int r(int i2, String str) {
        C2004nv c2004nvV = v();
        Integer num = null;
        if (c2004nvV != null) {
            Integer numValueOf = Integer.valueOf(c2004nvV.b(str, Math.max(0, i2 - 1)));
            if (numValueOf.intValue() != -1) {
                num = numValueOf;
            }
        }
        if (num != null) {
            return num.intValue();
        }
        BreakIterator characterInstance = BreakIterator.getCharacterInstance();
        characterInstance.setText(str);
        return characterInstance.preceding(i2);
    }

    public static final InterfaceC1184fK s(InterfaceC1184fK interfaceC1184fK) {
        InterfaceC1184fK interfaceC1184fK2;
        InterfaceC1184fK interfaceC1184fKL = interfaceC1184fK.l();
        while (true) {
            InterfaceC1184fK interfaceC1184fK3 = interfaceC1184fKL;
            interfaceC1184fK2 = interfaceC1184fK;
            interfaceC1184fK = interfaceC1184fK3;
            if (interfaceC1184fK == null) {
                break;
            }
            interfaceC1184fKL = interfaceC1184fK.l();
        }
        AbstractC2239qS abstractC2239qS = interfaceC1184fK2 instanceof AbstractC2239qS ? (AbstractC2239qS) interfaceC1184fK2 : null;
        if (abstractC2239qS == null) {
            return interfaceC1184fK2;
        }
        AbstractC2239qS abstractC2239qS2 = abstractC2239qS.B;
        while (true) {
            AbstractC2239qS abstractC2239qS3 = abstractC2239qS2;
            AbstractC2239qS abstractC2239qS4 = abstractC2239qS;
            abstractC2239qS = abstractC2239qS3;
            if (abstractC2239qS == null) {
                return abstractC2239qS4;
            }
            abstractC2239qS2 = abstractC2239qS.B;
        }
    }

    public static final Object t(AbstractC2591u50 abstractC2591u50, long j2, SC sc) {
        while (true) {
            if (abstractC2591u50.c >= j2 && !abstractC2591u50.d()) {
                return abstractC2591u50;
            }
            AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = AbstractC1318gl.a;
            Object obj = atomicReferenceFieldUpdater.get(abstractC2591u50);
            C2943xq c2943xq = b;
            if (obj == c2943xq) {
                return c2943xq;
            }
            AbstractC2591u50 abstractC2591u502 = (AbstractC2591u50) ((AbstractC1318gl) obj);
            if (abstractC2591u502 == null) {
                abstractC2591u502 = (AbstractC2591u50) sc.f(Long.valueOf(abstractC2591u50.c + 1), abstractC2591u50);
                while (!atomicReferenceFieldUpdater.compareAndSet(abstractC2591u50, null, abstractC2591u502)) {
                    if (atomicReferenceFieldUpdater.get(abstractC2591u50) != null) {
                        break;
                    }
                }
                if (abstractC2591u50.d()) {
                    abstractC2591u50.e();
                }
            }
            abstractC2591u50 = abstractC2591u502;
        }
    }

    public static final InterfaceC1925n40 u(View view) {
        while (view != null) {
            Object tag = view.getTag(R.id.view_tree_saved_state_registry_owner);
            InterfaceC1925n40 interfaceC1925n40 = tag instanceof InterfaceC1925n40 ? (InterfaceC1925n40) tag : null;
            if (interfaceC1925n40 != null) {
                return interfaceC1925n40;
            }
            Object objV = AbstractC1692kh0.v(view);
            view = objV instanceof View ? (View) objV : null;
        }
        return null;
    }

    public static final C2004nv v() {
        if (!C2004nv.d()) {
            return null;
        }
        C2004nv c2004nvA = C2004nv.a();
        if (c2004nvA.c() == 1) {
            return c2004nvA;
        }
        return null;
    }

    public static Object w(String str, Bundle bundle) {
        if (Build.VERSION.SDK_INT >= 34) {
            return E0.b(str, bundle);
        }
        Parcelable parcelable = bundle.getParcelable(str);
        if (C2582u1.class.isInstance(parcelable)) {
            return parcelable;
        }
        return null;
    }

    public static File x(Context context) {
        File cacheDir = context.getCacheDir();
        if (cacheDir == null) {
            return null;
        }
        String str = ".font" + Process.myPid() + "-" + Process.myTid() + "-";
        for (int i2 = 0; i2 < 100; i2++) {
            File file = new File(cacheDir, str + i2);
            if (file.createNewFile()) {
                return file;
            }
        }
        return null;
    }

    public static final boolean y(C2066oe0 c2066oe0, boolean z) {
        InterfaceC1184fK interfaceC1184fKC;
        MK mk = c2066oe0.d;
        if (mk == null || (interfaceC1184fKC = mk.c()) == null) {
            return false;
        }
        T00 t00Z = AbstractC2798wI.z(interfaceC1184fKC);
        long jK = c2066oe0.k(z);
        float f2 = t00Z.a;
        float f3 = t00Z.c;
        float fIntBitsToFloat = Float.intBitsToFloat((int) (jK >> 32));
        if (f2 > fIntBitsToFloat || fIntBitsToFloat > f3) {
            return false;
        }
        float f4 = t00Z.b;
        float f5 = t00Z.d;
        float fIntBitsToFloat2 = Float.intBitsToFloat((int) (jK & 4294967295L));
        return f4 <= fIntBitsToFloat2 && fIntBitsToFloat2 <= f5;
    }

    public static MappedByteBuffer z(Context context, Uri uri) throws IOException {
        ParcelFileDescriptor parcelFileDescriptorOpenFileDescriptor;
        try {
            parcelFileDescriptorOpenFileDescriptor = context.getContentResolver().openFileDescriptor(uri, "r", null);
        } catch (IOException unused) {
        }
        if (parcelFileDescriptorOpenFileDescriptor == null) {
            if (parcelFileDescriptorOpenFileDescriptor != null) {
                parcelFileDescriptorOpenFileDescriptor.close();
                return null;
            }
            return null;
        }
        try {
            FileInputStream fileInputStream = new FileInputStream(parcelFileDescriptorOpenFileDescriptor.getFileDescriptor());
            try {
                FileChannel channel = fileInputStream.getChannel();
                MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_ONLY, 0L, channel.size());
                fileInputStream.close();
                parcelFileDescriptorOpenFileDescriptor.close();
                return map;
            } finally {
            }
        } finally {
        }
    }

    public int hashCode() {
        switch (this.a) {
            case CommonStatusCodes.RECONNECTION_TIMED_OUT_DURING_UPDATE /* 21 */:
                return toString().hashCode();
            default:
                return super.hashCode();
        }
    }

    public String toString() {
        switch (this.a) {
            case CommonStatusCodes.RECONNECTION_TIMED_OUT_DURING_UPDATE /* 21 */:
                return C10.a(getClass()).b();
            default:
                return super.toString();
        }
    }
}
