package o;

import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.Signature;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Debug;
import android.util.Log;
import android.view.MotionEvent;
import androidx.compose.foundation.layout.FillElement;
import com.google.android.gms.common.R;
import com.google.android.gms.common.api.Api;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.mi0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1884mi0 {
    public static final char[] b = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
    public static final char[] c = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
    public static final C2943xq d;
    public static final C2943xq e;
    public static final C2943xq f;
    public static final C2943xq g;
    public static CG h;
    public final /* synthetic */ int a;

    static {
        int i = 4;
        d = new C2943xq("UNDEFINED", i);
        e = new C2943xq("REUSABLE_CLAIMED", i);
        f = new C2943xq("NO_OWNER", i);
        g = new C2943xq("NO_VALUE", i);
    }

    public /* synthetic */ C1884mi0(int i) {
        this.a = i;
    }

    public static int A(Context context, String str, String str2) throws Resources.NotFoundException {
        String packageName;
        Resources resources = context.getResources();
        int i = context.getApplicationContext().getApplicationInfo().icon;
        if (i > 0) {
            try {
                packageName = context.getResources().getResourcePackageName(i);
                if ("android".equals(packageName)) {
                    packageName = context.getPackageName();
                }
            } catch (Resources.NotFoundException unused) {
                packageName = context.getPackageName();
            }
        } else {
            packageName = context.getPackageName();
        }
        return resources.getIdentifier(str, str2, packageName);
    }

    public static final long B(double d2) {
        return H((float) d2, 4294967296L);
    }

    public static final long C(int i) {
        return H(i, 4294967296L);
    }

    public static String D(byte[] bArr) {
        char[] cArr = new char[bArr.length * 2];
        for (int i = 0; i < bArr.length; i++) {
            byte b2 = bArr[i];
            int i2 = i * 2;
            char[] cArr2 = b;
            cArr[i2] = cArr2[(b2 & 255) >>> 4];
            cArr[i2 + 1] = cArr2[b2 & 15];
        }
        return new String(cArr);
    }

    public static boolean E() {
        if (Build.PRODUCT.contains("sdk")) {
            return true;
        }
        String str = Build.HARDWARE;
        return str.contains("goldfish") || str.contains("ranchu");
    }

    public static boolean F(String str) {
        return ("Connection".equalsIgnoreCase(str) || "Keep-Alive".equalsIgnoreCase(str) || "Proxy-Authenticate".equalsIgnoreCase(str) || "Proxy-Authorization".equalsIgnoreCase(str) || "TE".equalsIgnoreCase(str) || "Trailers".equalsIgnoreCase(str) || "Transfer-Encoding".equalsIgnoreCase(str) || "Upgrade".equalsIgnoreCase(str)) ? false : true;
    }

    public static boolean G() {
        boolean zE = E();
        String str = Build.TAGS;
        if ((zE || str == null || !str.contains("test-keys")) && !new File("/system/app/Superuser.apk").exists()) {
            return !zE && new File("/system/xbin/su").exists();
        }
        return true;
    }

    public static final long H(float f2, long j) {
        long jFloatToRawIntBits = j | (Float.floatToRawIntBits(f2) & 4294967295L);
        C1115ef0[] c1115ef0Arr = C1020df0.b;
        return jFloatToRawIntBits;
    }

    /* JADX WARN: Removed duplicated region for block: B:32:0x008b A[Catch: all -> 0x006a, DONT_GENERATE, TryCatch #2 {all -> 0x006a, blocks: (B:16:0x0049, B:18:0x0057, B:20:0x005d, B:33:0x008e, B:23:0x006c, B:25:0x007a, B:30:0x0085, B:32:0x008b, B:38:0x009b, B:41:0x00a4, B:40:0x00a1, B:28:0x0080), top: B:54:0x0049, inners: #0 }] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static final void I(java.lang.Object r9, o.InterfaceC0220Im r10) {
        /*
            boolean r0 = r10 instanceof o.C1428hs
            if (r0 == 0) goto Laf
            o.hs r10 = (o.C1428hs) r10
            o.wn r0 = r10.f571o
            o.Lm r1 = r10.p
            java.lang.Throwable r2 = o.I20.a(r9)
            if (r2 != 0) goto L12
            r3 = r9
            goto L18
        L12:
            o.oj r3 = new o.oj
            r4 = 0
            r3.<init>(r2, r4)
        L18:
            o.vn r2 = r1.h()
            boolean r2 = r0.V(r2)
            r4 = 1
            if (r2 == 0) goto L2f
            r10.q = r3
            r10.n = r4
            o.vn r9 = r1.h()
            r0.T(r9, r10)
            return
        L2f:
            o.Qw r0 = o.AbstractC1688kf0.a()
            long r5 = r0.m
            r7 = 4294967296(0x100000000, double:2.121995791E-314)
            int r2 = (r5 > r7 ? 1 : (r5 == r7 ? 0 : -1))
            if (r2 < 0) goto L46
            r10.q = r3
            r10.n = r4
            r0.Y(r10)
            goto La9
        L46:
            r0.a0(r4)
            o.vn r2 = r1.h()     // Catch: java.lang.Throwable -> L6a
            o.Zu r3 = o.C0669Zu.K     // Catch: java.lang.Throwable -> L6a
            o.tn r2 = r2.m(r3)     // Catch: java.lang.Throwable -> L6a
            o.TI r2 = (o.TI) r2     // Catch: java.lang.Throwable -> L6a
            if (r2 == 0) goto L6c
            boolean r3 = r2.b()     // Catch: java.lang.Throwable -> L6a
            if (r3 != 0) goto L6c
            java.util.concurrent.CancellationException r9 = r2.z()     // Catch: java.lang.Throwable -> L6a
            o.H20 r1 = new o.H20     // Catch: java.lang.Throwable -> L6a
            r1.<init>(r9)     // Catch: java.lang.Throwable -> L6a
            r10.resumeWith(r1)     // Catch: java.lang.Throwable -> L6a
            goto L8e
        L6a:
            r9 = move-exception
            goto La5
        L6c:
            java.lang.Object r2 = r10.r     // Catch: java.lang.Throwable -> L6a
            o.vn r3 = r1.h()     // Catch: java.lang.Throwable -> L6a
            java.lang.Object r2 = o.AbstractC1155f00.I(r3, r2)     // Catch: java.lang.Throwable -> L6a
            o.xq r5 = o.AbstractC1155f00.g     // Catch: java.lang.Throwable -> L6a
            if (r2 == r5) goto L7f
            o.Jh0 r5 = o.C2887xC.G(r1, r3, r2)     // Catch: java.lang.Throwable -> L6a
            goto L80
        L7f:
            r5 = 0
        L80:
            r1.resumeWith(r9)     // Catch: java.lang.Throwable -> L98
            if (r5 == 0) goto L8b
            boolean r9 = r5.n0()     // Catch: java.lang.Throwable -> L6a
            if (r9 == 0) goto L8e
        L8b:
            o.AbstractC1155f00.C(r3, r2)     // Catch: java.lang.Throwable -> L6a
        L8e:
            boolean r9 = r0.c0()     // Catch: java.lang.Throwable -> L6a
            if (r9 != 0) goto L8e
        L94:
            r0.X(r4)
            goto La9
        L98:
            r9 = move-exception
            if (r5 == 0) goto La1
            boolean r1 = r5.n0()     // Catch: java.lang.Throwable -> L6a
            if (r1 == 0) goto La4
        La1:
            o.AbstractC1155f00.C(r3, r2)     // Catch: java.lang.Throwable -> L6a
        La4:
            throw r9     // Catch: java.lang.Throwable -> L6a
        La5:
            r10.g(r9)     // Catch: java.lang.Throwable -> Laa
            goto L94
        La9:
            return
        Laa:
            r9 = move-exception
            r0.X(r4)
            throw r9
        Laf:
            r10.resumeWith(r9)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C1884mi0.I(java.lang.Object, o.Im):void");
    }

    public static final int J(C2876x50 c2876x50, int i) {
        int i2;
        int[] iArr = c2876x50.q;
        int i3 = i + 1;
        int length = c2876x50.p.length - 1;
        int i4 = 0;
        while (true) {
            if (i4 <= length) {
                i2 = (i4 + length) >>> 1;
                int i5 = iArr[i2];
                if (i5 >= i3) {
                    if (i5 <= i3) {
                        break;
                    }
                    length = i2 - 1;
                } else {
                    i4 = i2 + 1;
                }
            } else {
                i2 = (-i4) - 1;
                break;
            }
        }
        return i2 >= 0 ? i2 : ~i2;
    }

    public static String K(String str) throws NoSuchAlgorithmException {
        byte[] bytes = str.getBytes();
        try {
            MessageDigest messageDigest = MessageDigest.getInstance("SHA-1");
            messageDigest.update(bytes);
            return D(messageDigest.digest());
        } catch (NoSuchAlgorithmException unused) {
            return "";
        }
    }

    public static String L(FileInputStream fileInputStream) {
        Scanner scannerUseDelimiter = new Scanner(fileInputStream).useDelimiter("\\A");
        try {
            String next = scannerUseDelimiter.hasNext() ? scannerUseDelimiter.next() : "";
            scannerUseDelimiter.close();
            return next;
        } catch (Throwable th) {
            if (scannerUseDelimiter != null) {
                try {
                    scannerUseDelimiter.close();
                } catch (Throwable th2) {
                    th.addSuppressed(th2);
                }
            }
            throw th;
        }
    }

    public static final Bitmap.Config M(int i) {
        if (i == 0) {
            return Bitmap.Config.ARGB_8888;
        }
        if (i == 1) {
            return Bitmap.Config.ALPHA_8;
        }
        if (i == 2) {
            return Bitmap.Config.RGB_565;
        }
        int i2 = Build.VERSION.SDK_INT;
        return (i2 < 26 || i != 3) ? (i2 < 26 || i != 4) ? Bitmap.Config.ARGB_8888 : Bitmap.Config.HARDWARE : Bitmap.Config.RGBA_F16;
    }

    public static final void N(CX cx, long j, OC oc, boolean z) {
        C2513tI c2513tI = cx.b;
        MotionEvent motionEvent = c2513tI != null ? (MotionEvent) ((C1390hY) c2513tI.d).n : null;
        if (motionEvent == null) {
            throw new IllegalArgumentException("The PointerEvent receiver cannot have a null MotionEvent.");
        }
        int action = motionEvent.getAction();
        if (z) {
            motionEvent.setAction(3);
        }
        int i = (int) (j >> 32);
        int i2 = (int) (j & 4294967295L);
        motionEvent.offsetLocation(-Float.intBitsToFloat(i), -Float.intBitsToFloat(i2));
        oc.g(motionEvent);
        motionEvent.offsetLocation(Float.intBitsToFloat(i), Float.intBitsToFloat(i2));
        motionEvent.setAction(action);
    }

    public static final long O(long j) {
        return (Float.floatToRawIntBits((int) (j & 4294967295L)) & 4294967295L) | (Float.floatToRawIntBits((int) (j >> 32)) << 32);
    }

    public static final void P(int i, int i2) {
        if (i <= 0 || i2 <= 0) {
            AbstractC2417sH.a("both minLines " + i + " and maxLines " + i2 + " must be greater than zero");
        }
        if (i <= i2) {
            return;
        }
        AbstractC2417sH.a("minLines " + i + " must be less than or equal to maxLines " + i2);
    }

    public static final void Q(R50 r50, int i, P40 p40) {
        R50 r502;
        C1479iR c1479iR = new C1479iR(new R50[16]);
        List listI = r50.i(false, false);
        while (true) {
            c1479iR.c(c1479iR.n, listI);
            while (true) {
                int i2 = c1479iR.n;
                if (i2 == 0) {
                    return;
                }
                r502 = (R50) c1479iR.k(i2 - 1);
                boolean zG = As0.G(r502);
                N50 n50 = r502.d;
                ZQ zq = n50.l;
                if (!zG && !zq.c(W50.i)) {
                    AbstractC2239qS abstractC2239qSD = r502.d();
                    if (abstractC2239qSD == null) {
                        throw AbstractC2462sn.q("Expected semantics node to have a coordinator.");
                    }
                    C1086eI c1086eIF = AbstractC2001nt0.F(AbstractC2841wm0.k(abstractC2239qSD));
                    if (c1086eIF.a < c1086eIF.c && c1086eIF.b < c1086eIF.d) {
                        Object objG = n50.l.g(M50.e);
                        if (objG == null) {
                            objG = null;
                        }
                        SC sc = (SC) objG;
                        Object objG2 = zq.g(W50.u);
                        O40 o40 = (O40) (objG2 != null ? objG2 : null);
                        if (sc == null || o40 == null || ((Number) o40.b.a()).floatValue() <= 0.0f) {
                            break;
                        }
                        int i3 = i + 1;
                        p40.g(new Q40(r502, i3, c1086eIF, abstractC2239qSD));
                        Q(r502, i3, p40);
                    }
                }
            }
            listI = r502.i(false, false);
        }
    }

    public static int R(byte[] bArr, int i, Rs0 rs0) {
        int i2 = i + 1;
        byte b2 = bArr[i];
        if (b2 < 0) {
            return S(b2, bArr, i2, rs0);
        }
        rs0.a = b2;
        return i2;
    }

    public static int S(int i, byte[] bArr, int i2, Rs0 rs0) {
        byte b2 = bArr[i2];
        int i3 = i2 + 1;
        int i4 = i & 127;
        if (b2 >= 0) {
            rs0.a = i4 | (b2 << 7);
            return i3;
        }
        int i5 = i4 | ((b2 & Byte.MAX_VALUE) << 7);
        int i6 = i2 + 2;
        byte b3 = bArr[i3];
        if (b3 >= 0) {
            rs0.a = i5 | (b3 << 14);
            return i6;
        }
        int i7 = i5 | ((b3 & Byte.MAX_VALUE) << 14);
        int i8 = i2 + 3;
        byte b4 = bArr[i6];
        if (b4 >= 0) {
            rs0.a = i7 | (b4 << 21);
            return i8;
        }
        int i9 = i7 | ((b4 & Byte.MAX_VALUE) << 21);
        int i10 = i2 + 4;
        byte b5 = bArr[i8];
        if (b5 >= 0) {
            rs0.a = i9 | (b5 << 28);
            return i10;
        }
        int i11 = i9 | ((b5 & Byte.MAX_VALUE) << 28);
        while (true) {
            int i12 = i10 + 1;
            if (bArr[i10] >= 0) {
                rs0.a = i11;
                return i12;
            }
            i10 = i12;
        }
    }

    public static int T(byte[] bArr, int i, Rs0 rs0) {
        long j = bArr[i];
        int i2 = i + 1;
        if (j >= 0) {
            rs0.b = j;
            return i2;
        }
        int i3 = i + 2;
        byte b2 = bArr[i2];
        long j2 = (j & 127) | ((b2 & Byte.MAX_VALUE) << 7);
        int i4 = 7;
        while (b2 < 0) {
            int i5 = i3 + 1;
            i4 += 7;
            j2 |= (r10 & Byte.MAX_VALUE) << i4;
            b2 = bArr[i3];
            i3 = i5;
        }
        rs0.b = j2;
        return i3;
    }

    public static int U(int i, byte[] bArr) {
        int i2 = bArr[i] & 255;
        int i3 = bArr[i + 1] & 255;
        int i4 = bArr[i + 2] & 255;
        return ((bArr[i + 3] & 255) << 24) | (i3 << 8) | i2 | (i4 << 16);
    }

    public static long V(int i, byte[] bArr) {
        return (bArr[i] & 255) | ((bArr[i + 1] & 255) << 8) | ((bArr[i + 2] & 255) << 16) | ((bArr[i + 3] & 255) << 24) | ((bArr[i + 4] & 255) << 32) | ((bArr[i + 5] & 255) << 40) | ((bArr[i + 6] & 255) << 48) | ((bArr[i + 7] & 255) << 56);
    }

    public static int W(byte[] bArr, int i, Rs0 rs0) throws Gt0 {
        int iR = R(bArr, i, rs0);
        int i2 = rs0.a;
        if (i2 < 0) {
            throw new Gt0("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
        }
        if (i2 == 0) {
            rs0.c = "";
            return iR;
        }
        int i3 = Ju0.a;
        int length = bArr.length;
        if ((((length - iR) - i2) | iR | i2) < 0) {
            throw new ArrayIndexOutOfBoundsException(String.format("buffer length=%d, index=%d, size=%d", Integer.valueOf(length), Integer.valueOf(iR), Integer.valueOf(i2)));
        }
        int i4 = iR + i2;
        char[] cArr = new char[i2];
        int i5 = 0;
        while (iR < i4) {
            byte b2 = bArr[iR];
            if (b2 < 0) {
                break;
            }
            iR++;
            cArr[i5] = (char) b2;
            i5++;
        }
        while (iR < i4) {
            int i6 = iR + 1;
            byte b3 = bArr[iR];
            if (b3 >= 0) {
                cArr[i5] = (char) b3;
                i5++;
                iR = i6;
                while (iR < i4) {
                    byte b4 = bArr[iR];
                    if (b4 >= 0) {
                        iR++;
                        cArr[i5] = (char) b4;
                        i5++;
                    }
                }
            } else {
                if (b3 >= -32) {
                    if (b3 >= -16) {
                        if (i6 >= i4 - 2) {
                            throw new Gt0("Protocol message had invalid UTF-8.");
                        }
                        byte b5 = bArr[i6];
                        int i7 = iR + 3;
                        byte b6 = bArr[iR + 2];
                        iR += 4;
                        byte b7 = bArr[i7];
                        if (!AbstractC0249Jp.h0(b5)) {
                            if ((((b5 + 112) + (b3 << 28)) >> 30) == 0 && !AbstractC0249Jp.h0(b6) && !AbstractC0249Jp.h0(b7)) {
                                int i8 = ((b5 & 63) << 12) | ((b3 & 7) << 18) | ((b6 & 63) << 6) | (b7 & 63);
                                cArr[i5] = (char) ((i8 >>> 10) + 55232);
                                cArr[i5 + 1] = (char) ((i8 & 1023) + 56320);
                                i5 += 2;
                            }
                        }
                        throw new Gt0("Protocol message had invalid UTF-8.");
                    }
                    if (i6 >= i4 - 1) {
                        throw new Gt0("Protocol message had invalid UTF-8.");
                    }
                    int i9 = i5 + 1;
                    int i10 = iR + 2;
                    byte b8 = bArr[i6];
                    iR += 3;
                    byte b9 = bArr[i10];
                    if (!AbstractC0249Jp.h0(b8)) {
                        if (b3 == -32) {
                            if (b8 >= -96) {
                                b3 = -32;
                            }
                        }
                        if (b3 == -19) {
                            if (b8 < -96) {
                                b3 = -19;
                            }
                        }
                        if (!AbstractC0249Jp.h0(b9)) {
                            cArr[i5] = (char) (((b8 & 63) << 6) | ((b3 & 15) << 12) | (b9 & 63));
                            i5 = i9;
                        }
                    }
                    throw new Gt0("Protocol message had invalid UTF-8.");
                }
                if (i6 >= i4) {
                    throw new Gt0("Protocol message had invalid UTF-8.");
                }
                int i11 = i5 + 1;
                iR += 2;
                byte b10 = bArr[i6];
                if (b3 < -62 || AbstractC0249Jp.h0(b10)) {
                    throw new Gt0("Protocol message had invalid UTF-8.");
                }
                cArr[i5] = (char) ((b10 & 63) | ((b3 & 31) << 6));
                i5 = i11;
            }
        }
        rs0.c = new String(cArr, 0, i5);
        return i4;
    }

    public static int X(byte[] bArr, int i, Rs0 rs0) throws Gt0 {
        int iR = R(bArr, i, rs0);
        int i2 = rs0.a;
        if (i2 < 0) {
            throw new Gt0("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
        }
        if (i2 > bArr.length - iR) {
            throw new Gt0("While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.");
        }
        if (i2 == 0) {
            rs0.c = Ws0.n;
            return iR;
        }
        rs0.c = Ws0.d(bArr, iR, i2);
        return iR + i2;
    }

    public static int Y(Object obj, InterfaceC1718ku0 interfaceC1718ku0, byte[] bArr, int i, int i2, Rs0 rs0) throws Gt0 {
        int iS = i + 1;
        int i3 = bArr[i];
        if (i3 < 0) {
            iS = S(i3, bArr, iS, rs0);
            i3 = rs0.a;
        }
        int i4 = iS;
        if (i3 < 0 || i3 > i2 - i4) {
            throw new Gt0("While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.");
        }
        int i5 = rs0.d + 1;
        rs0.d = i5;
        if (i5 >= 100) {
            throw new Gt0("Protocol message had too many levels of nesting.  May be malicious.  Use setRecursionLimit() to increase the recursion depth limit.");
        }
        int i6 = i4 + i3;
        interfaceC1718ku0.a(obj, bArr, i4, i6, rs0);
        rs0.d--;
        rs0.c = obj;
        return i6;
    }

    public static int Z(Object obj, InterfaceC1718ku0 interfaceC1718ku0, byte[] bArr, int i, int i2, int i3, Rs0 rs0) throws Gt0 {
        C0763au0 c0763au0 = (C0763au0) interfaceC1718ku0;
        int i4 = rs0.d + 1;
        rs0.d = i4;
        if (i4 >= 100) {
            throw new Gt0("Protocol message had too many levels of nesting.  May be malicious.  Use setRecursionLimit() to increase the recursion depth limit.");
        }
        int iS = c0763au0.s(obj, bArr, i, i2, i3, rs0);
        rs0.d--;
        rs0.c = obj;
        return iS;
    }

    public static final void a(C2066oe0 c2066oe0, C0554Vj c0554Vj, C0321Mk c0321Mk, int i) {
        int i2;
        MP mpC;
        c0321Mk.X(2080741862);
        if ((i & 6) == 0) {
            i2 = (c0321Mk.h(c2066oe0) ? 4 : 2) | i;
        } else {
            i2 = i;
        }
        if ((i & 48) == 0) {
            i2 |= c0321Mk.h(c0554Vj) ? 32 : 16;
        }
        if (c0321Mk.N(i2 & 1, (i2 & 19) != 18)) {
            c0321Mk.V(-1881943916);
            if (c2066oe0.j()) {
                InterfaceC0220Im interfaceC0220Im = null;
                mpC = androidx.compose.foundation.text.contextmenu.modifier.a.c(androidx.compose.foundation.text.contextmenu.modifier.a.b(new C1209fe0(c2066oe0, interfaceC0220Im, 0)), c2066oe0.y, new C1209fe0(c2066oe0, interfaceC0220Im, 1), new C1305ge0(c2066oe0, interfaceC0220Im, 0), new C0939cn(c2066oe0, 2));
            } else {
                mpC = JP.a;
            }
            Co0.d(mpC, c0554Vj, c0321Mk, i2 & 112);
            c0321Mk.q(false);
        } else {
            c0321Mk.Q();
        }
        L00 l00S = c0321Mk.s();
        if (l00S != null) {
            l00S.d = new C0502Tj(c2066oe0, c0554Vj, i, 3);
        }
    }

    public static int a0(int i, byte[] bArr, int i2, int i3, Dt0 dt0, Rs0 rs0) {
        C2855wt0 c2855wt0 = (C2855wt0) dt0;
        int iR = R(bArr, i2, rs0);
        c2855wt0.d(rs0.a);
        while (iR < i3) {
            int iR2 = R(bArr, iR, rs0);
            if (i != rs0.a) {
                break;
            }
            iR = R(bArr, iR2, rs0);
            c2855wt0.d(rs0.a);
        }
        return iR;
    }

    public static final void b(int i, C0321Mk c0321Mk) {
        C0321Mk c0321Mk2 = c0321Mk;
        c0321Mk2.X(1113460377);
        if (i == 0 && c0321Mk2.z()) {
            c0321Mk2.Q();
        } else {
            Z40 z40G = androidx.compose.foundation.a.g(c0321Mk2);
            FillElement fillElement = androidx.compose.foundation.layout.c.b;
            MP mpA = androidx.compose.foundation.a.a(fillElement, new C2232qL(AbstractC0008Ai.S(new C0190Hi(AbstractC0858bu.a), new C0190Hi(AbstractC0858bu.b), new C0190Hi(AbstractC0858bu.c)), 0L, (Float.floatToRawIntBits(1000.0f) << 32) | (Float.floatToRawIntBits(1400.0f) & 4294967295L)));
            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, mpA);
            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);
            MP mpH = androidx.compose.foundation.a.h(fillElement, z40G);
            C0790b9 c0790b9 = AbstractC0981d9.c;
            C0579Wi c0579WiA = AbstractC0527Ui.a(c0790b9, C0669Zu.y, c0321Mk2, 0);
            int iHashCode2 = Long.hashCode(c0321Mk2.R);
            AW awL2 = c0321Mk2.l();
            MP mpF2 = AbstractC1692kh0.F(c0321Mk2, mpH);
            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 mpC = androidx.compose.foundation.layout.c.c(androidx.compose.foundation.layout.c.b(jp, 1.0f), 190);
            InterfaceC2235qO interfaceC2235qOD2 = AbstractC3109ze.d(c0159Gd, false);
            int iHashCode3 = Long.hashCode(c0321Mk2.R);
            AW awL3 = c0321Mk2.l();
            MP mpF3 = AbstractC1692kh0.F(c0321Mk2, mpC);
            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);
            YT.c(AbstractC0752ap.Y(R.drawable.vam_asan_header, c0321Mk2), "هدر سامانه ابلاغ", fillElement, null, C2460sm.a, 0.0f, c0321Mk2, 25008, 104);
            AbstractC3109ze.a(androidx.compose.foundation.a.b(fillElement, C0190Hi.b(0.78f, AbstractC0752ap.c(4278849300L)), AbstractC2841wm0.j), c0321Mk2, 6);
            C0159Gd c0159Gd2 = C0669Zu.q;
            androidx.compose.foundation.layout.a aVar = androidx.compose.foundation.layout.a.a;
            MP mpG = androidx.compose.foundation.layout.b.g(androidx.compose.foundation.layout.b.c(aVar.a(jp, c0159Gd2), -28), 24, 0.0f, 2);
            C0579Wi c0579WiA2 = AbstractC0527Ui.a(c0790b9, C0669Zu.z, c0321Mk2, 48);
            int iHashCode4 = Long.hashCode(c0321Mk2.R);
            AW awL4 = c0321Mk2.l();
            MP mpF4 = AbstractC1692kh0.F(c0321Mk2, mpG);
            c0321Mk2.Y();
            if (c0321Mk2.Q) {
                c0321Mk2.k(c0744al);
            } else {
                c0321Mk2.i0();
            }
            AbstractC2378rs0.f0(c0579WiA2, 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);
            long j = C0190Hi.c;
            Ke0.b("سامانه ابلاغ الکترونیک", null, j, C(22), OA.r, 0L, null, 0L, 0, false, 0, 0, new C0733af0(0L, 0L, null, 0L, new I70(14.0f, C0190Hi.b(0.55f, C0190Hi.b), (Float.floatToRawIntBits(0.0f) << 32) | (Float.floatToRawIntBits(3.0f) & 4294967295L)), 0, 0L, 16769023), c0321Mk, 1597830, 12582912, 130986);
            C2887xC.e(c0321Mk, androidx.compose.foundation.layout.c.c(jp, 6));
            Ke0.b("مرحله نهایی - پرداخت با موفقیت انجام شد", null, C0190Hi.b(0.88f, j), C(13), OA.f264o, 0L, new Yc0(3), C(20), 0, false, 0, 0, null, c0321Mk, 1597830, 48, 258986);
            c0321Mk.q(true);
            c0321Mk.q(true);
            MP mpC2 = androidx.compose.foundation.layout.b.c(androidx.compose.foundation.layout.b.g(androidx.compose.foundation.layout.c.b(jp, 1.0f), 20, 0.0f, 2), -38);
            C0159Gd c0159Gd3 = C0669Zu.n;
            InterfaceC2235qO interfaceC2235qOD3 = AbstractC3109ze.d(c0159Gd3, false);
            int iHashCode5 = Long.hashCode(c0321Mk.R);
            AW awL5 = c0321Mk.l();
            MP mpF5 = AbstractC1692kh0.F(c0321Mk, mpC2);
            c0321Mk.Y();
            if (c0321Mk.Q) {
                c0321Mk.k(c0744al);
            } else {
                c0321Mk.i0();
            }
            AbstractC2378rs0.f0(interfaceC2235qOD3, c0321Mk, c0975d6);
            AbstractC2378rs0.f0(awL5, c0321Mk, c0975d62);
            if (c0321Mk.Q || !F3.c(c0321Mk.K(), Integer.valueOf(iHashCode5))) {
                AbstractC2462sn.r(iHashCode5, c0321Mk, iHashCode5, c0975d63);
            }
            AbstractC2378rs0.f0(mpF5, c0321Mk, c0975d64);
            float f2 = 22;
            MP mpN = Co0.N(androidx.compose.foundation.layout.c.b(jp, 1.0f), 10, AbstractC2397s30.a(f2));
            C2302r30 c2302r30A = AbstractC2397s30.a(f2);
            C0058Cg c0058CgI = C2887xC.i(AbstractC0858bu.f, c0321Mk, 6);
            float f3 = 1;
            long j2 = AbstractC0858bu.g;
            YT.a(mpN, c2302r30A, c0058CgI, C2887xC.j(62, 0), AbstractC1155f00.a(f3, j2), AbstractC1412hk.b, c0321Mk, 221184, 0);
            Nb0.a(androidx.compose.foundation.layout.b.c(aVar.a(androidx.compose.foundation.layout.c.h(jp, 84), c0159Gd3), -42), AbstractC2397s30.a, j, 0L, 0.0f, 16, AbstractC1155f00.a(f3, j2), AbstractC1412hk.c, c0321Mk, 14352768, 24);
            c0321Mk.q(true);
            C2887xC.e(c0321Mk, androidx.compose.foundation.layout.c.c(jp, 8));
            float f4 = 28;
            Ke0.b("اطلاعات پرداخت و ابلاغیه شما به\u200cصورت محرمانه و امن در سامانه ثبت شده است.", androidx.compose.foundation.layout.b.g(androidx.compose.foundation.layout.c.b(jp, 1.0f), f4, 0.0f, 2), AbstractC0858bu.e, C(11), null, 0L, new Yc0(3), C(16), 0, false, 0, 0, null, c0321Mk, 25014, 48, 259048);
            c0321Mk2 = c0321Mk;
            C2887xC.e(c0321Mk2, androidx.compose.foundation.layout.c.c(jp, f4));
            c0321Mk2.q(true);
            c0321Mk2.q(true);
        }
        L00 l00S = c0321Mk2.s();
        if (l00S != null) {
            l00S.d = new X8(i, 10);
        }
    }

    public static int b0(byte[] bArr, int i, Dt0 dt0, Rs0 rs0) throws Gt0 {
        C2855wt0 c2855wt0 = (C2855wt0) dt0;
        int iR = R(bArr, i, rs0);
        int i2 = rs0.a + iR;
        while (iR < i2) {
            iR = R(bArr, iR, rs0);
            c2855wt0.d(rs0.a);
        }
        if (iR == i2) {
            return iR;
        }
        throw new Gt0("While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.");
    }

    public static C1363h80 c(int i, int i2) {
        int i3 = (i2 & 1) != 0 ? 0 : 1;
        int i4 = (i2 & 2) == 0 ? 16 : 0;
        if (i3 <= 0 && i4 <= 0 && i != 1) {
            throw new IllegalArgumentException("replay or extraBufferCapacity must be positive with non-default onBufferOverflow strategy ".concat(AbstractC2462sn.x(i)).toString());
        }
        int i5 = i4 + i3;
        if (i5 < 0) {
            i5 = Api.BaseClientBuilder.API_PRIORITY_OTHER;
        }
        return new C1363h80(i3, i5, i);
    }

    public static int c0(InterfaceC1718ku0 interfaceC1718ku0, int i, byte[] bArr, int i2, int i3, Dt0 dt0, Rs0 rs0) throws Gt0 {
        AbstractC2665ut0 abstractC2665ut0Zza = interfaceC1718ku0.zza();
        InterfaceC1718ku0 interfaceC1718ku02 = interfaceC1718ku0;
        byte[] bArr2 = bArr;
        int i4 = i3;
        Rs0 rs02 = rs0;
        int iY = Y(abstractC2665ut0Zza, interfaceC1718ku02, bArr2, i2, i4, rs02);
        interfaceC1718ku02.b(abstractC2665ut0Zza);
        rs02.c = abstractC2665ut0Zza;
        dt0.add(abstractC2665ut0Zza);
        while (iY < i4) {
            Rs0 rs03 = rs02;
            int i5 = i4;
            int iR = R(bArr2, iY, rs03);
            if (i != rs03.a) {
                break;
            }
            byte[] bArr3 = bArr2;
            InterfaceC1718ku0 interfaceC1718ku03 = interfaceC1718ku02;
            AbstractC2665ut0 abstractC2665ut0Zza2 = interfaceC1718ku03.zza();
            iY = Y(abstractC2665ut0Zza2, interfaceC1718ku03, bArr3, iR, i5, rs03);
            interfaceC1718ku02 = interfaceC1718ku03;
            bArr2 = bArr3;
            i4 = i5;
            rs02 = rs03;
            interfaceC1718ku02.b(abstractC2665ut0Zza2);
            rs02.c = abstractC2665ut0Zza2;
            dt0.add(abstractC2665ut0Zza2);
        }
        return iY;
    }

    public static C2427sR d() {
        return new C2427sR(false);
    }

    public static int d0(int i, byte[] bArr, int i2, int i3, C2857wu0 c2857wu0, Rs0 rs0) throws Gt0 {
        if ((i >>> 3) == 0) {
            throw new Gt0("Protocol message contained an invalid tag (zero).");
        }
        int i4 = i & 7;
        if (i4 == 0) {
            int iT = T(bArr, i2, rs0);
            c2857wu0.d(i, Long.valueOf(rs0.b));
            return iT;
        }
        if (i4 == 1) {
            c2857wu0.d(i, Long.valueOf(V(i2, bArr)));
            return i2 + 8;
        }
        if (i4 == 2) {
            int iR = R(bArr, i2, rs0);
            int i5 = rs0.a;
            if (i5 < 0) {
                throw new Gt0("CodedInputStream encountered an embedded string or message which claimed to have negative size.");
            }
            if (i5 > bArr.length - iR) {
                throw new Gt0("While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.");
            }
            if (i5 == 0) {
                c2857wu0.d(i, Ws0.n);
            } else {
                c2857wu0.d(i, Ws0.d(bArr, iR, i5));
            }
            return iR + i5;
        }
        if (i4 != 3) {
            if (i4 != 5) {
                throw new Gt0("Protocol message contained an invalid tag (zero).");
            }
            c2857wu0.d(i, Integer.valueOf(U(i2, bArr)));
            return i2 + 4;
        }
        int i6 = (i & (-8)) | 4;
        C2857wu0 c2857wu0A = C2857wu0.a();
        int i7 = rs0.d + 1;
        rs0.d = i7;
        if (i7 >= 100) {
            throw new Gt0("Protocol message had too many levels of nesting.  May be malicious.  Use setRecursionLimit() to increase the recursion depth limit.");
        }
        int i8 = 0;
        while (true) {
            if (i2 >= i3) {
                break;
            }
            int iR2 = R(bArr, i2, rs0);
            int i9 = rs0.a;
            if (i9 == i6) {
                i8 = i9;
                i2 = iR2;
                break;
            }
            i2 = d0(i9, bArr, iR2, i3, c2857wu0A, rs0);
            i8 = i9;
        }
        rs0.d--;
        if (i2 > i3 || i8 != i6) {
            throw new Gt0("Failed to parse the message.");
        }
        c2857wu0.d(i, c2857wu0A);
        return i2;
    }

    public static final long e(float f2, float f3) {
        return (Float.floatToRawIntBits(f3) & 4294967295L) | (Float.floatToRawIntBits(f2) << 32);
    }

    public static int e0(int i, byte[] bArr, int i2, int i3, Rs0 rs0) throws Gt0 {
        if ((i >>> 3) == 0) {
            throw new Gt0("Protocol message contained an invalid tag (zero).");
        }
        int i4 = i & 7;
        if (i4 == 0) {
            return T(bArr, i2, rs0);
        }
        if (i4 == 1) {
            return i2 + 8;
        }
        if (i4 == 2) {
            return R(bArr, i2, rs0) + rs0.a;
        }
        if (i4 != 3) {
            if (i4 == 5) {
                return i2 + 4;
            }
            throw new Gt0("Protocol message contained an invalid tag (zero).");
        }
        int i5 = (i & (-8)) | 4;
        int i6 = 0;
        while (i2 < i3) {
            i2 = R(bArr, i2, rs0);
            i6 = rs0.a;
            if (i6 == i5) {
                break;
            }
            i2 = e0(i6, bArr, i2, i3, rs0);
        }
        if (i2 > i3 || i6 != i5) {
            throw new Gt0("Failed to parse the message.");
        }
        return i2;
    }

    public static final int f(float[] fArr) {
        int i = 0;
        if (fArr.length < 16) {
            return 0;
        }
        int i2 = (fArr[0] == 1.0f && fArr[1] == 0.0f && fArr[2] == 0.0f && fArr[4] == 0.0f && fArr[5] == 1.0f && fArr[6] == 0.0f && fArr[8] == 0.0f && fArr[9] == 0.0f && fArr[10] == 1.0f) ? 1 : 0;
        if (fArr[12] == 0.0f && fArr[13] == 0.0f && fArr[14] == 0.0f && fArr[15] == 1.0f) {
            i = 1;
        }
        return (i2 << 1) | i;
    }

    public static final int g(char c2) {
        if ('0' <= c2 && c2 < ':') {
            return c2 - '0';
        }
        if ('a' <= c2 && c2 < 'g') {
            return c2 - 'W';
        }
        if ('A' <= c2 && c2 < 'G') {
            return c2 - '7';
        }
        throw new IllegalArgumentException("Unexpected hex digit: " + c2);
    }

    public static final Object h(Object[] objArr, long j) {
        return objArr[((int) j) & (objArr.length - 1)];
    }

    public static final boolean i(long j) {
        return !C0704aI.a(j, 9223372034707292159L);
    }

    public static final void j(Object[] objArr, long j, Object obj) {
        objArr[((int) j) & (objArr.length - 1)] = obj;
    }

    public static final Bitmap k(C2493t4 c2493t4) {
        if (c2493t4 instanceof C2493t4) {
            return c2493t4.a;
        }
        throw new UnsupportedOperationException("Unable to obtain android.graphics.Bitmap");
    }

    /* JADX WARN: Multi-variable type inference failed */
    public static final Object l(ArrayList arrayList, Sb0 sb0) {
        if (arrayList.isEmpty()) {
            return C0332Mv.l;
        }
        InterfaceC0276Kq[] interfaceC0276KqArr = (InterfaceC0276Kq[]) arrayList.toArray(new InterfaceC0276Kq[0]);
        C0028Bc c0028Bc = new C0028Bc(interfaceC0276KqArr);
        C2448sg c2448sg = new C2448sg(1, AbstractC2539te.G(sb0));
        c2448sg.r();
        int length = interfaceC0276KqArr.length;
        C3105zc[] c3105zcArr = new C3105zc[length];
        for (int i = 0; i < length; i++) {
            C0548Vd c0548Vd = interfaceC0276KqArr[i];
            c0548Vd.start();
            C3105zc c3105zc = new C3105zc(c0028Bc, c2448sg);
            c3105zc.q = AbstractC0752ap.Q(c0548Vd, true, c3105zc);
            c3105zcArr[i] = c3105zc;
        }
        C0002Ac c0002Ac = new C0002Ac(c3105zcArr);
        for (int i2 = 0; i2 < length; i2++) {
            C3105zc c3105zc2 = c3105zcArr[i2];
            c3105zc2.getClass();
            C3105zc.s.set(c3105zc2, c0002Ac);
        }
        if (C2448sg.r.get(c2448sg) instanceof InterfaceC2998yS) {
            c2448sg.x(c0002Ac);
        } else {
            c0002Ac.b();
        }
        return c2448sg.q();
    }

    public static void m(long j, C0732af c0732af, int i, ArrayList arrayList, int i2, int i3, ArrayList arrayList2) {
        int i4;
        int i5;
        ArrayList arrayList3;
        long j2;
        int i6;
        int i7 = i;
        ArrayList arrayList4 = arrayList;
        ArrayList arrayList5 = arrayList2;
        if (i2 >= i3) {
            throw new IllegalArgumentException("Failed requirement.");
        }
        for (int i8 = i2; i8 < i3; i8++) {
            if (((C0135Ff) arrayList4.get(i8)).b() < i7) {
                throw new IllegalArgumentException("Failed requirement.");
            }
        }
        C0135Ff c0135Ff = (C0135Ff) arrayList.get(i2);
        C0135Ff c0135Ff2 = (C0135Ff) arrayList4.get(i3 - 1);
        if (i7 == c0135Ff.b()) {
            int iIntValue = ((Number) arrayList5.get(i2)).intValue();
            int i9 = i2 + 1;
            C0135Ff c0135Ff3 = (C0135Ff) arrayList4.get(i9);
            i4 = i9;
            i5 = iIntValue;
            c0135Ff = c0135Ff3;
        } else {
            i4 = i2;
            i5 = -1;
        }
        if (c0135Ff.g(i7) == c0135Ff2.g(i7)) {
            int iMin = Math.min(c0135Ff.b(), c0135Ff2.b());
            int i10 = 0;
            for (int i11 = i7; i11 < iMin && c0135Ff.g(i11) == c0135Ff2.g(i11); i11++) {
                i10++;
            }
            long j3 = 4;
            long j4 = (c0732af.m / j3) + j + 2 + i10 + 1;
            c0732af.S(-i10);
            c0732af.S(i5);
            int i12 = i7 + i10;
            while (i7 < i12) {
                c0732af.S(c0135Ff.g(i7) & 255);
                i7++;
            }
            if (i4 + 1 == i3) {
                if (i12 != ((C0135Ff) arrayList4.get(i4)).b()) {
                    throw new IllegalStateException("Check failed.");
                }
                c0732af.S(((Number) arrayList5.get(i4)).intValue());
                return;
            } else {
                C0732af c0732af2 = new C0732af();
                c0732af.S(((int) ((c0732af2.m / j3) + j4)) * (-1));
                m(j4, c0732af2, i12, arrayList4, i4, i3, arrayList5);
                c0732af.N(c0732af2);
                return;
            }
        }
        int i13 = 1;
        for (int i14 = i4 + 1; i14 < i3; i14++) {
            if (((C0135Ff) arrayList4.get(i14 - 1)).g(i7) != ((C0135Ff) arrayList4.get(i14)).g(i7)) {
                i13++;
            }
        }
        long j5 = 4;
        long j6 = (c0732af.m / j5) + j + 2 + (i13 * 2);
        c0732af.S(i13);
        c0732af.S(i5);
        for (int i15 = i4; i15 < i3; i15++) {
            int iG = ((C0135Ff) arrayList4.get(i15)).g(i7);
            if (i15 == i4 || iG != ((C0135Ff) arrayList4.get(i15 - 1)).g(i7)) {
                c0732af.S(iG & 255);
            }
        }
        C0732af c0732af3 = new C0732af();
        int i16 = i4;
        while (i16 < i3) {
            byte bG = ((C0135Ff) arrayList4.get(i16)).g(i7);
            int i17 = i16 + 1;
            int i18 = i17;
            while (true) {
                if (i18 >= i3) {
                    i18 = i3;
                    break;
                } else if (bG != ((C0135Ff) arrayList4.get(i18)).g(i7)) {
                    break;
                } else {
                    i18++;
                }
            }
            if (i17 == i18 && i7 + 1 == ((C0135Ff) arrayList4.get(i16)).b()) {
                c0732af.S(((Number) arrayList5.get(i16)).intValue());
                arrayList3 = arrayList5;
                j2 = j6;
                i6 = i18;
            } else {
                c0732af.S(((int) ((c0732af3.m / j5) + j6)) * (-1));
                arrayList3 = arrayList5;
                j2 = j6;
                i6 = i18;
                m(j2, c0732af3, i7 + 1, arrayList, i16, i6, arrayList3);
                arrayList4 = arrayList;
            }
            j6 = j2;
            i16 = i6;
            arrayList5 = arrayList3;
        }
        c0732af.N(c0732af3);
    }

    public static synchronized long n(Context context) {
        ActivityManager.MemoryInfo memoryInfo;
        memoryInfo = new ActivityManager.MemoryInfo();
        ((ActivityManager) context.getSystemService("activity")).getMemoryInfo(memoryInfo);
        return memoryInfo.totalMem;
    }

    public static final void o(Closeable closeable, Throwable th) {
        if (closeable != null) {
            if (th == null) {
                closeable.close();
                return;
            }
            try {
                closeable.close();
            } catch (Throwable th2) {
                C80.i(th, th2);
            }
        }
    }

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

    public static final InterfaceC1191fR q(KQ kq, C0321Mk c0321Mk, int i) {
        Object objK = c0321Mk.K();
        J7 j7 = C0140Fk.a;
        if (objK == j7) {
            objK = AbstractC0752ap.X(Boolean.FALSE);
            c0321Mk.f0(objK);
        }
        InterfaceC1191fR interfaceC1191fR = (InterfaceC1191fR) objK;
        boolean z = (((i & 14) ^ 6) > 4 && c0321Mk.f(kq)) || (i & 6) == 4;
        Object objK2 = c0321Mk.K();
        if (z || objK2 == j7) {
            objK2 = new C2105p(kq, interfaceC1191fR, null, 20);
            c0321Mk.f0(objK2);
        }
        AbstractC0249Jp.g(kq, c0321Mk, (SC) objK2);
        return interfaceC1191fR;
    }

    public static LE r(LE le, LE le2) {
        ArrayList arrayList = new ArrayList(20);
        int size = le.size();
        for (int i = 0; i < size; i++) {
            String strB = le.b(i);
            String strD = le.d(i);
            if ((!"Warning".equalsIgnoreCase(strB) || !AbstractC1299gb0.L(strD, "1", false)) && ("Content-Length".equalsIgnoreCase(strB) || "Content-Encoding".equalsIgnoreCase(strB) || "Content-Type".equalsIgnoreCase(strB) || !F(strB) || le2.a(strB) == null)) {
                AbstractC2001nt0.p(strB);
                AbstractC2001nt0.q(strD, strB);
                arrayList.add(strB);
                arrayList.add(Za0.o0(strD).toString());
            }
        }
        int size2 = le2.size();
        for (int i2 = 0; i2 < size2; i2++) {
            String strB2 = le2.b(i2);
            if (!"Content-Length".equalsIgnoreCase(strB2) && !"Content-Encoding".equalsIgnoreCase(strB2) && !"Content-Type".equalsIgnoreCase(strB2) && F(strB2)) {
                String strD2 = le2.d(i2);
                AbstractC2001nt0.p(strB2);
                AbstractC2001nt0.q(strD2, strB2);
                arrayList.add(strB2);
                arrayList.add(Za0.o0(strD2).toString());
            }
        }
        return new LE((String[]) arrayList.toArray(new String[0]));
    }

    public static final boolean s(T00 t00, float f2, float f3) {
        float f4 = t00.a;
        if (f2 > t00.c || f4 > f2) {
            return false;
        }
        return f3 <= t00.d && t00.b <= f3;
    }

    public static AA t(Context context) {
        ProviderInfo providerInfo;
        C2980yA c2980yA;
        ApplicationInfo applicationInfo;
        J7 c0508Tp = Build.VERSION.SDK_INT >= 28 ? new C0508Tp(15) : new J7(15);
        PackageManager packageManager = context.getPackageManager();
        AbstractC0249Jp.x(packageManager, "Package manager required to locate emoji font provider");
        Iterator<ResolveInfo> it = packageManager.queryIntentContentProviders(new Intent("androidx.content.action.LOAD_EMOJI_FONT"), 0).iterator();
        while (true) {
            if (!it.hasNext()) {
                providerInfo = null;
                break;
            }
            providerInfo = it.next().providerInfo;
            if (providerInfo != null && (applicationInfo = providerInfo.applicationInfo) != null && (applicationInfo.flags & 1) == 1) {
                break;
            }
        }
        if (providerInfo == null) {
            c2980yA = null;
        } else {
            try {
                String str = providerInfo.authority;
                String str2 = providerInfo.packageName;
                Signature[] signatureArrP = c0508Tp.p(packageManager, str2);
                ArrayList arrayList = new ArrayList();
                for (Signature signature : signatureArrP) {
                    arrayList.add(signature.toByteArray());
                }
                c2980yA = new C2980yA(str, str2, "emojicompat-emoji-font", Collections.singletonList(arrayList), null, null);
            } catch (PackageManager.NameNotFoundException e2) {
                Log.wtf("emoji2.text.DefaultEmojiConfig", e2);
            }
        }
        if (c2980yA == null) {
            return null;
        }
        return new AA(new C3075zA(context, c2980yA));
    }

    public static boolean v(String str, String str2) {
        if (str.equals(str2)) {
            return true;
        }
        if (str.length() != 0) {
            int i = 0;
            int i2 = 0;
            int i3 = 0;
            while (true) {
                if (i < str.length()) {
                    char cCharAt = str.charAt(i);
                    int i4 = i3 + 1;
                    if (i3 == 0 && cCharAt != '(') {
                        break;
                    }
                    if (cCharAt != '(') {
                        if (cCharAt == ')' && i2 - 1 == 0 && i3 != str.length() - 1) {
                            break;
                        }
                    } else {
                        i2++;
                    }
                    i++;
                    i3 = i4;
                } else if (i2 == 0) {
                    return F3.c(Za0.o0(str.substring(1, str.length() - 1)).toString(), str2);
                }
            }
        }
        return false;
    }

    public static EP x(EP ep, EnumC1280gK enumC1280gK, C0733af0 c0733af0, InterfaceC2281qr interfaceC2281qr, InterfaceC2221qA interfaceC2221qA) {
        if (ep != null && enumC1280gK == ep.a && AbstractC2001nt0.E(c0733af0, enumC1280gK).equals(ep.b) && interfaceC2281qr.e() == ep.c.l && interfaceC2221qA == ep.d) {
            return ep;
        }
        EP ep2 = EP.h;
        if (ep2 != null && enumC1280gK == ep2.a && AbstractC2001nt0.E(c0733af0, enumC1280gK).equals(ep2.b) && interfaceC2281qr.e() == ep2.c.l && interfaceC2221qA == ep2.d) {
            return ep2;
        }
        EP ep3 = new EP(enumC1280gK, AbstractC2001nt0.E(c0733af0, enumC1280gK), new C2375rr(interfaceC2281qr.e(), interfaceC2281qr.q()), interfaceC2221qA);
        EP.h = ep3;
        return ep3;
    }

    public static final long y(long j) {
        float fIntBitsToFloat = Float.intBitsToFloat((int) (j >> 32)) / 2.0f;
        float fIntBitsToFloat2 = Float.intBitsToFloat((int) (j & 4294967295L)) / 2.0f;
        return (Float.floatToRawIntBits(fIntBitsToFloat2) & 4294967295L) | (Float.floatToRawIntBits(fIntBitsToFloat) << 32);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r0v1, types: [int] */
    /* JADX WARN: Type inference failed for: r0v5 */
    /* JADX WARN: Type inference failed for: r0v6 */
    public static int z() {
        boolean zE = E();
        ?? r0 = zE;
        if (G()) {
            r0 = (zE ? 1 : 0) | 2;
        }
        return (Debug.isDebuggerConnected() || Debug.waitingForDebugger()) ? r0 | 4 : r0;
    }

    /* JADX WARN: Removed duplicated region for block: B:20:0x004a  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.String u(byte[] r11, int r12, int r13) {
        /*
            Method dump skipped, instructions count: 352
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C1884mi0.u(byte[], int, int):java.lang.String");
    }

    public final int w(String str, byte[] bArr, int i, int i2) {
        int i3;
        int i4;
        char cCharAt;
        long j;
        char c2;
        long j2;
        long j3;
        char c3;
        int i5;
        char cCharAt2;
        switch (this.a) {
            case 0:
                int length = str.length();
                int i6 = i2 + i;
                int i7 = 0;
                while (i7 < length && (i4 = i7 + i) < i6 && (cCharAt = str.charAt(i7)) < 128) {
                    bArr[i4] = (byte) cCharAt;
                    i7++;
                }
                if (i7 == length) {
                    return i + length;
                }
                int i8 = i + i7;
                while (i7 < length) {
                    char cCharAt3 = str.charAt(i7);
                    if (cCharAt3 < 128 && i8 < i6) {
                        bArr[i8] = (byte) cCharAt3;
                        i8++;
                    } else if (cCharAt3 < 2048 && i8 <= i6 - 2) {
                        int i9 = i8 + 1;
                        bArr[i8] = (byte) ((cCharAt3 >>> 6) | 960);
                        i8 += 2;
                        bArr[i9] = (byte) ((cCharAt3 & '?') | 128);
                    } else {
                        if ((cCharAt3 >= 55296 && 57343 >= cCharAt3) || i8 > i6 - 3) {
                            if (i8 > i6 - 4) {
                                if (55296 <= cCharAt3 && cCharAt3 <= 57343 && ((i3 = i7 + 1) == str.length() || !Character.isSurrogatePair(cCharAt3, str.charAt(i3)))) {
                                    throw new C1979ni0(i7, length);
                                }
                                throw new ArrayIndexOutOfBoundsException("Failed writing " + cCharAt3 + " at index " + i8);
                            }
                            int i10 = i7 + 1;
                            if (i10 != str.length()) {
                                char cCharAt4 = str.charAt(i10);
                                if (Character.isSurrogatePair(cCharAt3, cCharAt4)) {
                                    int codePoint = Character.toCodePoint(cCharAt3, cCharAt4);
                                    bArr[i8] = (byte) ((codePoint >>> 18) | 240);
                                    bArr[i8 + 1] = (byte) (((codePoint >>> 12) & 63) | 128);
                                    int i11 = i8 + 3;
                                    bArr[i8 + 2] = (byte) (((codePoint >>> 6) & 63) | 128);
                                    i8 += 4;
                                    bArr[i11] = (byte) ((codePoint & 63) | 128);
                                    i7 = i10;
                                } else {
                                    i7 = i10;
                                }
                            }
                            throw new C1979ni0(i7 - 1, length);
                        }
                        bArr[i8] = (byte) ((cCharAt3 >>> '\f') | 480);
                        int i12 = i8 + 2;
                        bArr[i8 + 1] = (byte) (((cCharAt3 >>> 6) & 63) | 128);
                        i8 += 3;
                        bArr[i12] = (byte) ((cCharAt3 & '?') | 128);
                    }
                    i7++;
                }
                return i8;
            default:
                long j4 = i;
                long j5 = i2 + j4;
                int length2 = str.length();
                if (length2 > i2 || bArr.length - i2 < i) {
                    throw new ArrayIndexOutOfBoundsException("Failed writing " + str.charAt(length2 - 1) + " at index " + (i + i2));
                }
                int i13 = 0;
                while (true) {
                    j = 1;
                    c2 = 128;
                    if (i13 < length2 && (cCharAt2 = str.charAt(i13)) < 128) {
                        AbstractC0835bi0.j(bArr, j4, (byte) cCharAt2);
                        i13++;
                        j4 = 1 + j4;
                    }
                }
                if (i13 == length2) {
                    return (int) j4;
                }
                while (i13 < length2) {
                    char cCharAt5 = str.charAt(i13);
                    if (cCharAt5 < c2 && j4 < j5) {
                        AbstractC0835bi0.j(bArr, j4, (byte) cCharAt5);
                        c3 = c2;
                        j2 = j;
                        j3 = j4 + j;
                    } else if (cCharAt5 >= 2048 || j4 > j5 - 2) {
                        j2 = j;
                        if ((cCharAt5 >= 55296 && 57343 >= cCharAt5) || j4 > j5 - 3) {
                            long j6 = j4;
                            if (j6 > j5 - 4) {
                                if (55296 <= cCharAt5 && cCharAt5 <= 57343 && ((i5 = i13 + 1) == length2 || !Character.isSurrogatePair(cCharAt5, str.charAt(i5)))) {
                                    throw new C1979ni0(i13, length2);
                                }
                                throw new ArrayIndexOutOfBoundsException("Failed writing " + cCharAt5 + " at index " + j6);
                            }
                            int i14 = i13 + 1;
                            if (i14 != length2) {
                                char cCharAt6 = str.charAt(i14);
                                if (Character.isSurrogatePair(cCharAt5, cCharAt6)) {
                                    int codePoint2 = Character.toCodePoint(cCharAt5, cCharAt6);
                                    AbstractC0835bi0.j(bArr, j6, (byte) ((codePoint2 >>> 18) | 240));
                                    c3 = 128;
                                    AbstractC0835bi0.j(bArr, j6 + j2, (byte) (((codePoint2 >>> 12) & 63) | 128));
                                    AbstractC0835bi0.j(bArr, j6 + 2, (byte) (((codePoint2 >>> 6) & 63) | 128));
                                    AbstractC0835bi0.j(bArr, j6 + 3, (byte) ((codePoint2 & 63) | 128));
                                    j3 = j6 + 4;
                                    i13 = i14;
                                } else {
                                    i13 = i14;
                                }
                            }
                            throw new C1979ni0(i13 - 1, length2);
                        }
                        AbstractC0835bi0.j(bArr, j4, (byte) ((cCharAt5 >>> '\f') | 480));
                        long j7 = j4;
                        AbstractC0835bi0.j(bArr, j4 + j2, (byte) (((cCharAt5 >>> 6) & 63) | 128));
                        j3 = j7 + 3;
                        AbstractC0835bi0.j(bArr, j7 + 2, (byte) ((cCharAt5 & '?') | 128));
                        c3 = 128;
                    } else {
                        j2 = j;
                        AbstractC0835bi0.j(bArr, j4, (byte) ((cCharAt5 >>> 6) | 960));
                        AbstractC0835bi0.j(bArr, j4 + j2, (byte) ((cCharAt5 & '?') | c2));
                        j3 = j4 + 2;
                        c3 = c2;
                    }
                    i13++;
                    c2 = c3;
                    j4 = j3;
                    j = j2;
                }
                return (int) j4;
        }
    }
}
