package f;

/* JADX INFO: renamed from: f.c, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public class C0457c {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    int f3831b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    final C0455a f3832c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    C0459e[] f3833d;

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    final C0459e f3835f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    final C0459e f3836g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    final C0459e f3837h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private int f3838i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private int f3839j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    String f3840k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    private int f3841l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    private int f3842m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    private int[] f3843n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    C0458d f3844o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    C0458d f3845p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    i f3846q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    i f3847r;

    public C0457c() {
        this(0);
    }

    private C0459e a(C0459e c0459e) {
        C0459e[] c0459eArr = this.f3833d;
        C0459e c0459e2 = c0459eArr[c0459e.f3859h % c0459eArr.length];
        while (c0459e2 != null && (c0459e2.f3853b != c0459e.f3853b || !c0459e.a(c0459e2))) {
            c0459e2 = c0459e2.f3860i;
        }
        return c0459e2;
    }

    private C0459e g(String str) {
        this.f3836g.c(8, str, null, null);
        C0459e c0459eA = a(this.f3836g);
        if (c0459eA != null) {
            return c0459eA;
        }
        this.f3832c.c(8, h(str));
        int i2 = this.f3831b;
        this.f3831b = i2 + 1;
        C0459e c0459e = new C0459e(i2, this.f3836g);
        i(c0459e);
        return c0459e;
    }

    private void i(C0459e c0459e) {
        if (this.f3831b > this.f3834e) {
            int length = this.f3833d.length;
            int i2 = (length * 2) + 1;
            C0459e[] c0459eArr = new C0459e[i2];
            for (int i3 = length - 1; i3 >= 0; i3--) {
                C0459e c0459e2 = this.f3833d[i3];
                while (c0459e2 != null) {
                    int i4 = c0459e2.f3859h % i2;
                    C0459e c0459e3 = c0459e2.f3860i;
                    c0459e2.f3860i = c0459eArr[i4];
                    c0459eArr[i4] = c0459e2;
                    c0459e2 = c0459e3;
                }
            }
            this.f3833d = c0459eArr;
            this.f3834e = (int) (((double) i2) * 0.75d);
        }
        int i5 = c0459e.f3859h;
        C0459e[] c0459eArr2 = this.f3833d;
        int length2 = i5 % c0459eArr2.length;
        c0459e.f3860i = c0459eArr2[length2];
        c0459eArr2[length2] = c0459e;
    }

    public C0459e b(String str) {
        this.f3836g.c(7, str, null, null);
        C0459e c0459eA = a(this.f3836g);
        if (c0459eA != null) {
            return c0459eA;
        }
        this.f3832c.c(7, h(str));
        int i2 = this.f3831b;
        this.f3831b = i2 + 1;
        C0459e c0459e = new C0459e(i2, this.f3836g);
        i(c0459e);
        return c0459e;
    }

    C0459e c(Object obj) {
        if (!(obj instanceof Integer)) {
            if (obj instanceof String) {
                return g((String) obj);
            }
            if (obj instanceof j) {
                j jVar = (j) obj;
                return b(jVar.f3889a == 10 ? jVar.f() : jVar.d());
            }
            throw new IllegalArgumentException("value " + obj);
        }
        int iIntValue = ((Integer) obj).intValue();
        this.f3835f.b(iIntValue);
        C0459e c0459eA = a(this.f3835f);
        if (c0459eA != null) {
            return c0459eA;
        }
        this.f3832c.d(3).f(iIntValue);
        int i2 = this.f3831b;
        this.f3831b = i2 + 1;
        C0459e c0459e = new C0459e(i2, this.f3835f);
        i(c0459e);
        return c0459e;
    }

    C0459e d(String str, String str2, String str3) {
        this.f3837h.c(9, str, str2, str3);
        C0459e c0459eA = a(this.f3837h);
        if (c0459eA != null) {
            return c0459eA;
        }
        int i2 = b(str).f3852a;
        this.f3832c.c(9, i2).g(f(str2, str3).f3852a);
        int i3 = this.f3831b;
        this.f3831b = i3 + 1;
        C0459e c0459e = new C0459e(i3, this.f3837h);
        i(c0459e);
        return c0459e;
    }

    C0459e e(String str, String str2, String str3, boolean z2) {
        int i2 = z2 ? 11 : 10;
        this.f3837h.c(i2, str, str2, str3);
        C0459e c0459eA = a(this.f3837h);
        if (c0459eA != null) {
            return c0459eA;
        }
        this.f3832c.c(i2, b(str).f3852a).g(f(str2, str3).f3852a);
        int i3 = this.f3831b;
        this.f3831b = i3 + 1;
        C0459e c0459e = new C0459e(i3, this.f3837h);
        i(c0459e);
        return c0459e;
    }

    public C0459e f(String str, String str2) {
        this.f3836g.c(12, str, str2, null);
        C0459e c0459eA = a(this.f3836g);
        if (c0459eA != null) {
            return c0459eA;
        }
        int iH = h(str);
        this.f3832c.c(12, iH).g(h(str2));
        int i2 = this.f3831b;
        this.f3831b = i2 + 1;
        C0459e c0459e = new C0459e(i2, this.f3836g);
        i(c0459e);
        return c0459e;
    }

    public int h(String str) {
        this.f3835f.c(1, str, null, null);
        C0459e c0459eA = a(this.f3835f);
        if (c0459eA == null) {
            this.f3832c.d(1).h(str);
            int i2 = this.f3831b;
            this.f3831b = i2 + 1;
            c0459eA = new C0459e(i2, this.f3835f);
            i(c0459eA);
        }
        return c0459eA.f3852a;
    }

    public byte[] j() {
        int iM = (this.f3842m * 2) + 24;
        int i2 = 0;
        for (C0458d c0458d = this.f3844o; c0458d != null; c0458d = c0458d.f3848a) {
            i2++;
            iM += c0458d.a();
        }
        int i3 = 0;
        for (i iVar = this.f3846q; iVar != null; iVar = iVar.f3870a) {
            i3++;
            iM += iVar.m();
        }
        C0455a c0455a = new C0455a(iM + this.f3832c.f3823b);
        c0455a.f(-889275714).f(this.f3830a);
        C0455a c0455aG = c0455a.g(this.f3831b);
        C0455a c0455a2 = this.f3832c;
        c0455aG.e(c0455a2.f3822a, 0, c0455a2.f3823b);
        c0455a.g(this.f3838i & (-393217)).g(this.f3839j).g(this.f3841l);
        c0455a.g(this.f3842m);
        for (int i4 = 0; i4 < this.f3842m; i4++) {
            c0455a.g(this.f3843n[i4]);
        }
        c0455a.g(i2);
        for (C0458d c0458d2 = this.f3844o; c0458d2 != null; c0458d2 = c0458d2.f3848a) {
            c0458d2.b(c0455a);
        }
        c0455a.g(i3);
        for (i iVar2 = this.f3846q; iVar2 != null; iVar2 = iVar2.f3870a) {
            iVar2.n(c0455a);
        }
        c0455a.g(0);
        return c0455a.f3822a;
    }

    public void k(int i2, int i3, String str, String str2, String[] strArr) {
        this.f3830a = i2;
        this.f3838i = i3;
        this.f3839j = b(str).f3852a;
        this.f3840k = str;
        this.f3841l = str2 == null ? 0 : b(str2).f3852a;
        if (strArr == null || strArr.length <= 0) {
            return;
        }
        int length = strArr.length;
        this.f3842m = length;
        this.f3843n = new int[length];
        for (int i4 = 0; i4 < this.f3842m; i4++) {
            this.f3843n[i4] = b(strArr[i4]).f3852a;
        }
    }

    private C0457c(int i2) {
        this.f3831b = 1;
        this.f3832c = new C0455a();
        C0459e[] c0459eArr = new C0459e[256];
        this.f3833d = c0459eArr;
        this.f3834e = (int) (((double) c0459eArr.length) * 0.75d);
        this.f3835f = new C0459e();
        this.f3836g = new C0459e();
        this.f3837h = new C0459e();
    }
}
