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

import java.io.EOFException;
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 C3653 implements InterfaceC3561 {

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

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

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

    @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.f11077.f13227, 0, 16384);
        if (iM5870 == -1) {
            return -1;
        }
        this.f11077.m6693(0);
        this.f11077.m6691(iM5870);
        if (!this.f11078) {
            this.f11076.f11091 = 0L;
            this.f11078 = true;
        }
        this.f11076.mo6000(this.f11077);
        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.f11078 = false;
        this.f11076.mo5997();
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3561
    /* JADX INFO: renamed from: ֏ */
    public void mo5889(InterfaceC3562 interfaceC3562) {
        this.f11076.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:0x0039, code lost:
    
        r15.f10565 = 0;
        r4 = r4 + 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:11:0x0041, code lost:
    
        if ((r4 - r3) < 8192) goto L13;
     */
    /* JADX WARN: Code restructure failed: missing block: B:12:0x0043, code lost:
    
        return false;
     */
    @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 i;
        C4140 c4140 = new C4140(10);
        int i2 = 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();
            i2 += iM6701 + 10;
            c3558.m5874(iM6701, false);
        }
        c3558.f10565 = 0;
        c3558.m5874(i2, false);
        int i3 = i2;
        while (true) {
            int i4 = 0;
            while (true) {
                int i5 = 7;
                c3558.m5875(c4140.f13227, 0, 7, false);
                c4140.m6693(0);
                int iM6707 = c4140.m6707();
                if (iM6707 != 44096 && iM6707 != 44097) {
                    break;
                }
                i4++;
                if (i4 >= 4) {
                    return true;
                }
                byte[] bArr = c4140.f13227;
                if (bArr.length < 7) {
                    i = -1;
                } else {
                    int i6 = ((bArr[2] & 255) << 8) | (bArr[3] & 255);
                    if (i6 == 65535) {
                        i6 = ((bArr[4] & 255) << 16) | ((bArr[5] & 255) << 8) | (bArr[6] & 255);
                    } else {
                        i5 = 4;
                    }
                    if (iM6707 == 44097) {
                        i5 += 2;
                    }
                    i = i6 + i5;
                }
                if (i == -1) {
                    return false;
                }
                c3558.m5874(i - 7, false);
            }
            c3558.m5874(i3, false);
        }
    }
}
