package a0;

import android.graphics.Rect;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Interpolator;
import androidx.constraintlayout.utils.widget.MotionLabel;
import com.google.android.gms.measurement.internal.u1;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import xyz.stream.utils.f0;

/* JADX INFO: loaded from: classes.dex */
public final class q {
    public n[] A;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final View f167b;

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

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public v.d[] f175j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public v.b f176k;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public int[] f180o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public double[] f181p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public double[] f182q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public String[] f183r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public int[] f184s;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public HashMap f189x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public HashMap f190y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public HashMap f191z;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Rect f166a = new Rect();

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

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final y f171f = new y();

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final y f172g = new y();

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final o f173h = new o();

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final o f174i = new o();

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public float f177l = Float.NaN;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public float f178m = 0.0f;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public float f179n = 1.0f;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final float[] f185t = new float[4];

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public final ArrayList f186u = new ArrayList();

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public final float[] f187v = new float[1];

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public final ArrayList f188w = new ArrayList();
    public int B = -1;
    public int C = -1;
    public View D = null;
    public int E = -1;
    public float F = Float.NaN;
    public Interpolator G = null;
    public boolean H = false;

    public q(View view) {
        this.f167b = view;
        this.f168c = view.getId();
        ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
        if (layoutParams instanceof androidx.constraintlayout.widget.c) {
            ((androidx.constraintlayout.widget.c) layoutParams).getClass();
        }
    }

    public static void h(Rect rect, Rect rect2, int i10, int i11, int i12) {
        if (i10 == 1) {
            int i13 = rect.left + rect.right;
            rect2.left = ((rect.top + rect.bottom) - rect.width()) / 2;
            rect2.top = i12 - ((rect.height() + i13) / 2);
            rect2.right = rect.width() + rect2.left;
            rect2.bottom = rect.height() + rect2.top;
            return;
        }
        if (i10 == 2) {
            int i14 = rect.left + rect.right;
            rect2.left = i11 - ((rect.width() + (rect.top + rect.bottom)) / 2);
            rect2.top = (i14 - rect.height()) / 2;
            rect2.right = rect.width() + rect2.left;
            rect2.bottom = rect.height() + rect2.top;
            return;
        }
        if (i10 == 3) {
            int i15 = rect.left + rect.right;
            rect2.left = ((rect.height() / 2) + rect.top) - (i15 / 2);
            rect2.top = i12 - ((rect.height() + i15) / 2);
            rect2.right = rect.width() + rect2.left;
            rect2.bottom = rect.height() + rect2.top;
            return;
        }
        if (i10 != 4) {
            return;
        }
        int i16 = rect.left + rect.right;
        rect2.left = i11 - ((rect.width() + (rect.bottom + rect.top)) / 2);
        rect2.top = (i16 - rect.height()) / 2;
        rect2.right = rect.width() + rect2.left;
        rect2.bottom = rect.height() + rect2.top;
    }

    public final void a(c cVar) {
        this.f188w.add(cVar);
    }

    public final float b(float[] fArr, float f10) {
        float f11 = 0.0f;
        if (fArr != null) {
            fArr[0] = 1.0f;
        } else {
            float f12 = this.f179n;
            if (f12 != 1.0d) {
                float f13 = this.f178m;
                if (f10 < f13) {
                    f10 = 0.0f;
                }
                if (f10 > f13 && f10 < 1.0d) {
                    f10 = Math.min((f10 - f13) * f12, 1.0f);
                }
            }
        }
        v.f fVar = this.f171f.f221a;
        float f14 = Float.NaN;
        for (y yVar : this.f186u) {
            v.f fVar2 = yVar.f221a;
            if (fVar2 != null) {
                float f15 = yVar.f223c;
                if (f15 < f10) {
                    fVar = fVar2;
                    f11 = f15;
                } else if (Float.isNaN(f14)) {
                    f14 = yVar.f223c;
                }
            }
        }
        if (fVar != null) {
            float f16 = (Float.isNaN(f14) ? 1.0f : f14) - f11;
            double d10 = (f10 - f11) / f16;
            f10 = (((float) fVar.a(d10)) * f16) + f11;
            if (fArr != null) {
                fArr[0] = (float) fVar.b(d10);
            }
        }
        return f10;
    }

    public final void c(double d10, float[] fArr, float[] fArr2) {
        double[] dArr = new double[4];
        double[] dArr2 = new double[4];
        this.f175j[0].f(d10, dArr);
        this.f175j[0].i(d10, dArr2);
        float f10 = 0.0f;
        Arrays.fill(fArr2, 0.0f);
        int[] iArr = this.f180o;
        y yVar = this.f171f;
        float f11 = yVar.f225e;
        float f12 = yVar.f226f;
        float f13 = yVar.f227g;
        float f14 = yVar.f228h;
        float f15 = 0.0f;
        float f16 = 0.0f;
        float f17 = 0.0f;
        for (int i10 = 0; i10 < iArr.length; i10++) {
            float f18 = (float) dArr[i10];
            float f19 = (float) dArr2[i10];
            int i11 = iArr[i10];
            if (i11 == 1) {
                f11 = f18;
                f10 = f19;
            } else if (i11 == 2) {
                f12 = f18;
                f17 = f19;
            } else if (i11 == 3) {
                f13 = f18;
                f15 = f19;
            } else if (i11 == 4) {
                f14 = f18;
                f16 = f19;
            }
        }
        float f20 = 2.0f;
        float f21 = (f15 / 2.0f) + f10;
        float fSin = (f16 / 2.0f) + f17;
        q qVar = yVar.f233m;
        if (qVar != null) {
            float[] fArr3 = new float[2];
            float[] fArr4 = new float[2];
            qVar.c(d10, fArr3, fArr4);
            float f22 = fArr3[0];
            float f23 = fArr3[1];
            float f24 = fArr4[0];
            float f25 = fArr4[1];
            double d11 = f11;
            double d12 = f12;
            float fSin2 = (float) (((Math.sin(d12) * d11) + ((double) f22)) - ((double) (f13 / 2.0f)));
            float fCos = (float) ((((double) f23) - (Math.cos(d12) * d11)) - ((double) (f14 / 2.0f)));
            double d13 = f24;
            double d14 = f10;
            double d15 = f17;
            float fCos2 = (float) ((Math.cos(d12) * d15) + (Math.sin(d12) * d14) + d13);
            fSin = (float) ((Math.sin(d12) * d15) + (((double) f25) - (Math.cos(d12) * d14)));
            f11 = fSin2;
            f12 = fCos;
            f21 = fCos2;
            f20 = 2.0f;
        }
        fArr[0] = (f13 / f20) + f11 + 0.0f;
        fArr[1] = (f14 / f20) + f12 + 0.0f;
        fArr2[0] = f21;
        fArr2[1] = fSin;
    }

    public final void d(float f10, float f11, float f12, float[] fArr) {
        double[] dArr;
        float[] fArr2 = this.f187v;
        float fB = b(fArr2, f10);
        v.d[] dVarArr = this.f175j;
        int i10 = 0;
        if (dVarArr == null) {
            y yVar = this.f172g;
            float f13 = yVar.f225e;
            y yVar2 = this.f171f;
            float f14 = f13 - yVar2.f225e;
            float f15 = yVar.f226f - yVar2.f226f;
            float f16 = yVar.f227g - yVar2.f227g;
            float f17 = (yVar.f228h - yVar2.f228h) + f15;
            fArr[0] = ((f16 + f14) * f11) + ((1.0f - f11) * f14);
            fArr[1] = (f17 * f12) + ((1.0f - f12) * f15);
            return;
        }
        double d10 = fB;
        dVarArr[0].i(d10, this.f182q);
        this.f175j[0].f(d10, this.f181p);
        float f18 = fArr2[0];
        while (true) {
            dArr = this.f182q;
            if (i10 >= dArr.length) {
                break;
            }
            dArr[i10] = dArr[i10] * ((double) f18);
            i10++;
        }
        v.b bVar = this.f176k;
        if (bVar == null) {
            y yVar3 = this.f171f;
            int[] iArr = this.f180o;
            double[] dArr2 = this.f181p;
            yVar3.getClass();
            y.h(f11, f12, fArr, iArr, dArr, dArr2);
            return;
        }
        double[] dArr3 = this.f181p;
        if (dArr3.length > 0) {
            bVar.f(d10, dArr3);
            this.f176k.i(d10, this.f182q);
            y yVar4 = this.f171f;
            int[] iArr2 = this.f180o;
            double[] dArr4 = this.f182q;
            double[] dArr5 = this.f181p;
            yVar4.getClass();
            y.h(f11, f12, fArr, iArr2, dArr4, dArr5);
        }
    }

    public final float e() {
        char c6;
        float[] fArr = new float[2];
        float f10 = 1.0f / 99;
        double d10 = 0.0d;
        double d11 = 0.0d;
        int i10 = 0;
        float fHypot = 0.0f;
        while (i10 < 100) {
            float f11 = i10 * f10;
            double dA = f11;
            v.f fVar = this.f171f.f221a;
            float f12 = Float.NaN;
            float f13 = 0.0f;
            for (y yVar : this.f186u) {
                v.f fVar2 = yVar.f221a;
                if (fVar2 != null) {
                    float f14 = yVar.f223c;
                    if (f14 < f11) {
                        fVar = fVar2;
                        f13 = f14;
                    } else if (Float.isNaN(f12)) {
                        f12 = yVar.f223c;
                    }
                }
            }
            if (fVar != null) {
                if (Float.isNaN(f12)) {
                    f12 = 1.0f;
                }
                dA = (((float) fVar.a((f11 - f13) / r7)) * (f12 - f13)) + f13;
            }
            this.f175j[0].f(dA, this.f181p);
            int i11 = i10;
            this.f171f.e(dA, this.f180o, this.f181p, fArr, 0);
            if (i11 > 0) {
                c6 = 0;
                fHypot += (float) Math.hypot(d11 - ((double) fArr[1]), d10 - ((double) fArr[0]));
            } else {
                c6 = 0;
            }
            d10 = fArr[c6];
            i10 = i11 + 1;
            d11 = fArr[1];
        }
        return fHypot;
    }

    /* JADX WARN: Removed duplicated region for block: B:126:0x0332  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean f(float f10, long j10, View view, f0 f0Var) {
        z.n nVar;
        boolean zF;
        float f11;
        int i10;
        boolean z10;
        double d10;
        float f12;
        y yVar;
        z.n nVar2;
        boolean z11;
        double d11;
        float f13;
        float f14;
        boolean z12;
        float f15;
        double d12;
        float f16;
        q qVar = this;
        View view2 = view;
        float fB = qVar.b(null, f10);
        int i11 = qVar.E;
        if (i11 != -1) {
            float f17 = 1.0f / i11;
            float fFloor = ((float) Math.floor(fB / f17)) * f17;
            float f18 = (fB % f17) / f17;
            if (!Float.isNaN(qVar.F)) {
                f18 = (f18 + qVar.F) % 1.0f;
            }
            Interpolator interpolator = qVar.G;
            fB = ((interpolator != null ? interpolator.getInterpolation(f18) : ((double) f18) > 0.5d ? 1.0f : 0.0f) * f17) + fFloor;
        }
        float f19 = fB;
        HashMap map = qVar.f190y;
        if (map != null) {
            Iterator it = map.values().iterator();
            while (it.hasNext()) {
                ((z.k) it.next()).c(f19, view2);
            }
        }
        HashMap map2 = qVar.f189x;
        if (map2 != null) {
            nVar = null;
            zF = false;
            for (z.p pVar : map2.values()) {
                if (pVar instanceof z.n) {
                    nVar = (z.n) pVar;
                } else {
                    zF |= pVar.f(f19, j10, view, f0Var);
                }
            }
        } else {
            nVar = null;
            zF = false;
        }
        v.d[] dVarArr = qVar.f175j;
        y yVar2 = qVar.f171f;
        if (dVarArr != null) {
            double d13 = f19;
            dVarArr[0].f(d13, qVar.f181p);
            qVar.f175j[0].i(d13, qVar.f182q);
            v.b bVar = qVar.f176k;
            if (bVar != null) {
                double[] dArr = qVar.f181p;
                if (dArr.length > 0) {
                    bVar.f(d13, dArr);
                    qVar.f176k.i(d13, qVar.f182q);
                }
            }
            if (qVar.H) {
                d10 = d13;
                f12 = f19;
                yVar = yVar2;
                nVar2 = nVar;
                z11 = zF;
            } else {
                int[] iArr = qVar.f180o;
                double[] dArr2 = qVar.f181p;
                double[] dArr3 = qVar.f182q;
                boolean z13 = qVar.f169d;
                float f20 = yVar2.f225e;
                float f21 = yVar2.f226f;
                float f22 = yVar2.f227g;
                float f23 = yVar2.f228h;
                if (iArr.length != 0) {
                    f14 = f20;
                    if (yVar2.S.length <= iArr[iArr.length - 1]) {
                        int i12 = iArr[iArr.length - 1] + 1;
                        yVar2.S = new double[i12];
                        yVar2.T = new double[i12];
                    }
                } else {
                    f14 = f20;
                }
                Arrays.fill(yVar2.S, Double.NaN);
                for (int i13 = 0; i13 < iArr.length; i13++) {
                    double[] dArr4 = yVar2.S;
                    int i14 = iArr[i13];
                    dArr4[i14] = dArr2[i13];
                    yVar2.T[i14] = dArr3[i13];
                }
                float f24 = Float.NaN;
                f12 = f19;
                nVar2 = nVar;
                float f25 = f23;
                float f26 = f14;
                float fCos = f21;
                float f27 = 0.0f;
                int i15 = 0;
                float f28 = 0.0f;
                float f29 = 0.0f;
                z11 = zF;
                float f30 = 0.0f;
                while (true) {
                    double[] dArr5 = yVar2.S;
                    z12 = z13;
                    if (i15 >= dArr5.length) {
                        break;
                    }
                    if (Double.isNaN(dArr5[i15])) {
                        d12 = d13;
                        f16 = f24;
                    } else {
                        d12 = d13;
                        float f31 = (float) (Double.isNaN(yVar2.S[i15]) ? 0.0d : yVar2.S[i15] + 0.0d);
                        f16 = f24;
                        float f32 = (float) yVar2.T[i15];
                        if (i15 == 1) {
                            f27 = f32;
                            f26 = f31;
                        } else if (i15 == 2) {
                            f30 = f32;
                            fCos = f31;
                        } else if (i15 == 3) {
                            f28 = f32;
                            f22 = f31;
                        } else if (i15 != 4) {
                            if (i15 == 5) {
                                f24 = f31;
                            }
                            i15++;
                            z13 = z12;
                            d13 = d12;
                        } else {
                            f29 = f32;
                            f25 = f31;
                        }
                    }
                    f24 = f16;
                    i15++;
                    z13 = z12;
                    d13 = d12;
                }
                d10 = d13;
                float f33 = f24;
                q qVar2 = yVar2.f233m;
                if (qVar2 != null) {
                    float[] fArr = new float[2];
                    float[] fArr2 = new float[2];
                    qVar2.c(d10, fArr, fArr2);
                    float f34 = fArr[0];
                    float f35 = fArr[1];
                    yVar = yVar2;
                    float f36 = fArr2[0];
                    float f37 = fArr2[1];
                    double d14 = f26;
                    double d15 = fCos;
                    float fSin = (float) (((Math.sin(d15) * d14) + ((double) f34)) - ((double) (f22 / 2.0f)));
                    fCos = (float) ((((double) f35) - (Math.cos(d15) * d14)) - ((double) (f25 / 2.0f)));
                    double d16 = f27;
                    double d17 = f30;
                    float fCos2 = (float) ((Math.cos(d15) * d14 * d17) + (Math.sin(d15) * d16) + ((double) f36));
                    f15 = f22;
                    float fSin2 = (float) ((Math.sin(d15) * d14 * d17) + (((double) f37) - (Math.cos(d15) * d16)));
                    if (dArr3.length >= 2) {
                        dArr3[0] = fCos2;
                        dArr3[1] = fSin2;
                    }
                    if (Float.isNaN(f33)) {
                        view2 = view;
                    } else {
                        view2 = view;
                        view2.setRotation((float) (Math.toDegrees(Math.atan2(fSin2, fCos2)) + ((double) f33)));
                    }
                    f26 = fSin;
                } else {
                    float f38 = f27;
                    f15 = f22;
                    yVar = yVar2;
                    if (!Float.isNaN(f33)) {
                        view2.setRotation(((float) Math.toDegrees(Math.atan2((f29 / 2.0f) + f30, (f28 / 2.0f) + f38))) + f33 + 0.0f);
                    }
                }
                if (view2 instanceof b) {
                    ((MotionLabel) ((b) view2)).c(f26, fCos, f26 + f15, f25 + fCos);
                } else {
                    float f39 = f26 + 0.5f;
                    int i16 = (int) f39;
                    float f40 = fCos + 0.5f;
                    int i17 = (int) f40;
                    int i18 = (int) (f39 + f15);
                    int i19 = (int) (f40 + f25);
                    int i20 = i18 - i16;
                    int i21 = i19 - i17;
                    if (i20 != view.getMeasuredWidth() || i21 != view.getMeasuredHeight() || z12) {
                        view2.measure(View.MeasureSpec.makeMeasureSpec(i20, 1073741824), View.MeasureSpec.makeMeasureSpec(i21, 1073741824));
                    }
                    view2.layout(i16, i17, i18, i19);
                }
                qVar = this;
                qVar.f169d = false;
            }
            if (qVar.C != -1) {
                if (qVar.D == null) {
                    qVar.D = ((View) view.getParent()).findViewById(qVar.C);
                }
                if (qVar.D != null) {
                    float bottom = (qVar.D.getBottom() + r1.getTop()) / 2.0f;
                    float right = (qVar.D.getRight() + qVar.D.getLeft()) / 2.0f;
                    if (view.getRight() - view.getLeft() > 0 && view.getBottom() - view.getTop() > 0) {
                        view2.setPivotX(right - view.getLeft());
                        view2.setPivotY(bottom - view.getTop());
                    }
                }
            }
            HashMap map3 = qVar.f190y;
            if (map3 != null) {
                for (z.k kVar : map3.values()) {
                    if (kVar instanceof z.i) {
                        double[] dArr6 = qVar.f182q;
                        if (dArr6.length > 1) {
                            f13 = f12;
                            view2.setRotation(((z.i) kVar).a(f13) + ((float) Math.toDegrees(Math.atan2(dArr6[1], dArr6[0]))));
                        } else {
                            f13 = f12;
                        }
                    }
                    f12 = f13;
                }
            }
            f11 = f12;
            if (nVar2 != null) {
                double[] dArr7 = qVar.f182q;
                d11 = d10;
                i10 = 1;
                view2.setRotation(nVar2.d(f11, j10, view, f0Var) + ((float) Math.toDegrees(Math.atan2(dArr7[1], dArr7[0]))));
                z10 = z11 | nVar2.f33628h;
            } else {
                d11 = d10;
                i10 = 1;
                z10 = z11;
            }
            int i22 = i10;
            while (true) {
                v.d[] dVarArr2 = qVar.f175j;
                if (i22 >= dVarArr2.length) {
                    break;
                }
                v.d dVar = dVarArr2[i22];
                float[] fArr3 = qVar.f185t;
                dVar.g(d11, fArr3);
                kotlinx.coroutines.y.X((androidx.constraintlayout.widget.a) yVar.Q.get(qVar.f183r[i22 - 1]), view2, fArr3);
                i22++;
            }
            o oVar = qVar.f173h;
            if (oVar.f153b == 0) {
                if (f11 <= 0.0f) {
                    view2.setVisibility(oVar.f154c);
                } else {
                    o oVar2 = qVar.f174i;
                    if (f11 >= 1.0f) {
                        view2.setVisibility(oVar2.f154c);
                    } else if (oVar2.f154c != oVar.f154c) {
                        view2.setVisibility(0);
                    }
                }
            }
            if (qVar.A != null) {
                int i23 = 0;
                while (true) {
                    n[] nVarArr = qVar.A;
                    if (i23 >= nVarArr.length) {
                        break;
                    }
                    nVarArr[i23].h(f11, view2);
                    i23++;
                }
            }
        } else {
            f11 = f19;
            boolean z14 = zF;
            i10 = 1;
            float f41 = yVar2.f225e;
            y yVar3 = qVar.f172g;
            float fA = u1.a(yVar3.f225e, f41, f11, f41);
            float f42 = yVar2.f226f;
            float fA2 = u1.a(yVar3.f226f, f42, f11, f42);
            float f43 = yVar2.f227g;
            float f44 = yVar3.f227g;
            float fA3 = u1.a(f44, f43, f11, f43);
            float f45 = yVar2.f228h;
            float f46 = yVar3.f228h;
            float f47 = fA + 0.5f;
            int i24 = (int) f47;
            float f48 = fA2 + 0.5f;
            int i25 = (int) f48;
            int i26 = (int) (f47 + fA3);
            int iA = (int) (f48 + u1.a(f46, f45, f11, f45));
            int i27 = i26 - i24;
            int i28 = iA - i25;
            if (f44 != f43 || f46 != f45 || qVar.f169d) {
                view2.measure(View.MeasureSpec.makeMeasureSpec(i27, 1073741824), View.MeasureSpec.makeMeasureSpec(i28, 1073741824));
                qVar.f169d = false;
            }
            view2.layout(i24, i25, i26, iA);
            z10 = z14;
        }
        HashMap map4 = qVar.f191z;
        if (map4 != null) {
            for (z.f fVar : map4.values()) {
                if (fVar instanceof z.d) {
                    double[] dArr8 = qVar.f182q;
                    view2.setRotation(((z.d) fVar).a(f11) + ((float) Math.toDegrees(Math.atan2(dArr8[i10], dArr8[0]))));
                } else {
                    fVar.e(f11, view2);
                }
            }
        }
        return z10;
    }

    public final void g(y yVar) {
        yVar.g((int) this.f167b.getX(), (int) this.f167b.getY(), this.f167b.getWidth(), this.f167b.getHeight());
    }

    /* JADX WARN: Removed duplicated region for block: B:195:0x0592  */
    /* JADX WARN: Removed duplicated region for block: B:196:0x0597  */
    /* JADX WARN: Removed duplicated region for block: B:321:0x0808  */
    /* JADX WARN: Removed duplicated region for block: B:496:0x0804 A[SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void i(int i10, int i11, long j10) {
        o oVar;
        ArrayList<c> arrayList;
        o oVar2;
        HashSet hashSet;
        q qVar;
        ArrayList arrayList2;
        HashSet<String> hashSet2;
        HashSet<String> hashSet3;
        ArrayList arrayList3;
        androidx.constraintlayout.widget.a aVar;
        z.p pVarE;
        androidx.constraintlayout.widget.a aVar2;
        Integer num;
        Iterator it;
        z.k gVar;
        z.k gVar2;
        androidx.constraintlayout.widget.a aVar3;
        o oVar3;
        ArrayList arrayList4;
        o oVar4;
        q qVar2;
        ArrayList arrayList5;
        HashSet hashSet4;
        HashSet hashSet5;
        HashSet hashSet6;
        HashSet hashSet7;
        HashMap map;
        HashSet hashSet8;
        HashSet hashSet9;
        ArrayList arrayList6;
        j jVar;
        float f10;
        int i12;
        float f11;
        int i13;
        int i14;
        float f12;
        float fMin;
        float fA;
        q qVar3 = this;
        new HashSet();
        HashSet hashSet10 = new HashSet();
        HashSet hashSet11 = new HashSet();
        HashSet hashSet12 = new HashSet();
        HashMap map2 = new HashMap();
        int i15 = qVar3.B;
        y yVar = qVar3.f171f;
        int i16 = -1;
        if (i15 != -1) {
            yVar.f230j = i15;
        }
        o oVar5 = qVar3.f173h;
        float f13 = oVar5.f156e;
        o oVar6 = qVar3.f174i;
        if (o.b(f13, oVar6.f156e)) {
            hashSet11.add("alpha");
        }
        if (o.b(oVar5.f157f, oVar6.f157f)) {
            hashSet11.add("elevation");
        }
        int i17 = oVar5.f154c;
        int i18 = oVar6.f154c;
        if (i17 != i18 && oVar5.f153b == 0 && (i17 == 0 || i18 == 0)) {
            hashSet11.add("alpha");
        }
        if (o.b(oVar5.f158g, oVar6.f158g)) {
            hashSet11.add("rotation");
        }
        if (!Float.isNaN(oVar5.S) || !Float.isNaN(oVar6.S)) {
            hashSet11.add("transitionPathRotate");
        }
        if (!Float.isNaN(oVar5.T) || !Float.isNaN(oVar6.T)) {
            hashSet11.add("progress");
        }
        if (o.b(oVar5.f159h, oVar6.f159h)) {
            hashSet11.add("rotationX");
        }
        if (o.b(oVar5.f152a, oVar6.f152a)) {
            hashSet11.add("rotationY");
        }
        if (o.b(oVar5.f162k, oVar6.f162k)) {
            hashSet11.add("transformPivotX");
        }
        if (o.b(oVar5.f163l, oVar6.f163l)) {
            hashSet11.add("transformPivotY");
        }
        if (o.b(oVar5.f160i, oVar6.f160i)) {
            hashSet11.add("scaleX");
        }
        if (o.b(oVar5.f161j, oVar6.f161j)) {
            hashSet11.add("scaleY");
        }
        if (o.b(oVar5.f164m, oVar6.f164m)) {
            hashSet11.add("translationX");
        }
        if (o.b(oVar5.Q, oVar6.Q)) {
            hashSet11.add("translationY");
        }
        if (o.b(oVar5.R, oVar6.R)) {
            hashSet11.add("translationZ");
        }
        ArrayList<c> arrayList7 = qVar3.f188w;
        y yVar2 = qVar3.f172g;
        ArrayList arrayList8 = qVar3.f186u;
        float f14 = Float.NaN;
        int i19 = 0;
        if (arrayList7 != null) {
            ArrayList arrayList9 = null;
            for (c cVar : arrayList7) {
                if (cVar instanceof j) {
                    j jVar2 = (j) cVar;
                    y yVar3 = new y();
                    yVar3.f222b = i19;
                    yVar3.f229i = f14;
                    yVar3.f230j = i16;
                    yVar3.f231k = i16;
                    yVar3.f232l = f14;
                    yVar3.f233m = null;
                    yVar3.Q = new LinkedHashMap();
                    yVar3.R = i19;
                    yVar3.S = new double[18];
                    yVar3.T = new double[18];
                    if (yVar.f231k != i16) {
                        float f15 = jVar2.f26a / 100.0f;
                        yVar3.f223c = f15;
                        yVar3.f222b = jVar2.f106h;
                        yVar3.R = jVar2.f113o;
                        float f16 = Float.isNaN(jVar2.f107i) ? f15 : jVar2.f107i;
                        if (Float.isNaN(jVar2.f108j)) {
                            oVar4 = oVar6;
                            f12 = f15;
                        } else {
                            f12 = jVar2.f108j;
                            oVar4 = oVar6;
                        }
                        float f17 = yVar2.f227g;
                        oVar3 = oVar5;
                        float f18 = yVar.f227g;
                        arrayList4 = arrayList7;
                        float f19 = yVar2.f228h;
                        hashSet7 = hashSet11;
                        float f20 = yVar.f228h;
                        map = map2;
                        yVar3.f224d = yVar3.f223c;
                        yVar3.f227g = (int) (((f17 - f18) * f16) + f18);
                        yVar3.f228h = (int) (((f19 - f20) * f12) + f20);
                        if (jVar2.f113o != 2) {
                            float f21 = Float.isNaN(jVar2.f109k) ? f15 : jVar2.f109k;
                            float f22 = yVar2.f225e;
                            float f23 = yVar.f225e;
                            yVar3.f225e = u1.a(f22, f23, f21, f23);
                            if (!Float.isNaN(jVar2.f110l)) {
                                f15 = jVar2.f110l;
                            }
                            float f24 = yVar2.f226f;
                            float f25 = yVar.f226f;
                            yVar3.f226f = u1.a(f24, f25, f15, f25);
                        } else {
                            if (Float.isNaN(jVar2.f109k)) {
                                float f26 = yVar2.f225e;
                                float f27 = yVar.f225e;
                                fMin = u1.a(f26, f27, f15, f27);
                            } else {
                                fMin = jVar2.f109k * Math.min(f12, f16);
                            }
                            yVar3.f225e = fMin;
                            if (Float.isNaN(jVar2.f110l)) {
                                float f28 = yVar2.f226f;
                                float f29 = yVar.f226f;
                                fA = u1.a(f28, f29, f15, f29);
                            } else {
                                fA = jVar2.f110l;
                            }
                            yVar3.f226f = fA;
                        }
                        yVar3.f231k = yVar.f231k;
                        yVar3.f221a = v.f.c(jVar2.f104f);
                        yVar3.f230j = jVar2.f105g;
                        hashSet8 = hashSet10;
                        hashSet9 = hashSet12;
                    } else {
                        hashSet7 = hashSet11;
                        map = map2;
                        oVar3 = oVar5;
                        arrayList4 = arrayList7;
                        oVar4 = oVar6;
                        int i20 = jVar2.f113o;
                        if (i20 == 1) {
                            hashSet8 = hashSet10;
                            hashSet9 = hashSet12;
                            y yVar4 = yVar;
                            arrayList6 = arrayList8;
                            float f30 = jVar2.f26a / 100.0f;
                            yVar3.f223c = f30;
                            yVar3.f222b = jVar2.f106h;
                            float f31 = Float.isNaN(jVar2.f107i) ? f30 : jVar2.f107i;
                            float f32 = Float.isNaN(jVar2.f108j) ? f30 : jVar2.f108j;
                            float f33 = yVar2.f227g - yVar4.f227g;
                            float f34 = yVar2.f228h - yVar4.f228h;
                            yVar3.f224d = yVar3.f223c;
                            if (!Float.isNaN(jVar2.f109k)) {
                                f30 = jVar2.f109k;
                            }
                            float f35 = yVar4.f225e;
                            float f36 = yVar4.f227g;
                            float f37 = yVar4.f226f;
                            float f38 = yVar4.f228h;
                            float f39 = ((yVar2.f227g / 2.0f) + yVar2.f225e) - ((f36 / 2.0f) + f35);
                            float f40 = ((yVar2.f228h / 2.0f) + yVar2.f226f) - ((f38 / 2.0f) + f37);
                            float f41 = f39 * f30;
                            float f42 = (f33 * f31) / 2.0f;
                            yVar3.f225e = (int) ((f35 + f41) - f42);
                            float f43 = f30 * f40;
                            float f44 = (f34 * f32) / 2.0f;
                            yVar3.f226f = (int) ((f37 + f43) - f44);
                            yVar3.f227g = (int) (f36 + r3);
                            yVar3.f228h = (int) (f38 + r5);
                            jVar = jVar2;
                            float f45 = Float.isNaN(jVar.f110l) ? 0.0f : jVar.f110l;
                            yVar3.R = 1;
                            yVar = yVar4;
                            float f46 = (int) ((yVar.f225e + f41) - f42);
                            float f47 = (int) ((yVar.f226f + f43) - f44);
                            yVar3.f225e = f46 + ((-f40) * f45);
                            yVar3.f226f = f47 + (f39 * f45);
                            yVar3.f231k = yVar3.f231k;
                            yVar3.f221a = v.f.c(jVar.f104f);
                            yVar3.f230j = jVar.f105g;
                        } else if (i20 == 2) {
                            hashSet8 = hashSet10;
                            hashSet9 = hashSet12;
                            y yVar5 = yVar;
                            ArrayList arrayList10 = arrayList8;
                            float f48 = jVar2.f26a / 100.0f;
                            yVar3.f223c = f48;
                            yVar3.f222b = jVar2.f106h;
                            float f49 = Float.isNaN(jVar2.f107i) ? f48 : jVar2.f107i;
                            float f50 = Float.isNaN(jVar2.f108j) ? f48 : jVar2.f108j;
                            float f51 = yVar2.f227g;
                            float f52 = f51 - yVar5.f227g;
                            float f53 = yVar2.f228h;
                            float f54 = f53 - yVar5.f228h;
                            yVar3.f224d = yVar3.f223c;
                            float f55 = yVar5.f225e;
                            float f56 = yVar5.f226f;
                            float f57 = (f51 / 2.0f) + yVar2.f225e;
                            float f58 = (f53 / 2.0f) + yVar2.f226f;
                            float f59 = f52 * f49;
                            yVar3.f225e = (int) ((((f57 - ((r4 / 2.0f) + f55)) * f48) + f55) - (f59 / 2.0f));
                            float f60 = f54 * f50;
                            yVar3.f226f = (int) ((((f58 - ((r8 / 2.0f) + f56)) * f48) + f56) - (f60 / 2.0f));
                            yVar3.f227g = (int) (r4 + f59);
                            yVar3.f228h = (int) (r8 + f60);
                            yVar3.R = 2;
                            if (!Float.isNaN(jVar2.f109k)) {
                                yVar3.f225e = (int) (jVar2.f109k * (i10 - ((int) yVar3.f227g)));
                            }
                            if (!Float.isNaN(jVar2.f110l)) {
                                yVar3.f226f = (int) (jVar2.f110l * (i11 - ((int) yVar3.f228h)));
                            }
                            yVar3.f231k = yVar3.f231k;
                            yVar3.f221a = v.f.c(jVar2.f104f);
                            yVar3.f230j = jVar2.f105g;
                            jVar = jVar2;
                            arrayList5 = arrayList10;
                            yVar = yVar5;
                            arrayList5.add((-Collections.binarySearch(arrayList5, yVar3)) - 1, yVar3);
                            i14 = jVar.f103e;
                            if (i14 != -1) {
                                qVar2 = this;
                                qVar2.f170e = i14;
                            } else {
                                qVar2 = this;
                            }
                            hashSet6 = hashSet7;
                            map2 = map;
                            hashSet5 = hashSet8;
                            hashSet4 = hashSet9;
                        } else if (i20 != 3) {
                            float f61 = jVar2.f26a / 100.0f;
                            yVar3.f223c = f61;
                            yVar3.f222b = jVar2.f106h;
                            float f62 = Float.isNaN(jVar2.f107i) ? f61 : jVar2.f107i;
                            float f63 = Float.isNaN(jVar2.f108j) ? f61 : jVar2.f108j;
                            float f64 = yVar2.f227g;
                            float f65 = yVar.f227g;
                            float f66 = f64 - f65;
                            float f67 = yVar2.f228h;
                            float f68 = yVar.f228h;
                            float f69 = f67 - f68;
                            hashSet8 = hashSet10;
                            yVar3.f224d = yVar3.f223c;
                            float f70 = yVar.f225e;
                            hashSet9 = hashSet12;
                            float f71 = yVar.f226f;
                            float f72 = ((f64 / 2.0f) + yVar2.f225e) - ((f65 / 2.0f) + f70);
                            float f73 = ((f67 / 2.0f) + yVar2.f226f) - ((f68 / 2.0f) + f71);
                            float f74 = (f72 * f61) + f70;
                            float f75 = (f66 * f62) / 2.0f;
                            yVar3.f225e = (int) (f74 - f75);
                            float f76 = (f73 * f61) + f71;
                            float f77 = (f69 * f63) / 2.0f;
                            yVar3.f226f = (int) (f76 - f77);
                            yVar3.f227g = (int) (f65 + r14);
                            yVar3.f228h = (int) (f68 + r26);
                            float f78 = Float.isNaN(jVar2.f109k) ? f61 : jVar2.f109k;
                            float f79 = Float.isNaN(jVar2.f112n) ? 0.0f : jVar2.f112n;
                            if (!Float.isNaN(jVar2.f110l)) {
                                f61 = jVar2.f110l;
                            }
                            if (Float.isNaN(jVar2.f111m)) {
                                i13 = 0;
                                f11 = 0.0f;
                            } else {
                                f11 = jVar2.f111m;
                                i13 = 0;
                            }
                            yVar3.R = i13;
                            yVar3.f225e = (int) (((f11 * f73) + ((f78 * f72) + yVar.f225e)) - f75);
                            yVar3.f226f = (int) (((f73 * f61) + ((f72 * f79) + yVar.f226f)) - f77);
                            yVar3.f221a = v.f.c(jVar2.f104f);
                            yVar3.f230j = jVar2.f105g;
                        } else {
                            hashSet8 = hashSet10;
                            hashSet9 = hashSet12;
                            float f80 = jVar2.f26a / 100.0f;
                            yVar3.f223c = f80;
                            yVar3.f222b = jVar2.f106h;
                            float f81 = Float.isNaN(jVar2.f107i) ? f80 : jVar2.f107i;
                            float f82 = Float.isNaN(jVar2.f108j) ? f80 : jVar2.f108j;
                            float f83 = yVar2.f227g;
                            float f84 = yVar.f227g;
                            float f85 = f83 - f84;
                            float f86 = yVar2.f228h;
                            float f87 = yVar.f228h;
                            float f88 = f86 - f87;
                            yVar3.f224d = yVar3.f223c;
                            float f89 = (f84 / 2.0f) + yVar.f225e;
                            arrayList6 = arrayList8;
                            float f90 = (f87 / 2.0f) + yVar.f226f;
                            y yVar6 = yVar;
                            float f91 = (f83 / 2.0f) + yVar2.f225e;
                            float f92 = (f86 / 2.0f) + yVar2.f226f;
                            if (f89 > f91) {
                                f89 = f91;
                                f91 = f89;
                            }
                            if (f90 <= f92) {
                                f90 = f92;
                                f92 = f90;
                            }
                            float f93 = f91 - f89;
                            float f94 = f90 - f92;
                            float f95 = (f85 * f81) / 2.0f;
                            yVar3.f225e = (int) (((f93 * f80) + r13) - f95);
                            float f96 = (f88 * f82) / 2.0f;
                            yVar3.f226f = (int) (((f94 * f80) + r11) - f96);
                            yVar3.f227g = (int) (f84 + r5);
                            yVar3.f228h = (int) (f87 + r9);
                            float f97 = Float.isNaN(jVar2.f109k) ? f80 : jVar2.f109k;
                            float f98 = Float.isNaN(jVar2.f112n) ? 0.0f : jVar2.f112n;
                            if (!Float.isNaN(jVar2.f110l)) {
                                f80 = jVar2.f110l;
                            }
                            if (Float.isNaN(jVar2.f111m)) {
                                i12 = 0;
                                f10 = 0.0f;
                            } else {
                                f10 = jVar2.f111m;
                                i12 = 0;
                            }
                            yVar3.R = i12;
                            yVar3.f225e = (int) (((f10 * f94) + ((f97 * f93) + yVar6.f225e)) - f95);
                            yVar3.f226f = (int) (((f94 * f80) + ((f93 * f98) + yVar6.f226f)) - f96);
                            yVar3.f221a = v.f.c(jVar2.f104f);
                            yVar3.f230j = jVar2.f105g;
                            yVar = yVar6;
                            jVar = jVar2;
                        }
                        arrayList5 = arrayList6;
                        arrayList5.add((-Collections.binarySearch(arrayList5, yVar3)) - 1, yVar3);
                        i14 = jVar.f103e;
                        if (i14 != -1) {
                        }
                        hashSet6 = hashSet7;
                        map2 = map;
                        hashSet5 = hashSet8;
                        hashSet4 = hashSet9;
                    }
                    arrayList5 = arrayList8;
                    jVar = jVar2;
                    arrayList5.add((-Collections.binarySearch(arrayList5, yVar3)) - 1, yVar3);
                    i14 = jVar.f103e;
                    if (i14 != -1) {
                    }
                    hashSet6 = hashSet7;
                    map2 = map;
                    hashSet5 = hashSet8;
                    hashSet4 = hashSet9;
                } else {
                    HashSet hashSet13 = hashSet10;
                    HashSet hashSet14 = hashSet11;
                    HashSet hashSet15 = hashSet12;
                    HashMap map3 = map2;
                    oVar3 = oVar5;
                    arrayList4 = arrayList7;
                    oVar4 = oVar6;
                    qVar2 = qVar3;
                    arrayList5 = arrayList8;
                    if (cVar instanceof g) {
                        hashSet4 = hashSet15;
                        cVar.d(hashSet4);
                        hashSet6 = hashSet14;
                        map2 = map3;
                        hashSet5 = hashSet13;
                    } else {
                        hashSet4 = hashSet15;
                        if (cVar instanceof l) {
                            hashSet5 = hashSet13;
                            cVar.d(hashSet5);
                        } else {
                            hashSet5 = hashSet13;
                            if (cVar instanceof n) {
                                if (arrayList9 == null) {
                                    arrayList9 = new ArrayList();
                                }
                                ArrayList arrayList11 = arrayList9;
                                arrayList11.add((n) cVar);
                                arrayList9 = arrayList11;
                            } else {
                                map2 = map3;
                                cVar.f(map2);
                                hashSet6 = hashSet14;
                                cVar.d(hashSet6);
                            }
                        }
                        hashSet6 = hashSet14;
                        map2 = map3;
                    }
                }
                arrayList8 = arrayList5;
                qVar3 = qVar2;
                hashSet11 = hashSet6;
                oVar6 = oVar4;
                oVar5 = oVar3;
                arrayList7 = arrayList4;
                i16 = -1;
                f14 = Float.NaN;
                i19 = 0;
                HashSet hashSet16 = hashSet5;
                hashSet12 = hashSet4;
                hashSet10 = hashSet16;
            }
            oVar = oVar5;
            arrayList = arrayList7;
            oVar2 = oVar6;
            hashSet = hashSet11;
            qVar = qVar3;
            arrayList2 = arrayList8;
            HashSet hashSet17 = hashSet12;
            hashSet2 = hashSet10;
            hashSet3 = hashSet17;
            arrayList3 = arrayList9;
        } else {
            oVar = oVar5;
            arrayList = arrayList7;
            oVar2 = oVar6;
            hashSet = hashSet11;
            qVar = qVar3;
            arrayList2 = arrayList8;
            hashSet2 = hashSet10;
            hashSet3 = hashSet12;
            arrayList3 = null;
        }
        if (arrayList3 != null) {
            qVar.A = (n[]) arrayList3.toArray(new n[0]);
        }
        if (!hashSet.isEmpty()) {
            qVar.f190y = new HashMap();
            Iterator it2 = hashSet.iterator();
            while (it2.hasNext()) {
                String str = (String) it2.next();
                if (str.startsWith("CUSTOM,")) {
                    SparseArray sparseArray = new SparseArray();
                    String str2 = str.split(",")[1];
                    for (c cVar2 : arrayList) {
                        Iterator it3 = it2;
                        HashMap map4 = cVar2.f29d;
                        if (map4 != null && (aVar3 = (androidx.constraintlayout.widget.a) map4.get(str2)) != null) {
                            sparseArray.append(cVar2.f26a, aVar3);
                        }
                        it2 = it3;
                    }
                    it = it2;
                    z.h hVar = new z.h();
                    String str3 = str.split(",")[1];
                    hVar.f36994f = sparseArray;
                    gVar = hVar;
                } else {
                    it = it2;
                    str.hashCode();
                    switch (str) {
                        case "rotationX":
                            gVar2 = new z.g(5);
                            break;
                        case "rotationY":
                            gVar2 = new z.g(6);
                            break;
                        case "translationX":
                            gVar2 = new z.g(9);
                            break;
                        case "translationY":
                            gVar2 = new z.g(10);
                            break;
                        case "translationZ":
                            gVar2 = new z.g(11);
                            break;
                        case "progress":
                            z.j jVar3 = new z.j();
                            jVar3.f36996f = false;
                            gVar2 = jVar3;
                            break;
                        case "scaleX":
                            gVar2 = new z.g(7);
                            break;
                        case "scaleY":
                            gVar2 = new z.g(8);
                            break;
                        case "waveVariesBy":
                            gVar2 = new z.g(0);
                            break;
                        case "transformPivotX":
                            gVar2 = new z.g(2);
                            break;
                        case "transformPivotY":
                            gVar2 = new z.g(3);
                            break;
                        case "rotation":
                            gVar = new z.g(4);
                            break;
                        case "elevation":
                            gVar = new z.g(1);
                            break;
                        case "transitionPathRotate":
                            gVar = new z.i();
                            break;
                        case "alpha":
                            gVar = new z.g(0);
                            break;
                        case "waveOffset":
                            gVar = new z.g(0);
                            break;
                        default:
                            gVar = null;
                            break;
                    }
                    if (gVar2 == null) {
                        gVar2.f37001e = str;
                        qVar.f190y.put(str, gVar2);
                    }
                    it2 = it;
                }
                gVar2 = gVar;
                if (gVar2 == null) {
                }
                it2 = it;
            }
            if (arrayList != null) {
                for (c cVar3 : arrayList) {
                    if (cVar3 instanceof e) {
                        cVar3.a(qVar.f190y);
                    }
                }
            }
            oVar.a(0, qVar.f190y);
            oVar2.a(100, qVar.f190y);
            for (String str4 : qVar.f190y.keySet()) {
                int iIntValue = (!map2.containsKey(str4) || (num = (Integer) map2.get(str4)) == null) ? 0 : num.intValue();
                z.k kVar = (z.k) qVar.f190y.get(str4);
                if (kVar != null) {
                    kVar.d(iIntValue);
                }
            }
        }
        if (!hashSet2.isEmpty()) {
            if (qVar.f189x == null) {
                qVar.f189x = new HashMap();
            }
            for (String str5 : hashSet2) {
                if (!qVar.f189x.containsKey(str5)) {
                    if (str5.startsWith("CUSTOM,")) {
                        SparseArray sparseArray2 = new SparseArray();
                        String str6 = str5.split(",")[1];
                        for (c cVar4 : arrayList) {
                            HashMap map5 = cVar4.f29d;
                            if (map5 != null && (aVar2 = (androidx.constraintlayout.widget.a) map5.get(str6)) != null) {
                                sparseArray2.append(cVar4.f26a, aVar2);
                            }
                        }
                        z.m mVar = new z.m();
                        mVar.f37005m = new SparseArray();
                        mVar.f37003k = str5.split(",")[1];
                        mVar.f37004l = sparseArray2;
                        pVarE = mVar;
                    } else {
                        pVarE = z.p.e(j10, str5);
                    }
                    if (pVarE != null) {
                        pVarE.f33626f = str5;
                        qVar.f189x.put(str5, pVarE);
                    }
                }
            }
            if (arrayList != null) {
                for (c cVar5 : arrayList) {
                    if (cVar5 instanceof l) {
                        ((l) cVar5).h(qVar.f189x);
                    }
                }
            }
            for (String str7 : qVar.f189x.keySet()) {
                ((z.p) qVar.f189x.get(str7)).c(map2.containsKey(str7) ? ((Integer) map2.get(str7)).intValue() : 0);
            }
        }
        int size = arrayList2.size();
        int i21 = size + 2;
        y[] yVarArr = new y[i21];
        yVarArr[0] = yVar;
        yVarArr[size + 1] = yVar2;
        if (arrayList2.size() > 0 && qVar.f170e == -1) {
            qVar.f170e = 0;
        }
        Iterator it4 = arrayList2.iterator();
        int i22 = 1;
        while (it4.hasNext()) {
            yVarArr[i22] = (y) it4.next();
            i22++;
        }
        HashSet hashSet18 = new HashSet();
        for (String str8 : yVar2.Q.keySet()) {
            if (yVar.Q.containsKey(str8)) {
                if (!hashSet.contains("CUSTOM," + str8)) {
                    hashSet18.add(str8);
                }
            }
        }
        String[] strArr = (String[]) hashSet18.toArray(new String[0]);
        qVar.f183r = strArr;
        qVar.f184s = new int[strArr.length];
        int i23 = 0;
        while (true) {
            String[] strArr2 = qVar.f183r;
            if (i23 < strArr2.length) {
                String str9 = strArr2[i23];
                qVar.f184s[i23] = 0;
                int i24 = 0;
                while (true) {
                    if (i24 >= i21) {
                        break;
                    }
                    if (!yVarArr[i24].Q.containsKey(str9) || (aVar = (androidx.constraintlayout.widget.a) yVarArr[i24].Q.get(str9)) == null) {
                        i24++;
                    } else {
                        int[] iArr = qVar.f184s;
                        iArr[i23] = aVar.c() + iArr[i23];
                    }
                }
                i23++;
            } else {
                boolean z10 = yVarArr[0].f230j != -1;
                int length = 18 + strArr2.length;
                boolean[] zArr = new boolean[length];
                for (int i25 = 1; i25 < i21; i25++) {
                    yVarArr[i25].c(yVarArr[i25 - 1], zArr, z10);
                }
                int i26 = 0;
                for (int i27 = 1; i27 < length; i27++) {
                    if (zArr[i27]) {
                        i26++;
                    }
                }
                qVar.f180o = new int[i26];
                int iMax = Math.max(2, i26);
                qVar.f181p = new double[iMax];
                qVar.f182q = new double[iMax];
                int i28 = 0;
                for (int i29 = 1; i29 < length; i29++) {
                    if (zArr[i29]) {
                        qVar.f180o[i28] = i29;
                        i28++;
                    }
                }
                double[][] dArr = (double[][]) Array.newInstance((Class<?>) Double.TYPE, i21, qVar.f180o.length);
                double[] dArr2 = new double[i21];
                for (int i30 = 0; i30 < i21; i30++) {
                    yVarArr[i30].d(dArr[i30], qVar.f180o);
                    dArr2[i30] = yVarArr[i30].f223c;
                }
                int i31 = 0;
                while (true) {
                    int[] iArr2 = qVar.f180o;
                    if (i31 < iArr2.length) {
                        if (iArr2[i31] < 6) {
                            String strO = defpackage.e.o(new StringBuilder(), y.U[qVar.f180o[i31]], " [");
                            for (int i32 = 0; i32 < i21; i32++) {
                                StringBuilder sbC = u.a.c(strO);
                                sbC.append(dArr[i32][i31]);
                                strO = sbC.toString();
                            }
                        }
                        i31++;
                    } else {
                        qVar.f175j = new v.d[qVar.f183r.length + 1];
                        int i33 = 0;
                        while (true) {
                            String[] strArr3 = qVar.f183r;
                            if (i33 >= strArr3.length) {
                                qVar.f175j[0] = v.d.d(qVar.f170e, dArr2, dArr);
                                if (yVarArr[0].f230j != -1) {
                                    int[] iArr3 = new int[i21];
                                    double[] dArr3 = new double[i21];
                                    double[][] dArr4 = (double[][]) Array.newInstance((Class<?>) Double.TYPE, i21, 2);
                                    for (int i34 = 0; i34 < i21; i34++) {
                                        iArr3[i34] = yVarArr[i34].f230j;
                                        dArr3[i34] = r8.f223c;
                                        double[] dArr5 = dArr4[i34];
                                        dArr5[0] = r8.f225e;
                                        dArr5[1] = r8.f226f;
                                    }
                                    qVar.f176k = new v.b(iArr3, dArr3, dArr4);
                                }
                                qVar.f191z = new HashMap();
                                if (arrayList != null) {
                                    float fE = Float.NaN;
                                    for (String str10 : hashSet3) {
                                        z.f fVarC = z.f.c(str10);
                                        if (fVarC != null) {
                                            if (fVarC.f36991e == 1 && Float.isNaN(fE)) {
                                                fE = e();
                                            }
                                            fVarC.f36988b = str10;
                                            qVar.f191z.put(str10, fVarC);
                                        }
                                    }
                                    for (c cVar6 : arrayList) {
                                        if (cVar6 instanceof g) {
                                            ((g) cVar6).h(qVar.f191z);
                                        }
                                    }
                                    Iterator it5 = qVar.f191z.values().iterator();
                                    while (it5.hasNext()) {
                                        ((z.f) it5.next()).f();
                                    }
                                    return;
                                }
                                return;
                            }
                            String str11 = strArr3[i33];
                            int i35 = 0;
                            double[] dArr6 = null;
                            double[][] dArr7 = null;
                            for (int i36 = 0; i36 < i21; i36++) {
                                if (yVarArr[i36].Q.containsKey(str11)) {
                                    if (dArr7 == null) {
                                        dArr6 = new double[i21];
                                        androidx.constraintlayout.widget.a aVar4 = (androidx.constraintlayout.widget.a) yVarArr[i36].Q.get(str11);
                                        dArr7 = (double[][]) Array.newInstance((Class<?>) Double.TYPE, i21, aVar4 == null ? 0 : aVar4.c());
                                    }
                                    y yVar7 = yVarArr[i36];
                                    dArr6[i35] = yVar7.f223c;
                                    yVar7.f(str11, dArr7[i35]);
                                    i35++;
                                }
                            }
                            i33++;
                            qVar.f175j[i33] = v.d.d(qVar.f170e, Arrays.copyOf(dArr6, i35), (double[][]) Arrays.copyOf(dArr7, i35));
                        }
                    }
                }
            }
        }
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder(" start: x: ");
        y yVar = this.f171f;
        sb.append(yVar.f225e);
        sb.append(" y: ");
        sb.append(yVar.f226f);
        sb.append(" end: x: ");
        y yVar2 = this.f172g;
        sb.append(yVar2.f225e);
        sb.append(" y: ");
        sb.append(yVar2.f226f);
        return sb.toString();
    }
}
