package com.bytedance.sdk.openadsdk.lse;

/* JADX INFO: loaded from: classes2.dex */
public final class ef {
    public static final ef fm = new ef(285, 256, 0);
    private final int ajl;
    private final int jnr;

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

    public ef(int i10, int i11, int i12) {
        this.jnr = i11;
        this.ajl = i12;
        this.ro = new int[i11];
        this.f7461lb = new int[i11];
        int i13 = 1;
        for (int i14 = 0; i14 < i11; i14++) {
            this.ro[i14] = i13;
            i13 *= 2;
            if (i13 >= i11) {
                i13 = (i13 ^ i10) & (i11 - 1);
            }
        }
        for (int i15 = 0; i15 < i11 - 1; i15++) {
            this.f7461lb[this.ro[i15]] = i15;
        }
        this.yz = new vt(this, new int[]{0});
    }

    public vt fm() {
        return this.yz;
    }

    public int lb(int i10, int i11) {
        if (i10 == 0 || i11 == 0) {
            return 0;
        }
        int[] iArr = this.ro;
        int[] iArr2 = this.f7461lb;
        return iArr[(iArr2[i10] + iArr2[i11]) % (this.jnr - 1)];
    }

    public int ro() {
        return this.ajl;
    }

    public static int ro(int i10, int i11) {
        return i10 ^ i11;
    }

    public vt fm(int i10, int i11) {
        if (i10 < 0) {
            throw new IllegalArgumentException();
        }
        if (i11 == 0) {
            return this.yz;
        }
        int[] iArr = new int[i10 + 1];
        iArr[0] = i11;
        return new vt(this, iArr);
    }

    public int ro(int i10) {
        if (i10 != 0) {
            return this.ro[(this.jnr - this.f7461lb[i10]) - 1];
        }
        throw new ArithmeticException();
    }

    public int fm(int i10) {
        return this.ro[i10];
    }
}
