package com.google.android.gms.internal.pal;

import java.io.Closeable;
import java.io.EOFException;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.util.Arrays;
import okio.internal.Buffer;

/* JADX INFO: loaded from: classes2.dex */
public final class f implements Closeable {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Reader f20780a;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public long f20787h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public int f20788i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public int[] f20789j;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public String[] f20791l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public int[] f20792m;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final char[] f20781b = new char[1024];

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f20782c = 0;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f20783d = 0;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f20784e = 0;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public int f20785f = 0;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public int f20786g = 0;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public int f20790k = 1;

    public f(StringReader stringReader) {
        int[] iArr = new int[32];
        this.f20789j = iArr;
        iArr[0] = 6;
        this.f20791l = new String[32];
        this.f20792m = new int[32];
        this.f20780a = stringReader;
    }

    /* JADX WARN: Code restructure failed: missing block: B:105:0x00fe, code lost:
    
        continue;
     */
    /* JADX WARN: Code restructure failed: missing block: B:17:0x0030, code lost:
    
        r11.f20782c = r8;
        r8 = r8 - r3;
        r2 = r8 - 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:18:0x0035, code lost:
    
        if (r1 != null) goto L20;
     */
    /* JADX WARN: Code restructure failed: missing block: B:19:0x0037, code lost:
    
        r1 = new java.lang.StringBuilder(java.lang.Math.max(r8 + r8, 16));
     */
    /* JADX WARN: Code restructure failed: missing block: B:20:0x0041, code lost:
    
        r1.append(r7, r3, r2);
     */
    /* JADX WARN: Code restructure failed: missing block: B:21:0x004a, code lost:
    
        if (r11.f20782c != r11.f20783d) goto L27;
     */
    /* JADX WARN: Code restructure failed: missing block: B:23:0x0050, code lost:
    
        if (M(1) == false) goto L96;
     */
    /* JADX WARN: Code restructure failed: missing block: B:25:0x0053, code lost:
    
        x("Unterminated escape sequence");
     */
    /* JADX WARN: Code restructure failed: missing block: B:26:0x0056, code lost:
    
        throw null;
     */
    /* JADX WARN: Code restructure failed: missing block: B:27:0x0057, code lost:
    
        r2 = r11.f20782c;
        r3 = r2 + 1;
        r11.f20782c = r3;
        r6 = r7[r2];
     */
    /* JADX WARN: Code restructure failed: missing block: B:28:0x005f, code lost:
    
        if (r6 == '\n') goto L82;
     */
    /* JADX WARN: Code restructure failed: missing block: B:30:0x0063, code lost:
    
        if (r6 == '\"') goto L83;
     */
    /* JADX WARN: Code restructure failed: missing block: B:32:0x0067, code lost:
    
        if (r6 == '\'') goto L83;
     */
    /* JADX WARN: Code restructure failed: missing block: B:34:0x006b, code lost:
    
        if (r6 == '/') goto L83;
     */
    /* JADX WARN: Code restructure failed: missing block: B:35:0x006d, code lost:
    
        if (r6 == '\\') goto L83;
     */
    /* JADX WARN: Code restructure failed: missing block: B:37:0x0071, code lost:
    
        if (r6 == 'b') goto L81;
     */
    /* JADX WARN: Code restructure failed: missing block: B:39:0x0075, code lost:
    
        if (r6 == 'f') goto L80;
     */
    /* JADX WARN: Code restructure failed: missing block: B:41:0x0079, code lost:
    
        if (r6 == 'n') goto L105;
     */
    /* JADX WARN: Code restructure failed: missing block: B:43:0x007d, code lost:
    
        if (r6 == 'r') goto L79;
     */
    /* JADX WARN: Code restructure failed: missing block: B:45:0x0081, code lost:
    
        if (r6 == 't') goto L78;
     */
    /* JADX WARN: Code restructure failed: missing block: B:47:0x0085, code lost:
    
        if (r6 != 'u') goto L97;
     */
    /* JADX WARN: Code restructure failed: missing block: B:49:0x008c, code lost:
    
        if ((r2 + 5) <= r11.f20783d) goto L55;
     */
    /* JADX WARN: Code restructure failed: missing block: B:51:0x0092, code lost:
    
        if (M(4) == false) goto L98;
     */
    /* JADX WARN: Code restructure failed: missing block: B:53:0x0095, code lost:
    
        x("Unterminated escape sequence");
     */
    /* JADX WARN: Code restructure failed: missing block: B:54:0x0098, code lost:
    
        throw null;
     */
    /* JADX WARN: Code restructure failed: missing block: B:55:0x0099, code lost:
    
        r2 = r11.f20782c;
        r4 = r2 + 4;
        r10 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:56:0x009f, code lost:
    
        if (r2 >= r4) goto L114;
     */
    /* JADX WARN: Code restructure failed: missing block: B:57:0x00a1, code lost:
    
        r5 = r7[r2];
        r8 = (char) (r10 << 4);
     */
    /* JADX WARN: Code restructure failed: missing block: B:58:0x00a8, code lost:
    
        if (r5 < '0') goto L63;
     */
    /* JADX WARN: Code restructure failed: missing block: B:60:0x00ac, code lost:
    
        if (r5 > '9') goto L63;
     */
    /* JADX WARN: Code restructure failed: missing block: B:61:0x00ae, code lost:
    
        r5 = r5 - '0';
     */
    /* JADX WARN: Code restructure failed: missing block: B:62:0x00b0, code lost:
    
        r10 = (char) (r5 + r8);
     */
    /* JADX WARN: Code restructure failed: missing block: B:64:0x00b6, code lost:
    
        if (r5 < 'a') goto L67;
     */
    /* JADX WARN: Code restructure failed: missing block: B:65:0x00b8, code lost:
    
        if (r5 > 'f') goto L67;
     */
    /* JADX WARN: Code restructure failed: missing block: B:66:0x00ba, code lost:
    
        r5 = r5 - 'W';
     */
    /* JADX WARN: Code restructure failed: missing block: B:68:0x00bf, code lost:
    
        if (r5 < 'A') goto L99;
     */
    /* JADX WARN: Code restructure failed: missing block: B:70:0x00c3, code lost:
    
        if (r5 > 'F') goto L100;
     */
    /* JADX WARN: Code restructure failed: missing block: B:71:0x00c5, code lost:
    
        r5 = r5 - '7';
     */
    /* JADX WARN: Code restructure failed: missing block: B:72:0x00c8, code lost:
    
        r2 = r2 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:75:0x00de, code lost:
    
        r11.f20782c += 4;
     */
    /* JADX WARN: Code restructure failed: missing block: B:76:0x00e4, code lost:
    
        x("Invalid escape sequence");
     */
    /* JADX WARN: Code restructure failed: missing block: B:77:0x00e9, code lost:
    
        throw null;
     */
    /* JADX WARN: Code restructure failed: missing block: B:78:0x00ea, code lost:
    
        r10 = '\t';
     */
    /* JADX WARN: Code restructure failed: missing block: B:79:0x00ed, code lost:
    
        r10 = '\r';
     */
    /* JADX WARN: Code restructure failed: missing block: B:80:0x00f0, code lost:
    
        r10 = '\f';
     */
    /* JADX WARN: Code restructure failed: missing block: B:81:0x00f3, code lost:
    
        r10 = '\b';
     */
    /* JADX WARN: Code restructure failed: missing block: B:82:0x00f6, code lost:
    
        r11.f20784e++;
        r11.f20785f = r3;
     */
    /* JADX WARN: Code restructure failed: missing block: B:83:0x00fd, code lost:
    
        r10 = r6;
     */
    /* JADX WARN: Code restructure failed: missing block: B:88:0x0113, code lost:
    
        if (r1 != null) goto L90;
     */
    /* JADX WARN: Code restructure failed: missing block: B:89:0x0115, code lost:
    
        r1 = r2 - r3;
        r1 = new java.lang.StringBuilder(java.lang.Math.max(r1 + r1, 16));
     */
    /* JADX WARN: Code restructure failed: missing block: B:90:0x0122, code lost:
    
        r1.append(r7, r3, r2 - r3);
        r11.f20782c = r2;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final String E(char c6) {
        char[] cArr;
        char c10;
        StringBuilder sb = null;
        loop0: do {
            int i10 = this.f20782c;
            int i11 = this.f20783d;
            while (true) {
                int i12 = i11;
                int i13 = i10;
                while (true) {
                    cArr = this.f20781b;
                    if (i10 >= i12) {
                        break;
                    }
                    int i14 = i10 + 1;
                    char c11 = cArr[i10];
                    if (c11 == c6) {
                        this.f20782c = i14;
                        int i15 = (i14 - i13) - 1;
                        if (sb == null) {
                            return new String(cArr, i13, i15);
                        }
                        sb.append(cArr, i13, i15);
                        return sb.toString();
                    }
                    c10 = '\n';
                    if (c11 == '\\') {
                        break;
                    }
                    if (c11 == '\n') {
                        this.f20784e++;
                        this.f20785f = i14;
                    }
                    i10 = i14;
                }
                sb.append(c10);
                i10 = this.f20782c;
                i11 = this.f20783d;
            }
            throw new NumberFormatException("\\u".concat(new String(cArr, this.f20782c, 4)));
        } while (M(1));
        x("Unterminated string");
        throw null;
    }

    /* JADX WARN: Code restructure failed: missing block: B:34:0x0049, code lost:
    
        x("Use JsonReader.setLenient(true) to accept malformed JSON");
     */
    /* JADX WARN: Code restructure failed: missing block: B:35:0x004e, code lost:
    
        throw null;
     */
    /* JADX WARN: Removed duplicated region for block: B:46:0x007d  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x0085  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final String H() {
        char[] cArr;
        String string;
        int i10 = 0;
        StringBuilder sb = null;
        do {
            int i11 = 0;
            while (true) {
                int i12 = this.f20782c + i11;
                int i13 = this.f20783d;
                cArr = this.f20781b;
                if (i12 < i13) {
                    char c6 = cArr[i12];
                    if (c6 != '\t' && c6 != '\n' && c6 != '\f' && c6 != '\r' && c6 != ' ') {
                        if (c6 != '#') {
                            if (c6 != ',') {
                                if (c6 != '/' && c6 != '=') {
                                    if (c6 != '{' && c6 != '}' && c6 != ':') {
                                        if (c6 != ';') {
                                            switch (c6) {
                                                case '[':
                                                case ']':
                                                    break;
                                                case '\\':
                                                    break;
                                                default:
                                                    i11++;
                                                    break;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                } else if (i11 >= 1024) {
                    if (sb == null) {
                        sb = new StringBuilder(Math.max(i11, 16));
                    }
                    sb.append(cArr, this.f20782c, i11);
                    this.f20782c += i11;
                } else if (!M(i11 + 1)) {
                }
            }
            i10 = i11;
            if (sb != null) {
                string = new String(cArr, this.f20782c, i10);
            } else {
                sb.append(cArr, this.f20782c, i10);
                string = sb.toString();
            }
            this.f20782c += i10;
            return string;
        } while (M(1));
        if (sb != null) {
        }
        this.f20782c += i10;
        return string;
    }

    public final void L(int i10) {
        int i11 = this.f20790k;
        int[] iArr = this.f20789j;
        if (i11 == iArr.length) {
            int i12 = i11 + i11;
            this.f20789j = Arrays.copyOf(iArr, i12);
            this.f20792m = Arrays.copyOf(this.f20792m, i12);
            this.f20791l = (String[]) Arrays.copyOf(this.f20791l, i12);
        }
        int[] iArr2 = this.f20789j;
        int i13 = this.f20790k;
        this.f20790k = i13 + 1;
        iArr2[i13] = i10;
    }

    public final boolean M(int i10) throws IOException {
        int i11;
        int i12 = this.f20785f;
        int i13 = this.f20782c;
        this.f20785f = i12 - i13;
        int i14 = this.f20783d;
        char[] cArr = this.f20781b;
        if (i14 != i13) {
            int i15 = i14 - i13;
            this.f20783d = i15;
            System.arraycopy(cArr, i13, cArr, 0, i15);
        } else {
            this.f20783d = 0;
        }
        this.f20782c = 0;
        do {
            int i16 = this.f20783d;
            int i17 = this.f20780a.read(cArr, i16, 1024 - i16);
            if (i17 == -1) {
                return false;
            }
            i11 = this.f20783d + i17;
            this.f20783d = i11;
            if (this.f20784e == 0 && this.f20785f == 0 && i11 > 0 && cArr[0] == 65279) {
                this.f20782c++;
                this.f20785f = 1;
                i10++;
            }
        } while (i11 < i10);
        return true;
    }

    public final boolean N(char c6) throws zzabf {
        if (c6 == '\t' || c6 == '\n' || c6 == '\f' || c6 == '\r' || c6 == ' ') {
            return false;
        }
        if (c6 != '#') {
            if (c6 == ',') {
                return false;
            }
            if (c6 != '/' && c6 != '=') {
                if (c6 == '{' || c6 == '}' || c6 == ':') {
                    return false;
                }
                if (c6 != ';') {
                    switch (c6) {
                        case '[':
                        case ']':
                            return false;
                        case '\\':
                            break;
                        default:
                            return true;
                    }
                }
            }
        }
        x("Use JsonReader.setLenient(true) to accept malformed JSON");
        throw null;
    }

    @Override // java.io.Closeable, java.lang.AutoCloseable
    public final void close() throws IOException {
        this.f20786g = 0;
        this.f20789j[0] = 8;
        this.f20790k = 1;
        this.f20780a.close();
    }

    /* JADX WARN: Code restructure failed: missing block: B:142:0x01b4, code lost:
    
        if (N(r13) == false) goto L144;
     */
    /* JADX WARN: Code restructure failed: missing block: B:144:0x01b8, code lost:
    
        if (r10 != 2) goto L161;
     */
    /* JADX WARN: Code restructure failed: missing block: B:145:0x01ba, code lost:
    
        if (r16 == false) goto L150;
     */
    /* JADX WARN: Code restructure failed: missing block: B:147:0x01c0, code lost:
    
        if (r11 != Long.MIN_VALUE) goto L151;
     */
    /* JADX WARN: Code restructure failed: missing block: B:148:0x01c2, code lost:
    
        if (r17 == false) goto L150;
     */
    /* JADX WARN: Code restructure failed: missing block: B:149:0x01c4, code lost:
    
        r3 = true;
     */
    /* JADX WARN: Code restructure failed: missing block: B:150:0x01c6, code lost:
    
        r10 = 2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:151:0x01c8, code lost:
    
        r3 = r17;
     */
    /* JADX WARN: Code restructure failed: missing block: B:153:0x01cc, code lost:
    
        if (r11 != 0) goto L156;
     */
    /* JADX WARN: Code restructure failed: missing block: B:154:0x01ce, code lost:
    
        if (r3 != false) goto L150;
     */
    /* JADX WARN: Code restructure failed: missing block: B:156:0x01d1, code lost:
    
        if (r3 == false) goto L158;
     */
    /* JADX WARN: Code restructure failed: missing block: B:158:0x01d4, code lost:
    
        r11 = -r11;
     */
    /* JADX WARN: Code restructure failed: missing block: B:159:0x01d5, code lost:
    
        r21.f20787h = r11;
        r21.f20782c += r5;
        r3 = 15;
     */
    /* JADX WARN: Code restructure failed: missing block: B:160:0x01de, code lost:
    
        r21.f20786g = r3;
     */
    /* JADX WARN: Code restructure failed: missing block: B:161:0x01e1, code lost:
    
        if (r10 == 2) goto L166;
     */
    /* JADX WARN: Code restructure failed: missing block: B:163:0x01e4, code lost:
    
        if (r10 == 4) goto L166;
     */
    /* JADX WARN: Code restructure failed: missing block: B:165:0x01e7, code lost:
    
        if (r10 != 7) goto L97;
     */
    /* JADX WARN: Code restructure failed: missing block: B:166:0x01e9, code lost:
    
        r21.f20788i = r5;
        r3 = 16;
     */
    /* JADX WARN: Removed duplicated region for block: B:104:0x014a  */
    /* JADX WARN: Removed duplicated region for block: B:180:0x020f  */
    /* JADX WARN: Removed duplicated region for block: B:185:0x0220 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:186:0x0221  */
    /* JADX WARN: Removed duplicated region for block: B:192:0x0237 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:212:0x025f  */
    /* JADX WARN: Removed duplicated region for block: B:42:0x007f  */
    /* JADX WARN: Removed duplicated region for block: B:92:0x011c  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final int e() {
        int i10;
        int iP;
        int iP2;
        int i11;
        String str;
        String str2;
        int i12;
        char c6;
        char c10;
        int i13;
        char c11;
        int i14;
        int[] iArr = this.f20789j;
        int i15 = this.f20790k - 1;
        int i16 = iArr[i15];
        boolean z10 = true;
        if (i16 == 1) {
            iArr[i15] = 2;
        } else {
            if (i16 != 2) {
                if (i16 == 3) {
                    i10 = 4;
                } else if (i16 == 5) {
                    i10 = 4;
                } else if (i16 == 4) {
                    iArr[i15] = 5;
                    int iP3 = p(true);
                    if (iP3 != 58) {
                        if (iP3 != 61) {
                            x("Expected ':'");
                            throw null;
                        }
                        x("Use JsonReader.setLenient(true) to accept malformed JSON");
                        throw null;
                    }
                } else {
                    if (i16 != 6) {
                        if (i16 == 7) {
                            if (p(false) == -1) {
                                this.f20786g = 17;
                                return 17;
                            }
                            x("Use JsonReader.setLenient(true) to accept malformed JSON");
                            throw null;
                        }
                        if (i16 == 8) {
                            throw new IllegalStateException("JsonReader is closed");
                        }
                        iP2 = p(true);
                        if (iP2 != 34) {
                            this.f20786g = 9;
                            return 9;
                        }
                        if (iP2 == 39) {
                            x("Use JsonReader.setLenient(true) to accept malformed JSON");
                            throw null;
                        }
                        if (iP2 == 44 || iP2 == 59) {
                            i11 = 1;
                        } else {
                            if (iP2 == 91) {
                                this.f20786g = 3;
                                return 3;
                            }
                            if (iP2 == 93) {
                                i11 = 1;
                                if (i16 == 1) {
                                    this.f20786g = 4;
                                    return 4;
                                }
                            } else {
                                if (iP2 == 123) {
                                    this.f20786g = 1;
                                    return 1;
                                }
                                int i17 = this.f20782c - 1;
                                this.f20782c = i17;
                                char[] cArr = this.f20781b;
                                char c12 = cArr[i17];
                                if (c12 == 't' || c12 == 'T') {
                                    str = "true";
                                    str2 = "TRUE";
                                    i12 = 5;
                                } else if (c12 == 'f' || c12 == 'F') {
                                    str = "false";
                                    str2 = "FALSE";
                                    i12 = 6;
                                } else {
                                    if (c12 == 'n' || c12 == 'N') {
                                        str = "null";
                                        str2 = "NULL";
                                        i12 = 7;
                                    }
                                    i12 = 0;
                                    if (i12 == 0) {
                                        return i12;
                                    }
                                    int i18 = this.f20782c;
                                    int i19 = this.f20783d;
                                    boolean z11 = true;
                                    long j10 = 0;
                                    int i20 = 0;
                                    char c13 = 0;
                                    boolean z12 = false;
                                    while (true) {
                                        if (i18 + i20 == i19) {
                                            if (i20 == 1024) {
                                                break;
                                            }
                                            if (!M(i20 + 1)) {
                                                break;
                                            }
                                            i18 = this.f20782c;
                                            i19 = this.f20783d;
                                            c10 = cArr[i18 + i20];
                                            if (c10 != '+') {
                                            }
                                        } else {
                                            c10 = cArr[i18 + i20];
                                            if (c10 != '+') {
                                                i13 = i19;
                                                c11 = 6;
                                                if (c13 != 5) {
                                                    break;
                                                }
                                                c13 = c11;
                                                i20++;
                                                i19 = i13;
                                                z10 = true;
                                            } else if (c10 == 'E' || c10 == 'e') {
                                                i13 = i19;
                                                if (c13 != 2 && c13 != 4) {
                                                    break;
                                                }
                                                c13 = 5;
                                                i20++;
                                                i19 = i13;
                                                z10 = true;
                                            } else if (c10 == '-') {
                                                i13 = i19;
                                                c11 = 6;
                                                if (c13 == 0) {
                                                    c13 = 1;
                                                    z12 = true;
                                                    i20++;
                                                    i19 = i13;
                                                    z10 = true;
                                                } else {
                                                    if (c13 != 5) {
                                                        break;
                                                    }
                                                    c13 = c11;
                                                    i20++;
                                                    i19 = i13;
                                                    z10 = true;
                                                }
                                            } else if (c10 == '.') {
                                                i13 = i19;
                                                if (c13 != 2) {
                                                    break;
                                                }
                                                c13 = 3;
                                                i20++;
                                                i19 = i13;
                                                z10 = true;
                                            } else {
                                                if (c10 < '0' || c10 > '9') {
                                                    break;
                                                }
                                                if (c13 == z10 || c13 == 0) {
                                                    i13 = i19;
                                                    j10 = -(c10 - '0');
                                                    c13 = 2;
                                                } else if (c13 != 2) {
                                                    i13 = i19;
                                                    if (c13 == 3) {
                                                        c13 = 4;
                                                    } else if (c13 == 5 || c13 == 6) {
                                                        c13 = 7;
                                                    }
                                                    i20++;
                                                    i19 = i13;
                                                    z10 = true;
                                                } else {
                                                    if (j10 == 0) {
                                                        break;
                                                    }
                                                    i13 = i19;
                                                    long j11 = (10 * j10) - ((long) (c10 - '0'));
                                                    z11 &= j10 > Buffer.OVERFLOW_ZONE || (j10 == Buffer.OVERFLOW_ZONE && j11 < j10);
                                                    j10 = j11;
                                                }
                                                i20++;
                                                i19 = i13;
                                                z10 = true;
                                            }
                                        }
                                        if (i14 == 0) {
                                            return i14;
                                        }
                                        if (N(cArr[this.f20782c])) {
                                            x("Use JsonReader.setLenient(true) to accept malformed JSON");
                                            throw null;
                                        }
                                        x("Expected value");
                                        throw null;
                                    }
                                    i14 = 0;
                                    if (i14 == 0) {
                                    }
                                }
                                int length = str.length();
                                int i21 = 1;
                                while (true) {
                                    if (i21 < length) {
                                        if ((this.f20782c + i21 >= this.f20783d && !M(i21 + 1)) || ((c6 = cArr[this.f20782c + i21]) != str.charAt(i21) && c6 != str2.charAt(i21))) {
                                            break;
                                        }
                                        i21++;
                                    } else {
                                        if ((this.f20782c + length < this.f20783d || M(length + 1)) && N(cArr[this.f20782c + length])) {
                                            break;
                                        }
                                        this.f20782c += length;
                                        this.f20786g = i12;
                                    }
                                }
                                i12 = 0;
                                if (i12 == 0) {
                                }
                            }
                        }
                        if (i16 == i11 || i16 == 2) {
                            x("Use JsonReader.setLenient(true) to accept malformed JSON");
                            throw null;
                        }
                        x("Unexpected value");
                        throw null;
                    }
                    iArr[i15] = 7;
                }
                iArr[i15] = i10;
                if (i16 == 5 && (iP = p(true)) != 44) {
                    if (iP == 59) {
                        x("Use JsonReader.setLenient(true) to accept malformed JSON");
                        throw null;
                    }
                    if (iP == 125) {
                        this.f20786g = 2;
                        return 2;
                    }
                    x("Unterminated object");
                    throw null;
                }
                int iP4 = p(true);
                if (iP4 == 34) {
                    this.f20786g = 13;
                    return 13;
                }
                if (iP4 == 39) {
                    x("Use JsonReader.setLenient(true) to accept malformed JSON");
                    throw null;
                }
                if (iP4 != 125) {
                    x("Use JsonReader.setLenient(true) to accept malformed JSON");
                    throw null;
                }
                if (i16 != 5) {
                    this.f20786g = 2;
                    return 2;
                }
                x("Expected name");
                throw null;
            }
            int iP5 = p(true);
            if (iP5 != 44) {
                if (iP5 == 59) {
                    x("Use JsonReader.setLenient(true) to accept malformed JSON");
                    throw null;
                }
                if (iP5 == 93) {
                    this.f20786g = 4;
                    return 4;
                }
                x("Unterminated array");
                throw null;
            }
        }
        iP2 = p(true);
        if (iP2 != 34) {
        }
    }

    public final String g() {
        int i10 = this.f20784e;
        int i11 = this.f20782c;
        int i12 = this.f20785f;
        StringBuilder sb = new StringBuilder(" at line ");
        sb.append(i10 + 1);
        sb.append(" column ");
        sb.append((i11 - i12) + 1);
        sb.append(" path ");
        StringBuilder sb2 = new StringBuilder("$");
        for (int i13 = 0; i13 < this.f20790k; i13++) {
            int i14 = this.f20789j[i13];
            if (i14 == 1 || i14 == 2) {
                int i15 = this.f20792m[i13];
                sb2.append('[');
                sb2.append(i15);
                sb2.append(']');
            } else if (i14 == 3 || i14 == 4 || i14 == 5) {
                sb2.append('.');
                String str = this.f20791l[i13];
                if (str != null) {
                    sb2.append(str);
                }
            }
        }
        sb.append(sb2.toString());
        return sb.toString();
    }

    public final String k() {
        String str;
        int iE = this.f20786g;
        if (iE == 0) {
            iE = e();
        }
        if (iE == 10) {
            str = H();
        } else if (iE == 8) {
            str = E('\'');
        } else if (iE == 9) {
            str = E('\"');
        } else if (iE == 11) {
            str = null;
        } else if (iE == 15) {
            str = Long.toString(this.f20787h);
        } else {
            if (iE != 16) {
                throw new IllegalStateException("Expected a string but was " + ((Object) q9.m(m())) + g());
            }
            str = new String(this.f20781b, this.f20782c, this.f20788i);
            this.f20782c += this.f20788i;
        }
        this.f20786g = 0;
        int[] iArr = this.f20792m;
        int i10 = this.f20790k - 1;
        iArr[i10] = iArr[i10] + 1;
        return str;
    }

    public final int m() {
        int iE = this.f20786g;
        if (iE == 0) {
            iE = e();
        }
        switch (iE) {
            case 1:
                return 3;
            case 2:
                return 4;
            case 3:
                return 1;
            case 4:
                return 2;
            case 5:
            case 6:
                return 8;
            case 7:
                return 9;
            case 8:
            case 9:
            case 10:
            case 11:
                return 6;
            case 12:
            case 13:
            case 14:
                return 5;
            case 15:
            case 16:
                return 7;
            default:
                return 10;
        }
    }

    public final int p(boolean z10) throws IOException {
        int i10 = this.f20782c;
        int i11 = this.f20783d;
        while (true) {
            if (i10 == i11) {
                this.f20782c = i10;
                if (!M(1)) {
                    if (z10) {
                        throw new EOFException("End of input".concat(g()));
                    }
                    return -1;
                }
                i10 = this.f20782c;
                i11 = this.f20783d;
            }
            int i12 = i10 + 1;
            char c6 = this.f20781b[i10];
            if (c6 == '\n') {
                this.f20784e++;
                this.f20785f = i12;
            } else if (c6 != ' ' && c6 != '\r' && c6 != '\t') {
                if (c6 != '/') {
                    if (c6 != '#') {
                        this.f20782c = i12;
                        return c6;
                    }
                    this.f20782c = i12;
                    x("Use JsonReader.setLenient(true) to accept malformed JSON");
                    throw null;
                }
                this.f20782c = i12;
                if (i12 == i11) {
                    this.f20782c = i10;
                    boolean zM = M(2);
                    this.f20782c++;
                    if (!zM) {
                        return 47;
                    }
                }
                x("Use JsonReader.setLenient(true) to accept malformed JSON");
                throw null;
            }
            i10 = i12;
        }
    }

    public final String toString() {
        return f.class.getSimpleName().concat(g());
    }

    public final void x(String str) throws zzabf {
        throw new zzabf(str.concat(g()));
    }
}
