package f.a.y;

import android.content.Context;
import android.os.Build;
import android.util.Base64;
import com.seewo.sdk.model.SDKKeyboardCode;
import dalvik.system.DexFile;
import f.a.o;
import f.a.u.b;
import f.a.u.d;
import f.a.v.c;
import g.e0.e;
import g.h0.c.d0;
import g.h0.c.e0;
import g.h0.c.l;
import g.h0.c.n;
import g.j0.h;
import g.l;
import g.n0.a;
import g.q;
import g.s;
import g.u;
import g.x;
import h.a.f1;
import h.a.g1;
import h.a.m;
import h.a.r;
import h.a.r0;
import h.b.i;
import h.b.j;
import h.b.m.k;
import h.b.n.f;
import h.b.o.b2;
import h.b.o.g0;
import h.b.o.h1;
import h.b.o.j0;
import h.b.o.k;
import h.b.o.l1;
import h.b.o.m1;
import h.b.o.p0;
import h.b.o.s1;
import h.b.o.u0;
import h.b.o.v1;
import h.b.o.y0;
import h.b.o.y1;
import h.b.p.a0.b0;
import h.b.p.a0.f0;
import h.b.p.a0.g;
import h.b.p.p;
import h.b.p.r;
import j.a0;
import j.c0;
import j.v;
import j.y;
import j.z;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.logging.Logger;
import k.b.a.a.b.e;
import okhttp3.internal.http2.Settings;

/* JADX INFO: compiled from: RxJavaPlugins.java */
/* JADX INFO: loaded from: classes.dex */
public final class a {
    public static volatile c<? super Throwable> a;

    public static final int A(int i2) {
        if (2 <= i2 && i2 <= new h(2, 36).f4124e) {
            return i2;
        }
        StringBuilder sbC = d.b.a.a.a.C("radix ", i2, " was not in valid range ");
        sbC.append(new h(2, 36));
        throw new IllegalArgumentException(sbC.toString());
    }

    public static final int A0(int i2, int i3) {
        int i4 = i2 % i3;
        return i4 >= 0 ? i4 : i4 + i3;
    }

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

    public static final long B0(long j2, long j3) {
        long j4 = j2 % j3;
        return j4 >= 0 ? j4 : j4 + j3;
    }

    public static final <T> int C(Iterable<? extends T> iterable, int i2) {
        l.f(iterable, "<this>");
        return iterable instanceof Collection ? ((Collection) iterable).size() : i2;
    }

    public static void C0(Throwable th) {
        c<? super Throwable> cVar = a;
        if (th == null) {
            th = new NullPointerException("onError called with null. Null values are generally not allowed in 2.x operators and sources.");
        } else {
            boolean z = true;
            if (!(th instanceof b) && !(th instanceof IllegalStateException) && !(th instanceof NullPointerException) && !(th instanceof IllegalArgumentException) && !(th instanceof f.a.u.a)) {
                z = false;
            }
            if (!z) {
                th = new d(th);
            }
        }
        if (cVar != null) {
            try {
                cVar.accept(th);
                return;
            } catch (Throwable th2) {
                th2.printStackTrace();
                Thread threadCurrentThread = Thread.currentThread();
                threadCurrentThread.getUncaughtExceptionHandler().uncaughtException(threadCurrentThread, th2);
            }
        }
        th.printStackTrace();
        Thread threadCurrentThread2 = Thread.currentThread();
        threadCurrentThread2.getUncaughtExceptionHandler().uncaughtException(threadCurrentThread2, th);
    }

    public static final <T extends Comparable<?>> int D(T t, T t2) {
        if (t == t2) {
            return 0;
        }
        if (t == null) {
            return -1;
        }
        if (t2 == null) {
            return 1;
        }
        return t.compareTo(t2);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:23:0x005b  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static final long D0(java.lang.String r8) {
        /*
            int r0 = r8.length()
            r1 = 2
            r2 = 1
            r3 = 0
            if (r0 <= 0) goto L17
            char r4 = r8.charAt(r3)
            java.lang.String r5 = "+-"
            boolean r4 = g.m0.f.a(r5, r4, r3, r1)
            if (r4 == 0) goto L17
            r4 = r2
            goto L18
        L17:
            r4 = r3
        L18:
            int r0 = r0 - r4
            r5 = 16
            if (r0 <= r5) goto L6c
            g.j0.h r0 = new g.j0.h
            int r5 = g.m0.f.h(r8)
            r0.<init>(r4, r5)
            boolean r4 = r0 instanceof java.util.Collection
            if (r4 == 0) goto L34
            r4 = r0
            java.util.Collection r4 = (java.util.Collection) r4
            boolean r4 = r4.isEmpty()
            if (r4 == 0) goto L34
            goto L58
        L34:
            g.c0.r r0 = r0.iterator()
        L38:
            r4 = r0
            g.j0.g r4 = (g.j0.g) r4
            boolean r4 = r4.f4128f
            if (r4 == 0) goto L58
            int r4 = r0.b()
            g.j0.c r5 = new g.j0.c
            r6 = 48
            r7 = 57
            r5.<init>(r6, r7)
            char r4 = r8.charAt(r4)
            boolean r4 = r5.b(r4)
            if (r4 != 0) goto L38
            r0 = r3
            goto L59
        L58:
            r0 = r2
        L59:
            if (r0 == 0) goto L6c
            char r8 = r8.charAt(r3)
            r0 = 45
            if (r8 != r0) goto L66
            r0 = -9223372036854775808
            goto L6b
        L66:
            r0 = 9223372036854775807(0x7fffffffffffffff, double:NaN)
        L6b:
            return r0
        L6c:
            java.lang.String r0 = "+"
            boolean r0 = g.m0.f.J(r8, r0, r3, r1)
            if (r0 == 0) goto L78
            java.lang.String r8 = O(r8, r2)
        L78:
            long r0 = java.lang.Long.parseLong(r8)
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: f.a.y.a.D0(java.lang.String):long");
    }

    public static final boolean E(byte[] bArr, byte b2) {
        l.f(bArr, "<this>");
        l.f(bArr, "<this>");
        int length = bArr.length;
        int i2 = 0;
        while (true) {
            if (i2 >= length) {
                i2 = -1;
                break;
            }
            if (b2 == bArr[i2]) {
                break;
            }
            i2++;
        }
        return i2 >= 0;
    }

    public static final <T> Object E0(Object obj, g.e0.d<? super T> dVar) {
        return obj instanceof h.a.l ? L(((h.a.l) obj).f4276b) : obj;
    }

    public static final boolean F(int[] iArr, int i2) {
        l.f(iArr, "<this>");
        l.f(iArr, "<this>");
        int length = iArr.length;
        int i3 = 0;
        while (true) {
            if (i3 >= length) {
                i3 = -1;
                break;
            }
            if (i2 == iArr[i3]) {
                break;
            }
            i3++;
        }
        return i3 >= 0;
    }

    public static final int F0(y yVar, int i2) {
        int i3;
        l.f(yVar, "$this$segment");
        int[] iArr = yVar.f4659j;
        int i4 = i2 + 1;
        int length = yVar.f4658i.length;
        l.f(iArr, "$this$binarySearch");
        int i5 = length - 1;
        int i6 = 0;
        while (true) {
            if (i6 <= i5) {
                i3 = (i6 + i5) >>> 1;
                int i7 = iArr[i3];
                if (i7 >= i4) {
                    if (i7 <= i4) {
                        break;
                    }
                    i5 = i3 - 1;
                } else {
                    i6 = i3 + 1;
                }
            } else {
                i3 = (-i6) - 1;
                break;
            }
        }
        return i3 >= 0 ? i3 : ~i3;
    }

    public static final boolean G(long[] jArr, long j2) {
        l.f(jArr, "<this>");
        l.f(jArr, "<this>");
        int length = jArr.length;
        int i2 = 0;
        while (true) {
            if (i2 >= length) {
                i2 = -1;
                break;
            }
            if (j2 == jArr[i2]) {
                break;
            }
            i2++;
        }
        return i2 >= 0;
    }

    public static final h.b.b<q> G0(q.a aVar) {
        l.f(aVar, "<this>");
        return s1.a;
    }

    public static final boolean H(short[] sArr, short s) {
        l.f(sArr, "<this>");
        l.f(sArr, "<this>");
        int length = sArr.length;
        int i2 = 0;
        while (true) {
            if (i2 >= length) {
                i2 = -1;
                break;
            }
            if (s == sArr[i2]) {
                break;
            }
            i2++;
        }
        return i2 >= 0;
    }

    public static final h.b.b<s> H0(s.a aVar) {
        l.f(aVar, "<this>");
        return v1.a;
    }

    public static final double I(double d2, g.n0.c cVar, g.n0.c cVar2) {
        l.f(cVar, "sourceUnit");
        l.f(cVar2, "targetUnit");
        long jConvert = cVar2.getTimeUnit$kotlin_stdlib().convert(1L, cVar.getTimeUnit$kotlin_stdlib());
        return jConvert > 0 ? d2 * jConvert : d2 / cVar.getTimeUnit$kotlin_stdlib().convert(1L, cVar2.getTimeUnit$kotlin_stdlib());
    }

    public static final h.b.b<u> I0(u.a aVar) {
        l.f(aVar, "<this>");
        return y1.a;
    }

    public static final long J(long j2, g.n0.c cVar, g.n0.c cVar2) {
        l.f(cVar, "sourceUnit");
        l.f(cVar2, "targetUnit");
        return cVar2.getTimeUnit$kotlin_stdlib().convert(j2, cVar.getTimeUnit$kotlin_stdlib());
    }

    public static final h.b.b<x> J0(x.a aVar) {
        l.f(aVar, "<this>");
        return b2.a;
    }

    public static final long K(long j2, g.n0.c cVar, g.n0.c cVar2) {
        l.f(cVar, "sourceUnit");
        l.f(cVar2, "targetUnit");
        return cVar2.getTimeUnit$kotlin_stdlib().convert(j2, cVar.getTimeUnit$kotlin_stdlib());
    }

    public static final h.b.b<Byte> K0(g.h0.c.b bVar) {
        l.f(bVar, "<this>");
        return k.a;
    }

    public static final Object L(Throwable th) {
        l.f(th, "exception");
        return new l.a(th);
    }

    public static final h.b.b<Integer> L0(g.h0.c.k kVar) {
        g.h0.c.l.f(kVar, "<this>");
        return g0.a;
    }

    public static k.b.a.a.b.a M(int i2) {
        return (i2 == 4 || i2 == 5) ? new e(i2) : new k.b.a.a.b.a(i2);
    }

    public static final h.b.b<Long> M0(n nVar) {
        g.h0.c.l.f(nVar, "<this>");
        return p0.a;
    }

    public static /* synthetic */ Object N(h.b.n.c cVar, h.b.m.e eVar, int i2, h.b.a aVar, Object obj, int i3, Object obj2) {
        int i4 = i3 & 8;
        return cVar.m(eVar, i2, aVar, null);
    }

    public static final h.b.b<Short> N0(d0 d0Var) {
        g.h0.c.l.f(d0Var, "<this>");
        return l1.a;
    }

    public static final String O(String str, int i2) {
        g.h0.c.l.f(str, "<this>");
        if (!(i2 >= 0)) {
            throw new IllegalArgumentException(("Requested character count " + i2 + " is less than zero.").toString());
        }
        int length = str.length();
        if (i2 > length) {
            i2 = length;
        }
        String strSubstring = str.substring(i2);
        g.h0.c.l.e(strSubstring, "this as java.lang.String).substring(startIndex)");
        return strSubstring;
    }

    public static final h.b.b<String> O0(e0 e0Var) {
        g.h0.c.l.f(e0Var, "<this>");
        return m1.a;
    }

    public static final long P(long j2) {
        long j3 = (j2 << 1) + 1;
        a.C0081a c0081a = g.n0.a.f4179b;
        int i2 = g.n0.b.a;
        return j3;
    }

    public static final h.b.b<Object> P0(h.b.q.c cVar, Type type) {
        g.h0.c.l.f(cVar, "<this>");
        g.h0.c.l.f(type, "type");
        h.b.b<Object> bVarC = h.b.k.c(cVar, type, true);
        if (bVarC != null) {
            return bVarC;
        }
        Class<?> clsA = h.b.k.a(type);
        g.h0.c.l.f(clsA, "<this>");
        StringBuilder sbB = d.b.a.a.a.B("Serializer for class '");
        sbB.append(clsA.getSimpleName());
        sbB.append("' is not found.\nMark the class as @Serializable or provide the serializer explicitly.");
        throw new i(sbB.toString());
    }

    public static final long Q(long j2) {
        return new g.j0.k(-4611686018426L, 4611686018426L).b(j2) ? R(j2 * ((long) 1000000)) : P(g.j0.l.a(j2, -4611686018427387903L, 4611686018427387903L));
    }

    public static final h.b.b<Object> Q0(h.b.q.c cVar, Type type) {
        g.h0.c.l.f(cVar, "<this>");
        g.h0.c.l.f(type, "type");
        return h.b.k.c(cVar, type, false);
    }

    public static final long R(long j2) {
        long j3 = j2 << 1;
        a.C0081a c0081a = g.n0.a.f4179b;
        int i2 = g.n0.b.a;
        return j3;
    }

    public static final <T> Set<T> R0(T t) {
        Set<T> setSingleton = Collections.singleton(t);
        g.h0.c.l.e(setSingleton, "singleton(element)");
        return setSingleton;
    }

    public static final <T> void S(h.b.p.a aVar, h.b.p.a0.x xVar, j<? super T> jVar, T t) {
        g.h0.c.l.f(aVar, "<this>");
        g.h0.c.l.f(xVar, "writer");
        g.h0.c.l.f(jVar, "serializer");
        f0 f0Var = f0.OBJ;
        f0.values();
        p[] pVarArr = new p[4];
        g.h0.c.l.f(xVar, "output");
        g.h0.c.l.f(aVar, "json");
        g.h0.c.l.f(f0Var, "mode");
        g.h0.c.l.f(pVarArr, "modeReuseCache");
        g.h0.c.l.f(xVar, "sb");
        g.h0.c.l.f(aVar, "json");
        new b0(aVar.f4485b.f4565e ? new g(xVar, aVar) : new h.b.p.a0.e(xVar), aVar, f0Var, pVarArr).e(jVar, t);
    }

    public static final char S0(char[] cArr) {
        g.h0.c.l.f(cArr, "<this>");
        int length = cArr.length;
        if (length == 0) {
            throw new NoSuchElementException("Array is empty.");
        }
        if (length == 1) {
            return cArr[0];
        }
        throw new IllegalArgumentException("Array has more than one element.");
    }

    public static final boolean T(char c2, char c3, boolean z) {
        if (c2 == c3) {
            return true;
        }
        if (!z) {
            return false;
        }
        char upperCase = Character.toUpperCase(c2);
        char upperCase2 = Character.toUpperCase(c3);
        return upperCase == upperCase2 || Character.toLowerCase(upperCase) == Character.toLowerCase(upperCase2);
    }

    public static final z T0(Socket socket) throws IOException {
        Logger logger = j.q.a;
        g.h0.c.l.f(socket, "$this$sink");
        a0 a0Var = new a0(socket);
        OutputStream outputStream = socket.getOutputStream();
        g.h0.c.l.e(outputStream, "getOutputStream()");
        return a0Var.sink(new j.s(outputStream, a0Var));
    }

    public static final Void U(h.b.p.h hVar, String str) {
        StringBuilder sbB = d.b.a.a.a.B("Element ");
        sbB.append(g.h0.c.b0.a(hVar.getClass()));
        sbB.append(" is not a ");
        sbB.append(str);
        throw new IllegalArgumentException(sbB.toString());
    }

    public static z U0(File file, boolean z, int i2, Object obj) throws FileNotFoundException {
        Logger logger = j.q.a;
        if ((i2 & 1) != 0) {
            z = false;
        }
        g.h0.c.l.f(file, "$this$sink");
        FileOutputStream fileOutputStream = new FileOutputStream(file, z);
        g.h0.c.l.f(fileOutputStream, "$this$sink");
        return new j.s(fileOutputStream, new c0());
    }

    public static final <T> List<T> V(T[] tArr) {
        g.h0.c.l.f(tArr, "<this>");
        ArrayList arrayList = new ArrayList();
        g.h0.c.l.f(tArr, "<this>");
        g.h0.c.l.f(arrayList, "destination");
        for (T t : tArr) {
            if (t != null) {
                arrayList.add(t);
            }
        }
        return arrayList;
    }

    public static final j.b0 V0(File file) throws FileNotFoundException {
        Logger logger = j.q.a;
        g.h0.c.l.f(file, "$this$source");
        FileInputStream fileInputStream = new FileInputStream(file);
        g.h0.c.l.f(fileInputStream, "$this$source");
        return new j.p(fileInputStream, new c0());
    }

    public static final <T> h.b.a<? extends T> W(h.b.o.b<T> bVar, h.b.n.c cVar, String str) {
        g.h0.c.l.f(bVar, "<this>");
        g.h0.c.l.f(cVar, "decoder");
        h.b.a<? extends T> aVarF = bVar.f(cVar, str);
        if (aVarF != null) {
            return aVarF;
        }
        f1(str, bVar.g());
        throw null;
    }

    public static final j.b0 W0(Socket socket) throws IOException {
        Logger logger = j.q.a;
        g.h0.c.l.f(socket, "$this$source");
        a0 a0Var = new a0(socket);
        InputStream inputStream = socket.getInputStream();
        g.h0.c.l.e(inputStream, "getInputStream()");
        return a0Var.source(new j.p(inputStream, a0Var));
    }

    public static final <T> j<T> X(h.b.o.b<T> bVar, f fVar, T t) {
        g.h0.c.l.f(bVar, "<this>");
        g.h0.c.l.f(fVar, "encoder");
        g.h0.c.l.f(t, "value");
        g.h0.c.l.f(fVar, "encoder");
        g.h0.c.l.f(t, "value");
        j<T> jVarD = fVar.b().d(bVar.g(), t);
        if (jVarD != null) {
            return jVarD;
        }
        g.k0.c cVarA = g.h0.c.b0.a(t.getClass());
        g.k0.c<T> cVarG = bVar.g();
        g.h0.c.l.f(cVarA, "subClass");
        g.h0.c.l.f(cVarG, "baseClass");
        String strA = ((g.h0.c.e) cVarA).a();
        if (strA == null) {
            strA = String.valueOf(cVarA);
        }
        f1(strA, cVarG);
        throw null;
    }

    public static final long X0(String str, long j2, long j3, long j4) {
        String strY0 = Y0(str);
        if (strY0 == null) {
            return j2;
        }
        Long lO = g.m0.f.O(strY0);
        if (lO == null) {
            throw new IllegalStateException(("System property '" + str + "' has unrecognized value '" + strY0 + '\'').toString());
        }
        long jLongValue = lO.longValue();
        boolean z = false;
        if (j3 <= jLongValue && jLongValue <= j4) {
            z = true;
        }
        if (z) {
            return jLongValue;
        }
        throw new IllegalStateException(("System property '" + str + "' should be in range " + j3 + ".." + j4 + ", but is '" + jLongValue + '\'').toString());
    }

    public static final <T> T Y(T[] tArr) {
        g.h0.c.l.f(tArr, "<this>");
        if (tArr.length == 0) {
            throw new NoSuchElementException("Array is empty.");
        }
        return tArr[0];
    }

    public static final String Y0(String str) {
        int i2 = h.a.k1.s.a;
        try {
            return System.getProperty(str);
        } catch (SecurityException unused) {
            return null;
        }
    }

    public static final Boolean Z(h.b.p.y yVar) {
        g.h0.c.l.f(yVar, "<this>");
        String strB = yVar.b();
        String[] strArr = h.b.p.a0.e0.a;
        g.h0.c.l.f(strB, "<this>");
        if (g.m0.f.e(strB, "true", true)) {
            return Boolean.TRUE;
        }
        if (g.m0.f.e(strB, "false", true)) {
            return Boolean.FALSE;
        }
        return null;
    }

    public static final boolean Z0(String str, boolean z) {
        String strY0 = Y0(str);
        return strY0 == null ? z : Boolean.parseBoolean(strY0);
    }

    public static final <T> h.b.m.e a(String str, h.b.b<T> bVar) {
        g.h0.c.l.f(str, "name");
        g.h0.c.l.f(bVar, "primitiveSerializer");
        return new h.b.o.c0(str, new h.b.o.d0(bVar));
    }

    public static final g.k0.c<?> a0(h.b.m.e eVar) {
        g.h0.c.l.f(eVar, "<this>");
        if (eVar instanceof h.b.m.b) {
            return ((h.b.m.b) eVar).f4359b;
        }
        if (eVar instanceof h1) {
            return a0(((h1) eVar).a);
        }
        return null;
    }

    public static int a1(String str, int i2, int i3, int i4, int i5, Object obj) {
        if ((i5 & 4) != 0) {
            i3 = 1;
        }
        if ((i5 & 8) != 0) {
            i4 = Integer.MAX_VALUE;
        }
        return (int) X0(str, i2, i3, i4);
    }

    public static final h.b.p.a0.j b(Number number, String str, String str2) {
        g.h0.c.l.f(number, "value");
        g.h0.c.l.f(str, "key");
        g.h0.c.l.f(str2, "output");
        return e(-1, "Unexpected special floating-point value " + number + " with key " + str + ". By default, non-finite floating point values are prohibited because they do not conform JSON specification. It is possible to deserialize them using 'JsonBuilder.allowSpecialFloatingPointValues = true'\nCurrent output: " + ((Object) z0(str2, -1)));
    }

    public static final int b0(h.b.p.y yVar) {
        g.h0.c.l.f(yVar, "<this>");
        return Integer.parseInt(yVar.b());
    }

    public static /* synthetic */ long b1(String str, long j2, long j3, long j4, int i2, Object obj) {
        if ((i2 & 4) != 0) {
            j3 = 1;
        }
        long j5 = j3;
        if ((i2 & 8) != 0) {
            j4 = Long.MAX_VALUE;
        }
        return X0(str, j2, j5, j4);
    }

    public static final h.b.p.a0.l c(Number number, String str) {
        g.h0.c.l.f(number, "value");
        g.h0.c.l.f(str, "output");
        return new h.b.p.a0.l("Unexpected special floating-point value " + number + ". By default, non-finite floating point values are prohibited because they do not conform JSON specification. It is possible to deserialize them using 'JsonBuilder.allowSpecialFloatingPointValues = true'\nCurrent output: " + ((Object) z0(str, -1)));
    }

    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    public static final <T> Class<T> c0(g.k0.c<T> cVar) {
        g.h0.c.l.f(cVar, "<this>");
        Class<T> cls = (Class<T>) ((g.h0.c.d) cVar).b();
        if (!cls.isPrimitive()) {
            g.h0.c.l.d(cls, "null cannot be cast to non-null type java.lang.Class<T of kotlin.jvm.JvmClassMappingKt.<get-javaObjectType>>");
            return cls;
        }
        String name = cls.getName();
        switch (name.hashCode()) {
            case -1325958191:
                if (name.equals("double")) {
                    cls = (Class<T>) Double.class;
                }
                break;
            case 104431:
                if (name.equals("int")) {
                    cls = (Class<T>) Integer.class;
                }
                break;
            case 3039496:
                if (name.equals("byte")) {
                    cls = (Class<T>) Byte.class;
                }
                break;
            case 3052374:
                if (name.equals("char")) {
                    cls = (Class<T>) Character.class;
                }
                break;
            case 3327612:
                if (name.equals("long")) {
                    cls = (Class<T>) Long.class;
                }
                break;
            case 3625364:
                if (name.equals("void")) {
                    cls = (Class<T>) Void.class;
                }
                break;
            case 64711720:
                if (name.equals("boolean")) {
                    cls = (Class<T>) Boolean.class;
                }
                break;
            case 97526364:
                if (name.equals("float")) {
                    cls = (Class<T>) Float.class;
                }
                break;
            case 109413500:
                if (name.equals("short")) {
                    cls = (Class<T>) Short.class;
                }
                break;
        }
        g.h0.c.l.d(cls, "null cannot be cast to non-null type java.lang.Class<T of kotlin.jvm.JvmClassMappingKt.<get-javaObjectType>>");
        return cls;
    }

    public static final Void c1(h.b.p.a0.a aVar, Number number) {
        g.h0.c.l.f(aVar, "<this>");
        g.h0.c.l.f(number, "result");
        h.b.p.a0.a.q(aVar, "Unexpected special floating-point value " + number + ". By default, non-finite floating point values are prohibited because they do not conform JSON specification", 0, "It is possible to deserialize them using 'JsonBuilder.allowSpecialFloatingPointValues = true'", 2, null);
        throw null;
    }

    public static final h.b.p.a0.l d(h.b.m.e eVar) {
        g.h0.c.l.f(eVar, "keyDescriptor");
        StringBuilder sbB = d.b.a.a.a.B("Value of type '");
        sbB.append(eVar.a());
        sbB.append("' can't be used in JSON as a key in the map. It should have either primitive or enum kind, but its kind is '");
        sbB.append(eVar.e());
        sbB.append("'.\nUse 'allowStructuredMapKeys = true' in 'Json {}' builder to convert such maps to [key1, value1, key2, value2,...] arrays.");
        return new h.b.p.a0.l(sbB.toString());
    }

    public static final h.b.p.y d0(h.b.p.h hVar) {
        g.h0.c.l.f(hVar, "<this>");
        h.b.p.y yVar = hVar instanceof h.b.p.y ? (h.b.p.y) hVar : null;
        if (yVar != null) {
            return yVar;
        }
        U(hVar, "JsonPrimitive");
        throw null;
    }

    public static final void d1(int i2, int i3, h.b.m.e eVar) {
        g.h0.c.l.f(eVar, "descriptor");
        ArrayList arrayList = new ArrayList();
        int i4 = (~i2) & i3;
        for (int i5 = 0; i5 < 32; i5++) {
            if ((i4 & 1) != 0) {
                arrayList.add(eVar.g(i5));
            }
            i4 >>>= 1;
        }
        throw new h.b.c(arrayList, eVar.a());
    }

    public static final h.b.p.a0.j e(int i2, String str) {
        g.h0.c.l.f(str, "message");
        if (i2 >= 0) {
            str = "Unexpected JSON token at offset " + i2 + ": " + str;
        }
        return new h.b.p.a0.j(str);
    }

    public static final <T> g.k0.c<T> e0(Class<T> cls) {
        g.h0.c.l.f(cls, "<this>");
        return g.h0.c.b0.a(cls);
    }

    public static final void e1(Object obj) throws Throwable {
        if (obj instanceof l.a) {
            throw ((l.a) obj).f4141b;
        }
    }

    public static final h.b.p.a0.j f(int i2, String str, CharSequence charSequence) {
        g.h0.c.l.f(str, "message");
        g.h0.c.l.f(charSequence, "input");
        return e(i2, str + "\nJSON input: " + ((Object) z0(charSequence, i2)));
    }

    public static final <T> int f0(T[] tArr) {
        g.h0.c.l.f(tArr, "<this>");
        return tArr.length - 1;
    }

    public static final Void f1(String str, g.k0.c<?> cVar) {
        String strP;
        g.h0.c.l.f(cVar, "baseClass");
        String str2 = "in the scope of '" + cVar.a() + '\'';
        if (str == null) {
            strP = d.b.a.a.a.p("Class discriminator was missing and no default polymorphic serializers were registered ", str2);
        } else {
            strP = "Class '" + str + "' is not registered for polymorphic serialization " + str2 + ".\nMark the base class as 'sealed' or register the serializer explicitly.";
        }
        throw new i(strP);
    }

    public static final h.b.p.y g(Number number) {
        return number == null ? h.b.p.u.INSTANCE : new r(number, false);
    }

    public static final <T> h.b.b<T> g0(h.b.b<T> bVar) {
        g.h0.c.l.f(bVar, "<this>");
        return bVar.a().c() ? bVar : new u0(bVar);
    }

    public static final long g1(double d2, g.n0.c cVar) {
        g.h0.c.l.f(cVar, "unit");
        double dI = I(d2, cVar, g.n0.c.NANOSECONDS);
        if (!(!Double.isNaN(dI))) {
            throw new IllegalArgumentException("Duration value cannot be NaN.".toString());
        }
        if (Double.isNaN(dI)) {
            throw new IllegalArgumentException("Cannot round NaN value.");
        }
        long jRound = Math.round(dI);
        if (new g.j0.k(-4611686018426999999L, 4611686018426999999L).b(jRound)) {
            return R(jRound);
        }
        double dI2 = I(d2, cVar, g.n0.c.MILLISECONDS);
        if (Double.isNaN(dI2)) {
            throw new IllegalArgumentException("Cannot round NaN value.");
        }
        return Q(Math.round(dI2));
    }

    public static final <T> h.b.b<List<T>> h(h.b.b<T> bVar) {
        g.h0.c.l.f(bVar, "elementSerializer");
        return new h.b.o.e(bVar);
    }

    public static final int h0(int i2, int i3, int i4) {
        if (i4 > 0) {
            return i2 >= i3 ? i3 : i3 - A0(A0(i3, i4) - A0(i2, i4), i4);
        }
        if (i4 >= 0) {
            throw new IllegalArgumentException("Step is zero.");
        }
        if (i2 <= i3) {
            return i3;
        }
        int i5 = -i4;
        return i3 + A0(A0(i2, i5) - A0(i3, i5), i5);
    }

    public static final long h1(long j2, g.n0.c cVar) {
        g.h0.c.l.f(cVar, "unit");
        g.n0.c cVar2 = g.n0.c.NANOSECONDS;
        long jK = K(4611686018426999999L, cVar2, cVar);
        return new g.j0.k(-jK, jK).b(j2) ? R(K(j2, cVar, cVar2)) : P(g.j0.l.a(J(j2, cVar, g.n0.c.MILLISECONDS), -4611686018427387903L, 4611686018427387903L));
    }

    public static final <K, V> h.b.b<Map<K, V>> i(h.b.b<K> bVar, h.b.b<V> bVar2) {
        g.h0.c.l.f(bVar, "keySerializer");
        g.h0.c.l.f(bVar2, "valueSerializer");
        return new j0(bVar, bVar2);
    }

    public static final h.b.p.a0.h i0(h.b.p.a aVar) {
        g.h0.c.l.f(aVar, "<this>");
        return aVar.f4487d;
    }

    public static final String i1(byte b2) {
        char[] cArr = j.d0.b.a;
        return new String(new char[]{cArr[(b2 >> 4) & 15], cArr[b2 & SDKKeyboardCode.FUNCTION_KEY_BOARD_L]});
    }

    public static final long j(long j2) {
        return j2 * ((long) 1000000);
    }

    public static final void j0(g.e0.f fVar, Throwable th) {
        try {
            int i2 = h.a.r.f4324c;
            h.a.r rVar = (h.a.r) fVar.get(r.a.f4325b);
            if (rVar == null) {
                h.a.s.a(fVar, th);
            } else {
                rVar.handleException(fVar, th);
            }
        } catch (Throwable th2) {
            if (th != th2) {
                RuntimeException runtimeException = new RuntimeException("Exception while trying to handle coroutine exception", th2);
                m(runtimeException, th);
                th = runtimeException;
            }
            h.a.s.a(fVar, th);
        }
    }

    public static final <T> List<T> j1(g.l0.d<? extends T> dVar) {
        g.h0.c.l.f(dVar, "<this>");
        g.h0.c.l.f(dVar, "<this>");
        ArrayList arrayList = new ArrayList();
        g.h0.c.l.f(dVar, "<this>");
        g.h0.c.l.f(arrayList, "destination");
        Iterator<? extends T> it = dVar.iterator();
        while (it.hasNext()) {
            arrayList.add(it.next());
        }
        return g.c0.g.y(arrayList);
    }

    /* JADX WARN: Removed duplicated region for block: B:195:0x0303  */
    /* JADX WARN: Removed duplicated region for block: B:202:0x031a  */
    /* JADX WARN: Removed duplicated region for block: B:207:0x0351  */
    /* JADX WARN: Removed duplicated region for block: B:23:0x0041  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static final long k(java.lang.String r20, boolean r21) {
        /*
            Method dump skipped, instruction units count: 923
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: f.a.y.a.k(java.lang.String, boolean):long");
    }

    public static final int k0(h.b.m.e eVar, h.b.m.e[] eVarArr) {
        g.h0.c.l.f(eVar, "<this>");
        g.h0.c.l.f(eVarArr, "typeParams");
        int iHashCode = (eVar.a().hashCode() * 31) + Arrays.hashCode(eVarArr);
        g.h0.c.l.f(eVar, "<this>");
        int iF = eVar.f();
        int i2 = 1;
        while (true) {
            int iHashCode2 = 0;
            if (!(iF > 0)) {
                break;
            }
            int i3 = iF - 1;
            int i4 = i2 * 31;
            String strA = eVar.i(eVar.f() - iF).a();
            if (strA != null) {
                iHashCode2 = strA.hashCode();
            }
            i2 = i4 + iHashCode2;
            iF = i3;
        }
        int iF2 = eVar.f();
        int iHashCode3 = 1;
        while (true) {
            if (!(iF2 > 0)) {
                return (((iHashCode * 31) + i2) * 31) + iHashCode3;
            }
            int i5 = iF2 - 1;
            int i6 = iHashCode3 * 31;
            h.b.m.j jVarE = eVar.i(eVar.f() - iF2).e();
            iHashCode3 = i6 + (jVarE != null ? jVarE.hashCode() : 0);
            iF2 = i5;
        }
    }

    public static final <T> List<T> k1(T[] tArr) {
        g.h0.c.l.f(tArr, "<this>");
        int length = tArr.length;
        return length != 0 ? length != 1 ? l1(tArr) : w0(tArr[0]) : g.c0.l.f4067b;
    }

    public static final void l(f fVar) {
        g.h0.c.l.f(fVar, "<this>");
        if ((fVar instanceof p ? (p) fVar : null) != null) {
            return;
        }
        StringBuilder sbB = d.b.a.a.a.B("This serializer can be used only with Json format.Expected Encoder to be JsonEncoder, got ");
        sbB.append(g.h0.c.b0.a(fVar.getClass()));
        throw new IllegalStateException(sbB.toString());
    }

    public static final <T> int l0(T[] tArr, T t) {
        g.h0.c.l.f(tArr, "<this>");
        int i2 = 0;
        if (t == null) {
            int length = tArr.length;
            while (i2 < length) {
                if (tArr[i2] == null) {
                    return i2;
                }
                i2++;
            }
            return -1;
        }
        int length2 = tArr.length;
        while (i2 < length2) {
            if (g.h0.c.l.a(t, tArr[i2])) {
                return i2;
            }
            i2++;
        }
        return -1;
    }

    public static final <T> List<T> l1(T[] tArr) {
        g.h0.c.l.f(tArr, "<this>");
        g.h0.c.l.f(tArr, "<this>");
        return new ArrayList(new g.c0.d(tArr, false));
    }

    public static final void m(Throwable th, Throwable th2) {
        g.h0.c.l.f(th, "<this>");
        g.h0.c.l.f(th2, "exception");
        if (th != th2) {
            g.f0.b.a.a(th, th2);
        }
    }

    public static final <T> g.e0.d<T> m0(g.e0.d<? super T> dVar) {
        g.h0.c.l.f(dVar, "<this>");
        g.e0.j.a.c cVar = dVar instanceof g.e0.j.a.c ? (g.e0.j.a.c) dVar : null;
        if (cVar != null && (dVar = (g.e0.d<T>) cVar.f4087f) == null) {
            g.e0.f fVar = cVar.f4086e;
            g.h0.c.l.c(fVar);
            int i2 = g.e0.e.a;
            g.e0.e eVar = (g.e0.e) fVar.get(e.a.f4081b);
            if (eVar == null || (dVar = (g.e0.d<T>) eVar.d(cVar)) == null) {
                dVar = cVar;
            }
            cVar.f4087f = dVar;
        }
        return (g.e0.d<T>) dVar;
    }

    public static final <K, V> Map<K, V> m1(Map<? extends K, ? extends V> map) {
        g.h0.c.l.f(map, "<this>");
        Map.Entry<? extends K, ? extends V> next = map.entrySet().iterator().next();
        Map<K, V> mapSingletonMap = Collections.singletonMap(next.getKey(), next.getValue());
        g.h0.c.l.e(mapSingletonMap, "with(entries.iterator().…ingletonMap(key, value) }");
        return mapSingletonMap;
    }

    /* JADX WARN: Multi-variable type inference failed */
    public static final <T> void n(Appendable appendable, T t, g.h0.b.l<? super T, ? extends CharSequence> lVar) {
        g.h0.c.l.f(appendable, "<this>");
        if (lVar != null) {
            appendable.append(lVar.invoke(t));
            return;
        }
        if (t == 0 ? true : t instanceof CharSequence) {
            appendable.append((CharSequence) t);
        } else if (t instanceof Character) {
            appendable.append(((Character) t).charValue());
        } else {
            appendable.append(String.valueOf(t));
        }
    }

    public static /* synthetic */ h.a.d0 n0(r0 r0Var, boolean z, boolean z2, g.h0.b.l lVar, int i2, Object obj) {
        if ((i2 & 1) != 0) {
            z = false;
        }
        if ((i2 & 2) != 0) {
            z2 = true;
        }
        return r0Var.g(z, z2, lVar);
    }

    public static final <T> Object n1(Object obj, g.h0.b.l<? super Throwable, g.a0> lVar) {
        Throwable thA = g.l.a(obj);
        return thA == null ? lVar != null ? new m(obj, lVar) : obj : new h.a.l(thA, false, 2);
    }

    public static final z o(File file) throws FileNotFoundException {
        Logger logger = j.q.a;
        g.h0.c.l.f(file, "$this$appendingSink");
        FileOutputStream fileOutputStream = new FileOutputStream(file, true);
        g.h0.c.l.f(fileOutputStream, "$this$sink");
        return new j.s(fileOutputStream, new c0());
    }

    public static final boolean o0(AssertionError assertionError) {
        Logger logger = j.q.a;
        g.h0.c.l.f(assertionError, "$this$isAndroidGetsocknameError");
        if (assertionError.getCause() == null) {
            return false;
        }
        String message = assertionError.getMessage();
        return message != null ? g.m0.f.b(message, "getsockname failed", false, 2) : false;
    }

    public static int o1(Context context) {
        boolean z;
        boolean zBooleanValue;
        Method method;
        if (Build.VERSION.SDK_INT < 28) {
            return 0;
        }
        String[] strArr = {"L"};
        Object obj = i.a.a.a.a;
        if (obj == null || (method = i.a.a.a.f4595b) == null) {
            z = false;
        } else {
            z = true;
            try {
                method.invoke(obj, strArr);
            } catch (Throwable unused) {
                z = false;
            }
        }
        if (z) {
            return 0;
        }
        byte[] bArrDecode = Base64.decode("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TGFuZHJvaWQvdXRpbC9Mb2c7ABFMamF2YS9sYW5nL0NsYXNzOwAUTGphdmEvbGFuZy9DbGFzczwqPjsAEkxqYXZhL2xhbmcvT2JqZWN0OwASTGphdmEvbGFuZy9TdHJpbmc7ABJMamF2YS9sYW5nL1N5c3RlbTsAFUxqYXZhL2xhbmcvVGhyb3dhYmxlOwAaTGphdmEvbGFuZy9yZWZsZWN0L01ldGhvZDsAJkxtZS93ZWlzaHUvZnJlZXJlZmxlY3Rpb24vQnVpbGRDb25maWc7ACVMbWUvd2Vpc2h1L3JlZmxlY3Rpb24vQm9vdHN0cmFwQ2xhc3M7ACFMbWUvd2Vpc2h1L3JlZmxlY3Rpb24vUmVmbGVjdGlvbjsAClJlZmxlY3Rpb24AD1JlZmxlY3Rpb24uamF2YQAHU0RLX0lOVAADVEFHAAFWAAxWRVJTSU9OX0NPREUADFZFUlNJT05fTkFNRQACVkwAAVoAAlpMABJbTGphdmEvbGFuZy9DbGFzczsAE1tMamF2YS9sYW5nL09iamVjdDsAE1tMamF2YS9sYW5nL1N0cmluZzsAB2NvbnRleHQAF2RhbHZpay5zeXN0ZW0uVk1SdW50aW1lAAFlAAZleGVtcHQACWV4ZW1wdEFsbAAHZm9yTmFtZQAPZnJlZS1yZWZsZWN0aW9uABJnZXRBcHBsaWNhdGlvbkluZm8AEWdldERlY2xhcmVkTWV0aG9kAApnZXRSdW50aW1lAAZpbnZva2UAC2xvYWRMaWJyYXJ5ABhtZS53ZWlzaHUuZnJlZXJlZmxlY3Rpb24ABm1ldGhvZAAHbWV0aG9kcwAZcmVmbGVjdCBib290c3RyYXAgZmFpbGVkOgAHcmVsZWFzZQAKc1ZtUnVudGltZQAWc2V0SGlkZGVuQXBpRXhlbXB0aW9ucwAQdGFyZ2V0U2RrVmVyc2lvbgAEdGhpcwAGdW5zZWFsAAx1bnNlYWxOYXRpdmUADnZtUnVudGltZUNsYXNzAAYABw4AFgAHDmr/AwEyCwEVEAMCNQvwBAREBhcBEg8DAzYLARsPqQUCBQMFBBkeAwAvCgAOAAcOACwBOgcOADYBOwcsnRriAQEDAC8KHgBIAAcOAA0ABw4AEwEtBx1yGWtaAAYXOBc8HxcABAEXAQEXBgEXHwYAAQACGQEZARkBGQEZARkGgYAEiAcDAAUACBoBCgEKB4iABKAHAYGABLQJAQnMCQGJAfQJAQnMCgEAAwALGgyBgAT4CgEJkAsBigIAAAAADgAAAAAAAAABAAAAAAAAAAEAAABEAAAAcAAAAAIAAAATAAAAgAEAAAMAAAALAAAAzAEAAAQAAAAMAAAAUAIAAAUAAAAPAAAAsAIAAAYAAAADAAAAKAMAAAEgAAAIAAAAiAMAAAEQAAAHAAAA3AUAAAIgAABEAAAAFgYAAAMgAAAIAAAAAwoAAAUgAAADAAAAZgoAAAAgAAADAAAAeAoAAAAQAAABAAAAyAoAAA==", 2);
        try {
            File file = new File(context.getCodeCacheDir(), System.currentTimeMillis() + ".dex");
            FileOutputStream fileOutputStream = new FileOutputStream(file);
            try {
                fileOutputStream.write(bArrDecode);
                fileOutputStream.close();
                zBooleanValue = ((Boolean) new DexFile(file).loadClass(i.a.a.a.class.getCanonicalName(), null).getDeclaredMethod("exemptAll", new Class[0]).invoke(null, new Object[0])).booleanValue();
            } finally {
            }
        } catch (Throwable th) {
            th.printStackTrace();
            zBooleanValue = false;
        }
        return zBooleanValue ? 0 : -1;
    }

    public static final boolean p(byte[] bArr, int i2, byte[] bArr2, int i3, int i4) {
        g.h0.c.l.f(bArr, "a");
        g.h0.c.l.f(bArr2, "b");
        for (int i5 = 0; i5 < i4; i5++) {
            if (bArr[i5 + i2] != bArr2[i5 + i3]) {
                return false;
            }
        }
        return true;
    }

    public static boolean p0(CharSequence charSequence) {
        return charSequence == null || charSequence.length() == 0;
    }

    public static final f1<?> p1(g.e0.d<?> dVar, g.e0.f fVar, Object obj) {
        f1<?> f1Var;
        if (!(dVar instanceof g.e0.j.a.d)) {
            return null;
        }
        if (!(fVar.get(g1.f4227b) != null)) {
            return null;
        }
        g.e0.j.a.d dVarC = (g.e0.j.a.d) dVar;
        while (!(dVarC instanceof h.a.z) && (dVarC = dVarC.c()) != null) {
            if (dVarC instanceof f1) {
                f1Var = (f1) dVarC;
                break;
            }
        }
        f1Var = null;
        if (f1Var == null) {
            return f1Var;
        }
        throw null;
    }

    public static final h.b.p.g q(h.b.n.e eVar) {
        g.h0.c.l.f(eVar, "<this>");
        h.b.p.g gVar = eVar instanceof h.b.p.g ? (h.b.p.g) eVar : null;
        if (gVar != null) {
            return gVar;
        }
        StringBuilder sbB = d.b.a.a.a.B("This serializer can be used only with Json format.Expected Decoder to be JsonDecoder, got ");
        sbB.append(g.h0.c.b0.a(eVar.getClass()));
        throw new IllegalStateException(sbB.toString());
    }

    public static final boolean q0(char c2) {
        return Character.isWhitespace(c2) || Character.isSpaceChar(c2);
    }

    public static void q1(String str, boolean z, boolean z2) throws IllegalArgumentException {
        int i2;
        try {
            int length = str.getBytes("UTF-8").length;
            boolean z3 = false;
            if (length < 1 || length > 65535) {
                throw new IllegalArgumentException(String.format("Invalid topic length, should be in range[%d, %d]!", 1, Integer.valueOf(Settings.DEFAULT_INITIAL_WINDOW_SIZE)));
            }
            if (!z) {
                if (!z2 && str.startsWith("$share/")) {
                    throw new IllegalArgumentException("Shared Subscriptions are not allowed.");
                }
                char[] charArray = "#+".toCharArray();
                if (!p0(str)) {
                    if (!(charArray == null || charArray.length == 0)) {
                        int length2 = str.length();
                        int length3 = charArray.length;
                        int i3 = length2 - 1;
                        int i4 = length3 - 1;
                        loop3: for (int i5 = 0; i5 < length2; i5++) {
                            char cCharAt = str.charAt(i5);
                            for (int i6 = 0; i6 < length3; i6++) {
                                if (charArray[i6] == cCharAt && (!Character.isHighSurrogate(cCharAt) || i6 == i4 || (i5 < i3 && charArray[i6 + 1] == str.charAt(i5 + 1)))) {
                                    z3 = true;
                                    break loop3;
                                }
                            }
                        }
                    }
                }
                if (z3) {
                    throw new IllegalArgumentException("The topic name MUST NOT contain any wildcard characters (#+)");
                }
                return;
            }
            String[] strArr = {"#", "+"};
            boolean z4 = false;
            for (int i7 = 0; i7 < 2; i7++) {
                z4 = z4 || strArr[i7].equals(str);
            }
            if (z4) {
                return;
            }
            if (p0(str) || p0("#")) {
                i2 = 0;
            } else {
                int length4 = 0;
                i2 = 0;
                while (true) {
                    int iIndexOf = str.toString().indexOf("#".toString(), length4);
                    if (iIndexOf == -1) {
                        break;
                    }
                    i2++;
                    length4 = iIndexOf + "#".length();
                }
            }
            if (i2 > 1 || (str.contains("#") && !str.endsWith("/#"))) {
                throw new IllegalArgumentException("Invalid usage of multi-level wildcard in topic string: " + str);
            }
            char cCharAt2 = "+".charAt(0);
            char cCharAt3 = "/".charAt(0);
            char[] charArray2 = str.toCharArray();
            int length5 = charArray2.length;
            int i8 = 0;
            while (i8 < length5) {
                int i9 = i8 - 1;
                char c2 = i9 >= 0 ? charArray2[i9] : (char) 0;
                int i10 = i8 + 1;
                char c3 = i10 < length5 ? charArray2[i10] : (char) 0;
                if (charArray2[i8] == cCharAt2 && ((c2 != cCharAt3 && c2 != 0) || (c3 != cCharAt3 && c3 != 0))) {
                    throw new IllegalArgumentException(String.format("Invalid usage of single-level wildcard in topic string '%s'!", str));
                }
                i8 = i10;
            }
        } catch (UnsupportedEncodingException e2) {
            throw new IllegalStateException(e2.getMessage());
        }
    }

    public static final <T> g.l0.d<T> r(Iterator<? extends T> it) {
        g.h0.c.l.f(it, "<this>");
        g.l0.g gVar = new g.l0.g(it);
        g.h0.c.l.f(gVar, "<this>");
        return gVar instanceof g.l0.a ? gVar : new g.l0.a(gVar);
    }

    public static final <T> Iterator<T> r0(T[] tArr) {
        g.h0.c.l.f(tArr, "array");
        return new g.h0.c.a(tArr);
    }

    /* JADX WARN: Removed duplicated region for block: B:57:0x00d1  */
    /* JADX WARN: Removed duplicated region for block: B:58:0x00d4  */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static final java.lang.Object r1(java.lang.Exception r9, g.e0.d<?> r10) throws java.lang.Exception {
        /*
            Method dump skipped, instruction units count: 249
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: f.a.y.a.r1(java.lang.Exception, g.e0.d):java.lang.Object");
    }

    public static final j.f s(z zVar) {
        g.h0.c.l.f(zVar, "$this$buffer");
        return new j.u(zVar);
    }

    public static String s0(Object[] objArr, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, int i2, CharSequence charSequence4, g.h0.b.l lVar, int i3) {
        String str = (i3 & 1) != 0 ? ", " : null;
        CharSequence charSequence5 = (i3 & 2) != 0 ? "" : null;
        String str2 = (i3 & 4) == 0 ? null : "";
        if ((i3 & 8) != 0) {
            i2 = -1;
        }
        String str3 = (i3 & 16) != 0 ? "..." : null;
        int i4 = i3 & 32;
        g.h0.c.l.f(objArr, "<this>");
        g.h0.c.l.f(str, "separator");
        g.h0.c.l.f(charSequence5, "prefix");
        g.h0.c.l.f(str2, "postfix");
        g.h0.c.l.f(str3, "truncated");
        StringBuilder sb = new StringBuilder();
        g.h0.c.l.f(objArr, "<this>");
        g.h0.c.l.f(sb, "buffer");
        g.h0.c.l.f(str, "separator");
        g.h0.c.l.f(charSequence5, "prefix");
        g.h0.c.l.f(str2, "postfix");
        g.h0.c.l.f(str3, "truncated");
        sb.append(charSequence5);
        int i5 = 0;
        for (Object obj : objArr) {
            i5++;
            if (i5 > 1) {
                sb.append((CharSequence) str);
            }
            if (i2 >= 0 && i5 > i2) {
                break;
            }
            n(sb, obj, null);
        }
        if (i2 >= 0 && i5 > i2) {
            sb.append((CharSequence) str3);
        }
        sb.append((CharSequence) str2);
        String string = sb.toString();
        g.h0.c.l.e(string, "joinTo(StringBuilder(), …ed, transform).toString()");
        return string;
    }

    public static final j.g t(j.b0 b0Var) {
        g.h0.c.l.f(b0Var, "$this$buffer");
        return new v(b0Var);
    }

    public static final Set<String> t0(h.b.m.e eVar) {
        g.h0.c.l.f(eVar, "<this>");
        return y0.a(eVar);
    }

    public static final h.b.m.e u(String str, h.b.m.e[] eVarArr, g.h0.b.l<? super h.b.m.a, g.a0> lVar) {
        g.h0.c.l.f(str, "serialName");
        g.h0.c.l.f(eVarArr, "typeParameters");
        g.h0.c.l.f(lVar, "builderAction");
        if (!(!g.m0.f.o(str))) {
            throw new IllegalArgumentException("Blank serial names are prohibited".toString());
        }
        h.b.m.a aVar = new h.b.m.a(str);
        lVar.invoke(aVar);
        return new h.b.m.f(str, k.a.a, aVar.f4354b.size(), k1(eVarArr), aVar);
    }

    public static final <T> g.g<T> u0(g.h hVar, g.h0.b.a<? extends T> aVar) {
        g.h0.c.l.f(hVar, "mode");
        g.h0.c.l.f(aVar, "initializer");
        int iOrdinal = hVar.ordinal();
        if (iOrdinal == 0) {
            return new g.n(aVar, null, 2);
        }
        if (iOrdinal == 1) {
            return new g.m(aVar);
        }
        if (iOrdinal == 2) {
            return new g.b0(aVar);
        }
        throw new g.j();
    }

    public static final h.b.m.e v(String str, h.b.m.j jVar, h.b.m.e[] eVarArr, g.h0.b.l<? super h.b.m.a, g.a0> lVar) {
        g.h0.c.l.f(str, "serialName");
        g.h0.c.l.f(jVar, "kind");
        g.h0.c.l.f(eVarArr, "typeParameters");
        g.h0.c.l.f(lVar, "builder");
        if (!(!g.m0.f.o(str))) {
            throw new IllegalArgumentException("Blank serial names are prohibited".toString());
        }
        if (!(!g.h0.c.l.a(jVar, k.a.a))) {
            throw new IllegalArgumentException("For StructureKind.CLASS please use 'buildClassSerialDescriptor' instead".toString());
        }
        h.b.m.a aVar = new h.b.m.a(str);
        lVar.invoke(aVar);
        return new h.b.m.f(str, jVar, aVar.f4354b.size(), k1(eVarArr), aVar);
    }

    public static final <T> g.g<T> v0(g.h0.b.a<? extends T> aVar) {
        g.h0.c.l.f(aVar, "initializer");
        return new g.n(aVar, null, 2);
    }

    public static final <T> List<T> w0(T t) {
        List<T> listSingletonList = Collections.singletonList(t);
        g.h0.c.l.e(listSingletonList, "singletonList(element)");
        return listSingletonList;
    }

    public static o x(Callable<o> callable) {
        try {
            o oVarCall = callable.call();
            Objects.requireNonNull(oVarCall, "Scheduler Callable result can't be null");
            return oVarCall;
        } catch (Throwable th) {
            throw f.a.w.h.c.a(th);
        }
    }

    public static final int x0(int i2) {
        if (i2 < 0) {
            return i2;
        }
        if (i2 < 3) {
            return i2 + 1;
        }
        if (i2 < 1073741824) {
            return (int) ((i2 / 0.75f) + 1.0f);
        }
        return Integer.MAX_VALUE;
    }

    public static final byte y(char c2) {
        if (c2 < '~') {
            return h.b.p.a0.d.f4512c[c2];
        }
        return (byte) 0;
    }

    public static final <K, V> Map<K, V> y0(g.k<? extends K, ? extends V> kVar) {
        g.h0.c.l.f(kVar, "pair");
        Map<K, V> mapSingletonMap = Collections.singletonMap(kVar.f4139b, kVar.f4140e);
        g.h0.c.l.e(mapSingletonMap, "singletonMap(pair.first, pair.second)");
        return mapSingletonMap;
    }

    public static final void z(long j2, long j3, long j4) {
        if ((j3 | j4) < 0 || j3 > j2 || j2 - j3 < j4) {
            throw new ArrayIndexOutOfBoundsException("size=" + j2 + " offset=" + j3 + " byteCount=" + j4);
        }
    }

    public static final CharSequence z0(CharSequence charSequence, int i2) {
        if (charSequence.length() < 200) {
            return charSequence;
        }
        if (i2 == -1) {
            int length = charSequence.length() - 60;
            if (length <= 0) {
                return charSequence;
            }
            StringBuilder sbB = d.b.a.a.a.B(".....");
            sbB.append(charSequence.subSequence(length, charSequence.length()).toString());
            return sbB.toString();
        }
        int i3 = i2 - 30;
        int i4 = i2 + 30;
        String str = i3 <= 0 ? "" : ".....";
        String str2 = i4 >= charSequence.length() ? "" : ".....";
        StringBuilder sbB2 = d.b.a.a.a.B(str);
        if (i3 < 0) {
            i3 = 0;
        }
        int length2 = charSequence.length();
        if (i4 > length2) {
            i4 = length2;
        }
        sbB2.append(charSequence.subSequence(i3, i4).toString());
        sbB2.append(str2);
        return sbB2.toString();
    }
}
