package android.support.constraint.i.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 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public List<f> f463a;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    int f465c;

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

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    List<f> f468f;
    List<f> g;
    HashSet<f> h;
    HashSet<f> i;
    List<f> j;
    List<f> k;

    h(List<f> list) {
        this.f464b = -1;
        this.f465c = -1;
        this.f466d = false;
        this.f467e = new int[]{-1, -1};
        this.f468f = new ArrayList();
        this.g = new ArrayList();
        this.h = new HashSet<>();
        this.i = new HashSet<>();
        this.j = new ArrayList();
        this.k = new ArrayList();
        this.f463a = 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 i = jVar.l0;
            for (int i2 = 0; i2 < i; i2++) {
                e(arrayList, jVar.k0[i2]);
            }
        }
        int length = fVar.A.length;
        for (int i3 = 0; i3 < length; i3++) {
            e eVar = fVar.A[i3].f451d;
            if (eVar != null) {
                f fVar2 = eVar.f449b;
                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(android.support.constraint.i.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: android.support.constraint.i.j.h.f(android.support.constraint.i.j.f):void");
    }

    void a(f fVar, int i) {
        if (i == 0) {
            this.h.add(fVar);
        } else if (i == 1) {
            this.i.add(fVar);
        }
    }

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

    Set<f> c(int i) {
        if (i == 0) {
            return this.h;
        }
        if (i == 1) {
            return this.i;
        }
        return null;
    }

    List<f> d() {
        if (!this.j.isEmpty()) {
            return this.j;
        }
        int size = this.f463a.size();
        for (int i = 0; i < size; i++) {
            f fVar = this.f463a.get(i);
            if (!fVar.b0) {
                e((ArrayList) this.j, fVar);
            }
        }
        this.k.clear();
        this.k.addAll(this.f463a);
        this.k.removeAll(this.j);
        return this.j;
    }

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

    h(List<f> list, boolean z) {
        this.f464b = -1;
        this.f465c = -1;
        this.f466d = false;
        this.f467e = new int[]{-1, -1};
        this.f468f = new ArrayList();
        this.g = new ArrayList();
        this.h = new HashSet<>();
        this.i = new HashSet<>();
        this.j = new ArrayList();
        this.k = new ArrayList();
        this.f463a = list;
        this.f466d = z;
    }
}
