package B7;

import n4.u0;

/* JADX INFO: loaded from: classes.dex */
public final class c extends i {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ int f1042c;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public c(int i, String str) {
        super(C7.b.f1417s, str);
        this.f1042c = i;
        switch (i) {
            case 1:
                P6.g.e(str, "data");
                super(C7.b.f1416r, str);
                break;
            default:
                P6.g.e(str, "data");
                break;
        }
    }

    public static int g(char c3) {
        if ('0' <= c3 && c3 < ':') {
            return c3 - '0';
        }
        if ('A' <= c3 && c3 < '[') {
            return c3 - '7';
        }
        if (c3 == ' ') {
            return 36;
        }
        if (c3 == '$') {
            return 37;
        }
        if (c3 == '%') {
            return 38;
        }
        if (c3 == '*') {
            return 39;
        }
        if (c3 == '+') {
            return 40;
        }
        if (c3 == '-') {
            return 41;
        }
        if (c3 == '.') {
            return 42;
        }
        if (c3 == '/') {
            return 43;
        }
        if (c3 == ':') {
            return 44;
        }
        throw new IllegalArgumentException("Illegal character: " + c3);
    }

    @Override // B7.i
    public final int c() {
        switch (this.f1042c) {
        }
        return ((String) this.f1072b).length();
    }

    @Override // B7.i
    public final void f(a aVar) {
        switch (this.f1042c) {
            case u0.f15495q /* 0 */:
                String str = (String) this.f1072b;
                int length = str.length();
                int i = 0;
                while (true) {
                    int i5 = i + 1;
                    if (i5 < length) {
                        aVar.o(g(str.charAt(i5)) + (g(str.charAt(i)) * 45), 11);
                        i += 2;
                    } else if (i < length) {
                        aVar.o(g(str.charAt(i)), 6);
                    }
                    break;
                }
                break;
            default:
                String str2 = (String) this.f1072b;
                int length2 = str2.length();
                int i8 = 0;
                while (true) {
                    int i9 = i8 + 2;
                    if (i9 < length2) {
                        int i10 = i8 + 3;
                        String strSubstring = str2.substring(i8, i10);
                        P6.g.d(strSubstring, "substring(...)");
                        aVar.o(Integer.parseInt(strSubstring), 10);
                        i8 = i10;
                    } else if (i8 < length2) {
                        int i11 = length2 - i8;
                        if (i11 == 1) {
                            String strSubstring2 = str2.substring(i8, i8 + 1);
                            P6.g.d(strSubstring2, "substring(...)");
                            aVar.o(Integer.parseInt(strSubstring2), 4);
                        } else if (i11 == 2) {
                            String strSubstring3 = str2.substring(i8, i9);
                            P6.g.d(strSubstring3, "substring(...)");
                            aVar.o(Integer.parseInt(strSubstring3), 7);
                        }
                    }
                    break;
                }
                break;
        }
    }
}
