package J2;

import java.util.Iterator;

/* JADX INFO: renamed from: J2.f, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0408f implements InterfaceC0406e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final int f3376a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int f3377b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final boolean f3378c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final boolean f3379d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final String f3380e;

    public C0408f(int i6, int i7, boolean z6, boolean z7, String str) {
        this.f3376a = i6;
        this.f3377b = i7;
        this.f3378c = z6;
        this.f3379d = z7;
        this.f3380e = str;
    }

    /* JADX WARN: Removed duplicated region for block: B:33:0x0064 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:34:0x0065 A[RETURN] */
    @Override // J2.InterfaceC0406e
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean a(AbstractC0399a0 abstractC0399a0) {
        int i6;
        int i7;
        boolean z6 = this.f3379d;
        String strM = this.f3380e;
        if (z6 && strM == null) {
            strM = abstractC0399a0.m();
        }
        Y y6 = abstractC0399a0.f3371b;
        if (y6 != null) {
            Iterator it = y6.getChildren().iterator();
            i7 = 0;
            i6 = 0;
            while (it.hasNext()) {
                AbstractC0399a0 abstractC0399a02 = (AbstractC0399a0) ((AbstractC0403c0) it.next());
                if (abstractC0399a02 == abstractC0399a0) {
                    i7 = i6;
                }
                if (strM == null || abstractC0399a02.m().equals(strM)) {
                    i6++;
                }
            }
        } else {
            i6 = 1;
            i7 = 0;
        }
        int i8 = this.f3378c ? i7 + 1 : i6 - i7;
        int i9 = this.f3376a;
        int i10 = this.f3377b;
        if (i9 == 0) {
            return i8 == i10;
        }
        int i11 = i8 - i10;
        if (i11 % i9 != 0 || (Integer.signum(i11) != 0 && Integer.signum(i11) != Integer.signum(i9))) {
        }
    }

    public final String toString() {
        String str = this.f3378c ? "" : "last-";
        boolean z6 = this.f3379d;
        int i6 = this.f3377b;
        int i7 = this.f3376a;
        return z6 ? String.format("nth-%schild(%dn%+d of type <%s>)", str, Integer.valueOf(i7), Integer.valueOf(i6), this.f3380e) : String.format("nth-%schild(%dn%+d)", str, Integer.valueOf(i7), Integer.valueOf(i6));
    }
}
