package w;

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

/* JADX INFO: renamed from: w.c, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1082c {

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public boolean f10463c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final C1083d f10464d;

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public C1082c f10466f;
    public u.f i;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public HashSet f10461a = null;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public int f10467g = 0;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public int f10468h = Integer.MIN_VALUE;

    public C1082c(C1083d c1083d, int i) {
        this.f10464d = c1083d;
        this.f10465e = i;
    }

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

    public final boolean b(C1082c c1082c, int i, int i5, boolean z5) {
        if (c1082c == null) {
            j();
            return true;
        }
        if (!z5 && !i(c1082c)) {
            return false;
        }
        this.f10466f = c1082c;
        if (c1082c.f10461a == null) {
            c1082c.f10461a = new HashSet();
        }
        HashSet hashSet = this.f10466f.f10461a;
        if (hashSet != null) {
            hashSet.add(this);
        }
        this.f10467g = i;
        this.f10468h = i5;
        return true;
    }

    public final void c(int i, ArrayList arrayList, n nVar) {
        HashSet hashSet = this.f10461a;
        if (hashSet != null) {
            Iterator it = hashSet.iterator();
            while (it.hasNext()) {
                x.h.b(((C1082c) it.next()).f10464d, i, arrayList, nVar);
            }
        }
    }

    public final int d() {
        if (this.f10463c) {
            return this.f10462b;
        }
        return 0;
    }

    public final int e() {
        C1082c c1082c;
        if (this.f10464d.f10504g0 == 8) {
            return 0;
        }
        int i = this.f10468h;
        return (i == Integer.MIN_VALUE || (c1082c = this.f10466f) == null || c1082c.f10464d.f10504g0 != 8) ? this.f10467g : i;
    }

    public final C1082c f() {
        int i = this.f10465e;
        int iC = u.e.c(i);
        C1083d c1083d = this.f10464d;
        switch (iC) {
            case 0:
            case 5:
            case 6:
            case 7:
            case 8:
                return null;
            case 1:
                return c1083d.K;
            case 2:
                return c1083d.f10477L;
            case 3:
                return c1083d.I;
            case 4:
                return c1083d.J;
            default:
                throw new AssertionError(s0.c.g(i));
        }
    }

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

    public final boolean h() {
        return this.f10466f != 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 code enable 'Show inconsistent code' option in preferences
    */
    public final boolean i(w.C1082c r11) {
        /*
            r10 = this;
            r0 = 0
            if (r11 != 0) goto L5
            goto L65
        L5:
            r1 = 6
            int r2 = r10.f10465e
            r3 = 1
            w.d r4 = r11.f10464d
            int r11 = r11.f10465e
            if (r11 != r2) goto L1c
            if (r2 != r1) goto L63
            boolean r11 = r4.f10473E
            if (r11 == 0) goto L65
            w.d r11 = r10.f10464d
            boolean r11 = r11.f10473E
            if (r11 != 0) goto L63
            goto L65
        L1c:
            int r5 = u.e.c(r2)
            r6 = 8
            r7 = 9
            r8 = 4
            r9 = 2
            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 = s0.c.g(r2)
            r11.<init>(r0)
            throw r11
        L33:
            if (r11 == r1) goto L65
            if (r11 == r6) goto L65
            if (r11 == r7) goto L65
            goto L63
        L3a:
            if (r11 == r9) goto L65
            if (r11 != r8) goto L63
            goto L65
        L3f:
            r1 = 3
            if (r11 == r1) goto L48
            r1 = 5
            if (r11 != r1) goto L46
            goto L48
        L46:
            r1 = r0
            goto L49
        L48:
            r1 = r3
        L49:
            boolean r2 = r4 instanceof w.C1087h
            if (r2 == 0) goto L52
            if (r1 != 0) goto L63
            if (r11 != r7) goto L65
            goto L63
        L52:
            return r1
        L53:
            if (r11 == r9) goto L5a
            if (r11 != r8) goto L58
            goto L5a
        L58:
            r1 = r0
            goto L5b
        L5a:
            r1 = r3
        L5b:
            boolean r2 = r4 instanceof w.C1087h
            if (r2 == 0) goto L64
            if (r1 != 0) goto L63
            if (r11 != r6) goto L65
        L63:
            return r3
        L64:
            return r1
        L65:
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: w.C1082c.i(w.c):boolean");
    }

    public final void j() {
        HashSet hashSet;
        C1082c c1082c = this.f10466f;
        if (c1082c != null && (hashSet = c1082c.f10461a) != null) {
            hashSet.remove(this);
            if (this.f10466f.f10461a.size() == 0) {
                this.f10466f.f10461a = null;
            }
        }
        this.f10461a = null;
        this.f10466f = null;
        this.f10467g = 0;
        this.f10468h = Integer.MIN_VALUE;
        this.f10463c = false;
        this.f10462b = 0;
    }

    public final void k() {
        u.f fVar = this.i;
        if (fVar == null) {
            this.i = new u.f(1);
        } else {
            fVar.c();
        }
    }

    public final void l(int i) {
        this.f10462b = i;
        this.f10463c = true;
    }

    public final String toString() {
        return this.f10464d.f10506h0 + ":" + s0.c.g(this.f10465e);
    }
}
