package M;

import java.util.Arrays;

/* JADX INFO: loaded from: classes.dex */
public class f {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final byte[] f1392b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private final byte[] f1393c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private final byte[] f1394d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private final byte[] f1395e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private final byte[] f1396f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private final byte[] f1397g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private final byte[] f1398h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private final boolean f1399i;

    public f(int i2, boolean z2) {
        this.f1391a = i2;
        this.f1399i = z2;
        this.f1392b = new byte[i2];
        this.f1393c = new byte[i2];
        this.f1394d = new byte[i2];
        this.f1395e = new byte[i2];
        this.f1396f = new byte[i2];
        this.f1397g = new byte[i2];
        this.f1398h = new byte[i2];
        int[] iArrA = b.a(0, 0, 0, z2);
        for (int i3 = 0; i3 < i2; i3++) {
            this.f1395e[i3] = 0;
            this.f1392b[i3] = 0;
            this.f1393c[i3] = 0;
            this.f1394d[i3] = 0;
            this.f1396f[i3] = (byte) iArrA[0];
            this.f1397g[i3] = (byte) iArrA[1];
            this.f1398h[i3] = (byte) iArrA[2];
        }
    }

    public int a(int i2) {
        return (this.f1394d[i2] & 255) | ((this.f1395e[i2] & 255) << 24) | ((this.f1392b[i2] & 255) << 16) | ((this.f1393c[i2] & 255) << 8);
    }

    public int b(int i2) {
        return this.f1395e[i2] & 255;
    }

    public byte[] c() {
        byte[] bArr = this.f1395e;
        return Arrays.copyOf(bArr, bArr.length);
    }

    public int d() {
        int i2 = 256;
        int i3 = 0;
        for (int i4 = 0; i4 < this.f1391a; i4++) {
            byte b2 = this.f1395e[i4];
            if ((b2 & 255) < i2) {
                int i5 = b2 & 255;
                if (i5 == 0) {
                    return i4;
                }
                i2 = i5;
                i3 = i4;
            }
        }
        return i3;
    }

    public int e() {
        return this.f1391a;
    }

    public byte[] f() {
        byte[] bArr = this.f1396f;
        return Arrays.copyOf(bArr, bArr.length);
    }

    public void g(int i2, int i3) {
        this.f1395e[i2] = (byte) i3;
    }

    public void h(int i2, int i3, int i4, int i5) {
        this.f1396f[i2] = (byte) i3;
        this.f1397g[i2] = (byte) i4;
        this.f1398h[i2] = (byte) i5;
        int[] iArrB = b.b(i3, i4, i5, this.f1399i);
        this.f1392b[i2] = (byte) iArrB[0];
        this.f1393c[i2] = (byte) iArrB[1];
        this.f1394d[i2] = (byte) iArrB[2];
    }
}
