package androidx.constraintlayout.helper.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import java.util.ArrayList;
import java.util.HashMap;
import o.Bk0;
import o.C0530Ul;
import o.C1778ld;
import o.C2199pz;
import o.RZ;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public class Flow extends Bk0 {
    public final C2199pz u;

    public Flow(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        this.l = new int[32];
        this.r = new HashMap();
        this.n = context;
        super.g(attributeSet);
        C2199pz c2199pz = new C2199pz();
        c2199pz.s0 = 0;
        c2199pz.t0 = 0;
        c2199pz.u0 = 0;
        c2199pz.v0 = 0;
        c2199pz.w0 = 0;
        c2199pz.x0 = 0;
        c2199pz.y0 = false;
        c2199pz.z0 = 0;
        c2199pz.A0 = 0;
        c2199pz.B0 = new C1778ld();
        c2199pz.C0 = null;
        c2199pz.D0 = -1;
        c2199pz.E0 = -1;
        c2199pz.F0 = -1;
        c2199pz.G0 = -1;
        c2199pz.H0 = -1;
        c2199pz.I0 = -1;
        c2199pz.J0 = 0.5f;
        c2199pz.K0 = 0.5f;
        c2199pz.L0 = 0.5f;
        c2199pz.M0 = 0.5f;
        c2199pz.N0 = 0.5f;
        c2199pz.O0 = 0.5f;
        c2199pz.P0 = 0;
        c2199pz.Q0 = 0;
        c2199pz.R0 = 2;
        c2199pz.S0 = 2;
        c2199pz.T0 = 0;
        c2199pz.U0 = -1;
        c2199pz.V0 = 0;
        c2199pz.W0 = new ArrayList();
        c2199pz.X0 = null;
        c2199pz.Y0 = null;
        c2199pz.Z0 = null;
        c2199pz.b1 = 0;
        this.u = c2199pz;
        if (attributeSet != null) {
            TypedArray typedArrayObtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, RZ.b);
            int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
            for (int i = 0; i < indexCount; i++) {
                int index = typedArrayObtainStyledAttributes.getIndex(i);
                if (index == 0) {
                    this.u.V0 = typedArrayObtainStyledAttributes.getInt(index, 0);
                } else if (index == 1) {
                    C2199pz c2199pz2 = this.u;
                    int dimensionPixelSize = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, 0);
                    c2199pz2.s0 = dimensionPixelSize;
                    c2199pz2.t0 = dimensionPixelSize;
                    c2199pz2.u0 = dimensionPixelSize;
                    c2199pz2.v0 = dimensionPixelSize;
                } else if (index == 18) {
                    C2199pz c2199pz3 = this.u;
                    int dimensionPixelSize2 = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, 0);
                    c2199pz3.u0 = dimensionPixelSize2;
                    c2199pz3.w0 = dimensionPixelSize2;
                    c2199pz3.x0 = dimensionPixelSize2;
                } else if (index == 19) {
                    this.u.v0 = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, 0);
                } else if (index == 2) {
                    this.u.w0 = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, 0);
                } else if (index == 3) {
                    this.u.s0 = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, 0);
                } else if (index == 4) {
                    this.u.x0 = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, 0);
                } else if (index == 5) {
                    this.u.t0 = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, 0);
                } else if (index == 54) {
                    this.u.T0 = typedArrayObtainStyledAttributes.getInt(index, 0);
                } else if (index == 44) {
                    this.u.D0 = typedArrayObtainStyledAttributes.getInt(index, 0);
                } else if (index == 53) {
                    this.u.E0 = typedArrayObtainStyledAttributes.getInt(index, 0);
                } else if (index == 38) {
                    this.u.F0 = typedArrayObtainStyledAttributes.getInt(index, 0);
                } else if (index == 46) {
                    this.u.H0 = typedArrayObtainStyledAttributes.getInt(index, 0);
                } else if (index == 40) {
                    this.u.G0 = typedArrayObtainStyledAttributes.getInt(index, 0);
                } else if (index == 48) {
                    this.u.I0 = typedArrayObtainStyledAttributes.getInt(index, 0);
                } else if (index == 42) {
                    this.u.J0 = typedArrayObtainStyledAttributes.getFloat(index, 0.5f);
                } else if (index == 37) {
                    this.u.L0 = typedArrayObtainStyledAttributes.getFloat(index, 0.5f);
                } else if (index == 45) {
                    this.u.N0 = typedArrayObtainStyledAttributes.getFloat(index, 0.5f);
                } else if (index == 39) {
                    this.u.M0 = typedArrayObtainStyledAttributes.getFloat(index, 0.5f);
                } else if (index == 47) {
                    this.u.O0 = typedArrayObtainStyledAttributes.getFloat(index, 0.5f);
                } else if (index == 51) {
                    this.u.K0 = typedArrayObtainStyledAttributes.getFloat(index, 0.5f);
                } else if (index == 41) {
                    this.u.R0 = typedArrayObtainStyledAttributes.getInt(index, 2);
                } else if (index == 50) {
                    this.u.S0 = typedArrayObtainStyledAttributes.getInt(index, 2);
                } else if (index == 43) {
                    this.u.P0 = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, 0);
                } else if (index == 52) {
                    this.u.Q0 = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, 0);
                } else if (index == 49) {
                    this.u.U0 = typedArrayObtainStyledAttributes.getInt(index, -1);
                }
            }
            typedArrayObtainStyledAttributes.recycle();
        }
        this.f82o = this.u;
        i();
    }

    @Override // o.AbstractC0089Dl
    public final void h(C0530Ul c0530Ul, boolean z) {
        C2199pz c2199pz = this.u;
        int i = c2199pz.u0;
        if (i > 0 || c2199pz.v0 > 0) {
            if (z) {
                c2199pz.w0 = c2199pz.v0;
                c2199pz.x0 = i;
            } else {
                c2199pz.w0 = i;
                c2199pz.x0 = c2199pz.v0;
            }
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:391:0x068f  */
    /* JADX WARN: Removed duplicated region for block: B:39:0x00c9  */
    /* JADX WARN: Removed duplicated region for block: B:405:0x072a  */
    /* JADX WARN: Removed duplicated region for block: B:411:0x0738  */
    /* JADX WARN: Removed duplicated region for block: B:412:0x073b  */
    /* JADX WARN: Removed duplicated region for block: B:419:0x0757  */
    /* JADX WARN: Removed duplicated region for block: B:420:0x0759  */
    /* JADX WARN: Removed duplicated region for block: B:42:0x00d0  */
    /* JADX WARN: Removed duplicated region for block: B:430:0x010f A[EDGE_INSN: B:430:0x010f->B:63:0x010f BREAK  A[LOOP:1: B:57:0x00f8->B:62:0x010a], SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:50:0x00e3  */
    /* JADX WARN: Removed duplicated region for block: B:59:0x0100  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x0111  */
    /* JADX WARN: Removed duplicated region for block: B:72:0x0135  */
    /* JADX WARN: Removed duplicated region for block: B:75:0x0140  */
    /* JADX WARN: Type inference failed for: r12v2 */
    /* JADX WARN: Type inference failed for: r12v3 */
    /* JADX WARN: Type inference failed for: r12v46 */
    @Override // o.Bk0
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void j(o.C2199pz r39, int r40, int r41) {
        /*
            Method dump skipped, instructions count: 1901
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.helper.widget.Flow.j(o.pz, int, int):void");
    }

    @Override // o.AbstractC0089Dl, android.view.View
    public final void onMeasure(int i, int i2) {
        j(this.u, i, i2);
    }

    public void setFirstHorizontalBias(float f) {
        this.u.L0 = f;
        requestLayout();
    }

    public void setFirstHorizontalStyle(int i) {
        this.u.F0 = i;
        requestLayout();
    }

    public void setFirstVerticalBias(float f) {
        this.u.M0 = f;
        requestLayout();
    }

    public void setFirstVerticalStyle(int i) {
        this.u.G0 = i;
        requestLayout();
    }

    public void setHorizontalAlign(int i) {
        this.u.R0 = i;
        requestLayout();
    }

    public void setHorizontalBias(float f) {
        this.u.J0 = f;
        requestLayout();
    }

    public void setHorizontalGap(int i) {
        this.u.P0 = i;
        requestLayout();
    }

    public void setHorizontalStyle(int i) {
        this.u.D0 = i;
        requestLayout();
    }

    public void setLastHorizontalBias(float f) {
        this.u.N0 = f;
        requestLayout();
    }

    public void setLastHorizontalStyle(int i) {
        this.u.H0 = i;
        requestLayout();
    }

    public void setLastVerticalBias(float f) {
        this.u.O0 = f;
        requestLayout();
    }

    public void setLastVerticalStyle(int i) {
        this.u.I0 = i;
        requestLayout();
    }

    public void setMaxElementsWrap(int i) {
        this.u.U0 = i;
        requestLayout();
    }

    public void setOrientation(int i) {
        this.u.V0 = i;
        requestLayout();
    }

    public void setPadding(int i) {
        C2199pz c2199pz = this.u;
        c2199pz.s0 = i;
        c2199pz.t0 = i;
        c2199pz.u0 = i;
        c2199pz.v0 = i;
        requestLayout();
    }

    public void setPaddingBottom(int i) {
        this.u.t0 = i;
        requestLayout();
    }

    public void setPaddingLeft(int i) {
        this.u.w0 = i;
        requestLayout();
    }

    public void setPaddingRight(int i) {
        this.u.x0 = i;
        requestLayout();
    }

    public void setPaddingTop(int i) {
        this.u.s0 = i;
        requestLayout();
    }

    public void setVerticalAlign(int i) {
        this.u.S0 = i;
        requestLayout();
    }

    public void setVerticalBias(float f) {
        this.u.K0 = f;
        requestLayout();
    }

    public void setVerticalGap(int i) {
        this.u.Q0 = i;
        requestLayout();
    }

    public void setVerticalStyle(int i) {
        this.u.E0 = i;
        requestLayout();
    }

    public void setWrapMode(int i) {
        this.u.T0 = i;
        requestLayout();
    }
}
