package p138.p176.p278.p279.p290;

import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;

/* JADX INFO: renamed from: ދ.ހ.ހ.֏.ޞ.ޅ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C5506 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static final Charset f15873 = Charset.forName("UTF-8");

    /* JADX INFO: renamed from: ދ.ހ.ހ.֏.ޞ.ޅ$֏, reason: contains not printable characters */
    public static abstract class AbstractC5507 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public byte[] f15874;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public int f15875;
    }

    /* JADX INFO: renamed from: ދ.ހ.ހ.֏.ޞ.ޅ$ؠ, reason: contains not printable characters */
    public static class C5508 extends AbstractC5507 {

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public static final int[] f15876 = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public static final int[] f15877 = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public int f15878;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public int f15879;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public final int[] f15880;

        public C5508(int i, byte[] bArr) {
            this.f15874 = bArr;
            this.f15880 = (i & 8) == 0 ? f15876 : f15877;
            this.f15878 = 0;
            this.f15879 = 0;
        }
    }

    /* JADX INFO: renamed from: ދ.ހ.ހ.֏.ޞ.ޅ$ހ, reason: contains not printable characters */
    public static class C5509 extends AbstractC5507 {

        /* JADX INFO: renamed from: އ, reason: contains not printable characters */
        public static final byte[] f15881 = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47};

        /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
        public static final byte[] f15882 = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 45, 95};

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final byte[] f15883;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public int f15884;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public int f15885;

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public final boolean f15886;

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public final boolean f15887;

        /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
        public final boolean f15888;

        /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
        public final byte[] f15889;

        public C5509(int i, byte[] bArr) {
            this.f15874 = bArr;
            this.f15886 = (i & 1) == 0;
            this.f15887 = (i & 2) == 0;
            this.f15888 = (i & 4) != 0;
            this.f15889 = (i & 8) == 0 ? f15881 : f15882;
            this.f15883 = new byte[2];
            this.f15884 = 0;
            this.f15885 = this.f15887 ? 19 : -1;
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static String m8874(byte[] bArr) {
        try {
            return new String(m8876(bArr, 2), "US-ASCII");
        } catch (UnsupportedEncodingException e) {
            throw new AssertionError(e);
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static byte[] m8875(String str, int i) {
        boolean z;
        byte[] bytes = str.getBytes(f15873);
        int length = bytes.length;
        C5508 c5508 = new C5508(i, new byte[(length * 3) / 4]);
        int i2 = c5508.f15878;
        int i3 = 1;
        if (i2 == 6) {
            z = false;
        } else {
            int i4 = length + 0;
            int i5 = c5508.f15879;
            byte[] bArr = c5508.f15874;
            int[] iArr = c5508.f15880;
            int i6 = 0;
            int i7 = 0;
            while (i6 < i4) {
                if (i2 == 0) {
                    while (true) {
                        int i8 = i6 + 4;
                        if (i8 > i4) {
                            break;
                        }
                        i5 = iArr[bytes[i6 + 3] & 255] | (iArr[bytes[i6 + 1] & 255] << 12) | (iArr[bytes[i6] & 255] << 18) | (iArr[bytes[i6 + 2] & 255] << 6);
                        if (i5 < 0) {
                            break;
                        }
                        bArr[i7 + 2] = (byte) i5;
                        bArr[i7 + 1] = (byte) (i5 >> 8);
                        bArr[i7] = (byte) (i5 >> 16);
                        i7 += 3;
                        i6 = i8;
                    }
                    if (i6 >= i4) {
                        break;
                    }
                }
                int i9 = i6 + 1;
                int i10 = iArr[bytes[i6] & 255];
                if (i2 != 0) {
                    if (i2 == i3) {
                        if (i10 < 0) {
                            if (i10 != -1) {
                                c5508.f15878 = 6;
                                break;
                            }
                        }
                        i10 |= i5 << 6;
                        i2++;
                        i5 = i10;
                    } else if (i2 == 2) {
                        if (i10 < 0) {
                            if (i10 == -2) {
                                bArr[i7] = (byte) (i5 >> 4);
                                i7++;
                                i2 = 4;
                            } else if (i10 != -1) {
                                c5508.f15878 = 6;
                                break;
                            }
                        }
                        i10 |= i5 << 6;
                        i2++;
                        i5 = i10;
                    } else if (i2 != 3) {
                        if (i2 != 4) {
                            if (i2 == 5 && i10 != -1) {
                                c5508.f15878 = 6;
                                break;
                            }
                        } else if (i10 == -2) {
                            i2++;
                        } else if (i10 != -1) {
                            c5508.f15878 = 6;
                            break;
                        }
                    } else if (i10 >= 0) {
                        i5 = (i5 << 6) | i10;
                        bArr[i7 + 2] = (byte) i5;
                        bArr[i7 + 1] = (byte) (i5 >> 8);
                        bArr[i7] = (byte) (i5 >> 16);
                        i7 += 3;
                        i2 = 0;
                    } else if (i10 == -2) {
                        bArr[i7 + 1] = (byte) (i5 >> 2);
                        bArr[i7] = (byte) (i5 >> 10);
                        i7 += 2;
                        i2 = 5;
                    } else if (i10 != -1) {
                        c5508.f15878 = 6;
                        break;
                    }
                    i6 = i9;
                    i3 = 1;
                } else {
                    if (i10 >= 0) {
                        i2++;
                        i5 = i10;
                    } else if (i10 != -1) {
                        c5508.f15878 = 6;
                        break;
                    }
                    i6 = i9;
                    i3 = 1;
                }
            }
            if (i2 != 1) {
                if (i2 == 2) {
                    bArr[i7] = (byte) (i5 >> 4);
                    i7++;
                } else if (i2 == 3) {
                    int i11 = i7 + 1;
                    bArr[i7] = (byte) (i5 >> 10);
                    i7 = i11 + 1;
                    bArr[i11] = (byte) (i5 >> 2);
                } else if (i2 == 4) {
                    c5508.f15878 = 6;
                }
                c5508.f15878 = i2;
                c5508.f15875 = i7;
                z = true;
            } else {
                c5508.f15878 = 6;
            }
            z = false;
        }
        if (!z) {
            throw new IllegalArgumentException("bad base-64");
        }
        int i12 = c5508.f15875;
        byte[] bArr2 = c5508.f15874;
        if (i12 == bArr2.length) {
            return bArr2;
        }
        byte[] bArr3 = new byte[i12];
        System.arraycopy(bArr2, 0, bArr3, 0, i12);
        return bArr3;
    }

    /* JADX WARN: Removed duplicated region for block: B:100:0x0125 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:29:0x0084  */
    /* JADX WARN: Removed duplicated region for block: B:44:0x00cd  */
    /*  JADX ERROR: JadxOverflowException in pass: RegionMakerVisitor
        jadx.core.utils.exceptions.JadxOverflowException: Regions count limit reached
        	at jadx.core.utils.ErrorsCounter.addError(ErrorsCounter.java:59)
        	at jadx.core.utils.ErrorsCounter.error(ErrorsCounter.java:31)
        	at jadx.core.dex.attributes.nodes.NotificationAttrNode.addError(NotificationAttrNode.java:19)
        */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static byte[] m8876(byte[] r17, int r18) {
        /*
            Method dump skipped, instruction units count: 508
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: p138.p176.p278.p279.p290.C5506.m8876(byte[], int):byte[]");
    }
}
