package c.f.g;

import android.annotation.SuppressLint;
import android.graphics.Typeface;
import java.util.ArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/* JADX INFO: compiled from: FontRequestWorker.java */
/* JADX INFO: loaded from: classes.dex */
public class k {
    public static final c.d.f<String, Typeface> a = new c.d.f<>(16);

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final ExecutorService f1369b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final Object f1370c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final c.d.h<String, ArrayList<c.f.i.a<a>>> f1371d;

    static {
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(0, 1, 10000, TimeUnit.MILLISECONDS, new LinkedBlockingDeque(), new o("fonts-androidx", 10));
        threadPoolExecutor.allowCoreThreadTimeOut(true);
        f1369b = threadPoolExecutor;
        f1370c = new Object();
        f1371d = new c.d.h<>();
    }

    /* JADX WARN: Removed duplicated region for block: B:23:0x0035  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static c.f.g.k.a a(java.lang.String r7, android.content.Context r8, c.f.g.f r9, int r10) {
        /*
            c.d.f<java.lang.String, android.graphics.Typeface> r0 = c.f.g.k.a
            java.lang.Object r0 = r0.a(r7)
            android.graphics.Typeface r0 = (android.graphics.Typeface) r0
            if (r0 == 0) goto L10
            c.f.g.k$a r7 = new c.f.g.k$a
            r7.<init>(r0)
            return r7
        L10:
            r0 = 0
            c.f.g.l r9 = c.f.g.e.a(r8, r9, r0)     // Catch: android.content.pm.PackageManager.NameNotFoundException -> L61
            int r1 = r9.a
            r2 = -3
            r3 = 1
            if (r1 == 0) goto L20
            if (r1 == r3) goto L1e
            goto L35
        L1e:
            r1 = -2
            goto L3e
        L20:
            c.f.g.m[] r1 = r9.f1373b
            if (r1 == 0) goto L3d
            int r4 = r1.length
            if (r4 != 0) goto L28
            goto L3d
        L28:
            int r3 = r1.length
            r4 = 0
            r5 = r4
        L2b:
            if (r5 >= r3) goto L3c
            r6 = r1[r5]
            int r6 = r6.f1377e
            if (r6 == 0) goto L39
            if (r6 >= 0) goto L37
        L35:
            r1 = r2
            goto L3e
        L37:
            r1 = r6
            goto L3e
        L39:
            int r5 = r5 + 1
            goto L2b
        L3c:
            r3 = r4
        L3d:
            r1 = r3
        L3e:
            if (r1 == 0) goto L46
            c.f.g.k$a r7 = new c.f.g.k$a
            r7.<init>(r1)
            return r7
        L46:
            c.f.g.m[] r9 = r9.f1373b
            c.f.d.j r1 = c.f.d.d.a
            android.graphics.Typeface r8 = r1.b(r8, r0, r9, r10)
            if (r8 == 0) goto L5b
            c.d.f<java.lang.String, android.graphics.Typeface> r9 = c.f.g.k.a
            r9.b(r7, r8)
            c.f.g.k$a r7 = new c.f.g.k$a
            r7.<init>(r8)
            return r7
        L5b:
            c.f.g.k$a r7 = new c.f.g.k$a
            r7.<init>(r2)
            return r7
        L61:
            c.f.g.k$a r7 = new c.f.g.k$a
            r8 = -1
            r7.<init>(r8)
            return r7
        */
        throw new UnsupportedOperationException("Method not decompiled: c.f.g.k.a(java.lang.String, android.content.Context, c.f.g.f, int):c.f.g.k$a");
    }

    /* JADX INFO: compiled from: FontRequestWorker.java */
    public static final class a {
        public final Typeface a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public final int f1372b;

        public a(int i2) {
            this.a = null;
            this.f1372b = i2;
        }

        @SuppressLint({"WrongConstant"})
        public a(Typeface typeface) {
            this.a = typeface;
            this.f1372b = 0;
        }
    }
}
