package q1;

import androidx.collection.g0;
import androidx.collection.q0;
import androidx.compose.ui.focus.FocusTargetNode;

/* loaded from: classes.dex */
public final class q {

    /* renamed from: a, reason: collision with root package name */
    private final g0 f33162a = q0.d();

    /* renamed from: b, reason: collision with root package name */
    private final a1.b f33163b = new a1.b(new dn.a[16], 0);

    /* renamed from: c, reason: collision with root package name */
    private boolean f33164c;

    public static final /* synthetic */ void a(q qVar) {
        qVar.f();
    }

    public static final /* synthetic */ void b(q qVar) {
        qVar.g();
    }

    public static final /* synthetic */ void c(q qVar) {
        qVar.h();
    }

    public static final /* synthetic */ a1.b d(q qVar) {
        return qVar.f33163b;
    }

    public static final /* synthetic */ boolean e(q qVar) {
        return qVar.f33164c;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void f() {
        this.f33164c = true;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void g() {
        this.f33162a.h();
        int i10 = 0;
        this.f33164c = false;
        a1.b bVar = this.f33163b;
        int q10 = bVar.q();
        if (q10 > 0) {
            Object[] p10 = bVar.p();
            do {
                ((dn.a) p10[i10]).invoke();
                i10++;
            } while (i10 < q10);
        }
        this.f33163b.k();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void h() {
        g0 g0Var = this.f33162a;
        Object[] objArr = g0Var.f1367b;
        long[] jArr = g0Var.f1366a;
        int length = jArr.length - 2;
        if (length >= 0) {
            int i10 = 0;
            while (true) {
                long j10 = jArr[i10];
                if ((((~j10) << 7) & j10 & (-9187201950435737472L)) != -9187201950435737472L) {
                    int i11 = 8 - ((~(i10 - length)) >>> 31);
                    for (int i12 = 0; i12 < i11; i12++) {
                        if ((255 & j10) < 128) {
                            ((FocusTargetNode) objArr[(i10 << 3) + i12]).l2();
                        }
                        j10 >>= 8;
                    }
                    if (i11 != 8) {
                        break;
                    }
                }
                if (i10 == length) {
                    break;
                } else {
                    i10++;
                }
            }
        }
        this.f33162a.h();
        this.f33164c = false;
        this.f33163b.k();
    }

    public final m i(FocusTargetNode focusTargetNode) {
        return (m) this.f33162a.b(focusTargetNode);
    }

    public final void j(FocusTargetNode focusTargetNode, m mVar) {
        g0 g0Var = this.f33162a;
        if (mVar != null) {
            g0Var.r(focusTargetNode, mVar);
        } else {
            g2.a.c("requires a non-null focus state");
            throw new rm.k();
        }
    }
}
