// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/i18n/translator.cpp
// Function: smooth::I18n::Translator::GetUserDefaultLanguageCode()
S::String S::I18n::Translator::GetUserDefaultLanguageCode()
{
	String	 code;

#if defined __WIN32__
	LANGID	 langid = GetUserDefaultLangID();

	switch (PRIMARYLANGID(langid))
	{
		case LANG_ENGLISH:	code = "en";	if	(SUBLANGID(langid) == SUBLANG_ENGLISH_AUS)		  code = "en_AU";
							else if (SUBLANGID(langid) == SUBLANG_ENGLISH_CAN)		  code = "en_CA";
							else if (SUBLANGID(langid) == SUBLANG_ENGLISH_NZ)		  code = "en_NZ";
							else if (SUBLANGID(langid) == SUBLANG_ENGLISH_US)		  code = "en_US";
							else if (SUBLANGID(langid) == SUBLANG_ENGLISH_UK)		  code = "en_UK";
							break;
		case LANG_AFRIKAANS:	code = "af";	break;
		case LANG_ALBANIAN:	code = "sq";	break;
		case LANG_AMHARIC:	code = "am";	break;
		case LANG_ARABIC:	code = "ar";	if	(SUBLANGID(langid) == SUBLANG_ARABIC_ALGERIA)		  code = "ar_DZ";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_BAHRAIN)		  code = "ar_BH";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_EGYPT)		  code = "ar_EG";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_IRAQ)		  code = "ar_IQ";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_JORDAN)		  code = "ar_JO";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_KUWAIT)		  code = "ar_KW";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_LEBANON)		  code = "ar_LB";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_LIBYA)		  code = "ar_LY";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_MOROCCO)		  code = "ar_MO";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_OMAN)		  code = "ar_OM";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_QATAR)		  code = "ar_QA";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_SAUDI_ARABIA)	  code = "ar_SA";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_SYRIA)		  code = "ar_SY";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_TUNISIA)		  code = "ar_TN";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_UAE)		  code = "ar_AE";
							else if (SUBLANGID(langid) == SUBLANG_ARABIC_YEMEN)		  code = "ar_YE";
							break;
		case LANG_ARMENIAN:	code = "hy";	break;
		case LANG_ASSAMESE:	code = "as";	break;
		case LANG_AZERI:	code = "az";	if	(SUBLANGID(langid) == SUBLANG_AZERI_LATIN)		  code = "az_AZ@Latn";
							else if (SUBLANGID(langid) == SUBLANG_AZERI_CYRILLIC)		  code = "az_AZ@Cyrl";
							break;
		case LANG_BANGLA:	code = "bn";	if	(SUBLANGID(langid) == SUBLANG_BANGLA_BANGLADESH)	  code = "bn_BD";
							else if (SUBLANGID(langid) == SUBLANG_BANGLA_INDIA)		  code = "bn_IN";
							break;
		case LANG_BASQUE:	code = "eu";	break;
		case LANG_BELARUSIAN:	code = "be";	break;
		case LANG_BRETON:	code = "br";	break;
		case LANG_BULGARIAN:	code = "bg";	break;
		case LANG_CATALAN:	code = "ca";	break;
		case LANG_CHINESE:	code = "zh_TW";	if	(SUBLANGID(langid) == SUBLANG_CHINESE_SIMPLIFIED)	  code = "zh_CN";
							else if (SUBLANGID(langid) == SUBLANG_CHINESE_TRADITIONAL)	  code = "zh_TW";
							else if (SUBLANGID(langid) == SUBLANG_CHINESE_HONGKONG)		  code = "zh_HK";
							else if (SUBLANGID(langid) == SUBLANG_CHINESE_MACAU)		  code = "zh_MO";
							else if (SUBLANGID(langid) == SUBLANG_CHINESE_SINGAPORE)	  code = "zh_SG";
							break;
		case LANG_CORSICAN:	code = "co";	break;
		case LANG_CZECH:	code = "cs";	break;
		case LANG_DANISH:	code = "da";	break;
		case LANG_DARI:		code = "prs";	break;
		case LANG_DIVEHI:	code = "dv";	break;
		case LANG_DUTCH:	code = "nl";	if	(SUBLANGID(langid) == SUBLANG_DUTCH)			  code = "nl_NL";
							else if (SUBLANGID(langid) == SUBLANG_DUTCH_BELGIAN)		  code = "nl_BE";
							break;
		case LANG_ESTONIAN:	code = "et";	break;
		case LANG_FILIPINO:	code = "fil";	break;
		case LANG_FINNISH:	code = "fi";	break;
		case LANG_FRENCH:	code = "fr";	if	(SUBLANGID(langid) == SUBLANG_FRENCH)			  code = "fr_FR";
							else if (SUBLANGID(langid) == SUBLANG_FRENCH_BELGIAN)		  code = "fr_BE";
							else if (SUBLANGID(langid) == SUBLANG_FRENCH_CANADIAN)		  code = "fr_CA";
							else if (SUBLANGID(langid) == SUBLANG_FRENCH_LUXEMBOURG)	  code = "fr_LU";
							else if (SUBLANGID(langid) == SUBLANG_FRENCH_MONACO)		  code = "fr_MC";
							else if (SUBLANGID(langid) == SUBLANG_FRENCH_SWISS)		  code = "fr_CH";
							break;
		case LANG_GALICIAN:	code = "gl";	break;
		case LANG_GEORGIAN:	code = "ka";	break;
		case LANG_GERMAN:	code = "de";	break;
		case LANG_GREEK:	code = "el";	break;
		case LANG_GUJARATI:	code = "gu";	break;
		case LANG_HAUSA:	code = "ha";	break;
		case LANG_HEBREW:	code = "he";	break;
		case LANG_HINDI:	code = "hi";	break;
		case LANG_HUNGARIAN:	code = "hu";	break;
		case LANG_ICELANDIC:	code = "is";	break;
		case LANG_IGBO:		code = "ig";	break;
		case LANG_INDONESIAN:	code = "id";	break;
		case LANG_IRISH:	code = "ga";	break;
		case LANG_ITALIAN:	code = "it";	break;
		case LANG_JAPANESE:	code = "ja";	break;
		case LANG_KANNADA:	code = "kn";	break;
		case LANG_KAZAK:	code = "kk";	break;
		case LANG_KHMER:	code = "kh";	break;
		case LANG_KINYARWANDA:	code = "rw";	break;
		case LANG_KOREAN:	code = "ko";	break;
		case LANG_KYRGYZ:	code = "ky";	break;
		case LANG_LAO:		code = "lo";	break;
		case LANG_LATVIAN:	code = "lv";	break;
		case LANG_LITHUANIAN:	code = "lt";	break;
		case LANG_LUXEMBOURGISH:code = "lb";	break;
		case LANG_MACEDONIAN:	code = "mk";	break;
		case LANG_MALAY:	code = "ms";	break;
		case LANG_MALAYALAM:	code = "ml";	break;
		case LANG_MALTESE:	code = "mt";	break;
		case LANG_MAORI:	code = "mi";	break;
		case LANG_MARATHI:	code = "mr";	break;
		case LANG_MONGOLIAN:	code = "mn";	break;
		case LANG_NEPALI:	code = "ni";	break;
		case LANG_NORWEGIAN:	code = "no";	break;
		case LANG_OCCITAN:	code = "oc";	break;
		case LANG_ORIYA:	code = "or";	break;
		case LANG_PASHTO:	code = "ps";	break;
		case LANG_PERSIAN:	code = "fa";	break;
		case LANG_POLISH:	code = "pl";	break;
		case LANG_PORTUGUESE:	code = "pt";	if	(SUBLANGID(langid) == SUBLANG_PORTUGUESE)		  code = "pt_PT";
							else if (SUBLANGID(langid) == SUBLANG_PORTUGUESE_BRAZILIAN)	  code = "pt_BR";
							break;
		case LANG_PULAR:	code = "ff";	break;
		case LANG_PUNJABI:	code = "pa";	if	(SUBLANGID(langid) == SUBLANG_PUNJABI_INDIA)		  code = "pa_IN";
							else if (SUBLANGID(langid) == SUBLANG_PUNJABI_PAKISTAN)		  code = "pa_PK";
							break;
		case LANG_QUECHUA:	code = "quz";	break;
		case LANG_ROMANIAN:	code = "ro";	break;
		case LANG_RUSSIAN:	code = "ru";	break;
		case LANG_SERBIAN:	code = "sr";	if	(SUBLANGID(langid) == SUBLANG_CROATIAN_CROATIA)		  code = "hr_HR";
							else if (SUBLANGID(langid) == SUBLANG_SERBIAN_LATIN)		  code = "sr_RS@Latn";
							else if (SUBLANGID(langid) == SUBLANG_SERBIAN_CYRILLIC)		  code = "sr_RS@Cyrl";
							break;
		case LANG_SINHALESE:	code = "si";	break;
		case LANG_SLOVAK:	code = "sk";	break;
		case LANG_SLOVENIAN:	code = "sl";	break;
		case LANG_SOTHO:	code = "sa";	break;
		case LANG_SPANISH:	code = "es";	if	(SUBLANGID(langid) == SUBLANG_SPANISH)			  code = "es_ES";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_ARGENTINA)	  code = "es_AR";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_BOLIVIA)		  code = "es_BO";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_CHILE)		  code = "es_CL";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_COLOMBIA)		  code = "es_CO";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_COSTA_RICA)	  code = "es_CR";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_DOMINICAN_REPUBLIC) code = "es_DO";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_ECUADOR)		  code = "es_EC";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_EL_SALVADOR)	  code = "es_SV";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_GUATEMALA)	  code = "es_GT";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_HONDURAS)		  code = "es_HN";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_MEXICAN)		  code = "es_MX";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_NICARAGUA)	  code = "es_NI";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_PANAMA)		  code = "es_PA";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_PARAGUAY)		  code = "es_PY";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_PERU)		  code = "es_PE";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_PUERTO_RICO)	  code = "es_PR";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_URUGUAY)		  code = "es_UY";
							else if (SUBLANGID(langid) == SUBLANG_SPANISH_VENEZUELA)	  code = "es_VE";
							break;
		case LANG_SWAHILI:	code = "sw";	break;
		case LANG_SWEDISH:	code = "sv";	break;
		case LANG_TAJIK:	code = "tg";	break;
		case LANG_TAMIL:	code = "ta";	if	(SUBLANGID(langid) == SUBLANG_TAMIL_INDIA)		  code = "ta_IN";
							else if (SUBLANGID(langid) == SUBLANG_TAMIL_SRI_LANKA)		  code = "ta_LK";
							break;
		case LANG_TELUGU:	code = "te";	break;
		case LANG_THAI:		code = "th";	break;
		case LANG_TIBETAN:	code = "bo";	break;
		case LANG_TIGRINYA:	code = "ti";	break;
		case LANG_TSWANA:	code = "tn";	break;
		case LANG_TURKISH:	code = "tr";	break;
		case LANG_TURKMEN:	code = "tk";	break;
		case LANG_UIGHUR:	code = "ug";	break;
		case LANG_UKRAINIAN:	code = "uk";	break;
		case LANG_URDU:		code = "ur";	if	(SUBLANGID(langid) == SUBLANG_URDU_INDIA)		  code = "ur_IN";
							else if (SUBLANGID(langid) == SUBLANG_URDU_PAKISTAN)		  code = "ur_PK";
							break;
		case LANG_UZBEK:	code = "uz";	if	(SUBLANGID(langid) == SUBLANG_UZBEK_LATIN)		  code = "uz_UZ@Latn";
							else if (SUBLANGID(langid) == SUBLANG_UZBEK_CYRILLIC)		  code = "uz_UZ@Cyrl";
							break;
		case LANG_VIETNAMESE:	code = "vi";	break;
		case LANG_WELSH:	code = "cy";	break;
		case LANG_WOLOF:	code = "wo";	break;
		case LANG_XHOSA:	code = "xh";	break;
		case LANG_YI:		code = "ii";	break;
		case LANG_YORUBA:	code = "yo";	break;
		case LANG_ZULU:		code = "zu";	break;
	}
#elif defined __APPLE__
	FILE		*pstdin = popen("defaults read -g AppleLocale", "r");
	Buffer<char>	 buffer(256);

	buffer.Zero();

	fscanf(pstdin, String("%[^\n]").Append(String::FromInt(buffer.Size() - 1)), (char *) buffer);

	pclose(pstdin);

	code = (char *) buffer;
#elif defined __HAIKU__
	FILE		*pstdin = popen("locale -l", "r");
	Buffer<char>	 buffer(256);

	buffer.Zero();

	fscanf(pstdin, String("%[^\n]").Append(String::FromInt(buffer.Size() - 1)), (char *) buffer);

	pclose(pstdin);

	code = (char *) buffer;
#else
	code = getenv("LANG");

	if (code == NIL) code = getenv("LC_MESSAGES");
#endif

	if (code.Contains(".")) code = code.Head(code.Find(".")).Append(code.Contains("@") ? code.Tail(code.Length() - code.Find("@")) : "");

	code.Replace("@latin", "@Latn");
	code.Replace("@cyrillic", "@Cyrl");

	return code;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x128(%rbp)
movq %rdi, %rax
movq %rax, -0x130(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
xorl %esi, %esi
callq 0x5da90
leaq 0xab913(%rip), %rdi     # 0x18b1d9
callq 0x5bea0
movq -0x128(%rbp), %rdi
movq %rax, %rsi
callq 0x5a230
jmp 0xdf8dc
movq -0x128(%rbp), %rdi
xorl %esi, %esi
callq 0x59320
movb %al, -0x131(%rbp)
jmp 0xdf8f2
movb -0x131(%rbp), %al
testb $0x1, %al
jne 0xdf8fe
jmp 0xdf92e
leaq 0xab8d9(%rip), %rdi     # 0x18b1de
callq 0x5bea0
movq -0x128(%rbp), %rdi
movq %rax, %rsi
callq 0x5a230
jmp 0xdf91b
jmp 0xdf92e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xdfce2
leaq 0xdd8ba(%rip), %rsi     # 0x1bd1ef
leaq -0x40(%rbp), %rdi
callq 0x5c1f0
jmp 0xdf940
movq -0x128(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x591d0
movb %al, -0x132(%rbp)
jmp 0xdf958
leaq -0x40(%rbp), %rdi
callq 0x5df00
movb -0x132(%rbp), %al
testb $0x1, %al
jne 0xdf970
jmp 0xdfb96
leaq 0xdd878(%rip), %rsi     # 0x1bd1ef
leaq -0x70(%rbp), %rdi
callq 0x5c1f0
jmp 0xdf982
movq -0x128(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x5bd60
movl %eax, -0x138(%rbp)
jmp 0xdf99a
movl -0x138(%rbp), %edx
movq -0x128(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x5d6b0
jmp 0xdf9b2
movb $0x0, -0xb9(%rbp)
leaq 0xab82a(%rip), %rsi     # 0x18b1ea
leaq -0xa0(%rbp), %rdi
callq 0x5c1f0
jmp 0xdf9ce
movq -0x128(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x591d0
movb %al, -0x139(%rbp)
jmp 0xdf9e9
movb -0x139(%rbp), %al
testb $0x1, %al
jne 0xdf9f5
jmp 0xdfa65
movq -0x128(%rbp), %rdi
callq 0x5b800
movl %eax, -0x140(%rbp)
jmp 0xdfa09
leaq 0xab7da(%rip), %rsi     # 0x18b1ea
leaq -0xb8(%rbp), %rdi
callq 0x5c1f0
jmp 0xdfa1e
movq -0x128(%rbp), %rdi
movb $0x1, -0xb9(%rbp)
leaq -0xb8(%rbp), %rsi
callq 0x5bd60
movl %eax, -0x144(%rbp)
jmp 0xdfa40
movq -0x128(%rbp), %rsi
movl -0x144(%rbp), %eax
movl -0x140(%rbp), %edx
subl %eax, %edx
leaq -0x88(%rbp), %rdi
callq 0x5c8a0
jmp 0xdfa63
jmp 0xdfa7c
leaq 0xc5e18(%rip), %rsi     # 0x1a5884
leaq -0x88(%rbp), %rdi
callq 0x5c1f0
jmp 0xdfa7a
jmp 0xdfa7c
leaq -0x58(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x5a710
movq %rax, -0x150(%rbp)
jmp 0xdfa95
movq -0x150(%rbp), %rsi
movq -0x128(%rbp), %rdi
callq 0x59760
jmp 0xdfaaa
leaq -0x88(%rbp), %rdi
callq 0x5df00
testb $0x1, -0xb9(%rbp)
jne 0xdfac1
jmp 0xdfacd
leaq -0xb8(%rbp), %rdi
callq 0x5df00
leaq -0xa0(%rbp), %rdi
callq 0x5df00
leaq -0x58(%rbp), %rdi
callq 0x5df00
leaq -0x70(%rbp), %rdi
callq 0x5df00
jmp 0xdfb96
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5df00
jmp 0xdfce2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xdfb88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xdfb7f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xdfb73
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xdfb5a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x5df00
testb $0x1, -0xb9(%rbp)
jne 0xdfb65
jmp 0xdfb71
leaq -0xb8(%rbp), %rdi
callq 0x5df00
jmp 0xdfb73
leaq -0xa0(%rbp), %rdi
callq 0x5df00
leaq -0x58(%rbp), %rdi
callq 0x5df00
leaq -0x70(%rbp), %rdi
callq 0x5df00
jmp 0xdfce2
leaq 0xab64f(%rip), %rsi     # 0x18b1ec
leaq -0xd8(%rbp), %rdi
callq 0x5c1f0
jmp 0xdfbab
leaq 0xab641(%rip), %rsi     # 0x18b1f3
leaq -0xf0(%rbp), %rdi
callq 0x5c1f0
jmp 0xdfbc0
movq -0x128(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
callq 0x5bd30
jmp 0xdfbdc
leaq -0xf0(%rbp), %rdi
callq 0x5df00
leaq -0xd8(%rbp), %rdi
callq 0x5df00
leaq 0xab5fe(%rip), %rsi     # 0x18b1f9
leaq -0x108(%rbp), %rdi
callq 0x5c1f0
jmp 0xdfc09
leaq 0xab5f3(%rip), %rsi     # 0x18b203
leaq -0x120(%rbp), %rdi
callq 0x5c1f0
jmp 0xdfc1e
movq -0x128(%rbp), %rdi
leaq -0x108(%rbp), %rsi
leaq -0x120(%rbp), %rdx
callq 0x5bd30
jmp 0xdfc3a
leaq -0x120(%rbp), %rdi
callq 0x5df00
leaq -0x108(%rbp), %rdi
callq 0x5df00
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0xdfcd2
jmp 0xdfcc6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xdfc84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x5df00
leaq -0xd8(%rbp), %rdi
callq 0x5df00
jmp 0xdfce2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xdfcb8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x5df00
leaq -0x108(%rbp), %rdi
callq 0x5df00
jmp 0xdfce2
movq -0x128(%rbp), %rdi
callq 0x5df00
movq -0x130(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x128(%rbp), %rdi
callq 0x5df00
movq -0x20(%rbp), %rdi
callq 0x5b6b0
nopw (%rax,%rax)