package p138.p176.p177.p190.p239;

import p000.p001.p002.p003.p004.C0567;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ဢ.ޏ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C4139 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public byte[] f13223;

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

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

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

    public C4139() {
        this.f13223 = C4150.f13264;
    }

    public C4139(byte[] bArr) {
        int length = bArr.length;
        this.f13223 = bArr;
        this.f13226 = length;
    }

    public C4139(byte[] bArr, int i) {
        this.f13223 = bArr;
        this.f13226 = i;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public int m6667(int i) {
        int i2;
        if (i == 0) {
            return 0;
        }
        this.f13225 += i;
        int i3 = 0;
        while (true) {
            i2 = this.f13225;
            if (i2 <= 8) {
                break;
            }
            int i4 = i2 - 8;
            this.f13225 = i4;
            byte[] bArr = this.f13223;
            int i5 = this.f13224;
            this.f13224 = i5 + 1;
            i3 |= (bArr[i5] & 255) << i4;
        }
        byte[] bArr2 = this.f13223;
        int i6 = this.f13224;
        int i7 = ((-1) >>> (32 - i)) & (i3 | ((bArr2[i6] & 255) >> (8 - i2)));
        if (i2 == 8) {
            this.f13225 = 0;
            this.f13224 = i6 + 1;
        }
        m6668();
        return i7;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m6668() {
        int i;
        int i2 = this.f13224;
        C0567.m1932(i2 >= 0 && (i2 < (i = this.f13226) || (i2 == i && this.f13225 == 0)));
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m6669(byte[] bArr, int i) {
        this.f13223 = bArr;
        this.f13224 = 0;
        this.f13225 = 0;
        this.f13226 = i;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m6670(byte[] bArr, int i, int i2) {
        int i3 = (i2 >> 3) + i;
        while (i < i3) {
            byte[] bArr2 = this.f13223;
            int i4 = this.f13224;
            int i5 = i4 + 1;
            this.f13224 = i5;
            byte b = bArr2[i4];
            int i6 = this.f13225;
            bArr[i] = (byte) (b << i6);
            bArr[i] = (byte) (((255 & bArr2[i5]) >> (8 - i6)) | bArr[i]);
            i++;
        }
        int i7 = i2 & 7;
        if (i7 == 0) {
            return;
        }
        bArr[i3] = (byte) (bArr[i3] & (255 >> i7));
        int i8 = this.f13225;
        if (i8 + i7 > 8) {
            int i9 = bArr[i3];
            byte[] bArr3 = this.f13223;
            int i10 = this.f13224;
            this.f13224 = i10 + 1;
            bArr[i3] = (byte) (i9 | ((bArr3[i10] & 255) << i8));
            this.f13225 = i8 - 8;
        }
        int i11 = this.f13225 + i7;
        this.f13225 = i11;
        byte[] bArr4 = this.f13223;
        int i12 = this.f13224;
        bArr[i3] = (byte) (((byte) (((255 & bArr4[i12]) >> (8 - i11)) << (8 - i7))) | bArr[i3]);
        if (i11 == 8) {
            this.f13225 = 0;
            this.f13224 = i12 + 1;
        }
        m6668();
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public int m6671() {
        return ((this.f13226 - this.f13224) * 8) - this.f13225;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public void m6672(int i) {
        int i2 = i / 8;
        this.f13224 = i2;
        this.f13225 = i - (i2 * 8);
        m6668();
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public void m6673(byte[] bArr, int i, int i2) {
        C0567.m1932(this.f13225 == 0);
        System.arraycopy(this.f13223, this.f13224, bArr, i, i2);
        this.f13224 += i2;
        m6668();
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public void m6674() {
        if (this.f13225 == 0) {
            return;
        }
        this.f13225 = 0;
        this.f13224++;
        m6668();
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public void m6675(int i) {
        int i2 = i / 8;
        int i3 = this.f13224 + i2;
        this.f13224 = i3;
        int i4 = (i - (i2 * 8)) + this.f13225;
        this.f13225 = i4;
        if (i4 > 7) {
            this.f13224 = i3 + 1;
            this.f13225 = i4 - 8;
        }
        m6668();
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public int m6676() {
        return (this.f13224 * 8) + this.f13225;
    }

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public boolean m6677() {
        boolean z = (this.f13223[this.f13224] & (128 >> this.f13225)) != 0;
        m6678();
        return z;
    }

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public void m6678() {
        int i = this.f13225 + 1;
        this.f13225 = i;
        if (i == 8) {
            this.f13225 = 0;
            this.f13224++;
        }
        m6668();
    }
}
