package defpackage;

import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicLong;

/* renamed from: ᵢᵩ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3293 implements InterfaceC5337, InterfaceC1383, InterfaceC1982, InterfaceC3964 {

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public long f12337;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final /* synthetic */ int f12338;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public Object f12339;

    public C3293() {
        this.f12338 = 0;
        this.f12337 = 0L;
    }

    public /* synthetic */ C3293(long j, Object obj, int i) {
        this.f12338 = i;
        this.f12337 = j;
        this.f12339 = obj;
    }

    public /* synthetic */ C3293(Object obj, long j, int i) {
        this.f12338 = i;
        this.f12339 = obj;
        this.f12337 = j;
    }

    public C3293(InterfaceC1383 interfaceC1383, long j) {
        this.f12338 = 5;
        this.f12339 = interfaceC1383;
        ᵛᵾˏ.ᵯٴᵦ(interfaceC1383.getPosition() >= j);
        this.f12337 = j;
    }

    public C3293(ˊᵻ r2) {
        this.f12338 = 8;
        ᵩʛʽ.ᵝᵵᵺ(r2);
        this.f12339 = r2;
    }

    public C3293(C2753 c2753) {
        this.f12338 = 2;
        this.f12339 = c2753;
        this.f12337 = 262144L;
    }

    @Override // defpackage.InterfaceC1383
    public long getLength() {
        return ((InterfaceC1383) this.f12339).getLength() - this.f12337;
    }

    @Override // defpackage.InterfaceC1383
    public long getPosition() {
        return ((InterfaceC1383) this.f12339).getPosition() - this.f12337;
    }

    @Override // defpackage.InterfaceC1463
    public int read(byte[] bArr, int i, int i2) {
        return ((InterfaceC1383) this.f12339).read(bArr, i, i2);
    }

    @Override // defpackage.InterfaceC1383
    public void readFully(byte[] bArr, int i, int i2) {
        ((InterfaceC1383) this.f12339).readFully(bArr, i, i2);
    }

    public String toString() {
        switch (this.f12338) {
            case 0:
                if (((C3293) this.f12339) == null) {
                    return Long.toBinaryString(this.f12337);
                }
                return ((C3293) this.f12339).toString() + "xx" + Long.toBinaryString(this.f12337);
            default:
                return super.toString();
        }
    }

    @Override // defpackage.InterfaceC5337
    /* renamed from: ˀᵗᵝᵭ */
    public long mo4294(long j) {
        return ((C5392) this.f12339).f20222;
    }

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public void m7673(int i, boolean z) {
        if (i >= 64) {
            m7675();
            ((C3293) this.f12339).m7673(i - 64, z);
            return;
        }
        long j = this.f12337;
        boolean z2 = (Long.MIN_VALUE & j) != 0;
        long j2 = (1 << i) - 1;
        this.f12337 = ((j & (~j2)) << 1) | (j & j2);
        if (z) {
            m7674(i);
        } else {
            m7678(i);
        }
        if (z2 || ((C3293) this.f12339) != null) {
            m7675();
            ((C3293) this.f12339).m7673(0, z2);
        }
    }

    @Override // defpackage.InterfaceC1383
    /* renamed from: ˌʾˀ */
    public int mo4243(int i) {
        return ((InterfaceC1383) this.f12339).mo4243(i);
    }

    @Override // defpackage.InterfaceC1383
    /* renamed from: ˌᵜᵹᵩ */
    public long mo4244() {
        return ((InterfaceC1383) this.f12339).mo4244() - this.f12337;
    }

    @Override // defpackage.InterfaceC5337
    /* renamed from: ˎˏʜʾ */
    public long mo4295(long j, long j2) {
        return 0L;
    }

    @Override // defpackage.InterfaceC3964
    /* renamed from: ˎˑː */
    public /* synthetic */ void mo6878(Exception exc) {
        C1601 c1601 = (C1601) this.f12339;
        ((AtomicLong) c1601.f6354).set(this.f12337);
    }

    @Override // defpackage.InterfaceC5337
    /* renamed from: ˏᵙ */
    public long mo4296(long j, long j2) {
        return ((C5392) this.f12339).f20224[(int) j];
    }

    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public void m7674(int i) {
        if (i < 64) {
            this.f12337 |= 1 << i;
        } else {
            m7675();
            ((C3293) this.f12339).m7674(i - 64);
        }
    }

    @Override // defpackage.InterfaceC5337
    /* renamed from: ˑᵥˁ */
    public long mo4297(long j, long j2) {
        return ((C5392) this.f12339).f20222;
    }

    @Override // defpackage.InterfaceC1383
    /* renamed from: ˑᵱ */
    public void mo4245() {
        ((InterfaceC1383) this.f12339).mo4245();
    }

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public void m7675() {
        if (((C3293) this.f12339) == null) {
            this.f12339 = new C3293();
        }
    }

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public boolean m7676(int i) {
        if (i >= 64) {
            m7675();
            return ((C3293) this.f12339).m7676(i - 64);
        }
        long j = 1 << i;
        long j2 = this.f12337;
        boolean z = (j2 & j) != 0;
        long j3 = j2 & (~j);
        this.f12337 = j3;
        long j4 = j - 1;
        this.f12337 = (j3 & j4) | Long.rotateRight((~j4) & j3, 1);
        C3293 c3293 = (C3293) this.f12339;
        if (c3293 != null) {
            if (c3293.m7679(0)) {
                m7674(63);
            }
            ((C3293) this.f12339).m7676(0);
        }
        return z;
    }

    @Override // defpackage.InterfaceC1383
    /* renamed from: ᵝᵵᵺ */
    public boolean mo4246(int i, boolean z) {
        return ((InterfaceC1383) this.f12339).mo4246(i, true);
    }

    @Override // defpackage.InterfaceC1982
    /* renamed from: ᵞʡ */
    public void mo4985() {
        ((InterfaceC1982) this.f12339).mo4985();
    }

    @Override // defpackage.InterfaceC1383
    /* renamed from: ᵡʠ */
    public int mo4247(byte[] bArr, int i, int i2) {
        return ((InterfaceC1383) this.f12339).mo4247(bArr, i, i2);
    }

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public void m7677() {
        this.f12337 = 0L;
        C3293 c3293 = (C3293) this.f12339;
        if (c3293 != null) {
            c3293.m7677();
        }
    }

    @Override // defpackage.InterfaceC1982
    /* renamed from: ᵡⁱᵥ */
    public void mo4987(InterfaceC5013 interfaceC5013) {
        ((InterfaceC1982) this.f12339).mo4987(new C3357(this, interfaceC5013, interfaceC5013));
    }

    @Override // defpackage.InterfaceC5337
    /* renamed from: ᵢˇᵭ */
    public boolean mo4298() {
        return true;
    }

    @Override // defpackage.InterfaceC5337
    /* renamed from: ᵤᵙᵷ */
    public long mo4299() {
        return 0L;
    }

    @Override // defpackage.InterfaceC5337
    /* renamed from: ᵥᵯˎ */
    public long mo4300(long j) {
        return ((C5392) this.f12339).f20219[(int) j] - this.f12337;
    }

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public void m7678(int i) {
        if (i < 64) {
            this.f12337 &= ~(1 << i);
            return;
        }
        C3293 c3293 = (C3293) this.f12339;
        if (c3293 != null) {
            c3293.m7678(i - 64);
        }
    }

    @Override // defpackage.InterfaceC1383
    /* renamed from: ᵧᵾˀˈ */
    public void mo4248(int i) {
        ((InterfaceC1383) this.f12339).mo4248(i);
    }

    @Override // defpackage.InterfaceC1383
    /* renamed from: ᵮᵠـˌ */
    public void mo4249(byte[] bArr, int i, int i2) {
        ((InterfaceC1383) this.f12339).mo4249(bArr, i, i2);
    }

    @Override // defpackage.InterfaceC5337
    /* renamed from: ᵯٴᵦ */
    public C0624 mo4301(long j) {
        return new C0624(((C5392) this.f12339).f20221[(int) j], r6.f20223[r7], null);
    }

    @Override // defpackage.InterfaceC1383
    /* renamed from: ᵳٴᵶ */
    public void mo4250(int i) {
        ((InterfaceC1383) this.f12339).mo4250(i);
    }

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public boolean m7679(int i) {
        if (i < 64) {
            return ((1 << i) & this.f12337) != 0;
        }
        m7675();
        return ((C3293) this.f12339).m7679(i - 64);
    }

    @Override // defpackage.InterfaceC1383
    /* renamed from: ᵶᵷᵕ */
    public boolean mo4251(byte[] bArr, int i, int i2, boolean z) {
        return ((InterfaceC1383) this.f12339).mo4251(bArr, i, i2, z);
    }

    @Override // defpackage.InterfaceC5337
    /* renamed from: ᵸʓᵠ */
    public long mo4302(long j, long j2) {
        C5392 c5392 = (C5392) this.f12339;
        return AbstractC3558.m8119(c5392.f20219, j + this.f12337, true);
    }

    @Override // defpackage.InterfaceC5337
    /* renamed from: ᵸˑ */
    public long mo4303(long j, long j2) {
        return -9223372036854775807L;
    }

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public int m7680(int i) {
        C3293 c3293 = (C3293) this.f12339;
        if (c3293 == null) {
            long j = this.f12337;
            return i >= 64 ? Long.bitCount(j) : Long.bitCount(((1 << i) - 1) & j);
        }
        if (i < 64) {
            return Long.bitCount(((1 << i) - 1) & this.f12337);
        }
        return Long.bitCount(this.f12337) + c3293.m7680(i - 64);
    }

    @Override // defpackage.InterfaceC1383
    /* renamed from: ᵻᵢﹳᵰ */
    public boolean mo4252(byte[] bArr, int i, int i2, boolean z) {
        return ((InterfaceC1383) this.f12339).mo4252(bArr, 0, i2, z);
    }

    @Override // defpackage.InterfaceC1982
    /* renamed from: ᵾᵬ */
    public InterfaceC2154 mo4996(int i, int i2) {
        return ((InterfaceC1982) this.f12339).mo4996(i, i2);
    }

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public C2609 m7681() {
        ArrayList arrayList = new ArrayList(20);
        while (true) {
            String strMo3294 = ((InterfaceC4777) this.f12339).mo3294(this.f12337);
            this.f12337 -= strMo3294.length();
            if (strMo3294.length() == 0) {
                return new C2609((String[]) arrayList.toArray(new String[0]));
            }
            int iM5058 = AbstractC1789.m5058(strMo3294, ':', 1, 4);
            if (iM5058 != -1) {
                String strSubstring = strMo3294.substring(0, iM5058);
                String strSubstring2 = strMo3294.substring(iM5058 + 1);
                arrayList.add(strSubstring);
                arrayList.add(AbstractC1789.m5079(strSubstring2).toString());
            } else if (strMo3294.charAt(0) == ':') {
                String strSubstring3 = strMo3294.substring(1);
                arrayList.add("");
                arrayList.add(AbstractC1789.m5079(strSubstring3).toString());
            } else {
                arrayList.add("");
                arrayList.add(AbstractC1789.m5079(strMo3294).toString());
            }
        }
    }
}
