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

import java.io.EOFException;
import p138.p176.p177.p190.p192.C3474;
import p138.p176.p177.p190.p198.C3558;
import p138.p176.p177.p190.p198.C3570;
import p138.p176.p177.p190.p198.InterfaceC3561;
import p138.p176.p177.p190.p198.InterfaceC3562;
import p138.p176.p177.p190.p198.InterfaceC3571;
import p138.p176.p177.p190.p198.p207.InterfaceC3690;
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 C3651 implements InterfaceC3561 {

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

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

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

    @Override // p138.p176.p177.p190.p198.InterfaceC3561
    /* JADX INFO: renamed from: ֏ */
    public int mo5886(C3558 c3558, C3570 c3570) throws InterruptedException, EOFException {
        int iM5870 = c3558.m5870(this.f11062.f13227, 0, 2786);
        if (iM5870 == -1) {
            return -1;
        }
        this.f11062.m6693(0);
        this.f11062.m6691(iM5870);
        if (!this.f11063) {
            this.f11061.f11075 = 0L;
            this.f11063 = true;
        }
        this.f11061.mo6000(this.f11062);
        return 0;
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3561
    /* JADX INFO: renamed from: ֏ */
    public void mo5887() {
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3561
    /* JADX INFO: renamed from: ֏ */
    public void mo5888(long j, long j2) {
        this.f11063 = false;
        this.f11061.mo5997();
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3561
    /* JADX INFO: renamed from: ֏ */
    public void mo5889(InterfaceC3562 interfaceC3562) {
        this.f11061.mo5999(interfaceC3562, new InterfaceC3690.C3694(Integer.MIN_VALUE, 0, 1));
        interfaceC3562.mo5892();
        interfaceC3562.mo5893(new InterfaceC3571.C3573(-9223372036854775807L, 0L));
    }

    /* JADX WARN: Code restructure failed: missing block: B:10:0x003b, code lost:
    
        if ((r5 - r3) < 8192) goto L12;
     */
    /* JADX WARN: Code restructure failed: missing block: B:11:0x003d, code lost:
    
        return false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:9:0x0033, code lost:
    
        r14.f10565 = 0;
        r5 = r5 + 1;
     */
    @Override // p138.p176.p177.p190.p198.InterfaceC3561
    /* JADX INFO: renamed from: ֏ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public boolean mo5890(C3558 c3558) throws InterruptedException, EOFException {
        int iM5755;
        C4140 c4140 = new C4140(10);
        int i = 0;
        while (true) {
            c3558.m5875(c4140.f13227, 0, 10, false);
            c4140.m6693(0);
            if (c4140.m6704() != 4801587) {
                break;
            }
            c4140.m6695(3);
            int iM6701 = c4140.m6701();
            i += iM6701 + 10;
            c3558.m5874(iM6701, false);
        }
        c3558.f10565 = 0;
        c3558.m5874(i, false);
        int i2 = i;
        while (true) {
            int i3 = 0;
            while (true) {
                c3558.m5875(c4140.f13227, 0, 6, false);
                c4140.m6693(0);
                if (c4140.m6707() != 2935) {
                    break;
                }
                i3++;
                if (i3 >= 4) {
                    return true;
                }
                byte[] bArr = c4140.f13227;
                if (bArr.length < 6) {
                    iM5755 = -1;
                } else {
                    iM5755 = ((bArr[5] & 248) >> 3) > 10 ? ((((bArr[2] & 7) << 8) | (bArr[3] & 255)) + 1) * 2 : C3474.m5755((bArr[4] & 192) >> 6, bArr[4] & 63);
                }
                if (iM5755 == -1) {
                    return false;
                }
                c3558.m5874(iM5755 - 6, false);
            }
            c3558.m5874(i2, false);
        }
    }
}
