package com.bytedance.sdk.openadsdk.lse;

import java.util.Arrays;

/* JADX INFO: loaded from: classes2.dex */
public final class ro {
    private int fm;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    private int f7470lb;
    private int ro;
    private int[] yz;

    public ro(int i10, int i11) {
        if (i10 <= 0 || i11 <= 0) {
            throw new IllegalArgumentException("Both dimensions must be greater than 0");
        }
        this.fm = i10;
        this.ro = i11;
        int i12 = (i10 + 31) / 32;
        this.f7470lb = i12;
        this.yz = new int[i12 * i11];
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof ro)) {
            return false;
        }
        ro roVar = (ro) obj;
        return this.fm == roVar.fm && this.ro == roVar.ro && this.f7470lb == roVar.f7470lb && Arrays.equals(this.yz, roVar.yz);
    }

    public boolean fm(int i10, int i11) {
        return ((this.yz[(i10 / 32) + (i11 * this.f7470lb)] >>> (i10 & 31)) & 1) != 0;
    }

    public int hashCode() {
        int i10 = this.fm;
        return Arrays.hashCode(this.yz) + (((((((i10 * 31) + i10) * 31) + this.ro) * 31) + this.f7470lb) * 31);
    }

    public void fm(int i10, int i11, int i12, int i13) {
        if (i11 < 0 || i10 < 0) {
            throw new IllegalArgumentException("Left and top must be nonnegative");
        }
        if (i13 <= 0 || i12 <= 0) {
            throw new IllegalArgumentException("Height and width must be at least 1");
        }
        int i14 = i12 + i10;
        int i15 = i13 + i11;
        if (i15 > this.ro || i14 > this.fm) {
            throw new IllegalArgumentException("The region must fit inside the matrix");
        }
        while (i11 < i15) {
            int i16 = this.f7470lb * i11;
            for (int i17 = i10; i17 < i14; i17++) {
                int[] iArr = this.yz;
                int i18 = (i17 / 32) + i16;
                iArr[i18] = iArr[i18] | (1 << (i17 & 31));
            }
            i11++;
        }
    }
}
