package defpackage;

import androidx.media3.container.NalUnitUtil;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0010\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Ll79;", "Lcl;", "kotlinx-serialization-json"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
@vx8
public class l79 extends cl {
    public final String e;

    public l79(String str) {
        cr4.g(str, "source");
        this.e = str;
    }

    @Override // defpackage.cl
    public final int aa(int i) {
        if (i < this.e.length()) {
            return i;
        }
        return -1;
    }

    @Override // defpackage.cl
    public int ab() {
        char cCharAt;
        int i = this.a;
        if (i == -1) {
            return i;
        }
        while (true) {
            String str = this.e;
            if (i >= str.length() || !((cCharAt = str.charAt(i)) == ' ' || cCharAt == '\n' || cCharAt == '\r' || cCharAt == '\t')) {
                break;
            }
            i++;
        }
        this.a = i;
        return i;
    }

    @Override // defpackage.cl
    public boolean c() {
        int i = this.a;
        if (i == -1) {
            return false;
        }
        while (true) {
            String str = this.e;
            if (i >= str.length()) {
                this.a = i;
                return false;
            }
            char cCharAt = str.charAt(i);
            if (cCharAt != ' ' && cCharAt != '\n' && cCharAt != '\r' && cCharAt != '\t') {
                this.a = i;
                return cl.w(cCharAt);
            }
            i++;
        }
    }

    @Override // defpackage.cl
    public final String e() {
        h('\"');
        int i = this.a;
        String str = this.e;
        int iY = n89.y(str, '\"', i, 4);
        if (iY == -1) {
            l();
            s((byte) 1, false);
            throw null;
        }
        for (int i2 = i; i2 < iY; i2++) {
            if (str.charAt(i2) == '\\') {
                return k(str, this.a, i2);
            }
        }
        this.a = iY + 1;
        String strSubstring = str.substring(i, iY);
        cr4.f(strSubstring, "substring(...)");
        return strSubstring;
    }

    /* JADX WARN: Code restructure failed: missing block: B:18:0x002d, code lost:
    
        r4.a = r3.length();
     */
    /* JADX WARN: Code restructure failed: missing block: B:19:0x0033, code lost:
    
        return 10;
     */
    @Override // defpackage.cl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public byte f() {
        int i = this.a;
        while (true) {
            String str = this.e;
            if (i == -1 || i >= str.length()) {
                break;
            }
            int i2 = i + 1;
            char cCharAt = str.charAt(i);
            if (cCharAt != ' ' && cCharAt != '\n' && cCharAt != '\r' && cCharAt != '\t') {
                this.a = i2;
                return cm.a(cCharAt);
            }
            i = i2;
        }
    }

    @Override // defpackage.cl
    public void h(char c) {
        int i = this.a;
        if (i == -1) {
            ae(c);
            throw null;
        }
        while (true) {
            String str = this.e;
            if (i >= str.length()) {
                this.a = -1;
                ae(c);
                throw null;
            }
            int i2 = i + 1;
            char cCharAt = str.charAt(i);
            if (cCharAt != ' ' && cCharAt != '\n' && cCharAt != '\r' && cCharAt != '\t') {
                this.a = i2;
                if (cCharAt == c) {
                    return;
                }
                ae(c);
                throw null;
            }
            i = i2;
        }
    }

    @Override // defpackage.cl
    public final CharSequence v() {
        return this.e;
    }

    @Override // defpackage.cl
    public final String x(String str, boolean z) {
        cr4.g(str, "keyToMatch");
        int i = this.a;
        try {
            if (f() == 6 && cr4.b(z(z), str)) {
                this.c = null;
                if (f() == 5) {
                    return z(z);
                }
            }
            return null;
        } finally {
            this.a = i;
            this.c = null;
        }
    }
}
