package p138.p176.p177.p190.p198.p205;

import java.io.EOFException;
import java.util.Arrays;
import p000.p001.p002.p003.p004.C0567;
import p138.p176.p177.p190.p198.C3558;
import p138.p176.p177.p190.p239.C4140;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ೲ.ޛ.ށ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C3640 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final C3641 f11014 = new C3641();

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final C4140 f11015 = new C4140(new byte[65025], 0);

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public int f11016 = -1;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public int f11017;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public boolean f11018;

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final int m5990(int i) {
        int i2;
        int i3 = 0;
        this.f11017 = 0;
        do {
            int i4 = this.f11017;
            int i5 = i + i4;
            C3641 c3641 = this.f11014;
            if (i5 >= c3641.f11022) {
                break;
            }
            int[] iArr = c3641.f11025;
            this.f11017 = i4 + 1;
            i2 = iArr[i4 + i];
            i3 += i2;
        } while (i2 == 255);
        return i3;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public boolean m5991(C3558 c3558) throws InterruptedException, EOFException {
        int i;
        C0567.m1932(c3558 != null);
        if (this.f11018) {
            this.f11018 = false;
            this.f11015.m6709();
        }
        while (!this.f11018) {
            if (this.f11016 < 0) {
                if (!this.f11014.m5993(c3558, true)) {
                    return false;
                }
                C3641 c3641 = this.f11014;
                int iM5990 = c3641.f11023;
                if ((c3641.f11020 & 1) == 1 && this.f11015.f13229 == 0) {
                    iM5990 += m5990(0);
                    i = this.f11017 + 0;
                } else {
                    i = 0;
                }
                c3558.m5878(iM5990);
                this.f11016 = i;
            }
            int iM59902 = m5990(this.f11016);
            int i2 = this.f11016 + this.f11017;
            if (iM59902 > 0) {
                C4140 c4140 = this.f11015;
                byte[] bArr = c4140.f13227;
                int length = bArr.length;
                int i3 = c4140.f13229;
                if (length < i3 + iM59902) {
                    c4140.f13227 = Arrays.copyOf(bArr, i3 + iM59902);
                }
                C4140 c41402 = this.f11015;
                c3558.m5877(c41402.f13227, c41402.f13229, iM59902, false);
                C4140 c41403 = this.f11015;
                c41403.m6691(c41403.f13229 + iM59902);
                this.f11018 = this.f11014.f11025[i2 + (-1)] != 255;
            }
            if (i2 == this.f11014.f11022) {
                i2 = -1;
            }
            this.f11016 = i2;
        }
        return true;
    }
}
