private UserLocale findBestMatch(String s)
    {
        Object obj = null;
        UserLocale auserlocale[] = toUserLocales(s);
        if (auserlocale.length < 1)
        {
            Log.w("nf_loc", "Empty list of preferred languages, set default");
            return null;
        }
        int i = 0;
        s = obj;
        do
        {
            if (i >= auserlocale.length)
            {
                break;
            }
            if (Log.isLoggable("nf_loc", 3))
            {
                Log.d("nf_loc", (new StringBuilder()).append("Choice #").append(i).append(": ").append(auserlocale[i]).toString());
            }
            for (int j = 0; j < supportedLocales.length;)
            {
                Object obj1;
label0:
                {
                    if (Log.isLoggable("nf_loc", 3))
                    {
                        Log.d("nf_loc", (new StringBuilder()).append("Try to match by locale with #").append(j).append(": ").append(supportedLocales[j]).toString());
                    }
                    obj1 = s;
                    if (auserlocale[i] == null)
                    {
                        break label0;
                    }
                    if (!auserlocale[i].equals(supportedLocales[j]))
                    {
                        obj1 = s;
                        if (!auserlocale[i].equalsByLanguage(supportedLocales[j]))
                        {
                            break label0;
                        }
                    }
                    if (Log.isLoggable("nf_loc", 3))
                    {
                        Log.d("nf_loc", (new StringBuilder()).append("Match by locale with #").append(j).append(": ").append(supportedLocales[j]).toString());
                    }
                    if (auserlocale[i].equals(supportedLocales[j]))
                    {
                        Log.d("nf_loc", (new StringBuilder()).append("Perfect Match by locale with #").append(j).append(": ").append(supportedLocales[j]).toString());
                        return supportedLocales[j];
                    }
                    obj1 = s;
                    if (s == null)
                    {
                        obj1 = supportedLocales[j];
                    }
                }
                j++;
                s = ((String) (obj1));
            }

            i++;
        } while (true);
        Log.i("nf_loc", (new StringBuilder()).append("findBestMatch: ").append(s).toString());
        return s;
    }