package d1;

import T0.H;
import c1.C0576a;
import e1.C0863a;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import n4.u0;
import u0.D;
import x0.o;

/* JADX INFO: renamed from: d1.b, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0763b extends u0 {

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public final /* synthetic */ int f11337v;

    public static C0863a C(o oVar) {
        String strO = oVar.o();
        strO.getClass();
        String strO2 = oVar.o();
        strO2.getClass();
        return new C0863a(strO, strO2, oVar.n(), oVar.n(), Arrays.copyOfRange(oVar.f18539a, oVar.f18540b, oVar.f18541c));
    }

    @Override // n4.u0
    public final D q(C0576a c0576a, ByteBuffer byteBuffer) {
        boolean z8 = true;
        switch (this.f11337v) {
            case u0.f15495q /* 0 */:
                if (byteBuffer.get() != 116) {
                    return null;
                }
                H h8 = new H(byteBuffer.limit(), byteBuffer.array());
                int i = 12;
                h8.t(12);
                int iF = (h8.f() + h8.i(12)) - 4;
                h8.t(44);
                h8.u(h8.i(12));
                h8.t(16);
                ArrayList arrayList = new ArrayList();
                while (h8.f() < iF) {
                    h8.t(48);
                    int i5 = h8.i(8);
                    h8.t(4);
                    int iF2 = h8.f() + h8.i(i);
                    String str = null;
                    String str2 = null;
                    while (h8.f() < iF2) {
                        int i8 = h8.i(8);
                        int i9 = h8.i(8);
                        boolean z9 = z8;
                        int iF3 = h8.f() + i9;
                        if (i8 == 2) {
                            int i10 = h8.i(16);
                            h8.t(8);
                            if (i10 == 3) {
                                while (h8.f() < iF3) {
                                    int i11 = h8.i(8);
                                    Charset charset = StandardCharsets.US_ASCII;
                                    byte[] bArr = new byte[i11];
                                    h8.l(i11, bArr);
                                    String str3 = new String(bArr, charset);
                                    int i12 = h8.i(8);
                                    for (int i13 = 0; i13 < i12; i13++) {
                                        h8.u(h8.i(8));
                                    }
                                    str = str3;
                                }
                            }
                        } else if (i8 == 21) {
                            Charset charset2 = StandardCharsets.US_ASCII;
                            byte[] bArr2 = new byte[i9];
                            h8.l(i9, bArr2);
                            str2 = new String(bArr2, charset2);
                        }
                        h8.q(iF3 * 8);
                        z8 = z9;
                    }
                    boolean z10 = z8;
                    h8.q(iF2 * 8);
                    if (str != null && str2 != null) {
                        arrayList.add(new C0762a(i5, str.concat(str2)));
                    }
                    z8 = z10;
                    i = 12;
                }
                if (arrayList.isEmpty()) {
                    return null;
                }
                return new D(arrayList);
            default:
                return new D(C(new o(byteBuffer.limit(), byteBuffer.array())));
        }
    }
}
