package o1;

import java.io.EOFException;
import u0.F;
import x0.AbstractC1709a;
import x0.o;

/* JADX INFO: renamed from: o1.f, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1330f {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public int f15603a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public long f15604b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f15605c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f15606d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f15607e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final int[] f15608f = new int[255];

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final o f15609g = new o(255);

    public final boolean a(T0.j jVar, boolean z8) throws F, EOFException {
        boolean zF;
        boolean zF2;
        this.f15603a = 0;
        this.f15604b = 0L;
        this.f15605c = 0;
        this.f15606d = 0;
        this.f15607e = 0;
        o oVar = this.f15609g;
        oVar.C(27);
        try {
            zF = jVar.f(oVar.f18539a, 0, 27, z8);
        } catch (EOFException e8) {
            if (!z8) {
                throw e8;
            }
            zF = false;
        }
        if (zF && oVar.v() == 1332176723) {
            if (oVar.t() == 0) {
                this.f15603a = oVar.t();
                this.f15604b = oVar.j();
                oVar.k();
                oVar.k();
                oVar.k();
                int iT = oVar.t();
                this.f15605c = iT;
                this.f15606d = iT + 27;
                oVar.C(iT);
                try {
                    zF2 = jVar.f(oVar.f18539a, 0, this.f15605c, z8);
                } catch (EOFException e9) {
                    if (!z8) {
                        throw e9;
                    }
                    zF2 = false;
                }
                if (zF2) {
                    for (int i = 0; i < this.f15605c; i++) {
                        int iT2 = oVar.t();
                        this.f15608f[i] = iT2;
                        this.f15607e += iT2;
                    }
                    return true;
                }
            } else if (!z8) {
                throw F.c("unsupported bit stream revision");
            }
        }
        return false;
    }

    /* JADX WARN: Code restructure failed: missing block: B:21:0x0046, code lost:
    
        if (r11 == (-1)) goto L24;
     */
    /* JADX WARN: Code restructure failed: missing block: B:23:0x004c, code lost:
    
        if (r10.f6428t >= r11) goto L33;
     */
    /* JADX WARN: Code restructure failed: missing block: B:25:0x0053, code lost:
    
        if (r10.s(1) == (-1)) goto L34;
     */
    /* JADX WARN: Code restructure failed: missing block: B:27:0x0056, code lost:
    
        return false;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean b(T0.j jVar, long j8) {
        boolean zF;
        AbstractC1709a.d(jVar.f6428t == jVar.i());
        o oVar = this.f15609g;
        oVar.C(4);
        while (true) {
            if (j8 != -1 && jVar.f6428t + 4 >= j8) {
                break;
            }
            try {
                zF = jVar.f(oVar.f18539a, 0, 4, true);
            } catch (EOFException unused) {
                zF = false;
            }
            if (!zF) {
                break;
            }
            oVar.F(0);
            if (oVar.v() == 1332176723) {
                jVar.f6430v = 0;
                return true;
            }
            jVar.b(1);
        }
    }
}
