package f;

import com.mstar.android.tv.TvLanguage;

/* JADX INFO: loaded from: classes.dex */
public class i implements InterfaceC0462h {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    final C0457c f3871b;

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

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

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

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

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    int[] f3876g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private C0455a f3877h = new C0455a();

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

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

    public i(C0457c c0457c, int i2, String str, String str2, String str3, String[] strArr) {
        if (c0457c.f3846q == null) {
            c0457c.f3846q = this;
        } else {
            c0457c.f3847r.f3870a = this;
        }
        c0457c.f3847r = this;
        this.f3871b = c0457c;
        this.f3872c = i2;
        this.f3873d = c0457c.h(str);
        this.f3874e = c0457c.h(str2);
        if (strArr == null || strArr.length <= 0) {
            return;
        }
        int length = strArr.length;
        this.f3875f = length;
        this.f3876g = new int[length];
        for (int i3 = 0; i3 < this.f3875f; i3++) {
            this.f3876g[i3] = c0457c.b(strArr[i3]).f3852a;
        }
    }

    @Override // f.InterfaceC0462h
    public void a(int i2, int i3) {
        this.f3877h.d(132).b(i2, i3);
    }

    @Override // f.InterfaceC0462h
    public void b(int i2, String str) {
        this.f3877h.c(i2, this.f3871b.b(str).f3852a);
    }

    @Override // f.InterfaceC0462h
    public void c(int i2, String str, String str2, String str3) {
        this.f3877h.c(i2, this.f3871b.d(str, str2, str3).f3852a);
    }

    @Override // f.InterfaceC0462h
    public void d(int i2, int i3) {
        this.f3877h.b(i2, i3);
    }

    @Override // f.InterfaceC0462h
    public void e(int i2) {
        this.f3877h.d(i2);
    }

    @Override // f.InterfaceC0462h
    public void f(int i2, int i3) {
        this.f3878i = i2;
        this.f3879j = i3;
    }

    @Override // f.InterfaceC0462h
    public void g(C0460f c0460f) {
        C0455a c0455a = this.f3877h;
        c0460f.c(this, c0455a.f3823b, c0455a.f3822a);
    }

    @Override // f.InterfaceC0462h
    public void h(int i2, int i3) {
        if (i3 < 4 && i2 != 169) {
            this.f3877h.d((i2 < 54 ? ((i2 - 21) << 2) + 26 : ((i2 - 54) << 2) + 59) + i3);
        } else if (i3 >= 256) {
            this.f3877h.d(TvLanguage.GOTHIC).c(i2, i3);
        } else {
            this.f3877h.b(i2, i3);
        }
    }

    @Override // f.InterfaceC0462h
    public void i(int i2, String str, String str2, String str3) {
        boolean z2 = i2 == 185;
        C0459e c0459eE = this.f3871b.e(str, str2, str3, z2);
        int iB = c0459eE.f3854c;
        if (!z2) {
            this.f3877h.c(i2, c0459eE.f3852a);
            return;
        }
        if (iB == 0) {
            iB = j.b(str3);
            c0459eE.f3854c = iB;
        }
        this.f3877h.c(TvLanguage.GALLEGAN, c0459eE.f3852a).b(iB >> 2, 0);
    }

    @Override // f.InterfaceC0462h
    public void j() {
    }

    @Override // f.InterfaceC0462h
    public void k(Object obj) {
        C0459e c0459eC = this.f3871b.c(obj);
        int i2 = c0459eC.f3852a;
        int i3 = c0459eC.f3853b;
        if (i3 == 5 || i3 == 6) {
            this.f3877h.c(20, i2);
        } else if (i2 >= 256) {
            this.f3877h.c(19, i2);
        } else {
            this.f3877h.b(18, i2);
        }
    }

    @Override // f.InterfaceC0462h
    public void l(int i2, C0460f c0460f) {
        if ((c0460f.f3861a & 2) != 0 && c0460f.f3862b - this.f3877h.f3823b < -32768) {
            throw new UnsupportedOperationException();
        }
        this.f3877h.d(i2);
        C0455a c0455a = this.f3877h;
        c0460f.b(this, c0455a, c0455a.f3823b - 1, i2 == 200);
    }

    final int m() {
        int i2;
        if (this.f3877h.f3823b > 0) {
            this.f3871b.h("Code");
            i2 = this.f3877h.f3823b + 26;
        } else {
            i2 = 8;
        }
        if (this.f3875f <= 0) {
            return i2;
        }
        this.f3871b.h("Exceptions");
        return i2 + (this.f3875f * 2) + 8;
    }

    final void n(C0455a c0455a) {
        c0455a.g(this.f3872c & (-393217)).g(this.f3873d).g(this.f3874e);
        int i2 = this.f3877h.f3823b > 0 ? 1 : 0;
        if (this.f3875f > 0) {
            i2++;
        }
        c0455a.g(i2);
        int i3 = this.f3877h.f3823b;
        if (i3 > 0) {
            c0455a.g(this.f3871b.h("Code")).f(i3 + 12);
            c0455a.g(this.f3878i).g(this.f3879j);
            C0455a c0455aF = c0455a.f(this.f3877h.f3823b);
            C0455a c0455a2 = this.f3877h;
            c0455aF.e(c0455a2.f3822a, 0, c0455a2.f3823b);
            c0455a.g(0);
            c0455a.g(0);
        }
        if (this.f3875f > 0) {
            c0455a.g(this.f3871b.h("Exceptions")).f((this.f3875f * 2) + 2);
            c0455a.g(this.f3875f);
            for (int i4 = 0; i4 < this.f3875f; i4++) {
                c0455a.g(this.f3876g[i4]);
            }
        }
    }
}
