package n;

import a.AbstractC0386a;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.text.TextUtils;
import android.text.method.PasswordTransformationMethod;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.widget.TextView;
import d5.AbstractC0844a;
import java.lang.ref.WeakReference;
import java.util.Arrays;

/* JADX INFO: renamed from: n.E, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1187E {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public k7.i f14692b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public k7.i f14693c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public k7.i f14694d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public k7.i f14695e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public k7.i f14696f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public k7.i f14697g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public k7.i f14698h;
    public final C1197O i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public int f14699j = 0;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public int f14700k = -1;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public Typeface f14701l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public boolean f14702m;

    public C1187E(TextView textView) {
        this.f14691a = textView;
        this.i = new C1197O(textView);
    }

    public static k7.i c(Context context, C1228p c1228p, int i) {
        ColorStateList colorStateListI;
        synchronized (c1228p) {
            colorStateListI = c1228p.f14917a.i(context, i);
        }
        if (colorStateListI == null) {
            return null;
        }
        k7.i iVar = new k7.i();
        iVar.f14081b = true;
        iVar.f14082c = colorStateListI;
        return iVar;
    }

    public static void f(EditorInfo editorInfo, InputConnection inputConnection, TextView textView) {
        int i = Build.VERSION.SDK_INT;
        if (i >= 30 || inputConnection == null) {
            return;
        }
        CharSequence text = textView.getText();
        if (i >= 30) {
            O.b.a(editorInfo, text);
            return;
        }
        text.getClass();
        if (i >= 30) {
            O.b.a(editorInfo, text);
            return;
        }
        int i5 = editorInfo.initialSelStart;
        int i8 = editorInfo.initialSelEnd;
        int i9 = i5 > i8 ? i8 : i5;
        if (i5 <= i8) {
            i5 = i8;
        }
        int length = text.length();
        if (i9 < 0 || i5 > length) {
            O.c.a(editorInfo, null, 0, 0);
            return;
        }
        int i10 = editorInfo.inputType & 4095;
        if (i10 == 129 || i10 == 225 || i10 == 18) {
            O.c.a(editorInfo, null, 0, 0);
            return;
        }
        if (length <= 2048) {
            O.c.a(editorInfo, text, i9, i5);
            return;
        }
        int i11 = i5 - i9;
        int i12 = i11 > 1024 ? 0 : i11;
        int i13 = 2048 - i12;
        int iMin = Math.min(text.length() - i5, i13 - Math.min(i9, (int) (((double) i13) * 0.8d)));
        int iMin2 = Math.min(i9, i13 - iMin);
        int i14 = i9 - iMin2;
        if (Character.isLowSurrogate(text.charAt(i14))) {
            i14++;
            iMin2--;
        }
        if (Character.isHighSurrogate(text.charAt((i5 + iMin) - 1))) {
            iMin--;
        }
        int i15 = iMin2 + i12;
        O.c.a(editorInfo, i12 != i11 ? TextUtils.concat(text.subSequence(i14, i14 + iMin2), text.subSequence(i5, iMin + i5)) : text.subSequence(i14, i15 + iMin + i14), iMin2, i15);
    }

    public final void a(Drawable drawable, k7.i iVar) {
        if (drawable == null || iVar == null) {
            return;
        }
        C1228p.d(drawable, iVar, this.f14691a.getDrawableState());
    }

    public final void b() {
        k7.i iVar = this.f14692b;
        TextView textView = this.f14691a;
        if (iVar != null || this.f14693c != null || this.f14694d != null || this.f14695e != null) {
            Drawable[] compoundDrawables = textView.getCompoundDrawables();
            a(compoundDrawables[0], this.f14692b);
            a(compoundDrawables[1], this.f14693c);
            a(compoundDrawables[2], this.f14694d);
            a(compoundDrawables[3], this.f14695e);
        }
        if (this.f14696f == null && this.f14697g == null) {
            return;
        }
        Drawable[] drawableArrA = AbstractC1246z.a(textView);
        a(drawableArrA[0], this.f14696f);
        a(drawableArrA[2], this.f14697g);
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final void d(AttributeSet attributeSet, int i) {
        C1228p c1228p;
        boolean z8;
        boolean z9;
        String string;
        String string2;
        ColorStateList colorStateList;
        int resourceId;
        int i5;
        int resourceId2;
        TextView textView = this.f14691a;
        Context context = textView.getContext();
        PorterDuff.Mode mode = C1228p.f14915b;
        synchronized (C1228p.class) {
            try {
                if (C1228p.f14916c == null) {
                    C1228p.c();
                }
                c1228p = C1228p.f14916c;
            } catch (Throwable th) {
                throw th;
            }
        }
        int[] iArr = h.a.f13010f;
        com.google.android.material.datepicker.c cVarZ = com.google.android.material.datepicker.c.z(context, attributeSet, iArr, i);
        TextView textView2 = this.f14691a;
        M.J.i(textView2, textView2.getContext(), iArr, attributeSet, (TypedArray) cVarZ.f10220s, i);
        TypedArray typedArray = (TypedArray) cVarZ.f10220s;
        int resourceId3 = typedArray.getResourceId(0, -1);
        if (typedArray.hasValue(3)) {
            this.f14692b = c(context, c1228p, typedArray.getResourceId(3, 0));
        }
        if (typedArray.hasValue(1)) {
            this.f14693c = c(context, c1228p, typedArray.getResourceId(1, 0));
        }
        if (typedArray.hasValue(4)) {
            this.f14694d = c(context, c1228p, typedArray.getResourceId(4, 0));
        }
        if (typedArray.hasValue(2)) {
            this.f14695e = c(context, c1228p, typedArray.getResourceId(2, 0));
        }
        int i8 = Build.VERSION.SDK_INT;
        if (typedArray.hasValue(5)) {
            this.f14696f = c(context, c1228p, typedArray.getResourceId(5, 0));
        }
        if (typedArray.hasValue(6)) {
            this.f14697g = c(context, c1228p, typedArray.getResourceId(6, 0));
        }
        cVarZ.B();
        boolean z10 = textView.getTransformationMethod() instanceof PasswordTransformationMethod;
        int[] iArr2 = h.a.f13022s;
        if (resourceId3 != -1) {
            TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(resourceId3, iArr2);
            com.google.android.material.datepicker.c cVar = new com.google.android.material.datepicker.c(context, typedArrayObtainStyledAttributes);
            if (z10 || !typedArrayObtainStyledAttributes.hasValue(14)) {
                z8 = false;
                z9 = false;
            } else {
                z9 = typedArrayObtainStyledAttributes.getBoolean(14, false);
                z8 = true;
            }
            l(context, cVar);
            string2 = typedArrayObtainStyledAttributes.hasValue(15) ? typedArrayObtainStyledAttributes.getString(15) : null;
            string = (i8 < 26 || !typedArrayObtainStyledAttributes.hasValue(13)) ? null : typedArrayObtainStyledAttributes.getString(13);
            cVar.B();
        } else {
            z8 = false;
            z9 = false;
            string = null;
            string2 = null;
        }
        TypedArray typedArrayObtainStyledAttributes2 = context.obtainStyledAttributes(attributeSet, iArr2, i, 0);
        com.google.android.material.datepicker.c cVar2 = new com.google.android.material.datepicker.c(context, typedArrayObtainStyledAttributes2);
        if (!z10 && typedArrayObtainStyledAttributes2.hasValue(14)) {
            z9 = typedArrayObtainStyledAttributes2.getBoolean(14, false);
            z8 = true;
        }
        boolean z11 = z9;
        if (typedArrayObtainStyledAttributes2.hasValue(15)) {
            string2 = typedArrayObtainStyledAttributes2.getString(15);
        }
        String str = string2;
        if (i8 >= 26 && typedArrayObtainStyledAttributes2.hasValue(13)) {
            string = typedArrayObtainStyledAttributes2.getString(13);
        }
        if (i8 >= 28 && typedArrayObtainStyledAttributes2.hasValue(0) && typedArrayObtainStyledAttributes2.getDimensionPixelSize(0, -1) == 0) {
            textView.setTextSize(0, 0.0f);
        }
        l(context, cVar2);
        cVar2.B();
        if (!z10 && z8) {
            this.f14691a.setAllCaps(z11);
        }
        Typeface typeface = this.f14701l;
        if (typeface != null) {
            if (this.f14700k == -1) {
                textView.setTypeface(typeface, this.f14699j);
            } else {
                textView.setTypeface(typeface);
            }
        }
        if (string != null) {
            AbstractC1185C.d(textView, string);
        }
        if (str != null) {
            if (i8 >= 24) {
                AbstractC1184B.b(textView, AbstractC1184B.a(str));
            } else {
                AbstractC1246z.c(textView, AbstractC1183A.a(str.split(",")[0]));
            }
        }
        int[] iArr3 = h.a.f13011g;
        C1197O c1197o = this.i;
        Context context2 = c1197o.f14757j;
        TypedArray typedArrayObtainStyledAttributes3 = context2.obtainStyledAttributes(attributeSet, iArr3, i, 0);
        TextView textView3 = c1197o.i;
        M.J.i(textView3, textView3.getContext(), iArr3, attributeSet, typedArrayObtainStyledAttributes3, i);
        if (typedArrayObtainStyledAttributes3.hasValue(5)) {
            c1197o.f14749a = typedArrayObtainStyledAttributes3.getInt(5, 0);
        }
        float dimension = typedArrayObtainStyledAttributes3.hasValue(4) ? typedArrayObtainStyledAttributes3.getDimension(4, -1.0f) : -1.0f;
        float dimension2 = typedArrayObtainStyledAttributes3.hasValue(2) ? typedArrayObtainStyledAttributes3.getDimension(2, -1.0f) : -1.0f;
        float dimension3 = typedArrayObtainStyledAttributes3.hasValue(1) ? typedArrayObtainStyledAttributes3.getDimension(1, -1.0f) : -1.0f;
        if (typedArrayObtainStyledAttributes3.hasValue(3) && (resourceId2 = typedArrayObtainStyledAttributes3.getResourceId(3, 0)) > 0) {
            TypedArray typedArrayObtainTypedArray = typedArrayObtainStyledAttributes3.getResources().obtainTypedArray(resourceId2);
            int length = typedArrayObtainTypedArray.length();
            int[] iArr4 = new int[length];
            if (length > 0) {
                for (int i9 = 0; i9 < length; i9++) {
                    iArr4[i9] = typedArrayObtainTypedArray.getDimensionPixelSize(i9, -1);
                }
                c1197o.f14754f = C1197O.b(iArr4);
                c1197o.i();
            }
            typedArrayObtainTypedArray.recycle();
        }
        typedArrayObtainStyledAttributes3.recycle();
        if (!c1197o.j()) {
            c1197o.f14749a = 0;
        } else if (c1197o.f14749a == 1) {
            if (!c1197o.f14755g) {
                DisplayMetrics displayMetrics = context2.getResources().getDisplayMetrics();
                if (dimension2 == -1.0f) {
                    i5 = 2;
                    dimension2 = TypedValue.applyDimension(2, 12.0f, displayMetrics);
                } else {
                    i5 = 2;
                }
                if (dimension3 == -1.0f) {
                    dimension3 = TypedValue.applyDimension(i5, 112.0f, displayMetrics);
                }
                float f3 = dimension3;
                if (dimension == -1.0f) {
                    dimension = 1.0f;
                }
                c1197o.k(dimension2, f3, dimension);
            }
            c1197o.h();
        }
        if (X0.f14804a && c1197o.f14749a != 0) {
            int[] iArr5 = c1197o.f14754f;
            if (iArr5.length > 0) {
                if (AbstractC1185C.a(textView) != -1.0f) {
                    AbstractC1185C.b(textView, Math.round(c1197o.f14752d), Math.round(c1197o.f14753e), Math.round(c1197o.f14751c), 0);
                } else {
                    AbstractC1185C.c(textView, iArr5, 0);
                }
            }
        }
        TypedArray typedArrayObtainStyledAttributes4 = context.obtainStyledAttributes(attributeSet, iArr3);
        int resourceId4 = typedArrayObtainStyledAttributes4.getResourceId(8, -1);
        Drawable drawableA = resourceId4 != -1 ? c1228p.a(context, resourceId4) : null;
        int resourceId5 = typedArrayObtainStyledAttributes4.getResourceId(13, -1);
        Drawable drawableA2 = resourceId5 != -1 ? c1228p.a(context, resourceId5) : null;
        int resourceId6 = typedArrayObtainStyledAttributes4.getResourceId(9, -1);
        Drawable drawableA3 = resourceId6 != -1 ? c1228p.a(context, resourceId6) : null;
        int resourceId7 = typedArrayObtainStyledAttributes4.getResourceId(6, -1);
        Drawable drawableA4 = resourceId7 != -1 ? c1228p.a(context, resourceId7) : null;
        int resourceId8 = typedArrayObtainStyledAttributes4.getResourceId(10, -1);
        Drawable drawableA5 = resourceId8 != -1 ? c1228p.a(context, resourceId8) : null;
        int resourceId9 = typedArrayObtainStyledAttributes4.getResourceId(7, -1);
        Drawable drawableA6 = resourceId9 != -1 ? c1228p.a(context, resourceId9) : null;
        if (drawableA5 != null || drawableA6 != null) {
            Drawable[] drawableArrA = AbstractC1246z.a(textView);
            if (drawableA5 == null) {
                drawableA5 = drawableArrA[0];
            }
            if (drawableA2 == null) {
                drawableA2 = drawableArrA[1];
            }
            if (drawableA6 == null) {
                drawableA6 = drawableArrA[2];
            }
            if (drawableA4 == null) {
                drawableA4 = drawableArrA[3];
            }
            AbstractC1246z.b(textView, drawableA5, drawableA2, drawableA6, drawableA4);
        } else if (drawableA != null || drawableA2 != null || drawableA3 != null || drawableA4 != null) {
            Drawable[] drawableArrA2 = AbstractC1246z.a(textView);
            Drawable drawable = drawableArrA2[0];
            if (drawable == null && drawableArrA2[2] == null) {
                Drawable[] compoundDrawables = textView.getCompoundDrawables();
                if (drawableA == null) {
                    drawableA = compoundDrawables[0];
                }
                if (drawableA2 == null) {
                    drawableA2 = compoundDrawables[1];
                }
                if (drawableA3 == null) {
                    drawableA3 = compoundDrawables[2];
                }
                if (drawableA4 == null) {
                    drawableA4 = compoundDrawables[3];
                }
                textView.setCompoundDrawablesWithIntrinsicBounds(drawableA, drawableA2, drawableA3, drawableA4);
            } else {
                if (drawableA2 == null) {
                    drawableA2 = drawableArrA2[1];
                }
                Drawable drawable2 = drawableArrA2[2];
                if (drawableA4 == null) {
                    drawableA4 = drawableArrA2[3];
                }
                AbstractC1246z.b(textView, drawable, drawableA2, drawable2, drawableA4);
            }
        }
        if (typedArrayObtainStyledAttributes4.hasValue(11)) {
            if (!typedArrayObtainStyledAttributes4.hasValue(11) || (resourceId = typedArrayObtainStyledAttributes4.getResourceId(11, 0)) == 0 || (colorStateList = s7.d.p(context, resourceId)) == null) {
                colorStateList = typedArrayObtainStyledAttributes4.getColorStateList(11);
            }
            if (Build.VERSION.SDK_INT >= 24) {
                textView.setCompoundDrawableTintList(colorStateList);
            } else {
                ((P.l) textView).setSupportCompoundDrawablesTintList(colorStateList);
            }
        }
        if (typedArrayObtainStyledAttributes4.hasValue(12)) {
            PorterDuff.Mode modeB = S.b(typedArrayObtainStyledAttributes4.getInt(12, -1), null);
            if (Build.VERSION.SDK_INT >= 24) {
                textView.setCompoundDrawableTintMode(modeB);
            } else {
                ((P.l) textView).setSupportCompoundDrawablesTintMode(modeB);
            }
        }
        int dimensionPixelSize = typedArrayObtainStyledAttributes4.getDimensionPixelSize(15, -1);
        int dimensionPixelSize2 = typedArrayObtainStyledAttributes4.getDimensionPixelSize(18, -1);
        int dimensionPixelSize3 = typedArrayObtainStyledAttributes4.getDimensionPixelSize(19, -1);
        typedArrayObtainStyledAttributes4.recycle();
        if (dimensionPixelSize != -1) {
            W3.b.t(textView, dimensionPixelSize);
        }
        if (dimensionPixelSize2 != -1) {
            W3.b.u(textView, dimensionPixelSize2);
        }
        if (dimensionPixelSize3 != -1) {
            AbstractC0386a.i(dimensionPixelSize3);
            if (dimensionPixelSize3 != textView.getPaint().getFontMetricsInt(null)) {
                textView.setLineSpacing(dimensionPixelSize3 - r0, 1.0f);
            }
        }
    }

    public final void e(Context context, int i) {
        String string;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(i, h.a.f13022s);
        com.google.android.material.datepicker.c cVar = new com.google.android.material.datepicker.c(context, typedArrayObtainStyledAttributes);
        boolean zHasValue = typedArrayObtainStyledAttributes.hasValue(14);
        TextView textView = this.f14691a;
        if (zHasValue) {
            textView.setAllCaps(typedArrayObtainStyledAttributes.getBoolean(14, false));
        }
        int i5 = Build.VERSION.SDK_INT;
        if (typedArrayObtainStyledAttributes.hasValue(0) && typedArrayObtainStyledAttributes.getDimensionPixelSize(0, -1) == 0) {
            textView.setTextSize(0, 0.0f);
        }
        l(context, cVar);
        if (i5 >= 26 && typedArrayObtainStyledAttributes.hasValue(13) && (string = typedArrayObtainStyledAttributes.getString(13)) != null) {
            AbstractC1185C.d(textView, string);
        }
        cVar.B();
        Typeface typeface = this.f14701l;
        if (typeface != null) {
            textView.setTypeface(typeface, this.f14699j);
        }
    }

    public final void g(int i, int i5, int i8, int i9) {
        C1197O c1197o = this.i;
        if (c1197o.j()) {
            DisplayMetrics displayMetrics = c1197o.f14757j.getResources().getDisplayMetrics();
            c1197o.k(TypedValue.applyDimension(i9, i, displayMetrics), TypedValue.applyDimension(i9, i5, displayMetrics), TypedValue.applyDimension(i9, i8, displayMetrics));
            if (c1197o.h()) {
                c1197o.a();
            }
        }
    }

    public final void h(int[] iArr, int i) {
        C1197O c1197o = this.i;
        if (c1197o.j()) {
            int length = iArr.length;
            if (length > 0) {
                int[] iArrCopyOf = new int[length];
                if (i == 0) {
                    iArrCopyOf = Arrays.copyOf(iArr, length);
                } else {
                    DisplayMetrics displayMetrics = c1197o.f14757j.getResources().getDisplayMetrics();
                    for (int i5 = 0; i5 < length; i5++) {
                        iArrCopyOf[i5] = Math.round(TypedValue.applyDimension(i, iArr[i5], displayMetrics));
                    }
                }
                c1197o.f14754f = C1197O.b(iArrCopyOf);
                if (!c1197o.i()) {
                    throw new IllegalArgumentException("None of the preset sizes is valid: " + Arrays.toString(iArr));
                }
            } else {
                c1197o.f14755g = false;
            }
            if (c1197o.h()) {
                c1197o.a();
            }
        }
    }

    public final void i(int i) {
        C1197O c1197o = this.i;
        if (c1197o.j()) {
            if (i == 0) {
                c1197o.f14749a = 0;
                c1197o.f14752d = -1.0f;
                c1197o.f14753e = -1.0f;
                c1197o.f14751c = -1.0f;
                c1197o.f14754f = new int[0];
                c1197o.f14750b = false;
                return;
            }
            if (i != 1) {
                throw new IllegalArgumentException(AbstractC0844a.j("Unknown auto-size text type: ", i));
            }
            DisplayMetrics displayMetrics = c1197o.f14757j.getResources().getDisplayMetrics();
            c1197o.k(TypedValue.applyDimension(2, 12.0f, displayMetrics), TypedValue.applyDimension(2, 112.0f, displayMetrics), 1.0f);
            if (c1197o.h()) {
                c1197o.a();
            }
        }
    }

    public final void j(ColorStateList colorStateList) {
        if (this.f14698h == null) {
            this.f14698h = new k7.i();
        }
        k7.i iVar = this.f14698h;
        iVar.f14082c = colorStateList;
        iVar.f14081b = colorStateList != null;
        this.f14692b = iVar;
        this.f14693c = iVar;
        this.f14694d = iVar;
        this.f14695e = iVar;
        this.f14696f = iVar;
        this.f14697g = iVar;
    }

    public final void k(PorterDuff.Mode mode) {
        if (this.f14698h == null) {
            this.f14698h = new k7.i();
        }
        k7.i iVar = this.f14698h;
        iVar.f14083d = mode;
        iVar.f14080a = mode != null;
        this.f14692b = iVar;
        this.f14693c = iVar;
        this.f14694d = iVar;
        this.f14695e = iVar;
        this.f14696f = iVar;
        this.f14697g = iVar;
    }

    public final void l(Context context, com.google.android.material.datepicker.c cVar) {
        String string;
        int i = this.f14699j;
        TypedArray typedArray = (TypedArray) cVar.f10220s;
        this.f14699j = typedArray.getInt(2, i);
        int i5 = Build.VERSION.SDK_INT;
        if (i5 >= 28) {
            int i8 = typedArray.getInt(11, -1);
            this.f14700k = i8;
            if (i8 != -1) {
                this.f14699j &= 2;
            }
        }
        if (!typedArray.hasValue(10) && !typedArray.hasValue(12)) {
            if (typedArray.hasValue(1)) {
                this.f14702m = false;
                int i9 = typedArray.getInt(1, 1);
                if (i9 == 1) {
                    this.f14701l = Typeface.SANS_SERIF;
                    return;
                } else if (i9 == 2) {
                    this.f14701l = Typeface.SERIF;
                    return;
                } else {
                    if (i9 != 3) {
                        return;
                    }
                    this.f14701l = Typeface.MONOSPACE;
                    return;
                }
            }
            return;
        }
        this.f14701l = null;
        int i10 = typedArray.hasValue(12) ? 12 : 10;
        int i11 = this.f14700k;
        int i12 = this.f14699j;
        if (!context.isRestricted()) {
            try {
                Typeface typefaceV = cVar.v(i10, this.f14699j, new C1245y(this, i11, i12, new WeakReference(this.f14691a)));
                if (typefaceV != null) {
                    if (i5 < 28 || this.f14700k == -1) {
                        this.f14701l = typefaceV;
                    } else {
                        this.f14701l = AbstractC1186D.a(Typeface.create(typefaceV, 0), this.f14700k, (this.f14699j & 2) != 0);
                    }
                }
                this.f14702m = this.f14701l == null;
            } catch (Resources.NotFoundException | UnsupportedOperationException unused) {
            }
        }
        if (this.f14701l != null || (string = typedArray.getString(i10)) == null) {
            return;
        }
        if (Build.VERSION.SDK_INT < 28 || this.f14700k == -1) {
            this.f14701l = Typeface.create(string, this.f14699j);
        } else {
            this.f14701l = AbstractC1186D.a(Typeface.create(string, 0), this.f14700k, (this.f14699j & 2) != 0);
        }
    }
}
