/*
 * Decompiled with CFR 0.152.
 */
import java.io.ByteArrayOutputStream;
import java.io.DataInput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
import java.util.Vector;

public final class bz
extends ay
implements mt {
    private static final String A;
    private static final String B;
    private static final String C;
    private static final String D;
    private static final String E;
    private static final String F;
    private static final String G;
    private static final String H;
    private static final String I;
    private static final String J;
    private static final String K;
    private static final String L;
    private static final String M;
    private static final String N;
    private static final String O;
    private static final String P;
    private static final String Q;
    private static final String R;
    private static final String S;
    private static final String T;
    private static final String U;
    private static final String V;
    private static final String W;
    private static final String X;
    private static final String Y;
    private static final String Z;
    private static final String u;
    private static final String v;
    private static final String w;
    private static final String x;
    private static final String y;
    private static final String z;
    private static final w aG;
    private static final w aH;
    private static final w aI;
    private static final String aa;
    private static final String ab;
    private static final String ac;
    private static final String ad;
    private static final String ae;
    private static final String af;
    public static final String h;
    public static final String i;
    public static final String j;
    public static final String k;
    private final ck ai;
    private final lh aj;
    private int aA;
    private int aB;
    private int aC;
    private hx aD;
    private iy aE;
    private int aF;
    private gm aJ;
    private hv aK;
    private hv aL;
    private hv aM;
    private boolean ag;
    private boolean ah = false;
    private lh ak;
    private aq al;
    private bq am;
    private bq an;
    private iv ao;
    private long ap;
    private aq aq;
    private jp ar;
    private hv as;
    private hc at;
    private hc au;
    private Date av;
    private int aw;
    private bj ax;
    private int ay;
    private int az;
    public boolean l;
    public boolean m = true;
    public int n = -1;
    public int o;
    public int p;

    private static void b(String string) {
        me.a((short)4, "q", string);
    }

    private void s() {
        this.aA = -1;
        this.aB = -1;
        this.aC = -1;
        int n = 0;
        if (this.c(1)) {
            this.aA = 0;
            n = 0 + 1;
        }
        if (this.c(2)) {
            this.aB = n++;
        }
        if (this.c(4)) {
            this.aC = n;
        }
        n = "ja".equals(lh.o()) ? 2 : this.e(0);
        this.az = n;
        aa aa2 = lh.k().f();
        DataInput dataInput = nz.a(aa2, "tabFlagMemory");
        if (dataInput != null) {
            try {
                this.az = dataInput.readInt();
            }
            catch (IOException iOException) {
                aa2.b("tabFlagMemory");
            }
        }
        this.aq = new aq();
        this.n = -1;
        this.aw = 0;
        this.av = new Date();
        this.m = true;
        this.aF = 0;
    }

    public final void b() {
        super.b();
        this.n = -1;
        this.ax = null;
        aa aa2 = lh.k().f();
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);
        try {
            dataOutputStream.writeInt(this.az);
        }
        catch (IOException iOException) {
            aa2.b("tabFlagMemory");
        }
        aa2.b(byteArrayOutputStream.toByteArray(), "tabFlagMemory");
    }

    private void E() {
        int n = ps.a(this.f, this.f.r());
        this.f.k();
        int n2 = aG.a(ps.a('s'));
        int n3 = aG.a(ps.a('e'));
        int n4 = aG.a(ps.a('C'));
        int n5 = 4 + Math.max(Math.max(n2, n3), n4);
        if (ps.a(this.x())) {
            this.a(this.f, af + " " + '\u00bb', false, n5);
        }
        n2 = n5 - n2 - 4;
        hx hx2 = this.f;
        hx hx3 = this.f;
        String string = Q;
        w w2 = aG;
        String string2 = this.t() ? bz.a(this.u()) : v;
        n3 = n5 - n3 - 4;
        this.aK = this.a(hx2, this.a(hx3, string, n2, w2, -16777216, string2, n5, aI, -16621882));
        hx2 = this.f;
        hx3 = this.f;
        string = R;
        w2 = aG;
        string2 = this.v() ? bz.a(this.w()) : w;
        this.aL = this.a(hx2, this.a(hx3, string, n3, w2, -16777216, string2, n5, aI, -16621882));
        this.aM = null;
        if (this.az == 2 && mo.n()) {
            this.o = n5 - n4 - 4;
            this.p = n5;
            hx2 = this.f;
            hx3 = this.f;
            string = H;
            n3 = this.o;
            w2 = aG;
            if (!this.m) {
                string2 = "";
                switch (this.aw) {
                    case 0: {
                        string2 = C;
                        break;
                    }
                    case 2: {
                        string2 = E;
                        break;
                    }
                    case 1: {
                        string2 = B;
                    }
                }
                n2 = this.aw == 2 ? 1 : 0;
                string2 = ed.a(string2, this.b(n2 != 0));
            } else {
                string2 = D;
            }
            this.aM = this.a(hx2, this.a(hx3, string, n3, w2, -16777216, string2, this.p, aI, -16621882));
        }
        dz.a(this.f, 4);
        hx2 = this.f;
        string2 = this.az != 2 ? X : W;
        this.aJ = dz.a(hx2, string2);
        if (n == -1) {
            n = 0;
        }
        this.f.l(dz.a((fs)this.f, n));
    }

    private void z() {
        this.aE = this.s.b(false, false);
        this.aD = (hx)this.aE.a();
        switch (this.n) {
            case 9: {
                dz.a(this.aD, A, aG);
                this.an.e();
                dz.a(this.aD, Y, this.an, aI);
                dz.a(this.aD, Z, this.an, aI);
                dz.a(this.aD, aa, this.an, aI);
                this.an.a(this.aw).q_();
                dz.a(this.aD, 4);
                if (!this.A()) {
                    if (this.m) {
                        this.av = new Date();
                    }
                    Calendar calendar = Calendar.getInstance();
                    calendar.setTime(this.av);
                    Calendar calendar2 = calendar;
                    this.at = this.a(this.aD, ku.c(calendar2), 0, aI, -16621882);
                    this.as = this.a(this.aD, this.a(this.aD, y, 0, aG, -16777216, this.at));
                    this.au = this.a(this.aD, ku.b(calendar2), 0, aI, -16621882);
                    this.a(this.aD, this.a(this.aD, z, 0, aG, -16777216, this.au));
                } else {
                    this.ar = this.a(this.aD, this.b(false), false);
                }
                dz.a(this.aD, 4);
                dz.a(this.aD, x);
                if (!this.A()) {
                    this.aD.l(this.as);
                    return;
                }
                this.aD.l(this.ar);
            }
            default: {
                return;
            }
            case 7: {
                dz.a(this.aD, ps.a('s') + " " + v, aG);
                boolean bl2 = !this.v() || !this.w().d();
                this.a(bl2, this.aD);
                this.aD.s();
                return;
            }
            case 8: 
        }
        dz.a(this.aD, ps.a('e') + " " + w, aG);
        boolean bl3 = !this.t() || !this.u().d();
        this.a(bl3, this.aD);
        this.aD.s();
    }

    private void h(int n) {
        this.aF = n;
        switch (this.aF) {
            case 1: {
                this.g(10);
                if (this.m) {
                    this.av = new Date();
                }
                this.al.a(this.av);
                this.al.a(3);
                this.al.b();
                return;
            }
            case 3: 
            case 4: {
                String string;
                Calendar calendar = Calendar.getInstance();
                calendar.setTime(this.av);
                if (this.aF == 3) {
                    string = ku.c(calendar);
                    this.g(13);
                } else {
                    string = ku.b(calendar);
                    this.g(14);
                }
                this.am.a(string);
                this.am.a();
                return;
            }
            case 2: {
                fk fk2 = this.b(this.g(this.aD));
                if (bz.e(fk2)) {
                    this.e.a(fk2.b);
                    this.g(this.U());
                    this.e.a();
                }
            }
            default: {
                return;
            }
            case 0: 
        }
        this.e.a("");
        this.g(this.U());
        this.e.a();
    }

    /*
     * Enabled aggressive block sorting
     */
    public final void a(cq cq2, Object object) {
        if (jy.i.equals(cq2)) {
            switch (this.aF) {
                case 2: {
                    String string = this.e.b().trim();
                    String string2 = dz.d(this.aD);
                    if (!string.equals(string2)) {
                        this.d(fk.a(string2));
                        if (!ed.b(string)) {
                            this.c(fk.a(string));
                        }
                    }
                }
                case 0: {
                    String string = this.e.b().trim();
                    if (!ed.b(string)) {
                        this.f(fk.a(string));
                    }
                    this.g(0);
                    break;
                }
                case 3: 
                case 4: {
                    Date date = this.aF != 3 ? ku.b(this.am.b(), this.av) : ku.a(this.am.b(), this.av);
                    if (date != null) {
                        this.m = false;
                        this.av = date;
                        Calendar calendar = Calendar.getInstance();
                        calendar.setTime(this.av);
                        Calendar calendar2 = calendar;
                        this.at.a(ku.c(calendar2));
                        this.au.a(ku.b(calendar2));
                    }
                    this.n = 9;
                    break;
                }
                case 1: {
                    this.m = false;
                    this.av = this.al.b();
                    this.ar.a(this.b(false));
                    this.n = 9;
                    break;
                }
            }
            this.e.a("");
            return;
        } else {
            if (!jy.a.equals(cq2) && !jy.g.equals(cq2)) return;
            this.T();
            return;
        }
    }

    /*
     * Unable to fully structure code
     */
    private int e(Object var1_1) {
        this.ah = false;
        this.ak.b((String)null);
        switch (this.n) {
            case 0: {
                if (!(var1_1 instanceof pb)) ** GOTO lbl14
                if (((pb)var1_1).c != 20) {
                    var2_2 = this.g.a((pb)var1_1);
                } else {
                    var6_6 = this.aq.a;
                    this.aq.a = this.aq.b;
                    this.aq.b = var6_6;
                    this.E();
                    return 3;
lbl14:
                    // 1 sources

                    var2_2 = this.g.b((nj)var1_1);
                }
                switch (var2_2) {
                    case -3: {
                        var3_7 = dz.d(this.f);
                        var1_1 = this.f.r();
                        var2_2 = var1_1 != this.aK ? (var1_1 != this.aL ? (var1_1 != this.aM ? (!ed.b(var3_7) ? (var3_7.indexOf(bz.af) == -1 ? 3 : 4) : 3) : 2) : 1) : 0;
                        switch (var2_2) {
                            case 3: {
                                if (this.t()) {
                                    if (this.v()) {
                                        if (this.aJ != null) {
                                            this.f.l(this.aJ);
                                        }
                                        var2_2 = 3;
                                    } else {
                                        var2_2 = 1;
                                        this.K();
                                    }
                                } else {
                                    var2_2 = 0;
                                    this.J();
                                }
                                switch (var2_2) {
                                    default: {
                                        this.c(this.u());
                                        this.c(this.w());
                                        return 1;
                                    }
                                    case 0: 
                                    case 1: 
                                }
                                this.ah = true;
                                var5_8 = this.ak;
                                var3_7 = var2_2 != 0 ? bz.i : bz.h;
                                var5_8.b(var3_7);
                                return 3;
                            }
                            case 4: {
                                this.f(this.e((this.d(this.az) + 1) % this.x().e().size()));
                                return 3;
                            }
                            case 0: {
                                bz.b("s");
                                this.g(7);
                                return 3;
                            }
                            case 1: {
                                bz.b("e");
                                this.g(8);
                            }
                            default: lbl-1000:
                            // 4 sources

                            {
                                return 3;
                            }
                            case 2: 
                        }
                        bz.b("t");
                        this.g(9);
                        return 3;
                    }
                }
                this.f(this.e(this.x().b));
                return 3;
            }
            case 7: 
            case 8: 
            case 9: {
                var2_3 = var1_1 instanceof pb == false ? this.aE.b((nj)var1_1) : this.aE.a((pb)var1_1);
                switch (var2_3) {
                    case -4: {
                        if (this.n == 8 || this.n == 7) break;
                    }
                    case -3: {
                        if (this.n != 9) {
                            var2_3 = !bz.c(this.aD) ? (!this.b(this.aD) ? (!bz.M.equals(dz.d(this.aD)) ? (!bz.L.equals(dz.d(this.aD)) ? 4 : 0) : 3) : 1) : 2;
                        } else {
                            var2_3 = ps.a(this.aD, this.aD.r());
                            if (!this.A()) {
                                switch (var2_3) {
                                    default: {
                                        var2_3 = 6;
                                        break;
                                    }
                                    case 4: {
                                        var2_3 = 8;
                                        break;
                                    }
                                    case 3: {
                                        var2_3 = 7;
                                        break;
                                    }
                                }
                            } else {
                                switch (var2_3) {
                                    case 3: {
                                        var2_3 = 5;
                                        break;
                                    }
                                    default: {
                                        var2_3 = 6;
                                    }
                                }
                            }
                        }
                        if (var2_3 <= 4) {
                            if (!this.O()) {
                                var4_9 = this.n == 2 || this.n == 4 || this.n == 6 || this.n == 8 || this.n == 12;
                                if (var4_9) {
                                    me.a((short)4, "e", String.valueOf(var2_3));
                                }
                            } else {
                                me.a((short)4, "s", String.valueOf(var2_3));
                            }
                        }
                        switch (var2_3) {
                            default: {
                                ** GOTO lbl-1000
                            }
                            case 7: {
                                this.h(3);
                                return 3;
                            }
                            case 1: {
                                this.h(0);
                                return 3;
                            }
                            case 0: {
                                this.f(fk.b(this.aj.m()));
                                this.g(0);
                                return 3;
                            }
                            case 3: {
                                var2_3 = this.n == 7 ? 1 : 2;
                                this.g(var2_3);
                                return 3;
                            }
                            case 2: {
                                var2_3 = this.n != 7 ? 6 : 5;
                                this.g(var2_3);
                                return 3;
                            }
                            case 8: {
                                this.h(4);
                                return 3;
                            }
                            case 6: {
                                var2_3 = this.an.b();
                                if (var2_3 == this.aw) break;
                                this.m = false;
                                this.aw = var2_3;
                                break;
                            }
                            case 5: {
                                this.h(1);
                                return 3;
                            }
                            case 4: {
                                this.f(this.b(this.g(this.aD)));
                            }
                        }
                        this.g(0);
                        return 3;
                    }
                }
                this.h(2);
            }
            default: {
                return 4;
            }
            case 5: 
            case 6: {
                var2_4 = var1_1 instanceof pb != false ? this.q.d().a((pb)var1_1) : this.q.d().a((nj)var1_1);
                switch (var2_4) {
                    case 3: {
                        ** GOTO lbl-1000
                    }
                    default: {
                        ** continue;
                    }
                    case 2: {
                        return this.T();
                    }
                    case 1: 
                }
                this.ax = bj.a().b();
                bj.a().c = 0;
                if (this.ax instanceof ar) {
                    this.f(fk.b((ar)this.ax));
                }
                this.q.d().o();
                this.g(0);
                return 3;
            }
            case 1: 
            case 2: 
        }
        if (var1_1 instanceof pb && ((pb)var1_1).c != 7) {
            return 5;
        }
        this.f(fk.a(this.ai.d()));
        var2_5 = this.n == 1 ? 3 : 4;
        this.g(var2_5);
        return 3;
    }

    public final void a(mo mo2) {
        String string = null;
        this.b(mo2);
        switch (mo2.b) {
            case 3: {
                String string2 = null;
                if (!mo2.R()) {
                    if (mo2.S()) {
                        string2 = mo2.m.b;
                        this.K();
                    }
                } else {
                    this.J();
                    string2 = mo2.k.b;
                }
                if (ed.b(string2)) break;
                string = ed.a(ab, string2);
                break;
            }
            case 6: {
                if (this.aM != null) {
                    this.f.l(this.aM);
                }
                string = ae;
                break;
            }
            case 5: {
                this.J();
                string = ad;
                break;
            }
            default: {
                this.J();
                string = ac;
            }
        }
        if (!ed.b(string)) {
            this.ah = true;
            this.ak.b(string);
        }
    }

    private void g(int n) {
        if (this.n == 3 || this.n == 4) {
            this.ai.a(this.ao);
        }
        this.n = n;
        switch (this.n) {
            case 6: {
                this.q.d().a(I);
                break;
            }
            case 7: 
            case 8: 
            case 9: {
                this.z();
                break;
            }
            case 5: {
                this.q.d().a(J);
                break;
            }
            case 3: 
            case 4: {
                this.ao = this.ai.d();
                ck ck2 = this.ai;
                iv iv2 = this.n == 3 ? this.u().c : this.w().c;
                ck2.a(iv2);
                this.ap = System.currentTimeMillis() + (long)1000;
                break;
            }
            case 0: {
                this.E();
                break;
            }
            case -1: {
                this.o();
            }
        }
        if (this.n == 1) {
            this.ak.b(j);
            return;
        }
        if (this.n != 2) {
            this.ak.b((String)null);
            return;
        }
        this.ak.b(k);
    }

    public final void i() {
        d d2 = new d(ps.c, ps.d, this.s.n(), this.s.a(false), aH, false);
        Vector<ht> vector = new Vector<ht>();
        if (this.c(1)) {
            vector.addElement(new ht(ps.a((iy)d2), N, aH));
        }
        if (this.c(2)) {
            vector.addElement(new ht(ps.a((iy)d2), O, aH));
        }
        if (this.c(4)) {
            vector.addElement(new ht(ps.a((iy)d2), P, aH));
        }
        d2.a(vector);
        d2.a_(this.d(this.az));
        this.g = d2;
        this.f = (hx)d2.d();
        this.E();
    }

    private void f(int n) {
        if (this.az != n) {
            String string;
            this.az = n;
            switch (n) {
                case 4: {
                    string = "mw";
                    break;
                }
                case 2: {
                    string = "mt";
                    break;
                }
                default: {
                    string = "md";
                }
            }
            bz.b(string);
            this.x().a_(this.d(n));
            this.f = (hx)this.x().d();
            this.E();
        }
    }

    private void a(ht ht2, boolean bl2, boolean bl3) {
        oa oa2;
        if (this.t() && this.u().c != null && (!bl2 || this.n == 3)) {
            oa2 = this.ai.b(this.u().c);
            this.s.a(ht2, (byte)4, oa2.a, oa2.b, 0);
        }
        if (this.v() && this.w().c != null && (bl2 || this.n == 4)) {
            oa2 = this.ai.b(this.w().c);
            this.s.a(ht2, (byte)5, oa2.a, oa2.b, 0);
        }
        if (bl3) {
            oa2 = !bl2 ? this.ai.b(this.w().c) : this.ai.b(this.u().c);
            String string = !bl2 ? lh.d(93) : lh.d(482);
            ft ft2 = this.s.a(new String[]{string}, new w[]{this.d}, oa2.a, oa2.b);
            ft2.a(ht2, (this.s.n() - ft2.r) / 2, 0);
        }
    }

    /*
     * WARNING - void declaration
     * Enabled aggressive block sorting
     * Lifted jumps to return sites
     */
    public final void a(ht ht2) {
        void var2_11;
        void var2_8;
        switch (this.n) {
            case 0: {
                super.a(ht2);
                if (!this.ah) return;
                this.ak.a(ht2);
                return;
            }
            case 7: 
            case 8: 
            case 9: {
                this.aE.a(ht2, 0, 0);
                return;
            }
            case 5: 
            case 6: {
                this.q.d().a(ht2);
                return;
            }
            case 3: 
            case 4: {
                void var2_4;
                if (this.n != 3) {
                    boolean bl2 = false;
                } else {
                    boolean bl3 = true;
                }
                this.a(ht2, (boolean)var2_4, true);
            }
            default: {
                return;
            }
            case 1: 
            case 2: 
        }
        if (!this.ag) {
            if (this.n != 1) {
                int n = 60698;
            } else {
                int n = 60699;
            }
        } else {
            char c = ps.a(this.ai);
        }
        this.s.a(ht2, this.s.a / 2, this.s.b / 2, (char)var2_8);
        if (this.n != 1) {
            boolean bl4 = false;
        } else {
            boolean bl5 = true;
        }
        this.a(ht2, (boolean)var2_11, false);
    }

    public final boolean a(boolean bl2) {
        switch (this.n) {
            default: {
                return super.a(bl2);
            }
            case 7: 
            case 8: 
            case 9: {
                return this.a(this.aE);
            }
            case 5: 
            case 6: {
                return this.q.d().a(bl2);
            }
            case 3: 
            case 4: {
                if (this.ap >= System.currentTimeMillis()) break;
                this.g(0);
                return true;
            }
            case 1: 
            case 2: {
                if (!bl2) break;
                bl2 = !this.ag;
                this.ag = bl2;
                return true;
            }
            case 0: {
                super.a(bl2);
            }
        }
        return false;
    }

    private int T() {
        switch (this.n) {
            case 0: {
                bz.b("b");
                this.g(-1);
                return 2;
            }
            case 13: 
            case 14: {
                this.n = 9;
                return 3;
            }
            case 10: {
                this.n = 9;
            }
            case 3: 
            case 4: {
                return 3;
            }
            case 5: 
            case 6: {
                this.q.d().o();
                int n = this.n == 5 ? 7 : 8;
                this.n = n;
                return 3;
            }
            case 2: 
            case 12: {
                this.n = 8;
                return 3;
            }
            case 1: 
            case 11: {
                this.n = 7;
                return 3;
            }
        }
        this.g(0);
        return 3;
    }

    public final void g_() {
        super.g_();
        if (this.n != 5 && this.n != 6) {
            if (this.n == 7 || this.n == 8 || this.n == 9) {
                int n = -1;
                int n2 = -1;
                if (this.aD != null) {
                    n2 = this.aD.g(this.aD.q());
                    if (this.n == 9) {
                        n = this.an.b();
                    }
                }
                this.z();
                if (n2 != -1) {
                    this.aD.l(this.aD.h(n2));
                    if (n != -1) {
                        this.an.a(n).q_();
                    }
                }
            }
            return;
        }
        this.q.d().g_();
    }

    public final mo l() {
        if (this.t() && this.v()) {
            if (this.az == 2) {
                gc gc2 = new gc(this.aq, this.s.j);
                if (!this.m) {
                    gc2.e = this.av;
                    gc2.f = this.aw;
                }
                return gc2;
            }
            if (this.az == 4) {
                return new bp(this.aq);
            }
            return new by(this.aq);
        }
        throw new IllegalStateException("DirectionsWizard.getRequest() called too early!");
    }

    public final void a(aq aq2) {
        this.s();
        this.aq = aq2;
        if (this.aj.m() && this.aj.i() && !this.t()) {
            this.aq.a = fk.b(this.aj.m());
        }
        super.n();
    }

    private void a(boolean bl2, hx hx2) {
        if (this.aj.m() && bl2 && this.aj.i()) {
            this.a(hx2, L, false);
        }
        this.a(hx2, S, false);
        this.a(hx2, M, false);
        if (bj.a().u()) {
            this.e(hx2);
        }
        this.a(hx2);
    }

    public final int a(nj nj2) {
        if (this.n != 1 && this.n != 2 && this.n != 3 && this.n != 4) {
            if (!nj2.m()) {
                if (nj2.n()) {
                    return this.e(pb.a(3));
                }
                return this.e(nj2);
            }
            return this.e(pb.a(4));
        }
        return 5;
    }

    public final int a(pb pb2) {
        if (pb2.c == 8) {
            bz.b("b");
            return this.T();
        }
        return this.e(pb2);
    }

    private void f(fk fk2) {
        if (!this.O()) {
            this.aq.b = fk2;
            return;
        }
        this.aq.a = fk2;
    }

    private int d(int n) {
        switch (n) {
            case 2: {
                if (!this.c(2)) break;
                return this.aB;
            }
            case 4: {
                if (!this.c(4)) break;
                return this.aC;
            }
            case 1: {
                if (!this.c(1)) break;
                return this.aA;
            }
        }
        return 0;
    }

    private int e(int n) {
        if (n != this.aB) {
            if (n == this.aC) {
                return 4;
            }
            return 1;
        }
        return 2;
    }

    public final boolean o_() {
        return this.t && (this.n == 1 || this.n == 2);
    }

    private boolean O() {
        return this.n == 1 || this.n == 7 || this.n == 5 || this.n == 11 || this.n == 3;
    }

    private boolean A() {
        return this.al != null;
    }

    private boolean v() {
        return this.w() != null;
    }

    private boolean t() {
        return this.u() != null;
    }

    public final boolean g() {
        return this.n == -1;
    }

    private boolean c(int n) {
        return (this.ay & n) != 0;
    }

    public static boolean b(fk fk2) {
        return fk2 != null && !fk2.c() && !fk2.d();
    }

    public static int j() {
        int n = 0;
        if (gu.w()) {
            n = 1;
        }
        if (gu.k()) {
            n |= 2;
        }
        if (gu.m()) {
            return n | 4;
        }
        return n;
    }

    private int U() {
        switch (this.n) {
            case 7: {
                return 11;
            }
            case 8: {
                return 12;
            }
        }
        return 10;
    }

    public final cq d() {
        switch (this.n) {
            case 0: {
                return jy.a;
            }
            case 3: 
            case 4: {
                return null;
            }
        }
        return jy.g;
    }

    public static String a(fk fk2) {
        if (fk2 != null) {
            switch (fk2.a) {
                case 4: {
                    return fk2.e + " " + "\u0001\ued1f";
                }
                case 3: 
                case 5: {
                    if (ed.b(fk2.e)) {
                        if (!ed.b(fk2.b)) {
                            return fk2.b;
                        }
                        return G;
                    }
                    return fk2.e;
                }
                case 2: {
                    return K;
                }
                case 1: {
                    return G;
                }
            }
            return fk2.b;
        }
        return "";
    }

    static {
        u = lh.d(278);
        v = lh.d(34);
        w = lh.d(32);
        x = lh.d(43);
        y = lh.d(50);
        z = lh.d(518);
        A = lh.d(520);
        B = lh.d(10);
        C = lh.d(54);
        D = lh.d(55);
        E = lh.d(290);
        F = lh.d(519);
        h = lh.d(369);
        i = lh.d(368);
        G = lh.d(371);
        H = lh.d(52);
        I = lh.d(88);
        J = lh.d(477);
        K = lh.d(266);
        L = lh.d(574);
        M = lh.d(446);
        N = lh.d(78);
        O = lh.d(531);
        P = lh.d(581);
        Q = lh.d(481);
        R = lh.d(92);
        S = lh.d(94);
        T = lh.d(94) + " " + lh.d(3);
        U = lh.d(386);
        V = lh.d(385);
        W = lh.d(457);
        X = lh.d(455);
        Y = lh.d(57);
        Z = lh.d(9);
        aa = lh.d(289);
        ab = lh.d(26);
        ac = lh.d(334);
        ad = lh.d(341);
        ae = lh.d(342);
        af = lh.d(512);
        j = lh.d(447);
        k = lh.d(445);
        aI = jj.a(false);
        aG = jj.a();
        aH = jj.b();
    }

    public final void b(mo mo2) {
        int n = !(mo2 instanceof gc) ? (mo2 instanceof bp && gu.m() ? 4 : 1) : 2;
        this.a(mo2.P(), n);
    }

    private String b(boolean bl2) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(this.av);
        if (!bl2) {
            return ed.a(F, ku.a(calendar), ku.d(calendar));
        }
        return ku.d(calendar);
    }

    public final cq e() {
        switch (this.n) {
            default: {
                if (lh.t()) break;
                return jy.c;
            }
            case 3: 
            case 4: 
        }
        return null;
    }

    private fk u() {
        return this.aq.a;
    }

    private fk w() {
        return this.aq.b;
    }

    private d x() {
        return (d)this.g;
    }

    private void K() {
        this.f.l(this.aL);
    }

    private void J() {
        this.f.l(this.aK);
    }

    public final void a() {
        gu.d().n();
        super.a();
        this.h();
        this.g(0);
        this.l = this.v();
    }

    public final void a(aq aq2, int n) {
        this.az = n;
        this.aq = aq2;
        super.n();
    }

    public final void a(lk lk2) {
        new aq().c = lk2;
        this.a(new aq());
    }

    private hv a(hx hx2, gm gm2) {
        hv hv2 = new hv(0, 0, bz.f(hx2), gm2);
        hx2.d(hv2);
        return hv2;
    }

    private hc a(hx hx2, String string, int n, w w2, int n2) {
        new hc(n, 0, bz.f(hx2) - n - 8, w2, string).d = n2;
        return new hc(n, 0, bz.f(hx2) - n - 8, w2, string);
    }

    private dr a(hx hx2, String string, int n, w w2, int n2, String string2, int n3, w w3, int n4) {
        return this.a(hx2, string, n, w2, n2, this.a(hx2, string2, n3, w3, n4));
    }

    private dr a(hx hx2, String string, int n, w w2, int n2, hc hc2) {
        dr dr2 = new dr(false);
        dr2.d(this.a(hx2, string, n, w2, n2));
        dr2.d(hc2);
        return dr2;
    }

    public bz(eb eb2, ck ck2, lh lh2, hj hj2, lh lh3, bi bi2, int n) {
        super(eb2, hj2, S, T, U, V, "locationMemory", bi2);
        this.ai = ck2;
        this.aj = lh2;
        this.ak = lh3;
        this.ay = n;
        this.ag = false;
        this.an = new bq(false);
        lh lh4 = lh.k();
        px cfr_ignored_0 = lh4.a;
        this.al = lh.a(lh4).a(this, u, jy.i, jy.a);
        this.am = lh.k().i().a(this, "", jy.i, jy.a);
        this.am.b(4);
        this.s();
    }
}

