package a0;

import java.util.LinkedHashMap;

/* JADX INFO: loaded from: classes.dex */
public final class y implements Comparable {
    public static final String[] U = {"position", "x", "y", "width", "height", "pathRotate"};

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public v.f f221a;

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

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

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

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

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public q f233m = null;
    public LinkedHashMap Q = new LinkedHashMap();
    public int R = 0;
    public double[] S = new double[18];
    public double[] T = new double[18];

    public static boolean b(float f10, float f11) {
        return (Float.isNaN(f10) || Float.isNaN(f11)) ? Float.isNaN(f10) != Float.isNaN(f11) : Math.abs(f10 - f11) > 1.0E-6f;
    }

    public static void h(float f10, float f11, float[] fArr, int[] iArr, double[] dArr, double[] dArr2) {
        float f12 = 0.0f;
        float f13 = 0.0f;
        float f14 = 0.0f;
        float f15 = 0.0f;
        for (int i10 = 0; i10 < iArr.length; i10++) {
            float f16 = (float) dArr[i10];
            double d10 = dArr2[i10];
            int i11 = iArr[i10];
            if (i11 == 1) {
                f12 = f16;
            } else if (i11 == 2) {
                f14 = f16;
            } else if (i11 == 3) {
                f13 = f16;
            } else if (i11 == 4) {
                f15 = f16;
            }
        }
        float f17 = f12 - ((0.0f * f13) / 2.0f);
        float f18 = f14 - ((0.0f * f15) / 2.0f);
        fArr[0] = (((f13 * 1.0f) + f17) * f10) + ((1.0f - f10) * f17) + 0.0f;
        fArr[1] = (((f15 * 1.0f) + f18) * f11) + ((1.0f - f11) * f18) + 0.0f;
    }

    public final void a(androidx.constraintlayout.widget.j jVar) {
        int iOrdinal;
        this.f221a = v.f.c(jVar.f1390d.f1442d);
        androidx.constraintlayout.widget.l lVar = jVar.f1390d;
        this.f230j = lVar.f1443e;
        this.f231k = lVar.f1440b;
        this.f229i = lVar.f1446h;
        this.f222b = lVar.f1444f;
        float f10 = jVar.f1389c.f1456e;
        this.f232l = jVar.f1391e.C;
        for (String str : jVar.f1393g.keySet()) {
            androidx.constraintlayout.widget.a aVar = (androidx.constraintlayout.widget.a) jVar.f1393g.get(str);
            if (aVar != null && (iOrdinal = aVar.f1302c.ordinal()) != 4 && iOrdinal != 5 && iOrdinal != 7) {
                this.Q.put(str, aVar);
            }
        }
    }

    public final void c(y yVar, boolean[] zArr, boolean z10) {
        boolean zB = b(this.f225e, yVar.f225e);
        boolean zB2 = b(this.f226f, yVar.f226f);
        zArr[0] = zArr[0] | b(this.f224d, yVar.f224d);
        boolean z11 = z10 | zB | zB2;
        zArr[1] = zArr[1] | z11;
        zArr[2] = z11 | zArr[2];
        zArr[3] = zArr[3] | b(this.f227g, yVar.f227g);
        zArr[4] = b(this.f228h, yVar.f228h) | zArr[4];
    }

    @Override // java.lang.Comparable
    public final int compareTo(Object obj) {
        return Float.compare(this.f224d, ((y) obj).f224d);
    }

    public final void d(double[] dArr, int[] iArr) {
        float[] fArr = {this.f224d, this.f225e, this.f226f, this.f227g, this.f228h, this.f229i};
        int i10 = 0;
        for (int i11 : iArr) {
            if (i11 < 6) {
                dArr[i10] = fArr[r4];
                i10++;
            }
        }
    }

    public final void e(double d10, int[] iArr, double[] dArr, float[] fArr, int i10) {
        float fSin = this.f225e;
        float fCos = this.f226f;
        float f10 = this.f227g;
        float f11 = this.f228h;
        for (int i11 = 0; i11 < iArr.length; i11++) {
            float f12 = (float) dArr[i11];
            int i12 = iArr[i11];
            if (i12 == 1) {
                fSin = f12;
            } else if (i12 == 2) {
                fCos = f12;
            } else if (i12 == 3) {
                f10 = f12;
            } else if (i12 == 4) {
                f11 = f12;
            }
        }
        q qVar = this.f233m;
        if (qVar != null) {
            float[] fArr2 = new float[2];
            qVar.c(d10, fArr2, new float[2]);
            float f13 = fArr2[0];
            float f14 = fArr2[1];
            double d11 = f13;
            double d12 = fSin;
            double d13 = fCos;
            fSin = (float) (((Math.sin(d13) * d12) + d11) - ((double) (f10 / 2.0f)));
            fCos = (float) ((((double) f14) - (Math.cos(d13) * d12)) - ((double) (f11 / 2.0f)));
        }
        fArr[i10] = (f10 / 2.0f) + fSin + 0.0f;
        fArr[i10 + 1] = (f11 / 2.0f) + fCos + 0.0f;
    }

    public final void f(String str, double[] dArr) {
        androidx.constraintlayout.widget.a aVar = (androidx.constraintlayout.widget.a) this.Q.get(str);
        if (aVar == null) {
            return;
        }
        int i10 = 0;
        if (aVar.c() == 1) {
            dArr[0] = aVar.a();
            return;
        }
        int iC = aVar.c();
        aVar.b(new float[iC]);
        int i11 = 0;
        while (i10 < iC) {
            dArr[i11] = r1[i10];
            i10++;
            i11++;
        }
    }

    public final void g(float f10, float f11, float f12, float f13) {
        this.f225e = f10;
        this.f226f = f11;
        this.f227g = f12;
        this.f228h = f13;
    }

    public final void i(q qVar, y yVar) {
        double d10 = (((this.f227g / 2.0f) + this.f225e) - yVar.f225e) - (yVar.f227g / 2.0f);
        double d11 = (((this.f228h / 2.0f) + this.f226f) - yVar.f226f) - (yVar.f228h / 2.0f);
        this.f233m = qVar;
        this.f225e = (float) Math.hypot(d11, d10);
        if (Float.isNaN(this.f232l)) {
            this.f226f = (float) (Math.atan2(d11, d10) + 1.5707963267948966d);
        } else {
            this.f226f = (float) Math.toRadians(this.f232l);
        }
    }
}
