package g.e.b.i0;

import g.e.b.g0.u;
import io.netty.util.internal.StringUtil;
import java.io.Closeable;
import java.io.IOException;
import java.io.Reader;
import java.util.Arrays;
import java.util.Objects;
import kotlinx.serialization.json.internal.AbstractJsonLexerKt;

/* JADX INFO: loaded from: classes.dex */
public class a implements Closeable {

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

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public boolean f4169m = false;

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

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public String f4178v;

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

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

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

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

    /* JADX INFO: renamed from: g.e.b.i0.a$a, reason: collision with other inner class name */
    public class C0064a extends u {
    }

    static {
        u.a = new C0064a();
    }

    public a(Reader reader) {
        int[] iArr = new int[32];
        this.f4179w = iArr;
        this.f4180x = 0;
        this.f4180x = 0 + 1;
        iArr[0] = 6;
        this.f4181y = new String[32];
        this.f4182z = new int[32];
        Objects.requireNonNull(reader, "in == null");
        this.f4168f = reader;
    }

    public int A() throws IOException {
        String strF;
        int iE = this.f4175s;
        if (iE == 0) {
            iE = e();
        }
        if (iE == 15) {
            long j2 = this.f4176t;
            int i2 = (int) j2;
            if (j2 != i2) {
                StringBuilder sbF = g.a.a.a.a.F("Expected an int but was ");
                sbF.append(this.f4176t);
                sbF.append(u());
                throw new NumberFormatException(sbF.toString());
            }
            this.f4175s = 0;
            int[] iArr = this.f4182z;
            int i3 = this.f4180x - 1;
            iArr[i3] = iArr[i3] + 1;
            return i2;
        }
        if (iE == 16) {
            this.f4178v = new String(this.f4170n, this.f4171o, this.f4177u);
            this.f4171o += this.f4177u;
        } else {
            if (iE != 8 && iE != 9 && iE != 10) {
                StringBuilder sbF2 = g.a.a.a.a.F("Expected an int but was ");
                sbF2.append(I());
                sbF2.append(u());
                throw new IllegalStateException(sbF2.toString());
            }
            if (iE == 10) {
                strF = H();
            } else {
                strF = F(iE == 8 ? '\'' : '\"');
            }
            this.f4178v = strF;
            try {
                int i4 = Integer.parseInt(this.f4178v);
                this.f4175s = 0;
                int[] iArr2 = this.f4182z;
                int i5 = this.f4180x - 1;
                iArr2[i5] = iArr2[i5] + 1;
                return i4;
            } catch (NumberFormatException unused) {
            }
        }
        this.f4175s = 11;
        double d2 = Double.parseDouble(this.f4178v);
        int i6 = (int) d2;
        if (i6 != d2) {
            StringBuilder sbF3 = g.a.a.a.a.F("Expected an int but was ");
            sbF3.append(this.f4178v);
            sbF3.append(u());
            throw new NumberFormatException(sbF3.toString());
        }
        this.f4178v = null;
        this.f4175s = 0;
        int[] iArr3 = this.f4182z;
        int i7 = this.f4180x - 1;
        iArr3[i7] = iArr3[i7] + 1;
        return i6;
    }

    public long B() throws IOException {
        String strF;
        int iE = this.f4175s;
        if (iE == 0) {
            iE = e();
        }
        if (iE == 15) {
            this.f4175s = 0;
            int[] iArr = this.f4182z;
            int i2 = this.f4180x - 1;
            iArr[i2] = iArr[i2] + 1;
            return this.f4176t;
        }
        if (iE == 16) {
            this.f4178v = new String(this.f4170n, this.f4171o, this.f4177u);
            this.f4171o += this.f4177u;
        } else {
            if (iE != 8 && iE != 9 && iE != 10) {
                StringBuilder sbF = g.a.a.a.a.F("Expected a long but was ");
                sbF.append(I());
                sbF.append(u());
                throw new IllegalStateException(sbF.toString());
            }
            if (iE == 10) {
                strF = H();
            } else {
                strF = F(iE == 8 ? '\'' : '\"');
            }
            this.f4178v = strF;
            try {
                long j2 = Long.parseLong(this.f4178v);
                this.f4175s = 0;
                int[] iArr2 = this.f4182z;
                int i3 = this.f4180x - 1;
                iArr2[i3] = iArr2[i3] + 1;
                return j2;
            } catch (NumberFormatException unused) {
            }
        }
        this.f4175s = 11;
        double d2 = Double.parseDouble(this.f4178v);
        long j3 = (long) d2;
        if (j3 != d2) {
            StringBuilder sbF2 = g.a.a.a.a.F("Expected a long but was ");
            sbF2.append(this.f4178v);
            sbF2.append(u());
            throw new NumberFormatException(sbF2.toString());
        }
        this.f4178v = null;
        this.f4175s = 0;
        int[] iArr3 = this.f4182z;
        int i4 = this.f4180x - 1;
        iArr3[i4] = iArr3[i4] + 1;
        return j3;
    }

    public String C() throws IOException {
        char c2;
        String strF;
        int iE = this.f4175s;
        if (iE == 0) {
            iE = e();
        }
        if (iE == 14) {
            strF = H();
        } else {
            if (iE == 12) {
                c2 = '\'';
            } else {
                if (iE != 13) {
                    StringBuilder sbF = g.a.a.a.a.F("Expected a name but was ");
                    sbF.append(I());
                    sbF.append(u());
                    throw new IllegalStateException(sbF.toString());
                }
                c2 = '\"';
            }
            strF = F(c2);
        }
        this.f4175s = 0;
        this.f4181y[this.f4180x - 1] = strF;
        return strF;
    }

    /* JADX WARN: Code restructure failed: missing block: B:26:0x0051, code lost:
    
        if (r1 != '/') goto L69;
     */
    /* JADX WARN: Code restructure failed: missing block: B:27:0x0053, code lost:
    
        r9.f4171o = r4;
     */
    /* JADX WARN: Code restructure failed: missing block: B:28:0x0056, code lost:
    
        if (r4 != r2) goto L32;
     */
    /* JADX WARN: Code restructure failed: missing block: B:29:0x0058, code lost:
    
        r9.f4171o = r4 - 1;
        r2 = j(2);
        r9.f4171o++;
     */
    /* JADX WARN: Code restructure failed: missing block: B:30:0x0065, code lost:
    
        if (r2 != false) goto L32;
     */
    /* JADX WARN: Code restructure failed: missing block: B:31:0x0067, code lost:
    
        return r1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:32:0x0068, code lost:
    
        d();
        r2 = r9.f4171o;
        r4 = r0[r2];
     */
    /* JADX WARN: Code restructure failed: missing block: B:33:0x0071, code lost:
    
        if (r4 == '*') goto L37;
     */
    /* JADX WARN: Code restructure failed: missing block: B:34:0x0073, code lost:
    
        if (r4 == '/') goto L36;
     */
    /* JADX WARN: Code restructure failed: missing block: B:35:0x0075, code lost:
    
        return r1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:36:0x0076, code lost:
    
        r9.f4171o = r2 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:37:0x007b, code lost:
    
        r9.f4171o = r2 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:38:0x007f, code lost:
    
        r4 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:39:0x0085, code lost:
    
        if ((r9.f4171o + 2) <= r9.f4172p) goto L44;
     */
    /* JADX WARN: Code restructure failed: missing block: B:41:0x008b, code lost:
    
        if (j(2) == false) goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:43:0x008e, code lost:
    
        r3 = false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:44:0x0090, code lost:
    
        r1 = r9.f4170n;
        r2 = r9.f4171o;
     */
    /* JADX WARN: Code restructure failed: missing block: B:45:0x0096, code lost:
    
        if (r1[r2] != '\n') goto L47;
     */
    /* JADX WARN: Code restructure failed: missing block: B:46:0x0098, code lost:
    
        r9.f4173q++;
        r9.f4174r = r2 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:47:0x00a2, code lost:
    
        if (r4 >= 2) goto L77;
     */
    /* JADX WARN: Code restructure failed: missing block: B:49:0x00b1, code lost:
    
        if (r9.f4170n[r9.f4171o + r4] == "*\/".charAt(r4)) goto L51;
     */
    /* JADX WARN: Code restructure failed: missing block: B:50:0x00b3, code lost:
    
        r9.f4171o++;
     */
    /* JADX WARN: Code restructure failed: missing block: B:51:0x00b9, code lost:
    
        r4 = r4 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:52:0x00bc, code lost:
    
        if (r3 == false) goto L65;
     */
    /* JADX WARN: Code restructure failed: missing block: B:54:0x00c3, code lost:
    
        O("Unterminated comment");
     */
    /* JADX WARN: Code restructure failed: missing block: B:55:0x00c9, code lost:
    
        throw null;
     */
    /* JADX WARN: Code restructure failed: missing block: B:56:0x00ca, code lost:
    
        r9.f4171o = r4;
     */
    /* JADX WARN: Code restructure failed: missing block: B:57:0x00ce, code lost:
    
        if (r1 != '#') goto L66;
     */
    /* JADX WARN: Code restructure failed: missing block: B:58:0x00d0, code lost:
    
        d();
     */
    /* JADX WARN: Code restructure failed: missing block: B:60:0x00d8, code lost:
    
        return r1;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final int D(boolean r10) throws java.io.IOException {
        /*
            Method dump skipped, instruction units count: 220
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: g.e.b.i0.a.D(boolean):int");
    }

    public void E() throws IOException {
        int iE = this.f4175s;
        if (iE == 0) {
            iE = e();
        }
        if (iE != 7) {
            StringBuilder sbF = g.a.a.a.a.F("Expected null but was ");
            sbF.append(I());
            sbF.append(u());
            throw new IllegalStateException(sbF.toString());
        }
        this.f4175s = 0;
        int[] iArr = this.f4182z;
        int i2 = this.f4180x - 1;
        iArr[i2] = iArr[i2] + 1;
    }

    public final String F(char c2) throws d {
        char[] cArr = this.f4170n;
        StringBuilder sb = null;
        while (true) {
            int i2 = this.f4171o;
            int i3 = this.f4172p;
            while (true) {
                if (i2 < i3) {
                    int i4 = i2 + 1;
                    char c3 = cArr[i2];
                    if (c3 == c2) {
                        this.f4171o = i4;
                        int i5 = (i4 - i2) - 1;
                        if (sb == null) {
                            return new String(cArr, i2, i5);
                        }
                        sb.append(cArr, i2, i5);
                        return sb.toString();
                    }
                    if (c3 == '\\') {
                        this.f4171o = i4;
                        int i6 = (i4 - i2) - 1;
                        if (sb == null) {
                            sb = new StringBuilder(Math.max((i6 + 1) * 2, 16));
                        }
                        sb.append(cArr, i2, i6);
                        sb.append(K());
                    } else {
                        if (c3 == '\n') {
                            this.f4173q++;
                            this.f4174r = i4;
                        }
                        i2 = i4;
                    }
                } else {
                    if (sb == null) {
                        sb = new StringBuilder(Math.max((i2 - i2) * 2, 16));
                    }
                    sb.append(cArr, i2, i2 - i2);
                    this.f4171o = i2;
                    if (!j(1)) {
                        O("Unterminated string");
                        throw null;
                    }
                }
            }
        }
    }

    public String G() throws IOException {
        String str;
        char c2;
        int iE = this.f4175s;
        if (iE == 0) {
            iE = e();
        }
        if (iE == 10) {
            str = H();
        } else {
            if (iE == 8) {
                c2 = '\'';
            } else if (iE == 9) {
                c2 = '\"';
            } else if (iE == 11) {
                str = this.f4178v;
                this.f4178v = null;
            } else if (iE == 15) {
                str = Long.toString(this.f4176t);
            } else {
                if (iE != 16) {
                    StringBuilder sbF = g.a.a.a.a.F("Expected a string but was ");
                    sbF.append(I());
                    sbF.append(u());
                    throw new IllegalStateException(sbF.toString());
                }
                str = new String(this.f4170n, this.f4171o, this.f4177u);
                this.f4171o += this.f4177u;
            }
            str = F(c2);
        }
        this.f4175s = 0;
        int[] iArr = this.f4182z;
        int i2 = this.f4180x - 1;
        iArr[i2] = iArr[i2] + 1;
        return str;
    }

    /* JADX WARN: Code restructure failed: missing block: B:34:0x004a, code lost:
    
        d();
     */
    /* JADX WARN: Failed to find 'out' block for switch in B:32:0x0044. Please report as an issue. */
    /* JADX WARN: Removed duplicated region for block: B:46:0x0080  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x008a  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.String H() throws g.e.b.i0.d {
        /*
            r6 = this;
            r0 = 0
            r1 = 0
        L2:
            r2 = r0
        L3:
            int r3 = r6.f4171o
            int r4 = r3 + r2
            int r5 = r6.f4172p
            if (r4 >= r5) goto L4e
            char[] r4 = r6.f4170n
            int r3 = r3 + r2
            char r3 = r4[r3]
            r4 = 9
            if (r3 == r4) goto L5c
            r4 = 10
            if (r3 == r4) goto L5c
            r4 = 12
            if (r3 == r4) goto L5c
            r4 = 13
            if (r3 == r4) goto L5c
            r4 = 32
            if (r3 == r4) goto L5c
            r4 = 35
            if (r3 == r4) goto L4a
            r4 = 44
            if (r3 == r4) goto L5c
            r4 = 47
            if (r3 == r4) goto L4a
            r4 = 61
            if (r3 == r4) goto L4a
            r4 = 123(0x7b, float:1.72E-43)
            if (r3 == r4) goto L5c
            r4 = 125(0x7d, float:1.75E-43)
            if (r3 == r4) goto L5c
            r4 = 58
            if (r3 == r4) goto L5c
            r4 = 59
            if (r3 == r4) goto L4a
            switch(r3) {
                case 91: goto L5c;
                case 92: goto L4a;
                case 93: goto L5c;
                default: goto L47;
            }
        L47:
            int r2 = r2 + 1
            goto L3
        L4a:
            r6.d()
            goto L5c
        L4e:
            char[] r3 = r6.f4170n
            int r3 = r3.length
            if (r2 >= r3) goto L5e
            int r3 = r2 + 1
            boolean r3 = r6.j(r3)
            if (r3 == 0) goto L5c
            goto L3
        L5c:
            r0 = r2
            goto L7e
        L5e:
            if (r1 != 0) goto L6b
            java.lang.StringBuilder r1 = new java.lang.StringBuilder
            r3 = 16
            int r3 = java.lang.Math.max(r2, r3)
            r1.<init>(r3)
        L6b:
            char[] r3 = r6.f4170n
            int r4 = r6.f4171o
            r1.append(r3, r4, r2)
            int r3 = r6.f4171o
            int r3 = r3 + r2
            r6.f4171o = r3
            r2 = 1
            boolean r2 = r6.j(r2)
            if (r2 != 0) goto L2
        L7e:
            if (r1 != 0) goto L8a
            java.lang.String r1 = new java.lang.String
            char[] r2 = r6.f4170n
            int r3 = r6.f4171o
            r1.<init>(r2, r3, r0)
            goto L95
        L8a:
            char[] r2 = r6.f4170n
            int r3 = r6.f4171o
            r1.append(r2, r3, r0)
            java.lang.String r1 = r1.toString()
        L95:
            int r2 = r6.f4171o
            int r2 = r2 + r0
            r6.f4171o = r2
            return r1
        */
        throw new UnsupportedOperationException("Method not decompiled: g.e.b.i0.a.H():java.lang.String");
    }

    public b I() {
        int iE = this.f4175s;
        if (iE == 0) {
            iE = e();
        }
        switch (iE) {
            case 1:
                return b.BEGIN_OBJECT;
            case 2:
                return b.END_OBJECT;
            case 3:
                return b.BEGIN_ARRAY;
            case 4:
                return b.END_ARRAY;
            case 5:
            case 6:
                return b.BOOLEAN;
            case 7:
                return b.NULL;
            case 8:
            case 9:
            case 10:
            case 11:
                return b.STRING;
            case 12:
            case 13:
            case 14:
                return b.NAME;
            case 15:
            case 16:
                return b.NUMBER;
            case 17:
                return b.END_DOCUMENT;
            default:
                throw new AssertionError();
        }
    }

    public final void J(int i2) {
        int i3 = this.f4180x;
        int[] iArr = this.f4179w;
        if (i3 == iArr.length) {
            int i4 = i3 * 2;
            this.f4179w = Arrays.copyOf(iArr, i4);
            this.f4182z = Arrays.copyOf(this.f4182z, i4);
            this.f4181y = (String[]) Arrays.copyOf(this.f4181y, i4);
        }
        int[] iArr2 = this.f4179w;
        int i5 = this.f4180x;
        this.f4180x = i5 + 1;
        iArr2[i5] = i2;
    }

    public final char K() throws d {
        int i2;
        int i3;
        if (this.f4171o == this.f4172p && !j(1)) {
            O("Unterminated escape sequence");
            throw null;
        }
        char[] cArr = this.f4170n;
        int i4 = this.f4171o;
        int i5 = i4 + 1;
        this.f4171o = i5;
        char c2 = cArr[i4];
        if (c2 == '\n') {
            this.f4173q++;
            this.f4174r = i5;
        } else if (c2 != '\"' && c2 != '\'' && c2 != '/' && c2 != '\\') {
            if (c2 == 'b') {
                return '\b';
            }
            if (c2 == 'f') {
                return '\f';
            }
            if (c2 == 'n') {
                return '\n';
            }
            if (c2 == 'r') {
                return StringUtil.CARRIAGE_RETURN;
            }
            if (c2 == 't') {
                return '\t';
            }
            if (c2 != 'u') {
                O("Invalid escape sequence");
                throw null;
            }
            if (i5 + 4 > this.f4172p && !j(4)) {
                O("Unterminated escape sequence");
                throw null;
            }
            char c3 = 0;
            int i6 = this.f4171o;
            int i7 = i6 + 4;
            while (i6 < i7) {
                char c4 = this.f4170n[i6];
                char c5 = (char) (c3 << 4);
                if (c4 < '0' || c4 > '9') {
                    if (c4 >= 'a' && c4 <= 'f') {
                        i2 = c4 - 'a';
                    } else {
                        if (c4 < 'A' || c4 > 'F') {
                            StringBuilder sbF = g.a.a.a.a.F("\\u");
                            sbF.append(new String(this.f4170n, this.f4171o, 4));
                            throw new NumberFormatException(sbF.toString());
                        }
                        i2 = c4 - 'A';
                    }
                    i3 = i2 + 10;
                } else {
                    i3 = c4 - '0';
                }
                c3 = (char) (i3 + c5);
                i6++;
            }
            this.f4171o += 4;
            return c3;
        }
        return c2;
    }

    public final void L(char c2) throws d {
        char[] cArr = this.f4170n;
        while (true) {
            int i2 = this.f4171o;
            int i3 = this.f4172p;
            while (true) {
                if (i2 < i3) {
                    int i4 = i2 + 1;
                    char c3 = cArr[i2];
                    if (c3 == c2) {
                        this.f4171o = i4;
                        return;
                    }
                    if (c3 == '\\') {
                        this.f4171o = i4;
                        K();
                        break;
                    } else {
                        if (c3 == '\n') {
                            this.f4173q++;
                            this.f4174r = i4;
                        }
                        i2 = i4;
                    }
                } else {
                    this.f4171o = i2;
                    if (!j(1)) {
                        O("Unterminated string");
                        throw null;
                    }
                }
            }
        }
    }

    public final void M() {
        char c2;
        do {
            if (this.f4171o >= this.f4172p && !j(1)) {
                return;
            }
            char[] cArr = this.f4170n;
            int i2 = this.f4171o;
            int i3 = i2 + 1;
            this.f4171o = i3;
            c2 = cArr[i2];
            if (c2 == '\n') {
                this.f4173q++;
                this.f4174r = i3;
                return;
            }
        } while (c2 != '\r');
    }

    /* JADX WARN: Code restructure failed: missing block: B:63:0x0099, code lost:
    
        d();
     */
    /* JADX WARN: Failed to find 'out' block for switch in B:61:0x0093. Please report as an issue. */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void N() throws java.io.IOException {
        /*
            Method dump skipped, instruction units count: 204
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: g.e.b.i0.a.N():void");
    }

    public final IOException O(String str) throws d {
        StringBuilder sbF = g.a.a.a.a.F(str);
        sbF.append(u());
        throw new d(sbF.toString());
    }

    public void a() throws IOException {
        int iE = this.f4175s;
        if (iE == 0) {
            iE = e();
        }
        if (iE == 3) {
            J(1);
            this.f4182z[this.f4180x - 1] = 0;
            this.f4175s = 0;
        } else {
            StringBuilder sbF = g.a.a.a.a.F("Expected BEGIN_ARRAY but was ");
            sbF.append(I());
            sbF.append(u());
            throw new IllegalStateException(sbF.toString());
        }
    }

    public void c() throws IOException {
        int iE = this.f4175s;
        if (iE == 0) {
            iE = e();
        }
        if (iE == 1) {
            J(3);
            this.f4175s = 0;
        } else {
            StringBuilder sbF = g.a.a.a.a.F("Expected BEGIN_OBJECT but was ");
            sbF.append(I());
            sbF.append(u());
            throw new IllegalStateException(sbF.toString());
        }
    }

    @Override // java.io.Closeable, java.lang.AutoCloseable
    public void close() throws IOException {
        this.f4175s = 0;
        this.f4179w[0] = 8;
        this.f4180x = 1;
        this.f4168f.close();
    }

    public final void d() throws d {
        if (this.f4169m) {
            return;
        }
        O("Use JsonReader.setLenient(true) to accept malformed JSON");
        throw null;
    }

    /* JADX WARN: Code restructure failed: missing block: B:167:0x0213, code lost:
    
        if (s(r1) != false) goto L120;
     */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:114:0x0180 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:115:0x0181  */
    /* JADX WARN: Removed duplicated region for block: B:127:0x01b2  */
    /* JADX WARN: Removed duplicated region for block: B:202:0x0262  */
    /* JADX WARN: Removed duplicated region for block: B:208:0x0270 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:209:0x0271  */
    /* JADX WARN: Removed duplicated region for block: B:231:0x02b6  */
    /* JADX WARN: Removed duplicated region for block: B:67:0x00e7  */
    /* JADX WARN: Type inference failed for: r1v1 */
    /* JADX WARN: Type inference failed for: r1v11 */
    /* JADX WARN: Type inference failed for: r1v2, types: [boolean, int] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public int e() throws java.io.IOException {
        /*
            Method dump skipped, instruction units count: 797
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: g.e.b.i0.a.e():int");
    }

    public void g() throws IOException {
        int iE = this.f4175s;
        if (iE == 0) {
            iE = e();
        }
        if (iE != 4) {
            StringBuilder sbF = g.a.a.a.a.F("Expected END_ARRAY but was ");
            sbF.append(I());
            sbF.append(u());
            throw new IllegalStateException(sbF.toString());
        }
        int i2 = this.f4180x - 1;
        this.f4180x = i2;
        int[] iArr = this.f4182z;
        int i3 = i2 - 1;
        iArr[i3] = iArr[i3] + 1;
        this.f4175s = 0;
    }

    public void h() throws IOException {
        int iE = this.f4175s;
        if (iE == 0) {
            iE = e();
        }
        if (iE != 2) {
            StringBuilder sbF = g.a.a.a.a.F("Expected END_OBJECT but was ");
            sbF.append(I());
            sbF.append(u());
            throw new IllegalStateException(sbF.toString());
        }
        int i2 = this.f4180x - 1;
        this.f4180x = i2;
        this.f4181y[i2] = null;
        int[] iArr = this.f4182z;
        int i3 = i2 - 1;
        iArr[i3] = iArr[i3] + 1;
        this.f4175s = 0;
    }

    public final boolean j(int i2) throws IOException {
        int i3;
        int i4;
        char[] cArr = this.f4170n;
        int i5 = this.f4174r;
        int i6 = this.f4171o;
        this.f4174r = i5 - i6;
        int i7 = this.f4172p;
        if (i7 != i6) {
            int i8 = i7 - i6;
            this.f4172p = i8;
            System.arraycopy(cArr, i6, cArr, 0, i8);
        } else {
            this.f4172p = 0;
        }
        this.f4171o = 0;
        do {
            Reader reader = this.f4168f;
            int i9 = this.f4172p;
            int i10 = reader.read(cArr, i9, cArr.length - i9);
            if (i10 == -1) {
                return false;
            }
            i3 = this.f4172p + i10;
            this.f4172p = i3;
            if (this.f4173q == 0 && (i4 = this.f4174r) == 0 && i3 > 0 && cArr[0] == 65279) {
                this.f4171o++;
                this.f4174r = i4 + 1;
                i2++;
            }
        } while (i3 < i2);
        return true;
    }

    public String l() {
        return m(false);
    }

    public final String m(boolean z2) {
        StringBuilder sbE = g.a.a.a.a.E('$');
        int i2 = 0;
        while (true) {
            int i3 = this.f4180x;
            if (i2 >= i3) {
                return sbE.toString();
            }
            int i4 = this.f4179w[i2];
            if (i4 == 1 || i4 == 2) {
                int i5 = this.f4182z[i2];
                if (z2 && i5 > 0 && i2 == i3 - 1) {
                    i5--;
                }
                sbE.append(AbstractJsonLexerKt.BEGIN_LIST);
                sbE.append(i5);
                sbE.append(AbstractJsonLexerKt.END_LIST);
            } else if (i4 == 3 || i4 == 4 || i4 == 5) {
                sbE.append('.');
                String[] strArr = this.f4181y;
                if (strArr[i2] != null) {
                    sbE.append(strArr[i2]);
                }
            }
            i2++;
        }
    }

    public String o() {
        return m(true);
    }

    public boolean q() throws IOException {
        int iE = this.f4175s;
        if (iE == 0) {
            iE = e();
        }
        return (iE == 2 || iE == 4 || iE == 17) ? false : true;
    }

    public final boolean s(char c2) throws d {
        if (c2 == '\t' || c2 == '\n' || c2 == '\f' || c2 == '\r' || c2 == ' ') {
            return false;
        }
        if (c2 != '#') {
            if (c2 == ',') {
                return false;
            }
            if (c2 != '/' && c2 != '=') {
                if (c2 == '{' || c2 == '}' || c2 == ':') {
                    return false;
                }
                if (c2 != ';') {
                    switch (c2) {
                        case '[':
                        case ']':
                            return false;
                        case '\\':
                            break;
                        default:
                            return true;
                    }
                }
            }
        }
        d();
        return false;
    }

    public String toString() {
        return getClass().getSimpleName() + u();
    }

    public String u() {
        StringBuilder sbI = g.a.a.a.a.I(" at line ", this.f4173q + 1, " column ", (this.f4171o - this.f4174r) + 1, " path ");
        sbI.append(l());
        return sbI.toString();
    }

    public boolean x() throws IOException {
        int iE = this.f4175s;
        if (iE == 0) {
            iE = e();
        }
        if (iE == 5) {
            this.f4175s = 0;
            int[] iArr = this.f4182z;
            int i2 = this.f4180x - 1;
            iArr[i2] = iArr[i2] + 1;
            return true;
        }
        if (iE != 6) {
            StringBuilder sbF = g.a.a.a.a.F("Expected a boolean but was ");
            sbF.append(I());
            sbF.append(u());
            throw new IllegalStateException(sbF.toString());
        }
        this.f4175s = 0;
        int[] iArr2 = this.f4182z;
        int i3 = this.f4180x - 1;
        iArr2[i3] = iArr2[i3] + 1;
        return false;
    }

    public double z() throws IOException {
        String strF;
        int iE = this.f4175s;
        if (iE == 0) {
            iE = e();
        }
        if (iE == 15) {
            this.f4175s = 0;
            int[] iArr = this.f4182z;
            int i2 = this.f4180x - 1;
            iArr[i2] = iArr[i2] + 1;
            return this.f4176t;
        }
        if (iE == 16) {
            this.f4178v = new String(this.f4170n, this.f4171o, this.f4177u);
            this.f4171o += this.f4177u;
        } else {
            if (iE == 8 || iE == 9) {
                strF = F(iE == 8 ? '\'' : '\"');
            } else if (iE == 10) {
                strF = H();
            } else if (iE != 11) {
                StringBuilder sbF = g.a.a.a.a.F("Expected a double but was ");
                sbF.append(I());
                sbF.append(u());
                throw new IllegalStateException(sbF.toString());
            }
            this.f4178v = strF;
        }
        this.f4175s = 11;
        double d2 = Double.parseDouble(this.f4178v);
        if (!this.f4169m && (Double.isNaN(d2) || Double.isInfinite(d2))) {
            throw new d("JSON forbids NaN and infinities: " + d2 + u());
        }
        this.f4178v = null;
        this.f4175s = 0;
        int[] iArr2 = this.f4182z;
        int i3 = this.f4180x - 1;
        iArr2[i3] = iArr2[i3] + 1;
        return d2;
    }
}
