package n0;

import I0.AbstractC0303l;
import I0.H;
import androidx.compose.runtime.collection.MutableVector;
import java.util.Comparator;

/* JADX INFO: loaded from: classes.dex */
public final class F implements Comparator {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final F f21504a = new F();

    @Override // java.util.Comparator
    public final int compare(Object obj, Object obj2) {
        E e6 = (E) obj;
        E e7 = (E) obj2;
        int i6 = 0;
        if (AbstractC2603d.t(e6) && AbstractC2603d.t(e7)) {
            H hT = AbstractC0303l.t(e6);
            H hT2 = AbstractC0303l.t(e7);
            if (!kotlin.jvm.internal.o.c(hT, hT2)) {
                MutableVector mutableVector = new MutableVector(new H[16], 0);
                while (hT != null) {
                    mutableVector.add(0, hT);
                    hT = hT.t();
                }
                MutableVector mutableVector2 = new MutableVector(new H[16], 0);
                while (hT2 != null) {
                    mutableVector2.add(0, hT2);
                    hT2 = hT2.t();
                }
                int iMin = Math.min(mutableVector.getSize() - 1, mutableVector2.getSize() - 1);
                if (iMin >= 0) {
                    while (kotlin.jvm.internal.o.c(mutableVector.content[i6], mutableVector2.content[i6])) {
                        if (i6 != iMin) {
                            i6++;
                        }
                    }
                    return kotlin.jvm.internal.o.i(((H) mutableVector.content[i6]).u(), ((H) mutableVector2.content[i6]).u());
                }
                throw new IllegalStateException("Could not find a common ancestor between the two FocusModifiers.");
            }
        } else {
            if (AbstractC2603d.t(e6)) {
                return -1;
            }
            if (AbstractC2603d.t(e7)) {
                return 1;
            }
        }
        return 0;
    }
}
