package b.e.c;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.Log;
import android.util.SparseArray;
import android.util.Xml;
import androidx.constraintlayout.widget.ConstraintLayout;
import java.util.ArrayList;
import org.xmlpull.v1.XmlPullParser;

/* JADX INFO: loaded from: classes.dex */
public class d {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final ConstraintLayout f828a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f829b = -1;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f830c = -1;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public SparseArray<a> f831d = new SparseArray<>();

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public SparseArray<e> f832e = new SparseArray<>();

    public static class a {

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

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public ArrayList<b> f834b = new ArrayList<>();

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

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

        public a(Context context, XmlPullParser xmlPullParser) {
            this.f835c = -1;
            TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(Xml.asAttributeSet(xmlPullParser), k.j);
            int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
            for (int i = 0; i < indexCount; i++) {
                int index = typedArrayObtainStyledAttributes.getIndex(i);
                if (index == 0) {
                    this.f833a = typedArrayObtainStyledAttributes.getResourceId(index, this.f833a);
                } else if (index == 1) {
                    this.f835c = typedArrayObtainStyledAttributes.getResourceId(index, this.f835c);
                    String resourceTypeName = context.getResources().getResourceTypeName(this.f835c);
                    context.getResources().getResourceName(this.f835c);
                    if ("layout".equals(resourceTypeName)) {
                        e eVar = new e();
                        this.f836d = eVar;
                        eVar.c(context, this.f835c);
                    }
                }
            }
            typedArrayObtainStyledAttributes.recycle();
        }

        public int a(float f2, float f3) {
            for (int i = 0; i < this.f834b.size(); i++) {
                if (this.f834b.get(i).a(f2, f3)) {
                    return i;
                }
            }
            return -1;
        }
    }

    public static class b {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public float f837a;

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

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

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

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

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

        public b(Context context, XmlPullParser xmlPullParser) {
            this.f837a = Float.NaN;
            this.f838b = Float.NaN;
            this.f839c = Float.NaN;
            this.f840d = Float.NaN;
            this.f841e = -1;
            TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(Xml.asAttributeSet(xmlPullParser), k.l);
            int indexCount = typedArrayObtainStyledAttributes.getIndexCount();
            for (int i = 0; i < indexCount; i++) {
                int index = typedArrayObtainStyledAttributes.getIndex(i);
                if (index == 0) {
                    this.f841e = typedArrayObtainStyledAttributes.getResourceId(index, this.f841e);
                    String resourceTypeName = context.getResources().getResourceTypeName(this.f841e);
                    context.getResources().getResourceName(this.f841e);
                    if ("layout".equals(resourceTypeName)) {
                        e eVar = new e();
                        this.f842f = eVar;
                        eVar.c(context, this.f841e);
                    }
                } else if (index == 1) {
                    this.f840d = typedArrayObtainStyledAttributes.getDimension(index, this.f840d);
                } else if (index == 2) {
                    this.f838b = typedArrayObtainStyledAttributes.getDimension(index, this.f838b);
                } else if (index == 3) {
                    this.f839c = typedArrayObtainStyledAttributes.getDimension(index, this.f839c);
                } else if (index == 4) {
                    this.f837a = typedArrayObtainStyledAttributes.getDimension(index, this.f837a);
                } else {
                    Log.v("ConstraintLayoutStates", "Unknown tag");
                }
            }
            typedArrayObtainStyledAttributes.recycle();
        }

        public boolean a(float f2, float f3) {
            if (!Float.isNaN(this.f837a) && f2 < this.f837a) {
                return false;
            }
            if (!Float.isNaN(this.f838b) && f3 < this.f838b) {
                return false;
            }
            if (Float.isNaN(this.f839c) || f2 <= this.f839c) {
                return Float.isNaN(this.f840d) || f3 <= this.f840d;
            }
            return false;
        }
    }

    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    /* JADX WARN: Removed duplicated region for block: B:28:0x006e  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public d(android.content.Context r8, androidx.constraintlayout.widget.ConstraintLayout r9, int r10) {
        /*
            r7 = this;
            r7.<init>()
            r0 = -1
            r7.f829b = r0
            r7.f830c = r0
            android.util.SparseArray r1 = new android.util.SparseArray
            r1.<init>()
            r7.f831d = r1
            android.util.SparseArray r1 = new android.util.SparseArray
            r1.<init>()
            r7.f832e = r1
            r7.f828a = r9
            android.content.res.Resources r9 = r8.getResources()
            android.content.res.XmlResourceParser r9 = r9.getXml(r10)
            int r10 = r9.getEventType()     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            r1 = 0
        L25:
            r2 = 1
            if (r10 == r2) goto La6
            if (r10 == 0) goto L95
            r3 = 2
            if (r10 == r3) goto L2f
            goto L98
        L2f:
            java.lang.String r10 = r9.getName()     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            int r4 = r10.hashCode()     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            r5 = 4
            r6 = 3
            switch(r4) {
                case -1349929691: goto L64;
                case 80204913: goto L5a;
                case 1382829617: goto L51;
                case 1657696882: goto L47;
                case 1901439077: goto L3d;
                default: goto L3c;
            }     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
        L3c:
            goto L6e
        L3d:
            java.lang.String r2 = "Variant"
            boolean r10 = r10.equals(r2)     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            if (r10 == 0) goto L6e
            r2 = r6
            goto L6f
        L47:
            java.lang.String r2 = "layoutDescription"
            boolean r10 = r10.equals(r2)     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            if (r10 == 0) goto L6e
            r2 = 0
            goto L6f
        L51:
            java.lang.String r4 = "StateSet"
            boolean r10 = r10.equals(r4)     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            if (r10 == 0) goto L6e
            goto L6f
        L5a:
            java.lang.String r2 = "State"
            boolean r10 = r10.equals(r2)     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            if (r10 == 0) goto L6e
            r2 = r3
            goto L6f
        L64:
            java.lang.String r2 = "ConstraintSet"
            boolean r10 = r10.equals(r2)     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            if (r10 == 0) goto L6e
            r2 = r5
            goto L6f
        L6e:
            r2 = r0
        L6f:
            if (r2 == r3) goto L87
            if (r2 == r6) goto L7a
            if (r2 == r5) goto L76
            goto L98
        L76:
            r7.a(r8, r9)     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            goto L98
        L7a:
            b.e.c.d$b r10 = new b.e.c.d$b     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            r10.<init>(r8, r9)     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            if (r1 == 0) goto L98
            java.util.ArrayList<b.e.c.d$b> r2 = r1.f834b     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            r2.add(r10)     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            goto L98
        L87:
            b.e.c.d$a r10 = new b.e.c.d$a     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            r10.<init>(r8, r9)     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            android.util.SparseArray<b.e.c.d$a> r1 = r7.f831d     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            int r2 = r10.f833a     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            r1.put(r2, r10)     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            r1 = r10
            goto L98
        L95:
            r9.getName()     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
        L98:
            int r10 = r9.next()     // Catch: java.io.IOException -> L9d org.xmlpull.v1.XmlPullParserException -> La2
            goto L25
        L9d:
            r7 = move-exception
            r7.printStackTrace()
            goto La6
        La2:
            r7 = move-exception
            r7.printStackTrace()
        La6:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: b.e.c.d.<init>(android.content.Context, androidx.constraintlayout.widget.ConstraintLayout, int):void");
    }

    /* JADX WARN: Code restructure failed: missing block: B:143:0x0229, code lost:
    
        continue;
     */
    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    /* JADX WARN: Removed duplicated region for block: B:41:0x00aa  */
    /* JADX WARN: Removed duplicated region for block: B:81:0x0136  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void a(android.content.Context r12, org.xmlpull.v1.XmlPullParser r13) {
        /*
            Method dump skipped, instruction units count: 664
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: b.e.c.d.a(android.content.Context, org.xmlpull.v1.XmlPullParser):void");
    }
}
