package q0;

import java.util.Arrays;
import p0.AbstractC2686D;

/* JADX INFO: renamed from: q0.r, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C2826r extends AbstractC2811c {

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public static final C2812d f23555r = new C2812d(6);

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final C2828t f23556d;

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

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

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final C2827s f23559g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final float[] f23560h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final float[] f23561i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final float[] f23562j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final InterfaceC2818j f23563k;
    public final C2825q l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final C2822n f23564m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final InterfaceC2818j f23565n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final C2825q f23566o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public final C2822n f23567p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final boolean f23568q;

    public C2826r(String str, float[] fArr, C2828t c2828t, final C2827s c2827s, int i6) {
        InterfaceC2818j interfaceC2818j;
        InterfaceC2818j interfaceC2818j2;
        double d6 = c2827s.f23569a;
        boolean z6 = d6 == -3.0d;
        double d7 = c2827s.f23575g;
        double d8 = c2827s.f23574f;
        if (z6) {
            final int i7 = 4;
            interfaceC2818j = new InterfaceC2818j() { // from class: q0.p
                @Override // q0.InterfaceC2818j
                public final double c(double d9) {
                    C2827s c2827s2 = c2827s;
                    switch (i7) {
                        case 0:
                            float[] fArr2 = C2813e.f23505a;
                            return C2813e.a(c2827s2, d9);
                        case 1:
                            float[] fArr3 = C2813e.f23505a;
                            return C2813e.c(c2827s2, d9);
                        case 2:
                            return d9 >= c2827s2.f23573e ? Math.pow((c2827s2.f23570b * d9) + c2827s2.f23571c, c2827s2.f23569a) : d9 * c2827s2.f23572d;
                        case 3:
                            double d10 = c2827s2.f23570b;
                            if (d9 >= c2827s2.f23573e) {
                                return Math.pow((d10 * d9) + c2827s2.f23571c, c2827s2.f23569a) + c2827s2.f23574f;
                            }
                            return c2827s2.f23575g + (c2827s2.f23572d * d9);
                        case 4:
                            float[] fArr4 = C2813e.f23505a;
                            return C2813e.b(c2827s2, d9);
                        case 5:
                            float[] fArr5 = C2813e.f23505a;
                            return C2813e.d(c2827s2, d9);
                        case 6:
                            double d11 = c2827s2.f23573e;
                            double d12 = c2827s2.f23572d;
                            return d9 >= d11 * d12 ? (Math.pow(d9, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / c2827s2.f23570b : d9 / d12;
                        default:
                            double d13 = c2827s2.f23570b;
                            double d14 = c2827s2.f23573e;
                            double d15 = c2827s2.f23572d;
                            return d9 >= d14 * d15 ? (Math.pow(d9 - c2827s2.f23574f, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / d13 : (d9 - c2827s2.f23575g) / d15;
                    }
                }
            };
        } else if (d6 == -2.0d) {
            final int i8 = 5;
            interfaceC2818j = new InterfaceC2818j() { // from class: q0.p
                @Override // q0.InterfaceC2818j
                public final double c(double d9) {
                    C2827s c2827s2 = c2827s;
                    switch (i8) {
                        case 0:
                            float[] fArr2 = C2813e.f23505a;
                            return C2813e.a(c2827s2, d9);
                        case 1:
                            float[] fArr3 = C2813e.f23505a;
                            return C2813e.c(c2827s2, d9);
                        case 2:
                            return d9 >= c2827s2.f23573e ? Math.pow((c2827s2.f23570b * d9) + c2827s2.f23571c, c2827s2.f23569a) : d9 * c2827s2.f23572d;
                        case 3:
                            double d10 = c2827s2.f23570b;
                            if (d9 >= c2827s2.f23573e) {
                                return Math.pow((d10 * d9) + c2827s2.f23571c, c2827s2.f23569a) + c2827s2.f23574f;
                            }
                            return c2827s2.f23575g + (c2827s2.f23572d * d9);
                        case 4:
                            float[] fArr4 = C2813e.f23505a;
                            return C2813e.b(c2827s2, d9);
                        case 5:
                            float[] fArr5 = C2813e.f23505a;
                            return C2813e.d(c2827s2, d9);
                        case 6:
                            double d11 = c2827s2.f23573e;
                            double d12 = c2827s2.f23572d;
                            return d9 >= d11 * d12 ? (Math.pow(d9, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / c2827s2.f23570b : d9 / d12;
                        default:
                            double d13 = c2827s2.f23570b;
                            double d14 = c2827s2.f23573e;
                            double d15 = c2827s2.f23572d;
                            return d9 >= d14 * d15 ? (Math.pow(d9 - c2827s2.f23574f, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / d13 : (d9 - c2827s2.f23575g) / d15;
                    }
                }
            };
        } else if (d8 == 0.0d && d7 == 0.0d) {
            final int i9 = 6;
            interfaceC2818j = new InterfaceC2818j() { // from class: q0.p
                @Override // q0.InterfaceC2818j
                public final double c(double d9) {
                    C2827s c2827s2 = c2827s;
                    switch (i9) {
                        case 0:
                            float[] fArr2 = C2813e.f23505a;
                            return C2813e.a(c2827s2, d9);
                        case 1:
                            float[] fArr3 = C2813e.f23505a;
                            return C2813e.c(c2827s2, d9);
                        case 2:
                            return d9 >= c2827s2.f23573e ? Math.pow((c2827s2.f23570b * d9) + c2827s2.f23571c, c2827s2.f23569a) : d9 * c2827s2.f23572d;
                        case 3:
                            double d10 = c2827s2.f23570b;
                            if (d9 >= c2827s2.f23573e) {
                                return Math.pow((d10 * d9) + c2827s2.f23571c, c2827s2.f23569a) + c2827s2.f23574f;
                            }
                            return c2827s2.f23575g + (c2827s2.f23572d * d9);
                        case 4:
                            float[] fArr4 = C2813e.f23505a;
                            return C2813e.b(c2827s2, d9);
                        case 5:
                            float[] fArr5 = C2813e.f23505a;
                            return C2813e.d(c2827s2, d9);
                        case 6:
                            double d11 = c2827s2.f23573e;
                            double d12 = c2827s2.f23572d;
                            return d9 >= d11 * d12 ? (Math.pow(d9, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / c2827s2.f23570b : d9 / d12;
                        default:
                            double d13 = c2827s2.f23570b;
                            double d14 = c2827s2.f23573e;
                            double d15 = c2827s2.f23572d;
                            return d9 >= d14 * d15 ? (Math.pow(d9 - c2827s2.f23574f, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / d13 : (d9 - c2827s2.f23575g) / d15;
                    }
                }
            };
        } else {
            final int i10 = 7;
            interfaceC2818j = new InterfaceC2818j() { // from class: q0.p
                @Override // q0.InterfaceC2818j
                public final double c(double d9) {
                    C2827s c2827s2 = c2827s;
                    switch (i10) {
                        case 0:
                            float[] fArr2 = C2813e.f23505a;
                            return C2813e.a(c2827s2, d9);
                        case 1:
                            float[] fArr3 = C2813e.f23505a;
                            return C2813e.c(c2827s2, d9);
                        case 2:
                            return d9 >= c2827s2.f23573e ? Math.pow((c2827s2.f23570b * d9) + c2827s2.f23571c, c2827s2.f23569a) : d9 * c2827s2.f23572d;
                        case 3:
                            double d10 = c2827s2.f23570b;
                            if (d9 >= c2827s2.f23573e) {
                                return Math.pow((d10 * d9) + c2827s2.f23571c, c2827s2.f23569a) + c2827s2.f23574f;
                            }
                            return c2827s2.f23575g + (c2827s2.f23572d * d9);
                        case 4:
                            float[] fArr4 = C2813e.f23505a;
                            return C2813e.b(c2827s2, d9);
                        case 5:
                            float[] fArr5 = C2813e.f23505a;
                            return C2813e.d(c2827s2, d9);
                        case 6:
                            double d11 = c2827s2.f23573e;
                            double d12 = c2827s2.f23572d;
                            return d9 >= d11 * d12 ? (Math.pow(d9, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / c2827s2.f23570b : d9 / d12;
                        default:
                            double d13 = c2827s2.f23570b;
                            double d14 = c2827s2.f23573e;
                            double d15 = c2827s2.f23572d;
                            return d9 >= d14 * d15 ? (Math.pow(d9 - c2827s2.f23574f, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / d13 : (d9 - c2827s2.f23575g) / d15;
                    }
                }
            };
        }
        if (d6 == -3.0d) {
            final int i11 = 0;
            interfaceC2818j2 = new InterfaceC2818j() { // from class: q0.p
                @Override // q0.InterfaceC2818j
                public final double c(double d9) {
                    C2827s c2827s2 = c2827s;
                    switch (i11) {
                        case 0:
                            float[] fArr2 = C2813e.f23505a;
                            return C2813e.a(c2827s2, d9);
                        case 1:
                            float[] fArr3 = C2813e.f23505a;
                            return C2813e.c(c2827s2, d9);
                        case 2:
                            return d9 >= c2827s2.f23573e ? Math.pow((c2827s2.f23570b * d9) + c2827s2.f23571c, c2827s2.f23569a) : d9 * c2827s2.f23572d;
                        case 3:
                            double d10 = c2827s2.f23570b;
                            if (d9 >= c2827s2.f23573e) {
                                return Math.pow((d10 * d9) + c2827s2.f23571c, c2827s2.f23569a) + c2827s2.f23574f;
                            }
                            return c2827s2.f23575g + (c2827s2.f23572d * d9);
                        case 4:
                            float[] fArr4 = C2813e.f23505a;
                            return C2813e.b(c2827s2, d9);
                        case 5:
                            float[] fArr5 = C2813e.f23505a;
                            return C2813e.d(c2827s2, d9);
                        case 6:
                            double d11 = c2827s2.f23573e;
                            double d12 = c2827s2.f23572d;
                            return d9 >= d11 * d12 ? (Math.pow(d9, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / c2827s2.f23570b : d9 / d12;
                        default:
                            double d13 = c2827s2.f23570b;
                            double d14 = c2827s2.f23573e;
                            double d15 = c2827s2.f23572d;
                            return d9 >= d14 * d15 ? (Math.pow(d9 - c2827s2.f23574f, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / d13 : (d9 - c2827s2.f23575g) / d15;
                    }
                }
            };
        } else if (d6 == -2.0d) {
            final int i12 = 1;
            interfaceC2818j2 = new InterfaceC2818j() { // from class: q0.p
                @Override // q0.InterfaceC2818j
                public final double c(double d9) {
                    C2827s c2827s2 = c2827s;
                    switch (i12) {
                        case 0:
                            float[] fArr2 = C2813e.f23505a;
                            return C2813e.a(c2827s2, d9);
                        case 1:
                            float[] fArr3 = C2813e.f23505a;
                            return C2813e.c(c2827s2, d9);
                        case 2:
                            return d9 >= c2827s2.f23573e ? Math.pow((c2827s2.f23570b * d9) + c2827s2.f23571c, c2827s2.f23569a) : d9 * c2827s2.f23572d;
                        case 3:
                            double d10 = c2827s2.f23570b;
                            if (d9 >= c2827s2.f23573e) {
                                return Math.pow((d10 * d9) + c2827s2.f23571c, c2827s2.f23569a) + c2827s2.f23574f;
                            }
                            return c2827s2.f23575g + (c2827s2.f23572d * d9);
                        case 4:
                            float[] fArr4 = C2813e.f23505a;
                            return C2813e.b(c2827s2, d9);
                        case 5:
                            float[] fArr5 = C2813e.f23505a;
                            return C2813e.d(c2827s2, d9);
                        case 6:
                            double d11 = c2827s2.f23573e;
                            double d12 = c2827s2.f23572d;
                            return d9 >= d11 * d12 ? (Math.pow(d9, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / c2827s2.f23570b : d9 / d12;
                        default:
                            double d13 = c2827s2.f23570b;
                            double d14 = c2827s2.f23573e;
                            double d15 = c2827s2.f23572d;
                            return d9 >= d14 * d15 ? (Math.pow(d9 - c2827s2.f23574f, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / d13 : (d9 - c2827s2.f23575g) / d15;
                    }
                }
            };
        } else if (d8 == 0.0d && d7 == 0.0d) {
            final int i13 = 2;
            interfaceC2818j2 = new InterfaceC2818j() { // from class: q0.p
                @Override // q0.InterfaceC2818j
                public final double c(double d9) {
                    C2827s c2827s2 = c2827s;
                    switch (i13) {
                        case 0:
                            float[] fArr2 = C2813e.f23505a;
                            return C2813e.a(c2827s2, d9);
                        case 1:
                            float[] fArr3 = C2813e.f23505a;
                            return C2813e.c(c2827s2, d9);
                        case 2:
                            return d9 >= c2827s2.f23573e ? Math.pow((c2827s2.f23570b * d9) + c2827s2.f23571c, c2827s2.f23569a) : d9 * c2827s2.f23572d;
                        case 3:
                            double d10 = c2827s2.f23570b;
                            if (d9 >= c2827s2.f23573e) {
                                return Math.pow((d10 * d9) + c2827s2.f23571c, c2827s2.f23569a) + c2827s2.f23574f;
                            }
                            return c2827s2.f23575g + (c2827s2.f23572d * d9);
                        case 4:
                            float[] fArr4 = C2813e.f23505a;
                            return C2813e.b(c2827s2, d9);
                        case 5:
                            float[] fArr5 = C2813e.f23505a;
                            return C2813e.d(c2827s2, d9);
                        case 6:
                            double d11 = c2827s2.f23573e;
                            double d12 = c2827s2.f23572d;
                            return d9 >= d11 * d12 ? (Math.pow(d9, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / c2827s2.f23570b : d9 / d12;
                        default:
                            double d13 = c2827s2.f23570b;
                            double d14 = c2827s2.f23573e;
                            double d15 = c2827s2.f23572d;
                            return d9 >= d14 * d15 ? (Math.pow(d9 - c2827s2.f23574f, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / d13 : (d9 - c2827s2.f23575g) / d15;
                    }
                }
            };
        } else {
            final int i14 = 3;
            interfaceC2818j2 = new InterfaceC2818j() { // from class: q0.p
                @Override // q0.InterfaceC2818j
                public final double c(double d9) {
                    C2827s c2827s2 = c2827s;
                    switch (i14) {
                        case 0:
                            float[] fArr2 = C2813e.f23505a;
                            return C2813e.a(c2827s2, d9);
                        case 1:
                            float[] fArr3 = C2813e.f23505a;
                            return C2813e.c(c2827s2, d9);
                        case 2:
                            return d9 >= c2827s2.f23573e ? Math.pow((c2827s2.f23570b * d9) + c2827s2.f23571c, c2827s2.f23569a) : d9 * c2827s2.f23572d;
                        case 3:
                            double d10 = c2827s2.f23570b;
                            if (d9 >= c2827s2.f23573e) {
                                return Math.pow((d10 * d9) + c2827s2.f23571c, c2827s2.f23569a) + c2827s2.f23574f;
                            }
                            return c2827s2.f23575g + (c2827s2.f23572d * d9);
                        case 4:
                            float[] fArr4 = C2813e.f23505a;
                            return C2813e.b(c2827s2, d9);
                        case 5:
                            float[] fArr5 = C2813e.f23505a;
                            return C2813e.d(c2827s2, d9);
                        case 6:
                            double d11 = c2827s2.f23573e;
                            double d12 = c2827s2.f23572d;
                            return d9 >= d11 * d12 ? (Math.pow(d9, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / c2827s2.f23570b : d9 / d12;
                        default:
                            double d13 = c2827s2.f23570b;
                            double d14 = c2827s2.f23573e;
                            double d15 = c2827s2.f23572d;
                            return d9 >= d14 * d15 ? (Math.pow(d9 - c2827s2.f23574f, 1.0d / c2827s2.f23569a) - c2827s2.f23571c) / d13 : (d9 - c2827s2.f23575g) / d15;
                    }
                }
            };
        }
        this(str, fArr, c2828t, null, interfaceC2818j, interfaceC2818j2, 0.0f, 1.0f, c2827s, i6);
    }

    @Override // q0.AbstractC2811c
    public final float a(int i6) {
        return this.f23558f;
    }

    @Override // q0.AbstractC2811c
    public final float b(int i6) {
        return this.f23557e;
    }

    @Override // q0.AbstractC2811c
    public final boolean c() {
        return this.f23568q;
    }

    @Override // q0.AbstractC2811c
    public final long d(float f6, float f7, float f8) {
        double d6 = f6;
        C2822n c2822n = this.f23567p;
        float fC = (float) c2822n.c(d6);
        float fC2 = (float) c2822n.c(f7);
        float fC3 = (float) c2822n.c(f8);
        float[] fArr = this.f23561i;
        if (fArr.length < 9) {
            return 0L;
        }
        float f9 = (fArr[6] * fC3) + (fArr[3] * fC2) + (fArr[0] * fC);
        return (((long) Float.floatToRawIntBits((fArr[7] * fC3) + (fArr[4] * fC2) + (fArr[1] * fC))) & 4294967295L) | (Float.floatToRawIntBits(f9) << 32);
    }

    @Override // q0.AbstractC2811c
    public final float e(float f6, float f7, float f8) {
        double d6 = f6;
        C2822n c2822n = this.f23567p;
        float fC = (float) c2822n.c(d6);
        float fC2 = (float) c2822n.c(f7);
        float fC3 = (float) c2822n.c(f8);
        float[] fArr = this.f23561i;
        return (fArr[8] * fC3) + (fArr[5] * fC2) + (fArr[2] * fC);
    }

    @Override // q0.AbstractC2811c
    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || C2826r.class != obj.getClass() || !super.equals(obj)) {
            return false;
        }
        C2826r c2826r = (C2826r) obj;
        if (Float.compare(c2826r.f23557e, this.f23557e) != 0 || Float.compare(c2826r.f23558f, this.f23558f) != 0 || !kotlin.jvm.internal.o.c(this.f23556d, c2826r.f23556d) || !Arrays.equals(this.f23560h, c2826r.f23560h)) {
            return false;
        }
        C2827s c2827s = c2826r.f23559g;
        C2827s c2827s2 = this.f23559g;
        if (c2827s2 != null) {
            return kotlin.jvm.internal.o.c(c2827s2, c2827s);
        }
        if (c2827s == null) {
            return true;
        }
        if (kotlin.jvm.internal.o.c(this.f23563k, c2826r.f23563k)) {
            return kotlin.jvm.internal.o.c(this.f23565n, c2826r.f23565n);
        }
        return false;
    }

    @Override // q0.AbstractC2811c
    public final long f(float f6, float f7, float f8, float f9, AbstractC2811c abstractC2811c) {
        float[] fArr = this.f23562j;
        float f10 = (fArr[6] * f8) + (fArr[3] * f7) + (fArr[0] * f6);
        float f11 = (fArr[7] * f8) + (fArr[4] * f7) + (fArr[1] * f6);
        float f12 = (fArr[8] * f8) + (fArr[5] * f7) + (fArr[2] * f6);
        C2822n c2822n = this.f23564m;
        return AbstractC2686D.b((float) c2822n.c(f10), (float) c2822n.c(f11), (float) c2822n.c(f12), f9, abstractC2811c);
    }

    @Override // q0.AbstractC2811c
    public final int hashCode() {
        int iHashCode = (Arrays.hashCode(this.f23560h) + ((this.f23556d.hashCode() + (super.hashCode() * 31)) * 31)) * 31;
        float f6 = this.f23557e;
        int iFloatToIntBits = (iHashCode + (f6 == 0.0f ? 0 : Float.floatToIntBits(f6))) * 31;
        float f7 = this.f23558f;
        int iFloatToIntBits2 = (iFloatToIntBits + (f7 == 0.0f ? 0 : Float.floatToIntBits(f7))) * 31;
        C2827s c2827s = this.f23559g;
        int iHashCode2 = iFloatToIntBits2 + (c2827s != null ? c2827s.hashCode() : 0);
        if (c2827s == null) {
            return this.f23565n.hashCode() + ((this.f23563k.hashCode() + (iHashCode2 * 31)) * 31);
        }
        return iHashCode2;
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:42:0x01e9  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x022d  */
    /* JADX WARN: Removed duplicated region for block: B:68:0x025f  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public C2826r(String str, float[] fArr, C2828t c2828t, float[] fArr2, InterfaceC2818j interfaceC2818j, InterfaceC2818j interfaceC2818j2, float f6, float f7, C2827s c2827s, int i6) {
        int i7;
        char c6;
        float f8;
        float f9;
        boolean z6;
        double d6;
        super(str, AbstractC2810b.f23496a, i6);
        int i8 = 0;
        int i9 = 1;
        this.f23556d = c2828t;
        this.f23557e = f6;
        this.f23558f = f7;
        this.f23559g = c2827s;
        this.f23563k = interfaceC2818j;
        this.l = new C2825q(this, i9);
        this.f23564m = new C2822n(this, i8);
        this.f23565n = interfaceC2818j2;
        this.f23566o = new C2825q(this, i8);
        this.f23567p = new C2822n(this, i9);
        if (fArr.length != 6 && fArr.length != 9) {
            throw new IllegalArgumentException("The color space's primaries must be defined as an array of 6 floats in xyY or 9 floats in XYZ");
        }
        if (f6 < f7) {
            float[] fArr3 = new float[6];
            if (fArr.length == 9) {
                float f10 = fArr[0];
                float f11 = fArr[1];
                float f12 = f10 + f11 + fArr[2];
                fArr3[0] = f10 / f12;
                fArr3[1] = f11 / f12;
                float f13 = fArr[3];
                float f14 = fArr[4];
                float f15 = f13 + f14 + fArr[5];
                fArr3[2] = f13 / f15;
                fArr3[3] = f14 / f15;
                float f16 = fArr[6];
                float f17 = fArr[7];
                float f18 = f16 + f17 + fArr[8];
                fArr3[4] = f16 / f18;
                fArr3[5] = f17 / f18;
            } else {
                System.arraycopy(fArr, 0, fArr3, 0, 6);
            }
            this.f23560h = fArr3;
            if (fArr2 == null) {
                float f19 = fArr3[0];
                float f20 = fArr3[1];
                float f21 = fArr3[2];
                float f22 = fArr3[3];
                float f23 = fArr3[4];
                float f24 = fArr3[5];
                f8 = 1.0f;
                float f25 = 1;
                float f26 = (f25 - f19) / f20;
                float f27 = (f25 - f21) / f22;
                float f28 = (f25 - f23) / f24;
                i7 = 0;
                float f29 = c2828t.f23576a;
                c6 = 1;
                float f30 = c2828t.f23577b;
                float f31 = (f25 - f29) / f30;
                float f32 = f19 / f20;
                float f33 = (f21 / f22) - f32;
                float f34 = (f29 / f30) - f32;
                float f35 = f27 - f26;
                float f36 = (f23 / f24) - f32;
                float f37 = (((f31 - f26) * f33) - (f34 * f35)) / (((f28 - f26) * f33) - (f35 * f36));
                float f38 = (f34 - (f36 * f37)) / f33;
                float f39 = (1.0f - f38) - f37;
                float f40 = f39 / f20;
                float f41 = f38 / f22;
                float f42 = f37 / f24;
                this.f23561i = new float[]{f40 * f19, f39, ((1.0f - f19) - f20) * f40, f41 * f21, f38, ((1.0f - f21) - f22) * f41, f42 * f23, f37, ((1.0f - f23) - f24) * f42};
            } else {
                i7 = 0;
                c6 = 1;
                f8 = 1.0f;
                if (fArr2.length == 9) {
                    this.f23561i = fArr2;
                } else {
                    throw new IllegalArgumentException("Transform must have 9 entries! Has " + fArr2.length);
                }
            }
            this.f23562j = AbstractC2819k.f(this.f23561i);
            float fB = AbstractC2819k.b(fArr3);
            float[] fArr4 = C2813e.f23505a;
            if (fB / AbstractC2819k.b(C2813e.f23506b) > 0.9f) {
                float[] fArr5 = C2813e.f23505a;
                float f43 = fArr3[i7];
                float f44 = fArr5[i7];
                float f45 = fArr3[c6];
                float f46 = fArr5[c6];
                float f47 = fArr3[2];
                float f48 = fArr5[2];
                float f49 = fArr3[3];
                float f50 = fArr5[3];
                float f51 = fArr3[4];
                float f52 = fArr5[4];
                float f53 = fArr3[5];
                float f54 = fArr5[5];
                f9 = 0.0f;
                float[] fArr6 = new float[6];
                fArr6[i7] = f43 - f44;
                fArr6[c6] = f45 - f46;
                fArr6[2] = f47 - f48;
                fArr6[3] = f49 - f50;
                fArr6[4] = f51 - f52;
                fArr6[5] = f53 - f54;
                float f55 = fArr6[i7];
                float f56 = fArr6[c6];
                if (((f46 - f54) * f55) - ((f44 - f52) * f56) >= 0.0f && ((f44 - f48) * f56) - ((f46 - f50) * f55) >= 0.0f) {
                    float f57 = fArr6[2];
                    float f58 = fArr6[3];
                    if (((f50 - f46) * f57) - ((f48 - f44) * f58) >= 0.0f && ((f48 - f52) * f58) - ((f50 - f54) * f57) >= 0.0f) {
                        float f59 = fArr6[4];
                        float f60 = fArr6[5];
                        if (((f54 - f50) * f59) - ((f52 - f48) * f60) < 0.0f || ((f52 - f44) * f60) - ((f54 - f46) * f59) < 0.0f) {
                        }
                    }
                }
                if (i6 != 0) {
                    float[] fArr7 = C2813e.f23505a;
                    if (fArr3 == fArr7) {
                        if (AbstractC2819k.d(c2828t, AbstractC2819k.f23540d) && f6 == f9 && f7 == f8) {
                            float[] fArr8 = C2813e.f23505a;
                            C2826r c2826r = C2813e.f23509e;
                            for (d6 = 0.0d; d6 <= 1.0d; d6 += 0.00392156862745098d) {
                                if (Math.abs(interfaceC2818j.c(d6) - c2826r.f23563k.c(d6)) <= 0.001d && Math.abs(interfaceC2818j2.c(d6) - c2826r.f23565n.c(d6)) <= 0.001d) {
                                }
                            }
                            z6 = c6;
                        }
                        z6 = i7;
                        break;
                    }
                    for (int i10 = i7; i10 < 6; i10++) {
                        if (Float.compare(fArr3[i10], fArr7[i10]) != 0 && Math.abs(fArr3[i10] - fArr7[i10]) > 0.001f) {
                            break;
                        }
                    }
                    if (AbstractC2819k.d(c2828t, AbstractC2819k.f23540d)) {
                        float[] fArr82 = C2813e.f23505a;
                        C2826r c2826r2 = C2813e.f23509e;
                        while (d6 <= 1.0d) {
                        }
                        z6 = c6;
                    }
                    z6 = i7;
                    break;
                }
                z6 = c6;
                this.f23568q = z6;
                return;
            }
            f9 = 0.0f;
            int i11 = (f6 > f9 ? 1 : (f6 == f9 ? 0 : -1));
            if (i6 != 0) {
            }
            this.f23568q = z6;
            return;
        }
        throw new IllegalArgumentException("Invalid range: min=" + f6 + ", max=" + f7 + "; min must be strictly < max");
    }

    /* JADX WARN: Illegal instructions before constructor call */
    public C2826r(String str, float[] fArr, C2828t c2828t, final double d6, float f6, float f7, int i6) {
        InterfaceC2818j interfaceC2818j;
        InterfaceC2818j interfaceC2818j2 = f23555r;
        if (d6 == 1.0d) {
            interfaceC2818j = interfaceC2818j2;
        } else {
            final int i7 = 0;
            interfaceC2818j = new InterfaceC2818j() { // from class: q0.o
                @Override // q0.InterfaceC2818j
                public final double c(double d7) {
                    switch (i7) {
                        case 0:
                            if (d7 < 0.0d) {
                                d7 = 0.0d;
                            }
                            return Math.pow(d7, 1.0d / d6);
                        default:
                            if (d7 < 0.0d) {
                                d7 = 0.0d;
                            }
                            return Math.pow(d7, d6);
                    }
                }
            };
        }
        if (d6 != 1.0d) {
            final int i8 = 1;
            interfaceC2818j2 = new InterfaceC2818j() { // from class: q0.o
                @Override // q0.InterfaceC2818j
                public final double c(double d7) {
                    switch (i8) {
                        case 0:
                            if (d7 < 0.0d) {
                                d7 = 0.0d;
                            }
                            return Math.pow(d7, 1.0d / d6);
                        default:
                            if (d7 < 0.0d) {
                                d7 = 0.0d;
                            }
                            return Math.pow(d7, d6);
                    }
                }
            };
        }
        this(str, fArr, c2828t, null, interfaceC2818j, interfaceC2818j2, f6, f7, new C2827s(d6, 1.0d, 0.0d, 0.0d, 0.0d), i6);
    }
}
