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

import p138.p176.p177.p190.p198.InterfaceC3562;
import p138.p176.p177.p190.p198.p207.InterfaceC3690;
import p138.p176.p177.p190.p239.C4140;
import p138.p176.p177.p190.p239.C4149;
import p138.p176.p177.p190.p239.C4150;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ೲ.ޝ.ޔ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C3681 implements InterfaceC3690 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final InterfaceC3680 f11327;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final C4140 f11328 = new C4140(32);

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

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

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

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

    public C3681(InterfaceC3680 interfaceC3680) {
        this.f11327 = interfaceC3680;
    }

    @Override // p138.p176.p177.p190.p198.p207.InterfaceC3690
    /* JADX INFO: renamed from: ֏ */
    public void mo6022() {
        this.f11332 = true;
    }

    @Override // p138.p176.p177.p190.p198.p207.InterfaceC3690
    /* JADX INFO: renamed from: ֏ */
    public void mo6024(C4140 c4140, int i) {
        boolean z = (i & 1) != 0;
        int iM6702 = z ? c4140.f13228 + c4140.m6702() : -1;
        if (this.f11332) {
            if (!z) {
                return;
            }
            this.f11332 = false;
            c4140.m6693(iM6702);
            this.f11330 = 0;
        }
        while (c4140.m6679() > 0) {
            int i2 = this.f11330;
            if (i2 < 3) {
                if (i2 == 0) {
                    int iM67022 = c4140.m6702();
                    c4140.m6693(c4140.f13228 - 1);
                    if (iM67022 == 255) {
                        this.f11332 = true;
                        return;
                    }
                }
                int iMin = Math.min(c4140.m6679(), 3 - this.f11330);
                c4140.m6685(this.f11328.f13227, this.f11330, iMin);
                int i3 = this.f11330 + iMin;
                this.f11330 = i3;
                if (i3 == 3) {
                    this.f11328.m6689(3);
                    this.f11328.m6695(1);
                    int iM67023 = this.f11328.m6702();
                    int iM67024 = this.f11328.m6702();
                    this.f11331 = (iM67023 & 128) != 0;
                    int i4 = (((iM67023 & 15) << 8) | iM67024) + 3;
                    this.f11329 = i4;
                    C4140 c41402 = this.f11328;
                    byte[] bArr = c41402.f13227;
                    if (bArr.length < i4) {
                        c41402.m6689(Math.min(4098, Math.max(i4, bArr.length * 2)));
                        System.arraycopy(bArr, 0, this.f11328.f13227, 0, 3);
                    }
                }
            } else {
                int iMin2 = Math.min(c4140.m6679(), this.f11329 - this.f11330);
                c4140.m6685(this.f11328.f13227, this.f11330, iMin2);
                int i5 = this.f11330 + iMin2;
                this.f11330 = i5;
                int i6 = this.f11329;
                if (i5 != i6) {
                    continue;
                } else {
                    if (!this.f11331) {
                        this.f11328.m6689(i6);
                    } else {
                        if (C4150.m6746(this.f11328.f13227, 0, i6, -1) != 0) {
                            this.f11332 = true;
                            return;
                        }
                        this.f11328.m6689(this.f11329 - 4);
                    }
                    this.f11327.mo6031(this.f11328);
                    this.f11330 = 0;
                }
            }
        }
    }

    @Override // p138.p176.p177.p190.p198.p207.InterfaceC3690
    /* JADX INFO: renamed from: ֏ */
    public void mo6025(C4149 c4149, InterfaceC3562 interfaceC3562, InterfaceC3690.C3694 c3694) {
        this.f11327.mo6032(c4149, interfaceC3562, c3694);
        this.f11332 = true;
    }
}
