package com.google.ads.interactivemedia.v3.internal;

import com.google.android.gms.measurement.internal.u1;
import defpackage.e;
import java.io.Closeable;
import java.io.EOFException;
import java.io.IOException;
import java.io.Reader;
import java.util.Arrays;
import java.util.Objects;
import okio.internal.Buffer;

/* JADX INFO: loaded from: classes2.dex */
public class zzacc implements Closeable {
    private final Reader zzb;
    private long zzi;
    private int zzj;
    private String zzk;
    private int[] zzl;
    private String[] zzn;
    private int[] zzo;
    private zzwg zzc = zzwg.LEGACY_STRICT;
    private final char[] zzd = new char[1024];
    private int zze = 0;
    private int zzf = 0;
    private int zzg = 0;
    private int zzh = 0;
    int zza = 0;
    private int zzm = 1;

    static {
        zzxp.zza = new zzacb();
    }

    public zzacc(Reader reader) {
        int[] iArr = new int[32];
        this.zzl = iArr;
        iArr[0] = 6;
        this.zzn = new String[32];
        this.zzo = new int[32];
        Objects.requireNonNull(reader, "in == null");
        this.zzb = reader;
    }

    private String zzA(boolean z10) {
        StringBuilder sb = new StringBuilder("$");
        int i10 = 0;
        while (true) {
            int i11 = this.zzm;
            if (i10 >= i11) {
                return sb.toString();
            }
            int i12 = this.zzl[i10];
            switch (i12) {
                case 1:
                case 2:
                    int i13 = this.zzo[i10];
                    if (z10 && i13 > 0 && i10 == i11 - 1) {
                        i13--;
                    }
                    sb.append('[');
                    sb.append(i13);
                    sb.append(']');
                    break;
                case 3:
                case 4:
                case 5:
                    sb.append('.');
                    String str = this.zzn[i10];
                    if (str != null) {
                        sb.append(str);
                    }
                    break;
                case 6:
                case 7:
                case 8:
                    break;
                default:
                    throw new AssertionError(u1.g("Unknown scope value: ", i12));
            }
            i10++;
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:30:0x006f, code lost:
    
        r3 = r1 - r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:31:0x0071, code lost:
    
        if (r0 != null) goto L33;
     */
    /* JADX WARN: Code restructure failed: missing block: B:32:0x0073, code lost:
    
        r0 = new java.lang.StringBuilder(java.lang.Math.max(r3 + r3, 16));
     */
    /* JADX WARN: Code restructure failed: missing block: B:33:0x007f, code lost:
    
        r0.append(r4, r2, r3);
        r10.zze = r1;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private final String zzB(char c6) throws IOException {
        StringBuilder sb = null;
        do {
            int i10 = this.zze;
            int i11 = this.zzf;
            int i12 = i10;
            while (true) {
                char[] cArr = this.zzd;
                if (i10 >= i11) {
                    break;
                }
                int i13 = i10 + 1;
                char c10 = cArr[i10];
                if (this.zzc == zzwg.STRICT && c10 < ' ') {
                    throw zzy("Unescaped control characters (\\u0000-\\u001F) are not allowed in strict mode");
                }
                if (c10 == c6) {
                    int i14 = (i13 - i12) - 1;
                    this.zze = i13;
                    if (sb == null) {
                        return new String(cArr, i12, i14);
                    }
                    sb.append(cArr, i12, i14);
                    return sb.toString();
                }
                if (c10 == '\\') {
                    int i15 = i13 - i12;
                    int i16 = i15 - 1;
                    this.zze = i13;
                    if (sb == null) {
                        sb = new StringBuilder(Math.max(i15 + i15, 16));
                    }
                    sb.append(cArr, i12, i16);
                    sb.append(zzd());
                    i12 = this.zze;
                    i11 = this.zzf;
                    i10 = i12;
                } else {
                    if (c10 == '\n') {
                        this.zzg++;
                        this.zzh = i13;
                    }
                    i10 = i13;
                }
            }
        } while (zzI(1));
        throw zzy("Unterminated string");
    }

    /* JADX WARN: Code restructure failed: missing block: B:34:0x0048, code lost:
    
        zzD();
     */
    /* 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:0x007d  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x0087  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private final String zzC() throws IOException {
        String string;
        int i10 = 0;
        StringBuilder sb = null;
        do {
            int i11 = 0;
            while (true) {
                int i12 = this.zze + i11;
                if (i12 < this.zzf) {
                    char c6 = this.zzd[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(this.zzd, this.zze, i11);
                    this.zze += i11;
                } else if (zzI(i11 + 1)) {
                }
            }
            i10 = i11;
            if (sb != null) {
                string = new String(this.zzd, this.zze, i10);
            } else {
                sb.append(this.zzd, this.zze, i10);
                string = sb.toString();
            }
            this.zze += i10;
            return string;
        } while (zzI(1));
        if (sb != null) {
        }
        this.zze += i10;
        return string;
    }

    private final void zzD() throws zzacf {
        if (this.zzc != zzwg.LENIENT) {
            throw zzy("Use JsonReader.setStrictness(Strictness.LENIENT) to accept malformed JSON");
        }
    }

    private final void zzE(int i10) throws zzacf {
        int i11 = this.zzm;
        if (i11 - 1 >= 1280) {
            throw new zzacf(e.i("Nesting limit 1280 reached", zzv()));
        }
        int[] iArr = this.zzl;
        if (i11 == iArr.length) {
            int i12 = i11 + i11;
            this.zzl = Arrays.copyOf(iArr, i12);
            this.zzo = Arrays.copyOf(this.zzo, i12);
            this.zzn = (String[]) Arrays.copyOf(this.zzn, i12);
        }
        int[] iArr2 = this.zzl;
        int i13 = this.zzm;
        this.zzm = i13 + 1;
        iArr2[i13] = i10;
    }

    private final void zzF(char c6) throws IOException {
        do {
            int i10 = this.zze;
            int i11 = this.zzf;
            while (i10 < i11) {
                int i12 = i10 + 1;
                char c10 = this.zzd[i10];
                if (c10 == c6) {
                    this.zze = i12;
                    return;
                }
                if (c10 == '\\') {
                    this.zze = i12;
                    zzd();
                    i10 = this.zze;
                    i11 = this.zzf;
                } else {
                    if (c10 == '\n') {
                        this.zzg++;
                        this.zzh = i12;
                    }
                    i10 = i12;
                }
            }
            this.zze = i10;
        } while (zzI(1));
        throw zzy("Unterminated string");
    }

    private final void zzG() throws IOException {
        char c6;
        do {
            if (this.zze >= this.zzf && !zzI(1)) {
                return;
            }
            char[] cArr = this.zzd;
            int i10 = this.zze;
            int i11 = i10 + 1;
            this.zze = i11;
            c6 = cArr[i10];
            if (c6 == '\n') {
                this.zzg++;
                this.zzh = i11;
                return;
            }
        } while (c6 != '\r');
    }

    /* JADX WARN: Code restructure failed: missing block: B:34:0x0047, code lost:
    
        zzD();
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private final void zzH() throws IOException {
        do {
            int i10 = 0;
            while (true) {
                int i11 = this.zze + i10;
                if (i11 < this.zzf) {
                    char c6 = this.zzd[i11];
                    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:
                                                    i10++;
                                                    break;
                                            }
                                            return;
                                        }
                                    }
                                }
                            }
                        }
                    }
                } else {
                    this.zze = i11;
                }
            }
            this.zze += i10;
            return;
        } while (zzI(1));
    }

    private final boolean zzI(int i10) throws IOException {
        int i11;
        int i12 = this.zzh;
        int i13 = this.zze;
        this.zzh = i12 - i13;
        char[] cArr = this.zzd;
        int i14 = this.zzf;
        if (i14 != i13) {
            int i15 = i14 - i13;
            this.zzf = i15;
            System.arraycopy(cArr, i13, cArr, 0, i15);
        } else {
            this.zzf = 0;
        }
        this.zze = 0;
        do {
            Reader reader = this.zzb;
            int i16 = this.zzf;
            int i17 = reader.read(cArr, i16, 1024 - i16);
            if (i17 == -1) {
                return false;
            }
            i11 = this.zzf + i17;
            this.zzf = i11;
            if (this.zzg == 0 && this.zzh == 0 && i11 > 0 && cArr[0] == 65279) {
                this.zze++;
                this.zzh = 1;
                i10++;
            }
        } while (i11 < i10);
        return true;
    }

    private final boolean zzJ(char c6) throws IOException {
        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;
                    }
                }
            }
        }
        zzD();
        return false;
    }

    private final char zzd() throws IOException {
        int i10;
        if (this.zze == this.zzf && !zzI(1)) {
            throw zzy("Unterminated escape sequence");
        }
        char[] cArr = this.zzd;
        int i11 = this.zze;
        int i12 = i11 + 1;
        this.zze = i12;
        char c6 = cArr[i11];
        if (c6 != '\n') {
            if (c6 != '\"') {
                if (c6 != '\'') {
                    if (c6 != '/' && c6 != '\\') {
                        if (c6 == 'b') {
                            return '\b';
                        }
                        if (c6 == 'f') {
                            return '\f';
                        }
                        if (c6 == 'n') {
                            return '\n';
                        }
                        if (c6 == 'r') {
                            return '\r';
                        }
                        if (c6 == 't') {
                            return '\t';
                        }
                        if (c6 != 'u') {
                            throw zzy("Invalid escape sequence");
                        }
                        if (i11 + 5 > this.zzf && !zzI(4)) {
                            throw zzy("Unterminated escape sequence");
                        }
                        int i13 = this.zze;
                        int i14 = i13 + 4;
                        int i15 = 0;
                        while (i13 < i14) {
                            char[] cArr2 = this.zzd;
                            int i16 = i15 << 4;
                            char c10 = cArr2[i13];
                            if (c10 >= '0' && c10 <= '9') {
                                i10 = c10 - '0';
                            } else if (c10 >= 'a' && c10 <= 'f') {
                                i10 = c10 - 'W';
                            } else {
                                if (c10 < 'A' || c10 > 'F') {
                                    throw zzy("Malformed Unicode escape \\u".concat(new String(cArr2, this.zze, 4)));
                                }
                                i10 = c10 - '7';
                            }
                            i15 = i10 + i16;
                            i13++;
                        }
                        this.zze += 4;
                        return (char) i15;
                    }
                }
            }
            return c6;
        }
        if (this.zzc == zzwg.STRICT) {
            throw zzy("Cannot escape a newline character in strict mode");
        }
        this.zzg++;
        this.zzh = i12;
        if (this.zzc == zzwg.STRICT) {
            throw zzy("Invalid escaped character \"'\" in strict mode");
        }
        return c6;
    }

    private final int zzn(boolean z10) throws IOException {
        int i10;
        int i11 = this.zze;
        int i12 = this.zzf;
        while (true) {
            if (i11 == i12) {
                this.zze = i11;
                if (!zzI(1)) {
                    if (z10) {
                        throw new EOFException("End of input".concat(zzv()));
                    }
                    return -1;
                }
                i11 = this.zze;
                i12 = this.zzf;
            }
            char[] cArr = this.zzd;
            int i13 = i11 + 1;
            char c6 = cArr[i11];
            if (c6 == '\n') {
                this.zzg++;
                this.zzh = i13;
            } else if (c6 != ' ' && c6 != '\r' && c6 != '\t') {
                if (c6 == '/') {
                    this.zze = i13;
                    if (i13 == i12) {
                        this.zze = i11;
                        boolean zZzI = zzI(2);
                        this.zze++;
                        if (!zZzI) {
                            return 47;
                        }
                    }
                    zzD();
                    int i14 = this.zze;
                    char c10 = cArr[i14];
                    if (c10 == '*') {
                        this.zze = i14 + 1;
                        while (true) {
                            if (this.zze + 2 > this.zzf && !zzI(2)) {
                                throw zzy("Unterminated comment");
                            }
                            char[] cArr2 = this.zzd;
                            int i15 = this.zze;
                            if (cArr2[i15] != '\n') {
                                while (i10 < 2) {
                                    i10 = this.zzd[this.zze + i10] == "*/".charAt(i10) ? i10 + 1 : 0;
                                }
                                i11 = this.zze + 2;
                                i12 = this.zzf;
                                break;
                            }
                            this.zzg++;
                            this.zzh = i15 + 1;
                            this.zze++;
                        }
                    } else {
                        if (c10 != '/') {
                            return 47;
                        }
                        this.zze = i14 + 1;
                        zzG();
                        i11 = this.zze;
                        i12 = this.zzf;
                    }
                } else {
                    if (c6 != '#') {
                        this.zze = i13;
                        return c6;
                    }
                    this.zze = i13;
                    zzD();
                    zzG();
                    i11 = this.zze;
                    i12 = this.zzf;
                }
            }
            i11 = i13;
        }
    }

    private final zzacf zzy(String str) throws zzacf {
        throw new zzacf(e.j(str, zzv(), "\nSee https://github.com/google/gson/blob/main/Troubleshooting.md#malformed-json"));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final IllegalStateException zzz(String str) throws IOException {
        int iZzr = zzr();
        StringBuilder sbT = e.t("Expected ", str, " but was ", zzacd.zza(zzr()), zzv());
        sbT.append("\nSee ");
        sbT.append("https://github.com/google/gson/blob/main/Troubleshooting.md#".concat(iZzr == 9 ? "adapter-not-null-safe" : "unexpected-json-structure"));
        return new IllegalStateException(sbT.toString());
    }

    @Override // java.io.Closeable, java.lang.AutoCloseable
    public void close() throws IOException {
        this.zza = 0;
        this.zzl[0] = 8;
        this.zzm = 1;
        this.zzb.close();
    }

    public String toString() {
        return getClass().getSimpleName().concat(zzv());
    }

    public double zza() throws IOException {
        int iZzs = this.zza;
        if (iZzs == 0) {
            iZzs = zzs();
        }
        if (iZzs == 15) {
            this.zza = 0;
            int[] iArr = this.zzo;
            int i10 = this.zzm - 1;
            iArr[i10] = iArr[i10] + 1;
            return this.zzi;
        }
        if (iZzs == 16) {
            char[] cArr = this.zzd;
            int i11 = this.zze;
            int i12 = this.zzj;
            this.zzk = new String(cArr, i11, i12);
            this.zze = i11 + i12;
        } else if (iZzs == 8 || iZzs == 9) {
            this.zzk = zzB(iZzs == 8 ? '\'' : '\"');
        } else if (iZzs == 10) {
            this.zzk = zzC();
        } else if (iZzs != 11) {
            throw zzz("a double");
        }
        this.zza = 11;
        double d10 = Double.parseDouble(this.zzk);
        if (this.zzc != zzwg.LENIENT && (Double.isNaN(d10) || Double.isInfinite(d10))) {
            throw zzy("JSON forbids NaN and infinities: " + d10);
        }
        this.zzk = null;
        this.zza = 0;
        int[] iArr2 = this.zzo;
        int i13 = this.zzm - 1;
        iArr2[i13] = iArr2[i13] + 1;
        return d10;
    }

    public int zzb() throws IOException {
        int iZzs = this.zza;
        if (iZzs == 0) {
            iZzs = zzs();
        }
        if (iZzs == 15) {
            long j10 = this.zzi;
            int i10 = (int) j10;
            if (j10 == i10) {
                this.zza = 0;
                int[] iArr = this.zzo;
                int i11 = this.zzm - 1;
                iArr[i11] = iArr[i11] + 1;
                return i10;
            }
            throw new NumberFormatException("Expected an int but was " + j10 + zzv());
        }
        if (iZzs == 16) {
            char[] cArr = this.zzd;
            int i12 = this.zze;
            int i13 = this.zzj;
            this.zzk = new String(cArr, i12, i13);
            this.zze = i12 + i13;
        } else {
            if (iZzs != 8 && iZzs != 9 && iZzs != 10) {
                throw zzz("an int");
            }
            if (iZzs == 10) {
                this.zzk = zzC();
            } else {
                this.zzk = zzB(iZzs == 8 ? '\'' : '\"');
            }
            try {
                int i14 = Integer.parseInt(this.zzk);
                this.zza = 0;
                int[] iArr2 = this.zzo;
                int i15 = this.zzm - 1;
                iArr2[i15] = iArr2[i15] + 1;
                return i14;
            } catch (NumberFormatException unused) {
            }
        }
        this.zza = 11;
        double d10 = Double.parseDouble(this.zzk);
        int i16 = (int) d10;
        if (i16 != d10) {
            throw new NumberFormatException(u1.k("Expected an int but was ", this.zzk, zzv()));
        }
        this.zzk = null;
        this.zza = 0;
        int[] iArr3 = this.zzo;
        int i17 = this.zzm - 1;
        iArr3[i17] = iArr3[i17] + 1;
        return i16;
    }

    public long zzc() throws IOException {
        int iZzs = this.zza;
        if (iZzs == 0) {
            iZzs = zzs();
        }
        if (iZzs == 15) {
            this.zza = 0;
            int[] iArr = this.zzo;
            int i10 = this.zzm - 1;
            iArr[i10] = iArr[i10] + 1;
            return this.zzi;
        }
        if (iZzs == 16) {
            char[] cArr = this.zzd;
            int i11 = this.zze;
            int i12 = this.zzj;
            this.zzk = new String(cArr, i11, i12);
            this.zze = i11 + i12;
        } else {
            if (iZzs != 8 && iZzs != 9 && iZzs != 10) {
                throw zzz("a long");
            }
            if (iZzs == 10) {
                this.zzk = zzC();
            } else {
                this.zzk = zzB(iZzs == 8 ? '\'' : '\"');
            }
            try {
                long j10 = Long.parseLong(this.zzk);
                this.zza = 0;
                int[] iArr2 = this.zzo;
                int i13 = this.zzm - 1;
                iArr2[i13] = iArr2[i13] + 1;
                return j10;
            } catch (NumberFormatException unused) {
            }
        }
        this.zza = 11;
        double d10 = Double.parseDouble(this.zzk);
        long j11 = (long) d10;
        if (j11 != d10) {
            throw new NumberFormatException(u1.k("Expected a long but was ", this.zzk, zzv()));
        }
        this.zzk = null;
        this.zza = 0;
        int[] iArr3 = this.zzo;
        int i14 = this.zzm - 1;
        iArr3[i14] = iArr3[i14] + 1;
        return j11;
    }

    public String zze() {
        return zzA(false);
    }

    public String zzf() {
        return zzA(true);
    }

    public String zzg() throws IOException {
        String strZzB;
        int iZzs = this.zza;
        if (iZzs == 0) {
            iZzs = zzs();
        }
        if (iZzs == 14) {
            strZzB = zzC();
        } else if (iZzs == 12) {
            strZzB = zzB('\'');
        } else {
            if (iZzs != 13) {
                throw zzz("a name");
            }
            strZzB = zzB('\"');
        }
        this.zza = 0;
        this.zzn[this.zzm - 1] = strZzB;
        return strZzB;
    }

    public String zzh() throws IOException {
        String string;
        int iZzs = this.zza;
        if (iZzs == 0) {
            iZzs = zzs();
        }
        if (iZzs == 10) {
            string = zzC();
        } else if (iZzs == 8) {
            string = zzB('\'');
        } else if (iZzs == 9) {
            string = zzB('\"');
        } else if (iZzs == 11) {
            string = this.zzk;
            this.zzk = null;
        } else if (iZzs == 15) {
            string = Long.toString(this.zzi);
        } else {
            if (iZzs != 16) {
                throw zzz("a string");
            }
            String str = new String(this.zzd, this.zze, this.zzj);
            this.zze += this.zzj;
            string = str;
        }
        this.zza = 0;
        int[] iArr = this.zzo;
        int i10 = this.zzm - 1;
        iArr[i10] = iArr[i10] + 1;
        return string;
    }

    public void zzi() throws IOException {
        int iZzs = this.zza;
        if (iZzs == 0) {
            iZzs = zzs();
        }
        if (iZzs != 3) {
            throw zzz("BEGIN_ARRAY");
        }
        zzE(1);
        this.zzo[this.zzm - 1] = 0;
        this.zza = 0;
    }

    public void zzj() throws IOException {
        int iZzs = this.zza;
        if (iZzs == 0) {
            iZzs = zzs();
        }
        if (iZzs != 1) {
            throw zzz("BEGIN_OBJECT");
        }
        zzE(3);
        this.zza = 0;
    }

    public void zzk() throws IOException {
        int iZzs = this.zza;
        if (iZzs == 0) {
            iZzs = zzs();
        }
        if (iZzs != 4) {
            throw zzz("END_ARRAY");
        }
        int i10 = this.zzm;
        this.zzm = i10 - 1;
        int[] iArr = this.zzo;
        int i11 = i10 - 2;
        iArr[i11] = iArr[i11] + 1;
        this.zza = 0;
    }

    public void zzl() throws IOException {
        int iZzs = this.zza;
        if (iZzs == 0) {
            iZzs = zzs();
        }
        if (iZzs != 2) {
            throw zzz("END_OBJECT");
        }
        int i10 = this.zzm;
        int i11 = i10 - 1;
        this.zzm = i11;
        this.zzn[i11] = null;
        int[] iArr = this.zzo;
        int i12 = i10 - 2;
        iArr[i12] = iArr[i12] + 1;
        this.zza = 0;
    }

    public void zzm() throws IOException {
        int iZzs = this.zza;
        if (iZzs == 0) {
            iZzs = zzs();
        }
        if (iZzs != 7) {
            throw zzz("null");
        }
        this.zza = 0;
        int[] iArr = this.zzo;
        int i10 = this.zzm - 1;
        iArr[i10] = iArr[i10] + 1;
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    public void zzo() throws IOException {
        int i10 = 0;
        do {
            int iZzs = this.zza;
            if (iZzs == 0) {
                iZzs = zzs();
            }
            switch (iZzs) {
                case 1:
                    zzE(3);
                    i10++;
                    this.zza = 0;
                    break;
                case 2:
                    if (i10 == 0) {
                        this.zzn[this.zzm - 1] = null;
                        i10 = 0;
                    }
                    this.zzm--;
                    i10--;
                    this.zza = 0;
                    break;
                case 3:
                    zzE(1);
                    i10++;
                    this.zza = 0;
                    break;
                case 4:
                    this.zzm--;
                    i10--;
                    this.zza = 0;
                    break;
                case 5:
                case 6:
                case 7:
                case 11:
                case 15:
                default:
                    this.zza = 0;
                    break;
                case 8:
                    zzF('\'');
                    this.zza = 0;
                    break;
                case 9:
                    zzF('\"');
                    this.zza = 0;
                    break;
                case 10:
                    zzH();
                    this.zza = 0;
                    break;
                case 12:
                    zzF('\'');
                    if (i10 == 0) {
                        this.zzn[this.zzm - 1] = "<skipped>";
                        i10 = 0;
                    }
                    this.zza = 0;
                    break;
                case 13:
                    zzF('\"');
                    if (i10 == 0) {
                        this.zzn[this.zzm - 1] = "<skipped>";
                        i10 = 0;
                    }
                    this.zza = 0;
                    break;
                case 14:
                    zzH();
                    if (i10 == 0) {
                        this.zzn[this.zzm - 1] = "<skipped>";
                        i10 = 0;
                    }
                    this.zza = 0;
                    break;
                case 16:
                    this.zze += this.zzj;
                    this.zza = 0;
                    break;
                case 17:
                    break;
            }
            return;
        } while (i10 > 0);
        int[] iArr = this.zzo;
        int i11 = this.zzm - 1;
        iArr[i11] = iArr[i11] + 1;
    }

    public boolean zzp() throws IOException {
        int iZzs = this.zza;
        if (iZzs == 0) {
            iZzs = zzs();
        }
        return (iZzs == 2 || iZzs == 4 || iZzs == 17) ? false : true;
    }

    public boolean zzq() throws IOException {
        int iZzs = this.zza;
        if (iZzs == 0) {
            iZzs = zzs();
        }
        if (iZzs == 5) {
            this.zza = 0;
            int[] iArr = this.zzo;
            int i10 = this.zzm - 1;
            iArr[i10] = iArr[i10] + 1;
            return true;
        }
        if (iZzs != 6) {
            throw zzz("a boolean");
        }
        this.zza = 0;
        int[] iArr2 = this.zzo;
        int i11 = this.zzm - 1;
        iArr2[i11] = iArr2[i11] + 1;
        return false;
    }

    public int zzr() throws IOException {
        int iZzs = this.zza;
        if (iZzs == 0) {
            iZzs = zzs();
        }
        switch (iZzs) {
            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;
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:164:0x021b, code lost:
    
        if (zzJ(r1) == false) goto L121;
     */
    /* JADX WARN: Code restructure failed: missing block: B:176:0x0237, code lost:
    
        if (r14 == 0) goto L180;
     */
    /* JADX WARN: Removed duplicated region for block: B:113:0x018a  */
    /* JADX WARN: Removed duplicated region for block: B:125:0x01bc  */
    /* JADX WARN: Removed duplicated region for block: B:202:0x0272  */
    /* JADX WARN: Removed duplicated region for block: B:207:0x027e A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:208:0x027f  */
    /* JADX WARN: Removed duplicated region for block: B:214:0x029a A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:228:0x02c4  */
    /* JADX WARN: Removed duplicated region for block: B:244:0x02f3  */
    /* JADX WARN: Removed duplicated region for block: B:258:0x0320  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x00e9  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final int zzs() throws IOException {
        int i10;
        int i11;
        int iZzn;
        int iZzn2;
        int i12;
        int iZzn3;
        String str;
        String str2;
        int i13;
        char c6;
        char c10;
        int i14;
        int i15;
        int[] iArr = this.zzl;
        int i16 = this.zzm - 1;
        int i17 = iArr[i16];
        int i18 = 3;
        int i19 = 1;
        if (i17 != 1) {
            if (i17 != 2) {
                if (i17 == 3) {
                    i10 = 2;
                    i11 = 4;
                } else if (i17 == 5) {
                    i11 = 4;
                    i10 = 2;
                } else if (i17 == 4) {
                    iArr[i16] = 5;
                    int iZzn4 = zzn(true);
                    if (iZzn4 != 58) {
                        if (iZzn4 != 61) {
                            throw zzy("Expected ':'");
                        }
                        zzD();
                        if (this.zze < this.zzf || zzI(1)) {
                            char[] cArr = this.zzd;
                            int i20 = this.zze;
                            if (cArr[i20] == '>') {
                                this.zze = i20 + 1;
                            }
                        }
                    }
                } else if (i17 == 6) {
                    if (this.zzc == zzwg.LENIENT) {
                        zzn(true);
                        int i21 = this.zze;
                        this.zze = i21 - 1;
                        if (i21 + 4 <= this.zzf || zzI(5)) {
                            int i22 = this.zze;
                            char[] cArr2 = this.zzd;
                            if (cArr2[i22] == ')' && cArr2[i22 + 1] == ']' && cArr2[i22 + 2] == '}' && cArr2[i22 + 3] == '\'' && cArr2[i22 + 4] == '\n') {
                                this.zze = i22 + 5;
                            }
                        }
                    }
                    this.zzl[this.zzm - 1] = 7;
                } else if (i17 == 7) {
                    i12 = 0;
                    if (zzn(false) == -1) {
                        i18 = 17;
                        this.zza = i18;
                        return i18;
                    }
                    zzD();
                    this.zze--;
                } else {
                    i12 = 0;
                    if (i17 == 8) {
                        throw new IllegalStateException("JsonReader is closed");
                    }
                }
                iArr[i16] = i11;
                if (i17 != 5 || (iZzn2 = zzn(true)) == 44) {
                    iZzn = zzn(true);
                    if (iZzn != 34) {
                        i18 = 13;
                    } else {
                        if (iZzn == 39) {
                            zzD();
                            this.zza = 12;
                            return 12;
                        }
                        if (iZzn != 125) {
                            zzD();
                            this.zze--;
                            if (!zzJ((char) iZzn)) {
                                throw zzy("Expected name");
                            }
                            i18 = 14;
                        } else {
                            if (i17 == 5) {
                                throw zzy("Expected name");
                            }
                            i18 = i10;
                        }
                    }
                } else if (iZzn2 != 59) {
                    if (iZzn2 != 125) {
                        throw zzy("Unterminated object");
                    }
                    i18 = i10;
                } else {
                    zzD();
                    iZzn = zzn(true);
                    if (iZzn != 34) {
                    }
                }
                this.zza = i18;
                return i18;
            }
            int iZzn5 = zzn(true);
            if (iZzn5 != 44) {
                if (iZzn5 != 59) {
                    if (iZzn5 != 93) {
                        throw zzy("Unterminated array");
                    }
                    i18 = 4;
                    this.zza = i18;
                    return i18;
                }
                zzD();
            }
            iZzn3 = zzn(true);
            if (iZzn3 == 34) {
                if (iZzn3 == 39) {
                    zzD();
                    this.zza = 8;
                    return 8;
                }
                if (iZzn3 != 44 && iZzn3 != 59) {
                    if (iZzn3 != 91) {
                        if (iZzn3 != 93) {
                            if (iZzn3 != 123) {
                                int i23 = this.zze - 1;
                                this.zze = i23;
                                char c11 = this.zzd[i23];
                                if (c11 == 't' || c11 == 'T') {
                                    str = "TRUE";
                                    str2 = "true";
                                    i13 = 5;
                                } else if (c11 == 'f' || c11 == 'F') {
                                    str = "FALSE";
                                    str2 = "false";
                                    i13 = 6;
                                } else {
                                    if (c11 == 'n' || c11 == 'N') {
                                        str = "NULL";
                                        str2 = "null";
                                        i13 = 7;
                                    }
                                    i13 = i12;
                                    if (i13 == 0) {
                                        return i13;
                                    }
                                    char[] cArr3 = this.zzd;
                                    int i24 = this.zze;
                                    int i25 = this.zzf;
                                    long j10 = 0;
                                    int i26 = i12;
                                    int i27 = i26;
                                    int i28 = i27;
                                    long j11 = 0;
                                    boolean z10 = true;
                                    while (true) {
                                        if (i24 + i27 == i25) {
                                            if (i27 == 1024) {
                                                break;
                                            }
                                            if (!zzI(i27 + 1)) {
                                                break;
                                            }
                                            int i29 = this.zze;
                                            i25 = this.zzf;
                                            i24 = i29;
                                            c10 = cArr3[i24 + i27];
                                            if (c10 != '+') {
                                            }
                                        } else {
                                            c10 = cArr3[i24 + i27];
                                            if (c10 != '+') {
                                                i14 = 6;
                                                if (i26 != 5) {
                                                    break;
                                                }
                                                i26 = i14;
                                                i27++;
                                            } else if (c10 == 'E' || c10 == 'e') {
                                                if (i26 != 2 && i26 != 4) {
                                                    break;
                                                }
                                                i26 = 5;
                                                i27++;
                                            } else if (c10 == '-') {
                                                i14 = 6;
                                                if (i26 == 0) {
                                                    i26 = 1;
                                                    i28 = 1;
                                                    i27++;
                                                } else {
                                                    if (i26 != 5) {
                                                        break;
                                                    }
                                                    i26 = i14;
                                                    i27++;
                                                }
                                            } else if (c10 == '.') {
                                                if (i26 != 2) {
                                                    break;
                                                }
                                                i26 = 3;
                                                i27++;
                                            } else {
                                                if (c10 < '0' || c10 > '9') {
                                                    break;
                                                }
                                                if (i26 == 1 || i26 == 0) {
                                                    j11 = -(c10 - '0');
                                                    i26 = 2;
                                                } else if (i26 == 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 (i26 == 3) {
                                                    i26 = 4;
                                                } else if (i26 == 5 || i26 == 6) {
                                                    i26 = 7;
                                                }
                                                j10 = 0;
                                                i27++;
                                            }
                                        }
                                        if (i15 == 0) {
                                            return i15;
                                        }
                                        if (!zzJ(this.zzd[this.zze])) {
                                            throw zzy("Expected value");
                                        }
                                        zzD();
                                        this.zza = 10;
                                        return 10;
                                    }
                                    int i30 = 2;
                                    if (i26 != 2) {
                                        if (i26 != i30 || i26 == 4 || i26 == 7) {
                                            this.zzj = i27;
                                            i15 = 16;
                                            this.zza = i15;
                                        }
                                        i15 = 0;
                                    } else {
                                        if (z10) {
                                            if (j11 != Long.MIN_VALUE) {
                                                i19 = i28;
                                            } else if (i28 != 0) {
                                            }
                                            if (j11 != 0) {
                                                if (i19 == 0) {
                                                }
                                                this.zzi = j11;
                                                this.zze += i27;
                                                i15 = 15;
                                                this.zza = i15;
                                            }
                                            j11 = -j11;
                                            this.zzi = j11;
                                            this.zze += i27;
                                            i15 = 15;
                                            this.zza = i15;
                                        }
                                        i30 = 2;
                                        i26 = 2;
                                        if (i26 != i30) {
                                        }
                                        this.zzj = i27;
                                        i15 = 16;
                                        this.zza = i15;
                                    }
                                    if (i15 == 0) {
                                    }
                                }
                                zzwg zzwgVar = this.zzc;
                                zzwg zzwgVar2 = zzwg.STRICT;
                                int i31 = i12;
                                while (true) {
                                    int length = str2.length();
                                    if (i31 < length) {
                                        if ((this.zze + i31 >= this.zzf && !zzI(i31 + 1)) || ((c6 = this.zzd[this.zze + i31]) != str2.charAt(i31) && (zzwgVar == zzwgVar2 || c6 != str.charAt(i31)))) {
                                            break;
                                        }
                                        i31++;
                                    } else {
                                        if ((this.zze + length < this.zzf || zzI(length + 1)) && zzJ(this.zzd[this.zze + length])) {
                                            break;
                                        }
                                        this.zze += length;
                                        this.zza = i13;
                                    }
                                }
                                if (i13 == 0) {
                                }
                            } else {
                                i18 = 1;
                            }
                        } else if (i17 == 1) {
                            i18 = 4;
                        }
                    }
                }
                if (i17 != 1 && i17 != 2) {
                    throw zzy("Unexpected value");
                }
                zzD();
                this.zze--;
                this.zza = 7;
                return 7;
            }
            i18 = 9;
            this.zza = i18;
            return i18;
        }
        iArr[i16] = 2;
        i12 = 0;
        iZzn3 = zzn(true);
        if (iZzn3 == 34) {
        }
        this.zza = i18;
        return i18;
    }

    public final zzwg zzt() {
        return this.zzc;
    }

    public String zzv() {
        int i10 = this.zzg + 1;
        int i11 = this.zze - this.zzh;
        String strZze = zze();
        StringBuilder sbQ = e.q(" at line ", i10, " column ");
        sbQ.append(i11 + 1);
        sbQ.append(" path ");
        sbQ.append(strZze);
        return sbQ.toString();
    }

    public final void zzw(zzwg zzwgVar) {
        Objects.requireNonNull(zzwgVar);
        this.zzc = zzwgVar;
    }

    public final boolean zzx() {
        return this.zzc == zzwg.LENIENT;
    }
}
