package ῲ.ᨨ.ʬ;

import android.graphics.Path;
import android.util.Log;
import K.K.K.ʬ.C2369;

/* renamed from: ῲ.ᨨ.ʬ.ʬ  reason: contains not printable characters */
/* compiled from: PathParser */
public class C1708 {

    /* renamed from: ῲ  reason: contains not printable characters */
    public float[] f5999;

    /* renamed from: K  reason: contains not printable characters */
    public char f6000;

    public C1708(char c, float[] fArr) {
        this.f6000 = c;
        this.f5999 = fArr;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m4379(C1708[] r31, Path path) {
        int i;
        int i2;
        float[] fArr;
        int i3;
        char c;
        float f;
        float f2;
        float f3;
        float f4;
        float f5;
        float f6;
        float f7;
        float f8;
        float f9;
        float f10;
        float f11;
        float f12;
        float f13;
        float f14;
        float f15;
        float f16;
        C1708[] r0 = r31;
        float[] fArr2 = new float[6];
        char c2 = 'm';
        char c3 = 0;
        char c4 = 'm';
        int i4 = 0;
        while (i4 < r0.length) {
            char c5 = r0[i4].f6000;
            float[] fArr3 = r0[i4].f5999;
            float f17 = fArr2[c3];
            float f18 = fArr2[1];
            float f19 = fArr2[2];
            float f20 = fArr2[3];
            float f21 = fArr2[4];
            float f22 = fArr2[5];
            switch (c5) {
                case 'A':
                case 'a':
                    i = 7;
                    break;
                case 'C':
                case 'c':
                    i = 6;
                    break;
                case 'H':
                case 'V':
                case 'h':
                case 'v':
                    i = 1;
                    break;
                case 'Q':
                case 'S':
                case 'q':
                case 's':
                    i = 4;
                    break;
                case 'Z':
                case 'z':
                    path.close();
                    path.moveTo(f21, f22);
                    f17 = f21;
                    f19 = f17;
                    f18 = f22;
                    f20 = f18;
                default:
                    i = 2;
                    break;
            }
            float f23 = f21;
            float f24 = f22;
            int i5 = 0;
            float f25 = f18;
            char c6 = c4;
            float f26 = f20;
            float f27 = f17;
            while (i5 < fArr3.length) {
                if (c5 != 'A') {
                    if (c5 == 'C') {
                        i3 = i5;
                        fArr = fArr3;
                        c = c5;
                        i2 = i4;
                        int i6 = i3 + 2;
                        int i7 = i3 + 3;
                        int i8 = i3 + 4;
                        int i9 = i3 + 5;
                        path.cubicTo(fArr[i3 + 0], fArr[i3 + 1], fArr[i6], fArr[i7], fArr[i8], fArr[i9]);
                        f27 = fArr[i8];
                        f25 = fArr[i9];
                        float f28 = fArr[i6];
                        f26 = fArr[i7];
                        f19 = f28;
                    } else if (c5 == 'H') {
                        i3 = i5;
                        fArr = fArr3;
                        c = c5;
                        i2 = i4;
                        int i10 = i3 + 0;
                        path.lineTo(fArr[i10], f25);
                        f27 = fArr[i10];
                    } else if (c5 == 'Q') {
                        i3 = i5;
                        fArr = fArr3;
                        c = c5;
                        i2 = i4;
                        int i11 = i3 + 0;
                        int i12 = i3 + 1;
                        int i13 = i3 + 2;
                        int i14 = i3 + 3;
                        path.quadTo(fArr[i11], fArr[i12], fArr[i13], fArr[i14]);
                        float f29 = fArr[i11];
                        f26 = fArr[i12];
                        float f30 = fArr[i13];
                        f25 = fArr[i14];
                        f19 = f29;
                        f27 = f30;
                    } else if (c5 == 'V') {
                        i3 = i5;
                        fArr = fArr3;
                        c = c5;
                        i2 = i4;
                        int i15 = i3 + 0;
                        path.lineTo(f27, fArr[i15]);
                        f25 = fArr[i15];
                    } else if (c5 != 'a') {
                        if (c5 != 'c') {
                            if (c5 == 'h') {
                                i3 = i5;
                                int i16 = i3 + 0;
                                path.rLineTo(fArr3[i16], 0.0f);
                                f27 += fArr3[i16];
                            } else if (c5 != 'q') {
                                if (c5 == 'v') {
                                    f8 = f27;
                                    f10 = f25;
                                    i3 = i5;
                                    int i17 = i3 + 0;
                                    path.rLineTo(0.0f, fArr3[i17]);
                                    f9 = fArr3[i17];
                                } else if (c5 != 'L') {
                                    if (c5 == 'M') {
                                        i3 = i5;
                                        int i18 = i3 + 0;
                                        float f31 = fArr3[i18];
                                        int i19 = i3 + 1;
                                        f = fArr3[i19];
                                        if (i3 > 0) {
                                            path.lineTo(fArr3[i18], fArr3[i19]);
                                            f27 = f31;
                                            f25 = f;
                                        } else {
                                            path.moveTo(fArr3[i18], fArr3[i19]);
                                            f23 = f31;
                                            f24 = f;
                                        }
                                    } else if (c5 == 'S') {
                                        i3 = i5;
                                        if (c6 == 'c' || c6 == 's' || c6 == 'C' || c6 == 'S') {
                                            f12 = (f27 * 2.0f) - f19;
                                            f11 = (f25 * 2.0f) - f26;
                                        } else {
                                            f11 = f25;
                                            f12 = f27;
                                        }
                                        int i20 = i3 + 0;
                                        int i21 = i3 + 1;
                                        int i22 = i3 + 2;
                                        int i23 = i3 + 3;
                                        path.cubicTo(f12, f11, fArr3[i20], fArr3[i21], fArr3[i22], fArr3[i23]);
                                        float f32 = fArr3[i20];
                                        f26 = fArr3[i21];
                                        f2 = fArr3[i22];
                                        f = fArr3[i23];
                                        f19 = f32;
                                        f27 = f2;
                                        f25 = f;
                                    } else if (c5 == 'T') {
                                        float f33 = f27;
                                        float f34 = f25;
                                        i3 = i5;
                                        if (c6 == 'q' || c6 == 't' || c6 == 'Q' || c6 == 'T') {
                                            f33 = (f33 * 2.0f) - f19;
                                            f34 = (f34 * 2.0f) - f26;
                                        }
                                        int i24 = i3 + 0;
                                        int i25 = i3 + 1;
                                        path.quadTo(f33, f34, fArr3[i24], fArr3[i25]);
                                        f27 = fArr3[i24];
                                        f25 = fArr3[i25];
                                        f26 = f34;
                                        fArr = fArr3;
                                        c = c5;
                                        i2 = i4;
                                        f19 = f33;
                                    } else if (c5 == 'l') {
                                        f10 = f25;
                                        i3 = i5;
                                        int i26 = i3 + 0;
                                        int i27 = i3 + 1;
                                        path.rLineTo(fArr3[i26], fArr3[i27]);
                                        float f35 = f27 + fArr3[i26];
                                        f9 = fArr3[i27];
                                        f8 = f35;
                                    } else if (c5 == c2) {
                                        i3 = i5;
                                        int i28 = i3 + 0;
                                        f27 += fArr3[i28];
                                        int i29 = i3 + 1;
                                        f25 += fArr3[i29];
                                        if (i3 > 0) {
                                            path.rLineTo(fArr3[i28], fArr3[i29]);
                                        } else {
                                            path.rMoveTo(fArr3[i28], fArr3[i29]);
                                            f23 = f27;
                                            f24 = f25;
                                        }
                                    } else if (c5 != 's') {
                                        if (c5 == 't') {
                                            if (c6 == 'q' || c6 == 't' || c6 == 'Q' || c6 == 'T') {
                                                f15 = f27 - f19;
                                                f16 = f25 - f26;
                                            } else {
                                                f16 = 0.0f;
                                                f15 = 0.0f;
                                            }
                                            int i30 = i5 + 0;
                                            int i31 = i5 + 1;
                                            path.rQuadTo(f15, f16, fArr3[i30], fArr3[i31]);
                                            float f36 = f15 + f27;
                                            f26 = f16 + f25;
                                            f27 += fArr3[i30];
                                            f25 += fArr3[i31];
                                            f19 = f36;
                                        }
                                        i3 = i5;
                                    } else {
                                        if (c6 == 'c' || c6 == 's' || c6 == 'C' || c6 == 'S') {
                                            f14 = f27 - f19;
                                            f13 = f25 - f26;
                                        } else {
                                            f14 = 0.0f;
                                            f13 = 0.0f;
                                        }
                                        int i32 = i5 + 0;
                                        int i33 = i5 + 1;
                                        int i34 = i5 + 2;
                                        int i35 = i5 + 3;
                                        f7 = f25;
                                        i3 = i5;
                                        path.rCubicTo(f14, f13, fArr3[i32], fArr3[i33], fArr3[i34], fArr3[i35]);
                                        f6 = fArr3[i32] + f27;
                                        f5 = fArr3[i33] + f7;
                                        f3 = f27 + fArr3[i34];
                                        f4 = fArr3[i35];
                                    }
                                    f27 = f23;
                                    f25 = f24;
                                } else {
                                    i3 = i5;
                                    int i36 = i3 + 0;
                                    int i37 = i3 + 1;
                                    path.lineTo(fArr3[i36], fArr3[i37]);
                                    f27 = fArr3[i36];
                                    f25 = fArr3[i37];
                                }
                                f25 = f10 + f9;
                                f27 = f8;
                            } else {
                                f7 = f25;
                                i3 = i5;
                                int i38 = i3 + 0;
                                int i39 = i3 + 1;
                                int i40 = i3 + 2;
                                int i41 = i3 + 3;
                                path.rQuadTo(fArr3[i38], fArr3[i39], fArr3[i40], fArr3[i41]);
                                f6 = fArr3[i38] + f27;
                                f5 = fArr3[i39] + f7;
                                f3 = f27 + fArr3[i40];
                                f4 = fArr3[i41];
                            }
                            fArr = fArr3;
                            c = c5;
                            i2 = i4;
                        } else {
                            f7 = f25;
                            i3 = i5;
                            int i42 = i3 + 2;
                            int i43 = i3 + 3;
                            int i44 = i3 + 4;
                            int i45 = i3 + 5;
                            path.rCubicTo(fArr3[i3 + 0], fArr3[i3 + 1], fArr3[i42], fArr3[i43], fArr3[i44], fArr3[i45]);
                            f6 = fArr3[i42] + f27;
                            f5 = fArr3[i43] + f7;
                            f3 = f27 + fArr3[i44];
                            f4 = fArr3[i45];
                        }
                        f = f4 + f7;
                        f19 = f6;
                        f26 = f5;
                        f2 = f3;
                        f27 = f2;
                        f25 = f;
                        fArr = fArr3;
                        c = c5;
                        i2 = i4;
                    } else {
                        i3 = i5;
                        int i46 = i3 + 5;
                        int i47 = i3 + 6;
                        fArr = fArr3;
                        c = c5;
                        i2 = i4;
                        m4378(path, f27, f25, fArr3[i46] + f27, fArr3[i47] + f25, fArr3[i3 + 0], fArr3[i3 + 1], fArr3[i3 + 2], fArr3[i3 + 3] != 0.0f, fArr3[i3 + 4] != 0.0f);
                        f27 += fArr[i46];
                        f25 += fArr[i47];
                    }
                    i5 = i3 + i;
                    c2 = 'm';
                    c6 = c;
                    c5 = c6;
                    fArr3 = fArr;
                    i4 = i2;
                } else {
                    i3 = i5;
                    fArr = fArr3;
                    c = c5;
                    i2 = i4;
                    int i48 = i3 + 5;
                    int i49 = i3 + 6;
                    m4378(path, f27, f25, fArr[i48], fArr[i49], fArr[i3 + 0], fArr[i3 + 1], fArr[i3 + 2], fArr[i3 + 3] != 0.0f, fArr[i3 + 4] != 0.0f);
                    f27 = fArr[i48];
                    f25 = fArr[i49];
                }
                f19 = f27;
                f26 = f25;
                i5 = i3 + i;
                c2 = 'm';
                c6 = c;
                c5 = c6;
                fArr3 = fArr;
                i4 = i2;
            }
            fArr2[0] = f27;
            fArr2[1] = f25;
            fArr2[2] = f19;
            fArr2[3] = f26;
            fArr2[4] = f23;
            fArr2[5] = f24;
            c4 = r31[i4].f6000;
            i4++;
            c2 = 'm';
            c3 = 0;
            r0 = r31;
        }
    }

    public C1708(C1708 r3) {
        this.f6000 = r3.f6000;
        float[] fArr = r3.f5999;
        this.f5999 = C2369.m6348(fArr, 0, fArr.length);
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m4380(C1708 r5, C1708 r6, float f) {
        this.f6000 = r5.f6000;
        int i = 0;
        while (true) {
            float[] fArr = r5.f5999;
            if (i < fArr.length) {
                this.f5999[i] = (r6.f5999[i] * f) + ((1.0f - f) * fArr[i]);
                i++;
            } else {
                return;
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m4378(Path path, float f, float f2, float f3, float f4, float f5, float f6, float f7, boolean z, boolean z2) {
        double d;
        double d2;
        double radians = Math.toRadians((double) f7);
        double cos = Math.cos(radians);
        double sin = Math.sin(radians);
        double d3 = (double) f;
        double d4 = (double) f2;
        double d5 = (d4 * sin) + (d3 * cos);
        double d6 = d3;
        double d7 = (double) f5;
        double d8 = d5 / d7;
        double d9 = (double) f6;
        double d10 = ((d4 * cos) + (((double) (-f)) * sin)) / d9;
        double d11 = d4;
        double d12 = (double) f4;
        double d13 = ((d12 * sin) + (((double) f3) * cos)) / d7;
        double d14 = ((d12 * cos) + (((double) (-f3)) * sin)) / d9;
        double d15 = d8 - d13;
        double d16 = d10 - d14;
        double d17 = (d8 + d13) / 2.0d;
        double d18 = (d10 + d14) / 2.0d;
        double d19 = (d16 * d16) + (d15 * d15);
        if (d19 == 0.0d) {
            Log.w("PathParser", " Points are coincident");
            return;
        }
        double d20 = (1.0d / d19) - 0.25d;
        if (d20 < 0.0d) {
            Log.w("PathParser", "Points are too far apart " + d19);
            float sqrt = (float) (Math.sqrt(d19) / 1.99999d);
            m4378(path, f, f2, f3, f4, f5 * sqrt, f6 * sqrt, f7, z, z2);
            return;
        }
        double sqrt2 = Math.sqrt(d20);
        double d21 = d15 * sqrt2;
        double d22 = sqrt2 * d16;
        if (z == z2) {
            d2 = d17 - d22;
            d = d18 + d21;
        } else {
            d2 = d17 + d22;
            d = d18 - d21;
        }
        double atan2 = Math.atan2(d10 - d, d8 - d2);
        double atan22 = Math.atan2(d14 - d, d13 - d2) - atan2;
        int i = 0;
        int i2 = (atan22 > 0.0d ? 1 : (atan22 == 0.0d ? 0 : -1));
        if (z2 != (i2 >= 0)) {
            atan22 = i2 > 0 ? atan22 - 6.283185307179586d : atan22 + 6.283185307179586d;
        }
        double d23 = d2 * d7;
        double d24 = d * d9;
        double d25 = (d23 * cos) - (d24 * sin);
        double d26 = (d24 * cos) + (d23 * sin);
        int ceil = (int) Math.ceil(Math.abs((atan22 * 4.0d) / 3.141592653589793d));
        double cos2 = Math.cos(radians);
        double sin2 = Math.sin(radians);
        double cos3 = Math.cos(atan2);
        double sin3 = Math.sin(atan2);
        double d27 = -d7;
        double d28 = d27 * cos2;
        double d29 = d9 * sin2;
        double d30 = (d28 * sin3) - (d29 * cos3);
        double d31 = d27 * sin2;
        double d32 = d9 * cos2;
        double d33 = (cos3 * d32) + (sin3 * d31);
        double d34 = atan22 / ((double) ceil);
        double d35 = atan2;
        while (i < ceil) {
            double d36 = d35 + d34;
            double sin4 = Math.sin(d36);
            double cos4 = Math.cos(d36);
            double d37 = (((d7 * cos2) * cos4) + d25) - (d29 * sin4);
            double d38 = (d32 * sin4) + (d7 * sin2 * cos4) + d26;
            double d39 = (d28 * sin4) - (d29 * cos4);
            double d40 = (cos4 * d32) + (sin4 * d31);
            double d41 = d36 - d35;
            double tan = Math.tan(d41 / 2.0d);
            double sqrt3 = ((Math.sqrt(((tan * 3.0d) * tan) + 4.0d) - 1.0d) * Math.sin(d41)) / 3.0d;
            path.rLineTo(0.0f, 0.0f);
            path.cubicTo((float) ((d30 * sqrt3) + d6), (float) ((d33 * sqrt3) + d11), (float) (d37 - (sqrt3 * d39)), (float) (d38 - (sqrt3 * d40)), (float) d37, (float) d38);
            i++;
            d32 = d32;
            d31 = d31;
            ceil = ceil;
            cos2 = cos2;
            d35 = d36;
            d7 = d7;
            d33 = d40;
            d30 = d39;
            d6 = d37;
            d11 = d38;
            d34 = d34;
            d25 = d25;
        }
    }
}
