package J2;

import I2.C0325i;
import I2.C0334s;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.DashPathEffect;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.RadialGradient;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.Typeface;
import android.util.Base64;
import android.util.Log;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Locale;
import java.util.Set;
import java.util.Stack;
import m1.AbstractC2464a;

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

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public static HashSet f3153g;

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public C4.f f3155b;

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

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

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

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

    public static Path A(O o6) {
        Path path = new Path();
        float[] fArr = o6.f3303o;
        path.moveTo(fArr[0], fArr[1]);
        int i6 = 2;
        while (true) {
            float[] fArr2 = o6.f3303o;
            if (i6 >= fArr2.length) {
                break;
            }
            path.lineTo(fArr2[i6], fArr2[i6 + 1]);
            i6 += 2;
        }
        if (o6 instanceof P) {
            path.close();
        }
        if (o6.f3357h == null) {
            o6.f3357h = c(path);
        }
        return path;
    }

    public static void N(z0 z0Var, boolean z6, AbstractC0405d0 abstractC0405d0) {
        int i6;
        U u6 = z0Var.f3488a;
        float fFloatValue = (z6 ? u6.f3329c : u6.f3331e).floatValue();
        if (abstractC0405d0 instanceof C0430v) {
            i6 = ((C0430v) abstractC0405d0).f3467a;
        } else if (!(abstractC0405d0 instanceof C0431w)) {
            return;
        } else {
            i6 = z0Var.f3488a.f3336n.f3467a;
        }
        int i7 = i(fFloatValue, i6);
        if (z6) {
            z0Var.f3491d.setColor(i7);
        } else {
            z0Var.f3492e.setColor(i7);
        }
    }

    public static void a(float f6, float f7, float f8, float f9, float f10, boolean z6, boolean z7, float f11, float f12, M m6) {
        if (f6 == f11 && f7 == f12) {
            return;
        }
        if (f8 == 0.0f || f9 == 0.0f) {
            m6.e(f11, f12);
            return;
        }
        float fAbs = Math.abs(f8);
        float fAbs2 = Math.abs(f9);
        double radians = Math.toRadians(((double) f10) % 360.0d);
        double dCos = Math.cos(radians);
        double dSin = Math.sin(radians);
        double d6 = ((double) (f6 - f11)) / 2.0d;
        double d7 = ((double) (f7 - f12)) / 2.0d;
        double d8 = (dSin * d7) + (dCos * d6);
        double d9 = (dCos * d7) + ((-dSin) * d6);
        double d10 = fAbs * fAbs;
        double d11 = fAbs2 * fAbs2;
        double d12 = d8 * d8;
        double d13 = d9 * d9;
        double d14 = (d13 / d11) + (d12 / d10);
        if (d14 > 0.99999d) {
            double dSqrt = Math.sqrt(d14) * 1.00001d;
            fAbs = (float) (((double) fAbs) * dSqrt);
            fAbs2 = (float) (dSqrt * ((double) fAbs2));
            d10 = fAbs * fAbs;
            d11 = fAbs2 * fAbs2;
        }
        double d15 = z6 == z7 ? -1.0d : 1.0d;
        double d16 = d10 * d11;
        double d17 = d10 * d13;
        double d18 = d11 * d12;
        double d19 = ((d16 - d17) - d18) / (d17 + d18);
        if (d19 < 0.0d) {
            d19 = 0.0d;
        }
        double dSqrt2 = Math.sqrt(d19) * d15;
        double d20 = fAbs;
        double d21 = fAbs2;
        double d22 = ((d20 * d9) / d21) * dSqrt2;
        double d23 = dSqrt2 * (-((d21 * d8) / d20));
        double d24 = ((dCos * d22) - (dSin * d23)) + (((double) (f6 + f11)) / 2.0d);
        double d25 = (dCos * d23) + (dSin * d22) + (((double) (f7 + f12)) / 2.0d);
        double d26 = (d8 - d22) / d20;
        double d27 = (d9 - d23) / d21;
        double d28 = ((-d8) - d22) / d20;
        double d29 = ((-d9) - d23) / d21;
        double d30 = (d27 * d27) + (d26 * d26);
        double dAcos = Math.acos(d26 / Math.sqrt(d30)) * (d27 < 0.0d ? -1.0d : 1.0d);
        double dSqrt3 = ((d27 * d29) + (d26 * d28)) / Math.sqrt(((d29 * d29) + (d28 * d28)) * d30);
        double dAcos2 = ((d26 * d29) - (d27 * d28) < 0.0d ? -1.0d : 1.0d) * (dSqrt3 < -1.0d ? 3.141592653589793d : dSqrt3 > 1.0d ? 0.0d : Math.acos(dSqrt3));
        if (!z7 && dAcos2 > 0.0d) {
            dAcos2 -= 6.283185307179586d;
        } else if (z7 && dAcos2 < 0.0d) {
            dAcos2 += 6.283185307179586d;
        }
        double d31 = dAcos2 % 6.283185307179586d;
        double d32 = dAcos % 6.283185307179586d;
        int iCeil = (int) Math.ceil((Math.abs(d31) * 2.0d) / 3.141592653589793d);
        double d33 = d31 / ((double) iCeil);
        double d34 = d33 / 2.0d;
        double dSin2 = (Math.sin(d34) * 1.3333333333333333d) / (Math.cos(d34) + 1.0d);
        int i6 = iCeil * 6;
        float[] fArr = new float[i6];
        int i7 = 0;
        int i8 = 0;
        while (i7 < iCeil) {
            double d35 = d32;
            double d36 = (((double) i7) * d33) + d35;
            double dCos2 = Math.cos(d36);
            double dSin3 = Math.sin(d36);
            int i9 = i7;
            int i10 = i8;
            fArr[i10] = (float) (dCos2 - (dSin2 * dSin3));
            fArr[i8 + 1] = (float) ((dCos2 * dSin2) + dSin3);
            double d37 = d36 + d33;
            double dCos3 = Math.cos(d37);
            double dSin4 = Math.sin(d37);
            fArr[i10 + 2] = (float) ((dSin2 * dSin4) + dCos3);
            fArr[i10 + 3] = (float) (dSin4 - (dSin2 * dCos3));
            fArr[i10 + 4] = (float) dCos3;
            i8 = i10 + 6;
            fArr[i10 + 5] = (float) dSin4;
            i7 = i9 + 1;
            d32 = d35;
            iCeil = iCeil;
        }
        Matrix matrix = new Matrix();
        matrix.postScale(fAbs, fAbs2);
        matrix.postRotate(f10);
        matrix.postTranslate((float) d24, (float) d25);
        matrix.mapPoints(fArr);
        fArr[i6 - 2] = f11;
        fArr[i6 - 1] = f12;
        for (int i11 = 0; i11 < i6; i11 += 6) {
            m6.c(fArr[i11], fArr[i11 + 1], fArr[i11 + 2], fArr[i11 + 3], fArr[i11 + 4], fArr[i11 + 5]);
        }
    }

    public static C0427s c(Path path) {
        RectF rectF = new RectF();
        path.computeBounds(rectF, true);
        return new C0427s(rectF.left, rectF.top, rectF.width(), rectF.height());
    }

    /* JADX WARN: Code restructure failed: missing block: B:26:0x005e, code lost:
    
        if (r7 != 9) goto L31;
     */
    /* JADX WARN: Removed duplicated region for block: B:34:0x0073  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x0078  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x007d A[PHI: r5
      0x007d: PHI (r5v2 float) = (r5v1 float), (r5v3 float) binds: [B:32:0x006f, B:35:0x0076] A[DONT_GENERATE, DONT_INLINE]] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static Matrix e(C0427s c0427s, C0427s c0427s2, r rVar) {
        EnumC0426q enumC0426q;
        float f6;
        float f7;
        Matrix matrix = new Matrix();
        if (rVar != null && (enumC0426q = rVar.f3436a) != null) {
            float f8 = c0427s.f3446d / c0427s2.f3446d;
            float f9 = c0427s.f3447e / c0427s2.f3447e;
            float f10 = -c0427s2.f3444b;
            float f11 = -c0427s2.f3445c;
            if (rVar.equals(r.f3434c)) {
                matrix.preTranslate(c0427s.f3444b, c0427s.f3445c);
                matrix.preScale(f8, f9);
                matrix.preTranslate(f10, f11);
                return matrix;
            }
            float fMax = rVar.f3437b == 2 ? Math.max(f8, f9) : Math.min(f8, f9);
            float f12 = c0427s.f3446d / fMax;
            float f13 = c0427s.f3447e / fMax;
            int iOrdinal = enumC0426q.ordinal();
            if (iOrdinal == 2) {
                f6 = (c0427s2.f3446d - f12) / 2.0f;
                f10 -= f6;
                switch (enumC0426q.ordinal()) {
                    case 4:
                    case 5:
                    case 6:
                        f7 = (c0427s2.f3447e - f13) / 2.0f;
                        break;
                    case 7:
                    case 8:
                    case 9:
                        f7 = c0427s2.f3447e - f13;
                        break;
                    default:
                        matrix.preTranslate(c0427s.f3444b, c0427s.f3445c);
                        matrix.preScale(fMax, fMax);
                        matrix.preTranslate(f10, f11);
                        break;
                }
                f11 -= f7;
                matrix.preTranslate(c0427s.f3444b, c0427s.f3445c);
                matrix.preScale(fMax, fMax);
                matrix.preTranslate(f10, f11);
            } else {
                if (iOrdinal != 3) {
                    if (iOrdinal != 5) {
                        if (iOrdinal != 6) {
                            if (iOrdinal != 8) {
                            }
                        }
                    }
                    f6 = (c0427s2.f3446d - f12) / 2.0f;
                    f10 -= f6;
                    switch (enumC0426q.ordinal()) {
                    }
                    f11 -= f7;
                    matrix.preTranslate(c0427s.f3444b, c0427s.f3445c);
                    matrix.preScale(fMax, fMax);
                    matrix.preTranslate(f10, f11);
                }
                f6 = c0427s2.f3446d - f12;
                f10 -= f6;
                switch (enumC0426q.ordinal()) {
                }
                f11 -= f7;
                matrix.preTranslate(c0427s.f3444b, c0427s.f3445c);
                matrix.preScale(fMax, fMax);
                matrix.preTranslate(f10, f11);
            }
        }
        return matrix;
    }

    public static Typeface h(String str, int i6, Integer num) {
        int i7;
        boolean z6 = i6 == 2;
        i7 = num.intValue() > 500 ? z6 ? 3 : 1 : z6 ? 2 : 0;
        str.getClass();
        switch (str) {
            case "sans-serif":
                return Typeface.create(Typeface.SANS_SERIF, i7);
            case "monospace":
                return Typeface.create(Typeface.MONOSPACE, i7);
            case "fantasy":
                return Typeface.create(Typeface.SANS_SERIF, i7);
            case "serif":
                return Typeface.create(Typeface.SERIF, i7);
            case "cursive":
                return Typeface.create(Typeface.SANS_SERIF, i7);
            default:
                return null;
        }
    }

    public static int i(float f6, int i6) {
        int i7 = 255;
        int iRound = Math.round(((i6 >> 24) & 255) * f6);
        if (iRound < 0) {
            i7 = 0;
        } else if (iRound <= 255) {
            i7 = iRound;
        }
        return (i7 << 24) | (i6 & 16777215);
    }

    public static void o(String str, Object... objArr) {
        Log.e("SVGAndroidRenderer", String.format(str, objArr));
    }

    public static void q(AbstractC0434z abstractC0434z, String str) {
        AbstractC0399a0 abstractC0399a0N = abstractC0434z.f3370a.N(str);
        if (abstractC0399a0N == null) {
            Log.w("SVGAndroidRenderer", "Gradient reference '" + str + "' not found");
            return;
        }
        if (!(abstractC0399a0N instanceof AbstractC0434z)) {
            o("Gradient href attributes must point to other gradient elements", new Object[0]);
            return;
        }
        if (abstractC0399a0N == abstractC0434z) {
            o("Circular reference in gradient href attribute '%s'", str);
            return;
        }
        AbstractC0434z abstractC0434z2 = (AbstractC0434z) abstractC0399a0N;
        if (abstractC0434z.f3485i == null) {
            abstractC0434z.f3485i = abstractC0434z2.f3485i;
        }
        if (abstractC0434z.f3486j == null) {
            abstractC0434z.f3486j = abstractC0434z2.f3486j;
        }
        if (abstractC0434z.f3487k == 0) {
            abstractC0434z.f3487k = abstractC0434z2.f3487k;
        }
        if (abstractC0434z.f3484h.isEmpty()) {
            abstractC0434z.f3484h = abstractC0434z2.f3484h;
        }
        try {
            if (abstractC0434z instanceof C0401b0) {
                C0401b0 c0401b0 = (C0401b0) abstractC0434z;
                C0401b0 c0401b02 = (C0401b0) abstractC0399a0N;
                if (c0401b0.f3366m == null) {
                    c0401b0.f3366m = c0401b02.f3366m;
                }
                if (c0401b0.f3367n == null) {
                    c0401b0.f3367n = c0401b02.f3367n;
                }
                if (c0401b0.f3368o == null) {
                    c0401b0.f3368o = c0401b02.f3368o;
                }
                if (c0401b0.f3369p == null) {
                    c0401b0.f3369p = c0401b02.f3369p;
                }
            } else {
                r((C0409f0) abstractC0434z, (C0409f0) abstractC0399a0N);
            }
        } catch (ClassCastException unused) {
        }
        String str2 = abstractC0434z2.l;
        if (str2 != null) {
            q(abstractC0434z, str2);
        }
    }

    public static void r(C0409f0 c0409f0, C0409f0 c0409f02) {
        if (c0409f0.f3381m == null) {
            c0409f0.f3381m = c0409f02.f3381m;
        }
        if (c0409f0.f3382n == null) {
            c0409f0.f3382n = c0409f02.f3382n;
        }
        if (c0409f0.f3383o == null) {
            c0409f0.f3383o = c0409f02.f3383o;
        }
        if (c0409f0.f3384p == null) {
            c0409f0.f3384p = c0409f02.f3384p;
        }
        if (c0409f0.f3385q == null) {
            c0409f0.f3385q = c0409f02.f3385q;
        }
    }

    public static void s(N n6, String str) {
        AbstractC0399a0 abstractC0399a0N = n6.f3370a.N(str);
        if (abstractC0399a0N == null) {
            Log.w("SVGAndroidRenderer", "Pattern reference '" + str + "' not found");
            return;
        }
        if (!(abstractC0399a0N instanceof N)) {
            o("Pattern href attributes must point to other pattern elements", new Object[0]);
            return;
        }
        if (abstractC0399a0N == n6) {
            o("Circular reference in pattern href attribute '%s'", str);
            return;
        }
        N n7 = (N) abstractC0399a0N;
        if (n6.f3295p == null) {
            n6.f3295p = n7.f3295p;
        }
        if (n6.f3296q == null) {
            n6.f3296q = n7.f3296q;
        }
        if (n6.f3297r == null) {
            n6.f3297r = n7.f3297r;
        }
        if (n6.f3298s == null) {
            n6.f3298s = n7.f3298s;
        }
        if (n6.f3299t == null) {
            n6.f3299t = n7.f3299t;
        }
        if (n6.f3300u == null) {
            n6.f3300u = n7.f3300u;
        }
        if (n6.f3301v == null) {
            n6.f3301v = n7.f3301v;
        }
        if (n6.f3353i.isEmpty()) {
            n6.f3353i = n7.f3353i;
        }
        if (n6.f3387o == null) {
            n6.f3387o = n7.f3387o;
        }
        if (n6.f3375n == null) {
            n6.f3375n = n7.f3375n;
        }
        String str2 = n7.f3302w;
        if (str2 != null) {
            s(n6, str2);
        }
    }

    public static boolean x(U u6, long j4) {
        return (u6.f3327a & j4) != 0;
    }

    /* JADX WARN: Removed duplicated region for block: B:16:0x0048  */
    /* JADX WARN: Removed duplicated region for block: B:17:0x004e  */
    /* JADX WARN: Removed duplicated region for block: B:20:0x0053  */
    /* JADX WARN: Removed duplicated region for block: B:21:0x0059  */
    /* JADX WARN: Removed duplicated region for block: B:24:0x006a  */
    /* JADX WARN: Removed duplicated region for block: B:29:0x0081  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Path B(Q q6) {
        float fD;
        float fE;
        float fMin;
        float fD2;
        float fE2;
        float f6;
        float f7;
        Path path;
        E e6 = q6.f3308s;
        if (e6 == null && q6.f3309t == null) {
            fD = 0.0f;
        } else if (e6 == null) {
            fD = q6.f3309t.e(this);
        } else {
            if (q6.f3309t != null) {
                fD = e6.d(this);
                fE = q6.f3309t.e(this);
                fMin = Math.min(fD, q6.f3306q.d(this) / 2.0f);
                float fMin2 = Math.min(fE, q6.f3307r.e(this) / 2.0f);
                E e7 = q6.f3304o;
                fD2 = e7 == null ? e7.d(this) : 0.0f;
                E e8 = q6.f3305p;
                fE2 = e8 == null ? e8.e(this) : 0.0f;
                float fD3 = q6.f3306q.d(this);
                float fE3 = q6.f3307r.e(this);
                if (q6.f3357h == null) {
                    q6.f3357h = new C0427s(fD2, fE2, fD3, fE3);
                }
                f6 = fD3 + fD2;
                f7 = fE2 + fE3;
                path = new Path();
                if (fMin != 0.0f || fMin2 == 0.0f) {
                    path.moveTo(fD2, fE2);
                    path.lineTo(f6, fE2);
                    path.lineTo(f6, f7);
                    path.lineTo(fD2, f7);
                    path.lineTo(fD2, fE2);
                } else {
                    float f8 = fMin * 0.5522848f;
                    float f9 = 0.5522848f * fMin2;
                    float f10 = fE2 + fMin2;
                    path.moveTo(fD2, f10);
                    float f11 = f10 - f9;
                    float f12 = fD2 + fMin;
                    float f13 = f12 - f8;
                    path.cubicTo(fD2, f11, f13, fE2, f12, fE2);
                    float f14 = f6 - fMin;
                    path.lineTo(f14, fE2);
                    float f15 = f14 + f8;
                    path.cubicTo(f15, fE2, f6, f11, f6, f10);
                    float f16 = f7 - fMin2;
                    path.lineTo(f6, f16);
                    float f17 = f16 + f9;
                    path.cubicTo(f6, f17, f15, f7, f14, f7);
                    path.lineTo(f12, f7);
                    float f18 = fD2;
                    path.cubicTo(f13, f7, f18, f17, fD2, f16);
                    path.lineTo(f18, f10);
                }
                path.close();
                return path;
            }
            fD = e6.d(this);
        }
        fE = fD;
        fMin = Math.min(fD, q6.f3306q.d(this) / 2.0f);
        float fMin22 = Math.min(fE, q6.f3307r.e(this) / 2.0f);
        E e72 = q6.f3304o;
        if (e72 == null) {
        }
        E e82 = q6.f3305p;
        if (e82 == null) {
        }
        float fD32 = q6.f3306q.d(this);
        float fE32 = q6.f3307r.e(this);
        if (q6.f3357h == null) {
        }
        f6 = fD32 + fD2;
        f7 = fE2 + fE32;
        path = new Path();
        if (fMin != 0.0f) {
            path.moveTo(fD2, fE2);
            path.lineTo(f6, fE2);
            path.lineTo(f6, f7);
            path.lineTo(fD2, f7);
            path.lineTo(fD2, fE2);
        }
        path.close();
        return path;
    }

    public final C0427s C(E e6, E e7, E e8, E e9) {
        float fD = e6 != null ? e6.d(this) : 0.0f;
        float fE = e7 != null ? e7.e(this) : 0.0f;
        z0 z0Var = this.f3156c;
        C0427s c0427s = z0Var.f3494g;
        if (c0427s == null) {
            c0427s = z0Var.f3493f;
        }
        return new C0427s(fD, fE, e8 != null ? e8.d(this) : c0427s.f3446d, e9 != null ? e9.e(this) : c0427s.f3447e);
    }

    public final Path D(Z z6, boolean z7) {
        Path pathB;
        Path pathB2;
        this.f3157d.push(this.f3156c);
        z0 z0Var = new z0(this.f3156c);
        this.f3156c = z0Var;
        T(z6, z0Var);
        if (!k() || !V()) {
            this.f3156c = (z0) this.f3157d.pop();
            return null;
        }
        if (z6 instanceof r0) {
            if (!z7) {
                o("<use> elements inside a <clipPath> cannot reference another <use>", new Object[0]);
            }
            r0 r0Var = (r0) z6;
            AbstractC0399a0 abstractC0399a0N = z6.f3370a.N(r0Var.f3438o);
            if (abstractC0399a0N == null) {
                o("Use reference '%s' not found", r0Var.f3438o);
                this.f3156c = (z0) this.f3157d.pop();
                return null;
            }
            if (!(abstractC0399a0N instanceof Z)) {
                this.f3156c = (z0) this.f3157d.pop();
                return null;
            }
            pathB = D((Z) abstractC0399a0N, false);
            if (pathB != null) {
                if (r0Var.f3357h == null) {
                    r0Var.f3357h = c(pathB);
                }
                Matrix matrix = r0Var.f3152n;
                if (matrix != null) {
                    pathB.transform(matrix);
                }
                if (this.f3156c.f3488a.f3311A != null && (pathB2 = b(z6, z6.f3357h)) != null) {
                    pathB.op(pathB2, Path.Op.INTERSECT);
                }
                this.f3156c = (z0) this.f3157d.pop();
                return pathB;
            }
            return null;
        }
        if (z6 instanceof A) {
            A a6 = (A) z6;
            if (z6 instanceof K) {
                pathB = new v0(((K) z6).f3279o).f3468a;
                if (z6.f3357h == null) {
                    z6.f3357h = c(pathB);
                }
            } else {
                pathB = z6 instanceof Q ? B((Q) z6) : z6 instanceof C0428t ? y((C0428t) z6) : z6 instanceof C0433y ? z((C0433y) z6) : z6 instanceof O ? A((O) z6) : null;
            }
            if (pathB != null) {
                if (a6.f3357h == null) {
                    a6.f3357h = c(pathB);
                }
                Matrix matrix2 = a6.f3149n;
                if (matrix2 != null) {
                    pathB.transform(matrix2);
                }
                pathB.setFillType(w());
            }
            return null;
        }
        if (!(z6 instanceof C0421l0)) {
            o("Invalid %s element found in clipPath definition", z6.m());
            return null;
        }
        C0421l0 c0421l0 = (C0421l0) z6;
        ArrayList arrayList = c0421l0.f3419n;
        float fE = 0.0f;
        float fD = (arrayList == null || arrayList.size() == 0) ? 0.0f : ((E) c0421l0.f3419n.get(0)).d(this);
        ArrayList arrayList2 = c0421l0.f3420o;
        float fE2 = (arrayList2 == null || arrayList2.size() == 0) ? 0.0f : ((E) c0421l0.f3420o.get(0)).e(this);
        ArrayList arrayList3 = c0421l0.f3421p;
        float fD2 = (arrayList3 == null || arrayList3.size() == 0) ? 0.0f : ((E) c0421l0.f3421p.get(0)).d(this);
        ArrayList arrayList4 = c0421l0.f3422q;
        if (arrayList4 != null && arrayList4.size() != 0) {
            fE = ((E) c0421l0.f3422q.get(0)).e(this);
        }
        if (this.f3156c.f3488a.f3323M != 1) {
            float fD3 = d(c0421l0);
            if (this.f3156c.f3488a.f3323M == 2) {
                fD3 /= 2.0f;
            }
            fD -= fD3;
        }
        if (c0421l0.f3357h == null) {
            y0 y0Var = new y0(this, fD, fE2);
            n(c0421l0, y0Var);
            RectF rectF = (RectF) y0Var.l;
            c0421l0.f3357h = new C0427s(rectF.left, rectF.top, rectF.width(), ((RectF) y0Var.l).height());
        }
        Path path = new Path();
        n(c0421l0, new y0(this, fD + fD2, fE2 + fE, path));
        Matrix matrix3 = c0421l0.f3404r;
        if (matrix3 != null) {
            path.transform(matrix3);
        }
        path.setFillType(w());
        pathB = path;
        if (this.f3156c.f3488a.f3311A != null) {
            pathB.op(pathB2, Path.Op.INTERSECT);
        }
        this.f3156c = (z0) this.f3157d.pop();
        return pathB;
    }

    public final void E(C0427s c0427s) {
        if (this.f3156c.f3488a.f3312B != null) {
            Paint paint = new Paint();
            PorterDuff.Mode mode = PorterDuff.Mode.DST_IN;
            paint.setXfermode(new PorterDuffXfermode(mode));
            Canvas canvas = this.f3154a;
            canvas.saveLayer(null, paint, 31);
            Paint paint2 = new Paint();
            paint2.setColorFilter(new ColorMatrixColorFilter(new ColorMatrix(new float[]{0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.2127f, 0.7151f, 0.0722f, 0.0f, 0.0f})));
            canvas.saveLayer(null, paint2, 31);
            H h5 = (H) this.f3155b.N(this.f3156c.f3488a.f3312B);
            L(h5, c0427s);
            canvas.restore();
            Paint paint3 = new Paint();
            paint3.setXfermode(new PorterDuffXfermode(mode));
            canvas.saveLayer(null, paint3, 31);
            L(h5, c0427s);
            canvas.restore();
            canvas.restore();
        }
        O();
    }

    public final boolean F() {
        AbstractC0399a0 abstractC0399a0N;
        int i6 = 0;
        if (this.f3156c.f3488a.f3335m.floatValue() >= 1.0f && this.f3156c.f3488a.f3312B == null) {
            return false;
        }
        int iFloatValue = (int) (this.f3156c.f3488a.f3335m.floatValue() * 256.0f);
        if (iFloatValue >= 0) {
            i6 = 255;
            if (iFloatValue <= 255) {
                i6 = iFloatValue;
            }
        }
        this.f3154a.saveLayerAlpha(null, i6, 31);
        this.f3157d.push(this.f3156c);
        z0 z0Var = new z0(this.f3156c);
        this.f3156c = z0Var;
        String str = z0Var.f3488a.f3312B;
        if (str != null && ((abstractC0399a0N = this.f3155b.N(str)) == null || !(abstractC0399a0N instanceof H))) {
            o("Mask reference '%s' not found", this.f3156c.f3488a.f3312B);
            this.f3156c.f3488a.f3312B = null;
        }
        return true;
    }

    public final void G(V v3, C0427s c0427s, C0427s c0427s2, r rVar) {
        if (c0427s.f3446d == 0.0f || c0427s.f3447e == 0.0f) {
            return;
        }
        if (rVar == null && (rVar = v3.f3375n) == null) {
            rVar = r.f3435d;
        }
        T(v3, this.f3156c);
        if (k()) {
            z0 z0Var = this.f3156c;
            z0Var.f3493f = c0427s;
            if (!z0Var.f3488a.f3340r.booleanValue()) {
                C0427s c0427s3 = this.f3156c.f3493f;
                M(c0427s3.f3444b, c0427s3.f3445c, c0427s3.f3446d, c0427s3.f3447e);
            }
            f(v3, this.f3156c.f3493f);
            Canvas canvas = this.f3154a;
            if (c0427s2 != null) {
                canvas.concat(e(this.f3156c.f3493f, c0427s2, rVar));
                this.f3156c.f3494g = v3.f3387o;
            } else {
                C0427s c0427s4 = this.f3156c.f3493f;
                canvas.translate(c0427s4.f3444b, c0427s4.f3445c);
            }
            boolean zF = F();
            U();
            I(v3, true);
            if (zF) {
                E(v3.f3357h);
            }
            R(v3);
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final void H(AbstractC0403c0 abstractC0403c0) {
        E e6;
        String str;
        int iIndexOf;
        Set setA;
        E e7;
        Boolean bool;
        if (abstractC0403c0 instanceof I) {
            return;
        }
        P();
        if ((abstractC0403c0 instanceof AbstractC0399a0) && (bool = ((AbstractC0399a0) abstractC0403c0).f3359d) != null) {
            this.f3156c.f3495h = bool.booleanValue();
        }
        if (abstractC0403c0 instanceof V) {
            V v3 = (V) abstractC0403c0;
            G(v3, C(v3.f3349p, v3.f3350q, v3.f3351r, v3.f3352s), v3.f3387o, v3.f3375n);
        } else {
            Bitmap bitmapDecodeByteArray = null;
            if (abstractC0403c0 instanceof r0) {
                r0 r0Var = (r0) abstractC0403c0;
                E e8 = r0Var.f3441r;
                if ((e8 == null || !e8.h()) && ((e7 = r0Var.f3442s) == null || !e7.h())) {
                    T(r0Var, this.f3156c);
                    if (k()) {
                        AbstractC0403c0 abstractC0403c0N = r0Var.f3370a.N(r0Var.f3438o);
                        if (abstractC0403c0N == null) {
                            o("Use reference '%s' not found", r0Var.f3438o);
                        } else {
                            Matrix matrix = r0Var.f3152n;
                            Canvas canvas = this.f3154a;
                            if (matrix != null) {
                                canvas.concat(matrix);
                            }
                            E e9 = r0Var.f3439p;
                            float fD = e9 != null ? e9.d(this) : 0.0f;
                            E e10 = r0Var.f3440q;
                            canvas.translate(fD, e10 != null ? e10.e(this) : 0.0f);
                            f(r0Var, r0Var.f3357h);
                            boolean zF = F();
                            this.f3158e.push(r0Var);
                            this.f3159f.push(this.f3154a.getMatrix());
                            if (abstractC0403c0N instanceof V) {
                                V v6 = (V) abstractC0403c0N;
                                C0427s c0427sC = C(null, null, r0Var.f3441r, r0Var.f3442s);
                                P();
                                G(v6, c0427sC, v6.f3387o, v6.f3375n);
                                O();
                            } else if (abstractC0403c0N instanceof C0415i0) {
                                E e11 = r0Var.f3441r;
                                if (e11 == null) {
                                    e11 = new E(100.0f, 9);
                                }
                                E e12 = r0Var.f3442s;
                                if (e12 == null) {
                                    e12 = new E(100.0f, 9);
                                }
                                C0427s c0427sC2 = C(null, null, e11, e12);
                                P();
                                C0415i0 c0415i0 = (C0415i0) abstractC0403c0N;
                                if (c0427sC2.f3446d != 0.0f && c0427sC2.f3447e != 0.0f) {
                                    r rVar = c0415i0.f3375n;
                                    if (rVar == null) {
                                        rVar = r.f3435d;
                                    }
                                    T(c0415i0, this.f3156c);
                                    z0 z0Var = this.f3156c;
                                    z0Var.f3493f = c0427sC2;
                                    if (!z0Var.f3488a.f3340r.booleanValue()) {
                                        C0427s c0427s = this.f3156c.f3493f;
                                        M(c0427s.f3444b, c0427s.f3445c, c0427s.f3446d, c0427s.f3447e);
                                    }
                                    C0427s c0427s2 = c0415i0.f3387o;
                                    if (c0427s2 != null) {
                                        canvas.concat(e(this.f3156c.f3493f, c0427s2, rVar));
                                        this.f3156c.f3494g = c0415i0.f3387o;
                                    } else {
                                        C0427s c0427s3 = this.f3156c.f3493f;
                                        canvas.translate(c0427s3.f3444b, c0427s3.f3445c);
                                    }
                                    boolean zF2 = F();
                                    I(c0415i0, true);
                                    if (zF2) {
                                        E(c0415i0.f3357h);
                                    }
                                    R(c0415i0);
                                }
                                O();
                            } else {
                                H(abstractC0403c0N);
                            }
                            this.f3158e.pop();
                            this.f3159f.pop();
                            if (zF) {
                                E(r0Var.f3357h);
                            }
                            R(r0Var);
                        }
                    }
                }
            } else if (abstractC0403c0 instanceof C0413h0) {
                C0413h0 c0413h0 = (C0413h0) abstractC0403c0;
                T(c0413h0, this.f3156c);
                if (k()) {
                    Matrix matrix2 = c0413h0.f3152n;
                    if (matrix2 != null) {
                        this.f3154a.concat(matrix2);
                    }
                    f(c0413h0, c0413h0.f3357h);
                    boolean zF3 = F();
                    String language = Locale.getDefault().getLanguage();
                    Iterator it = c0413h0.f3353i.iterator();
                    while (true) {
                        if (!it.hasNext()) {
                            break;
                        }
                        AbstractC0403c0 abstractC0403c02 = (AbstractC0403c0) it.next();
                        if (abstractC0403c02 instanceof W) {
                            W w6 = (W) abstractC0403c02;
                            if (w6.b() == null && ((setA = w6.a()) == null || (!setA.isEmpty() && setA.contains(language)))) {
                                Set requiredFeatures = w6.getRequiredFeatures();
                                if (requiredFeatures != null) {
                                    if (f3153g == null) {
                                        synchronized (B0.class) {
                                            HashSet hashSet = new HashSet();
                                            f3153g = hashSet;
                                            hashSet.add("Structure");
                                            f3153g.add("BasicStructure");
                                            f3153g.add("ConditionalProcessing");
                                            f3153g.add("Image");
                                            f3153g.add("Style");
                                            f3153g.add("ViewportAttribute");
                                            f3153g.add("Shape");
                                            f3153g.add("BasicText");
                                            f3153g.add("PaintAttribute");
                                            f3153g.add("BasicPaintAttribute");
                                            f3153g.add("OpacityAttribute");
                                            f3153g.add("BasicGraphicsAttribute");
                                            f3153g.add("Marker");
                                            f3153g.add("Gradient");
                                            f3153g.add("Pattern");
                                            f3153g.add("Clip");
                                            f3153g.add("BasicClip");
                                            f3153g.add("Mask");
                                            f3153g.add("View");
                                        }
                                    }
                                    if (requiredFeatures.isEmpty() || !f3153g.containsAll(requiredFeatures)) {
                                    }
                                }
                                Set setK = w6.k();
                                if (setK == null) {
                                    Set setL = w6.l();
                                    if (setL == null) {
                                        H(abstractC0403c02);
                                        break;
                                    }
                                    setL.isEmpty();
                                } else {
                                    setK.isEmpty();
                                }
                            }
                        }
                    }
                    if (zF3) {
                        E(c0413h0.f3357h);
                    }
                    R(c0413h0);
                }
            } else if (abstractC0403c0 instanceof B) {
                B b5 = (B) abstractC0403c0;
                T(b5, this.f3156c);
                if (k()) {
                    Matrix matrix3 = b5.f3152n;
                    if (matrix3 != null) {
                        this.f3154a.concat(matrix3);
                    }
                    f(b5, b5.f3357h);
                    boolean zF4 = F();
                    I(b5, true);
                    if (zF4) {
                        E(b5.f3357h);
                    }
                    R(b5);
                }
            } else {
                if (abstractC0403c0 instanceof D) {
                    D d6 = (D) abstractC0403c0;
                    E e13 = d6.f3163r;
                    if (e13 != null && !e13.h() && (e6 = d6.f3164s) != null && !e6.h() && (str = d6.f3160o) != null) {
                        r rVar2 = d6.f3375n;
                        if (rVar2 == null) {
                            rVar2 = r.f3435d;
                        }
                        if (str.startsWith("data:") && str.length() >= 14 && (iIndexOf = str.indexOf(44)) >= 12 && ";base64".equals(str.substring(iIndexOf - 7, iIndexOf))) {
                            try {
                                byte[] bArrDecode = Base64.decode(str.substring(iIndexOf + 1), 0);
                                bitmapDecodeByteArray = BitmapFactory.decodeByteArray(bArrDecode, 0, bArrDecode.length);
                            } catch (Exception e14) {
                                Log.e("SVGAndroidRenderer", "Could not decode bad Data URL", e14);
                            }
                        }
                        if (bitmapDecodeByteArray != null) {
                            C0427s c0427s4 = new C0427s(0.0f, 0.0f, bitmapDecodeByteArray.getWidth(), bitmapDecodeByteArray.getHeight());
                            T(d6, this.f3156c);
                            if (k() && V()) {
                                Matrix matrix4 = d6.f3165t;
                                Canvas canvas2 = this.f3154a;
                                if (matrix4 != null) {
                                    canvas2.concat(matrix4);
                                }
                                E e15 = d6.f3161p;
                                float fD2 = e15 != null ? e15.d(this) : 0.0f;
                                E e16 = d6.f3162q;
                                float fE = e16 != null ? e16.e(this) : 0.0f;
                                float fD3 = d6.f3163r.d(this);
                                float fD4 = d6.f3164s.d(this);
                                z0 z0Var2 = this.f3156c;
                                z0Var2.f3493f = new C0427s(fD2, fE, fD3, fD4);
                                if (!z0Var2.f3488a.f3340r.booleanValue()) {
                                    C0427s c0427s5 = this.f3156c.f3493f;
                                    M(c0427s5.f3444b, c0427s5.f3445c, c0427s5.f3446d, c0427s5.f3447e);
                                }
                                d6.f3357h = this.f3156c.f3493f;
                                R(d6);
                                f(d6, d6.f3357h);
                                boolean zF5 = F();
                                U();
                                canvas2.save();
                                canvas2.concat(e(this.f3156c.f3493f, c0427s4, rVar2));
                                canvas2.drawBitmap(bitmapDecodeByteArray, 0.0f, 0.0f, new Paint(this.f3156c.f3488a.f3326P == 3 ? 0 : 2));
                                canvas2.restore();
                                if (zF5) {
                                    E(d6.f3357h);
                                }
                            }
                        }
                    }
                } else if (abstractC0403c0 instanceof K) {
                    K k6 = (K) abstractC0403c0;
                    if (k6.f3279o != null) {
                        T(k6, this.f3156c);
                        if (k() && V()) {
                            z0 z0Var3 = this.f3156c;
                            if (z0Var3.f3490c || z0Var3.f3489b) {
                                Matrix matrix5 = k6.f3149n;
                                if (matrix5 != null) {
                                    this.f3154a.concat(matrix5);
                                }
                                Path path = new v0(k6.f3279o).f3468a;
                                if (k6.f3357h == null) {
                                    k6.f3357h = c(path);
                                }
                                R(k6);
                                g(k6);
                                f(k6, k6.f3357h);
                                boolean zF6 = F();
                                z0 z0Var4 = this.f3156c;
                                if (z0Var4.f3489b) {
                                    int i6 = z0Var4.f3488a.f3317G;
                                    path.setFillType((i6 == 0 || i6 != 2) ? Path.FillType.WINDING : Path.FillType.EVEN_ODD);
                                    l(k6, path);
                                }
                                if (this.f3156c.f3490c) {
                                    m(path);
                                }
                                K(k6);
                                if (zF6) {
                                    E(k6.f3357h);
                                }
                            }
                        }
                    }
                } else if (abstractC0403c0 instanceof Q) {
                    Q q6 = (Q) abstractC0403c0;
                    E e17 = q6.f3306q;
                    if (e17 != null && q6.f3307r != null && !e17.h() && !q6.f3307r.h()) {
                        T(q6, this.f3156c);
                        if (k() && V()) {
                            Matrix matrix6 = q6.f3149n;
                            if (matrix6 != null) {
                                this.f3154a.concat(matrix6);
                            }
                            Path pathB = B(q6);
                            R(q6);
                            g(q6);
                            f(q6, q6.f3357h);
                            boolean zF7 = F();
                            if (this.f3156c.f3489b) {
                                l(q6, pathB);
                            }
                            if (this.f3156c.f3490c) {
                                m(pathB);
                            }
                            if (zF7) {
                                E(q6.f3357h);
                            }
                        }
                    }
                } else if (abstractC0403c0 instanceof C0428t) {
                    C0428t c0428t = (C0428t) abstractC0403c0;
                    E e18 = c0428t.f3450q;
                    if (e18 != null && !e18.h()) {
                        T(c0428t, this.f3156c);
                        if (k() && V()) {
                            Matrix matrix7 = c0428t.f3149n;
                            if (matrix7 != null) {
                                this.f3154a.concat(matrix7);
                            }
                            Path pathY = y(c0428t);
                            R(c0428t);
                            g(c0428t);
                            f(c0428t, c0428t.f3357h);
                            boolean zF8 = F();
                            if (this.f3156c.f3489b) {
                                l(c0428t, pathY);
                            }
                            if (this.f3156c.f3490c) {
                                m(pathY);
                            }
                            if (zF8) {
                                E(c0428t.f3357h);
                            }
                        }
                    }
                } else if (abstractC0403c0 instanceof C0433y) {
                    C0433y c0433y = (C0433y) abstractC0403c0;
                    E e19 = c0433y.f3478q;
                    if (e19 != null && c0433y.f3479r != null && !e19.h() && !c0433y.f3479r.h()) {
                        T(c0433y, this.f3156c);
                        if (k() && V()) {
                            Matrix matrix8 = c0433y.f3149n;
                            if (matrix8 != null) {
                                this.f3154a.concat(matrix8);
                            }
                            Path pathZ = z(c0433y);
                            R(c0433y);
                            g(c0433y);
                            f(c0433y, c0433y.f3357h);
                            boolean zF9 = F();
                            if (this.f3156c.f3489b) {
                                l(c0433y, pathZ);
                            }
                            if (this.f3156c.f3490c) {
                                m(pathZ);
                            }
                            if (zF9) {
                                E(c0433y.f3357h);
                            }
                        }
                    }
                } else if (abstractC0403c0 instanceof F) {
                    F f6 = (F) abstractC0403c0;
                    T(f6, this.f3156c);
                    if (k() && V() && this.f3156c.f3490c) {
                        Matrix matrix9 = f6.f3149n;
                        if (matrix9 != null) {
                            this.f3154a.concat(matrix9);
                        }
                        E e20 = f6.f3170o;
                        float fD5 = e20 == null ? 0.0f : e20.d(this);
                        E e21 = f6.f3171p;
                        float fE2 = e21 == null ? 0.0f : e21.e(this);
                        E e22 = f6.f3172q;
                        float fD6 = e22 == null ? 0.0f : e22.d(this);
                        E e23 = f6.f3173r;
                        fE = e23 != null ? e23.e(this) : 0.0f;
                        if (f6.f3357h == null) {
                            f6.f3357h = new C0427s(Math.min(fD5, fD6), Math.min(fE2, fE), Math.abs(fD6 - fD5), Math.abs(fE - fE2));
                        }
                        Path path2 = new Path();
                        path2.moveTo(fD5, fE2);
                        path2.lineTo(fD6, fE);
                        R(f6);
                        g(f6);
                        f(f6, f6.f3357h);
                        boolean zF10 = F();
                        m(path2);
                        K(f6);
                        if (zF10) {
                            E(f6.f3357h);
                        }
                    }
                } else if (abstractC0403c0 instanceof P) {
                    P p6 = (P) abstractC0403c0;
                    T(p6, this.f3156c);
                    if (k() && V()) {
                        z0 z0Var5 = this.f3156c;
                        if (z0Var5.f3490c || z0Var5.f3489b) {
                            Matrix matrix10 = p6.f3149n;
                            if (matrix10 != null) {
                                this.f3154a.concat(matrix10);
                            }
                            if (p6.f3303o.length >= 2) {
                                Path pathA = A(p6);
                                R(p6);
                                g(p6);
                                f(p6, p6.f3357h);
                                boolean zF11 = F();
                                if (this.f3156c.f3489b) {
                                    l(p6, pathA);
                                }
                                if (this.f3156c.f3490c) {
                                    m(pathA);
                                }
                                K(p6);
                                if (zF11) {
                                    E(p6.f3357h);
                                }
                            }
                        }
                    }
                } else if (abstractC0403c0 instanceof O) {
                    O o6 = (O) abstractC0403c0;
                    T(o6, this.f3156c);
                    if (k() && V()) {
                        z0 z0Var6 = this.f3156c;
                        if (z0Var6.f3490c || z0Var6.f3489b) {
                            Matrix matrix11 = o6.f3149n;
                            if (matrix11 != null) {
                                this.f3154a.concat(matrix11);
                            }
                            if (o6.f3303o.length >= 2) {
                                Path pathA2 = A(o6);
                                R(o6);
                                int i7 = this.f3156c.f3488a.f3317G;
                                pathA2.setFillType((i7 == 0 || i7 != 2) ? Path.FillType.WINDING : Path.FillType.EVEN_ODD);
                                g(o6);
                                f(o6, o6.f3357h);
                                boolean zF12 = F();
                                if (this.f3156c.f3489b) {
                                    l(o6, pathA2);
                                }
                                if (this.f3156c.f3490c) {
                                    m(pathA2);
                                }
                                K(o6);
                                if (zF12) {
                                    E(o6.f3357h);
                                }
                            }
                        }
                    }
                } else if (abstractC0403c0 instanceof C0421l0) {
                    C0421l0 c0421l0 = (C0421l0) abstractC0403c0;
                    T(c0421l0, this.f3156c);
                    if (k()) {
                        Matrix matrix12 = c0421l0.f3404r;
                        if (matrix12 != null) {
                            this.f3154a.concat(matrix12);
                        }
                        ArrayList arrayList = c0421l0.f3419n;
                        float fD7 = (arrayList == null || arrayList.size() == 0) ? 0.0f : ((E) c0421l0.f3419n.get(0)).d(this);
                        ArrayList arrayList2 = c0421l0.f3420o;
                        float fE3 = (arrayList2 == null || arrayList2.size() == 0) ? 0.0f : ((E) c0421l0.f3420o.get(0)).e(this);
                        ArrayList arrayList3 = c0421l0.f3421p;
                        float fD8 = (arrayList3 == null || arrayList3.size() == 0) ? 0.0f : ((E) c0421l0.f3421p.get(0)).d(this);
                        ArrayList arrayList4 = c0421l0.f3422q;
                        if (arrayList4 != null && arrayList4.size() != 0) {
                            fE = ((E) c0421l0.f3422q.get(0)).e(this);
                        }
                        int iV = v();
                        if (iV != 1) {
                            float fD9 = d(c0421l0);
                            if (iV == 2) {
                                fD9 /= 2.0f;
                            }
                            fD7 -= fD9;
                        }
                        if (c0421l0.f3357h == null) {
                            y0 y0Var = new y0(this, fD7, fE3);
                            n(c0421l0, y0Var);
                            RectF rectF = (RectF) y0Var.l;
                            c0421l0.f3357h = new C0427s(rectF.left, rectF.top, rectF.width(), ((RectF) y0Var.l).height());
                        }
                        R(c0421l0);
                        g(c0421l0);
                        f(c0421l0, c0421l0.f3357h);
                        boolean zF13 = F();
                        n(c0421l0, new x0(this, fD7 + fD8, fE3 + fE));
                        if (zF13) {
                            E(c0421l0.f3357h);
                        }
                    }
                }
            }
        }
        O();
    }

    public final void I(X x6, boolean z6) {
        if (z6) {
            this.f3158e.push(x6);
            this.f3159f.push(this.f3154a.getMatrix());
        }
        Iterator it = x6.f3353i.iterator();
        while (it.hasNext()) {
            H((AbstractC0403c0) it.next());
        }
        if (z6) {
            this.f3158e.pop();
            this.f3159f.pop();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x0033  */
    /* JADX WARN: Removed duplicated region for block: B:65:0x00f3  */
    /* JADX WARN: Removed duplicated region for block: B:67:0x00f7  */
    /* JADX WARN: Removed duplicated region for block: B:68:0x00fb A[PHI: r1
      0x00fb: PHI (r1v1 float) = (r1v0 float), (r1v2 float) binds: [B:63:0x00ef, B:66:0x00f5] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:70:0x0107  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void J(G g6, u0 u0Var) {
        float fFloatValue;
        float f6;
        float f7;
        float f8;
        P();
        Float f9 = g6.f3180u;
        float f10 = 0.0f;
        if (f9 == null) {
            fFloatValue = 0.0f;
        } else if (Float.isNaN(f9.floatValue())) {
            float f11 = u0Var.f3462c;
            if (f11 != 0.0f || u0Var.f3463d != 0.0f) {
                fFloatValue = (float) Math.toDegrees(Math.atan2(u0Var.f3463d, f11));
            }
        } else {
            fFloatValue = g6.f3180u.floatValue();
        }
        float fC = g6.f3175p ? 1.0f : this.f3156c.f3488a.f3332f.c();
        this.f3156c = t(g6);
        Matrix matrix = new Matrix();
        matrix.preTranslate(u0Var.f3460a, u0Var.f3461b);
        matrix.preRotate(fFloatValue);
        matrix.preScale(fC, fC);
        E e6 = g6.f3176q;
        float fD = e6 != null ? e6.d(this) : 0.0f;
        E e7 = g6.f3177r;
        float fE = e7 != null ? e7.e(this) : 0.0f;
        E e8 = g6.f3178s;
        float fD2 = e8 != null ? e8.d(this) : 3.0f;
        E e9 = g6.f3179t;
        float fE2 = e9 != null ? e9.e(this) : 3.0f;
        C0427s c0427s = g6.f3387o;
        Canvas canvas = this.f3154a;
        if (c0427s != null) {
            float fMax = fD2 / c0427s.f3446d;
            float f12 = fE2 / c0427s.f3447e;
            r rVar = g6.f3375n;
            if (rVar == null) {
                rVar = r.f3435d;
            }
            if (!rVar.equals(r.f3434c)) {
                fMax = rVar.f3437b == 2 ? Math.max(fMax, f12) : Math.min(fMax, f12);
                f12 = fMax;
            }
            matrix.preTranslate((-fD) * fMax, (-fE) * f12);
            canvas.concat(matrix);
            C0427s c0427s2 = g6.f3387o;
            float f13 = c0427s2.f3446d * fMax;
            float f14 = c0427s2.f3447e * f12;
            EnumC0426q enumC0426q = rVar.f3436a;
            int iOrdinal = enumC0426q.ordinal();
            if (iOrdinal == 2) {
                f6 = (fD2 - f13) / 2.0f;
                f7 = 0.0f - f6;
                switch (enumC0426q.ordinal()) {
                    case 4:
                    case 5:
                    case 6:
                        f8 = (fE2 - f14) / 2.0f;
                        f10 = 0.0f - f8;
                        if (!this.f3156c.f3488a.f3340r.booleanValue()) {
                            M(f7, f10, fD2, fE2);
                        }
                        matrix.reset();
                        matrix.preScale(fMax, f12);
                        canvas.concat(matrix);
                        break;
                    case 7:
                    case 8:
                    case 9:
                        f8 = fE2 - f14;
                        f10 = 0.0f - f8;
                        if (!this.f3156c.f3488a.f3340r.booleanValue()) {
                        }
                        matrix.reset();
                        matrix.preScale(fMax, f12);
                        canvas.concat(matrix);
                        break;
                    default:
                        if (!this.f3156c.f3488a.f3340r.booleanValue()) {
                        }
                        matrix.reset();
                        matrix.preScale(fMax, f12);
                        canvas.concat(matrix);
                        break;
                }
            } else {
                if (iOrdinal != 3) {
                    if (iOrdinal != 5) {
                        if (iOrdinal != 6) {
                            if (iOrdinal != 8) {
                                if (iOrdinal != 9) {
                                    f7 = 0.0f;
                                    switch (enumC0426q.ordinal()) {
                                    }
                                }
                            }
                        }
                    }
                    f6 = (fD2 - f13) / 2.0f;
                    f7 = 0.0f - f6;
                    switch (enumC0426q.ordinal()) {
                    }
                }
                f6 = fD2 - f13;
                f7 = 0.0f - f6;
                switch (enumC0426q.ordinal()) {
                }
            }
        } else {
            matrix.preTranslate(-fD, -fE);
            canvas.concat(matrix);
            if (!this.f3156c.f3488a.f3340r.booleanValue()) {
                M(0.0f, 0.0f, fD2, fE2);
            }
        }
        boolean zF = F();
        I(g6, false);
        if (zF) {
            E(g6.f3357h);
        }
        O();
    }

    public final void K(A a6) {
        G g6;
        G g7;
        G g8;
        int i6;
        float f6;
        float f7;
        float f8;
        ArrayList arrayList;
        int size;
        U u6 = this.f3156c.f3488a;
        String str = u6.f3342t;
        if (str == null && u6.f3343u == null && u6.f3344v == null) {
            return;
        }
        if (str == null) {
            g6 = null;
        } else {
            AbstractC0399a0 abstractC0399a0N = a6.f3370a.N(str);
            if (abstractC0399a0N != null) {
                g6 = (G) abstractC0399a0N;
            } else {
                o("Marker reference '%s' not found", this.f3156c.f3488a.f3342t);
                g6 = null;
            }
        }
        String str2 = this.f3156c.f3488a.f3343u;
        if (str2 == null) {
            g7 = null;
        } else {
            AbstractC0399a0 abstractC0399a0N2 = a6.f3370a.N(str2);
            if (abstractC0399a0N2 != null) {
                g7 = (G) abstractC0399a0N2;
            } else {
                o("Marker reference '%s' not found", this.f3156c.f3488a.f3343u);
                g7 = null;
            }
        }
        String str3 = this.f3156c.f3488a.f3344v;
        if (str3 == null) {
            g8 = null;
        } else {
            AbstractC0399a0 abstractC0399a0N3 = a6.f3370a.N(str3);
            if (abstractC0399a0N3 != null) {
                g8 = (G) abstractC0399a0N3;
            } else {
                o("Marker reference '%s' not found", this.f3156c.f3488a.f3344v);
                g8 = null;
            }
        }
        float f9 = 0.0f;
        if (a6 instanceof K) {
            arrayList = new t0(this, ((K) a6).f3279o).f3451a;
            f7 = 0.0f;
            i6 = 1;
        } else if (a6 instanceof F) {
            F f10 = (F) a6;
            E e6 = f10.f3170o;
            float fD = e6 != null ? e6.d(this) : 0.0f;
            E e7 = f10.f3171p;
            float fE = e7 != null ? e7.e(this) : 0.0f;
            E e8 = f10.f3172q;
            float fD2 = e8 != null ? e8.d(this) : 0.0f;
            E e9 = f10.f3173r;
            float fE2 = e9 != null ? e9.e(this) : 0.0f;
            ArrayList arrayList2 = new ArrayList(2);
            float f11 = fD2 - fD;
            i6 = 1;
            float f12 = fE2 - fE;
            arrayList2.add(new u0(fD, fE, f11, f12));
            arrayList2.add(new u0(fD2, fE2, f11, f12));
            f7 = 0.0f;
            arrayList = arrayList2;
        } else {
            i6 = 1;
            O o6 = (O) a6;
            int length = o6.f3303o.length;
            if (length < 2) {
                arrayList = null;
                f7 = 0.0f;
            } else {
                ArrayList arrayList3 = new ArrayList();
                float[] fArr = o6.f3303o;
                u0 u0Var = new u0(fArr[0], fArr[1], 0.0f, 0.0f);
                int i7 = 2;
                float f13 = 0.0f;
                float f14 = 0.0f;
                while (true) {
                    f6 = u0Var.f3461b;
                    f7 = f9;
                    f8 = u0Var.f3460a;
                    if (i7 >= length) {
                        break;
                    }
                    float[] fArr2 = o6.f3303o;
                    float f15 = fArr2[i7];
                    float f16 = fArr2[i7 + 1];
                    u0Var.a(f15, f16);
                    arrayList3.add(u0Var);
                    u0Var = new u0(f15, f16, f15 - f8, f16 - f6);
                    i7 += 2;
                    f14 = f16;
                    f13 = f15;
                    f9 = f7;
                }
                if (o6 instanceof P) {
                    float[] fArr3 = o6.f3303o;
                    float f17 = fArr3[0];
                    if (f13 != f17) {
                        float f18 = fArr3[1];
                        if (f14 != f18) {
                            u0Var.a(f17, f18);
                            arrayList3.add(u0Var);
                            u0 u0Var2 = new u0(f17, f18, f17 - f8, f18 - f6);
                            u0Var2.b((u0) arrayList3.get(0));
                            arrayList3.add(u0Var2);
                            arrayList3.set(0, u0Var2);
                        }
                    }
                } else {
                    arrayList3.add(u0Var);
                }
                arrayList = arrayList3;
            }
        }
        if (arrayList == null || (size = arrayList.size()) == 0) {
            return;
        }
        U u7 = this.f3156c.f3488a;
        u7.f3344v = null;
        u7.f3343u = null;
        u7.f3342t = null;
        if (g6 != null) {
            J(g6, (u0) arrayList.get(0));
        }
        if (g7 != null && arrayList.size() > 2) {
            u0 u0Var3 = (u0) arrayList.get(0);
            u0 u0Var4 = (u0) arrayList.get(i6);
            int i8 = 1;
            while (i8 < size - 1) {
                i8++;
                u0 u0Var5 = (u0) arrayList.get(i8);
                if (u0Var4.f3464e) {
                    float f19 = u0Var4.f3462c;
                    float f20 = u0Var4.f3463d;
                    float f21 = u0Var3.f3460a;
                    float f22 = u0Var4.f3460a;
                    float f23 = u0Var4.f3461b;
                    float f24 = ((f23 - u0Var3.f3461b) * f20) + ((f22 - f21) * f19);
                    if (f24 == f7) {
                        f24 = ((u0Var5.f3460a - f22) * f19) + ((u0Var5.f3461b - f23) * f20);
                    }
                    if (f24 <= f7 && (f24 != f7 || (f19 <= f7 && f20 < f7))) {
                        u0Var4.f3462c = -f19;
                        u0Var4.f3463d = -f20;
                    }
                }
                J(g7, u0Var4);
                u0Var3 = u0Var4;
                u0Var4 = u0Var5;
            }
        }
        if (g8 != null) {
            J(g8, (u0) arrayList.get(size - 1));
        }
    }

    public final void L(H h5, C0427s c0427s) {
        float fD;
        float fE;
        Boolean bool = h5.f3182n;
        if (bool == null || !bool.booleanValue()) {
            E e6 = h5.f3184p;
            float fB = e6 != null ? e6.b(this, 1.0f) : 1.2f;
            E e7 = h5.f3185q;
            float fB2 = e7 != null ? e7.b(this, 1.0f) : 1.2f;
            fD = fB * c0427s.f3446d;
            fE = fB2 * c0427s.f3447e;
        } else {
            E e8 = h5.f3184p;
            fD = e8 != null ? e8.d(this) : c0427s.f3446d;
            E e9 = h5.f3185q;
            fE = e9 != null ? e9.e(this) : c0427s.f3447e;
        }
        if (fD == 0.0f || fE == 0.0f) {
            return;
        }
        P();
        z0 z0VarT = t(h5);
        this.f3156c = z0VarT;
        z0VarT.f3488a.f3335m = Float.valueOf(1.0f);
        boolean zF = F();
        Canvas canvas = this.f3154a;
        canvas.save();
        Boolean bool2 = h5.f3183o;
        if (bool2 != null && !bool2.booleanValue()) {
            canvas.translate(c0427s.f3444b, c0427s.f3445c);
            canvas.scale(c0427s.f3446d, c0427s.f3447e);
        }
        I(h5, false);
        canvas.restore();
        if (zF) {
            E(c0427s);
        }
        O();
    }

    public final void M(float f6, float f7, float f8, float f9) {
        float fD = f8 + f6;
        float fE = f9 + f7;
        C0.J j4 = this.f3156c.f3488a.f3341s;
        if (j4 != null) {
            f6 += ((E) j4.f536e).d(this);
            f7 += ((E) this.f3156c.f3488a.f3341s.f533b).e(this);
            fD -= ((E) this.f3156c.f3488a.f3341s.f534c).d(this);
            fE -= ((E) this.f3156c.f3488a.f3341s.f535d).e(this);
        }
        this.f3154a.clipRect(f6, f7, fD, fE);
    }

    public final void O() {
        this.f3154a.restore();
        this.f3156c = (z0) this.f3157d.pop();
    }

    public final void P() {
        this.f3154a.save();
        this.f3157d.push(this.f3156c);
        this.f3156c = new z0(this.f3156c);
    }

    public final String Q(String str, boolean z6, boolean z7) {
        if (this.f3156c.f3495h) {
            return str.replaceAll("[\\n\\t]", " ");
        }
        String strReplaceAll = str.replaceAll("\\n", "").replaceAll("\\t", " ");
        if (z6) {
            strReplaceAll = strReplaceAll.replaceAll("^\\s+", "");
        }
        if (z7) {
            strReplaceAll = strReplaceAll.replaceAll("\\s+$", "");
        }
        return strReplaceAll.replaceAll("\\s{2,}", " ");
    }

    public final void R(Z z6) {
        if (z6.f3371b == null || z6.f3357h == null) {
            return;
        }
        Matrix matrix = new Matrix();
        if (((Matrix) this.f3159f.peek()).invert(matrix)) {
            C0427s c0427s = z6.f3357h;
            float f6 = c0427s.f3444b;
            float f7 = c0427s.f3445c;
            float fC = c0427s.c();
            C0427s c0427s2 = z6.f3357h;
            float f8 = c0427s2.f3445c;
            float fC2 = c0427s2.c();
            float fD = z6.f3357h.d();
            C0427s c0427s3 = z6.f3357h;
            float[] fArr = {f6, f7, fC, f8, fC2, fD, c0427s3.f3444b, c0427s3.d()};
            matrix.preConcat(this.f3154a.getMatrix());
            matrix.mapPoints(fArr);
            float f9 = fArr[0];
            float f10 = fArr[1];
            RectF rectF = new RectF(f9, f10, f9, f10);
            for (int i6 = 2; i6 <= 6; i6 += 2) {
                float f11 = fArr[i6];
                if (f11 < rectF.left) {
                    rectF.left = f11;
                }
                if (f11 > rectF.right) {
                    rectF.right = f11;
                }
                float f12 = fArr[i6 + 1];
                if (f12 < rectF.top) {
                    rectF.top = f12;
                }
                if (f12 > rectF.bottom) {
                    rectF.bottom = f12;
                }
            }
            Z z7 = (Z) this.f3158e.peek();
            C0427s c0427s4 = z7.f3357h;
            if (c0427s4 == null) {
                float f13 = rectF.left;
                float f14 = rectF.top;
                z7.f3357h = new C0427s(f13, f14, rectF.right - f13, rectF.bottom - f14);
                return;
            }
            float f15 = rectF.left;
            float f16 = rectF.top;
            float f17 = rectF.right - f15;
            float f18 = rectF.bottom - f16;
            if (f15 < c0427s4.f3444b) {
                c0427s4.f3444b = f15;
            }
            if (f16 < c0427s4.f3445c) {
                c0427s4.f3445c = f16;
            }
            if (f15 + f17 > c0427s4.c()) {
                c0427s4.f3446d = (f15 + f17) - c0427s4.f3444b;
            }
            if (f16 + f18 > c0427s4.d()) {
                c0427s4.f3447e = (f16 + f18) - c0427s4.f3445c;
            }
        }
    }

    public final void S(z0 z0Var, U u6) {
        U u7;
        if (x(u6, 4096L)) {
            z0Var.f3488a.f3336n = u6.f3336n;
        }
        if (x(u6, 2048L)) {
            z0Var.f3488a.f3335m = u6.f3335m;
        }
        boolean zX = x(u6, 1L);
        C0430v c0430v = C0430v.f3466c;
        if (zX) {
            z0Var.f3488a.f3328b = u6.f3328b;
            AbstractC0405d0 abstractC0405d0 = u6.f3328b;
            z0Var.f3489b = (abstractC0405d0 == null || abstractC0405d0 == c0430v) ? false : true;
        }
        if (x(u6, 4L)) {
            z0Var.f3488a.f3329c = u6.f3329c;
        }
        if (x(u6, 6149L)) {
            N(z0Var, true, z0Var.f3488a.f3328b);
        }
        if (x(u6, 2L)) {
            z0Var.f3488a.f3317G = u6.f3317G;
        }
        if (x(u6, 8L)) {
            z0Var.f3488a.f3330d = u6.f3330d;
            AbstractC0405d0 abstractC0405d02 = u6.f3330d;
            z0Var.f3490c = (abstractC0405d02 == null || abstractC0405d02 == c0430v) ? false : true;
        }
        if (x(u6, 16L)) {
            z0Var.f3488a.f3331e = u6.f3331e;
        }
        if (x(u6, 6168L)) {
            N(z0Var, false, z0Var.f3488a.f3330d);
        }
        if (x(u6, 34359738368L)) {
            z0Var.f3488a.f3325O = u6.f3325O;
        }
        if (x(u6, 32L)) {
            U u8 = z0Var.f3488a;
            E e6 = u6.f3332f;
            u8.f3332f = e6;
            z0Var.f3492e.setStrokeWidth(e6.a(this));
        }
        if (x(u6, 64L)) {
            z0Var.f3488a.f3318H = u6.f3318H;
            int iC = AbstractC2464a.c(u6.f3318H);
            Paint paint = z0Var.f3492e;
            if (iC == 0) {
                paint.setStrokeCap(Paint.Cap.BUTT);
            } else if (iC == 1) {
                paint.setStrokeCap(Paint.Cap.ROUND);
            } else if (iC == 2) {
                paint.setStrokeCap(Paint.Cap.SQUARE);
            }
        }
        if (x(u6, 128L)) {
            z0Var.f3488a.f3319I = u6.f3319I;
            int iC2 = AbstractC2464a.c(u6.f3319I);
            Paint paint2 = z0Var.f3492e;
            if (iC2 == 0) {
                paint2.setStrokeJoin(Paint.Join.MITER);
            } else if (iC2 == 1) {
                paint2.setStrokeJoin(Paint.Join.ROUND);
            } else if (iC2 == 2) {
                paint2.setStrokeJoin(Paint.Join.BEVEL);
            }
        }
        if (x(u6, 256L)) {
            z0Var.f3488a.f3333j = u6.f3333j;
            z0Var.f3492e.setStrokeMiter(u6.f3333j.floatValue());
        }
        if (x(u6, 512L)) {
            z0Var.f3488a.f3334k = u6.f3334k;
        }
        if (x(u6, 1024L)) {
            z0Var.f3488a.l = u6.l;
        }
        Typeface typefaceH = null;
        if (x(u6, 1536L)) {
            E[] eArr = z0Var.f3488a.f3334k;
            Paint paint3 = z0Var.f3492e;
            if (eArr == null) {
                paint3.setPathEffect(null);
            } else {
                int length = eArr.length;
                int i6 = length % 2 == 0 ? length : length * 2;
                float[] fArr = new float[i6];
                int i7 = 0;
                float f6 = 0.0f;
                while (true) {
                    u7 = z0Var.f3488a;
                    if (i7 >= i6) {
                        break;
                    }
                    float fA = u7.f3334k[i7 % length].a(this);
                    fArr[i7] = fA;
                    f6 += fA;
                    i7++;
                }
                if (f6 == 0.0f) {
                    paint3.setPathEffect(null);
                } else {
                    float fA2 = u7.l.a(this);
                    if (fA2 < 0.0f) {
                        fA2 = (fA2 % f6) + f6;
                    }
                    paint3.setPathEffect(new DashPathEffect(fArr, fA2));
                }
            }
        }
        if (x(u6, 16384L)) {
            float textSize = this.f3156c.f3491d.getTextSize();
            z0Var.f3488a.f3338p = u6.f3338p;
            z0Var.f3491d.setTextSize(u6.f3338p.b(this, textSize));
            z0Var.f3492e.setTextSize(u6.f3338p.b(this, textSize));
        }
        if (x(u6, 8192L)) {
            z0Var.f3488a.f3337o = u6.f3337o;
        }
        if (x(u6, 32768L)) {
            if (u6.f3339q.intValue() == -1 && z0Var.f3488a.f3339q.intValue() > 100) {
                U u9 = z0Var.f3488a;
                u9.f3339q = Integer.valueOf(u9.f3339q.intValue() - 100);
            } else if (u6.f3339q.intValue() != 1 || z0Var.f3488a.f3339q.intValue() >= 900) {
                z0Var.f3488a.f3339q = u6.f3339q;
            } else {
                U u10 = z0Var.f3488a;
                u10.f3339q = Integer.valueOf(u10.f3339q.intValue() + 100);
            }
        }
        if (x(u6, 65536L)) {
            z0Var.f3488a.f3320J = u6.f3320J;
        }
        if (x(u6, 106496L)) {
            U u11 = z0Var.f3488a;
            ArrayList arrayList = u11.f3337o;
            if (arrayList != null) {
                Iterator it = arrayList.iterator();
                while (it.hasNext()) {
                    typefaceH = h((String) it.next(), u11.f3320J, u11.f3339q);
                    if (typefaceH != null) {
                        break;
                    }
                }
            }
            if (typefaceH == null) {
                typefaceH = h(androidx.media3.common.C.SERIF_NAME, u11.f3320J, u11.f3339q);
            }
            z0Var.f3491d.setTypeface(typefaceH);
            z0Var.f3492e.setTypeface(typefaceH);
        }
        if (x(u6, 131072L)) {
            z0Var.f3488a.f3321K = u6.f3321K;
            Paint paint4 = z0Var.f3491d;
            paint4.setStrikeThruText(u6.f3321K == 4);
            paint4.setUnderlineText(u6.f3321K == 2);
            Paint paint5 = z0Var.f3492e;
            paint5.setStrikeThruText(u6.f3321K == 4);
            paint5.setUnderlineText(u6.f3321K == 2);
        }
        if (x(u6, 68719476736L)) {
            z0Var.f3488a.f3322L = u6.f3322L;
        }
        if (x(u6, 262144L)) {
            z0Var.f3488a.f3323M = u6.f3323M;
        }
        if (x(u6, 524288L)) {
            z0Var.f3488a.f3340r = u6.f3340r;
        }
        if (x(u6, 2097152L)) {
            z0Var.f3488a.f3342t = u6.f3342t;
        }
        if (x(u6, 4194304L)) {
            z0Var.f3488a.f3343u = u6.f3343u;
        }
        if (x(u6, 8388608L)) {
            z0Var.f3488a.f3344v = u6.f3344v;
        }
        if (x(u6, 16777216L)) {
            z0Var.f3488a.f3345w = u6.f3345w;
        }
        if (x(u6, 33554432L)) {
            z0Var.f3488a.f3346x = u6.f3346x;
        }
        if (x(u6, 1048576L)) {
            z0Var.f3488a.f3341s = u6.f3341s;
        }
        if (x(u6, 268435456L)) {
            z0Var.f3488a.f3311A = u6.f3311A;
        }
        if (x(u6, 536870912L)) {
            z0Var.f3488a.f3324N = u6.f3324N;
        }
        if (x(u6, 1073741824L)) {
            z0Var.f3488a.f3312B = u6.f3312B;
        }
        if (x(u6, 67108864L)) {
            z0Var.f3488a.f3347y = u6.f3347y;
        }
        if (x(u6, 134217728L)) {
            z0Var.f3488a.f3348z = u6.f3348z;
        }
        if (x(u6, 8589934592L)) {
            z0Var.f3488a.f3315E = u6.f3315E;
        }
        if (x(u6, 17179869184L)) {
            z0Var.f3488a.f3316F = u6.f3316F;
        }
        if (x(u6, 137438953472L)) {
            z0Var.f3488a.f3326P = u6.f3326P;
        }
    }

    public final void T(AbstractC0399a0 abstractC0399a0, z0 z0Var) {
        boolean z6 = abstractC0399a0.f3371b == null;
        U u6 = z0Var.f3488a;
        Boolean bool = Boolean.TRUE;
        u6.f3345w = bool;
        if (!z6) {
            bool = Boolean.FALSE;
        }
        u6.f3340r = bool;
        u6.f3341s = null;
        u6.f3311A = null;
        u6.f3335m = Float.valueOf(1.0f);
        u6.f3347y = C0430v.f3465b;
        u6.f3348z = Float.valueOf(1.0f);
        u6.f3312B = null;
        u6.f3313C = null;
        u6.f3314D = Float.valueOf(1.0f);
        u6.f3315E = null;
        u6.f3316F = Float.valueOf(1.0f);
        u6.f3325O = 1;
        U u7 = abstractC0399a0.f3360e;
        if (u7 != null) {
            S(z0Var, u7);
        }
        ArrayList arrayList = ((C0334s) this.f3155b.f742c).f2658b;
        if (arrayList != null && !arrayList.isEmpty()) {
            for (C0420l c0420l : ((C0334s) this.f3155b.f742c).f2658b) {
                if (C0325i.g(c0420l.f3401a, abstractC0399a0)) {
                    S(z0Var, c0420l.f3402b);
                }
            }
        }
        U u8 = abstractC0399a0.f3361f;
        if (u8 != null) {
            S(z0Var, u8);
        }
    }

    public final void U() {
        int i6;
        U u6 = this.f3156c.f3488a;
        AbstractC0405d0 abstractC0405d0 = u6.f3315E;
        if (abstractC0405d0 instanceof C0430v) {
            i6 = ((C0430v) abstractC0405d0).f3467a;
        } else if (!(abstractC0405d0 instanceof C0431w)) {
            return;
        } else {
            i6 = u6.f3336n.f3467a;
        }
        Float f6 = u6.f3316F;
        if (f6 != null) {
            i6 = i(f6.floatValue(), i6);
        }
        this.f3154a.drawColor(i6);
    }

    public final boolean V() {
        Boolean bool = this.f3156c.f3488a.f3346x;
        if (bool != null) {
            return bool.booleanValue();
        }
        return true;
    }

    public final Path b(Z z6, C0427s c0427s) {
        Path pathD;
        AbstractC0399a0 abstractC0399a0N = z6.f3370a.N(this.f3156c.f3488a.f3311A);
        if (abstractC0399a0N == null) {
            o("ClipPath reference '%s' not found", this.f3156c.f3488a.f3311A);
            return null;
        }
        C0429u c0429u = (C0429u) abstractC0399a0N;
        this.f3157d.push(this.f3156c);
        this.f3156c = t(c0429u);
        Boolean bool = c0429u.f3459o;
        boolean z7 = bool == null || bool.booleanValue();
        Matrix matrix = new Matrix();
        if (!z7) {
            matrix.preTranslate(c0427s.f3444b, c0427s.f3445c);
            matrix.preScale(c0427s.f3446d, c0427s.f3447e);
        }
        Matrix matrix2 = c0429u.f3152n;
        if (matrix2 != null) {
            matrix.preConcat(matrix2);
        }
        Path path = new Path();
        for (AbstractC0403c0 abstractC0403c0 : c0429u.f3353i) {
            if ((abstractC0403c0 instanceof Z) && (pathD = D((Z) abstractC0403c0, true)) != null) {
                path.op(pathD, Path.Op.UNION);
            }
        }
        if (this.f3156c.f3488a.f3311A != null) {
            if (c0429u.f3357h == null) {
                c0429u.f3357h = c(path);
            }
            Path pathB = b(c0429u, c0429u.f3357h);
            if (pathB != null) {
                path.op(pathB, Path.Op.INTERSECT);
            }
        }
        path.transform(matrix);
        this.f3156c = (z0) this.f3157d.pop();
        return path;
    }

    public final float d(n0 n0Var) {
        A0 a02 = new A0(this);
        n(n0Var, a02);
        return a02.f3150h;
    }

    public final void f(Z z6, C0427s c0427s) {
        Path pathB;
        if (this.f3156c.f3488a.f3311A == null || (pathB = b(z6, c0427s)) == null) {
            return;
        }
        this.f3154a.clipPath(pathB);
    }

    public final void g(Z z6) {
        AbstractC0405d0 abstractC0405d0 = this.f3156c.f3488a.f3328b;
        if (abstractC0405d0 instanceof J) {
            j(true, z6.f3357h, (J) abstractC0405d0);
        }
        AbstractC0405d0 abstractC0405d02 = this.f3156c.f3488a.f3330d;
        if (abstractC0405d02 instanceof J) {
            j(false, z6.f3357h, (J) abstractC0405d02);
        }
    }

    public final void j(boolean z6, C0427s c0427s, J j4) {
        float fB;
        float f6;
        float fB2;
        float f7;
        float f8;
        float fB3;
        float fB4;
        float f9;
        float f10;
        AbstractC0399a0 abstractC0399a0N = this.f3155b.N(j4.f3271a);
        if (abstractC0399a0N == null) {
            o("%s reference '%s' not found", z6 ? "Fill" : "Stroke", j4.f3271a);
            AbstractC0405d0 abstractC0405d0 = j4.f3272b;
            if (abstractC0405d0 != null) {
                N(this.f3156c, z6, abstractC0405d0);
                return;
            } else if (z6) {
                this.f3156c.f3489b = false;
                return;
            } else {
                this.f3156c.f3490c = false;
                return;
            }
        }
        boolean z7 = abstractC0399a0N instanceof C0401b0;
        C0430v c0430v = C0430v.f3465b;
        if (z7) {
            C0401b0 c0401b0 = (C0401b0) abstractC0399a0N;
            String str = c0401b0.l;
            if (str != null) {
                q(c0401b0, str);
            }
            Boolean bool = c0401b0.f3485i;
            boolean z8 = bool != null && bool.booleanValue();
            z0 z0Var = this.f3156c;
            Paint paint = z6 ? z0Var.f3491d : z0Var.f3492e;
            if (z8) {
                z0 z0Var2 = this.f3156c;
                f7 = 256.0f;
                C0427s c0427s2 = z0Var2.f3494g;
                if (c0427s2 == null) {
                    c0427s2 = z0Var2.f3493f;
                }
                E e6 = c0401b0.f3366m;
                float fD = e6 != null ? e6.d(this) : 0.0f;
                E e7 = c0401b0.f3367n;
                fB3 = e7 != null ? e7.e(this) : 0.0f;
                f8 = 0.0f;
                E e8 = c0401b0.f3368o;
                float fD2 = e8 != null ? e8.d(this) : c0427s2.f3446d;
                E e9 = c0401b0.f3369p;
                f10 = fD2;
                f9 = fD;
                fB4 = e9 != null ? e9.e(this) : 0.0f;
            } else {
                f7 = 256.0f;
                f8 = 0.0f;
                E e10 = c0401b0.f3366m;
                float fB5 = e10 != null ? e10.b(this, 1.0f) : 0.0f;
                E e11 = c0401b0.f3367n;
                fB3 = e11 != null ? e11.b(this, 1.0f) : 0.0f;
                E e12 = c0401b0.f3368o;
                float fB6 = e12 != null ? e12.b(this, 1.0f) : 1.0f;
                E e13 = c0401b0.f3369p;
                fB4 = e13 != null ? e13.b(this, 1.0f) : 0.0f;
                f9 = fB5;
                f10 = fB6;
            }
            float f11 = fB3;
            P();
            this.f3156c = t(c0401b0);
            Matrix matrix = new Matrix();
            if (!z8) {
                matrix.preTranslate(c0427s.f3444b, c0427s.f3445c);
                matrix.preScale(c0427s.f3446d, c0427s.f3447e);
            }
            Matrix matrix2 = c0401b0.f3486j;
            if (matrix2 != null) {
                matrix.preConcat(matrix2);
            }
            int size = c0401b0.f3484h.size();
            if (size == 0) {
                O();
                if (z6) {
                    this.f3156c.f3489b = false;
                    return;
                } else {
                    this.f3156c.f3490c = false;
                    return;
                }
            }
            int[] iArr = new int[size];
            float[] fArr = new float[size];
            Iterator it = c0401b0.f3484h.iterator();
            int i6 = 0;
            float f12 = -1.0f;
            while (it.hasNext()) {
                T t6 = (T) ((AbstractC0403c0) it.next());
                Float f13 = t6.f3310h;
                float fFloatValue = f13 != null ? f13.floatValue() : f8;
                if (i6 == 0 || fFloatValue >= f12) {
                    fArr[i6] = fFloatValue;
                    f12 = fFloatValue;
                } else {
                    fArr[i6] = f12;
                }
                P();
                T(t6, this.f3156c);
                U u6 = this.f3156c.f3488a;
                C0430v c0430v2 = (C0430v) u6.f3347y;
                if (c0430v2 == null) {
                    c0430v2 = c0430v;
                }
                iArr[i6] = i(u6.f3348z.floatValue(), c0430v2.f3467a);
                i6++;
                O();
            }
            if ((f9 == f10 && f11 == fB4) || size == 1) {
                O();
                paint.setColor(iArr[size - 1]);
                return;
            }
            Shader.TileMode tileMode = Shader.TileMode.CLAMP;
            int i7 = c0401b0.f3487k;
            if (i7 != 0) {
                if (i7 == 2) {
                    tileMode = Shader.TileMode.MIRROR;
                } else if (i7 == 3) {
                    tileMode = Shader.TileMode.REPEAT;
                }
            }
            Shader.TileMode tileMode2 = tileMode;
            O();
            LinearGradient linearGradient = new LinearGradient(f9, f11, f10, fB4, iArr, fArr, tileMode2);
            linearGradient.setLocalMatrix(matrix);
            paint.setShader(linearGradient);
            int iFloatValue = (int) (this.f3156c.f3488a.f3329c.floatValue() * f7);
            paint.setAlpha(iFloatValue < 0 ? 0 : iFloatValue > 255 ? 255 : iFloatValue);
            return;
        }
        if (!(abstractC0399a0N instanceof C0409f0)) {
            if (abstractC0399a0N instanceof S) {
                S s6 = (S) abstractC0399a0N;
                if (z6) {
                    if (x(s6.f3360e, 2147483648L)) {
                        z0 z0Var3 = this.f3156c;
                        U u7 = z0Var3.f3488a;
                        AbstractC0405d0 abstractC0405d02 = s6.f3360e.f3313C;
                        u7.f3328b = abstractC0405d02;
                        z0Var3.f3489b = abstractC0405d02 != null;
                    }
                    if (x(s6.f3360e, 4294967296L)) {
                        this.f3156c.f3488a.f3329c = s6.f3360e.f3314D;
                    }
                    if (x(s6.f3360e, 6442450944L)) {
                        z0 z0Var4 = this.f3156c;
                        N(z0Var4, z6, z0Var4.f3488a.f3328b);
                        return;
                    }
                    return;
                }
                if (x(s6.f3360e, 2147483648L)) {
                    z0 z0Var5 = this.f3156c;
                    U u8 = z0Var5.f3488a;
                    AbstractC0405d0 abstractC0405d03 = s6.f3360e.f3313C;
                    u8.f3330d = abstractC0405d03;
                    z0Var5.f3490c = abstractC0405d03 != null;
                }
                if (x(s6.f3360e, 4294967296L)) {
                    this.f3156c.f3488a.f3331e = s6.f3360e.f3314D;
                }
                if (x(s6.f3360e, 6442450944L)) {
                    z0 z0Var6 = this.f3156c;
                    N(z0Var6, z6, z0Var6.f3488a.f3330d);
                    return;
                }
                return;
            }
            return;
        }
        C0409f0 c0409f0 = (C0409f0) abstractC0399a0N;
        String str2 = c0409f0.l;
        if (str2 != null) {
            q(c0409f0, str2);
        }
        Boolean bool2 = c0409f0.f3485i;
        boolean z9 = bool2 != null && bool2.booleanValue();
        z0 z0Var7 = this.f3156c;
        Paint paint2 = z6 ? z0Var7.f3491d : z0Var7.f3492e;
        if (z9) {
            E e14 = new E(50.0f, 9);
            E e15 = c0409f0.f3381m;
            float fD3 = e15 != null ? e15.d(this) : e14.d(this);
            E e16 = c0409f0.f3382n;
            fB = e16 != null ? e16.e(this) : e14.e(this);
            E e17 = c0409f0.f3383o;
            fB2 = e17 != null ? e17.a(this) : e14.a(this);
            f6 = fD3;
        } else {
            E e18 = c0409f0.f3381m;
            float fB7 = e18 != null ? e18.b(this, 1.0f) : 0.5f;
            E e19 = c0409f0.f3382n;
            fB = e19 != null ? e19.b(this, 1.0f) : 0.5f;
            E e20 = c0409f0.f3383o;
            f6 = fB7;
            fB2 = e20 != null ? e20.b(this, 1.0f) : 0.5f;
        }
        float f14 = fB;
        P();
        this.f3156c = t(c0409f0);
        Matrix matrix3 = new Matrix();
        if (!z9) {
            matrix3.preTranslate(c0427s.f3444b, c0427s.f3445c);
            matrix3.preScale(c0427s.f3446d, c0427s.f3447e);
        }
        Matrix matrix4 = c0409f0.f3486j;
        if (matrix4 != null) {
            matrix3.preConcat(matrix4);
        }
        int size2 = c0409f0.f3484h.size();
        if (size2 == 0) {
            O();
            if (z6) {
                this.f3156c.f3489b = false;
                return;
            } else {
                this.f3156c.f3490c = false;
                return;
            }
        }
        int[] iArr2 = new int[size2];
        float[] fArr2 = new float[size2];
        Iterator it2 = c0409f0.f3484h.iterator();
        int i8 = 0;
        float f15 = -1.0f;
        while (it2.hasNext()) {
            T t7 = (T) ((AbstractC0403c0) it2.next());
            Float f16 = t7.f3310h;
            float fFloatValue2 = f16 != null ? f16.floatValue() : 0.0f;
            if (i8 == 0 || fFloatValue2 >= f15) {
                fArr2[i8] = fFloatValue2;
                f15 = fFloatValue2;
            } else {
                fArr2[i8] = f15;
            }
            P();
            T(t7, this.f3156c);
            U u9 = this.f3156c.f3488a;
            C0430v c0430v3 = (C0430v) u9.f3347y;
            if (c0430v3 == null) {
                c0430v3 = c0430v;
            }
            iArr2[i8] = i(u9.f3348z.floatValue(), c0430v3.f3467a);
            i8++;
            O();
        }
        if (fB2 == 0.0f || size2 == 1) {
            O();
            paint2.setColor(iArr2[size2 - 1]);
            return;
        }
        Shader.TileMode tileMode3 = Shader.TileMode.CLAMP;
        int i9 = c0409f0.f3487k;
        if (i9 != 0) {
            if (i9 == 2) {
                tileMode3 = Shader.TileMode.MIRROR;
            } else if (i9 == 3) {
                tileMode3 = Shader.TileMode.REPEAT;
            }
        }
        Shader.TileMode tileMode4 = tileMode3;
        O();
        RadialGradient radialGradient = new RadialGradient(f6, f14, fB2, iArr2, fArr2, tileMode4);
        radialGradient.setLocalMatrix(matrix3);
        paint2.setShader(radialGradient);
        int iFloatValue2 = (int) (this.f3156c.f3488a.f3329c.floatValue() * 256.0f);
        if (iFloatValue2 < 0) {
            iFloatValue2 = 0;
        } else if (iFloatValue2 > 255) {
            iFloatValue2 = 255;
        }
        paint2.setAlpha(iFloatValue2);
    }

    public final boolean k() {
        Boolean bool = this.f3156c.f3488a.f3345w;
        if (bool != null) {
            return bool.booleanValue();
        }
        return true;
    }

    /* JADX WARN: Removed duplicated region for block: B:80:0x0176  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void l(Z z6, Path path) {
        char c6;
        float fD;
        float fE;
        float fE2;
        float fD2;
        char c7;
        float f6;
        float f7;
        AbstractC0405d0 abstractC0405d0 = this.f3156c.f3488a.f3328b;
        boolean z7 = abstractC0405d0 instanceof J;
        Canvas canvas = this.f3154a;
        if (z7) {
            AbstractC0399a0 abstractC0399a0N = this.f3155b.N(((J) abstractC0405d0).f3271a);
            if (abstractC0399a0N instanceof N) {
                N n6 = (N) abstractC0399a0N;
                Boolean bool = n6.f3295p;
                boolean z8 = bool != null && bool.booleanValue();
                String str = n6.f3302w;
                if (str != null) {
                    s(n6, str);
                }
                if (z8) {
                    E e6 = n6.f3298s;
                    fD = e6 != null ? e6.d(this) : 0.0f;
                    E e7 = n6.f3299t;
                    fE2 = e7 != null ? e7.e(this) : 0.0f;
                    E e8 = n6.f3300u;
                    fD2 = e8 != null ? e8.d(this) : 0.0f;
                    E e9 = n6.f3301v;
                    fE = e9 != null ? e9.e(this) : 0.0f;
                    c6 = 0;
                } else {
                    E e10 = n6.f3298s;
                    float fB = e10 != null ? e10.b(this, 1.0f) : 0.0f;
                    E e11 = n6.f3299t;
                    float fB2 = e11 != null ? e11.b(this, 1.0f) : 0.0f;
                    E e12 = n6.f3300u;
                    float fB3 = e12 != null ? e12.b(this, 1.0f) : 0.0f;
                    E e13 = n6.f3301v;
                    float fB4 = e13 != null ? e13.b(this, 1.0f) : 0.0f;
                    C0427s c0427s = z6.f3357h;
                    float f8 = c0427s.f3444b;
                    c6 = 0;
                    float f9 = c0427s.f3446d;
                    fD = (fB * f9) + f8;
                    float f10 = c0427s.f3445c;
                    float f11 = c0427s.f3447e;
                    float f12 = f9 * fB3;
                    fE = fB4 * f11;
                    fE2 = (fB2 * f11) + f10;
                    fD2 = f12;
                }
                if (fD2 == 0.0f || fE == 0.0f) {
                    return;
                }
                r rVar = n6.f3375n;
                if (rVar == null) {
                    rVar = r.f3435d;
                }
                P();
                canvas.clipPath(path);
                z0 z0Var = new z0();
                S(z0Var, U.a());
                z0Var.f3488a.f3340r = Boolean.FALSE;
                u(n6, z0Var);
                this.f3156c = z0Var;
                C0427s c0427s2 = z6.f3357h;
                Matrix matrix = n6.f3297r;
                if (matrix != null) {
                    canvas.concat(matrix);
                    Matrix matrix2 = new Matrix();
                    if (n6.f3297r.invert(matrix2)) {
                        C0427s c0427s3 = z6.f3357h;
                        float f13 = c0427s3.f3444b;
                        float f14 = c0427s3.f3445c;
                        float fC = c0427s3.c();
                        c7 = 1;
                        C0427s c0427s4 = z6.f3357h;
                        float f15 = c0427s4.f3445c;
                        float fC2 = c0427s4.c();
                        float fD3 = z6.f3357h.d();
                        C0427s c0427s5 = z6.f3357h;
                        float f16 = c0427s5.f3444b;
                        float fD4 = c0427s5.d();
                        float[] fArr = new float[8];
                        fArr[c6] = f13;
                        fArr[1] = f14;
                        fArr[2] = fC;
                        fArr[3] = f15;
                        fArr[4] = fC2;
                        fArr[5] = fD3;
                        fArr[6] = f16;
                        fArr[7] = fD4;
                        matrix2.mapPoints(fArr);
                        float f17 = fArr[c6];
                        float f18 = fArr[1];
                        RectF rectF = new RectF(f17, f18, f17, f18);
                        for (int i6 = 2; i6 <= 6; i6 += 2) {
                            float f19 = fArr[i6];
                            if (f19 < rectF.left) {
                                rectF.left = f19;
                            }
                            if (f19 > rectF.right) {
                                rectF.right = f19;
                            }
                            float f20 = fArr[i6 + 1];
                            if (f20 < rectF.top) {
                                rectF.top = f20;
                            }
                            if (f20 > rectF.bottom) {
                                rectF.bottom = f20;
                            }
                        }
                        float f21 = rectF.left;
                        float f22 = rectF.top;
                        c0427s2 = new C0427s(f21, f22, rectF.right - f21, rectF.bottom - f22);
                    } else {
                        c7 = 1;
                    }
                }
                float fFloor = (((float) Math.floor((c0427s2.f3444b - fD) / fD2)) * fD2) + fD;
                float fC3 = c0427s2.c();
                float fD5 = c0427s2.d();
                C0427s c0427s6 = new C0427s(0.0f, 0.0f, fD2, fE);
                boolean zF = F();
                for (float fFloor2 = (((float) Math.floor((c0427s2.f3445c - fE2) / fE)) * fE) + fE2; fFloor2 < fD5; fFloor2 += fE) {
                    float f23 = fFloor;
                    while (f23 < fC3) {
                        c0427s6.f3444b = f23;
                        c0427s6.f3445c = fFloor2;
                        P();
                        if (this.f3156c.f3488a.f3340r.booleanValue()) {
                            f6 = fD5;
                            f7 = fFloor;
                        } else {
                            f6 = fD5;
                            f7 = fFloor;
                            M(c0427s6.f3444b, c0427s6.f3445c, c0427s6.f3446d, c0427s6.f3447e);
                        }
                        C0427s c0427s7 = n6.f3387o;
                        if (c0427s7 != null) {
                            canvas.concat(e(c0427s6, c0427s7, rVar));
                        } else {
                            Boolean bool2 = n6.f3296q;
                            char c8 = (bool2 == null || bool2.booleanValue()) ? c7 : c6;
                            canvas.translate(f23, fFloor2);
                            if (c8 == 0) {
                                C0427s c0427s8 = z6.f3357h;
                                canvas.scale(c0427s8.f3446d, c0427s8.f3447e);
                            }
                        }
                        Iterator it = n6.f3353i.iterator();
                        while (it.hasNext()) {
                            H((AbstractC0403c0) it.next());
                        }
                        O();
                        f23 += fD2;
                        fD5 = f6;
                        fFloor = f7;
                    }
                }
                if (zF) {
                    E(n6.f3357h);
                }
                O();
                return;
            }
        }
        canvas.drawPath(path, this.f3156c.f3491d);
    }

    public final void m(Path path) {
        z0 z0Var = this.f3156c;
        int i6 = z0Var.f3488a.f3325O;
        Canvas canvas = this.f3154a;
        if (i6 != 2) {
            canvas.drawPath(path, z0Var.f3492e);
            return;
        }
        Matrix matrix = canvas.getMatrix();
        Path path2 = new Path();
        path.transform(matrix, path2);
        canvas.setMatrix(new Matrix());
        Shader shader = this.f3156c.f3492e.getShader();
        Matrix matrix2 = new Matrix();
        if (shader != null) {
            shader.getLocalMatrix(matrix2);
            Matrix matrix3 = new Matrix(matrix2);
            matrix3.postConcat(matrix);
            shader.setLocalMatrix(matrix3);
        }
        canvas.drawPath(path2, this.f3156c.f3492e);
        canvas.setMatrix(matrix);
        if (shader != null) {
            shader.setLocalMatrix(matrix2);
        }
    }

    public final void n(n0 n0Var, android.support.v4.media.session.b bVar) {
        float f6;
        float fE;
        float fD;
        int iV;
        if (k()) {
            Iterator it = n0Var.f3353i.iterator();
            boolean z6 = true;
            while (it.hasNext()) {
                AbstractC0403c0 abstractC0403c0 = (AbstractC0403c0) it.next();
                if (abstractC0403c0 instanceof q0) {
                    bVar.E(Q(((q0) abstractC0403c0).f3433c, z6, !it.hasNext()));
                } else if (bVar.l((n0) abstractC0403c0)) {
                    if (abstractC0403c0 instanceof o0) {
                        P();
                        o0 o0Var = (o0) abstractC0403c0;
                        T(o0Var, this.f3156c);
                        if (k() && V()) {
                            AbstractC0399a0 abstractC0399a0N = o0Var.f3370a.N(o0Var.f3413n);
                            if (abstractC0399a0N == null) {
                                o("TextPath reference '%s' not found", o0Var.f3413n);
                            } else {
                                K k6 = (K) abstractC0399a0N;
                                Path path = new v0(k6.f3279o).f3468a;
                                Matrix matrix = k6.f3149n;
                                if (matrix != null) {
                                    path.transform(matrix);
                                }
                                PathMeasure pathMeasure = new PathMeasure(path, false);
                                E e6 = o0Var.f3414o;
                                fE = e6 != null ? e6.b(this, pathMeasure.getLength()) : 0.0f;
                                int iV2 = v();
                                if (iV2 != 1) {
                                    float fD2 = d(o0Var);
                                    if (iV2 == 2) {
                                        fD2 /= 2.0f;
                                    }
                                    fE -= fD2;
                                }
                                g(o0Var.f3415p);
                                boolean zF = F();
                                n(o0Var, new w0(this, path, fE));
                                if (zF) {
                                    E(o0Var.f3357h);
                                }
                            }
                        }
                        O();
                    } else if (abstractC0403c0 instanceof C0419k0) {
                        P();
                        C0419k0 c0419k0 = (C0419k0) abstractC0403c0;
                        T(c0419k0, this.f3156c);
                        if (k()) {
                            ArrayList arrayList = c0419k0.f3419n;
                            boolean z7 = arrayList != null && arrayList.size() > 0;
                            boolean z8 = bVar instanceof x0;
                            if (z8) {
                                float fD3 = !z7 ? ((x0) bVar).f3473h : ((E) c0419k0.f3419n.get(0)).d(this);
                                ArrayList arrayList2 = c0419k0.f3420o;
                                fE = (arrayList2 == null || arrayList2.size() == 0) ? ((x0) bVar).f3474i : ((E) c0419k0.f3420o.get(0)).e(this);
                                ArrayList arrayList3 = c0419k0.f3421p;
                                fD = (arrayList3 == null || arrayList3.size() == 0) ? 0.0f : ((E) c0419k0.f3421p.get(0)).d(this);
                                ArrayList arrayList4 = c0419k0.f3422q;
                                if (arrayList4 != null && arrayList4.size() != 0) {
                                    fE = ((E) c0419k0.f3422q.get(0)).e(this);
                                }
                                float f7 = fD3;
                                f6 = fE;
                                fE = f7;
                            } else {
                                f6 = 0.0f;
                                fE = 0.0f;
                                fD = 0.0f;
                            }
                            if (z7 && (iV = v()) != 1) {
                                float fD4 = d(c0419k0);
                                if (iV == 2) {
                                    fD4 /= 2.0f;
                                }
                                fE -= fD4;
                            }
                            g(c0419k0.f3400r);
                            if (z8) {
                                x0 x0Var = (x0) bVar;
                                x0Var.f3473h = fE + fD;
                                x0Var.f3474i = fE + f6;
                            }
                            boolean zF2 = F();
                            n(c0419k0, bVar);
                            if (zF2) {
                                E(c0419k0.f3357h);
                            }
                        }
                        O();
                    } else if (abstractC0403c0 instanceof C0417j0) {
                        P();
                        C0417j0 c0417j0 = (C0417j0) abstractC0403c0;
                        T(c0417j0, this.f3156c);
                        if (k()) {
                            g(c0417j0.f3397o);
                            AbstractC0399a0 abstractC0399a0N2 = abstractC0403c0.f3370a.N(c0417j0.f3396n);
                            if (abstractC0399a0N2 == null || !(abstractC0399a0N2 instanceof n0)) {
                                o("Tref reference '%s' not found", c0417j0.f3396n);
                            } else {
                                StringBuilder sb = new StringBuilder();
                                p((n0) abstractC0399a0N2, sb);
                                if (sb.length() > 0) {
                                    bVar.E(sb.toString());
                                }
                            }
                        }
                        O();
                    }
                }
                z6 = false;
            }
        }
    }

    public final void p(n0 n0Var, StringBuilder sb) {
        Iterator it = n0Var.f3353i.iterator();
        boolean z6 = true;
        while (it.hasNext()) {
            AbstractC0403c0 abstractC0403c0 = (AbstractC0403c0) it.next();
            if (abstractC0403c0 instanceof n0) {
                p((n0) abstractC0403c0, sb);
            } else if (abstractC0403c0 instanceof q0) {
                sb.append(Q(((q0) abstractC0403c0).f3433c, z6, !it.hasNext()));
            }
            z6 = false;
        }
    }

    public final z0 t(AbstractC0399a0 abstractC0399a0) {
        z0 z0Var = new z0();
        S(z0Var, U.a());
        u(abstractC0399a0, z0Var);
        return z0Var;
    }

    public final void u(AbstractC0399a0 abstractC0399a0, z0 z0Var) {
        ArrayList arrayList = new ArrayList();
        AbstractC0403c0 abstractC0403c0 = abstractC0399a0;
        while (true) {
            if (abstractC0403c0 instanceof AbstractC0399a0) {
                arrayList.add(0, (AbstractC0399a0) abstractC0403c0);
            }
            Object obj = abstractC0403c0.f3371b;
            if (obj == null) {
                break;
            } else {
                abstractC0403c0 = (AbstractC0403c0) obj;
            }
        }
        Iterator it = arrayList.iterator();
        while (it.hasNext()) {
            T((AbstractC0399a0) it.next(), z0Var);
        }
        z0 z0Var2 = this.f3156c;
        z0Var.f3494g = z0Var2.f3494g;
        z0Var.f3493f = z0Var2.f3493f;
    }

    public final int v() {
        int i6;
        U u6 = this.f3156c.f3488a;
        return (u6.f3322L == 1 || (i6 = u6.f3323M) == 2) ? u6.f3323M : i6 == 1 ? 3 : 1;
    }

    public final Path.FillType w() {
        int i6 = this.f3156c.f3488a.f3324N;
        return (i6 == 0 || i6 != 2) ? Path.FillType.WINDING : Path.FillType.EVEN_ODD;
    }

    public final Path y(C0428t c0428t) {
        E e6 = c0428t.f3448o;
        float fD = e6 != null ? e6.d(this) : 0.0f;
        E e7 = c0428t.f3449p;
        float fE = e7 != null ? e7.e(this) : 0.0f;
        float fA = c0428t.f3450q.a(this);
        float f6 = fD - fA;
        float f7 = fE - fA;
        float f8 = fD + fA;
        float f9 = fE + fA;
        if (c0428t.f3357h == null) {
            float f10 = 2.0f * fA;
            c0428t.f3357h = new C0427s(f6, f7, f10, f10);
        }
        float f11 = fA * 0.5522848f;
        Path path = new Path();
        path.moveTo(fD, f7);
        float f12 = fD + f11;
        float f13 = fE - f11;
        path.cubicTo(f12, f7, f8, f13, f8, fE);
        float f14 = fE + f11;
        path.cubicTo(f8, f14, f12, f9, fD, f9);
        float f15 = fD - f11;
        path.cubicTo(f15, f9, f6, f14, f6, fE);
        path.cubicTo(f6, f13, f15, f7, fD, f7);
        path.close();
        return path;
    }

    public final Path z(C0433y c0433y) {
        E e6 = c0433y.f3476o;
        float fD = e6 != null ? e6.d(this) : 0.0f;
        E e7 = c0433y.f3477p;
        float fE = e7 != null ? e7.e(this) : 0.0f;
        float fD2 = c0433y.f3478q.d(this);
        float fE2 = c0433y.f3479r.e(this);
        float f6 = fD - fD2;
        float f7 = fE - fE2;
        float f8 = fD + fD2;
        float f9 = fE + fE2;
        if (c0433y.f3357h == null) {
            c0433y.f3357h = new C0427s(f6, f7, fD2 * 2.0f, 2.0f * fE2);
        }
        float f10 = fD2 * 0.5522848f;
        float f11 = fE2 * 0.5522848f;
        Path path = new Path();
        path.moveTo(fD, f7);
        float f12 = fD + f10;
        float f13 = fE - f11;
        path.cubicTo(f12, f7, f8, f13, f8, fE);
        float f14 = fE + f11;
        path.cubicTo(f8, f14, f12, f9, fD, f9);
        float f15 = fD - f10;
        path.cubicTo(f15, f9, f6, f14, f6, fE);
        path.cubicTo(f6, f13, f15, f7, fD, f7);
        path.close();
        return path;
    }
}
