package g.d.a.j;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/* JADX INFO: compiled from: ConstraintWidgetGroup.java */
/* JADX INFO: loaded from: classes.dex */
public class h {
    public List<f> a;
    int b;
    int c;
    public boolean d;
    public final int[] e;
    List<f> f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    List<f> f490g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    HashSet<f> f491h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    HashSet<f> f492i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    List<f> f493j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    List<f> f494k;

    h(List<f> list) {
        this.b = -1;
        this.c = -1;
        this.d = false;
        this.e = new int[]{-1, -1};
        this.f = new ArrayList();
        this.f490g = new ArrayList();
        this.f491h = new HashSet<>();
        this.f492i = new HashSet<>();
        this.f493j = new ArrayList();
        this.f494k = new ArrayList();
        this.a = list;
    }

    private void e(ArrayList<f> arrayList, f fVar) {
        if (fVar.d0) {
            return;
        }
        arrayList.add(fVar);
        fVar.d0 = true;
        if (fVar.L()) {
            return;
        }
        if (fVar instanceof j) {
            j jVar = (j) fVar;
            int i2 = jVar.l0;
            for (int i3 = 0; i3 < i2; i3++) {
                e(arrayList, jVar.k0[i3]);
            }
        }
        int length = fVar.A.length;
        for (int i4 = 0; i4 < length; i4++) {
            e eVar = fVar.A[i4].d;
            if (eVar != null) {
                f fVar2 = eVar.b;
                if (eVar != null && fVar2 != fVar.u()) {
                    e(arrayList, fVar2);
                }
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:24:0x0045  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    private void f(g.d.a.j.f r7) {
        /*
            Method dump skipped, instruction units count: 223
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: g.d.a.j.h.f(g.d.a.j.f):void");
    }

    void a(f fVar, int i2) {
        if (i2 == 0) {
            this.f491h.add(fVar);
        } else if (i2 == 1) {
            this.f492i.add(fVar);
        }
    }

    public List<f> b(int i2) {
        if (i2 == 0) {
            return this.f;
        }
        if (i2 == 1) {
            return this.f490g;
        }
        return null;
    }

    Set<f> c(int i2) {
        if (i2 == 0) {
            return this.f491h;
        }
        if (i2 == 1) {
            return this.f492i;
        }
        return null;
    }

    List<f> d() {
        if (!this.f493j.isEmpty()) {
            return this.f493j;
        }
        int size = this.a.size();
        for (int i2 = 0; i2 < size; i2++) {
            f fVar = this.a.get(i2);
            if (!fVar.b0) {
                e((ArrayList) this.f493j, fVar);
            }
        }
        this.f494k.clear();
        this.f494k.addAll(this.a);
        this.f494k.removeAll(this.f493j);
        return this.f493j;
    }

    void g() {
        int size = this.f494k.size();
        for (int i2 = 0; i2 < size; i2++) {
            f(this.f494k.get(i2));
        }
    }

    h(List<f> list, boolean z) {
        this.b = -1;
        this.c = -1;
        this.d = false;
        this.e = new int[]{-1, -1};
        this.f = new ArrayList();
        this.f490g = new ArrayList();
        this.f491h = new HashSet<>();
        this.f492i = new HashSet<>();
        this.f493j = new ArrayList();
        this.f494k = new ArrayList();
        this.a = list;
        this.d = z;
    }
}
