package o;

import android.graphics.Path;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Looper;
import android.os.SystemClock;
import android.util.Log;
import com.google.android.gms.common.ConnectionResult;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.WeakHashMap;
import org.json.JSONException;
import org.json.JSONObject;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.uQ, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public class C2616uQ implements InterfaceC2049oS, InterfaceC1955nT, InterfaceC3098zX, InterfaceC0912cZ, InterfaceC0092Do, InterfaceC3051yx, D70, E2, InterfaceC2652un, To0 {
    public static C2616uQ m;
    public static final /* synthetic */ C2616uQ n = new C2616uQ(29);
    public final /* synthetic */ int l;

    public /* synthetic */ C2616uQ(int i) {
        this.l = i;
    }

    /* JADX WARN: Removed duplicated region for block: B:29:0x0075  */
    /* JADX WARN: Removed duplicated region for block: B:31:0x003f A[EXC_TOP_SPLITTER, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:25:0x006c -> B:27:0x0070). Please report as a decompilation issue!!! */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static final java.lang.Object i(java.io.FileOutputStream r11, o.AbstractC0298Lm r12) throws java.io.IOException {
        /*
            boolean r0 = r12 instanceof o.C2521tQ
            if (r0 == 0) goto L13
            r0 = r12
            o.tQ r0 = (o.C2521tQ) r0
            int r1 = r0.r
            r2 = -2147483648(0xffffffff80000000, float:-0.0)
            r3 = r1 & r2
            if (r3 == 0) goto L13
            int r1 = r1 - r2
            r0.r = r1
            goto L18
        L13:
            o.tQ r0 = new o.tQ
            r0.<init>(r12)
        L18:
            java.lang.Object r12 = r0.q
            int r1 = r0.r
            r2 = 1
            if (r1 == 0) goto L32
            if (r1 != r2) goto L2a
            long r3 = r0.p
            java.io.FileOutputStream r11 = r0.f728o
            o.IJ.H(r12)
            r12 = r0
            goto L70
        L2a:
            java.lang.IllegalStateException r11 = new java.lang.IllegalStateException
            java.lang.String r12 = "call to 'resume' before 'invoke' with coroutine"
            r11.<init>(r12)
            throw r11
        L32:
            o.IJ.H(r12)
            r3 = 10
            r12 = r0
        L38:
            r0 = 60000(0xea60, double:2.9644E-319)
            int r0 = (r3 > r0 ? 1 : (r3 == r0 ? 0 : -1))
            if (r0 > 0) goto L75
            java.nio.channels.FileChannel r5 = r11.getChannel()     // Catch: java.io.IOException -> L50
            r8 = 9223372036854775807(0x7fffffffffffffff, double:NaN)
            r10 = 0
            r6 = 0
            java.nio.channels.FileLock r11 = r5.lock(r6, r8, r10)     // Catch: java.io.IOException -> L50
            goto L85
        L50:
            r0 = move-exception
            java.lang.String r1 = r0.getMessage()
            if (r1 == 0) goto L74
            java.lang.String r5 = "Resource deadlock would occur"
            r6 = 0
            boolean r1 = o.Za0.P(r1, r5, r6)
            if (r1 != r2) goto L74
            r12.f728o = r11
            r12.p = r3
            r12.r = r2
            java.lang.Object r0 = o.F3.t(r3, r12)
            o.Dn r1 = o.EnumC0091Dn.l
            if (r0 != r1) goto L70
            r11 = r1
            goto L85
        L70:
            r0 = 2
            long r0 = (long) r0
            long r3 = r3 * r0
            goto L38
        L74:
            throw r0
        L75:
            java.nio.channels.FileChannel r5 = r11.getChannel()
            r8 = 9223372036854775807(0x7fffffffffffffff, double:NaN)
            r10 = 0
            r6 = 0
            java.nio.channels.FileLock r11 = r5.lock(r6, r8, r10)
        L85:
            return r11
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C2616uQ.i(java.io.FileOutputStream, o.Lm):java.lang.Object");
    }

    public static final boolean k(SV sv) {
        SV sv2 = C2395s20.e;
        C0135Ff c0135FfL = sv.l;
        C0135Ff c0135Ff = AbstractC1153f.a;
        c0135FfL.getClass();
        int iH = c0135FfL.h(c0135Ff.f());
        if (iH == -1) {
            C0135Ff c0135Ff2 = sv.l;
            C0135Ff c0135Ff3 = AbstractC1153f.b;
            c0135Ff2.getClass();
            iH = c0135Ff2.h(c0135Ff3.f());
        }
        if (iH != -1) {
            c0135FfL = C0135Ff.l(c0135FfL, iH + 1, 0, 2);
        } else if (sv.e() != null && c0135FfL.b() == 2) {
            c0135FfL = C0135Ff.f122o;
        }
        String strN = c0135FfL.n();
        return !strN.regionMatches(true, strN.length() - 6, ".class", 0, 6);
    }

    public static final void l(BP bp) {
        Ba0 ba0;
        Object obj;
        KW kw;
        Ba0 ba02 = P00.x;
        do {
            ba0 = P00.x;
            obj = (LW) ba0.getValue();
            kw = (KW) obj;
            BW bwA = kw.n;
            FL fl = (FL) bwA.get(bp);
            if (fl != null) {
                Object obj2 = fl.a;
                Object obj3 = fl.b;
                C0737ah0 c0737ah0 = bwA.l;
                C0737ah0 c0737ah0V = c0737ah0.v(bp != null ? bp.hashCode() : 0, 0, bp);
                if (c0737ah0 != c0737ah0V) {
                    bwA = c0737ah0V == null ? BW.n : new BW(c0737ah0V, bwA.m - 1);
                }
                C0669Zu c0669Zu = C0669Zu.G;
                if (obj2 != c0669Zu) {
                    bwA = bwA.a(obj2, new FL(((FL) bwA.get(obj2)).a, obj3));
                }
                if (obj3 != c0669Zu) {
                    bwA = bwA.a(obj3, new FL(obj2, ((FL) bwA.get(obj3)).b));
                }
                Object obj4 = obj2 != c0669Zu ? kw.l : obj3;
                if (obj3 != c0669Zu) {
                    obj2 = kw.m;
                }
                kw = new KW(obj4, obj2, bwA);
            }
            if (obj == kw) {
                return;
            }
            Object obj5 = F3.f;
            if (obj == null) {
                obj = obj5;
            }
        } while (!ba0.i(obj, kw));
    }

    public static final C1262g6 m(int i, String str) {
        WeakHashMap weakHashMap = Pl0.u;
        return new C1262g6(i, str);
    }

    public static final Ai0 o(int i, String str) {
        WeakHashMap weakHashMap = Pl0.u;
        return new Ai0(new RH(0, 0, 0, 0), str);
    }

    public static ArrayList q(List list) {
        ArrayList arrayList = new ArrayList();
        for (Object obj : list) {
            if (((EnumC2910xZ) obj) != EnumC2910xZ.m) {
                arrayList.add(obj);
            }
        }
        ArrayList arrayList2 = new ArrayList(AbstractC0034Bi.W(arrayList, 10));
        int size = arrayList.size();
        int i = 0;
        while (i < size) {
            Object obj2 = arrayList.get(i);
            i++;
            arrayList2.add(((EnumC2910xZ) obj2).l);
        }
        return arrayList2;
    }

    public static byte[] r(List list) {
        C0732af c0732af = new C0732af();
        ArrayList arrayListQ = q(list);
        int size = arrayListQ.size();
        int i = 0;
        while (i < size) {
            Object obj = arrayListQ.get(i);
            i++;
            String str = (String) obj;
            c0732af.G(str.length());
            c0732af.U(0, str, str.length());
        }
        return c0732af.q(c0732af.m);
    }

    public static Typeface s(String str, OA oa, int i) {
        if (i == 0 && F3.c(oa, OA.n) && (str == null || str.length() == 0)) {
            return Typeface.DEFAULT;
        }
        return Typeface.create(str == null ? Typeface.DEFAULT : Typeface.create(str, 0), oa.l, i == 1);
    }

    public static Path t(float f, float f2, float f3, float f4) {
        Path path = new Path();
        path.moveTo(f, f2);
        path.lineTo(f3, f4);
        return path;
    }

    public static boolean v() {
        return "Dalvik".equals(System.getProperty("java.vm.name"));
    }

    public static final boolean x() {
        return Looper.myLooper() == Looper.getMainLooper();
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r1v0 */
    /* JADX WARN: Type inference failed for: r1v1 */
    /* JADX WARN: Type inference failed for: r1v10 */
    /* JADX WARN: Type inference failed for: r1v11 */
    /* JADX WARN: Type inference failed for: r1v2 */
    /* JADX WARN: Type inference failed for: r1v3, types: [o.iR] */
    /* JADX WARN: Type inference failed for: r1v4 */
    /* JADX WARN: Type inference failed for: r1v5 */
    /* JADX WARN: Type inference failed for: r1v6, types: [o.iR] */
    /* JADX WARN: Type inference failed for: r1v8 */
    /* JADX WARN: Type inference failed for: r1v9 */
    /* JADX WARN: Type inference failed for: r8v0, types: [o.LP] */
    /* JADX WARN: Type inference failed for: r8v1, types: [o.LP] */
    /* JADX WARN: Type inference failed for: r8v10 */
    /* JADX WARN: Type inference failed for: r8v11 */
    /* JADX WARN: Type inference failed for: r8v3 */
    /* JADX WARN: Type inference failed for: r8v4, types: [o.LP] */
    /* JADX WARN: Type inference failed for: r8v5, types: [java.lang.Object] */
    /* JADX WARN: Type inference failed for: r8v6 */
    /* JADX WARN: Type inference failed for: r8v7 */
    /* JADX WARN: Type inference failed for: r8v8 */
    /* JADX WARN: Type inference failed for: r8v9 */
    @Override // o.InterfaceC2049oS
    public boolean a(LP lp) {
        ?? c1479iR = 0;
        while (true) {
            int i = 0;
            if (lp == 0) {
                return false;
            }
            if (lp instanceof LX) {
                ((LX) lp).l0();
            } else if ((lp.n & 16) != 0 && (lp instanceof AbstractC0561Vq)) {
                LP lp2 = lp.A;
                c1479iR = c1479iR;
                lp = lp;
                while (lp2 != null) {
                    if ((lp2.n & 16) != 0) {
                        i++;
                        c1479iR = c1479iR;
                        if (i == 1) {
                            lp = lp2;
                        } else {
                            if (c1479iR == 0) {
                                c1479iR = new C1479iR(new LP[16]);
                            }
                            if (lp != 0) {
                                c1479iR.b(lp);
                                lp = 0;
                            }
                            c1479iR.b(lp2);
                        }
                    }
                    lp2 = lp2.q;
                    c1479iR = c1479iR;
                    lp = lp;
                }
                if (i == 1) {
                }
            }
            lp = AbstractC2539te.i(c1479iR);
        }
    }

    @Override // o.InterfaceC2049oS
    public int b() {
        return 16;
    }

    @Override // o.InterfaceC2049oS
    public boolean c(C2420sK c2420sK) {
        return true;
    }

    @Override // o.D70
    public C2975y70 d(C2616uQ c2616uQ, JSONObject jSONObject) throws JSONException {
        jSONObject.optInt("settings_version", 0);
        int iOptInt = jSONObject.optInt("cache_duration", 3600);
        double dOptDouble = jSONObject.optDouble("on_demand_upload_rate_per_minute", 10.0d);
        double dOptDouble2 = jSONObject.optDouble("on_demand_backoff_base", 1.2d);
        int iOptInt2 = jSONObject.optInt("on_demand_backoff_step_duration_seconds", 60);
        C2785w70 c2785w70 = jSONObject.has("session") ? new C2785w70(jSONObject.getJSONObject("session").optInt("max_custom_exception_events", 8)) : new C2785w70(new JSONObject().optInt("max_custom_exception_events", 8));
        JSONObject jSONObject2 = jSONObject.getJSONObject("features");
        return new C2975y70(jSONObject.has("expires_at") ? jSONObject.optLong("expires_at") : (iOptInt * 1000) + System.currentTimeMillis(), c2785w70, new C2690v70(jSONObject2.optBoolean("collect_reports", true), jSONObject2.optBoolean("collect_anrs", false), jSONObject2.optBoolean("collect_build_ids", false)), dOptDouble, dOptDouble2, iOptInt2);
    }

    @Override // o.InterfaceC2049oS
    public void e(C2420sK c2420sK, long j, C1275gF c1275gF, int i, boolean z) {
        c2420sK.x(j, c1275gF, i, z);
    }

    @Override // o.InterfaceC0912cZ
    public void f(int i, Object obj) {
        if (i == 6 || i == 7 || i == 8) {
        }
    }

    @Override // o.InterfaceC3098zX
    public Typeface g(OA oa, int i) {
        return s(null, oa, i);
    }

    @Override // o.CZ
    public Object get() {
        C2616uQ c2616uQ = new C2616uQ(25);
        HashMap map = new HashMap();
        Set set = Collections.EMPTY_SET;
        if (set == null) {
            throw new NullPointerException("Null flags");
        }
        map.put(HY.l, new C1492ic(30000L, 86400000L, set));
        if (set == null) {
            throw new NullPointerException("Null flags");
        }
        map.put(HY.n, new C1492ic(1000L, 86400000L, set));
        if (set == null) {
            throw new NullPointerException("Null flags");
        }
        Set setUnmodifiableSet = Collections.unmodifiableSet(new HashSet(Arrays.asList(E40.m)));
        if (setUnmodifiableSet == null) {
            throw new NullPointerException("Null flags");
        }
        map.put(HY.m, new C1492ic(86400000L, 86400000L, setUnmodifiableSet));
        if (map.keySet().size() < HY.values().length) {
            throw new IllegalStateException("Not all priorities have been configured");
        }
        new HashMap();
        return new C1396hc(c2616uQ, map);
    }

    @Override // o.E2
    public void h(Bundle bundle) {
        Log.isLoggable("FirebaseCrashlytics", 3);
    }

    @Override // o.InterfaceC3098zX
    public Typeface j(HD hd, OA oa, int i) {
        hd.getClass();
        return s("sans-serif", oa, i);
    }

    public String toString() {
        switch (this.l) {
            case 15:
                return "SharingStarted.Eagerly";
            default:
                return super.toString();
        }
    }

    public long u() {
        switch (this.l) {
            case ConnectionResult.API_DISABLED /* 23 */:
                return SystemClock.elapsedRealtime();
            default:
                return System.currentTimeMillis();
        }
    }

    @Override // o.To0
    public Object zza() {
        return new Boolean(((Boolean) C1815lv0.a.b()).booleanValue());
    }

    public /* synthetic */ C2616uQ(int i, Object obj) {
        this.l = i;
    }

    @Override // o.InterfaceC1955nT
    public int n(int i) {
        return i;
    }

    @Override // o.InterfaceC1955nT
    public int p(int i) {
        return i;
    }

    public void w(UX ux, int i, int i2) {
    }
}
