package defpackage;

import java.io.EOFException;

/* renamed from: ᵧᵺˉ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3687 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public boolean f13725;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public int f13729;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C2251 f13727 = new C2251();

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final C3493 f13728 = new C3493(0, new byte[65025]);

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public int f13726 = -1;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final int m8279(int i) {
        int i2;
        int i3 = 0;
        this.f13729 = 0;
        do {
            int i4 = this.f13729;
            int i5 = i + i4;
            C2251 c2251 = this.f13727;
            if (i5 >= c2251.f8811) {
                break;
            }
            int[] iArr = (int[]) c2251.f8810;
            this.f13729 = i4 + 1;
            i2 = iArr[i5];
            i3 += i2;
        } while (i2 == 255);
        return i3;
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final boolean m8280(InterfaceC1383 interfaceC1383) {
        int i;
        ᵛᵾˏ.ᵿʗᵝʽ(interfaceC1383 != null);
        boolean z = this.f13725;
        C3493 c3493 = this.f13728;
        if (z) {
            this.f13725 = false;
            c3493.m7939(0);
        }
        while (!this.f13725) {
            int i2 = this.f13726;
            C2251 c2251 = this.f13727;
            if (i2 < 0) {
                if (c2251.m5925(interfaceC1383, -1L) && c2251.m5930(interfaceC1383, true)) {
                    int iM8279 = c2251.f8814;
                    if ((c2251.f8812 & 1) == 1 && c3493.f13081 == 0) {
                        iM8279 += m8279(0);
                        i = this.f13729;
                    } else {
                        i = 0;
                    }
                    try {
                        interfaceC1383.mo4248(iM8279);
                        this.f13726 = i;
                    } catch (EOFException unused) {
                    }
                }
                return false;
            }
            int iM82792 = m8279(this.f13726);
            int i3 = this.f13726 + this.f13729;
            if (iM82792 > 0) {
                c3493.m7945(c3493.f13081 + iM82792);
                try {
                    interfaceC1383.readFully(c3493.f13082, c3493.f13081, iM82792);
                    c3493.m7950(c3493.f13081 + iM82792);
                    this.f13725 = ((int[]) c2251.f8810)[i3 + (-1)] != 255;
                } catch (EOFException unused2) {
                    return false;
                }
            }
            if (i3 == c2251.f8811) {
                i3 = -1;
            }
            this.f13726 = i3;
        }
        return true;
    }
}
