/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  javax.microedition.lcdui.Graphics
 */
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Vector;
import javax.microedition.lcdui.Graphics;

/*
 * Duplicate member names - consider using --renamedupmembers true
 */
public final class ps
implements jf,
hh {
    private static int k;
    private static ps I;
    private static boolean a;
    private static String a;
    private static long c;
    private static iv d;
    private static String e;
    private static int f;
    private static int h;
    private static int i;
    private static int j;
    private static int m;
    private static int n;
    private static int p;
    private static int v;
    public static int c;
    public static int d;
    public static int e;
    public static le[] f;
    public static boolean i;
    private lc C;
    private w o;
    private lc s;
    private lc u;
    private lc A;
    private String B;
    private lc B;
    private lc D;
    private lc E;
    private lc F;
    private long G;
    private String p;
    private lc r;
    private lc t;
    private lc v;
    private ar[] w;
    private lc w;
    private int[] x;
    private lc x;
    private iv y;
    private lc y;
    private lc z;
    private int z;
    public int b;
    public String b;
    public lc k;
    public int o;
    public String s;
    public String u;
    public int a;
    public jt a;
    public String c;
    public String d;
    public boolean e;
    public String[] f;
    public int g;
    public w h;
    public boolean h;
    public cw i;
    public fu j;
    public int l;
    public br l;
    public lc l;
    public byte p;
    public String q;
    public int q;
    public String r;
    public int t;

    private static String A() {
        if (i) {
            return "arrows-big";
        }
        return "arrows-small";
    }

    private static String B() {
        if (i) {
            return "voice_search_bb_big";
        }
        return "voice_search_bb";
    }

    private static String F() {
        if (i) {
            return "friend_ff_user_hr";
        }
        return "friend_ff_user";
    }

    private static String y() {
        if (i) {
            return "ok-big";
        }
        return "ok";
    }

    private static String J() {
        if (!i) {
            return "friend_profile_med";
        }
        return "friend_profile_med_hr";
    }

    private static String C() {
        if (!i) {
            return "back_bb";
        }
        return "back_bb_big";
    }

    private static String G() {
        if (!i) {
            return "friend_icons";
        }
        return "friend_icons_hr";
    }

    private static String z() {
        if (!i) {
            return "keys";
        }
        return "keys-big";
    }

    public int z() {
        return 30;
    }

    public static int q() {
        return -22;
    }

    public static int u() {
        return 12;
    }

    public static int t() {
        return 12;
    }

    public static int f() {
        return f;
    }

    public static iv d() {
        return d;
    }

    public static String c() {
        return a;
    }

    public static String e() {
        return e;
    }

    public static hx a(iy iy2) {
        new hx(0, 0, iy2.x_(), iy2.c(), false).d = -3618616;
        new hx(0, 0, iy2.x_(), iy2.c(), false).e = -3618616;
        new hx(0, 0, iy2.x_(), iy2.c(), false).f = -16777216;
        new hx(0, 0, iy2.x_(), iy2.c(), false).g = -11842741;
        return new hx(0, 0, iy2.x_(), iy2.c(), false);
    }

    public static void a(ht ht2, oa oa2, int n, int n2, int n3, int n4) {
        ht2.b(n4);
        ht2.d(oa2.a, oa2.b, n, n2, 0, 360);
        ht2.b(n3);
        ht2.c(oa2.a, oa2.b, n, n2, 0, 360);
        ht2.a(0);
    }

    public final ft a(String[] stringArray, w[] wArray, int n, int n2) {
        ft ft2 = this.a(stringArray, wArray, -1);
        ft2.d(n, n2);
        return ft2;
    }

    public final ft a(gu gu2, int n) {
        return this.a(gu.a(gu2), gu.b(gu2), n);
    }

    private lc a(String string, String string2) {
        return new gu(this.b(string), string2);
    }

    public final ft b(boolean bl2, boolean bl3) {
        return this.a(bl2, bl3, false);
    }

    public static ps b(DataInput dataInput) {
        ps ps2 = new ps();
        ps2.a(dataInput);
        ps2.l = 2;
        ps2.b = -1;
        return ps2;
    }

    public ps a(int n) {
        return new ps(this, n);
    }

    private void a(lc lc2) {
        this.k = new oz(this.k, lc2);
    }

    public ps(int n, int n2, int n3) {
        this(n, n2, n3, false);
    }

    public final void a(ht ht2, int n, int n2) {
        this.G = System.currentTimeMillis();
        this.ad().a((char)(60716 + (int)(this.G / (long)256 % (long)3)), ht2, n, n2);
    }

    public final void a(char c, ht ht2, int n, int n2) {
        this.Y().a(c, ht2, n, n2);
    }

    private void b(ht ht2, int n, int n2, char c) {
        this.r.a(c, ht2, n - this.r.c(c) / 2, n2 - this.r.b(c) / 2);
    }

    public static void b(ht ht2, int n, int n2, int n3) {
        int n4 = n;
        while (n3 >= 0) {
            ht2.e(n4, n2 - n3, n, n2 - n3);
            ht2.e(n4, n2 + n3, n, n2 + n3);
            ++n;
            --n4;
            --n3;
        }
    }

    private le d(String string) {
        try {
            return lh.k().g().a(this.b(string));
        }
        catch (IOException iOException) {
            me.b("UI-UIHelper", iOException);
            return null;
        }
    }

    public iv n() {
        if (this.y == null) {
            return this.i.a;
        }
        return this.y;
    }

    public String q() {
        if (!ed.b(this.B)) {
            if (ar.i(this.B) && !ed.b(this.p)) {
                return this.p;
            }
            return this.B;
        }
        return null;
    }

    /*
     * WARNING - void declaration
     */
    public final int a(boolean bl2) {
        void var1_4;
        int n = this.b - d * 2 - this.g;
        if (bl2) {
            int n2 = this.o.l() + 4;
        } else {
            boolean bl3 = false;
        }
        return n - var1_4;
    }

    public final void a(ht ht2, cq cq2, cq cq3) {
        if (lh.t()) {
            a.a(ht2, -10784626, -12429967, 0, this.b - this.g, this.a, this.g);
            ht2.a(-11842741);
            ht2.e(this.a / 2, this.b - this.g, this.a / 2, this.b);
        }
        boolean bl2 = !lh.x;
        this.a(ht2, bl2, cq2);
        this.a(ht2, lh.x, cq3);
    }

    public final int a(cq cq2) {
        if (cq2 != null) {
            w w2 = lh.k().h().a(2, false, false, 0, false);
            if (!lh.t()) {
                return w2.a(cq2.g);
            }
            return this.a / 2;
        }
        return 0;
    }

    public ps(String string, cw cw2, ck ck2, int n, int n2, int n3, br br2) {
        int n4 = n == -1 ? ck2.k() : n * 10;
        n = n == -1 ? ck2.l() : (n *= 10);
        this(string, cw2, n4, n, n2, n3);
        this.l = br2;
    }

    public static void a(String string, iv iv2, String string2) {
        a = string;
        d = iv2;
        if (ed.b(string2)) {
            string2 = null;
        }
        e = string2;
    }

    private static void e() {
        long l = System.currentTimeMillis();
        if (l >= c) {
            Runtime runtime = Runtime.getRuntime();
            h = (int)runtime.freeMemory();
            i = (int)runtime.totalMemory();
            int n = (int)(System.currentTimeMillis() - l) < p ? j : k;
            c = l + (long)n;
        }
    }

    static {
        c = Long.MIN_VALUE;
        j = 200;
        k = 3000;
        p = 50;
        v = -1;
        m = 5;
        n = 5;
    }

    public static void b() {
        a = false;
        a = null;
        e = null;
        d = null;
        f = 0;
    }

    public static void b(boolean bl2) {
        a = bl2;
    }

    public static void a(int n) {
        f = n;
    }

    public static void a(ps ps2) {
        I = ps2;
    }

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

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

    public int a() {
        return this.w.length;
    }

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

    public int d(int n) {
        return this.x[n];
    }

    public static int c(int n) {
        return n + 512 >> 10;
    }

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

    private lc Q() {
        return this.a("clock", "C");
    }

    private lc P() {
        return this.a("arrow_in_directions", "\ued17");
    }

    private lc R() {
        return this.a("alert", "\ued3f");
    }

    private lc N() {
        return this.a("route_icon", "\ued16");
    }

    private lc O() {
        return this.a("external_warning", "\ued09");
    }

    private lc U() {
        return this.a(ps.F(), "u");
    }

    private lc T() {
        return this.a(ps.G(), "hf");
    }

    private lc K() {
        return this.a(ps.y(), "k");
    }

    private lc L() {
        return this.a(ps.z(), "0123456789*#\ued1f\ued20\ued21\ued0f\ued0c");
    }

    private lc M() {
        return this.a(ps.A(), "\ued25\ued24\ued22\ued23\ued29\ued28\ued26\ued27");
    }

    public int s() {
        return this.q / this.g();
    }

    public final int m() {
        return this.a(true) / 2;
    }

    public final int l() {
        return ft.c(this.m());
    }

    public boolean z_() {
        return true;
    }

    public boolean y_() {
        return true;
    }

    public boolean A_() {
        return false;
    }

    public static int p() {
        return 0;
    }

    public static int b() {
        ps.e();
        return i;
    }

    public static int e() {
        ps.e();
        return h;
    }

    public static int d() {
        ps.e();
        return (i - h) * 100 / i;
    }

    public static int c() {
        ps.e();
        return i - h;
    }

    public final int n() {
        return this.a - c * 2;
    }

    public final int h() {
        return this.l.b('\ued2f') + ps.k() * 2;
    }

    public final int j() {
        return (this.i() - this.l.c('\ued2f')) / 2;
    }

    public final int r() {
        return this.ad().c('\ued2c');
    }

    public ps() {
        this.w = new ar[0];
        this.f = new String[0];
        this.a = -1;
        this.u = "o";
    }

    public ps(ar[] arArray, String string, String string2, int n) {
        this.w = new ar[0];
        this.f = new String[0];
        this.a = -1;
        this.u = "o";
        this.w = arArray;
        this.w();
        this.d = string;
        this.b = string2;
        this.z = n;
    }

    private ps(ps ps2, int n) {
        this.w = new ar[0];
        this.f = new String[0];
        this.a = -1;
        this.u = "o";
        this.G = System.currentTimeMillis();
        this.b = ps2.b;
        this.i = ps2.i;
        this.g = ps2.g;
        this.o = ps2.o;
        this.l = ps2.l;
        this.q = n;
    }

    public ps(String string, cw cw2, int n, int n2, int n3, int n4) {
        this.w = new ar[0];
        this.f = new String[0];
        this.a = -1;
        this.u = "o";
        this.G = System.currentTimeMillis();
        this.q = 0;
        this.b = string;
        this.i = cw2;
        this.g = n2;
        this.o = n;
        this.l = n3;
        this.t = n4;
    }

    public ps(ar[] arArray, cw cw2, int n, int n2) {
        this.w = new ar[0];
        this.f = new String[0];
        this.a = -1;
        this.u = "o";
        this.l = 2;
        this.b = "";
        this.i = cw2;
        this.o = n;
        this.g = n2;
        this.w = arArray;
        this.w();
    }

    public final void a(int n, int n2) {
        this.a = n;
        this.b = n2;
        d = m;
        c = ps.n;
        if (this.b * this.a <= 57600) {
            d = 0;
            c = 0;
        }
    }

    public int g() {
        if (this.h && v != -1) {
            return v;
        }
        return 10;
    }

    public final boolean s() {
        return System.currentTimeMillis() - this.G > (long)256;
    }

    public static ps a() {
        if (I == null) {
            throw new IllegalStateException("No UIHelper instance available.");
        }
        return I;
    }

    public static char a(ck ck2) {
        if (ck2.m()) {
            return '\ued19';
        }
        return '\ued18';
    }

    public static boolean a(d d2) {
        if (d2.e().size() >= 2) {
            return ps.w();
        }
        return false;
    }

    public static String a(char c) {
        return String.valueOf('\u0001') + c;
    }

    private String c(String string) {
        return "hosted_images/" + string + ".png";
    }

    public final String b(String string) {
        return "/" + string + ".png";
    }

    public static String b(int n) {
        return "" + ps.c(n) + "KB";
    }

    public String a() {
        if (lh.r()) {
            return "q=" + ar.a(this.b);
        }
        return "";
    }

    public boolean a(short s) {
        ar ar2;
        if (this.b != -1 && (ar2 = (ar)this.j()).q() && !ar2.b(s)) {
            ar2.a(s);
            StringBuffer stringBuffer = new StringBuffer();
            stringBuffer.append(ar2.D()).append("@\u001f");
            stringBuffer.append(-1).append("@\u001f");
            stringBuffer.append(this.b).append("@\u001f");
            stringBuffer.append(this.b).append("@\u001f");
            stringBuffer.append(this.n().a).append("@\u001f");
            stringBuffer.append(this.n().b).append("@\u001f");
            me.a(s, "", stringBuffer.toString());
            return true;
        }
        return false;
    }

    public static int k() {
        if (lh.s()) {
            return 4;
        }
        return 0;
    }

    public static boolean w() {
        if (lh.t()) {
            return false;
        }
        return false;
    }

    public static boolean f() {
        return f != null && f.length == 2 && f[0] != null && f[1] != null;
    }

    public boolean l() {
        return this.z == 6;
    }

    public boolean b() {
        return this.z == 1;
    }

    public boolean g() {
        return this.z == 3;
    }

    public boolean m() {
        return this.d != null && !this.d.equals("");
    }

    public boolean e() {
        return !ed.b(this.q);
    }

    public static boolean a() {
        return a && !ed.b(a);
    }

    public boolean p() {
        return this.f != null && this.f.length > 0;
    }

    public boolean o() {
        return this.w != null && this.w.length > 0;
    }

    public pz c(int n) {
        if (n >= 0 && n < this.w.length) {
            return this.w[n];
        }
        return null;
    }

    public void a(boolean bl2) {
        for (int i = 0; i < this.w.length; ++i) {
            this.w[i].f = bl2;
        }
    }

    public static int a(fs fs2, gm gm2) {
        if (fs2.l() && gm2.b()) {
            int n = 0;
            int n2 = fs2.m();
            for (int i = 0; i < n2; ++i) {
                gm gm3 = fs2.h(i);
                if (gm3 != gm2) {
                    if (!gm3.b()) continue;
                    ++n;
                    continue;
                }
                return n;
            }
        }
        return -1;
    }

    private void w() {
        int n = this.w.length;
        this.x = new int[n];
        for (int i = 0; i < n; ++i) {
            int n2 = i;
            for (int k = 0; k <= i; ++k) {
                iv iv2 = this.w[this.x[k]].a();
                iv iv3 = this.w[i].a();
                if (k != i && (iv2 == null || iv3 == null || iv2.a >= iv3.a)) continue;
                int n3 = this.x[k];
                this.x[k] = n2;
                n2 = n3;
            }
        }
    }

    public gl[] r() {
        block3: {
            Vector<dm> vector = new Vector<dm>();
            for (int i = 0; i < this.w.length; ++i) {
                dm dm2 = this.w[i].c;
                if (dm2 != null) {
                    int n = dm2.a();
                    if (n != 2 && n != 3 || !((gl)((Object)dm2)).f()) continue;
                    vector.addElement(dm2);
                    continue;
                }
                break block3;
            }
            if (vector.size() != 0) {
                Object[] objectArray = new gl[vector.size()];
                vector.copyInto(objectArray);
                return objectArray;
            }
        }
        return null;
    }

    public void b(int n) {
        if (n != this.b) {
            if (this.p != 2) {
                if (this.p == 1) {
                    me.a((short)18, "1", String.valueOf(n));
                }
            } else {
                me.a((short)5, "1", String.valueOf(n));
            }
        }
        this.b = n;
        if (n >= 0) {
            if (this.p == 0) {
                this.p = 1;
            }
            return;
        }
        this.p = 0;
    }

    public int v() {
        int n = Integer.MAX_VALUE;
        if (this.a > 0) {
            n = this.a - (this.q + this.w.length);
        }
        return Math.min(n, this.g());
    }

    public final int i() {
        int n = lh.u() ? 6 : 5;
        int n2 = this.a > this.b ? this.b : this.a;
        return n2 / n;
    }

    private lc W() {
        block0: {
            if (this.s != null) break block0;
            String string = lh.u() ? "search_markers_big" : "search_markers";
            this.s = this.a(string, "\ued00\ued02\ued01\ued07\ued08");
        }
        return this.s;
    }

    private lc Y() {
        block0: {
            if (this.x != null) break block0;
            String string = !i ? "friend_placards" : "friend_placards_hr";
            this.x = this.a(string, "\ued40\ued41\ued42\ued43\ued44\ued45\ued46\ued47\ued48");
        }
        return this.x;
    }

    public final lc e() {
        block0: {
            if (this.A != null) break block0;
            String string = !i ? "friend_profile_sml" : "friend_profile_sml_hr";
            this.A = this.a(string, "\ued49\ued4a");
        }
        return this.A;
    }

    public final lc c() {
        block1: {
            if (!i) {
                return this.d();
            }
            if (this.y != null) break block1;
            String string = i ? "friend_profile_big_hr" : ps.J();
            this.y = this.a(string, "\ued49\ued4a");
        }
        return this.y;
    }

    public final lc d() {
        block0: {
            if (this.z != null) break block0;
            this.z = this.a(ps.J(), "\ued49\ued4a");
        }
        return this.z;
    }

    private lc ad() {
        block0: {
            if (this.E != null) break block0;
            this.E = this.a("loading", "\ued2c\ued2e\ued2d");
        }
        return this.E;
    }

    private lc aa() {
        block0: {
            if (this.F != null) break block0;
            this.F = this.a("ad_marker", "\ued1d\ued1e");
        }
        return this.F;
    }

    private lc Z() {
        block0: {
            if (this.t != null) break block0;
            this.t = this.a("inexact_marker", "\ued2a\ued2b");
        }
        return this.t;
    }

    private lc X() {
        block0: {
            if (this.w != null) break block0;
            this.w = this.a("star", "S");
        }
        return this.w;
    }

    public final void b(ht ht2, int n, int n2) {
        if (this.v == null) {
            this.v = this.a("red_x_small", "\ued1c");
        }
        this.v.a('\ued1c', ht2, n - 10, n2 - 6);
    }

    public final void a(ht ht2, int n, int n2, char c) {
        if (this.u == null) {
            this.u = this.a("target_strip", "\ued18\ued19\ued1b\ued1a");
        }
        lc lc2 = this.u;
        lc2.a(c, ht2, n - lc2.c(c) / 2, n2 - lc2.b(c) / 2);
    }

    /*
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    public final void a(ht ht2, byte by2, int n, int n2) {
        if (!lh.k().k()) return;
        switch (by2) {
            case 12: {
                lc lc2 = this.aa();
                lc2.a('\ued1e', ht2, n - lc2.c('\ued1e') + 6, n2 - lc2.b('\ued1e'));
                return;
            }
            case 15: {
                this.Z().a('\ued2b', ht2, n, n2 - 1);
                return;
            }
            case 10: {
                lc lc3 = this.W();
                lc3.a('\ued08', ht2, n - 1, n2 - lc3.b('\ued08'));
            }
            default: {
                return;
            }
            case 1: 
            case 11: 
            case 13: 
        }
        lc lc4 = this.W();
        lc4.a('\ued07', ht2, n - 1, n2 - lc4.b('\ued07'));
    }

    public final void a(ht ht2, byte by2, int n, int n2, int n3) {
        switch (by2) {
            case 15: {
                lc lc2 = this.Z();
                lc2.a('\ued2a', ht2, n - lc2.c('\ued2a') / 2, n2 - lc2.b('\ued2a') / 2);
                return;
            }
            case 12: {
                lc lc3 = this.aa();
                lc3.a('\ued1d', ht2, n - lc3.c('\ued1d') + 4, n2 - lc3.b('\ued1d'));
                return;
            }
            case 6: {
                lc lc4 = this.X();
                lc4.a('S', ht2, n - 15, n2 - lc4.b('S'));
            }
            default: {
                return;
            }
            case 5: {
                this.b(ht2, n, n2, 'e');
                return;
            }
            case 4: {
                this.b(ht2, n, n2, 's');
                return;
            }
            case 3: {
                this.b(ht2, n, n2, 't');
                return;
            }
            case 1: 
            case 2: 
            case 10: 
            case 11: 
            case 13: 
        }
        lc lc5 = this.W();
        switch (by2) {
            default: {
                by2 = (byte)60672;
                break;
            }
            case 11: {
                by2 = (byte)60674;
                break;
            }
            case 2: 
            case 10: {
                by2 = (byte)60673;
            }
        }
        lc5.a((char)by2, ht2, n - lc5.c((char)by2) / 2, n2 - lc5.b((char)by2));
    }

    public final void a(ht ht2, int n, int n2, int n3, boolean bl2) {
        lc lc2;
        if (bl2) {
            if (this.D == null) {
                this.D = this.a("streetview_arrows_full", "34567012");
            }
            lc2 = this.D;
        } else {
            if (this.C == null) {
                this.C = this.a("streetview_arrows", "34567012");
            }
            lc2 = this.C;
        }
        int n4 = lc2.c('0');
        int n5 = lc2.b('0');
        lc2.a((char)(48 + n3), ht2, n - n4 / 2, n2 - n5 / 2);
    }

    public final void a(ht ht2, int n, int n2, int n3) {
        if (this.B == null) {
            this.B = this.a("green_pointer_strip_small", "34567012");
        }
        lc lc2 = this.B;
        int n4 = lc2.c('0');
        int n5 = lc2.b('0');
        lc2.a((char)(48 + n3), ht2, n - n4 / 2, n2 - n5 / 2 - 2);
    }

    public void a(DataOutput dataOutput) {
        lk lk2 = new lk(la.j);
        lk2.b(2, this.b);
        lk2.h(1, this.l);
        lk2.h(4, this.q);
        lk2.h(5, 10);
        lk2.b(3, gu.a(this.n(), this.o, this.g, this.i.b.b));
        lk2.a(7, true);
        lk2.a(18, true);
        lk2.a(8, true);
        lk2.a(17, true);
        lk2.a(6, false);
        lk2.a(13, true);
        lk2.a(19, true);
        lk2.a(20, false);
        iv[] cfr_ignored_0 = gu.g().c;
        if (false) {
            lk2.a(14, true);
        }
        lk lk3 = new lk(la.q);
        ps ps2 = ps.a();
        lk3.h(1, ps2.n() - 20);
        lk3.h(2, ps2.a(false) - 20);
        lk3.a(18, false);
        lk3.a(16, 0);
        lk3.a(16, 2);
        lk3.h(3, Math.min((int)Runtime.getRuntime().freeMemory() / 1024 / 3, 100));
        lk2.b(12, lk3);
        lk2.h(16, this.t);
        dataOutput.writeInt(lk2.b());
        lk2.a((OutputStream)((Object)dataOutput));
    }

    public void b(DataOutput dataOutput) {
        String string;
        int n;
        lk lk2 = new lk(la.k);
        lk2.h(1, this.z);
        if (!ed.b(this.q)) {
            lk2.b(2, this.q);
        }
        lk2.b(3, this.b);
        if (!ed.b(this.d)) {
            lk2.b(6, this.d);
        }
        lk2.a(5, false);
        lk2.b(7, gu.a(this.n(), this.o, this.g, -1));
        for (n = 0; n < this.f.length; ++n) {
            lk2.a(10, this.f[n]);
        }
        lk2.h(11, this.q);
        for (n = 0; n < this.w.length; ++n) {
            lk2.a(8, this.w[n].a);
        }
        n = 0;
        lk lk3 = new lk(la.l);
        if (!ed.b(this.r)) {
            n = 1;
            lk3.b(2, this.r);
        }
        if (!ed.b(this.s)) {
            n = 1;
            lk3.b(7, this.s);
        }
        if (!ed.b(string = this.q())) {
            lk3.b(8, string);
            n = 1;
        }
        if (n != 0) {
            lk2.b(9, lk3);
        }
        dataOutput.writeInt(lk2.b());
        lk2.a((OutputStream)((Object)dataOutput));
    }

    public boolean a(DataInput dataInput) {
        lk lk2 = ar.a(la.k, dataInput);
        this.z = lk2.d(1);
        this.q = lk2.g(2);
        switch (this.z) {
            case 3: {
                this.q = "";
            }
            case 0: {
                if (lk2.h(5)) {
                    this.e = lk2.b(5);
                }
                if (lk2.h(6)) {
                    this.d = lk2.g(6);
                }
                if (lk2.h(4)) {
                    this.c = lk2.g(4);
                }
                if (lk2.h(3)) {
                    this.b = lk2.g(3);
                }
                lk lk3 = lk2.f(7);
                this.y = gu.a(lk3.f(1));
                this.o = lk3.d(2);
                this.g = lk3.d(3);
                this.h = false;
                if (lk2.h(9)) {
                    this.h = true;
                    lk lk4 = lk2.f(9);
                    this.r = ar.a(lk4, 2);
                    this.s = ar.a(lk4, 7);
                    if (!ed.b(this.b)) {
                        this.B = this.b;
                    }
                    this.p = ar.a(lk4, 8);
                }
                this.q = lk2.d(11);
                int n = lk2.h(13) ? lk2.d(13) : -1;
                this.a = n;
                int n2 = lk2.i(8);
                this.w = new ar[n2];
                for (n = 0; n < n2; ++n) {
                    try {
                        ar ar2 = ar.a(lk2.e(8, n));
                        if (ar2.s()) {
                            ar2.d(this.B);
                            ar2.e(this.r);
                            if (ed.b(ar2.L())) {
                                ar2.f(this.s);
                            }
                            if (ed.b(ar2.N())) {
                                ar2.g(this.p);
                            }
                        }
                        this.w[n] = ar2;
                        continue;
                    }
                    catch (OutOfMemoryError outOfMemoryError) {
                        nz.a();
                        this.w = null;
                        break;
                    }
                }
                if (this.o()) {
                    this.w();
                }
                n2 = lk2.i(10);
                this.f = new String[n2];
                for (n = 0; n < n2; ++n) {
                    this.f[n] = lk2.f(10, n);
                }
                if (v == -1 && this.h && this.q == 0 && this.w.length < this.a) {
                    v = this.w.length;
                }
                if (this.o()) break;
                this.z = 1;
                this.q = lh.d(556);
            }
        }
        if (this.G != 0L) {
            long l = System.currentTimeMillis() - this.G;
            me.a((short)22, "s", "" + l);
        }
        if (this.a != null) {
            this.a.a(this.l());
        }
        return true;
    }

    public final ft a(boolean bl2, boolean bl3) {
        ft ft2;
        int n = c;
        int n2 = d;
        int n3 = this.n();
        int n4 = this.a(bl2);
        bl2 = !bl3;
        ft ft3 = ft2;
        ft3(n, n2, n3, n4, bl2);
        return ft3;
    }

    /*
     * WARNING - void declaration
     */
    public final ft a(boolean bl2, boolean bl3, boolean bl4) {
        ft ft2;
        boolean bl5;
        int n;
        void var3_5;
        int n2 = this.a(bl2);
        if (var3_5 != false) {
            n = n2 - this.h();
        }
        int n3 = c;
        int n4 = d;
        int n5 = this.n();
        bl5 = !bl5;
        ft ft3 = ft2;
        ft3(n3, n4, n5, n, bl5);
        ft ft4 = ft3;
        ft4.b(ps.a(ft4));
        return ft4;
    }

    public final ft a(gm gm2) {
        ft ft2 = new ft(c, d, this.n(), this.m(), false);
        hx hx2 = ps.a(ft2);
        ft2.b(hx2);
        hx2.d(gm2);
        hx2.B();
        int n = gm2.r + (ft2.r - ft2.x_()) + 4;
        if (n < ft2.r) {
            ft2.l(n);
        }
        return ft2;
    }

    public final ft a(String[] stringArray, w[] wArray, int n) {
        ft ft2 = new ft(c, d, this.n(), this.m(), false);
        hx hx2 = ps.a(ft2);
        ft2.b(hx2);
        hc hc2 = null;
        int n2 = 0;
        for (int i = 0; i < stringArray.length; ++i) {
            hc hc3 = new hc(0, 0, hx2.a(), wArray[i], stringArray[i]);
            if (i == n) {
                hc2 = hc3;
            }
            hc3.d = wArray[i].t();
            hx2.d(hc3);
            hc3.j(2);
            n2 = Math.max(n2, hc3.d());
        }
        n = hx2.c.a.b();
        if (hc2 != null && ft2.c() < n) {
            hc2.b(true);
            hc2.a(1);
            n2 = Math.max(n2, hc2.d());
        }
        hx2.B();
        n = n2 + (ft2.r - ft2.x_()) + 4;
        if (n < ft2.r) {
            ft2.l(n);
        }
        return ft2;
    }

    public final void a(ht ht2, String string, boolean bl2) {
        int n;
        int n2;
        int n3 = this.a - 14;
        Object[] objectArray = ed.a(string, '\n');
        Vector<String> vector = new Vector<String>();
        for (n2 = 0; n2 < objectArray.length; ++n2) {
            String[] stringArray = bk.a(this.o, objectArray[n2], n3, 3, this.k);
            for (n = 0; n < stringArray.length; ++n) {
                vector.addElement(stringArray[n]);
            }
        }
        objectArray = new String[vector.size()];
        vector.copyInto(objectArray);
        if (objectArray.length != 0) {
            int[] nArray = bk.a(null, this.o, (String[])objectArray, 0, 0, this.k);
            int n4 = nArray[0] + 4;
            int n5 = nArray[1] + 4;
            int n6 = (this.a - n4) / 2;
            n2 = this.b - 4 - n5 - this.g;
            if (lh.t()) {
                n2 -= this.h();
            }
            n3 = bl2 ? -65536 : -16777216;
            n = !bl2 ? -3355648 : -1;
            int n7 = n4 + 1;
            n4 = n5 + 1;
            n5 = n6 + -1;
            int n8 = n2 + -1;
            Graphics graphics = ht2.a;
            graphics.setColor(-11842741);
            graphics.fillRoundRect(n6, n2, n7 + 1, n4 + 1, 8, 8);
            graphics.setColor(n);
            graphics.fillRoundRect(n5, n8, n7, n4, 8, 8);
            graphics.setColor(n3);
            graphics.drawRoundRect(n5, n8, n7, n4, 8, 8);
            ht2.a(n3);
            bk.a(ht2, this.o, (String[])objectArray, n6 + 2, n2 + 2, this.k, nArray);
        }
    }

    /*
     * WARNING - void declaration
     */
    public final void a(ht ht2, boolean bl2, cq cq2) {
        void var3_4;
        if (var3_4 != null) {
            String string = var3_4.g;
            String string2 = bl2 ? this.p : this.q;
            if (string2 != null) {
                string = string2 + string;
            }
            int n = this.h.a(string) + 3;
            int n2 = this.g;
            ht2.a(-1);
            if (lh.t()) {
                int n4 = (this.a / 2 - n) / 2;
                if (!bl2) {
                    n4 += this.a / 2;
                }
                int n3 = this.b - this.h.l() - (this.g - this.h.l()) / 2;
                bk.a(ht2, this.h, string, n4, n3, new int[2], this.k);
                return;
            }
            int n4 = !bl2 ? this.a - n : 0;
            ht2.c(n4 + 1, this.b - n2 + 1, n - 1, n2);
            ht2.a(-16777216);
            ht2.e(n4, this.b - n2 + 1, n4, this.b);
            ht2.e(n4 + 1, this.b - n2, n4 + n - 1, this.b - n2);
            ht2.e(n4 + n, this.b - n2 + 1, n4 + n, this.b);
            bk.a(ht2, this.h, string, n4 + 2, this.b - n2 + 2, new int[2], this.k);
        }
    }

    public final void a(String string) {
        String string2 = nz.b("RemoteImages");
        string2 = !ed.b(string2) ? string2 + string + '|' : string + '|';
        nz.a("RemoteImages", string2);
        if (string.equals(null)) {
            lh.k().f().h();
        }
        oz oz2 = (oz)this.k;
        lc lc2 = null;
        if (!string.equals(this.c(ps.z()))) {
            if (!string.equals(this.c(ps.y()))) {
                if (!string.equals(this.c(ps.A()))) {
                    if (!string.equals(this.c("external_warning"))) {
                        if (!string.equals(this.c("route_icon"))) {
                            if (!string.equals(this.c("clock"))) {
                                if (!string.equals(this.c("arrow_in_directions"))) {
                                    if (!string.equals(this.c(ps.B()))) {
                                        if (!string.equals(this.c(ps.C()))) {
                                            if (!string.equals(this.c(ps.G()))) {
                                                if (!string.equals(this.c(ps.F()))) {
                                                    if (string.equals(this.c("alert"))) {
                                                        lc2 = this.R();
                                                    }
                                                } else {
                                                    lc2 = this.U();
                                                }
                                            } else {
                                                lc2 = this.T();
                                            }
                                        } else {
                                            lc2 = this.a(ps.C(), "b");
                                        }
                                    } else {
                                        lc2 = this.a(ps.B(), "V");
                                    }
                                } else {
                                    lc2 = this.P();
                                }
                            } else {
                                lc2 = this.Q();
                            }
                        } else {
                            lc2 = this.N();
                        }
                    } else {
                        lc2 = this.O();
                    }
                } else {
                    lc2 = this.M();
                }
            } else {
                lc2 = this.K();
            }
        } else {
            lc2 = this.L();
        }
        if (lc2 != null) {
            oz2.a(lc2);
        }
    }

    public ps(int n, int n2, int n3, boolean bl2) {
        this.a = n;
        this.b = n2;
        m = n3;
        n = lh.k().h().a(2, false, false, 0, false).l() > 21 ? 1 : 0;
        i = n;
        if (lh.u()) {
            i = true;
        }
        n = !(i = false) ? 0 : 1;
        e = n;
        if (!lh.w) {
            lh lh2 = lh.k();
            n = !lh.t() ? 2 : 3;
            this.h = lh2.h().a(n, false, false, 0, false);
            this.g = this.h.l() + 2 + ps.k();
            if (lh.h == 113) {
                this.p = "\u0001l ";
                this.q = "\u0001r ";
            }
        } else {
            this.h = null;
            this.g = 0;
        }
        try {
            lh.k().g().a(this.b("darken_image"));
            this.o = lh.k().h().a(1, false, false, 0, false);
            this.k = new oz(this.K(), this.L());
            this.a(this.M());
            this.a(this.O());
            this.a(this.N());
            this.a(this.Q());
            this.a(this.P());
            this.a(this.R());
            this.r = new jt();
            this.a(this.r);
            this.j = new fu(50);
            this.a(this.j);
            this.a(new gu(this.b("blue_location"), "L"));
            this.a(this.T());
            this.a(this.U());
            n = !i ? 11 : 16;
            this.a(new gu(lh.k().g().a(n, n), '\ued3e'));
        }
        catch (IOException iOException) {
            throw new RuntimeException("darken_image");
        }
        if (lh.t()) {
            this.l = new gu(this.b("touchscreen_icons"), "\ued2f\ued31\ued37\ued35\ued33\ued39\ued30\ued32\ued38\ued36\ued34\ued3a");
            this.l = new oz(this.l, (lc)new gu(this.b("touchscreen_icon_glow"), "\ued3d"));
        } else {
            this.l = null;
        }
        f = new le[2];
        ps.f[0] = this.d("blue_location");
        ps.f[1] = this.d("grey_location");
    }

    /*
     * Handled duff style switch with additional control
     * WARNING - void declaration
     * Enabled aggressive block sorting
     */
    public final void a(boolean bl2, int n, ht ht2, int n2, int n3) {
        void var5_8;
        void var4_7;
        void var3_6;
        void var1_4;
        if (bl2) {
            int n4 = 60745;
        } else {
            int n5 = 60746;
        }
        int n6 = Integer.MIN_VALUE;
        block5: do {
            int n7;
            switch (n6 == Integer.MIN_VALUE ? n7 : n6) {
                case 2: {
                    n6 = 1;
                    if (!i) continue block5;
                    this.c().a((char)var1_4, (ht)var3_6, (int)var4_7, (int)var5_8);
                }
                default: {
                    return;
                }
                case 1: {
                    this.d().a((char)var1_4, (ht)var3_6, (int)var4_7, (int)var5_8);
                    return;
                }
                case 0: 
            }
            break;
        } while (true);
        this.e().a((char)var1_4, (ht)var3_6, (int)var4_7, (int)var5_8);
    }

    public final int a(int n) {
        switch (n) {
            case 2: {
                if (i) {
                    return this.c().b('\ued49');
                }
            }
            case 1: {
                return this.d().b('\ued49');
            }
            case 0: {
                return this.e().b('\ued49');
            }
        }
        return -1;
    }

    public final int b(int n) {
        switch (n) {
            case 2: {
                if (i) {
                    return this.c().c('\ued49');
                }
            }
            case 1: {
                return this.d().c('\ued49');
            }
            case 0: {
                return this.e().c('\ued49');
            }
        }
        return -1;
    }

    public final int b(byte by2) {
        switch (by2) {
            case 12: {
                return this.aa().c('\ued1d');
            }
            case 15: {
                return this.Z().c('\ued2a');
            }
            case 14: {
                return this.Y().c('\ued40');
            }
            case 11: {
                return this.W().c('\ued02');
            }
            case 6: {
                return this.X().c('S');
            }
            case 5: {
                return this.r.c('e');
            }
            case 4: {
                return this.r.c('s');
            }
            case 3: {
                return this.r.c('t');
            }
            case 2: 
            case 10: {
                return this.W().c('\ued01');
            }
            case 1: 
            case 13: {
                return this.W().c('\ued00');
            }
        }
        return 0;
    }

    public final int a(byte by2) {
        switch (by2) {
            case 6: {
                return this.X().b('S');
            }
            case 15: {
                return this.Z().b('\ued2a');
            }
            case 14: {
                return this.Y().b('\ued40');
            }
            case 12: {
                return this.aa().b('\ued1d');
            }
            case 11: {
                return this.W().b('\ued02');
            }
            case 5: {
                return this.r.b('e');
            }
            case 4: {
                return this.r.b('s');
            }
            case 3: {
                return this.r.b('t');
            }
            case 2: 
            case 10: {
                return this.W().b('\ued01');
            }
            case 1: 
            case 13: {
                return this.W().b('\ued00');
            }
        }
        return 0;
    }
}

