package defpackage;

/* renamed from: ᵥᵖˋ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3514 {

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

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public C3514 f13186;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public C3514 f13187;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public int f13188;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final byte[] f13189;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public int f13190;

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

    public C3514() {
        this.f13189 = new byte[8192];
        this.f13185 = true;
        this.f13191 = false;
    }

    public C3514(byte[] bArr, int i, int i2, boolean z) {
        this.f13189 = bArr;
        this.f13190 = i;
        this.f13188 = i2;
        this.f13191 = z;
        this.f13185 = false;
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final C3514 m8038() {
        this.f13191 = true;
        return new C3514(this.f13189, this.f13190, this.f13188, true);
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C3514 m8039() {
        C3514 c3514 = this.f13187;
        C3514 c35142 = c3514 != this ? c3514 : null;
        C3514 c35143 = this.f13186;
        c35143.f13187 = c3514;
        this.f13187.f13186 = c35143;
        this.f13187 = null;
        this.f13186 = null;
        return c35142;
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final void m8040(C3514 c3514) {
        c3514.f13186 = this;
        c3514.f13187 = this.f13187;
        this.f13187.f13186 = c3514;
        this.f13187 = c3514;
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final void m8041(C3514 c3514, int i) {
        byte[] bArr = c3514.f13189;
        if (!c3514.f13185) {
            ᵹˉᵞ.ᵳٴᵶ("only owner can write");
            return;
        }
        int i2 = c3514.f13188;
        int i3 = i2 + i;
        if (i3 > 8192) {
            if (c3514.f13191) {
                ᵨᴵᵺ.ᵻᵢﹳᵰ();
                return;
            }
            int i4 = c3514.f13190;
            if (i3 - i4 > 8192) {
                ᵨᴵᵺ.ᵻᵢﹳᵰ();
                return;
            } else {
                AbstractC1658.m4721(i4, i2, bArr, bArr);
                c3514.f13188 -= c3514.f13190;
                c3514.f13190 = 0;
            }
        }
        int i5 = c3514.f13188;
        int i6 = this.f13190;
        System.arraycopy(this.f13189, i6, bArr, i5, (i6 + i) - i6);
        c3514.f13188 += i;
        this.f13190 += i;
    }
}
