/*
 * Decompiled with CFR 0.152.
 */
/*
 * Duplicate member names - consider using --renamedupmembers true
 */
public class bj
implements hh,
fh,
jq {
    private final bu a;
    private static bj e;
    public static int g;
    private hd f;
    private boolean g;
    public byte c;
    public boolean d;
    public String h;
    public gu i;
    public int j;

    public bj(bu bu2, boolean bl2) {
        this.a = bu2;
    }

    public bj(bu bu2) {
        this.a = bu2;
    }

    public void a(hd hd2) {
        this.d = false;
        hd2.b();
    }

    public void b(int n) {
        this.j = n;
        if (n >= 0) {
            if (this.c == 0) {
                this.c = 1;
            }
            return;
        }
        this.c = 0;
    }

    public String e() {
        if (!this.d) {
            String string = this.g ? lh.d(105) : null;
            this.h = string;
            this.g = false;
        } else {
            this.h = lh.d(119);
            this.g = true;
        }
        return this.h;
    }

    public boolean a(bj bj2) {
        boolean bl2;
        this.d = true;
        this.f = new hd(this);
        this.f.a(2000);
        if (bj2 instanceof ar) {
            ((ar)bj2).b = (byte)6;
        }
        if (bl2 = this.i.a(bj2, this.i.o())) {
            this.j = this.i.o() - 1;
        }
        return bl2;
    }

    public boolean u() {
        for (int i = 0; i < this.i.o(); ++i) {
            if (!(this.i.c(i) instanceof ar)) {
                continue;
            }
            return true;
        }
        return false;
    }

    public bj a(int n, boolean bl2) {
        if (this.i instanceof gu) {
            if (!bl2) {
                return this.i.d(n);
            }
            return this.i.c(n);
        }
        return this.i.c(n);
    }

    public final String Z() {
        if (!(this instanceof ar)) {
            if (!(this instanceof by)) {
                if (!(this instanceof gc)) {
                    if (!(this instanceof bp)) {
                        return "";
                    }
                    return "dw";
                }
                return "dt";
            }
            return "dd";
        }
        return "p";
    }

    public hh d() {
        if (this.j != -1) {
            bj bj2 = this.a(this.j, true);
            if (bj2 instanceof mo) {
                mo mo2 = (mo)bj2;
                mo2.b(0);
                return mo2;
            }
            return this;
        }
        return null;
    }

    public final void a(bj bj2) {
        if (this.u()) {
            this.i.a(bj2, this.j);
        }
    }

    public static bj a() {
        if (e == null) {
            e = new bj(false);
        }
        return e;
    }

    public pz c(int n) {
        bj bj2;
        if (n >= 0 && (bj2 = this.a(n, false)) instanceof ar) {
            return (ar)bj2;
        }
        return null;
    }

    public String v() {
        if (this.h != null) {
            return this.h;
        }
        return "";
    }

    public String G() {
        if (!this.u()) {
            return lh.d(420);
        }
        return lh.d(84);
    }

    public byte i() {
        return this.c;
    }

    public int w() {
        return this.j;
    }

    public int a() {
        return this.i.o();
    }

    public void t() {
        throw new IllegalStateException();
    }

    public void e(String string) {
        throw new IllegalStateException();
    }

    public void c(String string) {
        this.h = string;
    }

    public void a(byte by2) {
        this.c = by2;
    }

    public final void a(int n, gu gu2) {
        this.j = n;
        this.i = gu2;
    }

    public final void Y() {
        this.j = g;
        this.i = null;
    }

    public bj() {
        this.h = "";
        this.j = g;
    }

    public void a() {
        this.a.w.a(lh.d(176), 2);
    }

    public void c(int n) {
        this.a.w.a(lh.d(152), 0);
    }

    public void f(String string) {
        this.a.w.a(lh.d(228), 2);
        this.a.x().a(string);
        bu.b(this.a);
    }

    private bj(boolean bl2) {
        this.i = new gu(ps.a().j);
    }

    public pz j() {
        return this.c(this.j);
    }

    public bj b() {
        return this.a(this.j, false);
    }

    public int d(int n) {
        return n;
    }

    static {
        g = -1;
    }
}

