package defpackage;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Random;

/* renamed from: ᵻʽ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C5172 {

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public String f19248;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public C1343 f19252;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public static final C4287 f19245 = new C4287(0);

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public static final Random f19244 = new Random();

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C3254 f19250 = new C3254();

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final C4479 f19251 = new C4479();

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final HashMap f19249 = new HashMap();

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public AbstractC0488 f19246 = AbstractC0488.f2597;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public long f19247 = -1;

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final void m10670(C2355 c2355) {
        C2477 c2477;
        AbstractC0488 abstractC0488 = c2355.f9214;
        int i = c2355.f9211;
        C2477 c24772 = c2355.f9217;
        boolean zM2115 = abstractC0488.m2115();
        String str = this.f19248;
        HashMap map = this.f19249;
        if (zM2115) {
            if (str != null) {
                C1062 c1062 = (C1062) map.get(str);
                c1062.getClass();
                m10674(c1062);
                return;
            }
            return;
        }
        C1062 c10622 = (C1062) map.get(str);
        this.f19248 = m10673(i, c24772).f4599;
        m10672(c2355);
        if (c24772 != null) {
            long j = c24772.f9685;
            if (c24772.m6321()) {
                if (c10622 != null && c10622.f4598 == j && (c2477 = c10622.f4601) != null && c2477.f9684 == c24772.f9684 && c2477.f9682 == c24772.f9682) {
                    return;
                }
                m10673(i, new C2477(j, c24772.f9683));
                this.f19252.getClass();
            }
        }
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final synchronized void m10671(C2355 c2355, int i) {
        try {
            this.f19252.getClass();
            boolean z = i == 0;
            Iterator it = this.f19249.values().iterator();
            while (it.hasNext()) {
                C1062 c1062 = (C1062) it.next();
                if (c1062.m3437(c2355)) {
                    it.remove();
                    boolean zEquals = c1062.f4599.equals(this.f19248);
                    if (zEquals) {
                        m10674(c1062);
                    }
                    if (c1062.f4595) {
                        if (z && zEquals) {
                            boolean z2 = c1062.f4597;
                        }
                        this.f19252.m4163(c2355, c1062.f4599);
                    }
                }
            }
            m10670(c2355);
        } catch (Throwable th) {
            throw th;
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:16:0x002f A[Catch: all -> 0x0054, TRY_LEAVE, TryCatch #0 {, blocks: (B:3:0x0001, B:7:0x0010, B:9:0x0014, B:11:0x001c, B:13:0x0028, B:16:0x002f, B:22:0x003a, B:24:0x0046, B:26:0x004c, B:32:0x0057, B:34:0x0063, B:35:0x0067, B:37:0x006c, B:39:0x0072, B:41:0x0089, B:42:0x00b6, B:44:0x00ba, B:45:0x00c1, B:47:0x00cb, B:49:0x00cf), top: B:54:0x0001 }] */
    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final synchronized void m10672(defpackage.C2355 r10) {
        /*
            Method dump skipped, instructions count: 220
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C5172.m10672(ᵖˌˀ):void");
    }

    /* JADX WARN: Removed duplicated region for block: B:15:0x004b  */
    /* JADX WARN: Removed duplicated region for block: B:41:0x008e  */
    /* JADX WARN: Removed duplicated region for block: B:59:0x00a0 A[ADDED_TO_REGION, REMOVE, SYNTHETIC] */
    /* renamed from: ˏᵙ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final defpackage.C1062 m10673(int r19, defpackage.C2477 r20) {
        /*
            r18 = this;
            r0 = r18
            r1 = r19
            r2 = r20
            java.util.HashMap r3 = r0.f19249
            java.util.Collection r4 = r3.values()
            java.util.Iterator r4 = r4.iterator()
            r5 = 0
            r6 = 9223372036854775807(0x7fffffffffffffff, double:NaN)
        L16:
            boolean r8 = r4.hasNext()
            if (r8 == 0) goto La4
            java.lang.Object r8 = r4.next()
            ˈᵕᵟ r8 = (defpackage.C1062) r8
            long r9 = r8.f4598
            ᵗᵱ r11 = r8.f4601
            r12 = -1
            int r9 = (r9 > r12 ? 1 : (r9 == r12 ? 0 : -1))
            if (r9 != 0) goto L57
            int r9 = r8.f4600
            if (r1 != r9) goto L57
            if (r2 == 0) goto L57
            long r9 = r2.f9685
            ᵻʽ r14 = r8.f4596
            java.util.HashMap r15 = r14.f19249
            r16 = r12
            java.lang.String r12 = r14.f19248
            java.lang.Object r12 = r15.get(r12)
            ˈᵕᵟ r12 = (defpackage.C1062) r12
            if (r12 == 0) goto L4b
            long r12 = r12.f4598
            int r15 = (r12 > r16 ? 1 : (r12 == r16 ? 0 : -1))
            if (r15 == 0) goto L4b
            goto L50
        L4b:
            long r12 = r14.f19247
            r14 = 1
            long r12 = r12 + r14
        L50:
            int r12 = (r9 > r12 ? 1 : (r9 == r12 ? 0 : -1))
            if (r12 < 0) goto L59
            r8.f4598 = r9
            goto L59
        L57:
            r16 = r12
        L59:
            if (r2 == 0) goto L84
            long r9 = r2.f9685
            int r12 = (r9 > r16 ? 1 : (r9 == r16 ? 0 : -1))
            if (r12 != 0) goto L62
            goto L84
        L62:
            if (r11 != 0) goto L71
            boolean r12 = r2.m6321()
            if (r12 != 0) goto L16
            long r12 = r8.f4598
            int r9 = (r9 > r12 ? 1 : (r9 == r12 ? 0 : -1))
            if (r9 != 0) goto L16
            goto L88
        L71:
            long r12 = r11.f9685
            int r9 = (r9 > r12 ? 1 : (r9 == r12 ? 0 : -1))
            if (r9 != 0) goto L16
            int r9 = r2.f9684
            int r10 = r11.f9684
            if (r9 != r10) goto L16
            int r9 = r2.f9682
            int r10 = r11.f9682
            if (r9 != r10) goto L16
            goto L88
        L84:
            int r9 = r8.f4600
            if (r1 != r9) goto L16
        L88:
            long r9 = r8.f4598
            int r12 = (r9 > r16 ? 1 : (r9 == r16 ? 0 : -1))
            if (r12 == 0) goto La0
            int r12 = (r9 > r6 ? 1 : (r9 == r6 ? 0 : -1))
            if (r12 >= 0) goto L93
            goto La0
        L93:
            if (r12 != 0) goto L16
            java.lang.String r9 = defpackage.AbstractC3558.f13329
            ᵗᵱ r9 = r5.f4601
            if (r9 == 0) goto L16
            if (r11 == 0) goto L16
            r5 = r8
            goto L16
        La0:
            r5 = r8
            r6 = r9
            goto L16
        La4:
            if (r5 != 0) goto Lb6
            ᵯᵚᵷˇ r4 = defpackage.C5172.f19245
            java.lang.Object r4 = r4.get()
            java.lang.String r4 = (java.lang.String) r4
            ˈᵕᵟ r5 = new ˈᵕᵟ
            r5.<init>(r0, r4, r1, r2)
            r3.put(r4, r5)
        Lb6:
            return r5
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C5172.m10673(int, ᵗᵱ):ˈᵕᵟ");
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final void m10674(C1062 c1062) {
        long j = c1062.f4598;
        if (j != -1 && c1062.f4595) {
            this.f19247 = j;
        }
        this.f19248 = null;
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final synchronized void m10675(C2355 c2355) {
        C1343 c1343;
        try {
            String str = this.f19248;
            if (str != null) {
                C1062 c1062 = (C1062) this.f19249.get(str);
                c1062.getClass();
                m10674(c1062);
            }
            Iterator it = this.f19249.values().iterator();
            while (it.hasNext()) {
                C1062 c10622 = (C1062) it.next();
                it.remove();
                if (c10622.f4595 && (c1343 = this.f19252) != null) {
                    c1343.m4163(c2355, c10622.f4599);
                }
            }
        } catch (Throwable th) {
            throw th;
        }
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final synchronized String m10676(AbstractC0488 abstractC0488, C2477 c2477) {
        return m10673(abstractC0488.mo2117(c2477.f9683, this.f19251).f16708, c2477).f4599;
    }
}
