package com.fasterxml.jackson.core.filter;

import com.fasterxml.jackson.core.Base64Variant;
import com.fasterxml.jackson.core.JsonLocation;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonStreamContext;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.core.util.JsonParserDelegate;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.math.BigInteger;

/* loaded from: classes.dex */
public class FilteringParserDelegate extends JsonParserDelegate {
    protected boolean _allowMultipleMatches;
    protected JsonToken _currToken;
    protected TokenFilterContext _exposedContext;
    protected TokenFilterContext _headContext;

    @Deprecated
    protected boolean _includeImmediateParent;
    protected boolean _includePath;
    protected TokenFilter _itemFilter;
    protected JsonToken _lastClearedToken;
    protected int _matchCount;
    protected TokenFilter rootFilter;

    public FilteringParserDelegate(JsonParser jsonParser, TokenFilter tokenFilter, boolean z10, boolean z11) {
        super(jsonParser);
        this.rootFilter = tokenFilter;
        this._itemFilter = tokenFilter;
        this._headContext = TokenFilterContext.createRootContext(tokenFilter);
        this._includePath = z10;
        this._allowMultipleMatches = z11;
    }

    private JsonToken _nextBuffered(TokenFilterContext tokenFilterContext) throws IOException {
        this._exposedContext = tokenFilterContext;
        JsonToken nextTokenToRead = tokenFilterContext.nextTokenToRead();
        if (nextTokenToRead != null) {
            return nextTokenToRead;
        }
        while (tokenFilterContext != this._headContext) {
            tokenFilterContext = this._exposedContext.findChildOf(tokenFilterContext);
            this._exposedContext = tokenFilterContext;
            if (tokenFilterContext == null) {
                throw _constructError("Unexpected problem: chain of filtered context broken");
            }
            JsonToken nextTokenToRead2 = tokenFilterContext.nextTokenToRead();
            if (nextTokenToRead2 != null) {
                return nextTokenToRead2;
            }
        }
        throw _constructError("Internal error: failed to locate expected buffered tokens");
    }

    private final boolean _verifyAllowedMatches() throws IOException {
        int i10 = this._matchCount;
        if (i10 != 0 && !this._allowMultipleMatches) {
            return false;
        }
        this._matchCount = i10 + 1;
        return true;
    }

    protected JsonStreamContext _filterContext() {
        TokenFilterContext tokenFilterContext = this._exposedContext;
        return tokenFilterContext != null ? tokenFilterContext : this._headContext;
    }

    protected final JsonToken _nextToken2() throws IOException {
        TokenFilter checkValue;
        JsonToken _nextTokenWithBuffering;
        JsonToken _nextTokenWithBuffering2;
        JsonToken _nextTokenWithBuffering3;
        while (true) {
            JsonToken nextToken = this.delegate.nextToken();
            if (nextToken == null) {
                this._currToken = nextToken;
                return nextToken;
            }
            int id2 = nextToken.id();
            if (id2 != 1) {
                if (id2 != 2) {
                    if (id2 == 3) {
                        TokenFilter tokenFilter = this._itemFilter;
                        TokenFilter tokenFilter2 = TokenFilter.INCLUDE_ALL;
                        if (tokenFilter == tokenFilter2) {
                            this._headContext = this._headContext.createChildArrayContext(tokenFilter, true);
                            this._currToken = nextToken;
                            return nextToken;
                        }
                        if (tokenFilter == null) {
                            this.delegate.skipChildren();
                        } else {
                            TokenFilter checkValue2 = this._headContext.checkValue(tokenFilter);
                            if (checkValue2 == null) {
                                this.delegate.skipChildren();
                            } else {
                                if (checkValue2 != tokenFilter2) {
                                    checkValue2 = checkValue2.filterStartArray();
                                }
                                this._itemFilter = checkValue2;
                                if (checkValue2 == tokenFilter2) {
                                    this._headContext = this._headContext.createChildArrayContext(checkValue2, true);
                                    this._currToken = nextToken;
                                    return nextToken;
                                }
                                TokenFilterContext createChildArrayContext = this._headContext.createChildArrayContext(checkValue2, false);
                                this._headContext = createChildArrayContext;
                                if (this._includePath && (_nextTokenWithBuffering2 = _nextTokenWithBuffering(createChildArrayContext)) != null) {
                                    this._currToken = _nextTokenWithBuffering2;
                                    return _nextTokenWithBuffering2;
                                }
                            }
                        }
                    } else if (id2 != 4) {
                        if (id2 != 5) {
                            TokenFilter tokenFilter3 = this._itemFilter;
                            TokenFilter tokenFilter4 = TokenFilter.INCLUDE_ALL;
                            if (tokenFilter3 == tokenFilter4) {
                                this._currToken = nextToken;
                                return nextToken;
                            }
                            if (tokenFilter3 != null && ((checkValue = this._headContext.checkValue(tokenFilter3)) == tokenFilter4 || (checkValue != null && checkValue.includeValue(this.delegate)))) {
                                if (_verifyAllowedMatches()) {
                                    this._currToken = nextToken;
                                    return nextToken;
                                }
                            }
                        } else {
                            String currentName = this.delegate.getCurrentName();
                            TokenFilter fieldName = this._headContext.setFieldName(currentName);
                            TokenFilter tokenFilter5 = TokenFilter.INCLUDE_ALL;
                            if (fieldName == tokenFilter5) {
                                this._itemFilter = fieldName;
                                this._currToken = nextToken;
                                return nextToken;
                            }
                            if (fieldName == null) {
                                this.delegate.nextToken();
                                this.delegate.skipChildren();
                            } else {
                                TokenFilter includeProperty = fieldName.includeProperty(currentName);
                                if (includeProperty == null) {
                                    this.delegate.nextToken();
                                    this.delegate.skipChildren();
                                } else {
                                    this._itemFilter = includeProperty;
                                    if (includeProperty == tokenFilter5) {
                                        if (_verifyAllowedMatches() && this._includePath) {
                                            this._currToken = nextToken;
                                            return nextToken;
                                        }
                                    } else if (this._includePath && (_nextTokenWithBuffering = _nextTokenWithBuffering(this._headContext)) != null) {
                                        this._currToken = _nextTokenWithBuffering;
                                        return _nextTokenWithBuffering;
                                    }
                                }
                            }
                        }
                    }
                }
                boolean isStartHandled = this._headContext.isStartHandled();
                TokenFilter filter = this._headContext.getFilter();
                if (filter != null && filter != TokenFilter.INCLUDE_ALL) {
                    filter.filterFinishArray();
                }
                TokenFilterContext parent = this._headContext.getParent();
                this._headContext = parent;
                this._itemFilter = parent.getFilter();
                if (isStartHandled) {
                    this._currToken = nextToken;
                    return nextToken;
                }
            } else {
                TokenFilter tokenFilter6 = this._itemFilter;
                TokenFilter tokenFilter7 = TokenFilter.INCLUDE_ALL;
                if (tokenFilter6 == tokenFilter7) {
                    this._headContext = this._headContext.createChildObjectContext(tokenFilter6, true);
                    this._currToken = nextToken;
                    return nextToken;
                }
                if (tokenFilter6 == null) {
                    this.delegate.skipChildren();
                } else {
                    TokenFilter checkValue3 = this._headContext.checkValue(tokenFilter6);
                    if (checkValue3 == null) {
                        this.delegate.skipChildren();
                    } else {
                        if (checkValue3 != tokenFilter7) {
                            checkValue3 = checkValue3.filterStartObject();
                        }
                        this._itemFilter = checkValue3;
                        if (checkValue3 == tokenFilter7) {
                            this._headContext = this._headContext.createChildObjectContext(checkValue3, true);
                            this._currToken = nextToken;
                            return nextToken;
                        }
                        TokenFilterContext createChildObjectContext = this._headContext.createChildObjectContext(checkValue3, false);
                        this._headContext = createChildObjectContext;
                        if (this._includePath && (_nextTokenWithBuffering3 = _nextTokenWithBuffering(createChildObjectContext)) != null) {
                            this._currToken = _nextTokenWithBuffering3;
                            return _nextTokenWithBuffering3;
                        }
                    }
                }
            }
        }
    }

    protected final JsonToken _nextTokenWithBuffering(TokenFilterContext tokenFilterContext) throws IOException {
        TokenFilter checkValue;
        while (true) {
            JsonToken nextToken = this.delegate.nextToken();
            if (nextToken == null) {
                return nextToken;
            }
            int id2 = nextToken.id();
            boolean z10 = false;
            if (id2 != 1) {
                if (id2 != 2) {
                    if (id2 == 3) {
                        TokenFilter checkValue2 = this._headContext.checkValue(this._itemFilter);
                        if (checkValue2 == null) {
                            this.delegate.skipChildren();
                        } else {
                            TokenFilter tokenFilter = TokenFilter.INCLUDE_ALL;
                            if (checkValue2 != tokenFilter) {
                                checkValue2 = checkValue2.filterStartArray();
                            }
                            this._itemFilter = checkValue2;
                            if (checkValue2 == tokenFilter) {
                                this._headContext = this._headContext.createChildArrayContext(checkValue2, true);
                                return _nextBuffered(tokenFilterContext);
                            }
                            this._headContext = this._headContext.createChildArrayContext(checkValue2, false);
                        }
                    } else if (id2 != 4) {
                        if (id2 != 5) {
                            TokenFilter tokenFilter2 = this._itemFilter;
                            TokenFilter tokenFilter3 = TokenFilter.INCLUDE_ALL;
                            if (tokenFilter2 == tokenFilter3) {
                                return _nextBuffered(tokenFilterContext);
                            }
                            if (tokenFilter2 != null && ((checkValue = this._headContext.checkValue(tokenFilter2)) == tokenFilter3 || (checkValue != null && checkValue.includeValue(this.delegate)))) {
                                if (_verifyAllowedMatches()) {
                                    return _nextBuffered(tokenFilterContext);
                                }
                            }
                        } else {
                            String currentName = this.delegate.getCurrentName();
                            TokenFilter fieldName = this._headContext.setFieldName(currentName);
                            TokenFilter tokenFilter4 = TokenFilter.INCLUDE_ALL;
                            if (fieldName == tokenFilter4) {
                                this._itemFilter = fieldName;
                                return _nextBuffered(tokenFilterContext);
                            }
                            if (fieldName == null) {
                                this.delegate.nextToken();
                                this.delegate.skipChildren();
                            } else {
                                TokenFilter includeProperty = fieldName.includeProperty(currentName);
                                if (includeProperty == null) {
                                    this.delegate.nextToken();
                                    this.delegate.skipChildren();
                                } else {
                                    this._itemFilter = includeProperty;
                                    if (includeProperty != tokenFilter4) {
                                        continue;
                                    } else {
                                        if (_verifyAllowedMatches()) {
                                            return _nextBuffered(tokenFilterContext);
                                        }
                                        this._itemFilter = this._headContext.setFieldName(currentName);
                                    }
                                }
                            }
                        }
                    }
                }
                TokenFilter filter = this._headContext.getFilter();
                if (filter != null && filter != TokenFilter.INCLUDE_ALL) {
                    filter.filterFinishArray();
                }
                TokenFilterContext tokenFilterContext2 = this._headContext;
                if ((tokenFilterContext2 == tokenFilterContext) && tokenFilterContext2.isStartHandled()) {
                    z10 = true;
                }
                TokenFilterContext parent = this._headContext.getParent();
                this._headContext = parent;
                this._itemFilter = parent.getFilter();
                if (z10) {
                    return nextToken;
                }
            } else {
                TokenFilter tokenFilter5 = this._itemFilter;
                TokenFilter tokenFilter6 = TokenFilter.INCLUDE_ALL;
                if (tokenFilter5 == tokenFilter6) {
                    this._headContext = this._headContext.createChildObjectContext(tokenFilter5, true);
                    return nextToken;
                }
                if (tokenFilter5 == null) {
                    this.delegate.skipChildren();
                } else {
                    TokenFilter checkValue3 = this._headContext.checkValue(tokenFilter5);
                    if (checkValue3 == null) {
                        this.delegate.skipChildren();
                    } else {
                        if (checkValue3 != tokenFilter6) {
                            checkValue3 = checkValue3.filterStartObject();
                        }
                        this._itemFilter = checkValue3;
                        if (checkValue3 == tokenFilter6) {
                            this._headContext = this._headContext.createChildObjectContext(checkValue3, true);
                            return _nextBuffered(tokenFilterContext);
                        }
                        this._headContext = this._headContext.createChildObjectContext(checkValue3, false);
                    }
                }
            }
        }
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public void clearCurrentToken() {
        JsonToken jsonToken = this._currToken;
        if (jsonToken != null) {
            this._lastClearedToken = jsonToken;
            this._currToken = null;
        }
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public JsonToken currentToken() {
        return this._currToken;
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public final int currentTokenId() {
        JsonToken jsonToken = this._currToken;
        if (jsonToken == null) {
            return 0;
        }
        return jsonToken.id();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public BigInteger getBigIntegerValue() throws IOException {
        return this.delegate.getBigIntegerValue();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public byte[] getBinaryValue(Base64Variant base64Variant) throws IOException {
        return this.delegate.getBinaryValue(base64Variant);
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public boolean getBooleanValue() throws IOException {
        return this.delegate.getBooleanValue();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public byte getByteValue() throws IOException {
        return this.delegate.getByteValue();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public JsonLocation getCurrentLocation() {
        return this.delegate.getCurrentLocation();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public String getCurrentName() throws IOException {
        JsonStreamContext _filterContext = _filterContext();
        JsonToken jsonToken = this._currToken;
        if (jsonToken != JsonToken.START_OBJECT && jsonToken != JsonToken.START_ARRAY) {
            return _filterContext.getCurrentName();
        }
        JsonStreamContext parent = _filterContext.getParent();
        if (parent == null) {
            return null;
        }
        return parent.getCurrentName();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public JsonToken getCurrentToken() {
        return this._currToken;
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public final int getCurrentTokenId() {
        JsonToken jsonToken = this._currToken;
        if (jsonToken == null) {
            return 0;
        }
        return jsonToken.id();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public BigDecimal getDecimalValue() throws IOException {
        return this.delegate.getDecimalValue();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public double getDoubleValue() throws IOException {
        return this.delegate.getDoubleValue();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public Object getEmbeddedObject() throws IOException {
        return this.delegate.getEmbeddedObject();
    }

    public TokenFilter getFilter() {
        return this.rootFilter;
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public float getFloatValue() throws IOException {
        return this.delegate.getFloatValue();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public int getIntValue() throws IOException {
        return this.delegate.getIntValue();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public JsonToken getLastClearedToken() {
        return this._lastClearedToken;
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public long getLongValue() throws IOException {
        return this.delegate.getLongValue();
    }

    public int getMatchCount() {
        return this._matchCount;
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public JsonParser.NumberType getNumberType() throws IOException {
        return this.delegate.getNumberType();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public Number getNumberValue() throws IOException {
        return this.delegate.getNumberValue();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public JsonStreamContext getParsingContext() {
        return _filterContext();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public short getShortValue() throws IOException {
        return this.delegate.getShortValue();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public String getText() throws IOException {
        return this.delegate.getText();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public char[] getTextCharacters() throws IOException {
        return this.delegate.getTextCharacters();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public int getTextLength() throws IOException {
        return this.delegate.getTextLength();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public int getTextOffset() throws IOException {
        return this.delegate.getTextOffset();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public JsonLocation getTokenLocation() {
        return this.delegate.getTokenLocation();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public boolean getValueAsBoolean() throws IOException {
        return this.delegate.getValueAsBoolean();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public double getValueAsDouble() throws IOException {
        return this.delegate.getValueAsDouble();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public int getValueAsInt() throws IOException {
        return this.delegate.getValueAsInt();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public long getValueAsLong() throws IOException {
        return this.delegate.getValueAsLong();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public String getValueAsString() throws IOException {
        return this.delegate.getValueAsString();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public boolean hasCurrentToken() {
        return this._currToken != null;
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public boolean hasTextCharacters() {
        return this.delegate.hasTextCharacters();
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public final boolean hasToken(JsonToken jsonToken) {
        return this._currToken == jsonToken;
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public boolean hasTokenId(int i10) {
        JsonToken jsonToken = this._currToken;
        return jsonToken == null ? i10 == 0 : jsonToken.id() == i10;
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public boolean isExpectedStartArrayToken() {
        return this._currToken == JsonToken.START_ARRAY;
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public boolean isExpectedStartObjectToken() {
        return this._currToken == JsonToken.START_OBJECT;
    }

    /* JADX WARN: Code restructure failed: missing block: B:100:0x011c, code lost:
    
        if (r1 != r4) goto L98;
     */
    /* JADX WARN: Code restructure failed: missing block: B:101:0x011e, code lost:
    
        r6._headContext = r6._headContext.createChildArrayContext(r1, true);
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:102:0x0128, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:103:0x0129, code lost:
    
        if (r1 != null) goto L100;
     */
    /* JADX WARN: Code restructure failed: missing block: B:104:0x012b, code lost:
    
        r6.delegate.skipChildren();
     */
    /* JADX WARN: Code restructure failed: missing block: B:105:0x0132, code lost:
    
        r1 = r6._headContext.checkValue(r1);
     */
    /* JADX WARN: Code restructure failed: missing block: B:106:0x0138, code lost:
    
        if (r1 != null) goto L103;
     */
    /* JADX WARN: Code restructure failed: missing block: B:107:0x013a, code lost:
    
        r6.delegate.skipChildren();
     */
    /* JADX WARN: Code restructure failed: missing block: B:108:0x0141, code lost:
    
        if (r1 == r4) goto L105;
     */
    /* JADX WARN: Code restructure failed: missing block: B:109:0x0143, code lost:
    
        r1 = r1.filterStartArray();
     */
    /* JADX WARN: Code restructure failed: missing block: B:110:0x0147, code lost:
    
        r6._itemFilter = r1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:111:0x0149, code lost:
    
        if (r1 != r4) goto L109;
     */
    /* JADX WARN: Code restructure failed: missing block: B:112:0x014b, code lost:
    
        r6._headContext = r6._headContext.createChildArrayContext(r1, true);
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:113:0x0155, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:114:0x0156, code lost:
    
        r0 = r6._headContext.createChildArrayContext(r1, false);
        r6._headContext = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:115:0x0160, code lost:
    
        if (r6._includePath == false) goto L145;
     */
    /* JADX WARN: Code restructure failed: missing block: B:116:0x0162, code lost:
    
        r0 = _nextTokenWithBuffering(r0);
     */
    /* JADX WARN: Code restructure failed: missing block: B:117:0x0166, code lost:
    
        if (r0 == null) goto L145;
     */
    /* JADX WARN: Code restructure failed: missing block: B:118:0x0168, code lost:
    
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:119:0x016a, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:120:0x016b, code lost:
    
        r1 = r6._headContext.isStartHandled();
        r2 = r6._headContext.getFilter();
     */
    /* JADX WARN: Code restructure failed: missing block: B:121:0x0177, code lost:
    
        if (r2 == null) goto L120;
     */
    /* JADX WARN: Code restructure failed: missing block: B:123:0x017b, code lost:
    
        if (r2 == com.fasterxml.jackson.core.filter.TokenFilter.INCLUDE_ALL) goto L120;
     */
    /* JADX WARN: Code restructure failed: missing block: B:124:0x017d, code lost:
    
        r2.filterFinishArray();
     */
    /* JADX WARN: Code restructure failed: missing block: B:125:0x0180, code lost:
    
        r2 = r6._headContext.getParent();
        r6._headContext = r2;
        r6._itemFilter = r2.getFilter();
     */
    /* JADX WARN: Code restructure failed: missing block: B:126:0x018e, code lost:
    
        if (r1 == false) goto L145;
     */
    /* JADX WARN: Code restructure failed: missing block: B:127:0x0190, code lost:
    
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:128:0x0192, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:129:0x0193, code lost:
    
        r1 = r6._itemFilter;
        r4 = com.fasterxml.jackson.core.filter.TokenFilter.INCLUDE_ALL;
     */
    /* JADX WARN: Code restructure failed: missing block: B:130:0x0197, code lost:
    
        if (r1 != r4) goto L128;
     */
    /* JADX WARN: Code restructure failed: missing block: B:131:0x0199, code lost:
    
        r6._headContext = r6._headContext.createChildObjectContext(r1, true);
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:132:0x01a3, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:133:0x01a4, code lost:
    
        if (r1 != null) goto L130;
     */
    /* JADX WARN: Code restructure failed: missing block: B:134:0x01a6, code lost:
    
        r6.delegate.skipChildren();
     */
    /* JADX WARN: Code restructure failed: missing block: B:135:0x01ac, code lost:
    
        r1 = r6._headContext.checkValue(r1);
     */
    /* JADX WARN: Code restructure failed: missing block: B:136:0x01b2, code lost:
    
        if (r1 != null) goto L133;
     */
    /* JADX WARN: Code restructure failed: missing block: B:137:0x01b4, code lost:
    
        r6.delegate.skipChildren();
     */
    /* JADX WARN: Code restructure failed: missing block: B:138:0x01ba, code lost:
    
        if (r1 == r4) goto L135;
     */
    /* JADX WARN: Code restructure failed: missing block: B:139:0x01bc, code lost:
    
        r1 = r1.filterStartObject();
     */
    /* JADX WARN: Code restructure failed: missing block: B:140:0x01c0, code lost:
    
        r6._itemFilter = r1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:141:0x01c2, code lost:
    
        if (r1 != r4) goto L139;
     */
    /* JADX WARN: Code restructure failed: missing block: B:142:0x01c4, code lost:
    
        r6._headContext = r6._headContext.createChildObjectContext(r1, true);
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:143:0x01ce, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:144:0x01cf, code lost:
    
        r0 = r6._headContext.createChildObjectContext(r1, false);
        r6._headContext = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:145:0x01d9, code lost:
    
        if (r6._includePath == false) goto L145;
     */
    /* JADX WARN: Code restructure failed: missing block: B:146:0x01db, code lost:
    
        r0 = _nextTokenWithBuffering(r0);
     */
    /* JADX WARN: Code restructure failed: missing block: B:147:0x01df, code lost:
    
        if (r0 == null) goto L145;
     */
    /* JADX WARN: Code restructure failed: missing block: B:148:0x01e1, code lost:
    
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:149:0x01e3, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:19:0x002a, code lost:
    
        if (r0 != null) goto L20;
     */
    /* JADX WARN: Code restructure failed: missing block: B:20:0x002c, code lost:
    
        r2 = r0.nextTokenToRead();
     */
    /* JADX WARN: Code restructure failed: missing block: B:21:0x0030, code lost:
    
        if (r2 == null) goto L24;
     */
    /* JADX WARN: Code restructure failed: missing block: B:22:0x0035, code lost:
    
        r2 = r6._headContext;
     */
    /* JADX WARN: Code restructure failed: missing block: B:23:0x0037, code lost:
    
        if (r0 != r2) goto L30;
     */
    /* JADX WARN: Code restructure failed: missing block: B:24:0x004a, code lost:
    
        r0 = r2.findChildOf(r0);
        r6._exposedContext = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:25:0x0050, code lost:
    
        if (r0 == null) goto L147;
     */
    /* JADX WARN: Code restructure failed: missing block: B:28:0x0059, code lost:
    
        throw _constructError("Unexpected problem: chain of filtered context broken");
     */
    /* JADX WARN: Code restructure failed: missing block: B:31:0x0039, code lost:
    
        r6._exposedContext = null;
     */
    /* JADX WARN: Code restructure failed: missing block: B:32:0x003f, code lost:
    
        if (r0.inArray() == false) goto L35;
     */
    /* JADX WARN: Code restructure failed: missing block: B:33:0x0041, code lost:
    
        r0 = r6.delegate.getCurrentToken();
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:34:0x0049, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:36:0x0032, code lost:
    
        r6._currToken = r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:37:0x0034, code lost:
    
        return r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:38:0x005a, code lost:
    
        r0 = r6.delegate.nextToken();
     */
    /* JADX WARN: Code restructure failed: missing block: B:39:0x0060, code lost:
    
        if (r0 != null) goto L39;
     */
    /* JADX WARN: Code restructure failed: missing block: B:40:0x0062, code lost:
    
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:41:0x0064, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:42:0x0065, code lost:
    
        r1 = r0.id();
     */
    /* JADX WARN: Code restructure failed: missing block: B:43:0x006b, code lost:
    
        if (r1 == 1) goto L124;
     */
    /* JADX WARN: Code restructure failed: missing block: B:45:0x006e, code lost:
    
        if (r1 == 2) goto L115;
     */
    /* JADX WARN: Code restructure failed: missing block: B:47:0x0071, code lost:
    
        if (r1 == 3) goto L94;
     */
    /* JADX WARN: Code restructure failed: missing block: B:49:0x0074, code lost:
    
        if (r1 == 4) goto L115;
     */
    /* JADX WARN: Code restructure failed: missing block: B:51:0x0077, code lost:
    
        if (r1 == 5) goto L63;
     */
    /* JADX WARN: Code restructure failed: missing block: B:52:0x0079, code lost:
    
        r1 = r6._itemFilter;
        r2 = com.fasterxml.jackson.core.filter.TokenFilter.INCLUDE_ALL;
     */
    /* JADX WARN: Code restructure failed: missing block: B:53:0x007d, code lost:
    
        if (r1 != r2) goto L53;
     */
    /* JADX WARN: Code restructure failed: missing block: B:54:0x007f, code lost:
    
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:55:0x0081, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:56:0x0082, code lost:
    
        if (r1 == null) goto L145;
     */
    /* JADX WARN: Code restructure failed: missing block: B:57:0x0084, code lost:
    
        r1 = r6._headContext.checkValue(r1);
     */
    /* JADX WARN: Code restructure failed: missing block: B:58:0x008a, code lost:
    
        if (r1 == r2) goto L59;
     */
    /* JADX WARN: Code restructure failed: missing block: B:59:0x008c, code lost:
    
        if (r1 == null) goto L145;
     */
    /* JADX WARN: Code restructure failed: missing block: B:61:0x0094, code lost:
    
        if (r1.includeValue(r6.delegate) == false) goto L145;
     */
    /* JADX WARN: Code restructure failed: missing block: B:63:0x009a, code lost:
    
        if (_verifyAllowedMatches() == false) goto L145;
     */
    /* JADX WARN: Code restructure failed: missing block: B:64:0x009c, code lost:
    
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:65:0x009e, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:67:0x01e8, code lost:
    
        return _nextToken2();
     */
    /* JADX WARN: Code restructure failed: missing block: B:68:0x009f, code lost:
    
        r1 = r6.delegate.getCurrentName();
        r2 = r6._headContext.setFieldName(r1);
        r3 = com.fasterxml.jackson.core.filter.TokenFilter.INCLUDE_ALL;
     */
    /* JADX WARN: Code restructure failed: missing block: B:69:0x00ad, code lost:
    
        if (r2 != r3) goto L74;
     */
    /* JADX WARN: Code restructure failed: missing block: B:70:0x00af, code lost:
    
        r6._itemFilter = r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:71:0x00b3, code lost:
    
        if (r6._includePath != false) goto L72;
     */
    /* JADX WARN: Code restructure failed: missing block: B:73:0x00b7, code lost:
    
        if (r6._includeImmediateParent == false) goto L72;
     */
    /* JADX WARN: Code restructure failed: missing block: B:75:0x00bf, code lost:
    
        if (r6._headContext.isStartHandled() != false) goto L72;
     */
    /* JADX WARN: Code restructure failed: missing block: B:76:0x00c1, code lost:
    
        r0 = r6._headContext.nextTokenToRead();
        r6._exposedContext = r6._headContext;
     */
    /* JADX WARN: Code restructure failed: missing block: B:77:0x00cb, code lost:
    
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:78:0x00cd, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:79:0x00ce, code lost:
    
        if (r2 != null) goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:80:0x00d0, code lost:
    
        r6.delegate.nextToken();
        r6.delegate.skipChildren();
     */
    /* JADX WARN: Code restructure failed: missing block: B:81:0x00dc, code lost:
    
        r1 = r2.includeProperty(r1);
     */
    /* JADX WARN: Code restructure failed: missing block: B:82:0x00e0, code lost:
    
        if (r1 != null) goto L79;
     */
    /* JADX WARN: Code restructure failed: missing block: B:83:0x00e2, code lost:
    
        r6.delegate.nextToken();
        r6.delegate.skipChildren();
     */
    /* JADX WARN: Code restructure failed: missing block: B:84:0x00ee, code lost:
    
        r6._itemFilter = r1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:85:0x00f0, code lost:
    
        if (r1 != r3) goto L88;
     */
    /* JADX WARN: Code restructure failed: missing block: B:87:0x00f6, code lost:
    
        if (_verifyAllowedMatches() == false) goto L87;
     */
    /* JADX WARN: Code restructure failed: missing block: B:89:0x00fa, code lost:
    
        if (r6._includePath == false) goto L88;
     */
    /* JADX WARN: Code restructure failed: missing block: B:90:0x00fc, code lost:
    
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:91:0x00fe, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:92:0x00ff, code lost:
    
        r6.delegate.nextToken();
        r6.delegate.skipChildren();
     */
    /* JADX WARN: Code restructure failed: missing block: B:94:0x010b, code lost:
    
        if (r6._includePath == false) goto L145;
     */
    /* JADX WARN: Code restructure failed: missing block: B:95:0x010d, code lost:
    
        r0 = _nextTokenWithBuffering(r6._headContext);
     */
    /* JADX WARN: Code restructure failed: missing block: B:96:0x0113, code lost:
    
        if (r0 == null) goto L145;
     */
    /* JADX WARN: Code restructure failed: missing block: B:97:0x0115, code lost:
    
        r6._currToken = r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:98:0x0117, code lost:
    
        return r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:99:0x0118, code lost:
    
        r1 = r6._itemFilter;
        r4 = com.fasterxml.jackson.core.filter.TokenFilter.INCLUDE_ALL;
     */
    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public JsonToken nextToken() throws IOException {
        JsonToken jsonToken;
        if (!this._allowMultipleMatches && (jsonToken = this._currToken) != null && this._exposedContext == null && jsonToken.isScalarValue() && !this._headContext.isStartHandled() && !this._includePath && this._itemFilter == TokenFilter.INCLUDE_ALL) {
            this._currToken = null;
            return null;
        }
        TokenFilterContext tokenFilterContext = this._exposedContext;
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public JsonToken nextValue() throws IOException {
        JsonToken nextToken = nextToken();
        return nextToken == JsonToken.FIELD_NAME ? nextToken() : nextToken;
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public void overrideCurrentName(String str) {
        throw new UnsupportedOperationException("Can not currently override name during filtering read");
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public int readBinaryValue(Base64Variant base64Variant, OutputStream outputStream) throws IOException {
        return this.delegate.readBinaryValue(base64Variant, outputStream);
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public JsonParser skipChildren() throws IOException {
        JsonToken jsonToken = this._currToken;
        if (jsonToken != JsonToken.START_OBJECT && jsonToken != JsonToken.START_ARRAY) {
            return this;
        }
        int i10 = 1;
        while (true) {
            JsonToken nextToken = nextToken();
            if (nextToken == null) {
                return this;
            }
            if (nextToken.isStructStart()) {
                i10++;
            } else if (nextToken.isStructEnd() && i10 - 1 == 0) {
                return this;
            }
        }
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public boolean getValueAsBoolean(boolean z10) throws IOException {
        return this.delegate.getValueAsBoolean(z10);
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public double getValueAsDouble(double d10) throws IOException {
        return this.delegate.getValueAsDouble(d10);
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public int getValueAsInt(int i10) throws IOException {
        return this.delegate.getValueAsInt(i10);
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public long getValueAsLong(long j10) throws IOException {
        return this.delegate.getValueAsLong(j10);
    }

    @Override // com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.core.JsonParser
    public String getValueAsString(String str) throws IOException {
        return this.delegate.getValueAsString(str);
    }
}
