package o;

import java.util.Arrays;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class R20 extends AbstractC0345Ni {
    public static final C0387Oy r = new C0387Oy(10);
    public final Yk0 d;
    public final float e;
    public final float f;
    public final C1595jg0 g;
    public final float[] h;
    public final float[] i;
    public final float[] j;
    public final InterfaceC0070Cs k;
    public final Q20 l;
    public final N20 m;
    public final InterfaceC0070Cs n;

    /* renamed from: o, reason: collision with root package name */
    public final Q20 f306o;
    public final N20 p;
    public final boolean q;

    public R20(String str, float[] fArr, Yk0 yk0, final C1595jg0 c1595jg0, int i) {
        InterfaceC0070Cs interfaceC0070Cs;
        InterfaceC0070Cs interfaceC0070Cs2;
        double d = c1595jg0.a;
        boolean z = d == -3.0d;
        double d2 = c1595jg0.g;
        double d3 = c1595jg0.f;
        if (z) {
            final int i2 = 4;
            interfaceC0070Cs = new InterfaceC0070Cs() { // from class: o.P20
                @Override // o.InterfaceC0070Cs
                public final double c(double d4) {
                    int i3 = i2;
                    C1595jg0 c1595jg02 = c1595jg0;
                    switch (i3) {
                        case 0:
                            float[] fArr2 = C0423Qi.a;
                            return C0423Qi.a(c1595jg02, d4);
                        case 1:
                            float[] fArr3 = C0423Qi.a;
                            return C0423Qi.c(c1595jg02, d4);
                        case 2:
                            double d5 = c1595jg02.b;
                            return d4 >= c1595jg02.e ? Math.pow((d5 * d4) + c1595jg02.c, c1595jg02.a) : d4 * c1595jg02.d;
                        case 3:
                            double d6 = c1595jg02.b;
                            double d7 = c1595jg02.c;
                            double d8 = c1595jg02.d;
                            return d4 >= c1595jg02.e ? Math.pow((d6 * d4) + d7, c1595jg02.a) + c1595jg02.f : (d8 * d4) + c1595jg02.g;
                        case 4:
                            float[] fArr4 = C0423Qi.a;
                            return C0423Qi.b(c1595jg02, d4);
                        case 5:
                            float[] fArr5 = C0423Qi.a;
                            return C0423Qi.d(c1595jg02, d4);
                        case 6:
                            double d9 = c1595jg02.b;
                            double d10 = c1595jg02.c;
                            double d11 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d11 ? (Math.pow(d4, 1.0d / c1595jg02.a) - d10) / d9 : d4 / d11;
                        default:
                            double d12 = c1595jg02.b;
                            double d13 = c1595jg02.c;
                            double d14 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d14 ? (Math.pow(d4 - c1595jg02.f, 1.0d / c1595jg02.a) - d13) / d12 : (d4 - c1595jg02.g) / d14;
                    }
                }
            };
        } else if (d == -2.0d) {
            final int i3 = 5;
            interfaceC0070Cs = new InterfaceC0070Cs() { // from class: o.P20
                @Override // o.InterfaceC0070Cs
                public final double c(double d4) {
                    int i32 = i3;
                    C1595jg0 c1595jg02 = c1595jg0;
                    switch (i32) {
                        case 0:
                            float[] fArr2 = C0423Qi.a;
                            return C0423Qi.a(c1595jg02, d4);
                        case 1:
                            float[] fArr3 = C0423Qi.a;
                            return C0423Qi.c(c1595jg02, d4);
                        case 2:
                            double d5 = c1595jg02.b;
                            return d4 >= c1595jg02.e ? Math.pow((d5 * d4) + c1595jg02.c, c1595jg02.a) : d4 * c1595jg02.d;
                        case 3:
                            double d6 = c1595jg02.b;
                            double d7 = c1595jg02.c;
                            double d8 = c1595jg02.d;
                            return d4 >= c1595jg02.e ? Math.pow((d6 * d4) + d7, c1595jg02.a) + c1595jg02.f : (d8 * d4) + c1595jg02.g;
                        case 4:
                            float[] fArr4 = C0423Qi.a;
                            return C0423Qi.b(c1595jg02, d4);
                        case 5:
                            float[] fArr5 = C0423Qi.a;
                            return C0423Qi.d(c1595jg02, d4);
                        case 6:
                            double d9 = c1595jg02.b;
                            double d10 = c1595jg02.c;
                            double d11 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d11 ? (Math.pow(d4, 1.0d / c1595jg02.a) - d10) / d9 : d4 / d11;
                        default:
                            double d12 = c1595jg02.b;
                            double d13 = c1595jg02.c;
                            double d14 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d14 ? (Math.pow(d4 - c1595jg02.f, 1.0d / c1595jg02.a) - d13) / d12 : (d4 - c1595jg02.g) / d14;
                    }
                }
            };
        } else if (d3 == 0.0d && d2 == 0.0d) {
            final int i4 = 6;
            interfaceC0070Cs = new InterfaceC0070Cs() { // from class: o.P20
                @Override // o.InterfaceC0070Cs
                public final double c(double d4) {
                    int i32 = i4;
                    C1595jg0 c1595jg02 = c1595jg0;
                    switch (i32) {
                        case 0:
                            float[] fArr2 = C0423Qi.a;
                            return C0423Qi.a(c1595jg02, d4);
                        case 1:
                            float[] fArr3 = C0423Qi.a;
                            return C0423Qi.c(c1595jg02, d4);
                        case 2:
                            double d5 = c1595jg02.b;
                            return d4 >= c1595jg02.e ? Math.pow((d5 * d4) + c1595jg02.c, c1595jg02.a) : d4 * c1595jg02.d;
                        case 3:
                            double d6 = c1595jg02.b;
                            double d7 = c1595jg02.c;
                            double d8 = c1595jg02.d;
                            return d4 >= c1595jg02.e ? Math.pow((d6 * d4) + d7, c1595jg02.a) + c1595jg02.f : (d8 * d4) + c1595jg02.g;
                        case 4:
                            float[] fArr4 = C0423Qi.a;
                            return C0423Qi.b(c1595jg02, d4);
                        case 5:
                            float[] fArr5 = C0423Qi.a;
                            return C0423Qi.d(c1595jg02, d4);
                        case 6:
                            double d9 = c1595jg02.b;
                            double d10 = c1595jg02.c;
                            double d11 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d11 ? (Math.pow(d4, 1.0d / c1595jg02.a) - d10) / d9 : d4 / d11;
                        default:
                            double d12 = c1595jg02.b;
                            double d13 = c1595jg02.c;
                            double d14 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d14 ? (Math.pow(d4 - c1595jg02.f, 1.0d / c1595jg02.a) - d13) / d12 : (d4 - c1595jg02.g) / d14;
                    }
                }
            };
        } else {
            final int i5 = 7;
            interfaceC0070Cs = new InterfaceC0070Cs() { // from class: o.P20
                @Override // o.InterfaceC0070Cs
                public final double c(double d4) {
                    int i32 = i5;
                    C1595jg0 c1595jg02 = c1595jg0;
                    switch (i32) {
                        case 0:
                            float[] fArr2 = C0423Qi.a;
                            return C0423Qi.a(c1595jg02, d4);
                        case 1:
                            float[] fArr3 = C0423Qi.a;
                            return C0423Qi.c(c1595jg02, d4);
                        case 2:
                            double d5 = c1595jg02.b;
                            return d4 >= c1595jg02.e ? Math.pow((d5 * d4) + c1595jg02.c, c1595jg02.a) : d4 * c1595jg02.d;
                        case 3:
                            double d6 = c1595jg02.b;
                            double d7 = c1595jg02.c;
                            double d8 = c1595jg02.d;
                            return d4 >= c1595jg02.e ? Math.pow((d6 * d4) + d7, c1595jg02.a) + c1595jg02.f : (d8 * d4) + c1595jg02.g;
                        case 4:
                            float[] fArr4 = C0423Qi.a;
                            return C0423Qi.b(c1595jg02, d4);
                        case 5:
                            float[] fArr5 = C0423Qi.a;
                            return C0423Qi.d(c1595jg02, d4);
                        case 6:
                            double d9 = c1595jg02.b;
                            double d10 = c1595jg02.c;
                            double d11 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d11 ? (Math.pow(d4, 1.0d / c1595jg02.a) - d10) / d9 : d4 / d11;
                        default:
                            double d12 = c1595jg02.b;
                            double d13 = c1595jg02.c;
                            double d14 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d14 ? (Math.pow(d4 - c1595jg02.f, 1.0d / c1595jg02.a) - d13) / d12 : (d4 - c1595jg02.g) / d14;
                    }
                }
            };
        }
        if (d == -3.0d) {
            final int i6 = 0;
            interfaceC0070Cs2 = new InterfaceC0070Cs() { // from class: o.P20
                @Override // o.InterfaceC0070Cs
                public final double c(double d4) {
                    int i32 = i6;
                    C1595jg0 c1595jg02 = c1595jg0;
                    switch (i32) {
                        case 0:
                            float[] fArr2 = C0423Qi.a;
                            return C0423Qi.a(c1595jg02, d4);
                        case 1:
                            float[] fArr3 = C0423Qi.a;
                            return C0423Qi.c(c1595jg02, d4);
                        case 2:
                            double d5 = c1595jg02.b;
                            return d4 >= c1595jg02.e ? Math.pow((d5 * d4) + c1595jg02.c, c1595jg02.a) : d4 * c1595jg02.d;
                        case 3:
                            double d6 = c1595jg02.b;
                            double d7 = c1595jg02.c;
                            double d8 = c1595jg02.d;
                            return d4 >= c1595jg02.e ? Math.pow((d6 * d4) + d7, c1595jg02.a) + c1595jg02.f : (d8 * d4) + c1595jg02.g;
                        case 4:
                            float[] fArr4 = C0423Qi.a;
                            return C0423Qi.b(c1595jg02, d4);
                        case 5:
                            float[] fArr5 = C0423Qi.a;
                            return C0423Qi.d(c1595jg02, d4);
                        case 6:
                            double d9 = c1595jg02.b;
                            double d10 = c1595jg02.c;
                            double d11 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d11 ? (Math.pow(d4, 1.0d / c1595jg02.a) - d10) / d9 : d4 / d11;
                        default:
                            double d12 = c1595jg02.b;
                            double d13 = c1595jg02.c;
                            double d14 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d14 ? (Math.pow(d4 - c1595jg02.f, 1.0d / c1595jg02.a) - d13) / d12 : (d4 - c1595jg02.g) / d14;
                    }
                }
            };
        } else if (d == -2.0d) {
            final int i7 = 1;
            interfaceC0070Cs2 = new InterfaceC0070Cs() { // from class: o.P20
                @Override // o.InterfaceC0070Cs
                public final double c(double d4) {
                    int i32 = i7;
                    C1595jg0 c1595jg02 = c1595jg0;
                    switch (i32) {
                        case 0:
                            float[] fArr2 = C0423Qi.a;
                            return C0423Qi.a(c1595jg02, d4);
                        case 1:
                            float[] fArr3 = C0423Qi.a;
                            return C0423Qi.c(c1595jg02, d4);
                        case 2:
                            double d5 = c1595jg02.b;
                            return d4 >= c1595jg02.e ? Math.pow((d5 * d4) + c1595jg02.c, c1595jg02.a) : d4 * c1595jg02.d;
                        case 3:
                            double d6 = c1595jg02.b;
                            double d7 = c1595jg02.c;
                            double d8 = c1595jg02.d;
                            return d4 >= c1595jg02.e ? Math.pow((d6 * d4) + d7, c1595jg02.a) + c1595jg02.f : (d8 * d4) + c1595jg02.g;
                        case 4:
                            float[] fArr4 = C0423Qi.a;
                            return C0423Qi.b(c1595jg02, d4);
                        case 5:
                            float[] fArr5 = C0423Qi.a;
                            return C0423Qi.d(c1595jg02, d4);
                        case 6:
                            double d9 = c1595jg02.b;
                            double d10 = c1595jg02.c;
                            double d11 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d11 ? (Math.pow(d4, 1.0d / c1595jg02.a) - d10) / d9 : d4 / d11;
                        default:
                            double d12 = c1595jg02.b;
                            double d13 = c1595jg02.c;
                            double d14 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d14 ? (Math.pow(d4 - c1595jg02.f, 1.0d / c1595jg02.a) - d13) / d12 : (d4 - c1595jg02.g) / d14;
                    }
                }
            };
        } else if (d3 == 0.0d && d2 == 0.0d) {
            final int i8 = 2;
            interfaceC0070Cs2 = new InterfaceC0070Cs() { // from class: o.P20
                @Override // o.InterfaceC0070Cs
                public final double c(double d4) {
                    int i32 = i8;
                    C1595jg0 c1595jg02 = c1595jg0;
                    switch (i32) {
                        case 0:
                            float[] fArr2 = C0423Qi.a;
                            return C0423Qi.a(c1595jg02, d4);
                        case 1:
                            float[] fArr3 = C0423Qi.a;
                            return C0423Qi.c(c1595jg02, d4);
                        case 2:
                            double d5 = c1595jg02.b;
                            return d4 >= c1595jg02.e ? Math.pow((d5 * d4) + c1595jg02.c, c1595jg02.a) : d4 * c1595jg02.d;
                        case 3:
                            double d6 = c1595jg02.b;
                            double d7 = c1595jg02.c;
                            double d8 = c1595jg02.d;
                            return d4 >= c1595jg02.e ? Math.pow((d6 * d4) + d7, c1595jg02.a) + c1595jg02.f : (d8 * d4) + c1595jg02.g;
                        case 4:
                            float[] fArr4 = C0423Qi.a;
                            return C0423Qi.b(c1595jg02, d4);
                        case 5:
                            float[] fArr5 = C0423Qi.a;
                            return C0423Qi.d(c1595jg02, d4);
                        case 6:
                            double d9 = c1595jg02.b;
                            double d10 = c1595jg02.c;
                            double d11 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d11 ? (Math.pow(d4, 1.0d / c1595jg02.a) - d10) / d9 : d4 / d11;
                        default:
                            double d12 = c1595jg02.b;
                            double d13 = c1595jg02.c;
                            double d14 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d14 ? (Math.pow(d4 - c1595jg02.f, 1.0d / c1595jg02.a) - d13) / d12 : (d4 - c1595jg02.g) / d14;
                    }
                }
            };
        } else {
            final int i9 = 3;
            interfaceC0070Cs2 = new InterfaceC0070Cs() { // from class: o.P20
                @Override // o.InterfaceC0070Cs
                public final double c(double d4) {
                    int i32 = i9;
                    C1595jg0 c1595jg02 = c1595jg0;
                    switch (i32) {
                        case 0:
                            float[] fArr2 = C0423Qi.a;
                            return C0423Qi.a(c1595jg02, d4);
                        case 1:
                            float[] fArr3 = C0423Qi.a;
                            return C0423Qi.c(c1595jg02, d4);
                        case 2:
                            double d5 = c1595jg02.b;
                            return d4 >= c1595jg02.e ? Math.pow((d5 * d4) + c1595jg02.c, c1595jg02.a) : d4 * c1595jg02.d;
                        case 3:
                            double d6 = c1595jg02.b;
                            double d7 = c1595jg02.c;
                            double d8 = c1595jg02.d;
                            return d4 >= c1595jg02.e ? Math.pow((d6 * d4) + d7, c1595jg02.a) + c1595jg02.f : (d8 * d4) + c1595jg02.g;
                        case 4:
                            float[] fArr4 = C0423Qi.a;
                            return C0423Qi.b(c1595jg02, d4);
                        case 5:
                            float[] fArr5 = C0423Qi.a;
                            return C0423Qi.d(c1595jg02, d4);
                        case 6:
                            double d9 = c1595jg02.b;
                            double d10 = c1595jg02.c;
                            double d11 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d11 ? (Math.pow(d4, 1.0d / c1595jg02.a) - d10) / d9 : d4 / d11;
                        default:
                            double d12 = c1595jg02.b;
                            double d13 = c1595jg02.c;
                            double d14 = c1595jg02.d;
                            return d4 >= c1595jg02.e * d14 ? (Math.pow(d4 - c1595jg02.f, 1.0d / c1595jg02.a) - d13) / d12 : (d4 - c1595jg02.g) / d14;
                    }
                }
            };
        }
        this(str, fArr, yk0, null, interfaceC0070Cs, interfaceC0070Cs2, 0.0f, 1.0f, c1595jg0, i);
    }

    @Override // o.AbstractC0345Ni
    public final float a(int i) {
        return this.f;
    }

    @Override // o.AbstractC0345Ni
    public final float b(int i) {
        return this.e;
    }

    @Override // o.AbstractC0345Ni
    public final boolean c() {
        return this.q;
    }

    @Override // o.AbstractC0345Ni
    public final long d(float f, float f2, float f3) {
        double d = f;
        N20 n20 = this.p;
        float fC = (float) n20.c(d);
        float fC2 = (float) n20.c(f2);
        float fC3 = (float) n20.c(f3);
        float[] fArr = this.i;
        if (fArr.length < 9) {
            return 0L;
        }
        float f4 = (fArr[6] * fC3) + (fArr[3] * fC2) + (fArr[0] * fC);
        float f5 = (fArr[7] * fC3) + (fArr[4] * fC2) + (fArr[1] * fC);
        return (Float.floatToRawIntBits(f5) & 4294967295L) | (Float.floatToRawIntBits(f4) << 32);
    }

    @Override // o.AbstractC0345Ni
    public final float e(float f, float f2, float f3) {
        double d = f;
        N20 n20 = this.p;
        float fC = (float) n20.c(d);
        float fC2 = (float) n20.c(f2);
        float fC3 = (float) n20.c(f3);
        float[] fArr = this.i;
        return (fArr[8] * fC3) + (fArr[5] * fC2) + (fArr[2] * fC);
    }

    @Override // o.AbstractC0345Ni
    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || R20.class != obj.getClass() || !super.equals(obj)) {
            return false;
        }
        R20 r20 = (R20) obj;
        C1595jg0 c1595jg0 = r20.g;
        if (Float.compare(r20.e, this.e) != 0 || Float.compare(r20.f, this.f) != 0 || !F3.c(this.d, r20.d) || !Arrays.equals(this.h, r20.h)) {
            return false;
        }
        C1595jg0 c1595jg02 = this.g;
        if (c1595jg02 != null) {
            return F3.c(c1595jg02, c1595jg0);
        }
        if (c1595jg0 == null) {
            return true;
        }
        if (F3.c(this.k, r20.k)) {
            return F3.c(this.n, r20.n);
        }
        return false;
    }

    @Override // o.AbstractC0345Ni
    public final long f(float f, float f2, float f3, float f4, AbstractC0345Ni abstractC0345Ni) {
        float[] fArr = this.j;
        float f5 = (fArr[6] * f3) + (fArr[3] * f2) + (fArr[0] * f);
        float f6 = (fArr[7] * f3) + (fArr[4] * f2) + (fArr[1] * f);
        float f7 = (fArr[8] * f3) + (fArr[5] * f2) + (fArr[2] * f);
        N20 n20 = this.m;
        return AbstractC0752ap.a((float) n20.c(f5), (float) n20.c(f6), (float) n20.c(f7), f4, abstractC0345Ni);
    }

    @Override // o.AbstractC0345Ni
    public final int hashCode() {
        int iHashCode = (Arrays.hashCode(this.h) + ((this.d.hashCode() + (super.hashCode() * 31)) * 31)) * 31;
        float f = this.e;
        int iFloatToIntBits = (iHashCode + (f == 0.0f ? 0 : Float.floatToIntBits(f))) * 31;
        float f2 = this.f;
        int iFloatToIntBits2 = (iFloatToIntBits + (f2 == 0.0f ? 0 : Float.floatToIntBits(f2))) * 31;
        C1595jg0 c1595jg0 = this.g;
        int iHashCode2 = iFloatToIntBits2 + (c1595jg0 != null ? c1595jg0.hashCode() : 0);
        if (c1595jg0 == null) {
            return this.n.hashCode() + ((this.k.hashCode() + (iHashCode2 * 31)) * 31);
        }
        return iHashCode2;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:42:0x01ed  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x0231  */
    /* JADX WARN: Removed duplicated region for block: B:68:0x0263 A[EDGE_INSN: B:68:0x0263->B:69:0x0265 BREAK  A[LOOP:1: B:61:0x022b->B:67:0x025c], EDGE_INSN: B:75:0x0263->B:68:0x0263 BREAK  A[LOOP:0: B:46:0x01f4->B:52:0x0211]] */
    /* JADX WARN: Type inference failed for: r41v1 */
    /* JADX WARN: Type inference failed for: r41v2 */
    /* JADX WARN: Type inference failed for: r41v3 */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public R20(java.lang.String r33, float[] r34, o.Yk0 r35, float[] r36, o.InterfaceC0070Cs r37, o.InterfaceC0070Cs r38, float r39, float r40, o.C1595jg0 r41, int r42) {
        /*
            Method dump skipped, instructions count: 670
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: o.R20.<init>(java.lang.String, float[], o.Yk0, float[], o.Cs, o.Cs, float, float, o.jg0, int):void");
    }

    /* JADX WARN: Illegal instructions before constructor call */
    public R20(String str, float[] fArr, Yk0 yk0, final double d, float f, float f2, int i) {
        InterfaceC0070Cs interfaceC0070Cs;
        InterfaceC0070Cs interfaceC0070Cs2 = r;
        if (d == 1.0d) {
            interfaceC0070Cs = interfaceC0070Cs2;
        } else {
            final int i2 = 0;
            interfaceC0070Cs = new InterfaceC0070Cs() { // from class: o.O20
                @Override // o.InterfaceC0070Cs
                public final double c(double d2) {
                    switch (i2) {
                        case 0:
                            if (d2 < 0.0d) {
                                d2 = 0.0d;
                            }
                            return Math.pow(d2, 1.0d / d);
                        default:
                            if (d2 < 0.0d) {
                                d2 = 0.0d;
                            }
                            return Math.pow(d2, d);
                    }
                }
            };
        }
        if (d != 1.0d) {
            final int i3 = 1;
            interfaceC0070Cs2 = new InterfaceC0070Cs() { // from class: o.O20
                @Override // o.InterfaceC0070Cs
                public final double c(double d2) {
                    switch (i3) {
                        case 0:
                            if (d2 < 0.0d) {
                                d2 = 0.0d;
                            }
                            return Math.pow(d2, 1.0d / d);
                        default:
                            if (d2 < 0.0d) {
                                d2 = 0.0d;
                            }
                            return Math.pow(d2, d);
                    }
                }
            };
        }
        this(str, fArr, yk0, null, interfaceC0070Cs, interfaceC0070Cs2, f, f2, new C1595jg0(d, 1.0d, 0.0d, 0.0d, 0.0d), i);
    }
}
