package p0;

import android.graphics.Bitmap;
import android.graphics.BlendMode;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader;
import android.os.Build;
import android.util.DisplayMetrics;
import i0.InterfaceC2255s;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.List;
import o0.C2632c;
import o0.C2633d;
import q0.AbstractC2810b;
import q0.AbstractC2811c;
import q0.C2813e;
import q0.C2821m;
import q0.C2826r;
import r0.InterfaceC2866e;
import x4.AbstractC3252r;

/* JADX INFO: renamed from: p0.D, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC2686D {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static U f22843a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final T f22844b = new T();

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static Method f22845c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static Method f22846d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static boolean f22847e;

    public static final float[] A(List list, int i6, List list2) {
        if (i6 == 0) {
            if (list == null) {
                return null;
            }
            kotlin.jvm.internal.o.h(list, "<this>");
            float[] fArr = new float[list.size()];
            Iterator it = list.iterator();
            int i7 = 0;
            while (it.hasNext()) {
                fArr[i7] = ((Number) it.next()).floatValue();
                i7++;
            }
            return fArr;
        }
        float[] fArr2 = new float[list2.size() + i6];
        fArr2[0] = list != null ? ((Number) list.get(0)).floatValue() : 0.0f;
        int iA = AbstractC3252r.A(list2);
        int i8 = 1;
        for (int i9 = 1; i9 < iA; i9++) {
            long j4 = ((C2714u) list2.get(i9)).f22947a;
            float fFloatValue = list != null ? ((Number) list.get(i9)).floatValue() : i9 / AbstractC3252r.A(list2);
            int i10 = i8 + 1;
            fArr2[i8] = fFloatValue;
            if (C2714u.e(j4) == 0.0f) {
                i8 += 2;
                fArr2[i10] = fFloatValue;
            } else {
                i8 = i10;
            }
        }
        fArr2[i8] = list != null ? ((Number) list.get(AbstractC3252r.A(list2))).floatValue() : 1.0f;
        return fArr2;
    }

    public static final void B(Matrix matrix, float[] fArr) {
        float f6 = fArr[0];
        float f7 = fArr[1];
        float f8 = fArr[2];
        float f9 = fArr[3];
        float f10 = fArr[4];
        float f11 = fArr[5];
        float f12 = fArr[6];
        float f13 = fArr[7];
        float f14 = fArr[8];
        float f15 = fArr[12];
        float f16 = fArr[13];
        float f17 = fArr[15];
        fArr[0] = f6;
        fArr[1] = f10;
        fArr[2] = f15;
        fArr[3] = f7;
        fArr[4] = f11;
        fArr[5] = f16;
        fArr[6] = f9;
        fArr[7] = f13;
        fArr[8] = f17;
        matrix.setValues(fArr);
        fArr[0] = f6;
        fArr[1] = f7;
        fArr[2] = f8;
        fArr[3] = f9;
        fArr[4] = f10;
        fArr[5] = f11;
        fArr[6] = f12;
        fArr[7] = f13;
        fArr[8] = f14;
    }

    public static final void C(Matrix matrix, float[] fArr) {
        matrix.getValues(fArr);
        float f6 = fArr[0];
        float f7 = fArr[1];
        float f8 = fArr[2];
        float f9 = fArr[3];
        float f10 = fArr[4];
        float f11 = fArr[5];
        float f12 = fArr[6];
        float f13 = fArr[7];
        float f14 = fArr[8];
        fArr[0] = f6;
        fArr[1] = f9;
        fArr[2] = 0.0f;
        fArr[3] = f12;
        fArr[4] = f7;
        fArr[5] = f10;
        fArr[6] = 0.0f;
        fArr[7] = f13;
        fArr[8] = 0.0f;
        fArr[9] = 0.0f;
        fArr[10] = 1.0f;
        fArr[11] = 0.0f;
        fArr[12] = f8;
        fArr[13] = f11;
        fArr[14] = 0.0f;
        fArr[15] = f14;
    }

    public static final long D(C2632c c2632c) {
        float f6 = c2632c.f21789c - c2632c.f21787a;
        float f7 = c2632c.f21790d - c2632c.f21788b;
        return (((long) Float.floatToRawIntBits(f6)) << 32) | (((long) Float.floatToRawIntBits(f7)) & 4294967295L);
    }

    public static final BlendMode E(int i6) {
        return i6 == 0 ? BlendMode.CLEAR : i6 == 1 ? BlendMode.SRC : i6 == 2 ? BlendMode.DST : i6 == 3 ? BlendMode.SRC_OVER : i6 == 4 ? BlendMode.DST_OVER : i6 == 5 ? BlendMode.SRC_IN : i6 == 6 ? BlendMode.DST_IN : i6 == 7 ? BlendMode.SRC_OUT : i6 == 8 ? BlendMode.DST_OUT : i6 == 9 ? BlendMode.SRC_ATOP : i6 == 10 ? BlendMode.DST_ATOP : i6 == 11 ? BlendMode.XOR : i6 == 12 ? BlendMode.PLUS : i6 == 13 ? BlendMode.MODULATE : i6 == 14 ? BlendMode.SCREEN : i6 == 15 ? BlendMode.OVERLAY : i6 == 16 ? BlendMode.DARKEN : i6 == 17 ? BlendMode.LIGHTEN : i6 == 18 ? BlendMode.COLOR_DODGE : i6 == 19 ? BlendMode.COLOR_BURN : i6 == 20 ? BlendMode.HARD_LIGHT : i6 == 21 ? BlendMode.SOFT_LIGHT : i6 == 22 ? BlendMode.DIFFERENCE : i6 == 23 ? BlendMode.EXCLUSION : i6 == 24 ? BlendMode.MULTIPLY : i6 == 25 ? BlendMode.HUE : i6 == 26 ? BlendMode.SATURATION : i6 == 27 ? BlendMode.COLOR : i6 == 28 ? BlendMode.LUMINOSITY : BlendMode.SRC_OVER;
    }

    public static final Rect F(h1.k kVar) {
        return new Rect(kVar.f16623a, kVar.f16624b, kVar.f16625c, kVar.f16626d);
    }

    public static final RectF G(C2632c c2632c) {
        return new RectF(c2632c.f21787a, c2632c.f21788b, c2632c.f21789c, c2632c.f21790d);
    }

    public static final Shader.TileMode H(int i6) {
        return i6 == 0 ? Shader.TileMode.CLAMP : i6 == 1 ? Shader.TileMode.REPEAT : i6 == 2 ? Shader.TileMode.MIRROR : i6 == 3 ? Build.VERSION.SDK_INT >= 31 ? Shader.TileMode.DECAL : Shader.TileMode.CLAMP : Shader.TileMode.CLAMP;
    }

    public static final int I(long j4) {
        float[] fArr = C2813e.f23505a;
        return (int) (C2714u.b(j4, C2813e.f23509e) >>> 32);
    }

    public static final Bitmap.Config J(int i6) {
        if (i6 == 0) {
            return Bitmap.Config.ARGB_8888;
        }
        if (i6 == 1) {
            return Bitmap.Config.ALPHA_8;
        }
        if (i6 == 2) {
            return Bitmap.Config.RGB_565;
        }
        int i7 = Build.VERSION.SDK_INT;
        return (i7 < 26 || i6 != 3) ? (i7 < 26 || i6 != 4) ? Bitmap.Config.ARGB_8888 : Bitmap.Config.HARDWARE : Bitmap.Config.RGBA_F16;
    }

    public static final C2632c K(Rect rect) {
        return new C2632c(rect.left, rect.top, rect.right, rect.bottom);
    }

    public static final C2632c L(RectF rectF) {
        return new C2632c(rectF.left, rectF.top, rectF.right, rectF.bottom);
    }

    public static final PorterDuff.Mode M(int i6) {
        return i6 == 0 ? PorterDuff.Mode.CLEAR : i6 == 1 ? PorterDuff.Mode.SRC : i6 == 2 ? PorterDuff.Mode.DST : i6 == 3 ? PorterDuff.Mode.SRC_OVER : i6 == 4 ? PorterDuff.Mode.DST_OVER : i6 == 5 ? PorterDuff.Mode.SRC_IN : i6 == 6 ? PorterDuff.Mode.DST_IN : i6 == 7 ? PorterDuff.Mode.SRC_OUT : i6 == 8 ? PorterDuff.Mode.DST_OUT : i6 == 9 ? PorterDuff.Mode.SRC_ATOP : i6 == 10 ? PorterDuff.Mode.DST_ATOP : i6 == 11 ? PorterDuff.Mode.XOR : i6 == 12 ? PorterDuff.Mode.ADD : i6 == 14 ? PorterDuff.Mode.SCREEN : i6 == 15 ? PorterDuff.Mode.OVERLAY : i6 == 16 ? PorterDuff.Mode.DARKEN : i6 == 17 ? PorterDuff.Mode.LIGHTEN : i6 == 13 ? PorterDuff.Mode.MULTIPLY : PorterDuff.Mode.SRC_OVER;
    }

    public static String N(int i6) {
        return i6 == 0 ? "Clamp" : i6 == 1 ? "Repeated" : i6 == 2 ? "Mirror" : i6 == 3 ? "Decal" : "Unknown";
    }

    public static final void O(List list, List list2) {
        if (list2 == null) {
            if (list.size() < 2) {
                throw new IllegalArgumentException("colors must have length of at least 2 if colorStops is omitted.");
            }
        } else if (list.size() != list2.size()) {
            throw new IllegalArgumentException("colors and colorStops arguments must have equal length.");
        }
    }

    public static final int P(float f6, float[] fArr, int i6) {
        float f7 = f6 >= 0.0f ? f6 : 0.0f;
        if (f7 > 1.0f) {
            f7 = 1.0f;
        }
        if (Math.abs(f7 - f6) > 1.05E-6f) {
            f7 = Float.NaN;
        }
        fArr[i6] = f7;
        return !Float.isNaN(f7) ? 1 : 0;
    }

    public static final C2696b a(C2700f c2700f) {
        Canvas canvas = AbstractC2697c.f22904a;
        C2696b c2696b = new C2696b();
        c2696b.f22900a = new Canvas(l(c2700f));
        return c2696b;
    }

    /* JADX WARN: Removed duplicated region for block: B:108:0x0157  */
    /* JADX WARN: Removed duplicated region for block: B:112:0x015e  */
    /* JADX WARN: Removed duplicated region for block: B:115:0x016b  */
    /* JADX WARN: Removed duplicated region for block: B:117:0x0170  */
    /* JADX WARN: Removed duplicated region for block: B:137:0x01a9  */
    /* JADX WARN: Removed duplicated region for block: B:141:0x01b0  */
    /* JADX WARN: Removed duplicated region for block: B:77:0x00f6  */
    /* JADX WARN: Removed duplicated region for block: B:81:0x00fd  */
    /* JADX WARN: Removed duplicated region for block: B:84:0x010b  */
    /* JADX WARN: Removed duplicated region for block: B:88:0x0113  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final long b(float f6, float f7, float f8, float f9, AbstractC2811c abstractC2811c) {
        int i6;
        int i7;
        int i8;
        float fB;
        float fA;
        int i9;
        int i10;
        int i11;
        int i12;
        float fB2;
        float fA2;
        int i13;
        int i14;
        int i15;
        float f10;
        int i16 = 31;
        if (abstractC2811c.c()) {
            float f11 = f9 < 0.0f ? 0.0f : f9;
            if (f11 > 1.0f) {
                f11 = 1.0f;
            }
            int i17 = ((int) ((f11 * 255.0f) + 0.5f)) << 24;
            float f12 = f6 < 0.0f ? 0.0f : f6;
            if (f12 > 1.0f) {
                f12 = 1.0f;
            }
            int i18 = i17 | (((int) ((f12 * 255.0f) + 0.5f)) << 16);
            float f13 = f7 < 0.0f ? 0.0f : f7;
            if (f13 > 1.0f) {
                f13 = 1.0f;
            }
            int i19 = i18 | (((int) ((f13 * 255.0f) + 0.5f)) << 8);
            f10 = f8 >= 0.0f ? f8 : 0.0f;
            long j4 = ((long) (i19 | ((int) (((f10 <= 1.0f ? f10 : 1.0f) * 255.0f) + 0.5f)))) << 32;
            int i20 = C2714u.f22946n;
            return j4;
        }
        int i21 = AbstractC2810b.f23500e;
        if (((int) (abstractC2811c.f23502b >> 32)) != 3) {
            AbstractC2690H.a("Color only works with ColorSpaces with 3 components");
        }
        int i22 = abstractC2811c.f23503c;
        if (i22 == -1) {
            AbstractC2690H.a("Unknown color space, please use a color space in ColorSpaces");
        }
        float fB3 = abstractC2811c.b(0);
        float fA3 = abstractC2811c.a(0);
        if (f6 >= fB3) {
            fB3 = f6;
        }
        if (fB3 <= fA3) {
            fA3 = fB3;
        }
        int iFloatToRawIntBits = Float.floatToRawIntBits(fA3);
        int i23 = iFloatToRawIntBits >>> 31;
        int i24 = (iFloatToRawIntBits >>> 23) & 255;
        int i25 = iFloatToRawIntBits & 8388607;
        if (i24 == 255) {
            i7 = i25 != 0 ? 512 : 0;
            i6 = 31;
        } else {
            i6 = i24 - 112;
            if (i6 >= 31) {
                i6 = 49;
                i7 = 0;
            } else if (i6 <= 0) {
                if (i6 >= -10) {
                    int i26 = (i25 | 8388608) >> (1 - i6);
                    if ((i26 & 4096) != 0) {
                        i26 += 8192;
                    }
                    i7 = i26 >> 13;
                } else {
                    i7 = 0;
                }
                i6 = 0;
            } else {
                int i27 = i25 >> 13;
                if ((iFloatToRawIntBits & 4096) != 0) {
                    i8 = (((i6 << 10) | i27) + 1) | (i23 << 15);
                    short s6 = (short) i8;
                    fB = abstractC2811c.b(1);
                    fA = abstractC2811c.a(1);
                    if (f7 >= fB) {
                        fB = f7;
                    }
                    if (fB <= fA) {
                        fA = fB;
                    }
                    int iFloatToRawIntBits2 = Float.floatToRawIntBits(fA);
                    int i28 = iFloatToRawIntBits2 >>> 31;
                    i9 = (iFloatToRawIntBits2 >>> 23) & 255;
                    int i29 = iFloatToRawIntBits2 & 8388607;
                    if (i9 != 255) {
                        i11 = i29 != 0 ? 512 : 0;
                        i10 = 31;
                    } else {
                        i10 = i9 - 112;
                        if (i10 >= 31) {
                            i10 = 49;
                            i11 = 0;
                        } else if (i10 <= 0) {
                            if (i10 >= -10) {
                                int i30 = (i29 | 8388608) >> (1 - i10);
                                if ((i30 & 4096) != 0) {
                                    i30 += 8192;
                                }
                                i11 = i30 >> 13;
                            } else {
                                i11 = 0;
                            }
                            i10 = 0;
                        } else {
                            int i31 = i29 >> 13;
                            if ((iFloatToRawIntBits2 & 4096) != 0) {
                                i12 = (((i10 << 10) | i31) + 1) | (i28 << 15);
                                short s7 = (short) i12;
                                fB2 = abstractC2811c.b(2);
                                fA2 = abstractC2811c.a(2);
                                if (f8 >= fB2) {
                                    fB2 = f8;
                                }
                                if (fB2 <= fA2) {
                                    fA2 = fB2;
                                }
                                int iFloatToRawIntBits3 = Float.floatToRawIntBits(fA2);
                                int i32 = iFloatToRawIntBits3 >>> 31;
                                i13 = (iFloatToRawIntBits3 >>> 23) & 255;
                                int i33 = 8388607 & iFloatToRawIntBits3;
                                if (i13 == 255) {
                                    i14 = i33 != 0 ? 512 : 0;
                                    i15 = (i32 << 15) | (i16 << 10) | i14;
                                } else {
                                    int i34 = i13 - 112;
                                    if (i34 >= 31) {
                                        i16 = 49;
                                    } else {
                                        if (i34 > 0) {
                                            i14 = i33 >> 13;
                                            if ((iFloatToRawIntBits3 & 4096) != 0) {
                                                i15 = (((i34 << 10) | i14) + 1) | (i32 << 15);
                                            } else {
                                                i16 = i34;
                                            }
                                        } else if (i34 >= -10) {
                                            int i35 = (i33 | 8388608) >> (1 - i34);
                                            if ((i35 & 4096) != 0) {
                                                i35 += 8192;
                                            }
                                            i14 = i35 >> 13;
                                            i16 = 0;
                                        } else {
                                            i16 = 0;
                                        }
                                        i15 = (i32 << 15) | (i16 << 10) | i14;
                                    }
                                    i15 = (i32 << 15) | (i16 << 10) | i14;
                                }
                                short s8 = (short) i15;
                                f10 = f9 >= 0.0f ? f9 : 0.0f;
                                long j6 = ((((long) ((int) (((f10 <= 1.0f ? f10 : 1.0f) * 1023.0f) + 0.5f))) & 1023) << 6) | ((((long) s6) & 65535) << 48) | ((((long) s7) & 65535) << 32) | ((((long) s8) & 65535) << 16) | (((long) i22) & 63);
                                int i36 = C2714u.f22946n;
                                return j6;
                            }
                            i11 = i31;
                        }
                    }
                    i12 = i11 | (i28 << 15) | (i10 << 10);
                    short s72 = (short) i12;
                    fB2 = abstractC2811c.b(2);
                    fA2 = abstractC2811c.a(2);
                    if (f8 >= fB2) {
                    }
                    if (fB2 <= fA2) {
                    }
                    int iFloatToRawIntBits32 = Float.floatToRawIntBits(fA2);
                    int i322 = iFloatToRawIntBits32 >>> 31;
                    i13 = (iFloatToRawIntBits32 >>> 23) & 255;
                    int i332 = 8388607 & iFloatToRawIntBits32;
                    if (i13 == 255) {
                    }
                    short s82 = (short) i15;
                    if (f9 >= 0.0f) {
                    }
                    long j62 = ((((long) ((int) (((f10 <= 1.0f ? f10 : 1.0f) * 1023.0f) + 0.5f))) & 1023) << 6) | ((((long) s6) & 65535) << 48) | ((((long) s72) & 65535) << 32) | ((((long) s82) & 65535) << 16) | (((long) i22) & 63);
                    int i362 = C2714u.f22946n;
                    return j62;
                }
                i7 = i27;
            }
        }
        i8 = i7 | (i23 << 15) | (i6 << 10);
        short s62 = (short) i8;
        fB = abstractC2811c.b(1);
        fA = abstractC2811c.a(1);
        if (f7 >= fB) {
        }
        if (fB <= fA) {
        }
        int iFloatToRawIntBits22 = Float.floatToRawIntBits(fA);
        int i282 = iFloatToRawIntBits22 >>> 31;
        i9 = (iFloatToRawIntBits22 >>> 23) & 255;
        int i292 = iFloatToRawIntBits22 & 8388607;
        if (i9 != 255) {
        }
        i12 = i11 | (i282 << 15) | (i10 << 10);
        short s722 = (short) i12;
        fB2 = abstractC2811c.b(2);
        fA2 = abstractC2811c.a(2);
        if (f8 >= fB2) {
        }
        if (fB2 <= fA2) {
        }
        int iFloatToRawIntBits322 = Float.floatToRawIntBits(fA2);
        int i3222 = iFloatToRawIntBits322 >>> 31;
        i13 = (iFloatToRawIntBits322 >>> 23) & 255;
        int i3322 = 8388607 & iFloatToRawIntBits322;
        if (i13 == 255) {
        }
        short s822 = (short) i15;
        if (f9 >= 0.0f) {
        }
        long j622 = ((((long) ((int) (((f10 <= 1.0f ? f10 : 1.0f) * 1023.0f) + 0.5f))) & 1023) << 6) | ((((long) s62) & 65535) << 48) | ((((long) s722) & 65535) << 32) | ((((long) s822) & 65535) << 16) | (((long) i22) & 63);
        int i3622 = C2714u.f22946n;
        return j622;
    }

    public static final long c(int i6) {
        long j4 = ((long) i6) << 32;
        int i7 = C2714u.f22946n;
        return j4;
    }

    public static final long d(int i6, int i7, int i8) {
        return c(((i6 & 255) << 16) | (-16777216) | ((i7 & 255) << 8) | (i8 & 255));
    }

    public static final long e(long j4) {
        long j6 = j4 << 32;
        int i6 = C2714u.f22946n;
        return j6;
    }

    public static long f(float f6, float f7, float f8, float f9, int i6) {
        if ((i6 & 8) != 0) {
            f9 = 1.0f;
        }
        return b(f6, f7, f8, f9, C2813e.f23509e);
    }

    public static C2700f g(int i6, int i7, int i8) {
        Bitmap bitmapCreateBitmap;
        C2826r c2826r = C2813e.f23509e;
        Bitmap.Config configJ = J(i8);
        if (Build.VERSION.SDK_INT >= 26) {
            bitmapCreateBitmap = Bitmap.createBitmap((DisplayMetrics) null, i6, i7, J(i8), true, AbstractC2718y.a(c2826r));
        } else {
            bitmapCreateBitmap = Bitmap.createBitmap((DisplayMetrics) null, i6, i7, configJ);
            bitmapCreateBitmap.setHasAlpha(true);
        }
        return new C2700f(bitmapCreateBitmap);
    }

    public static final LinearGradient h(long j4, long j6, List list, List list2, int i6) {
        O(list, list2);
        int iN = n(list);
        return new LinearGradient(Float.intBitsToFloat((int) (j4 >> 32)), Float.intBitsToFloat((int) (j4 & 4294967295L)), Float.intBitsToFloat((int) (j6 >> 32)), Float.intBitsToFloat((int) (j6 & 4294967295L)), z(iN, list), A(list2, iN, list), H(i6));
    }

    public static final I2.O i() {
        return new I2.O(new Paint(7));
    }

    public static final long j(float f6, float f7) {
        long jFloatToRawIntBits = (((long) Float.floatToRawIntBits(f7)) & 4294967295L) | (Float.floatToRawIntBits(f6) << 32);
        int i6 = c0.f22906c;
        return jFloatToRawIntBits;
    }

    /* JADX WARN: Removed duplicated region for block: B:30:0x0092  */
    /* JADX WARN: Removed duplicated region for block: B:34:0x0099  */
    /* JADX WARN: Removed duplicated region for block: B:52:0x00de  */
    /* JADX WARN: Removed duplicated region for block: B:56:0x00e4  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final long k(float f6, float f7, float f8, float f9, AbstractC2811c abstractC2811c) {
        int i6;
        int i7;
        int i8;
        int i9;
        int i10;
        int i11;
        int i12;
        int i13;
        int i14;
        int i15 = 31;
        if (abstractC2811c.c()) {
            long j4 = ((long) ((((((int) ((f9 * 255.0f) + 0.5f)) << 24) | (((int) ((f6 * 255.0f) + 0.5f)) << 16)) | (((int) ((f7 * 255.0f) + 0.5f)) << 8)) | ((int) ((255.0f * f8) + 0.5f)))) << 32;
            int i16 = C2714u.f22946n;
            return j4;
        }
        int iFloatToRawIntBits = Float.floatToRawIntBits(f6);
        int i17 = iFloatToRawIntBits >>> 31;
        int i18 = (iFloatToRawIntBits >>> 23) & 255;
        int i19 = iFloatToRawIntBits & 8388607;
        int i20 = 0;
        if (i18 == 255) {
            i7 = i19 != 0 ? 512 : 0;
            i6 = 31;
        } else {
            i6 = i18 - 112;
            if (i6 >= 31) {
                i6 = 49;
                i7 = 0;
            } else if (i6 > 0) {
                int i21 = i19 >> 13;
                if ((iFloatToRawIntBits & 4096) != 0) {
                    i8 = (((i6 << 10) | i21) + 1) | (i17 << 15);
                    short s6 = (short) i8;
                    int iFloatToRawIntBits2 = Float.floatToRawIntBits(f7);
                    int i22 = iFloatToRawIntBits2 >>> 31;
                    i9 = (iFloatToRawIntBits2 >>> 23) & 255;
                    int i23 = iFloatToRawIntBits2 & 8388607;
                    if (i9 != 255) {
                        i11 = i23 != 0 ? 512 : 0;
                        i10 = 31;
                    } else {
                        i10 = i9 - 112;
                        if (i10 >= 31) {
                            i10 = 49;
                            i11 = 0;
                        } else if (i10 > 0) {
                            int i24 = i23 >> 13;
                            if ((iFloatToRawIntBits2 & 4096) != 0) {
                                i12 = (((i10 << 10) | i24) + 1) | (i22 << 15);
                                short s7 = (short) i12;
                                int iFloatToRawIntBits3 = Float.floatToRawIntBits(f8);
                                int i25 = iFloatToRawIntBits3 >>> 31;
                                i13 = (iFloatToRawIntBits3 >>> 23) & 255;
                                int i26 = 8388607 & iFloatToRawIntBits3;
                                if (i13 == 255) {
                                    i20 = i26 == 0 ? 0 : 512;
                                } else {
                                    int i27 = i13 - 112;
                                    if (i27 >= 31) {
                                        i15 = 49;
                                    } else if (i27 > 0) {
                                        i20 = i26 >> 13;
                                        if ((iFloatToRawIntBits3 & 4096) != 0) {
                                            i14 = (((i27 << 10) | i20) + 1) | (i25 << 15);
                                            long jMax = ((((long) s6) & 65535) << 48) | ((((long) s7) & 65535) << 32) | ((((long) ((short) i14)) & 65535) << 16) | ((((long) ((int) ((Math.max(0.0f, Math.min(f9, 1.0f)) * 1023.0f) + 0.5f))) & 1023) << 6) | (((long) abstractC2811c.f23503c) & 63);
                                            int i28 = C2714u.f22946n;
                                            return jMax;
                                        }
                                        i15 = i27;
                                    } else if (i27 >= -10) {
                                        int i29 = (i26 | 8388608) >> (1 - i27);
                                        if ((i29 & 4096) != 0) {
                                            i29 += 8192;
                                        }
                                        i20 = i29 >> 13;
                                        i15 = 0;
                                    } else {
                                        i15 = 0;
                                    }
                                }
                                i14 = (i15 << 10) | (i25 << 15) | i20;
                                long jMax2 = ((((long) s6) & 65535) << 48) | ((((long) s7) & 65535) << 32) | ((((long) ((short) i14)) & 65535) << 16) | ((((long) ((int) ((Math.max(0.0f, Math.min(f9, 1.0f)) * 1023.0f) + 0.5f))) & 1023) << 6) | (((long) abstractC2811c.f23503c) & 63);
                                int i282 = C2714u.f22946n;
                                return jMax2;
                            }
                            i11 = i24;
                        } else if (i10 >= -10) {
                            int i30 = (i23 | 8388608) >> (1 - i10);
                            if ((i30 & 4096) != 0) {
                                i30 += 8192;
                            }
                            i11 = i30 >> 13;
                            i10 = 0;
                        } else {
                            i11 = 0;
                            i10 = 0;
                        }
                    }
                    i12 = i11 | (i22 << 15) | (i10 << 10);
                    short s72 = (short) i12;
                    int iFloatToRawIntBits32 = Float.floatToRawIntBits(f8);
                    int i252 = iFloatToRawIntBits32 >>> 31;
                    i13 = (iFloatToRawIntBits32 >>> 23) & 255;
                    int i262 = 8388607 & iFloatToRawIntBits32;
                    if (i13 == 255) {
                    }
                    i14 = (i15 << 10) | (i252 << 15) | i20;
                    long jMax22 = ((((long) s6) & 65535) << 48) | ((((long) s72) & 65535) << 32) | ((((long) ((short) i14)) & 65535) << 16) | ((((long) ((int) ((Math.max(0.0f, Math.min(f9, 1.0f)) * 1023.0f) + 0.5f))) & 1023) << 6) | (((long) abstractC2811c.f23503c) & 63);
                    int i2822 = C2714u.f22946n;
                    return jMax22;
                }
                i7 = i21;
            } else if (i6 >= -10) {
                int i31 = (i19 | 8388608) >> (1 - i6);
                if ((i31 & 4096) != 0) {
                    i31 += 8192;
                }
                i7 = i31 >> 13;
                i6 = 0;
            } else {
                i7 = 0;
                i6 = 0;
            }
        }
        i8 = i7 | (i17 << 15) | (i6 << 10);
        short s62 = (short) i8;
        int iFloatToRawIntBits22 = Float.floatToRawIntBits(f7);
        int i222 = iFloatToRawIntBits22 >>> 31;
        i9 = (iFloatToRawIntBits22 >>> 23) & 255;
        int i232 = iFloatToRawIntBits22 & 8388607;
        if (i9 != 255) {
        }
        i12 = i11 | (i222 << 15) | (i10 << 10);
        short s722 = (short) i12;
        int iFloatToRawIntBits322 = Float.floatToRawIntBits(f8);
        int i2522 = iFloatToRawIntBits322 >>> 31;
        i13 = (iFloatToRawIntBits322 >>> 23) & 255;
        int i2622 = 8388607 & iFloatToRawIntBits322;
        if (i13 == 255) {
        }
        i14 = (i15 << 10) | (i2522 << 15) | i20;
        long jMax222 = ((((long) s62) & 65535) << 48) | ((((long) s722) & 65535) << 32) | ((((long) ((short) i14)) & 65535) << 16) | ((((long) ((int) ((Math.max(0.0f, Math.min(f9, 1.0f)) * 1023.0f) + 0.5f))) & 1023) << 6) | (((long) abstractC2811c.f23503c) & 63);
        int i28222 = C2714u.f22946n;
        return jMax222;
    }

    public static final Bitmap l(C2700f c2700f) {
        if (c2700f instanceof C2700f) {
            return c2700f.f22917a;
        }
        throw new UnsupportedOperationException("Unable to obtain android.graphics.Bitmap");
    }

    public static final long m(long j4, long j6) {
        float f6;
        float f7;
        long jB = C2714u.b(j4, C2714u.g(j6));
        float fE = C2714u.e(j6);
        float fE2 = C2714u.e(jB);
        float f8 = 1.0f - fE2;
        float f9 = (fE * f8) + fE2;
        float fI = C2714u.i(jB);
        float fI2 = C2714u.i(j6);
        float f10 = 0.0f;
        if (f9 == 0.0f) {
            f6 = 0.0f;
        } else {
            f6 = (((fI2 * fE) * f8) + (fI * fE2)) / f9;
        }
        float fH = C2714u.h(jB);
        float fH2 = C2714u.h(j6);
        if (f9 == 0.0f) {
            f7 = 0.0f;
        } else {
            f7 = (((fH2 * fE) * f8) + (fH * fE2)) / f9;
        }
        float f11 = C2714u.f(jB);
        float f12 = C2714u.f(j6);
        if (f9 != 0.0f) {
            f10 = (((f12 * fE) * f8) + (f11 * fE2)) / f9;
        }
        return k(f6, f7, f10, f9, C2714u.g(j6));
    }

    public static final int n(List list) {
        int i6 = 0;
        if (Build.VERSION.SDK_INT >= 26) {
            return 0;
        }
        int iA = AbstractC3252r.A(list);
        for (int i7 = 1; i7 < iA; i7++) {
            if (C2714u.e(((C2714u) list.get(i7)).f22947a) == 0.0f) {
                i6++;
            }
        }
        return i6;
    }

    public static void o(InterfaceC2866e interfaceC2866e, N n6, AbstractC2711q abstractC2711q, float f6, int i6) {
        float f7 = (i6 & 4) != 0 ? 1.0f : f6;
        r0.h hVar = r0.h.f23808a;
        if (n6 instanceof C2694L) {
            C2632c c2632c = ((C2694L) n6).f22856a;
            interfaceC2866e.x(abstractC2711q, (((long) Float.floatToRawIntBits(c2632c.f21787a)) << 32) | (((long) Float.floatToRawIntBits(c2632c.f21788b)) & 4294967295L), D(c2632c), f7, hVar);
            return;
        }
        if (!(n6 instanceof M)) {
            if (!(n6 instanceof C2693K)) {
                throw new E3.v();
            }
            interfaceC2866e.H(((C2693K) n6).f22855a, abstractC2711q, f7, hVar, 3);
            return;
        }
        M m6 = (M) n6;
        C2702h c2702h = m6.f22858b;
        if (c2702h != null) {
            interfaceC2866e.H(c2702h, abstractC2711q, f7, hVar, 3);
            return;
        }
        C2633d c2633d = m6.f22857a;
        float fIntBitsToFloat = Float.intBitsToFloat((int) (c2633d.f21798h >> 32));
        interfaceC2866e.h(abstractC2711q, (((long) Float.floatToRawIntBits(c2633d.f21791a)) << 32) | (((long) Float.floatToRawIntBits(c2633d.f21792b)) & 4294967295L), (((long) Float.floatToRawIntBits(c2633d.b())) << 32) | (((long) Float.floatToRawIntBits(c2633d.a())) & 4294967295L), (((long) Float.floatToRawIntBits(fIntBitsToFloat)) << 32) | (((long) Float.floatToRawIntBits(fIntBitsToFloat)) & 4294967295L), f7, hVar);
    }

    public static void p(InterfaceC2866e interfaceC2866e, N n6, long j4) {
        if (n6 instanceof C2694L) {
            C2632c c2632c = ((C2694L) n6).f22856a;
            interfaceC2866e.p0(j4, (((long) Float.floatToRawIntBits(c2632c.f21787a)) << 32) | (((long) Float.floatToRawIntBits(c2632c.f21788b)) & 4294967295L), D(c2632c), 1.0f, 3);
            return;
        }
        if (!(n6 instanceof M)) {
            if (!(n6 instanceof C2693K)) {
                throw new E3.v();
            }
            interfaceC2866e.g(((C2693K) n6).f22855a, j4);
            return;
        }
        M m6 = (M) n6;
        C2702h c2702h = m6.f22858b;
        if (c2702h != null) {
            interfaceC2866e.g(c2702h, j4);
            return;
        }
        C2633d c2633d = m6.f22857a;
        float fIntBitsToFloat = Float.intBitsToFloat((int) (c2633d.f21798h >> 32));
        interfaceC2866e.W(j4, (((long) Float.floatToRawIntBits(c2633d.f21791a)) << 32) | (((long) Float.floatToRawIntBits(c2633d.f21792b)) & 4294967295L), (((long) Float.floatToRawIntBits(c2633d.b())) << 32) | (((long) Float.floatToRawIntBits(c2633d.a())) & 4294967295L), (4294967295L & ((long) Float.floatToRawIntBits(fIntBitsToFloat))) | (Float.floatToRawIntBits(fIntBitsToFloat) << 32));
    }

    public static void q(Canvas canvas, boolean z6) {
        Method method;
        int i6 = Build.VERSION.SDK_INT;
        if (i6 >= 29) {
            if (z6) {
                canvas.enableZ();
                return;
            } else {
                canvas.disableZ();
                return;
            }
        }
        if (!f22847e) {
            try {
                if (i6 == 28) {
                    Method declaredMethod = Class.class.getDeclaredMethod("getDeclaredMethod", String.class, new Class[0].getClass());
                    f22845c = (Method) declaredMethod.invoke(Canvas.class, "insertReorderBarrier", new Class[0]);
                    f22846d = (Method) declaredMethod.invoke(Canvas.class, "insertInorderBarrier", new Class[0]);
                } else {
                    f22845c = Canvas.class.getDeclaredMethod("insertReorderBarrier", new Class[0]);
                    f22846d = Canvas.class.getDeclaredMethod("insertInorderBarrier", new Class[0]);
                }
                Method method2 = f22845c;
                if (method2 != null) {
                    method2.setAccessible(true);
                }
                Method method3 = f22846d;
                if (method3 != null) {
                    method3.setAccessible(true);
                }
            } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException unused) {
            }
            f22847e = true;
        }
        if (z6) {
            try {
                Method method4 = f22845c;
                if (method4 != null) {
                    method4.invoke(canvas, new Object[0]);
                }
            } catch (IllegalAccessException | InvocationTargetException unused2) {
                return;
            }
        }
        if (z6 || (method = f22846d) == null) {
            return;
        }
        method.invoke(canvas, new Object[0]);
    }

    public static long r() {
        return C2714u.f22935b;
    }

    public static long s() {
        return C2714u.l;
    }

    public static long t() {
        return C2714u.f22939f;
    }

    public static final InterfaceC2255s u(InterfaceC2255s interfaceC2255s, J4.c cVar) {
        return interfaceC2255s.then(new C2707m(cVar));
    }

    public static InterfaceC2255s v(float f6, float f7, float f8, float f9, X x6, int i6) {
        float f10 = (i6 & 1) != 0 ? 1.0f : f6;
        float f11 = (i6 & 2) != 0 ? 1.0f : f7;
        float f12 = (i6 & 4) != 0 ? 1.0f : f8;
        float f13 = (i6 & 32) != 0 ? 0.0f : f9;
        long j4 = c0.f22905b;
        X x7 = (i6 & 2048) != 0 ? f22844b : x6;
        long j6 = AbstractC2688F.f22848a;
        return new C2685C(f10, f11, f12, f13, j4, x7, false, j6, j6);
    }

    public static InterfaceC2255s w(InterfaceC2255s interfaceC2255s, float f6, float f7, float f8, X x6, int i6) {
        float f9 = (i6 & 1) != 0 ? 1.0f : f6;
        float f10 = (i6 & 2) != 0 ? 1.0f : f7;
        float f11 = (i6 & 4) != 0 ? 1.0f : f8;
        long j4 = c0.f22905b;
        X x7 = (i6 & 2048) != 0 ? f22844b : x6;
        boolean z6 = (i6 & 4096) == 0;
        long j6 = AbstractC2688F.f22848a;
        return interfaceC2255s.then(new C2685C(f9, f10, f11, 0.0f, j4, x7, z6, j6, j6));
    }

    public static final boolean x(float[] fArr) {
        return fArr.length >= 16 && fArr[0] == 1.0f && fArr[1] == 0.0f && fArr[2] == 0.0f && fArr[3] == 0.0f && fArr[4] == 0.0f && fArr[5] == 1.0f && fArr[6] == 0.0f && fArr[7] == 0.0f && fArr[8] == 0.0f && fArr[9] == 0.0f && fArr[10] == 1.0f && fArr[11] == 0.0f && fArr[12] == 0.0f && fArr[13] == 0.0f && fArr[14] == 0.0f && fArr[15] == 1.0f;
    }

    public static final long y(long j4, float f6, long j6) {
        C2821m c2821m = C2813e.f23527x;
        long jB = C2714u.b(j4, c2821m);
        long jB2 = C2714u.b(j6, c2821m);
        float fE = C2714u.e(jB);
        float fI = C2714u.i(jB);
        float fH = C2714u.h(jB);
        float f7 = C2714u.f(jB);
        float fE2 = C2714u.e(jB2);
        float fI2 = C2714u.i(jB2);
        float fH2 = C2714u.h(jB2);
        float f8 = C2714u.f(jB2);
        if (f6 < 0.0f) {
            f6 = 0.0f;
        }
        if (f6 > 1.0f) {
            f6 = 1.0f;
        }
        return C2714u.b(k(W.b.r0(fI, fI2, f6), W.b.r0(fH, fH2, f6), W.b.r0(f7, f8, f6), W.b.r0(fE, fE2, f6), c2821m), C2714u.g(j6));
    }

    public static final int[] z(int i6, List list) {
        int i7;
        int i8 = 0;
        if (Build.VERSION.SDK_INT >= 26) {
            int size = list.size();
            int[] iArr = new int[size];
            while (i8 < size) {
                iArr[i8] = I(((C2714u) list.get(i8)).f22947a);
                i8++;
            }
            return iArr;
        }
        int[] iArr2 = new int[list.size() + i6];
        int iA = AbstractC3252r.A(list);
        int size2 = list.size();
        int i9 = 0;
        while (i8 < size2) {
            long j4 = ((C2714u) list.get(i8)).f22947a;
            if (C2714u.e(j4) == 0.0f) {
                if (i8 == 0) {
                    i7 = i9 + 1;
                    iArr2[i9] = I(C2714u.c(0.0f, ((C2714u) list.get(1)).f22947a));
                } else if (i8 == iA) {
                    i7 = i9 + 1;
                    iArr2[i9] = I(C2714u.c(0.0f, ((C2714u) list.get(i8 - 1)).f22947a));
                } else {
                    int i10 = i9 + 1;
                    iArr2[i9] = I(C2714u.c(0.0f, ((C2714u) list.get(i8 - 1)).f22947a));
                    i9 += 2;
                    iArr2[i10] = I(C2714u.c(0.0f, ((C2714u) list.get(i8 + 1)).f22947a));
                }
                i9 = i7;
            } else {
                iArr2[i9] = I(j4);
                i9++;
            }
            i8++;
        }
        return iArr2;
    }
}
