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

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 z92 implements Closeable {
    public int[] Q;

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

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

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

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

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public zzhyq f19154b = zzhyq.f19852b;

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

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

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

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

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

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

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

    public z92(StringReader stringReader) {
        int[] iArr = new int[32];
        this.f19163k = iArr;
        iArr[0] = 6;
        this.f19165m = new String[32];
        this.Q = new int[32];
        this.f19153a = stringReader;
    }

    /* JADX WARN: Code restructure failed: missing block: B:34:0x0048, code lost:
    
        N();
     */
    /* JADX WARN: Failed to find 'out' block for switch in B:32:0x0042. Please report as an issue. */
    /* JADX WARN: Removed duplicated region for block: B:46:0x007b  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x0083  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final String E() throws zzhzt {
        char[] cArr;
        String string;
        int i10 = 0;
        StringBuilder sb = null;
        do {
            int i11 = 0;
            while (true) {
                int i12 = this.f19156d + i11;
                int i13 = this.f19157e;
                cArr = this.f19155c;
                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.f19156d, i11);
                    this.f19156d += i11;
                } else if (L(i11 + 1)) {
                }
            }
            i10 = i11;
            if (sb != null) {
                string = new String(cArr, this.f19156d, i10);
            } else {
                sb.append(cArr, this.f19156d, i10);
                string = sb.toString();
            }
            this.f19156d += i10;
            return string;
        } while (L(1));
        if (sb != null) {
        }
        this.f19156d += i10;
        return string;
    }

    public final void H(int i10) throws zzhzt {
        int i11 = this.f19164l;
        if (i11 - 1 >= 1280) {
            String strK = k();
            throw new zzhzt(defpackage.e.o(new StringBuilder(strK.length() + 26), "Nesting limit 1280 reached", strK));
        }
        int[] iArr = this.f19163k;
        if (i11 == iArr.length) {
            int i12 = i11 + i11;
            this.f19163k = Arrays.copyOf(iArr, i12);
            this.Q = Arrays.copyOf(this.Q, i12);
            this.f19165m = (String[]) Arrays.copyOf(this.f19165m, i12);
        }
        int[] iArr2 = this.f19163k;
        int i13 = this.f19164l;
        this.f19164l = i13 + 1;
        iArr2[i13] = i10;
    }

    public final boolean L(int i10) throws IOException {
        int i11;
        int i12 = this.f19159g;
        int i13 = this.f19156d;
        this.f19159g = i12 - i13;
        int i14 = this.f19157e;
        char[] cArr = this.f19155c;
        if (i14 != i13) {
            int i15 = i14 - i13;
            this.f19157e = i15;
            System.arraycopy(cArr, i13, cArr, 0, i15);
        } else {
            this.f19157e = 0;
        }
        this.f19156d = 0;
        do {
            int i16 = this.f19157e;
            int i17 = this.f19153a.read(cArr, i16, 1024 - i16);
            if (i17 == -1) {
                return false;
            }
            i11 = this.f19157e + i17;
            this.f19157e = i11;
            if (this.f19158f == 0 && this.f19159g == 0 && i11 > 0 && cArr[0] == 65279) {
                this.f19156d++;
                this.f19159g = 1;
                i10++;
            }
        } while (i11 < i10);
        return true;
    }

    public final int M(boolean z10) throws IOException {
        int i10;
        int i11 = this.f19156d;
        int i12 = this.f19157e;
        while (true) {
            if (i11 == i12) {
                this.f19156d = i11;
                if (!L(1)) {
                    if (z10) {
                        throw new EOFException("End of input".concat(k()));
                    }
                    return -1;
                }
                i11 = this.f19156d;
                i12 = this.f19157e;
            }
            int i13 = i11 + 1;
            char[] cArr = this.f19155c;
            char c6 = cArr[i11];
            if (c6 == '\n') {
                this.f19158f++;
                this.f19159g = i13;
            } else if (c6 != ' ' && c6 != '\r' && c6 != '\t') {
                if (c6 == '/') {
                    this.f19156d = i13;
                    if (i13 == i12) {
                        this.f19156d = i11;
                        boolean zL = L(2);
                        this.f19156d++;
                        if (!zL) {
                            return 47;
                        }
                    }
                    N();
                    int i14 = this.f19156d;
                    char c10 = cArr[i14];
                    if (c10 == '*') {
                        this.f19156d = i14 + 1;
                        while (true) {
                            if (this.f19156d + 2 > this.f19157e && !L(2)) {
                                P("Unterminated comment");
                                throw null;
                            }
                            int i15 = this.f19156d;
                            if (cArr[i15] != '\n') {
                                while (i10 < 2) {
                                    i10 = cArr[this.f19156d + i10] == "*/".charAt(i10) ? i10 + 1 : 0;
                                }
                                i11 = this.f19156d + 2;
                                i12 = this.f19157e;
                                break;
                            }
                            this.f19158f++;
                            this.f19159g = i15 + 1;
                            this.f19156d++;
                        }
                    } else {
                        if (c10 != '/') {
                            return 47;
                        }
                        this.f19156d = i14 + 1;
                        O();
                        i11 = this.f19156d;
                        i12 = this.f19157e;
                    }
                } else {
                    if (c6 != '#') {
                        this.f19156d = i13;
                        return c6;
                    }
                    this.f19156d = i13;
                    N();
                    O();
                    i11 = this.f19156d;
                    i12 = this.f19157e;
                }
            }
            i11 = i13;
        }
    }

    public final void N() throws zzhzt {
        if (this.f19154b == zzhyq.f19851a) {
            return;
        }
        P("Use JsonReader.setStrictness(Strictness.LENIENT) to accept malformed JSON");
        throw null;
    }

    public final void O() {
        char c6;
        do {
            if (this.f19156d >= this.f19157e && !L(1)) {
                return;
            }
            int i10 = this.f19156d;
            int i11 = i10 + 1;
            this.f19156d = i11;
            c6 = this.f19155c[i10];
            if (c6 == '\n') {
                this.f19158f++;
                this.f19159g = i11;
                return;
            }
        } while (c6 != '\r');
    }

    public final void P(String str) throws zzhzt {
        String strK = k();
        throw new zzhzt(defpackage.e.p(new StringBuilder(str.length() + strK.length() + 79), str, strK, "\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#malformed-json"));
    }

    public final IllegalStateException Q(String str) throws IOException {
        int iM = m();
        String strB = vj1.b(m());
        String strK = k();
        int iC = com.google.android.gms.measurement.internal.u1.c(strB, str.length() + 18, strK.length());
        String strConcat = "https://github.com/google/gson/blob/main/Troubleshooting.md#".concat(iM == 9 ? "adapter-not-null-safe" : "unexpected-json-structure");
        StringBuilder sb = new StringBuilder(strConcat.length() + iC + 5);
        u.a.h(sb, "Expected ", str, " but was ", strB);
        return new IllegalStateException(defpackage.e.p(sb, strK, "\nSee ", strConcat));
    }

    @Override // java.io.Closeable, java.lang.AutoCloseable
    public final void close() throws IOException {
        this.f19160h = 0;
        this.f19163k[0] = 8;
        this.f19164l = 1;
        this.f19153a.close();
    }

    /* JADX WARN: Code restructure failed: missing block: B:162:0x021a, code lost:
    
        if (p(r1) == false) goto L121;
     */
    /* JADX WARN: Code restructure failed: missing block: B:174:0x0237, code lost:
    
        if (r8 == 0) goto L178;
     */
    /* JADX WARN: Removed duplicated region for block: B:113:0x0183  */
    /* JADX WARN: Removed duplicated region for block: B:125:0x01b4  */
    /* JADX WARN: Removed duplicated region for block: B:200:0x026f  */
    /* JADX WARN: Removed duplicated region for block: B:204:0x0279 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:205:0x027a  */
    /* JADX WARN: Removed duplicated region for block: B:211:0x0293 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:225:0x02be  */
    /* JADX WARN: Removed duplicated region for block: B:240:0x02eb  */
    /* JADX WARN: Removed duplicated region for block: B:255:0x0319  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x00e7  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final int e() throws IOException {
        int iM;
        int iM2;
        int i10;
        int iM3;
        String str;
        String str2;
        int i11;
        char c6;
        char c10;
        int i12;
        int[] iArr = this.f19163k;
        int i13 = this.f19164l - 1;
        int i14 = iArr[i13];
        char[] cArr = this.f19155c;
        int i15 = 3;
        int i16 = 1;
        if (i14 != 1) {
            if (i14 != 2) {
                if (i14 == 3 || i14 == 5) {
                    iArr[i13] = 4;
                    if (i14 != 5 || (iM2 = M(true)) == 44) {
                        iM = M(true);
                        if (iM != 34) {
                            i15 = 13;
                        } else {
                            if (iM == 39) {
                                N();
                                this.f19160h = 12;
                                return 12;
                            }
                            if (iM != 125) {
                                N();
                                this.f19156d--;
                                if (!p((char) iM)) {
                                    P("Expected name");
                                    throw null;
                                }
                                i15 = 14;
                            } else {
                                if (i14 == 5) {
                                    P("Expected name");
                                    throw null;
                                }
                                i15 = 2;
                            }
                        }
                    } else if (iM2 != 59) {
                        if (iM2 != 125) {
                            P("Unterminated object");
                            throw null;
                        }
                        i15 = 2;
                    } else {
                        N();
                        iM = M(true);
                        if (iM != 34) {
                        }
                    }
                } else if (i14 == 4) {
                    iArr[i13] = 5;
                    int iM4 = M(true);
                    if (iM4 != 58) {
                        if (iM4 != 61) {
                            P("Expected ':'");
                            throw null;
                        }
                        N();
                        if (this.f19156d < this.f19157e || L(1)) {
                            int i17 = this.f19156d;
                            if (cArr[i17] == '>') {
                                this.f19156d = i17 + 1;
                            }
                        }
                    }
                } else if (i14 == 6) {
                    if (this.f19154b == zzhyq.f19851a) {
                        M(true);
                        int i18 = this.f19156d;
                        this.f19156d = i18 - 1;
                        if (i18 + 4 <= this.f19157e || L(5)) {
                            int i19 = this.f19156d;
                            if (cArr[i19] == ')' && cArr[i19 + 1] == ']' && cArr[i19 + 2] == '}' && cArr[i19 + 3] == '\'' && cArr[i19 + 4] == '\n') {
                                this.f19156d = i19 + 5;
                            }
                        }
                    }
                    this.f19163k[this.f19164l - 1] = 7;
                } else if (i14 == 7) {
                    i10 = 0;
                    if (M(false) == -1) {
                        i15 = 17;
                    } else {
                        N();
                        this.f19156d--;
                    }
                } else {
                    i10 = 0;
                    if (i14 == 8) {
                        throw new IllegalStateException("JsonReader is closed");
                    }
                }
                this.f19160h = i15;
                return i15;
            }
            int iM5 = M(true);
            if (iM5 != 44) {
                if (iM5 != 59) {
                    if (iM5 != 93) {
                        P("Unterminated array");
                        throw null;
                    }
                    i15 = 4;
                    this.f19160h = i15;
                    return i15;
                }
                N();
            }
            iM3 = M(true);
            if (iM3 == 34) {
                if (iM3 == 39) {
                    N();
                    this.f19160h = 8;
                    return 8;
                }
                if (iM3 != 44 && iM3 != 59) {
                    if (iM3 != 91) {
                        if (iM3 != 93) {
                            if (iM3 != 123) {
                                int i20 = this.f19156d - 1;
                                this.f19156d = i20;
                                char c11 = cArr[i20];
                                if (c11 == 't' || c11 == 'T') {
                                    str = "TRUE";
                                    str2 = "true";
                                    i11 = 5;
                                } else if (c11 == 'f' || c11 == 'F') {
                                    str = "FALSE";
                                    str2 = "false";
                                    i11 = 6;
                                } else {
                                    if (c11 == 'n' || c11 == 'N') {
                                        str = "NULL";
                                        str2 = "null";
                                        i11 = 7;
                                    }
                                    i11 = i10;
                                    if (i11 == 0) {
                                        return i11;
                                    }
                                    int i21 = this.f19156d;
                                    int i22 = this.f19157e;
                                    long j10 = 0;
                                    int i23 = i10;
                                    int i24 = i23;
                                    int i25 = i24;
                                    long j11 = 0;
                                    boolean z10 = true;
                                    while (true) {
                                        if (i21 + i24 == i22) {
                                            if (i24 == 1024) {
                                                break;
                                            }
                                            if (!L(i24 + 1)) {
                                                break;
                                            }
                                            int i26 = this.f19156d;
                                            i22 = this.f19157e;
                                            i21 = i26;
                                            c10 = cArr[i21 + i24];
                                            if (c10 != '+') {
                                            }
                                        } else {
                                            c10 = cArr[i21 + i24];
                                            if (c10 != '+') {
                                                if (i23 != 5) {
                                                    break;
                                                }
                                                i23 = 6;
                                                i24++;
                                            } else if (c10 == 'E' || c10 == 'e') {
                                                if (i23 != 2 && i23 != 4) {
                                                    break;
                                                }
                                                i23 = 5;
                                                i24++;
                                            } else if (c10 != '-') {
                                                if (c10 == '.') {
                                                    if (i23 != 2) {
                                                        break;
                                                    }
                                                    i23 = 3;
                                                    i24++;
                                                } else {
                                                    if (c10 < '0' || c10 > '9') {
                                                        break;
                                                    }
                                                    if (i23 == 1 || i23 == 0) {
                                                        j11 = -(c10 - '0');
                                                        j10 = 0;
                                                        i23 = 2;
                                                    } else {
                                                        if (i23 == 2) {
                                                            if (j11 == j10) {
                                                                break;
                                                            }
                                                            long j12 = (10 * j11) - ((long) (c10 - '0'));
                                                            z10 &= j11 > Buffer.OVERFLOW_ZONE || (j11 == Buffer.OVERFLOW_ZONE && j12 < j11);
                                                            j11 = j12;
                                                        } else if (i23 == 3) {
                                                            j10 = 0;
                                                            i23 = 4;
                                                        } else if (i23 == 5 || i23 == 6) {
                                                            j10 = 0;
                                                            i23 = 7;
                                                        }
                                                        j10 = 0;
                                                    }
                                                    i24++;
                                                }
                                            } else if (i23 == 0) {
                                                i23 = 1;
                                                i25 = 1;
                                                i24++;
                                            } else {
                                                if (i23 != 5) {
                                                    break;
                                                }
                                                i23 = 6;
                                                i24++;
                                            }
                                        }
                                        if (i12 == 0) {
                                            return i12;
                                        }
                                        if (!p(cArr[this.f19156d])) {
                                            P("Expected value");
                                            throw null;
                                        }
                                        N();
                                        this.f19160h = 10;
                                        return 10;
                                    }
                                    int i27 = 2;
                                    if (i23 != 2) {
                                        if (i23 != i27 || i23 == 4 || i23 == 7) {
                                            this.f19162j = i24;
                                            i12 = 16;
                                            this.f19160h = i12;
                                        }
                                        i12 = 0;
                                    } else {
                                        if (z10) {
                                            if (j11 != Long.MIN_VALUE) {
                                                i16 = i25;
                                            } else if (i25 != 0) {
                                            }
                                            if (j11 != 0) {
                                                if (i16 == 0) {
                                                }
                                                this.f19161i = j11;
                                                this.f19156d += i24;
                                                i12 = 15;
                                                this.f19160h = i12;
                                            }
                                            j11 = -j11;
                                            this.f19161i = j11;
                                            this.f19156d += i24;
                                            i12 = 15;
                                            this.f19160h = i12;
                                        }
                                        i27 = 2;
                                        i23 = 2;
                                        if (i23 != i27) {
                                        }
                                        this.f19162j = i24;
                                        i12 = 16;
                                        this.f19160h = i12;
                                    }
                                    if (i12 == 0) {
                                    }
                                }
                                zzhyq zzhyqVar = this.f19154b;
                                zzhyq zzhyqVar2 = zzhyq.f19853c;
                                int i28 = i10;
                                while (true) {
                                    int length = str2.length();
                                    if (i28 < length) {
                                        if ((this.f19156d + i28 >= this.f19157e && !L(i28 + 1)) || ((c6 = cArr[this.f19156d + i28]) != str2.charAt(i28) && (zzhyqVar == zzhyqVar2 || c6 != str.charAt(i28)))) {
                                            break;
                                        }
                                        i28++;
                                    } else {
                                        if ((this.f19156d + length < this.f19157e || L(length + 1)) && p(cArr[this.f19156d + length])) {
                                            break;
                                        }
                                        this.f19156d += length;
                                        this.f19160h = i11;
                                    }
                                }
                                if (i11 == 0) {
                                }
                            } else {
                                i15 = 1;
                            }
                        } else if (i14 == 1) {
                            i15 = 4;
                        }
                    }
                }
                if (i14 != 1 && i14 != 2) {
                    P("Unexpected value");
                    throw null;
                }
                N();
                this.f19156d--;
                this.f19160h = 7;
                return 7;
            }
            i15 = 9;
            this.f19160h = i15;
            return i15;
        }
        iArr[i13] = 2;
        i10 = 0;
        iM3 = M(true);
        if (iM3 == 34) {
        }
        this.f19160h = i15;
        return i15;
    }

    public final String g() throws IOException {
        String str;
        int iE = this.f19160h;
        if (iE == 0) {
            iE = e();
        }
        if (iE == 10) {
            str = E();
        } else if (iE == 8) {
            str = x('\'');
        } else if (iE == 9) {
            str = x('\"');
        } else if (iE == 11) {
            str = null;
        } else if (iE == 15) {
            str = Long.toString(this.f19161i);
        } else {
            if (iE != 16) {
                throw Q("a string");
            }
            str = new String(this.f19155c, this.f19156d, this.f19162j);
            this.f19156d += this.f19162j;
        }
        this.f19160h = 0;
        int[] iArr = this.Q;
        int i10 = this.f19164l - 1;
        iArr[i10] = iArr[i10] + 1;
        return str;
    }

    public final String k() {
        int i10 = this.f19158f + 1;
        int i11 = this.f19156d - this.f19159g;
        StringBuilder sb = new StringBuilder("$");
        for (int i12 = 0; i12 < this.f19164l; i12++) {
            int i13 = this.f19163k[i12];
            switch (i13) {
                case 1:
                case 2:
                    int i14 = this.Q[i12];
                    sb.append('[');
                    sb.append(i14);
                    sb.append(']');
                    break;
                case 3:
                case 4:
                case 5:
                    sb.append('.');
                    String str = this.f19165m[i12];
                    if (str != null) {
                        sb.append(str);
                    }
                    break;
                case 6:
                case 7:
                case 8:
                    break;
                default:
                    throw new AssertionError(defpackage.e.n(new StringBuilder(String.valueOf(i13).length() + 21), "Unknown scope value: ", i13));
            }
        }
        int i15 = i11 + 1;
        String string = sb.toString();
        int length = String.valueOf(i10).length();
        int length2 = String.valueOf(i15).length();
        StringBuilder sb2 = new StringBuilder(string.length() + length2 + length + 17 + 6);
        com.google.android.gms.measurement.internal.u1.y(sb2, " at line ", i10, " column ", i15);
        return defpackage.e.o(sb2, " path ", string);
    }

    public final int m() throws IOException {
        int iE = this.f19160h;
        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 boolean p(char c6) throws zzhzt {
        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;
                    }
                }
            }
        }
        N();
        return false;
    }

    public final String toString() {
        return z92.class.getSimpleName().concat(k());
    }

    /* JADX WARN: Code restructure failed: missing block: B:101:0x0137, code lost:
    
        r4 = r2 - r3;
     */
    /* JADX WARN: Code restructure failed: missing block: B:102:0x0139, code lost:
    
        if (r1 != null) goto L104;
     */
    /* JADX WARN: Code restructure failed: missing block: B:103:0x013b, code lost:
    
        r1 = new java.lang.StringBuilder(java.lang.Math.max(r4 + r4, 16));
     */
    /* JADX WARN: Code restructure failed: missing block: B:104:0x0147, code lost:
    
        r1.append(r7, r3, r4);
        r12.f19156d = r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:78:0x00db, code lost:
    
        P("Malformed Unicode escape \\u".concat(new java.lang.String(r7, r12.f19156d, 4)));
     */
    /* JADX WARN: Code restructure failed: missing block: B:79:0x00eb, code lost:
    
        throw null;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final String x(char c6) throws zzhzt {
        int i10;
        StringBuilder sb = null;
        loop0: do {
            int i11 = this.f19156d;
            int i12 = this.f19157e;
            int i13 = i11;
            while (true) {
                char[] cArr = this.f19155c;
                if (i11 >= i12) {
                    break;
                }
                int i14 = i11 + 1;
                char c10 = cArr[i11];
                zzhyq zzhyqVar = this.f19154b;
                zzhyq zzhyqVar2 = zzhyq.f19853c;
                if (zzhyqVar == zzhyqVar2 && c10 < ' ') {
                    P("Unescaped control characters (\\u0000-\\u001F) are not allowed in strict mode");
                    throw null;
                }
                if (c10 == c6) {
                    int i15 = (i14 - i13) - 1;
                    this.f19156d = i14;
                    if (sb == null) {
                        return new String(cArr, i13, i15);
                    }
                    sb.append(cArr, i13, i15);
                    return sb.toString();
                }
                char c11 = '\n';
                if (c10 == '\\') {
                    int i16 = i14 - i13;
                    int i17 = i16 - 1;
                    this.f19156d = i14;
                    if (sb == null) {
                        sb = new StringBuilder(Math.max(i16 + i16, 16));
                    }
                    sb.append(cArr, i13, i17);
                    if (this.f19156d == this.f19157e && !L(1)) {
                        P("Unterminated escape sequence");
                        throw null;
                    }
                    int i18 = this.f19156d;
                    int i19 = i18 + 1;
                    this.f19156d = i19;
                    char c12 = cArr[i18];
                    if (c12 != '\n') {
                        if (c12 == '\"') {
                            c11 = c12;
                            sb.append(c11);
                            i13 = this.f19156d;
                            i12 = this.f19157e;
                            i11 = i13;
                        } else {
                            if (c12 != '\'') {
                                if (c12 != '/' && c12 != '\\') {
                                    if (c12 == 'b') {
                                        c11 = '\b';
                                    } else if (c12 == 'f') {
                                        c11 = '\f';
                                    } else if (c12 != 'n') {
                                        if (c12 == 'r') {
                                            c11 = '\r';
                                        } else if (c12 == 't') {
                                            c11 = '\t';
                                        } else {
                                            if (c12 != 'u') {
                                                P("Invalid escape sequence");
                                                throw null;
                                            }
                                            if (i18 + 5 > this.f19157e && !L(4)) {
                                                P("Unterminated escape sequence");
                                                throw null;
                                            }
                                            int i20 = this.f19156d;
                                            int i21 = i20 + 4;
                                            int i22 = 0;
                                            while (i20 < i21) {
                                                int i23 = i22 << 4;
                                                char c13 = cArr[i20];
                                                if (c13 >= '0' && c13 <= '9') {
                                                    i10 = c13 - '0';
                                                } else if (c13 >= 'a' && c13 <= 'f') {
                                                    i10 = c13 - 'W';
                                                } else {
                                                    if (c13 < 'A' || c13 > 'F') {
                                                        break loop0;
                                                    }
                                                    i10 = c13 - '7';
                                                }
                                                i22 = i10 + i23;
                                                i20++;
                                            }
                                            this.f19156d += 4;
                                            c11 = (char) i22;
                                        }
                                    }
                                }
                                sb.append(c11);
                                i13 = this.f19156d;
                                i12 = this.f19157e;
                                i11 = i13;
                            }
                            c11 = c12;
                            sb.append(c11);
                            i13 = this.f19156d;
                            i12 = this.f19157e;
                            i11 = i13;
                        }
                    } else {
                        if (this.f19154b == zzhyqVar2) {
                            P("Cannot escape a newline character in strict mode");
                            throw null;
                        }
                        this.f19158f++;
                        this.f19159g = i19;
                    }
                    if (this.f19154b == zzhyqVar2) {
                        P("Invalid escaped character \"'\" in strict mode");
                        throw null;
                    }
                    c11 = c12;
                    sb.append(c11);
                    i13 = this.f19156d;
                    i12 = this.f19157e;
                    i11 = i13;
                } else {
                    if (c10 == '\n') {
                        this.f19158f++;
                        this.f19159g = i14;
                    }
                    i11 = i14;
                }
            }
        } while (L(1));
        P("Unterminated string");
        throw null;
    }
}
