package o6;

import d3.E;
import d5.AbstractC0844a;
import e0.C0853a;
import java.io.EOFException;
import java.io.IOException;
import x7.C1731g;
import x7.C1734j;
import x7.InterfaceC1733i;

/* JADX INFO: renamed from: o6.o, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1395o extends AbstractC1394n {

    /* JADX INFO: renamed from: A, reason: collision with root package name */
    public static final C1734j f15877A;

    /* JADX INFO: renamed from: B, reason: collision with root package name */
    public static final C1734j f15878B;

    /* JADX INFO: renamed from: C, reason: collision with root package name */
    public static final C1734j f15879C;
    public static final C1734j D;

    /* JADX INFO: renamed from: E, reason: collision with root package name */
    public static final C1734j f15880E;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public final InterfaceC1733i f15881u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public final C1731g f15882v;

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

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

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

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

    static {
        C1734j c1734j = C1734j.f18766t;
        f15877A = E.h("'\\");
        f15878B = E.h("\"\\");
        f15879C = E.h("{}[]:, \n\t\r\f/\\;#=");
        D = E.h("\n\r");
        f15880E = E.h("*/");
    }

    public C1395o(InterfaceC1733i interfaceC1733i) {
        this.f15874r = new int[32];
        this.f15875s = new String[32];
        this.f15876t = new int[32];
        this.f15883w = 0;
        this.f15881u = interfaceC1733i;
        this.f15882v = interfaceC1733i.d();
        O(6);
    }

    @Override // o6.AbstractC1394n
    public final void A() {
        int iL0 = this.f15883w;
        if (iL0 == 0) {
            iL0 = l0();
        }
        if (iL0 == 7) {
            this.f15883w = 0;
            int[] iArr = this.f15876t;
            int i = this.f15873q - 1;
            iArr[i] = iArr[i] + 1;
            return;
        }
        throw new A6.b("Expected null but was " + AbstractC0844a.B(K()) + " at path " + m());
    }

    @Override // o6.AbstractC1394n
    public final String H() throws F0.t, EOFException {
        String strN0;
        int iL0 = this.f15883w;
        if (iL0 == 0) {
            iL0 = l0();
        }
        if (iL0 == 10) {
            strN0 = s0();
        } else if (iL0 == 9) {
            strN0 = r0(f15878B);
        } else if (iL0 == 8) {
            strN0 = r0(f15877A);
        } else if (iL0 == 11) {
            strN0 = this.f15886z;
            this.f15886z = null;
        } else if (iL0 == 16) {
            strN0 = Long.toString(this.f15884x);
        } else {
            if (iL0 != 17) {
                throw new A6.b("Expected a string but was " + AbstractC0844a.B(K()) + " at path " + m());
            }
            long j8 = this.f15885y;
            C1731g c1731g = this.f15882v;
            c1731g.getClass();
            strN0 = c1731g.n0(j8, X6.a.f7235a);
        }
        this.f15883w = 0;
        int[] iArr = this.f15876t;
        int i = this.f15873q - 1;
        iArr[i] = iArr[i] + 1;
        return strN0;
    }

    @Override // o6.AbstractC1394n
    public final int K() {
        int iL0 = this.f15883w;
        if (iL0 == 0) {
            iL0 = l0();
        }
        switch (iL0) {
            case 1:
                return 3;
            case 2:
                return 4;
            case 3:
                return 1;
            case 4:
                return 2;
            case 5:
            case Z.g.STRING_SET_FIELD_NUMBER /* 6 */:
                return 8;
            case Z.g.DOUBLE_FIELD_NUMBER /* 7 */:
                return 9;
            case Z.g.BYTES_FIELD_NUMBER /* 8 */:
            case 9:
            case 10:
            case 11:
                return 6;
            case 12:
            case 13:
            case 14:
            case 15:
                return 5;
            case 16:
            case 17:
                return 7;
            case 18:
                return 10;
            default:
                throw new AssertionError();
        }
    }

    @Override // o6.AbstractC1394n
    public final int Q(C0853a c0853a) throws F0.t, EOFException {
        int iL0 = this.f15883w;
        if (iL0 == 0) {
            iL0 = l0();
        }
        if (iL0 < 12 || iL0 > 15) {
            return -1;
        }
        if (iL0 == 15) {
            return m0(this.f15886z, c0853a);
        }
        int iT = this.f15881u.t((x7.w) c0853a.f12398s);
        if (iT != -1) {
            this.f15883w = 0;
            this.f15875s[this.f15873q - 1] = ((String[]) c0853a.f12397r)[iT];
            return iT;
        }
        String str = this.f15875s[this.f15873q - 1];
        String strP0 = p0();
        int iM0 = m0(strP0, c0853a);
        if (iM0 == -1) {
            this.f15883w = 15;
            this.f15886z = strP0;
            this.f15875s[this.f15873q - 1] = str;
        }
        return iM0;
    }

    @Override // o6.AbstractC1394n
    public final void V() throws F0.t, EOFException {
        int iL0 = this.f15883w;
        if (iL0 == 0) {
            iL0 = l0();
        }
        if (iL0 == 14) {
            long jI = this.f15881u.i(f15879C);
            C1731g c1731g = this.f15882v;
            if (jI == -1) {
                jI = c1731g.f18765r;
            }
            c1731g.y(jI);
        } else if (iL0 == 13) {
            u0(f15878B);
        } else if (iL0 == 12) {
            u0(f15877A);
        } else if (iL0 != 15) {
            throw new A6.b("Expected a name but was " + AbstractC0844a.B(K()) + " at path " + m());
        }
        this.f15883w = 0;
        this.f15875s[this.f15873q - 1] = "null";
    }

    @Override // o6.AbstractC1394n
    public final void a() {
        int iL0 = this.f15883w;
        if (iL0 == 0) {
            iL0 = l0();
        }
        if (iL0 == 3) {
            O(1);
            this.f15876t[this.f15873q - 1] = 0;
            this.f15883w = 0;
        } else {
            throw new A6.b("Expected BEGIN_ARRAY but was " + AbstractC0844a.B(K()) + " at path " + m());
        }
    }

    @Override // o6.AbstractC1394n
    public final void b() {
        int iL0 = this.f15883w;
        if (iL0 == 0) {
            iL0 = l0();
        }
        if (iL0 == 1) {
            O(3);
            this.f15883w = 0;
        } else {
            throw new A6.b("Expected BEGIN_OBJECT but was " + AbstractC0844a.B(K()) + " at path " + m());
        }
    }

    @Override // java.io.Closeable, java.lang.AutoCloseable
    public final void close() throws IOException {
        this.f15883w = 0;
        this.f15874r[0] = 8;
        this.f15873q = 1;
        this.f15882v.m();
        this.f15881u.close();
    }

    @Override // o6.AbstractC1394n
    public final void f0() throws F0.t, EOFException {
        int i = 0;
        do {
            int iL0 = this.f15883w;
            if (iL0 == 0) {
                iL0 = l0();
            }
            if (iL0 == 3) {
                O(1);
            } else if (iL0 == 1) {
                O(3);
            } else {
                if (iL0 == 4) {
                    i--;
                    if (i < 0) {
                        throw new A6.b("Expected a value but was " + AbstractC0844a.B(K()) + " at path " + m());
                    }
                    this.f15873q--;
                } else if (iL0 == 2) {
                    i--;
                    if (i < 0) {
                        throw new A6.b("Expected a value but was " + AbstractC0844a.B(K()) + " at path " + m());
                    }
                    this.f15873q--;
                } else {
                    C1731g c1731g = this.f15882v;
                    if (iL0 == 14 || iL0 == 10) {
                        long jI = this.f15881u.i(f15879C);
                        if (jI == -1) {
                            jI = c1731g.f18765r;
                        }
                        c1731g.y(jI);
                    } else if (iL0 == 9 || iL0 == 13) {
                        u0(f15878B);
                    } else if (iL0 == 8 || iL0 == 12) {
                        u0(f15877A);
                    } else if (iL0 == 17) {
                        c1731g.y(this.f15885y);
                    } else if (iL0 == 18) {
                        throw new A6.b("Expected a value but was " + AbstractC0844a.B(K()) + " at path " + m());
                    }
                }
                this.f15883w = 0;
            }
            i++;
            this.f15883w = 0;
        } while (i != 0);
        int[] iArr = this.f15876t;
        int i5 = this.f15873q - 1;
        iArr[i5] = iArr[i5] + 1;
        this.f15875s[i5] = "null";
    }

    @Override // o6.AbstractC1394n
    public final void g() {
        int iL0 = this.f15883w;
        if (iL0 == 0) {
            iL0 = l0();
        }
        if (iL0 != 4) {
            throw new A6.b("Expected END_ARRAY but was " + AbstractC0844a.B(K()) + " at path " + m());
        }
        int i = this.f15873q;
        this.f15873q = i - 1;
        int[] iArr = this.f15876t;
        int i5 = i - 2;
        iArr[i5] = iArr[i5] + 1;
        this.f15883w = 0;
    }

    @Override // o6.AbstractC1394n
    public final void j() {
        int iL0 = this.f15883w;
        if (iL0 == 0) {
            iL0 = l0();
        }
        if (iL0 != 2) {
            throw new A6.b("Expected END_OBJECT but was " + AbstractC0844a.B(K()) + " at path " + m());
        }
        int i = this.f15873q;
        int i5 = i - 1;
        this.f15873q = i5;
        this.f15875s[i5] = null;
        int[] iArr = this.f15876t;
        int i8 = i - 2;
        iArr[i8] = iArr[i8] + 1;
        this.f15883w = 0;
    }

    public final void k0() throws F0.t {
        j0("Use JsonReader.setLenient(true) to accept malformed JSON");
        throw null;
    }

    /* JADX WARN: Code restructure failed: missing block: B:139:0x01b5, code lost:
    
        if (o0(r8) != false) goto L120;
     */
    /* JADX WARN: Code restructure failed: missing block: B:141:0x01b8, code lost:
    
        if (r2 != 2) goto L155;
     */
    /* JADX WARN: Code restructure failed: missing block: B:142:0x01ba, code lost:
    
        if (r6 == 0) goto L147;
     */
    /* JADX WARN: Code restructure failed: missing block: B:144:0x01c0, code lost:
    
        if (r18 != Long.MIN_VALUE) goto L148;
     */
    /* JADX WARN: Code restructure failed: missing block: B:145:0x01c2, code lost:
    
        if (r7 == 0) goto L147;
     */
    /* JADX WARN: Code restructure failed: missing block: B:147:0x01c5, code lost:
    
        r3 = 2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:149:0x01c9, code lost:
    
        if (r18 != r16) goto L151;
     */
    /* JADX WARN: Code restructure failed: missing block: B:150:0x01cb, code lost:
    
        if (r7 != 0) goto L147;
     */
    /* JADX WARN: Code restructure failed: missing block: B:151:0x01cd, code lost:
    
        if (r7 == 0) goto L153;
     */
    /* JADX WARN: Code restructure failed: missing block: B:152:0x01cf, code lost:
    
        r9 = r18;
     */
    /* JADX WARN: Code restructure failed: missing block: B:153:0x01d2, code lost:
    
        r9 = -r18;
     */
    /* JADX WARN: Code restructure failed: missing block: B:154:0x01d5, code lost:
    
        r23.f15884x = r9;
        r12.y(r4);
        r11 = 16;
        r23.f15883w = 16;
     */
    /* JADX WARN: Code restructure failed: missing block: B:155:0x01e0, code lost:
    
        if (r2 == r3) goto L160;
     */
    /* JADX WARN: Code restructure failed: missing block: B:157:0x01e3, code lost:
    
        if (r2 == 4) goto L160;
     */
    /* JADX WARN: Code restructure failed: missing block: B:159:0x01e6, code lost:
    
        if (r2 != 7) goto L120;
     */
    /* JADX WARN: Code restructure failed: missing block: B:160:0x01e8, code lost:
    
        r23.f15885y = r4;
        r11 = 17;
        r23.f15883w = 17;
     */
    /* JADX WARN: Code restructure failed: missing block: B:97:0x0146, code lost:
    
        r3 = 2;
     */
    /* JADX WARN: Removed duplicated region for block: B:179:0x0216 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:180:0x0217  */
    /* JADX WARN: Removed duplicated region for block: B:205:0x0267  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x00a5  */
    /* JADX WARN: Removed duplicated region for block: B:93:0x0134 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:94:0x0135  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final int l0() {
        int i;
        int iQ0;
        int i5;
        int i8;
        String str;
        String str2;
        long j8;
        char cA;
        int i9;
        int i10;
        int[] iArr = this.f15874r;
        int i11 = 1;
        int i12 = this.f15873q - 1;
        int i13 = iArr[i12];
        InterfaceC1733i interfaceC1733i = this.f15881u;
        long j9 = 0;
        C1731g c1731g = this.f15882v;
        if (i13 == 1) {
            iArr[i12] = 2;
        } else if (i13 == 2) {
            int iQ02 = q0(true);
            c1731g.Q();
            if (iQ02 != 44) {
                if (iQ02 != 59) {
                    if (iQ02 == 93) {
                        this.f15883w = 4;
                        return 4;
                    }
                    j0("Unterminated array");
                    throw null;
                }
                k0();
            }
        } else {
            if (i13 == 3 || i13 == 5) {
                iArr[i12] = 4;
                if (i13 == 5) {
                    int iQ03 = q0(true);
                    c1731g.Q();
                    if (iQ03 != 44) {
                        if (iQ03 != 59) {
                            if (iQ03 == 125) {
                                this.f15883w = 2;
                                return 2;
                            }
                            j0("Unterminated object");
                            throw null;
                        }
                        k0();
                    }
                }
                int iQ04 = q0(true);
                if (iQ04 == 34) {
                    c1731g.Q();
                    this.f15883w = 13;
                    return 13;
                }
                if (iQ04 == 39) {
                    c1731g.Q();
                    k0();
                    this.f15883w = 12;
                    return 12;
                }
                if (iQ04 != 125) {
                    k0();
                    if (o0((char) iQ04)) {
                        this.f15883w = 14;
                        return 14;
                    }
                    j0("Expected name");
                    throw null;
                }
                if (i13 == 5) {
                    j0("Expected name");
                    throw null;
                }
                c1731g.Q();
                this.f15883w = 2;
                return 2;
            }
            if (i13 == 4) {
                iArr[i12] = 5;
                int iQ05 = q0(true);
                c1731g.Q();
                if (iQ05 != 58) {
                    if (iQ05 != 61) {
                        j0("Expected ':'");
                        throw null;
                    }
                    k0();
                    if (interfaceC1733i.C(1L) && c1731g.A(0L) == 62) {
                        c1731g.Q();
                    }
                }
            } else {
                if (i13 != 6) {
                    if (i13 == 7) {
                        i = 0;
                        if (q0(false) == -1) {
                            this.f15883w = 18;
                            return 18;
                        }
                        k0();
                    } else {
                        i = 0;
                        if (i13 == 9) {
                            throw null;
                        }
                        if (i13 == 8) {
                            throw new IllegalStateException("JsonReader is closed");
                        }
                    }
                    iQ0 = q0(true);
                    if (iQ0 != 34) {
                        c1731g.Q();
                        this.f15883w = 9;
                        return 9;
                    }
                    if (iQ0 == 39) {
                        k0();
                        c1731g.Q();
                        this.f15883w = 8;
                        return 8;
                    }
                    if (iQ0 == 44 || iQ0 == 59) {
                        i5 = 1;
                    } else {
                        if (iQ0 == 91) {
                            c1731g.Q();
                            this.f15883w = 3;
                            return 3;
                        }
                        if (iQ0 == 93) {
                            i5 = 1;
                            if (i13 == 1) {
                                c1731g.Q();
                                this.f15883w = 4;
                                return 4;
                            }
                        } else {
                            if (iQ0 == 123) {
                                c1731g.Q();
                                this.f15883w = 1;
                                return 1;
                            }
                            byte bA = c1731g.A(0L);
                            if (bA == 116 || bA == 84) {
                                i8 = 5;
                                str2 = "true";
                                str = "TRUE";
                            } else if (bA == 102 || bA == 70) {
                                i8 = 6;
                                str2 = "false";
                                str = "FALSE";
                            } else if (bA == 110 || bA == 78) {
                                i8 = 7;
                                str2 = "null";
                                str = "NULL";
                            } else {
                                i8 = i;
                                j8 = 0;
                                if (i8 == 0) {
                                    return i8;
                                }
                                int i14 = i;
                                int i15 = i14;
                                int i16 = i15;
                                int i17 = 1;
                                long j10 = j8;
                                while (true) {
                                    int i18 = i15 + 1;
                                    long j11 = j10;
                                    if (!interfaceC1733i.C(i18)) {
                                        break;
                                    }
                                    byte bA2 = c1731g.A(i15);
                                    if (bA2 != 43) {
                                        if (bA2 == 69 || bA2 == 101) {
                                            if (i14 != 2 && i14 != 4) {
                                                break;
                                            }
                                            i14 = 5;
                                            i15 = i18;
                                            j10 = j11;
                                            i11 = 1;
                                        } else if (bA2 == 45) {
                                            i10 = 6;
                                            if (i14 == 0) {
                                                i14 = 1;
                                                i16 = 1;
                                                i15 = i18;
                                                j10 = j11;
                                                i11 = 1;
                                            } else {
                                                if (i14 != 5) {
                                                    break;
                                                }
                                                i14 = i10;
                                                i15 = i18;
                                                j10 = j11;
                                                i11 = 1;
                                            }
                                        } else if (bA2 == 46) {
                                            if (i14 != 2) {
                                                break;
                                            }
                                            i14 = 3;
                                            i15 = i18;
                                            j10 = j11;
                                            i11 = 1;
                                        } else {
                                            if (bA2 < 48 || bA2 > 57) {
                                                break;
                                            }
                                            if (i14 == i11 || i14 == 0) {
                                                j11 = -(bA2 - 48);
                                                i14 = 2;
                                            } else if (i14 == 2) {
                                                if (j11 == j8) {
                                                    break;
                                                }
                                                long j12 = (10 * j11) - ((long) (bA2 - 48));
                                                i17 &= (j11 > -922337203685477580L || (j11 == -922337203685477580L && j12 < j11)) ? 1 : i;
                                                j11 = j12;
                                            } else if (i14 == 3) {
                                                i14 = 4;
                                            } else if (i14 == 5 || i14 == 6) {
                                                i14 = 7;
                                            }
                                            i15 = i18;
                                            j10 = j11;
                                            i11 = 1;
                                        }
                                        if (i9 == 0) {
                                            return i9;
                                        }
                                        if (!o0(c1731g.A(j8))) {
                                            j0("Expected value");
                                            throw null;
                                        }
                                        k0();
                                        this.f15883w = 10;
                                        return 10;
                                    }
                                    i10 = 6;
                                    if (i14 != 5) {
                                        break;
                                    }
                                    i14 = i10;
                                    i15 = i18;
                                    j10 = j11;
                                    i11 = 1;
                                }
                                i9 = i;
                                if (i9 == 0) {
                                }
                            }
                            int length = str2.length();
                            int i19 = 1;
                            while (true) {
                                if (i19 < length) {
                                    int i20 = i19 + 1;
                                    j8 = j9;
                                    if (!interfaceC1733i.C(i20) || ((cA = c1731g.A(i19)) != str2.charAt(i19) && cA != str.charAt(i19))) {
                                        break;
                                    }
                                    i19 = i20;
                                    j9 = j8;
                                } else {
                                    j8 = j9;
                                    if (!interfaceC1733i.C(length + 1) || !o0(c1731g.A(length))) {
                                        c1731g.y(length);
                                        this.f15883w = i8;
                                    }
                                }
                            }
                            i8 = i;
                            if (i8 == 0) {
                            }
                        }
                    }
                    if (i13 != i5 && i13 != 2) {
                        j0("Unexpected value");
                        throw null;
                    }
                    k0();
                    this.f15883w = 7;
                    return 7;
                }
                iArr[i12] = 7;
            }
        }
        i = 0;
        iQ0 = q0(true);
        if (iQ0 != 34) {
        }
    }

    public final int m0(String str, C0853a c0853a) {
        int length = ((String[]) c0853a.f12397r).length;
        for (int i = 0; i < length; i++) {
            if (str.equals(((String[]) c0853a.f12397r)[i])) {
                this.f15883w = 0;
                this.f15875s[this.f15873q - 1] = str;
                return i;
            }
        }
        return -1;
    }

    @Override // o6.AbstractC1394n
    public final boolean n() {
        int iL0 = this.f15883w;
        if (iL0 == 0) {
            iL0 = l0();
        }
        return (iL0 == 2 || iL0 == 4 || iL0 == 18) ? false : true;
    }

    public final int n0(String str, C0853a c0853a) {
        int length = ((String[]) c0853a.f12397r).length;
        for (int i = 0; i < length; i++) {
            if (str.equals(((String[]) c0853a.f12397r)[i])) {
                this.f15883w = 0;
                int[] iArr = this.f15876t;
                int i5 = this.f15873q - 1;
                iArr[i5] = iArr[i5] + 1;
                return i;
            }
        }
        return -1;
    }

    public final boolean o0(int i) throws F0.t {
        if (i == 9 || i == 10 || i == 12 || i == 13 || i == 32) {
            return false;
        }
        if (i != 35) {
            if (i == 44) {
                return false;
            }
            if (i != 47 && i != 61) {
                if (i == 123 || i == 125 || i == 58) {
                    return false;
                }
                if (i != 59) {
                    switch (i) {
                        case 91:
                        case 93:
                            return false;
                        case 92:
                            break;
                        default:
                            return true;
                    }
                }
            }
        }
        k0();
        return false;
    }

    public final String p0() throws F0.t, EOFException {
        String strR0;
        int iL0 = this.f15883w;
        if (iL0 == 0) {
            iL0 = l0();
        }
        if (iL0 == 14) {
            strR0 = s0();
        } else if (iL0 == 13) {
            strR0 = r0(f15878B);
        } else if (iL0 == 12) {
            strR0 = r0(f15877A);
        } else {
            if (iL0 != 15) {
                throw new A6.b("Expected a name but was " + AbstractC0844a.B(K()) + " at path " + m());
            }
            strR0 = this.f15886z;
            this.f15886z = null;
        }
        this.f15883w = 0;
        this.f15875s[this.f15873q - 1] = strR0;
        return strR0;
    }

    /* JADX WARN: Code restructure failed: missing block: B:15:0x0026, code lost:
    
        r1.y(r3);
        r2 = o6.C1395o.D;
     */
    /* JADX WARN: Code restructure failed: missing block: B:16:0x0031, code lost:
    
        if (r6 != 47) goto L56;
     */
    /* JADX WARN: Code restructure failed: missing block: B:18:0x0039, code lost:
    
        if (r5.C(2) != false) goto L20;
     */
    /* JADX WARN: Code restructure failed: missing block: B:20:0x003d, code lost:
    
        k0();
        r10 = r1.A(1);
     */
    /* JADX WARN: Code restructure failed: missing block: B:21:0x0046, code lost:
    
        if (r10 == 42) goto L58;
     */
    /* JADX WARN: Code restructure failed: missing block: B:22:0x0048, code lost:
    
        if (r10 == 47) goto L24;
     */
    /* JADX WARN: Code restructure failed: missing block: B:24:0x004b, code lost:
    
        r1.Q();
        r1.Q();
        r5 = r5.i(r2);
     */
    /* JADX WARN: Code restructure failed: missing block: B:25:0x0057, code lost:
    
        if (r5 == (-1)) goto L27;
     */
    /* JADX WARN: Code restructure failed: missing block: B:26:0x0059, code lost:
    
        r5 = r5 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:27:0x005b, code lost:
    
        r5 = r1.f18765r;
     */
    /* JADX WARN: Code restructure failed: missing block: B:28:0x005d, code lost:
    
        r1.y(r5);
     */
    /* JADX WARN: Code restructure failed: missing block: B:29:0x0061, code lost:
    
        r1.Q();
        r1.Q();
        r2 = o6.C1395o.f15880E;
        r5 = r5.F(r2);
     */
    /* JADX WARN: Code restructure failed: missing block: B:30:0x006f, code lost:
    
        if (r5 == (-1)) goto L32;
     */
    /* JADX WARN: Code restructure failed: missing block: B:31:0x0071, code lost:
    
        r3 = true;
     */
    /* JADX WARN: Code restructure failed: missing block: B:32:0x0073, code lost:
    
        r3 = false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:33:0x0074, code lost:
    
        if (r3 == false) goto L35;
     */
    /* JADX WARN: Code restructure failed: missing block: B:34:0x0076, code lost:
    
        r5 = r5 + ((long) r2.f18767q.length);
     */
    /* JADX WARN: Code restructure failed: missing block: B:35:0x007c, code lost:
    
        r5 = r1.f18765r;
     */
    /* JADX WARN: Code restructure failed: missing block: B:36:0x007e, code lost:
    
        r1.y(r5);
     */
    /* JADX WARN: Code restructure failed: missing block: B:37:0x0081, code lost:
    
        if (r3 == false) goto L61;
     */
    /* JADX WARN: Code restructure failed: missing block: B:39:0x0085, code lost:
    
        j0("Unterminated comment");
     */
    /* JADX WARN: Code restructure failed: missing block: B:40:0x008b, code lost:
    
        throw null;
     */
    /* JADX WARN: Code restructure failed: missing block: B:42:0x008e, code lost:
    
        if (r6 != 35) goto L62;
     */
    /* JADX WARN: Code restructure failed: missing block: B:43:0x0090, code lost:
    
        k0();
        r5 = r5.i(r2);
     */
    /* JADX WARN: Code restructure failed: missing block: B:44:0x0099, code lost:
    
        if (r5 == (-1)) goto L46;
     */
    /* JADX WARN: Code restructure failed: missing block: B:45:0x009b, code lost:
    
        r5 = r5 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:46:0x009d, code lost:
    
        r5 = r1.f18765r;
     */
    /* JADX WARN: Code restructure failed: missing block: B:47:0x009f, code lost:
    
        r1.y(r5);
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final int q0(boolean z8) throws F0.t, EOFException {
        byte bA;
        while (true) {
            int i = 0;
            while (true) {
                int i5 = i + 1;
                InterfaceC1733i interfaceC1733i = this.f15881u;
                if (!interfaceC1733i.C(i5)) {
                    if (z8) {
                        throw new EOFException("End of input");
                    }
                    return -1;
                }
                long j8 = i;
                C1731g c1731g = this.f15882v;
                bA = c1731g.A(j8);
                if (bA != 10 && bA != 32 && bA != 13 && bA != 9) {
                    break;
                }
                i = i5;
            }
        }
        return bA;
    }

    @Override // o6.AbstractC1394n
    public final double r() throws F0.t {
        int iL0 = this.f15883w;
        if (iL0 == 0) {
            iL0 = l0();
        }
        if (iL0 == 16) {
            this.f15883w = 0;
            int[] iArr = this.f15876t;
            int i = this.f15873q - 1;
            iArr[i] = iArr[i] + 1;
            return this.f15884x;
        }
        if (iL0 == 17) {
            long j8 = this.f15885y;
            C1731g c1731g = this.f15882v;
            c1731g.getClass();
            this.f15886z = c1731g.n0(j8, X6.a.f7235a);
        } else if (iL0 == 9) {
            this.f15886z = r0(f15878B);
        } else if (iL0 == 8) {
            this.f15886z = r0(f15877A);
        } else if (iL0 == 10) {
            this.f15886z = s0();
        } else if (iL0 != 11) {
            throw new A6.b("Expected a double but was " + AbstractC0844a.B(K()) + " at path " + m());
        }
        this.f15883w = 11;
        try {
            double d8 = Double.parseDouble(this.f15886z);
            if (Double.isNaN(d8) || Double.isInfinite(d8)) {
                throw new F0.t("JSON forbids NaN and infinities: " + d8 + " at path " + m());
            }
            this.f15886z = null;
            this.f15883w = 0;
            int[] iArr2 = this.f15876t;
            int i5 = this.f15873q - 1;
            iArr2[i5] = iArr2[i5] + 1;
            return d8;
        } catch (NumberFormatException unused) {
            throw new A6.b("Expected a double but was " + this.f15886z + " at path " + m());
        }
    }

    public final String r0(C1734j c1734j) throws F0.t, EOFException {
        StringBuilder sb = null;
        while (true) {
            long jI = this.f15881u.i(c1734j);
            if (jI == -1) {
                j0("Unterminated string");
                throw null;
            }
            C1731g c1731g = this.f15882v;
            if (c1731g.A(jI) != 92) {
                if (sb == null) {
                    String strN0 = c1731g.n0(jI, X6.a.f7235a);
                    c1731g.Q();
                    return strN0;
                }
                sb.append(c1731g.n0(jI, X6.a.f7235a));
                c1731g.Q();
                return sb.toString();
            }
            if (sb == null) {
                sb = new StringBuilder();
            }
            sb.append(c1731g.n0(jI, X6.a.f7235a));
            c1731g.Q();
            sb.append(t0());
        }
    }

    public final String s0() {
        long jI = this.f15881u.i(f15879C);
        C1731g c1731g = this.f15882v;
        if (jI == -1) {
            return c1731g.o0();
        }
        c1731g.getClass();
        return c1731g.n0(jI, X6.a.f7235a);
    }

    public final char t0() throws F0.t, EOFException {
        int i;
        InterfaceC1733i interfaceC1733i = this.f15881u;
        if (!interfaceC1733i.C(1L)) {
            j0("Unterminated escape sequence");
            throw null;
        }
        C1731g c1731g = this.f15882v;
        byte bQ = c1731g.Q();
        if (bQ == 10 || bQ == 34 || bQ == 39 || bQ == 47 || bQ == 92) {
            return (char) bQ;
        }
        if (bQ == 98) {
            return '\b';
        }
        if (bQ == 102) {
            return '\f';
        }
        if (bQ == 110) {
            return '\n';
        }
        if (bQ == 114) {
            return '\r';
        }
        if (bQ == 116) {
            return '\t';
        }
        if (bQ != 117) {
            j0("Invalid escape sequence: \\" + ((char) bQ));
            throw null;
        }
        if (!interfaceC1733i.C(4L)) {
            throw new EOFException("Unterminated escape sequence at path " + m());
        }
        char c3 = 0;
        for (int i5 = 0; i5 < 4; i5++) {
            byte bA = c1731g.A(i5);
            char c8 = (char) (c3 << 4);
            if (bA >= 48 && bA <= 57) {
                i = bA - 48;
            } else if (bA >= 97 && bA <= 102) {
                i = bA - 87;
            } else {
                if (bA < 65 || bA > 70) {
                    j0("\\u".concat(c1731g.n0(4L, X6.a.f7235a)));
                    throw null;
                }
                i = bA - 55;
            }
            c3 = (char) (i + c8);
        }
        c1731g.y(4L);
        return c3;
    }

    public final String toString() {
        return "JsonReader(" + this.f15881u + ")";
    }

    @Override // o6.AbstractC1394n
    public final int u() {
        int iL0 = this.f15883w;
        if (iL0 == 0) {
            iL0 = l0();
        }
        if (iL0 == 16) {
            long j8 = this.f15884x;
            int i = (int) j8;
            if (j8 == i) {
                this.f15883w = 0;
                int[] iArr = this.f15876t;
                int i5 = this.f15873q - 1;
                iArr[i5] = iArr[i5] + 1;
                return i;
            }
            throw new A6.b("Expected an int but was " + this.f15884x + " at path " + m());
        }
        if (iL0 == 17) {
            long j9 = this.f15885y;
            C1731g c1731g = this.f15882v;
            c1731g.getClass();
            this.f15886z = c1731g.n0(j9, X6.a.f7235a);
        } else if (iL0 == 9 || iL0 == 8) {
            String strR0 = iL0 == 9 ? r0(f15878B) : r0(f15877A);
            this.f15886z = strR0;
            try {
                int i8 = Integer.parseInt(strR0);
                this.f15883w = 0;
                int[] iArr2 = this.f15876t;
                int i9 = this.f15873q - 1;
                iArr2[i9] = iArr2[i9] + 1;
                return i8;
            } catch (NumberFormatException unused) {
            }
        } else if (iL0 != 11) {
            throw new A6.b("Expected an int but was " + AbstractC0844a.B(K()) + " at path " + m());
        }
        this.f15883w = 11;
        try {
            double d8 = Double.parseDouble(this.f15886z);
            int i10 = (int) d8;
            if (i10 != d8) {
                throw new A6.b("Expected an int but was " + this.f15886z + " at path " + m());
            }
            this.f15886z = null;
            this.f15883w = 0;
            int[] iArr3 = this.f15876t;
            int i11 = this.f15873q - 1;
            iArr3[i11] = iArr3[i11] + 1;
            return i10;
        } catch (NumberFormatException unused2) {
            throw new A6.b("Expected an int but was " + this.f15886z + " at path " + m());
        }
    }

    public final void u0(C1734j c1734j) throws F0.t, EOFException {
        while (true) {
            long jI = this.f15881u.i(c1734j);
            if (jI == -1) {
                j0("Unterminated string");
                throw null;
            }
            C1731g c1731g = this.f15882v;
            if (c1731g.A(jI) != 92) {
                c1731g.y(jI + 1);
                return;
            } else {
                c1731g.y(jI + 1);
                t0();
            }
        }
    }
}
