package o;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.zl, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C3123zl {
    public int b;
    public boolean c;
    public final C0530Ul d;
    public final int e;
    public C3123zl f;
    public R90 i;
    public HashSet a = null;
    public int g = 0;
    public int h = Integer.MIN_VALUE;

    public C3123zl(C0530Ul c0530Ul, int i) {
        this.d = c0530Ul;
        this.e = i;
    }

    public final void a(C3123zl c3123zl, int i) {
        b(c3123zl, i, Integer.MIN_VALUE, false);
    }

    public final boolean b(C3123zl c3123zl, int i, int i2, boolean z) {
        if (c3123zl == null) {
            j();
            return true;
        }
        if (!z && !i(c3123zl)) {
            return false;
        }
        this.f = c3123zl;
        if (c3123zl.a == null) {
            c3123zl.a = new HashSet();
        }
        HashSet hashSet = this.f.a;
        if (hashSet != null) {
            hashSet.add(this);
        }
        this.g = i;
        this.h = i2;
        return true;
    }

    public final void c(int i, ArrayList arrayList, Zk0 zk0) {
        HashSet hashSet = this.a;
        if (hashSet != null) {
            Iterator it = hashSet.iterator();
            while (it.hasNext()) {
                AbstractC2461sm0.m(((C3123zl) it.next()).d, i, arrayList, zk0);
            }
        }
    }

    public final int d() {
        if (this.c) {
            return this.b;
        }
        return 0;
    }

    public final int e() {
        C3123zl c3123zl;
        if (this.d.g0 == 8) {
            return 0;
        }
        int i = this.h;
        return (i == Integer.MIN_VALUE || (c3123zl = this.f) == null || c3123zl.d.g0 != 8) ? this.g : i;
    }

    public final C3123zl f() {
        int i = this.e;
        int iW = AbstractC2462sn.w(i);
        C0530Ul c0530Ul = this.d;
        switch (iW) {
            case 0:
            case 5:
            case 6:
            case 7:
            case 8:
                return null;
            case 1:
                return c0530Ul.K;
            case 2:
                return c0530Ul.L;
            case 3:
                return c0530Ul.I;
            case 4:
                return c0530Ul.J;
            default:
                throw new AssertionError(AbstractC2462sn.v(i));
        }
    }

    public final boolean g() {
        HashSet hashSet = this.a;
        if (hashSet == null) {
            return false;
        }
        Iterator it = hashSet.iterator();
        while (it.hasNext()) {
            if (((C3123zl) it.next()).f().h()) {
                return true;
            }
        }
        return false;
    }

    public final boolean h() {
        return this.f != null;
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Removed duplicated region for block: B:46:0x0063 A[RETURN] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean i(o.C3123zl r11) {
        /*
            r10 = this;
            r0 = 0
            if (r11 != 0) goto L5
            goto L65
        L5:
            o.Ul r1 = r11.d
            int r11 = r11.e
            r2 = 6
            int r3 = r10.e
            r4 = 1
            if (r11 != r3) goto L1c
            if (r3 != r2) goto L63
            boolean r11 = r1.E
            if (r11 == 0) goto L65
            o.Ul r11 = r10.d
            boolean r11 = r11.E
            if (r11 != 0) goto L63
            goto L65
        L1c:
            int r5 = o.AbstractC2462sn.w(r3)
            r6 = 4
            r7 = 2
            r8 = 9
            r9 = 8
            switch(r5) {
                case 0: goto L65;
                case 1: goto L53;
                case 2: goto L3f;
                case 3: goto L53;
                case 4: goto L3f;
                case 5: goto L3a;
                case 6: goto L33;
                case 7: goto L65;
                case 8: goto L65;
                default: goto L29;
            }
        L29:
            java.lang.AssertionError r11 = new java.lang.AssertionError
            java.lang.String r0 = o.AbstractC2462sn.v(r3)
            r11.<init>(r0)
            throw r11
        L33:
            if (r11 == r2) goto L65
            if (r11 == r9) goto L65
            if (r11 == r8) goto L65
            goto L63
        L3a:
            if (r11 == r7) goto L65
            if (r11 != r6) goto L63
            goto L65
        L3f:
            r2 = 3
            if (r11 == r2) goto L48
            r2 = 5
            if (r11 != r2) goto L46
            goto L48
        L46:
            r2 = r0
            goto L49
        L48:
            r2 = r4
        L49:
            boolean r1 = r1 instanceof o.C2604uE
            if (r1 == 0) goto L52
            if (r2 != 0) goto L63
            if (r11 != r8) goto L65
            goto L63
        L52:
            return r2
        L53:
            if (r11 == r7) goto L5a
            if (r11 != r6) goto L58
            goto L5a
        L58:
            r2 = r0
            goto L5b
        L5a:
            r2 = r4
        L5b:
            boolean r1 = r1 instanceof o.C2604uE
            if (r1 == 0) goto L64
            if (r2 != 0) goto L63
            if (r11 != r9) goto L65
        L63:
            return r4
        L64:
            return r2
        L65:
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C3123zl.i(o.zl):boolean");
    }

    public final void j() {
        HashSet hashSet;
        C3123zl c3123zl = this.f;
        if (c3123zl != null && (hashSet = c3123zl.a) != null) {
            hashSet.remove(this);
            if (this.f.a.size() == 0) {
                this.f.a = null;
            }
        }
        this.a = null;
        this.f = null;
        this.g = 0;
        this.h = Integer.MIN_VALUE;
        this.c = false;
        this.b = 0;
    }

    public final void k() {
        R90 r90 = this.i;
        if (r90 == null) {
            this.i = new R90(1);
        } else {
            r90.c();
        }
    }

    public final void l(int i) {
        this.b = i;
        this.c = true;
    }

    public final String toString() {
        return this.d.h0 + ":" + AbstractC2462sn.v(this.e);
    }
}
