package o;

import java.util.ArrayList;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class ZE extends AbstractC0745al0 {
    @Override // o.InterfaceC2755vr
    public final void a(InterfaceC2755vr interfaceC2755vr) {
        C0651Zc c0651Zc = (C0651Zc) this.b;
        int i = c0651Zc.s0;
        C0017Ar c0017Ar = this.h;
        ArrayList arrayList = c0017Ar.l;
        int size = arrayList.size();
        int i2 = 0;
        int i3 = -1;
        int i4 = 0;
        while (i4 < size) {
            Object obj = arrayList.get(i4);
            i4++;
            int i5 = ((C0017Ar) obj).g;
            if (i3 == -1 || i5 < i3) {
                i3 = i5;
            }
            if (i2 < i5) {
                i2 = i5;
            }
        }
        if (i == 0 || i == 2) {
            c0017Ar.d(i3 + c0651Zc.u0);
        } else {
            c0017Ar.d(i2 + c0651Zc.u0);
        }
    }

    @Override // o.AbstractC0745al0
    public final void d() {
        C0530Ul c0530Ul = this.b;
        if (c0530Ul instanceof C0651Zc) {
            C0017Ar c0017Ar = this.h;
            c0017Ar.b = true;
            ArrayList arrayList = c0017Ar.l;
            C0651Zc c0651Zc = (C0651Zc) c0530Ul;
            int i = c0651Zc.s0;
            boolean z = c0651Zc.t0;
            int i2 = 0;
            if (i == 0) {
                c0017Ar.e = 4;
                while (i2 < c0651Zc.r0) {
                    C0530Ul c0530Ul2 = c0651Zc.q0[i2];
                    if (z || c0530Ul2.g0 != 8) {
                        C0017Ar c0017Ar2 = c0530Ul2.d.h;
                        c0017Ar2.k.add(c0017Ar);
                        arrayList.add(c0017Ar2);
                    }
                    i2++;
                }
                m(this.b.d.h);
                m(this.b.d.i);
                return;
            }
            if (i == 1) {
                c0017Ar.e = 5;
                while (i2 < c0651Zc.r0) {
                    C0530Ul c0530Ul3 = c0651Zc.q0[i2];
                    if (z || c0530Ul3.g0 != 8) {
                        C0017Ar c0017Ar3 = c0530Ul3.d.i;
                        c0017Ar3.k.add(c0017Ar);
                        arrayList.add(c0017Ar3);
                    }
                    i2++;
                }
                m(this.b.d.h);
                m(this.b.d.i);
                return;
            }
            if (i == 2) {
                c0017Ar.e = 6;
                while (i2 < c0651Zc.r0) {
                    C0530Ul c0530Ul4 = c0651Zc.q0[i2];
                    if (z || c0530Ul4.g0 != 8) {
                        C0017Ar c0017Ar4 = c0530Ul4.e.h;
                        c0017Ar4.k.add(c0017Ar);
                        arrayList.add(c0017Ar4);
                    }
                    i2++;
                }
                m(this.b.e.h);
                m(this.b.e.i);
                return;
            }
            if (i != 3) {
                return;
            }
            c0017Ar.e = 7;
            while (i2 < c0651Zc.r0) {
                C0530Ul c0530Ul5 = c0651Zc.q0[i2];
                if (z || c0530Ul5.g0 != 8) {
                    C0017Ar c0017Ar5 = c0530Ul5.e.i;
                    c0017Ar5.k.add(c0017Ar);
                    arrayList.add(c0017Ar5);
                }
                i2++;
            }
            m(this.b.e.h);
            m(this.b.e.i);
        }
    }

    @Override // o.AbstractC0745al0
    public final void e() {
        C0530Ul c0530Ul = this.b;
        if (c0530Ul instanceof C0651Zc) {
            int i = ((C0651Zc) c0530Ul).s0;
            C0017Ar c0017Ar = this.h;
            if (i == 0 || i == 1) {
                c0530Ul.Y = c0017Ar.g;
            } else {
                c0530Ul.Z = c0017Ar.g;
            }
        }
    }

    @Override // o.AbstractC0745al0
    public final void f() {
        this.c = null;
        this.h.c();
    }

    @Override // o.AbstractC0745al0
    public final boolean k() {
        return false;
    }

    public final void m(C0017Ar c0017Ar) {
        C0017Ar c0017Ar2 = this.h;
        c0017Ar2.k.add(c0017Ar);
        c0017Ar.l.add(c0017Ar2);
    }
}
