package ub;

import androidx.media3.exoplayer.analytics.AnalyticsListener;
import defpackage.e;

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

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public static final a f33422h = new a(4201, 4096, 1);

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public static final a f33423i = new a(AnalyticsListener.EVENT_RENDERER_READY_CHANGED, 1024, 1);

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public static final a f33424j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public static final a f33425k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public static final a f33426l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public static final a f33427m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public static final a f33428n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public static final a f33429o;

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int[] f33431b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final b f33432c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final b f33433d;

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

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

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final int f33436g;

    static {
        a aVar = new a(67, 64, 1);
        f33424j = aVar;
        f33425k = new a(19, 16, 1);
        f33426l = new a(285, 256, 0);
        a aVar2 = new a(301, 256, 1);
        f33427m = aVar2;
        f33428n = aVar2;
        f33429o = aVar;
    }

    public a(int i10, int i11, int i12) {
        this.f33435f = i10;
        this.f33434e = i11;
        this.f33436g = i12;
        this.f33430a = new int[i11];
        this.f33431b = new int[i11];
        int i13 = 1;
        for (int i14 = 0; i14 < i11; i14++) {
            this.f33430a[i14] = i13;
            i13 *= 2;
            if (i13 >= i11) {
                i13 = (i13 ^ i10) & (i11 - 1);
            }
        }
        for (int i15 = 0; i15 < i11 - 1; i15++) {
            this.f33431b[this.f33430a[i15]] = i15;
        }
        this.f33432c = new b(this, new int[]{0});
        this.f33433d = new b(this, new int[]{1});
    }

    public final b a(int i10, int i11) {
        if (i10 < 0) {
            throw new IllegalArgumentException();
        }
        if (i11 == 0) {
            return this.f33432c;
        }
        int[] iArr = new int[i10 + 1];
        iArr[0] = i11;
        return new b(this, iArr);
    }

    public final int b(int i10) {
        if (i10 == 0) {
            throw new ArithmeticException();
        }
        return this.f33430a[(this.f33434e - this.f33431b[i10]) - 1];
    }

    public final int c(int i10, int i11) {
        if (i10 == 0 || i11 == 0) {
            return 0;
        }
        int[] iArr = this.f33431b;
        return this.f33430a[(iArr[i10] + iArr[i11]) % (this.f33434e - 1)];
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder("GF(0x");
        sb.append(Integer.toHexString(this.f33435f));
        sb.append(',');
        return e.l(sb, this.f33434e, ')');
    }
}
