package g0;

import g0.d0;
import java.util.ArrayList;
import java.util.List;

/* loaded from: classes.dex */
public abstract class n {
    public static final List a(s sVar, d0 d0Var, j jVar) {
        List k10;
        if (!jVar.d() && d0Var.isEmpty()) {
            k10 = sm.u.k();
            return k10;
        }
        ArrayList arrayList = new ArrayList();
        jn.i iVar = jVar.d() ? new jn.i(jVar.c(), Math.min(jVar.b(), sVar.a() - 1)) : jn.i.f25088t.a();
        int size = d0Var.size();
        for (int i10 = 0; i10 < size; i10++) {
            d0.a aVar = (d0.a) d0Var.get(i10);
            int a10 = t.a(sVar, aVar.getKey(), aVar.getIndex());
            if (!(a10 <= iVar.m() && iVar.g() <= a10)) {
                if (a10 >= 0 && a10 < sVar.a()) {
                    arrayList.add(Integer.valueOf(a10));
                }
            }
        }
        int g10 = iVar.g();
        int m10 = iVar.m();
        if (g10 <= m10) {
            while (true) {
                arrayList.add(Integer.valueOf(g10));
                if (g10 == m10) {
                    break;
                }
                g10++;
            }
        }
        return arrayList;
    }
}
