package androidx.constraintlayout.widget;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
import android.util.SparseIntArray;
import android.view.View;
import android.view.ViewGroup;
import c.e.b.h.e;
import c.e.b.h.g;
import c.e.b.h.l.b;
import c.e.c.c;
import c.e.c.d;
import c.e.c.e;
import c.e.c.f;
import c.e.c.h;
import c.e.c.i;
import c.e.c.k;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Objects;
import okhttp3.internal.http2.Http2Connection;

/* JADX INFO: loaded from: classes.dex */
public class ConstraintLayout extends ViewGroup {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public SparseArray<View> f225b;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public ArrayList<c> f226e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public e f227f;

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

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

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

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

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

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public int f233l;
    public c.e.c.e m;
    public d n;
    public int o;
    public HashMap<String, Integer> p;
    public int q;
    public int r;
    public SparseArray<c.e.b.h.d> s;
    public b t;
    public int u;
    public int v;

    public class b implements b.InterfaceC0007b {
        public ConstraintLayout a;

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

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

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

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

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

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

        public b(ConstraintLayout constraintLayout) {
            this.a = constraintLayout;
        }

        public final boolean a(int i2, int i3, int i4) {
            if (i2 == i3) {
                return true;
            }
            int mode = View.MeasureSpec.getMode(i2);
            View.MeasureSpec.getSize(i2);
            int mode2 = View.MeasureSpec.getMode(i3);
            int size = View.MeasureSpec.getSize(i3);
            if (mode2 == 1073741824) {
                return (mode == Integer.MIN_VALUE || mode == 0) && i4 == size;
            }
            return false;
        }

        /* JADX WARN: Removed duplicated region for block: B:103:0x0144  */
        /* JADX WARN: Removed duplicated region for block: B:122:0x01a0  */
        /* JADX WARN: Removed duplicated region for block: B:124:0x01a3  */
        /* JADX WARN: Removed duplicated region for block: B:128:0x01b8  */
        /* JADX WARN: Removed duplicated region for block: B:129:0x01ba  */
        /* JADX WARN: Removed duplicated region for block: B:131:0x01bd  */
        /* JADX WARN: Removed duplicated region for block: B:132:0x01bf  */
        /* JADX WARN: Removed duplicated region for block: B:135:0x01c4  */
        /* JADX WARN: Removed duplicated region for block: B:139:0x01cb  */
        /* JADX WARN: Removed duplicated region for block: B:141:0x01ce  */
        /* JADX WARN: Removed duplicated region for block: B:145:0x01d5  */
        /* JADX WARN: Removed duplicated region for block: B:148:0x01d9  */
        /* JADX WARN: Removed duplicated region for block: B:151:0x01e1  */
        /* JADX WARN: Removed duplicated region for block: B:153:0x01e4  */
        /* JADX WARN: Removed duplicated region for block: B:156:0x01ec  */
        /* JADX WARN: Removed duplicated region for block: B:158:0x01ef A[RETURN] */
        /* JADX WARN: Removed duplicated region for block: B:159:0x01f0  */
        /* JADX WARN: Removed duplicated region for block: B:36:0x0072  */
        /* JADX WARN: Removed duplicated region for block: B:79:0x00f8  */
        @android.annotation.SuppressLint({"WrongCall"})
        /*
            Code decompiled incorrectly, please refer to instructions dump.
            To view partially-correct add '--show-bad-code' argument
        */
        public final void b(c.e.b.h.d r18, c.e.b.h.l.b.a r19) {
            /*
                Method dump skipped, instruction units count: 739
                To view this dump add '--comments-level debug' option
            */
            throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.widget.ConstraintLayout.b.b(c.e.b.h.d, c.e.b.h.l.b$a):void");
        }
    }

    public ConstraintLayout(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        this.f225b = new SparseArray<>();
        this.f226e = new ArrayList<>(4);
        this.f227f = new e();
        this.f228g = 0;
        this.f229h = 0;
        this.f230i = Integer.MAX_VALUE;
        this.f231j = Integer.MAX_VALUE;
        this.f232k = true;
        this.f233l = 257;
        this.m = null;
        this.n = null;
        this.o = -1;
        this.p = new HashMap<>();
        this.q = -1;
        this.r = -1;
        this.s = new SparseArray<>();
        b bVar = new b(this);
        this.t = bVar;
        this.u = 0;
        this.v = 0;
        e eVar = this.f227f;
        eVar.b0 = this;
        eVar.o0 = bVar;
        eVar.n0.f1155f = bVar;
        this.f225b.put(getId(), this);
        this.m = null;
        if (attributeSet != null) {
            TypedArray typedArrayObtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, k.f1258b, 0, 0);
            int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
            for (int i2 = 0; i2 < indexCount; i2++) {
                int index = typedArrayObtainStyledAttributes.getIndex(i2);
                if (index == 9) {
                    this.f228g = typedArrayObtainStyledAttributes.getDimensionPixelOffset(index, this.f228g);
                } else if (index == 10) {
                    this.f229h = typedArrayObtainStyledAttributes.getDimensionPixelOffset(index, this.f229h);
                } else if (index == 7) {
                    this.f230i = typedArrayObtainStyledAttributes.getDimensionPixelOffset(index, this.f230i);
                } else if (index == 8) {
                    this.f231j = typedArrayObtainStyledAttributes.getDimensionPixelOffset(index, this.f231j);
                } else if (index == 90) {
                    this.f233l = typedArrayObtainStyledAttributes.getInt(index, this.f233l);
                } else if (index == 39) {
                    int resourceId = typedArrayObtainStyledAttributes.getResourceId(index, 0);
                    if (resourceId != 0) {
                        try {
                            this.n = new d(getContext(), this, resourceId);
                        } catch (Resources.NotFoundException unused) {
                            this.n = null;
                        }
                    }
                } else if (index == 18) {
                    int resourceId2 = typedArrayObtainStyledAttributes.getResourceId(index, 0);
                    try {
                        c.e.c.e eVar2 = new c.e.c.e();
                        this.m = eVar2;
                        eVar2.d(getContext(), resourceId2);
                    } catch (Resources.NotFoundException unused2) {
                        this.m = null;
                    }
                    this.o = resourceId2;
                }
            }
            typedArrayObtainStyledAttributes.recycle();
        }
        this.f227f.a0(this.f233l);
    }

    private int getPaddingWidth() {
        int iMax = Math.max(0, getPaddingRight()) + Math.max(0, getPaddingLeft());
        int iMax2 = Math.max(0, getPaddingEnd()) + Math.max(0, getPaddingStart());
        return iMax2 > 0 ? iMax2 : iMax;
    }

    /* JADX WARN: Removed duplicated region for block: B:147:0x02e9  */
    /* JADX WARN: Removed duplicated region for block: B:150:0x02ee  */
    /* JADX WARN: Removed duplicated region for block: B:71:0x01b5  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:147:0x02e9 -> B:148:0x02ea). Please report as a decompilation issue!!! */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void a(boolean r19, android.view.View r20, c.e.b.h.d r21, androidx.constraintlayout.widget.ConstraintLayout.a r22, android.util.SparseArray<c.e.b.h.d> r23) {
        /*
            Method dump skipped, instruction units count: 846
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.widget.ConstraintLayout.a(boolean, android.view.View, c.e.b.h.d, androidx.constraintlayout.widget.ConstraintLayout$a, android.util.SparseArray):void");
    }

    @Override // android.view.ViewGroup
    public void addView(View view, int i2, ViewGroup.LayoutParams layoutParams) {
        super.addView(view, i2, layoutParams);
    }

    @Override // android.view.ViewGroup
    /* JADX INFO: renamed from: b, reason: merged with bridge method [inline-methods] */
    public a generateDefaultLayoutParams() {
        return new a(-2, -2);
    }

    public Object c(int i2, Object obj) {
        if (i2 != 0 || !(obj instanceof String)) {
            return null;
        }
        String str = (String) obj;
        HashMap<String, Integer> map = this.p;
        if (map == null || !map.containsKey(str)) {
            return null;
        }
        return this.p.get(str);
    }

    @Override // android.view.ViewGroup
    public boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return layoutParams instanceof a;
    }

    public View d(int i2) {
        return this.f225b.get(i2);
    }

    @Override // android.view.ViewGroup, android.view.View
    public void dispatchDraw(Canvas canvas) {
        Object tag;
        int size;
        ArrayList<c> arrayList = this.f226e;
        if (arrayList != null && (size = arrayList.size()) > 0) {
            for (int i2 = 0; i2 < size; i2++) {
                Objects.requireNonNull(this.f226e.get(i2));
            }
        }
        super.dispatchDraw(canvas);
        if (isInEditMode()) {
            int childCount = getChildCount();
            float width = getWidth();
            float height = getHeight();
            for (int i3 = 0; i3 < childCount; i3++) {
                View childAt = getChildAt(i3);
                if (childAt.getVisibility() != 8 && (tag = childAt.getTag()) != null && (tag instanceof String)) {
                    String[] strArrSplit = ((String) tag).split(",");
                    if (strArrSplit.length == 4) {
                        int i4 = Integer.parseInt(strArrSplit[0]);
                        int i5 = Integer.parseInt(strArrSplit[1]);
                        int i6 = Integer.parseInt(strArrSplit[2]);
                        int i7 = (int) ((i4 / 1080.0f) * width);
                        int i8 = (int) ((i5 / 1920.0f) * height);
                        Paint paint = new Paint();
                        paint.setColor(-65536);
                        float f2 = i7;
                        float f3 = i8;
                        float f4 = i7 + ((int) ((i6 / 1080.0f) * width));
                        canvas.drawLine(f2, f3, f4, f3, paint);
                        float f5 = i8 + ((int) ((Integer.parseInt(strArrSplit[3]) / 1920.0f) * height));
                        canvas.drawLine(f4, f3, f4, f5, paint);
                        canvas.drawLine(f4, f5, f2, f5, paint);
                        canvas.drawLine(f2, f5, f2, f3, paint);
                        paint.setColor(-16711936);
                        canvas.drawLine(f2, f3, f4, f5, paint);
                        canvas.drawLine(f2, f5, f4, f3, paint);
                    }
                }
            }
        }
    }

    public final c.e.b.h.d e(View view) {
        if (view == this) {
            return this.f227f;
        }
        if (view == null) {
            return null;
        }
        return ((a) view.getLayoutParams()).l0;
    }

    public boolean f() {
        return ((getContext().getApplicationInfo().flags & 4194304) != 0) && 1 == getLayoutDirection();
    }

    @Override // android.view.View
    public void forceLayout() {
        this.f232k = true;
        this.q = -1;
        this.r = -1;
        super.forceLayout();
    }

    public void g(int i2, int i3, int i4, int i5, boolean z, boolean z2) {
        b bVar = this.t;
        int i6 = bVar.f248e;
        int iResolveSizeAndState = ViewGroup.resolveSizeAndState(i4 + bVar.f247d, i2, 0);
        int iResolveSizeAndState2 = ViewGroup.resolveSizeAndState(i5 + i6, i3, 0) & 16777215;
        int iMin = Math.min(this.f230i, iResolveSizeAndState & 16777215);
        int iMin2 = Math.min(this.f231j, iResolveSizeAndState2);
        if (z) {
            iMin |= Http2Connection.OKHTTP_CLIENT_WINDOW_SIZE;
        }
        if (z2) {
            iMin2 |= Http2Connection.OKHTTP_CLIENT_WINDOW_SIZE;
        }
        setMeasuredDimension(iMin, iMin2);
        this.q = iMin;
        this.r = iMin2;
    }

    @Override // android.view.ViewGroup
    public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
        return new a(getContext(), attributeSet);
    }

    public int getMaxHeight() {
        return this.f231j;
    }

    public int getMaxWidth() {
        return this.f230i;
    }

    public int getMinHeight() {
        return this.f229h;
    }

    public int getMinWidth() {
        return this.f228g;
    }

    public int getOptimizationLevel() {
        return this.f227f.x0;
    }

    public void h(int i2, Object obj, Object obj2) {
        if (i2 == 0 && (obj instanceof String) && (obj2 instanceof Integer)) {
            if (this.p == null) {
                this.p = new HashMap<>();
            }
            String strSubstring = (String) obj;
            int iIndexOf = strSubstring.indexOf("/");
            if (iIndexOf != -1) {
                strSubstring = strSubstring.substring(iIndexOf + 1);
            }
            this.p.put(strSubstring, Integer.valueOf(((Integer) obj2).intValue()));
        }
    }

    public final boolean i() {
        int i2;
        boolean z;
        boolean z2;
        boolean z3;
        int i3;
        String str;
        int iE;
        int i4;
        boolean z4;
        boolean z5;
        int i5;
        int i6;
        String resourceEntryName;
        c.e.b.h.d dVar;
        int childCount = getChildCount();
        int i7 = 0;
        int i8 = 0;
        while (true) {
            i2 = 1;
            if (i8 >= childCount) {
                z = false;
                break;
            }
            if (getChildAt(i8).isLayoutRequested()) {
                z = true;
                break;
            }
            i8++;
        }
        if (!z) {
            return z;
        }
        boolean zIsInEditMode = isInEditMode();
        int childCount2 = getChildCount();
        for (int i9 = 0; i9 < childCount2; i9++) {
            c.e.b.h.d dVarE = e(getChildAt(i9));
            if (dVarE != null) {
                dVarE.C();
            }
        }
        int i10 = -1;
        if (zIsInEditMode) {
            for (int i11 = 0; i11 < childCount2; i11++) {
                View childAt = getChildAt(i11);
                try {
                    String resourceName = getResources().getResourceName(childAt.getId());
                    h(0, resourceName, Integer.valueOf(childAt.getId()));
                    int iIndexOf = resourceName.indexOf(47);
                    if (iIndexOf != -1) {
                        resourceName = resourceName.substring(iIndexOf + 1);
                    }
                    int id = childAt.getId();
                    if (id == 0) {
                        dVar = this.f227f;
                    } else {
                        View viewFindViewById = this.f225b.get(id);
                        if (viewFindViewById == null && (viewFindViewById = findViewById(id)) != null && viewFindViewById != this && viewFindViewById.getParent() == this) {
                            onViewAdded(viewFindViewById);
                        }
                        dVar = viewFindViewById == this ? this.f227f : viewFindViewById == null ? null : ((a) viewFindViewById.getLayoutParams()).l0;
                    }
                    dVar.d0 = resourceName;
                } catch (Resources.NotFoundException unused) {
                }
            }
        }
        if (this.o != -1) {
            for (int i12 = 0; i12 < childCount2; i12++) {
                View childAt2 = getChildAt(i12);
                if (childAt2.getId() == this.o && (childAt2 instanceof f)) {
                    this.m = ((f) childAt2).getConstraintSet();
                }
            }
        }
        c.e.c.e eVar = this.m;
        if (eVar != null) {
            int childCount3 = getChildCount();
            HashSet<Integer> hashSet = new HashSet(eVar.f1215e.keySet());
            while (i7 < childCount3) {
                View childAt3 = getChildAt(i7);
                int id2 = childAt3.getId();
                if (!eVar.f1215e.containsKey(Integer.valueOf(id2))) {
                    StringBuilder sbB = d.b.a.a.a.B("id unknown ");
                    try {
                        resourceEntryName = childAt3.getContext().getResources().getResourceEntryName(childAt3.getId());
                    } catch (Exception unused2) {
                        resourceEntryName = "UNKNOWN";
                    }
                    sbB.append(resourceEntryName);
                    Log.w("ConstraintSet", sbB.toString());
                } else {
                    if (eVar.f1214d && id2 == i10) {
                        throw new RuntimeException("All children of ConstraintLayout must have ids to use ConstraintSet");
                    }
                    if (id2 != i10) {
                        if (eVar.f1215e.containsKey(Integer.valueOf(id2))) {
                            hashSet.remove(Integer.valueOf(id2));
                            e.a aVar = eVar.f1215e.get(Integer.valueOf(id2));
                            if (childAt3 instanceof c.e.c.a) {
                                aVar.f1218d.e0 = i2;
                            }
                            int i13 = aVar.f1218d.e0;
                            if (i13 != i10 && i13 == i2) {
                                c.e.c.a aVar2 = (c.e.c.a) childAt3;
                                aVar2.setId(id2);
                                aVar2.setType(aVar.f1218d.c0);
                                aVar2.setMargin(aVar.f1218d.d0);
                                aVar2.setAllowsGoneWidget(aVar.f1218d.k0);
                                e.b bVar = aVar.f1218d;
                                int[] iArr = bVar.f0;
                                if (iArr != null) {
                                    aVar2.setReferencedIds(iArr);
                                } else {
                                    String str2 = bVar.g0;
                                    if (str2 != null) {
                                        bVar.f0 = eVar.b(aVar2, str2);
                                        aVar2.setReferencedIds(aVar.f1218d.f0);
                                    }
                                }
                            }
                            a aVar3 = (a) childAt3.getLayoutParams();
                            aVar3.a();
                            aVar.a(aVar3);
                            HashMap<String, c.e.c.b> map = aVar.f1220f;
                            i4 = childCount3;
                            Class<?> cls = childAt3.getClass();
                            for (String str3 : map.keySet()) {
                                boolean z6 = z;
                                c.e.c.b bVar2 = map.get(str3);
                                HashMap<String, c.e.c.b> map2 = map;
                                String strP = d.b.a.a.a.p("set", str3);
                                boolean z7 = zIsInEditMode;
                                try {
                                    switch (bVar2.f1190b.ordinal()) {
                                        case 0:
                                            i6 = childCount2;
                                            cls.getMethod(strP, Integer.TYPE).invoke(childAt3, Integer.valueOf(bVar2.f1191c));
                                            break;
                                        case 1:
                                            i6 = childCount2;
                                            cls.getMethod(strP, Float.TYPE).invoke(childAt3, Float.valueOf(bVar2.f1192d));
                                            break;
                                        case 2:
                                            i6 = childCount2;
                                            cls.getMethod(strP, Integer.TYPE).invoke(childAt3, Integer.valueOf(bVar2.f1195g));
                                            break;
                                        case 3:
                                            i6 = childCount2;
                                            Method method = cls.getMethod(strP, Drawable.class);
                                            ColorDrawable colorDrawable = new ColorDrawable();
                                            colorDrawable.setColor(bVar2.f1195g);
                                            method.invoke(childAt3, colorDrawable);
                                            break;
                                        case 4:
                                            i6 = childCount2;
                                            cls.getMethod(strP, CharSequence.class).invoke(childAt3, bVar2.f1193e);
                                            break;
                                        case 5:
                                            i6 = childCount2;
                                            cls.getMethod(strP, Boolean.TYPE).invoke(childAt3, Boolean.valueOf(bVar2.f1194f));
                                            break;
                                        case 6:
                                            i6 = childCount2;
                                            try {
                                                cls.getMethod(strP, Float.TYPE).invoke(childAt3, Float.valueOf(bVar2.f1192d));
                                            } catch (IllegalAccessException e2) {
                                                e = e2;
                                                StringBuilder sbE = d.b.a.a.a.E(" Custom Attribute \"", str3, "\" not found on ");
                                                sbE.append(cls.getName());
                                                Log.e("TransitionLayout", sbE.toString());
                                                e.printStackTrace();
                                            } catch (NoSuchMethodException e3) {
                                                e = e3;
                                                Log.e("TransitionLayout", e.getMessage());
                                                Log.e("TransitionLayout", " Custom Attribute \"" + str3 + "\" not found on " + cls.getName());
                                                StringBuilder sb = new StringBuilder();
                                                sb.append(cls.getName());
                                                sb.append(" must have a method ");
                                                sb.append(strP);
                                                Log.e("TransitionLayout", sb.toString());
                                            } catch (InvocationTargetException e4) {
                                                e = e4;
                                                StringBuilder sbE2 = d.b.a.a.a.E(" Custom Attribute \"", str3, "\" not found on ");
                                                sbE2.append(cls.getName());
                                                Log.e("TransitionLayout", sbE2.toString());
                                                e.printStackTrace();
                                            }
                                            break;
                                        default:
                                            i6 = childCount2;
                                            break;
                                    }
                                } catch (IllegalAccessException e5) {
                                    e = e5;
                                    i6 = childCount2;
                                } catch (NoSuchMethodException e6) {
                                    e = e6;
                                    i6 = childCount2;
                                } catch (InvocationTargetException e7) {
                                    e = e7;
                                    i6 = childCount2;
                                }
                                z = z6;
                                map = map2;
                                zIsInEditMode = z7;
                                childCount2 = i6;
                            }
                            z4 = z;
                            z5 = zIsInEditMode;
                            i5 = childCount2;
                            childAt3.setLayoutParams(aVar3);
                            e.d dVar2 = aVar.f1216b;
                            if (dVar2.f1240c == 0) {
                                childAt3.setVisibility(dVar2.f1239b);
                            }
                            childAt3.setAlpha(aVar.f1216b.f1241d);
                            childAt3.setRotation(aVar.f1219e.f1244c);
                            childAt3.setRotationX(aVar.f1219e.f1245d);
                            childAt3.setRotationY(aVar.f1219e.f1246e);
                            childAt3.setScaleX(aVar.f1219e.f1247f);
                            childAt3.setScaleY(aVar.f1219e.f1248g);
                            if (!Float.isNaN(aVar.f1219e.f1249h)) {
                                childAt3.setPivotX(aVar.f1219e.f1249h);
                            }
                            if (!Float.isNaN(aVar.f1219e.f1250i)) {
                                childAt3.setPivotY(aVar.f1219e.f1250i);
                            }
                            childAt3.setTranslationX(aVar.f1219e.f1251j);
                            childAt3.setTranslationY(aVar.f1219e.f1252k);
                            childAt3.setTranslationZ(aVar.f1219e.f1253l);
                            e.C0008e c0008e = aVar.f1219e;
                            if (c0008e.m) {
                                childAt3.setElevation(c0008e.n);
                            }
                        } else {
                            i4 = childCount3;
                            z4 = z;
                            z5 = zIsInEditMode;
                            i5 = childCount2;
                            Log.v("ConstraintSet", "WARNING NO CONSTRAINTS for view " + id2);
                        }
                    }
                    i7++;
                    i2 = 1;
                    i10 = -1;
                    childCount3 = i4;
                    z = z4;
                    zIsInEditMode = z5;
                    childCount2 = i5;
                }
                i4 = childCount3;
                z4 = z;
                z5 = zIsInEditMode;
                i5 = childCount2;
                i7++;
                i2 = 1;
                i10 = -1;
                childCount3 = i4;
                z = z4;
                zIsInEditMode = z5;
                childCount2 = i5;
            }
            z2 = z;
            z3 = zIsInEditMode;
            i3 = childCount2;
            for (Integer num : hashSet) {
                e.a aVar4 = eVar.f1215e.get(num);
                int i14 = aVar4.f1218d.e0;
                if (i14 != -1 && i14 == 1) {
                    c.e.c.a aVar5 = new c.e.c.a(getContext());
                    aVar5.setId(num.intValue());
                    e.b bVar3 = aVar4.f1218d;
                    int[] iArr2 = bVar3.f0;
                    if (iArr2 != null) {
                        aVar5.setReferencedIds(iArr2);
                    } else {
                        String str4 = bVar3.g0;
                        if (str4 != null) {
                            bVar3.f0 = eVar.b(aVar5, str4);
                            aVar5.setReferencedIds(aVar4.f1218d.f0);
                        }
                    }
                    aVar5.setType(aVar4.f1218d.c0);
                    aVar5.setMargin(aVar4.f1218d.d0);
                    a aVarGenerateDefaultLayoutParams = generateDefaultLayoutParams();
                    aVar5.h();
                    aVar4.a(aVarGenerateDefaultLayoutParams);
                    addView(aVar5, aVarGenerateDefaultLayoutParams);
                }
                if (aVar4.f1218d.f1221b) {
                    View hVar = new h(getContext());
                    hVar.setId(num.intValue());
                    a aVarGenerateDefaultLayoutParams2 = generateDefaultLayoutParams();
                    aVar4.a(aVarGenerateDefaultLayoutParams2);
                    addView(hVar, aVarGenerateDefaultLayoutParams2);
                }
            }
        } else {
            z2 = z;
            z3 = zIsInEditMode;
            i3 = childCount2;
        }
        this.f227f.l0.clear();
        int size = this.f226e.size();
        if (size > 0) {
            for (int i15 = 0; i15 < size; i15++) {
                c cVar = this.f226e.get(i15);
                if (cVar.isInEditMode()) {
                    cVar.setIds(cVar.f1200h);
                }
                g gVar = cVar.f1199g;
                if (gVar != null) {
                    c.e.b.h.h hVar2 = (c.e.b.h.h) gVar;
                    hVar2.m0 = 0;
                    Arrays.fill(hVar2.l0, (Object) null);
                    for (int i16 = 0; i16 < cVar.f1197e; i16++) {
                        int i17 = cVar.f1196b[i16];
                        View viewD = d(i17);
                        if (viewD == null && (iE = cVar.e(this, (str = cVar.f1202j.get(Integer.valueOf(i17))))) != 0) {
                            cVar.f1196b[i16] = iE;
                            cVar.f1202j.put(Integer.valueOf(iE), str);
                            viewD = d(iE);
                        }
                        if (viewD != null) {
                            g gVar2 = cVar.f1199g;
                            c.e.b.h.d dVarE2 = e(viewD);
                            c.e.b.h.h hVar3 = (c.e.b.h.h) gVar2;
                            Objects.requireNonNull(hVar3);
                            if (dVarE2 != hVar3 && dVarE2 != null) {
                                int i18 = hVar3.m0 + 1;
                                c.e.b.h.d[] dVarArr = hVar3.l0;
                                if (i18 > dVarArr.length) {
                                    hVar3.l0 = (c.e.b.h.d[]) Arrays.copyOf(dVarArr, dVarArr.length * 2);
                                }
                                c.e.b.h.d[] dVarArr2 = hVar3.l0;
                                int i19 = hVar3.m0;
                                dVarArr2[i19] = dVarE2;
                                hVar3.m0 = i19 + 1;
                            }
                        }
                    }
                    cVar.f1199g.a(this.f227f);
                }
            }
        }
        int i20 = i3;
        for (int i21 = 0; i21 < i20; i21++) {
            View childAt4 = getChildAt(i21);
            if (childAt4 instanceof i) {
                i iVar = (i) childAt4;
                if (iVar.f1255b == -1 && !iVar.isInEditMode()) {
                    iVar.setVisibility(iVar.f1257f);
                }
                View viewFindViewById2 = findViewById(iVar.f1255b);
                iVar.f1256e = viewFindViewById2;
                if (viewFindViewById2 != null) {
                    ((a) viewFindViewById2.getLayoutParams()).a0 = true;
                    iVar.f1256e.setVisibility(0);
                    iVar.setVisibility(0);
                }
            }
        }
        this.s.clear();
        this.s.put(0, this.f227f);
        this.s.put(getId(), this.f227f);
        for (int i22 = 0; i22 < i20; i22++) {
            View childAt5 = getChildAt(i22);
            this.s.put(childAt5.getId(), e(childAt5));
        }
        for (int i23 = 0; i23 < i20; i23++) {
            View childAt6 = getChildAt(i23);
            c.e.b.h.d dVarE3 = e(childAt6);
            if (dVarE3 != null) {
                a aVar6 = (a) childAt6.getLayoutParams();
                c.e.b.h.e eVar2 = this.f227f;
                eVar2.l0.add(dVarE3);
                c.e.b.h.d dVar3 = dVarE3.P;
                if (dVar3 != null) {
                    ((c.e.b.h.k) dVar3).l0.remove(dVarE3);
                    dVarE3.C();
                }
                dVarE3.P = eVar2;
                a(z3, childAt6, dVarE3, aVar6, this.s);
            }
        }
        return z2;
    }

    @Override // android.view.ViewGroup, android.view.View
    public void onLayout(boolean z, int i2, int i3, int i4, int i5) {
        View content;
        int childCount = getChildCount();
        boolean zIsInEditMode = isInEditMode();
        for (int i6 = 0; i6 < childCount; i6++) {
            View childAt = getChildAt(i6);
            a aVar = (a) childAt.getLayoutParams();
            c.e.b.h.d dVar = aVar.l0;
            if ((childAt.getVisibility() != 8 || aVar.Y || aVar.Z || zIsInEditMode) && !aVar.a0) {
                int iS = dVar.s();
                int iT = dVar.t();
                int iR = dVar.r() + iS;
                int iL = dVar.l() + iT;
                childAt.layout(iS, iT, iR, iL);
                if ((childAt instanceof i) && (content = ((i) childAt).getContent()) != null) {
                    content.setVisibility(0);
                    content.layout(iS, iT, iR, iL);
                }
            }
        }
        int size = this.f226e.size();
        if (size > 0) {
            for (int i7 = 0; i7 < size; i7++) {
                Objects.requireNonNull(this.f226e.get(i7));
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:304:0x05b5 A[PHI: r15
      0x05b5: PHI (r15v10 boolean) = (r15v9 boolean), (r15v9 boolean), (r15v9 boolean), (r15v13 boolean) binds: [B:280:0x057e, B:282:0x0584, B:284:0x0588, B:300:0x05aa] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:307:0x05b9  */
    /* JADX WARN: Removed duplicated region for block: B:462:0x05bd A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:68:0x0171 A[PHI: r15
      0x0171: PHI (r15v32 c.e.b.h.d$a) = (r15v31 c.e.b.h.d$a), (r15v1 c.e.b.h.d$a) binds: [B:66:0x0165, B:62:0x0158] A[DONT_GENERATE, DONT_INLINE]] */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void onMeasure(int r27, int r28) {
        /*
            Method dump skipped, instruction units count: 2101
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.widget.ConstraintLayout.onMeasure(int, int):void");
    }

    @Override // android.view.ViewGroup
    public void onViewAdded(View view) {
        super.onViewAdded(view);
        c.e.b.h.d dVarE = e(view);
        if ((view instanceof h) && !(dVarE instanceof c.e.b.h.f)) {
            a aVar = (a) view.getLayoutParams();
            c.e.b.h.f fVar = new c.e.b.h.f();
            aVar.l0 = fVar;
            aVar.Y = true;
            fVar.R(aVar.R);
        }
        if (view instanceof c) {
            c cVar = (c) view;
            cVar.h();
            ((a) view.getLayoutParams()).Z = true;
            if (!this.f226e.contains(cVar)) {
                this.f226e.add(cVar);
            }
        }
        this.f225b.put(view.getId(), view);
        this.f232k = true;
    }

    @Override // android.view.ViewGroup
    public void onViewRemoved(View view) {
        super.onViewRemoved(view);
        this.f225b.remove(view.getId());
        c.e.b.h.d dVarE = e(view);
        this.f227f.l0.remove(dVarE);
        dVarE.C();
        this.f226e.remove(view);
        this.f232k = true;
    }

    @Override // android.view.ViewGroup, android.view.ViewManager
    public void removeView(View view) {
        super.removeView(view);
    }

    @Override // android.view.View, android.view.ViewParent
    public void requestLayout() {
        this.f232k = true;
        this.q = -1;
        this.r = -1;
        super.requestLayout();
    }

    public void setConstraintSet(c.e.c.e eVar) {
        this.m = eVar;
    }

    @Override // android.view.View
    public void setId(int i2) {
        this.f225b.remove(getId());
        super.setId(i2);
        this.f225b.put(getId(), this);
    }

    public void setMaxHeight(int i2) {
        if (i2 == this.f231j) {
            return;
        }
        this.f231j = i2;
        requestLayout();
    }

    public void setMaxWidth(int i2) {
        if (i2 == this.f230i) {
            return;
        }
        this.f230i = i2;
        requestLayout();
    }

    public void setMinHeight(int i2) {
        if (i2 == this.f229h) {
            return;
        }
        this.f229h = i2;
        requestLayout();
    }

    public void setMinWidth(int i2) {
        if (i2 == this.f228g) {
            return;
        }
        this.f228g = i2;
        requestLayout();
    }

    public void setOnConstraintsChanged(c.e.c.g gVar) {
        d dVar = this.n;
        if (dVar != null) {
            Objects.requireNonNull(dVar);
        }
    }

    public void setOptimizationLevel(int i2) {
        this.f233l = i2;
        c.e.b.h.e eVar = this.f227f;
        eVar.x0 = i2;
        c.e.b.d.a = eVar.Z(512);
    }

    @Override // android.view.ViewGroup
    public boolean shouldDelayChildPressedState() {
        return false;
    }

    @Override // android.view.ViewGroup
    public ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return new a(layoutParams);
    }

    public static class a extends ViewGroup.MarginLayoutParams {
        public float A;
        public String B;
        public int C;
        public float D;
        public float E;
        public int F;
        public int G;
        public int H;
        public int I;
        public int J;
        public int K;
        public int L;
        public int M;
        public float N;
        public float O;
        public int P;
        public int Q;
        public int R;
        public boolean S;
        public boolean T;
        public String U;
        public boolean V;
        public boolean W;
        public boolean X;
        public boolean Y;
        public boolean Z;
        public int a;
        public boolean a0;

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

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public float f235c;
        public int c0;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        public int f236d;
        public int d0;

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

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public int f238f;
        public int f0;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        public int f239g;
        public int g0;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        public int f240h;
        public float h0;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        public int f241i;
        public int i0;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        public int f242j;
        public int j0;

        /* JADX INFO: renamed from: k, reason: collision with root package name */
        public int f243k;
        public float k0;

        /* JADX INFO: renamed from: l, reason: collision with root package name */
        public int f244l;
        public c.e.b.h.d l0;
        public int m;
        public int n;
        public float o;
        public int p;
        public int q;
        public int r;
        public int s;
        public int t;
        public int u;
        public int v;
        public int w;
        public int x;
        public int y;
        public float z;

        /* JADX INFO: renamed from: androidx.constraintlayout.widget.ConstraintLayout$a$a, reason: collision with other inner class name */
        public static class C0001a {
            public static final SparseIntArray a;

            static {
                SparseIntArray sparseIntArray = new SparseIntArray();
                a = sparseIntArray;
                sparseIntArray.append(64, 8);
                sparseIntArray.append(65, 9);
                sparseIntArray.append(67, 10);
                sparseIntArray.append(68, 11);
                sparseIntArray.append(74, 12);
                sparseIntArray.append(73, 13);
                sparseIntArray.append(46, 14);
                sparseIntArray.append(45, 15);
                sparseIntArray.append(43, 16);
                sparseIntArray.append(47, 2);
                sparseIntArray.append(49, 3);
                sparseIntArray.append(48, 4);
                sparseIntArray.append(82, 49);
                sparseIntArray.append(83, 50);
                sparseIntArray.append(53, 5);
                sparseIntArray.append(54, 6);
                sparseIntArray.append(55, 7);
                sparseIntArray.append(0, 1);
                sparseIntArray.append(69, 17);
                sparseIntArray.append(70, 18);
                sparseIntArray.append(52, 19);
                sparseIntArray.append(51, 20);
                sparseIntArray.append(86, 21);
                sparseIntArray.append(89, 22);
                sparseIntArray.append(87, 23);
                sparseIntArray.append(84, 24);
                sparseIntArray.append(88, 25);
                sparseIntArray.append(85, 26);
                sparseIntArray.append(60, 29);
                sparseIntArray.append(75, 30);
                sparseIntArray.append(50, 44);
                sparseIntArray.append(62, 45);
                sparseIntArray.append(77, 46);
                sparseIntArray.append(61, 47);
                sparseIntArray.append(76, 48);
                sparseIntArray.append(41, 27);
                sparseIntArray.append(40, 28);
                sparseIntArray.append(78, 31);
                sparseIntArray.append(56, 32);
                sparseIntArray.append(80, 33);
                sparseIntArray.append(79, 34);
                sparseIntArray.append(81, 35);
                sparseIntArray.append(58, 36);
                sparseIntArray.append(57, 37);
                sparseIntArray.append(59, 38);
                sparseIntArray.append(63, 39);
                sparseIntArray.append(72, 40);
                sparseIntArray.append(66, 41);
                sparseIntArray.append(44, 42);
                sparseIntArray.append(42, 43);
                sparseIntArray.append(71, 51);
            }
        }

        public a(Context context, AttributeSet attributeSet) {
            int i2;
            super(context, attributeSet);
            this.a = -1;
            this.f234b = -1;
            this.f235c = -1.0f;
            this.f236d = -1;
            this.f237e = -1;
            this.f238f = -1;
            this.f239g = -1;
            this.f240h = -1;
            this.f241i = -1;
            this.f242j = -1;
            this.f243k = -1;
            this.f244l = -1;
            this.m = -1;
            this.n = 0;
            this.o = 0.0f;
            this.p = -1;
            this.q = -1;
            this.r = -1;
            this.s = -1;
            this.t = -1;
            this.u = -1;
            this.v = -1;
            this.w = -1;
            this.x = -1;
            this.y = -1;
            this.z = 0.5f;
            this.A = 0.5f;
            this.B = null;
            this.C = 1;
            this.D = -1.0f;
            this.E = -1.0f;
            this.F = 0;
            this.G = 0;
            this.H = 0;
            this.I = 0;
            this.J = 0;
            this.K = 0;
            this.L = 0;
            this.M = 0;
            this.N = 1.0f;
            this.O = 1.0f;
            this.P = -1;
            this.Q = -1;
            this.R = -1;
            this.S = false;
            this.T = false;
            this.U = null;
            this.V = true;
            this.W = true;
            this.X = false;
            this.Y = false;
            this.Z = false;
            this.a0 = false;
            this.b0 = -1;
            this.c0 = -1;
            this.d0 = -1;
            this.e0 = -1;
            this.f0 = -1;
            this.g0 = -1;
            this.h0 = 0.5f;
            this.l0 = new c.e.b.h.d();
            TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, k.f1258b);
            int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
            for (int i3 = 0; i3 < indexCount; i3++) {
                int index = typedArrayObtainStyledAttributes.getIndex(i3);
                int i4 = C0001a.a.get(index);
                switch (i4) {
                    case 1:
                        this.R = typedArrayObtainStyledAttributes.getInt(index, this.R);
                        break;
                    case 2:
                        int resourceId = typedArrayObtainStyledAttributes.getResourceId(index, this.m);
                        this.m = resourceId;
                        if (resourceId == -1) {
                            this.m = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 3:
                        this.n = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, this.n);
                        break;
                    case 4:
                        float f2 = typedArrayObtainStyledAttributes.getFloat(index, this.o) % 360.0f;
                        this.o = f2;
                        if (f2 < 0.0f) {
                            this.o = (360.0f - f2) % 360.0f;
                        }
                        break;
                    case 5:
                        this.a = typedArrayObtainStyledAttributes.getDimensionPixelOffset(index, this.a);
                        break;
                    case 6:
                        this.f234b = typedArrayObtainStyledAttributes.getDimensionPixelOffset(index, this.f234b);
                        break;
                    case 7:
                        this.f235c = typedArrayObtainStyledAttributes.getFloat(index, this.f235c);
                        break;
                    case 8:
                        int resourceId2 = typedArrayObtainStyledAttributes.getResourceId(index, this.f236d);
                        this.f236d = resourceId2;
                        if (resourceId2 == -1) {
                            this.f236d = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 9:
                        int resourceId3 = typedArrayObtainStyledAttributes.getResourceId(index, this.f237e);
                        this.f237e = resourceId3;
                        if (resourceId3 == -1) {
                            this.f237e = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 10:
                        int resourceId4 = typedArrayObtainStyledAttributes.getResourceId(index, this.f238f);
                        this.f238f = resourceId4;
                        if (resourceId4 == -1) {
                            this.f238f = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 11:
                        int resourceId5 = typedArrayObtainStyledAttributes.getResourceId(index, this.f239g);
                        this.f239g = resourceId5;
                        if (resourceId5 == -1) {
                            this.f239g = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 12:
                        int resourceId6 = typedArrayObtainStyledAttributes.getResourceId(index, this.f240h);
                        this.f240h = resourceId6;
                        if (resourceId6 == -1) {
                            this.f240h = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 13:
                        int resourceId7 = typedArrayObtainStyledAttributes.getResourceId(index, this.f241i);
                        this.f241i = resourceId7;
                        if (resourceId7 == -1) {
                            this.f241i = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 14:
                        int resourceId8 = typedArrayObtainStyledAttributes.getResourceId(index, this.f242j);
                        this.f242j = resourceId8;
                        if (resourceId8 == -1) {
                            this.f242j = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 15:
                        int resourceId9 = typedArrayObtainStyledAttributes.getResourceId(index, this.f243k);
                        this.f243k = resourceId9;
                        if (resourceId9 == -1) {
                            this.f243k = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 16:
                        int resourceId10 = typedArrayObtainStyledAttributes.getResourceId(index, this.f244l);
                        this.f244l = resourceId10;
                        if (resourceId10 == -1) {
                            this.f244l = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 17:
                        int resourceId11 = typedArrayObtainStyledAttributes.getResourceId(index, this.p);
                        this.p = resourceId11;
                        if (resourceId11 == -1) {
                            this.p = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 18:
                        int resourceId12 = typedArrayObtainStyledAttributes.getResourceId(index, this.q);
                        this.q = resourceId12;
                        if (resourceId12 == -1) {
                            this.q = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 19:
                        int resourceId13 = typedArrayObtainStyledAttributes.getResourceId(index, this.r);
                        this.r = resourceId13;
                        if (resourceId13 == -1) {
                            this.r = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 20:
                        int resourceId14 = typedArrayObtainStyledAttributes.getResourceId(index, this.s);
                        this.s = resourceId14;
                        if (resourceId14 == -1) {
                            this.s = typedArrayObtainStyledAttributes.getInt(index, -1);
                        }
                        break;
                    case 21:
                        this.t = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, this.t);
                        break;
                    case 22:
                        this.u = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, this.u);
                        break;
                    case 23:
                        this.v = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, this.v);
                        break;
                    case 24:
                        this.w = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, this.w);
                        break;
                    case 25:
                        this.x = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, this.x);
                        break;
                    case 26:
                        this.y = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, this.y);
                        break;
                    case 27:
                        this.S = typedArrayObtainStyledAttributes.getBoolean(index, this.S);
                        break;
                    case 28:
                        this.T = typedArrayObtainStyledAttributes.getBoolean(index, this.T);
                        break;
                    case 29:
                        this.z = typedArrayObtainStyledAttributes.getFloat(index, this.z);
                        break;
                    case 30:
                        this.A = typedArrayObtainStyledAttributes.getFloat(index, this.A);
                        break;
                    case 31:
                        int i5 = typedArrayObtainStyledAttributes.getInt(index, 0);
                        this.H = i5;
                        if (i5 == 1) {
                            Log.e("ConstraintLayout", "layout_constraintWidth_default=\"wrap\" is deprecated.\nUse layout_width=\"WRAP_CONTENT\" and layout_constrainedWidth=\"true\" instead.");
                        }
                        break;
                    case 32:
                        int i6 = typedArrayObtainStyledAttributes.getInt(index, 0);
                        this.I = i6;
                        if (i6 == 1) {
                            Log.e("ConstraintLayout", "layout_constraintHeight_default=\"wrap\" is deprecated.\nUse layout_height=\"WRAP_CONTENT\" and layout_constrainedHeight=\"true\" instead.");
                        }
                        break;
                    case 33:
                        try {
                            this.J = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, this.J);
                        } catch (Exception unused) {
                            if (typedArrayObtainStyledAttributes.getInt(index, this.J) == -2) {
                                this.J = -2;
                            }
                        }
                        break;
                    case 34:
                        try {
                            this.L = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, this.L);
                        } catch (Exception unused2) {
                            if (typedArrayObtainStyledAttributes.getInt(index, this.L) == -2) {
                                this.L = -2;
                            }
                        }
                        break;
                    case 35:
                        this.N = Math.max(0.0f, typedArrayObtainStyledAttributes.getFloat(index, this.N));
                        this.H = 2;
                        break;
                    case 36:
                        try {
                            this.K = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, this.K);
                        } catch (Exception unused3) {
                            if (typedArrayObtainStyledAttributes.getInt(index, this.K) == -2) {
                                this.K = -2;
                            }
                        }
                        break;
                    case 37:
                        try {
                            this.M = typedArrayObtainStyledAttributes.getDimensionPixelSize(index, this.M);
                        } catch (Exception unused4) {
                            if (typedArrayObtainStyledAttributes.getInt(index, this.M) == -2) {
                                this.M = -2;
                            }
                        }
                        break;
                    case 38:
                        this.O = Math.max(0.0f, typedArrayObtainStyledAttributes.getFloat(index, this.O));
                        this.I = 2;
                        break;
                    default:
                        switch (i4) {
                            case 44:
                                String string = typedArrayObtainStyledAttributes.getString(index);
                                this.B = string;
                                this.C = -1;
                                if (string != null) {
                                    int length = string.length();
                                    int iIndexOf = this.B.indexOf(44);
                                    if (iIndexOf <= 0 || iIndexOf >= length - 1) {
                                        i2 = 0;
                                    } else {
                                        String strSubstring = this.B.substring(0, iIndexOf);
                                        if (strSubstring.equalsIgnoreCase("W")) {
                                            this.C = 0;
                                        } else if (strSubstring.equalsIgnoreCase("H")) {
                                            this.C = 1;
                                        }
                                        i2 = iIndexOf + 1;
                                    }
                                    int iIndexOf2 = this.B.indexOf(58);
                                    if (iIndexOf2 < 0 || iIndexOf2 >= length - 1) {
                                        String strSubstring2 = this.B.substring(i2);
                                        if (strSubstring2.length() > 0) {
                                            Float.parseFloat(strSubstring2);
                                        }
                                    } else {
                                        String strSubstring3 = this.B.substring(i2, iIndexOf2);
                                        String strSubstring4 = this.B.substring(iIndexOf2 + 1);
                                        if (strSubstring3.length() > 0 && strSubstring4.length() > 0) {
                                            try {
                                                float f3 = Float.parseFloat(strSubstring3);
                                                float f4 = Float.parseFloat(strSubstring4);
                                                if (f3 > 0.0f && f4 > 0.0f) {
                                                    if (this.C == 1) {
                                                        Math.abs(f4 / f3);
                                                    } else {
                                                        Math.abs(f3 / f4);
                                                    }
                                                }
                                            } catch (NumberFormatException unused5) {
                                            }
                                        }
                                    }
                                }
                                break;
                            case 45:
                                this.D = typedArrayObtainStyledAttributes.getFloat(index, this.D);
                                break;
                            case 46:
                                this.E = typedArrayObtainStyledAttributes.getFloat(index, this.E);
                                break;
                            case 47:
                                this.F = typedArrayObtainStyledAttributes.getInt(index, 0);
                                break;
                            case 48:
                                this.G = typedArrayObtainStyledAttributes.getInt(index, 0);
                                break;
                            case 49:
                                this.P = typedArrayObtainStyledAttributes.getDimensionPixelOffset(index, this.P);
                                break;
                            case 50:
                                this.Q = typedArrayObtainStyledAttributes.getDimensionPixelOffset(index, this.Q);
                                break;
                            case 51:
                                this.U = typedArrayObtainStyledAttributes.getString(index);
                                break;
                        }
                        break;
                }
            }
            typedArrayObtainStyledAttributes.recycle();
            a();
        }

        public void a() {
            this.Y = false;
            this.V = true;
            this.W = true;
            int i2 = ((ViewGroup.MarginLayoutParams) this).width;
            if (i2 == -2 && this.S) {
                this.V = false;
                if (this.H == 0) {
                    this.H = 1;
                }
            }
            int i3 = ((ViewGroup.MarginLayoutParams) this).height;
            if (i3 == -2 && this.T) {
                this.W = false;
                if (this.I == 0) {
                    this.I = 1;
                }
            }
            if (i2 == 0 || i2 == -1) {
                this.V = false;
                if (i2 == 0 && this.H == 1) {
                    ((ViewGroup.MarginLayoutParams) this).width = -2;
                    this.S = true;
                }
            }
            if (i3 == 0 || i3 == -1) {
                this.W = false;
                if (i3 == 0 && this.I == 1) {
                    ((ViewGroup.MarginLayoutParams) this).height = -2;
                    this.T = true;
                }
            }
            if (this.f235c == -1.0f && this.a == -1 && this.f234b == -1) {
                return;
            }
            this.Y = true;
            this.V = true;
            this.W = true;
            if (!(this.l0 instanceof c.e.b.h.f)) {
                this.l0 = new c.e.b.h.f();
            }
            ((c.e.b.h.f) this.l0).R(this.R);
        }

        /* JADX WARN: Removed duplicated region for block: B:17:0x004c  */
        /* JADX WARN: Removed duplicated region for block: B:20:0x0053  */
        /* JADX WARN: Removed duplicated region for block: B:23:0x005a  */
        /* JADX WARN: Removed duplicated region for block: B:26:0x0060  */
        /* JADX WARN: Removed duplicated region for block: B:29:0x0066  */
        /* JADX WARN: Removed duplicated region for block: B:36:0x0078  */
        /* JADX WARN: Removed duplicated region for block: B:37:0x0080  */
        @Override // android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.LayoutParams
        @android.annotation.TargetApi(17)
        /*
            Code decompiled incorrectly, please refer to instructions dump.
            To view partially-correct add '--show-bad-code' argument
        */
        public void resolveLayoutDirection(int r10) {
            /*
                Method dump skipped, instruction units count: 257
                To view this dump add '--comments-level debug' option
            */
            throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.widget.ConstraintLayout.a.resolveLayoutDirection(int):void");
        }

        public a(int i2, int i3) {
            super(i2, i3);
            this.a = -1;
            this.f234b = -1;
            this.f235c = -1.0f;
            this.f236d = -1;
            this.f237e = -1;
            this.f238f = -1;
            this.f239g = -1;
            this.f240h = -1;
            this.f241i = -1;
            this.f242j = -1;
            this.f243k = -1;
            this.f244l = -1;
            this.m = -1;
            this.n = 0;
            this.o = 0.0f;
            this.p = -1;
            this.q = -1;
            this.r = -1;
            this.s = -1;
            this.t = -1;
            this.u = -1;
            this.v = -1;
            this.w = -1;
            this.x = -1;
            this.y = -1;
            this.z = 0.5f;
            this.A = 0.5f;
            this.B = null;
            this.C = 1;
            this.D = -1.0f;
            this.E = -1.0f;
            this.F = 0;
            this.G = 0;
            this.H = 0;
            this.I = 0;
            this.J = 0;
            this.K = 0;
            this.L = 0;
            this.M = 0;
            this.N = 1.0f;
            this.O = 1.0f;
            this.P = -1;
            this.Q = -1;
            this.R = -1;
            this.S = false;
            this.T = false;
            this.U = null;
            this.V = true;
            this.W = true;
            this.X = false;
            this.Y = false;
            this.Z = false;
            this.a0 = false;
            this.b0 = -1;
            this.c0 = -1;
            this.d0 = -1;
            this.e0 = -1;
            this.f0 = -1;
            this.g0 = -1;
            this.h0 = 0.5f;
            this.l0 = new c.e.b.h.d();
        }

        public a(ViewGroup.LayoutParams layoutParams) {
            super(layoutParams);
            this.a = -1;
            this.f234b = -1;
            this.f235c = -1.0f;
            this.f236d = -1;
            this.f237e = -1;
            this.f238f = -1;
            this.f239g = -1;
            this.f240h = -1;
            this.f241i = -1;
            this.f242j = -1;
            this.f243k = -1;
            this.f244l = -1;
            this.m = -1;
            this.n = 0;
            this.o = 0.0f;
            this.p = -1;
            this.q = -1;
            this.r = -1;
            this.s = -1;
            this.t = -1;
            this.u = -1;
            this.v = -1;
            this.w = -1;
            this.x = -1;
            this.y = -1;
            this.z = 0.5f;
            this.A = 0.5f;
            this.B = null;
            this.C = 1;
            this.D = -1.0f;
            this.E = -1.0f;
            this.F = 0;
            this.G = 0;
            this.H = 0;
            this.I = 0;
            this.J = 0;
            this.K = 0;
            this.L = 0;
            this.M = 0;
            this.N = 1.0f;
            this.O = 1.0f;
            this.P = -1;
            this.Q = -1;
            this.R = -1;
            this.S = false;
            this.T = false;
            this.U = null;
            this.V = true;
            this.W = true;
            this.X = false;
            this.Y = false;
            this.Z = false;
            this.a0 = false;
            this.b0 = -1;
            this.c0 = -1;
            this.d0 = -1;
            this.e0 = -1;
            this.f0 = -1;
            this.g0 = -1;
            this.h0 = 0.5f;
            this.l0 = new c.e.b.h.d();
        }
    }
}
