package p138.p176.p177.p190.p217;

import android.net.Uri;
import java.util.List;
import java.util.Map;
import p000.p001.p002.p003.p004.C0567;
import p138.p176.p177.p190.p198.InterfaceC3575;
import p138.p176.p177.p190.p217.C3809;
import p138.p176.p177.p190.p238.C4098;
import p138.p176.p177.p190.p238.InterfaceC4095;
import p138.p176.p177.p190.p238.InterfaceC4115;
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 C3796 implements InterfaceC4095 {

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

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

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final InterfaceC3797 f11626;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final byte[] f11627;

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

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໞ.ގ$֏, reason: contains not printable characters */
    public interface InterfaceC3797 {
    }

    public C3796(InterfaceC4095 interfaceC4095, int i, InterfaceC3797 interfaceC3797) {
        C0567.m1896(i > 0);
        this.f11624 = interfaceC4095;
        this.f11625 = i;
        this.f11626 = interfaceC3797;
        this.f11627 = new byte[1];
        this.f11628 = i;
    }

    @Override // p138.p176.p177.p190.p238.InterfaceC4095
    public void close() {
        throw new UnsupportedOperationException();
    }

    /* JADX WARN: Removed duplicated region for block: B:27:0x0071  */
    /* JADX WARN: Removed duplicated region for block: B:28:0x0076 A[RETURN] */
    @Override // p138.p176.p177.p190.p238.InterfaceC4095
    /* JADX INFO: renamed from: ֏ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public int mo1282(byte[] bArr, int i, int i2) {
        if (this.f11628 == 0) {
            boolean z = true;
            if (this.f11624.mo1282(this.f11627, 0, 1) != -1) {
                int i3 = (this.f11627[0] & 255) << 4;
                if (i3 != 0) {
                    byte[] bArr2 = new byte[i3];
                    int i4 = i3;
                    int i5 = 0;
                    while (i4 > 0) {
                        int iMo1282 = this.f11624.mo1282(bArr2, i5, i4);
                        if (iMo1282 == -1) {
                            z = false;
                            break;
                        }
                        i5 += iMo1282;
                        i4 -= iMo1282;
                    }
                    while (i3 > 0) {
                        int i6 = i3 - 1;
                        if (bArr2[i6] != 0) {
                            break;
                        }
                        i3 = i6;
                    }
                    if (i3 > 0) {
                        InterfaceC3797 interfaceC3797 = this.f11626;
                        C4140 c4140 = new C4140(bArr2, i3);
                        C3809.C3810 c3810 = (C3809.C3810) interfaceC3797;
                        long jMax = !c3810.f11693 ? c3810.f11689 : Math.max(C3809.this.m6152(), c3810.f11689);
                        int iM6679 = c4140.m6679();
                        InterfaceC3575 interfaceC3575 = c3810.f11692;
                        C0567.m1856(interfaceC3575);
                        interfaceC3575.mo5885(c4140, iM6679);
                        interfaceC3575.mo5883(jMax, 1, iM6679, 0, null);
                        c3810.f11693 = true;
                    }
                }
                if (z) {
                    return -1;
                }
                this.f11628 = this.f11625;
            } else {
                z = false;
                if (z) {
                }
            }
        }
        int iMo12822 = this.f11624.mo1282(bArr, i, Math.min(this.f11628, i2));
        if (iMo12822 != -1) {
            this.f11628 -= iMo12822;
        }
        return iMo12822;
    }

    @Override // p138.p176.p177.p190.p238.InterfaceC4095
    /* JADX INFO: renamed from: ֏ */
    public long mo1283(C4098 c4098) {
        throw new UnsupportedOperationException();
    }

    @Override // p138.p176.p177.p190.p238.InterfaceC4095
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public Map<String, List<String>> mo6120() {
        return this.f11624.mo6120();
    }

    @Override // p138.p176.p177.p190.p238.InterfaceC4095
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void mo6121(InterfaceC4115 interfaceC4115) {
        this.f11624.mo6121(interfaceC4115);
    }

    @Override // p138.p176.p177.p190.p238.InterfaceC4095
    /* JADX INFO: renamed from: ؠ */
    public Uri mo1284() {
        return this.f11624.mo1284();
    }
}
