package y1;

import T0.H;
import android.graphics.Rect;
import java.util.Arrays;

/* JADX INFO: renamed from: y1.a, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1738a {

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int[] f18881d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f18882e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public int f18883f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public Rect f18884g;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final int[] f18878a = new int[4];

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

    public static int a(int[] iArr, int i) {
        return (i < 0 || i >= iArr.length) ? iArr[0] : iArr[i];
    }

    public static int c(int i, int i5) {
        return (i & 16777215) | ((i5 * 17) << 24);
    }

    public final void b(H h8, boolean z8, Rect rect, int[] iArr) {
        int i;
        int i5;
        int iWidth = rect.width();
        int iHeight = rect.height();
        int i8 = !z8 ? 1 : 0;
        int i9 = i8 * iWidth;
        while (true) {
            int i10 = 0;
            do {
                int i11 = 0;
                for (int i12 = 1; i11 < i12 && i12 <= 64; i12 <<= 2) {
                    if (h8.b() < 4) {
                        i = -1;
                        i5 = 0;
                        break;
                    }
                    i11 = (i11 << 4) | h8.i(4);
                }
                i = i11 & 3;
                i5 = i11 < 4 ? iWidth : i11 >> 2;
                int iMin = Math.min(i5, iWidth - i10);
                if (iMin > 0) {
                    int i13 = i9 + iMin;
                    Arrays.fill(iArr, i9, i13, this.f18878a[i]);
                    i10 += iMin;
                    i9 = i13;
                }
            } while (i10 < iWidth);
            i8 += 2;
            if (i8 >= iHeight) {
                return;
            }
            i9 = i8 * iWidth;
            h8.c();
        }
    }
}
