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

import java.io.EOFException;
import p000.p001.p002.p003.p004.C0567;
import p138.p176.p177.p190.p198.AbstractC3548;
import p138.p176.p177.p190.p198.C3555;
import p138.p176.p177.p190.p198.C3558;
import p138.p176.p177.p190.p198.C3564;
import p138.p176.p177.p190.p239.C4128;
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 C3583 extends AbstractC3548 {

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ೲ.ޖ.ؠ$ؠ, reason: contains not printable characters */
    public static final class C3585 implements AbstractC3548.InterfaceC3554 {

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

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

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final C3564.C3565 f10638 = new C3564.C3565();

        public /* synthetic */ C3585(C4128 c4128, int i, C3584 c3584) {
            this.f10636 = c4128;
            this.f10637 = i;
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final long m5910(C3558 c3558) throws InterruptedException, EOFException {
            boolean zM5895;
            while (c3558.m5872() < c3558.f10562 - 6) {
                C4128 c4128 = this.f10636;
                int i = this.f10637;
                C3564.C3565 c3565 = this.f10638;
                long jM5872 = c3558.m5872();
                byte[] bArr = new byte[2];
                c3558.m5875(bArr, 0, 2, false);
                if ((((bArr[0] & 255) << 8) | (bArr[1] & 255)) != i) {
                    c3558.f10565 = 0;
                    c3558.m5874((int) (jM5872 - c3558.f10563), false);
                    zM5895 = false;
                } else {
                    C4140 c4140 = new C4140(16);
                    System.arraycopy(bArr, 0, c4140.f13227, 0, 2);
                    c4140.m6691(C0567.m1846(c3558, c4140.f13227, 2, 14));
                    c3558.f10565 = 0;
                    c3558.m5874((int) (jM5872 - c3558.f10563), false);
                    zM5895 = C3564.m5895(c4140, c4128, i, c3565);
                }
                if (zM5895) {
                    break;
                }
                c3558.m5874(1, false);
            }
            long jM58722 = c3558.m5872();
            long j = c3558.f10562;
            if (jM58722 < j - 6) {
                return this.f10638.f10570;
            }
            c3558.m5874((int) (j - c3558.m5872()), false);
            return this.f10636.f13189;
        }

        @Override // p138.p176.p177.p190.p198.AbstractC3548.InterfaceC3554
        /* JADX INFO: renamed from: ֏ */
        public AbstractC3548.C3553 mo5865(C3558 c3558, long j) throws InterruptedException, EOFException {
            long j2 = c3558.f10563;
            long jM5910 = m5910(c3558);
            long jM5872 = c3558.m5872();
            c3558.m5874(Math.max(6, this.f10636.f13182), false);
            long jM59102 = m5910(c3558);
            return (jM5910 > j || jM59102 <= j) ? jM59102 <= j ? AbstractC3548.C3553.m5864(jM59102, c3558.m5872()) : AbstractC3548.C3553.m5863(jM5910, j2) : AbstractC3548.C3553.m5862(jM5872);
        }

        @Override // p138.p176.p177.p190.p198.AbstractC3548.InterfaceC3554
        /* JADX INFO: renamed from: ֏ */
        public /* synthetic */ void mo5866() {
            C3555.m5867(this);
        }
    }

    public C3583(final C4128 c4128, int i, long j, long j2) {
        long j3;
        long j4;
        c4128.getClass();
        AbstractC3548.InterfaceC3552 interfaceC3552 = new AbstractC3548.InterfaceC3552() { // from class: ދ.ހ.֏.ؠ.ೲ.ޖ.֏
            @Override // p138.p176.p177.p190.p198.AbstractC3548.InterfaceC3552
            /* JADX INFO: renamed from: ֏ */
            public final long mo5860(long j5) {
                return c4128.m6639(j5);
            }
        };
        C3585 c3585 = new C3585(c4128, i, null);
        long jM6638 = c4128.m6638();
        long j5 = c4128.f13189;
        int i2 = c4128.f13183;
        if (i2 > 0) {
            j3 = (((long) i2) + ((long) c4128.f13182)) / 2;
            j4 = 1;
        } else {
            int i3 = c4128.f13180;
            j3 = ((((i3 != c4128.f13181 || i3 <= 0) ? 4096L : i3) * ((long) c4128.f13186)) * ((long) c4128.f13187)) / 8;
            j4 = 64;
        }
        super(interfaceC3552, c3585, jM6638, 0L, j5, j, j2, j3 + j4, Math.max(6, c4128.f13182));
    }
}
