package o;

import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.gms.common.ConnectionResult;
import java.util.Comparator;
import java.util.WeakHashMap;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.lA, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1746lA implements Comparator {
    public static final C1746lA b = new C1746lA(0);
    public static final C1746lA c = new C1746lA(1);
    public static final C1746lA d = new C1746lA(2);
    public static final C1746lA e = new C1746lA(3);
    public static final C1746lA f = new C1746lA(4);
    public static final /* synthetic */ C1746lA g = new C1746lA(14);
    public final /* synthetic */ int a;

    public /* synthetic */ C1746lA(int i) {
        this.a = i;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r5v4, types: [java.lang.Object, java.lang.Object[]] */
    /* JADX WARN: Type inference failed for: r5v9, types: [java.lang.Object, java.lang.Object[]] */
    @Override // java.util.Comparator
    public final int compare(Object obj, Object obj2) {
        int i = 0;
        switch (this.a) {
            case 0:
                C1556jA c1556jA = (C1556jA) obj;
                C1556jA c1556jA2 = (C1556jA) obj2;
                if (AbstractC0752ap.S(c1556jA) && AbstractC0752ap.S(c1556jA2)) {
                    C2420sK c2420sKS = AbstractC2539te.S(c1556jA);
                    C2420sK c2420sKS2 = AbstractC2539te.S(c1556jA2);
                    if (!F3.c(c2420sKS, c2420sKS2)) {
                        C2420sK[] c2420sKArr = new C2420sK[16];
                        int i2 = 0;
                        while (c2420sKS != null) {
                            int i3 = i2 + 1;
                            if (c2420sKArr.length < i3) {
                                int length = c2420sKArr.length;
                                ?? r5 = new Object[Math.max(i3, length * 2)];
                                System.arraycopy(c2420sKArr, 0, r5, 0, length);
                                c2420sKArr = r5;
                            }
                            if (i2 != 0) {
                                System.arraycopy(c2420sKArr, 0, c2420sKArr, 0 + 1, i2 + 0);
                            }
                            c2420sKArr[0] = c2420sKS;
                            i2++;
                            c2420sKS = c2420sKS.s();
                        }
                        C2420sK[] c2420sKArr2 = new C2420sK[16];
                        int i4 = 0;
                        while (c2420sKS2 != null) {
                            int i5 = i4 + 1;
                            if (c2420sKArr2.length < i5) {
                                int length2 = c2420sKArr2.length;
                                ?? r52 = new Object[Math.max(i5, length2 * 2)];
                                System.arraycopy(c2420sKArr2, 0, r52, 0, length2);
                                c2420sKArr2 = r52;
                            }
                            if (i4 != 0) {
                                System.arraycopy(c2420sKArr2, 0, c2420sKArr2, 0 + 1, i4 + 0);
                            }
                            c2420sKArr2[0] = c2420sKS2;
                            i4++;
                            c2420sKS2 = c2420sKS2.s();
                        }
                        int iMin = Math.min(i2 - 1, i4 - 1);
                        if (iMin >= 0) {
                            while (F3.c(c2420sKArr[i], c2420sKArr2[i])) {
                                if (i != iMin) {
                                    i++;
                                }
                            }
                            return F3.m(c2420sKArr[i].t(), c2420sKArr2[i].t());
                        }
                        throw new IllegalStateException("Could not find a common ancestor between the two FocusModifiers.");
                    }
                } else {
                    if (AbstractC0752ap.S(c1556jA)) {
                        return -1;
                    }
                    if (AbstractC0752ap.S(c1556jA2)) {
                        return 1;
                    }
                }
                return 0;
            case 1:
                T00 t00H = ((R50) obj).h();
                T00 t00H2 = ((R50) obj2).h();
                int iCompare = Float.compare(t00H.a, t00H2.a);
                if (iCompare != 0) {
                    return iCompare;
                }
                int iCompare2 = Float.compare(t00H.b, t00H2.b);
                if (iCompare2 != 0) {
                    return iCompare2;
                }
                int iCompare3 = Float.compare(t00H.d, t00H2.d);
                return iCompare3 != 0 ? iCompare3 : Float.compare(t00H.c, t00H2.c);
            case 2:
                C2420sK c2420sK = (C2420sK) obj;
                C2420sK c2420sK2 = (C2420sK) obj2;
                int iM = F3.m(c2420sK2.z, c2420sK.z);
                return iM != 0 ? iM : F3.m(c2420sK.hashCode(), c2420sK2.hashCode());
            case 3:
                T00 t00H3 = ((R50) obj).h();
                T00 t00H4 = ((R50) obj2).h();
                int iCompare4 = Float.compare(t00H4.c, t00H3.c);
                if (iCompare4 != 0) {
                    return iCompare4;
                }
                int iCompare5 = Float.compare(t00H3.b, t00H4.b);
                if (iCompare5 != 0) {
                    return iCompare5;
                }
                int iCompare6 = Float.compare(t00H3.d, t00H4.d);
                return iCompare6 != 0 ? iCompare6 : Float.compare(t00H4.a, t00H3.a);
            case 4:
                C3001yV c3001yV = (C3001yV) obj;
                C3001yV c3001yV2 = (C3001yV) obj2;
                int iCompare7 = Float.compare(((T00) c3001yV.l).b, ((T00) c3001yV2.l).b);
                return iCompare7 != 0 ? iCompare7 : Float.compare(((T00) c3001yV.l).d, ((T00) c3001yV2.l).d);
            case 5:
                return AbstractC2798wI.k(Integer.valueOf(((C0881c7) obj).b), Integer.valueOf(((C0881c7) obj2).b));
            case 6:
                return AbstractC2798wI.k(Integer.valueOf(((C0881c7) obj).b), Integer.valueOf(((C0881c7) obj2).b));
            case 7:
                String str = (String) obj;
                String str2 = (String) obj2;
                int iMin2 = Math.min(str.length(), str2.length());
                int i6 = 4;
                while (true) {
                    if (i6 >= iMin2) {
                        int length3 = str.length();
                        int length4 = str2.length();
                        if (length3 == length4) {
                            return 0;
                        }
                        if (length3 >= length4) {
                            return 1;
                        }
                    } else {
                        char cCharAt = str.charAt(i6);
                        char cCharAt2 = str2.charAt(i6);
                        if (cCharAt == cCharAt2) {
                            i6++;
                        } else if (F3.m(cCharAt, cCharAt2) >= 0) {
                            return 1;
                        }
                    }
                }
                return -1;
            case 8:
                WeakHashMap weakHashMap = Oj0.a;
                float fG = Gj0.g((View) obj);
                float fG2 = Gj0.g((View) obj2);
                if (fG > fG2) {
                    return -1;
                }
                return fG < fG2 ? 1 : 0;
            case ConnectionResult.SERVICE_INVALID /* 9 */:
                C2420sK c2420sK3 = (C2420sK) obj;
                C2420sK c2420sK4 = (C2420sK) obj2;
                int iM2 = F3.m(c2420sK3.z, c2420sK4.z);
                return iM2 != 0 ? iM2 : F3.m(c2420sK3.hashCode(), c2420sK4.hashCode());
            case 10:
                C2888xD c2888xD = (C2888xD) obj;
                C2888xD c2888xD2 = (C2888xD) obj2;
                RecyclerView recyclerView = c2888xD.d;
                if ((recyclerView == null) == (c2888xD2.d == null)) {
                    boolean z = c2888xD.a;
                    if (z == c2888xD2.a) {
                        int i7 = c2888xD2.b - c2888xD.b;
                        if (i7 != 0) {
                            return i7;
                        }
                        int i8 = c2888xD.c - c2888xD2.c;
                        if (i8 != 0) {
                            return i8;
                        }
                        return 0;
                    }
                    if (!z) {
                        return 1;
                    }
                } else if (recyclerView == null) {
                    return 1;
                }
                return -1;
            case ConnectionResult.LICENSE_CHECK_FAILED /* 11 */:
                return ((R90) obj).m - ((R90) obj2).m;
            case 12:
                return ((View) obj).getTop() - ((View) obj2).getTop();
            case 13:
                return AbstractC2798wI.k(((Zm0) obj).a, ((Zm0) obj2).a);
            default:
                return Long.compare(((Long) obj).longValue(), ((Long) obj2).longValue());
        }
    }
}
