// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/i18n/translator.cpp
// Function: smooth::I18n::Translator::ActivateLanguage(smooth::String const&)
S::Int S::I18n::Translator::ActivateLanguage(const String &magic)
{
	foreach (Language *language, languages)
	{
		if (language->magic != magic) continue;

		activeLanguage = language;

		/* Try to set application language for internal library strings.
		 */
		if (magic != "internal")
		{
			String	 code = magic.SubString(magic.Find("_") + 1, magic.Find(".xml") - magic.Find("_") - 1);
			String	 id   = String("smooth_").Append(code).Append(".xml");

			if (defaultTranslator->ActivateLanguage(id) != Success())
			{
				/* If failed, try the base language code if applicable.
				 */
				if (code.Contains("_"))
				{
					id = String("smooth_").Append(code.Head(code.Find("_"))).Append(".xml");

					defaultTranslator->ActivateLanguage(id);
				}
			}

			/* Activate user default language if setting the application language failed.
			 */
			if (defaultTranslator->GetActiveLanguageID() != id) defaultTranslator->SelectUserDefaultLanguage();
		}

		/* Activate internal language if application language is set to internal.
		 */
		if (magic == "internal" && defaultTranslator != NIL) defaultTranslator->ActivateLanguage(magic);

		/* Load actual language data.
		 */
		if (magic != "internal" && activeLanguage->strings.Length() == 0 && activeLanguage->sections.Length() == 0)
		{
			/* Check translation folders.
			 */
			const Array<Directory>	&dirs = GetTranslationFolders(appPrefix);

			foreach (const Directory &dir, dirs)
			{
				/* Load translation file.
				 */
				String		 file = String(dir).Append(Directory::GetDirectoryDelimiter()).Append(magic);
				XML::Document	 doc;

				if (doc.LoadFile(file) == Success() && LoadData(doc, activeLanguage) == Success()) break;
			}
		}

		return Success();
	}

	return Error();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x298(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0xffffffff, -0x20(%rbp) # imm = 0xFFFFFFFF
xorl %eax, %eax
cmpl $0x0, -0x1c(%rbp)
movb %al, -0x299(%rbp)
jne 0xe1fb9
movq -0x298(%rbp), %rdi
movl -0x20(%rbp), %eax
movl %eax, -0x2a0(%rbp)
addq $0x20, %rdi
callq 0x5c990
movl %eax, %ecx
movl -0x2a0(%rbp), %eax
subl $0x1, %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0x299(%rbp)
movb -0x299(%rbp), %al
testb $0x1, %al
jne 0xe1fc8
jmp 0xe2a17
movq -0x298(%rbp), %rdi
addq $0x20, %rdi
movl -0x20(%rbp), %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
callq 0xe3090
movq (%rax), %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x1c(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe1ffa
jmp 0xe2a07
movq -0x28(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
movq -0x18(%rbp), %rsi
callq 0x5b570
testb $0x1, %al
jne 0xe2014
jmp 0xe2019
jmp 0xe29f9
movq -0x298(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, 0x78(%rax)
movq -0x18(%rbp), %rdi
leaq 0xa919d(%rip), %rsi     # 0x18b1d0
callq 0x5dd80
testb $0x1, %al
jne 0xe2041
jmp 0xe2545
movq -0x18(%rbp), %rax
movq %rax, -0x2b8(%rbp)
leaq 0xc5d16(%rip), %rsi     # 0x1a7d69
leaq -0x58(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x5c1f0
movq -0x2b8(%rbp), %rdi
movq -0x2b0(%rbp), %rsi
callq 0x5bd60
movl %eax, -0x2a4(%rbp)
jmp 0xe207e
movl -0x2a4(%rbp), %eax
incl %eax
movl %eax, -0x2c4(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x2c0(%rbp)
leaq 0xa91a1(%rip), %rsi     # 0x18b23f
leaq -0x80(%rbp), %rdi
callq 0x5c1f0
jmp 0xe20a9
movq -0x2c0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x5bd60
movl %eax, -0x2c8(%rbp)
jmp 0xe20c1
movq -0x18(%rbp), %rax
movq %rax, -0x2d0(%rbp)
leaq 0xc5c96(%rip), %rsi     # 0x1a7d69
leaq -0x98(%rbp), %rdi
callq 0x5c1f0
jmp 0xe20e1
movq -0x2d0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x5bd60
movl %eax, -0x2d4(%rbp)
jmp 0xe20fc
movl -0x2c4(%rbp), %edx
movq -0x2b8(%rbp), %rsi
movl -0x2c8(%rbp), %eax
movl -0x2d4(%rbp), %ecx
notl %ecx
addl %eax, %ecx
leaq -0x40(%rbp), %rdi
callq 0x5dc20
jmp 0xe2124
leaq -0x98(%rbp), %rdi
callq 0x5df00
leaq -0x80(%rbp), %rdi
callq 0x5df00
leaq -0x58(%rbp), %rdi
callq 0x5df00
leaq 0xa90fb(%rip), %rsi     # 0x18b244
leaq -0xc8(%rbp), %rdi
callq 0x5c1f0
jmp 0xe2157
leaq -0xc8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5a710
movq %rax, -0x2e0(%rbp)
jmp 0xe2170
leaq 0xa90c8(%rip), %rsi     # 0x18b23f
leaq -0xe0(%rbp), %rdi
callq 0x5c1f0
jmp 0xe2185
movq -0x2e0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x5a710
movq %rax, -0x2e8(%rbp)
jmp 0xe21a1
movq -0x2e8(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x5b6d0
jmp 0xe21b6
leaq -0xe0(%rbp), %rdi
callq 0x5df00
leaq -0xc8(%rbp), %rdi
callq 0x5df00
movq 0x1261eb(%rip), %rax    # 0x2083c0
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
leaq -0xb0(%rbp), %rsi
callq *%rax
movl %eax, -0x2ec(%rbp)
jmp 0xe21f0
leaq -0xf0(%rbp), %rdi
callq 0x5ca80
jmp 0xe21fe
leaq -0xf0(%rbp), %rdi
callq 0x59680
movl %eax, -0x2f0(%rbp)
jmp 0xe2212
leaq -0xf0(%rbp), %rdi
callq 0x5a410
movl -0x2f0(%rbp), %ecx
movl -0x2ec(%rbp), %eax
cmpl %ecx, %eax
je 0xe24cf
leaq 0xc5b30(%rip), %rsi     # 0x1a7d69
leaq -0x108(%rbp), %rdi
callq 0x5c1f0
jmp 0xe2247
leaq -0x40(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x591d0
movb %al, -0x2f1(%rbp)
jmp 0xe225f
leaq -0x108(%rbp), %rdi
callq 0x5df00
movb -0x2f1(%rbp), %al
testb $0x1, %al
jne 0xe227a
jmp 0xe24cd
leaq 0xa8fc3(%rip), %rsi     # 0x18b244
leaq -0x120(%rbp), %rdi
callq 0x5c1f0
jmp 0xe228f
leaq 0xc5ad3(%rip), %rsi     # 0x1a7d69
leaq -0x150(%rbp), %rdi
callq 0x5c1f0
jmp 0xe22a4
leaq -0x40(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x5bd60
movl %eax, -0x2f8(%rbp)
jmp 0xe22bc
movl -0x2f8(%rbp), %edx
leaq -0x138(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5d6b0
jmp 0xe22d4
leaq -0x120(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x5a710
movq %rax, -0x300(%rbp)
jmp 0xe22f0
leaq 0xa8f48(%rip), %rsi     # 0x18b23f
leaq -0x168(%rbp), %rdi
callq 0x5c1f0
jmp 0xe2305
movq -0x300(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x5a710
movq %rax, -0x308(%rbp)
jmp 0xe2321
movq -0x308(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x59760
jmp 0xe2336
leaq -0x168(%rbp), %rdi
callq 0x5df00
leaq -0x138(%rbp), %rdi
callq 0x5df00
leaq -0x150(%rbp), %rdi
callq 0x5df00
leaq -0x120(%rbp), %rdi
callq 0x5df00
movq 0x126053(%rip), %rax    # 0x2083c0
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
leaq -0xb0(%rbp), %rsi
callq *%rax
jmp 0xe2382
jmp 0xe24cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe23c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe23bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5df00
leaq -0x80(%rbp), %rdi
callq 0x5df00
leaq -0x58(%rbp), %rdi
callq 0x5df00
jmp 0xe2a80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe2537
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe2409
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x5df00
leaq -0xc8(%rbp), %rdi
callq 0x5df00
jmp 0xe2537
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe252b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x5a410
jmp 0xe252b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x5df00
jmp 0xe252b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe24bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe24b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe24a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x5df00
leaq -0x138(%rbp), %rdi
callq 0x5df00
leaq -0x150(%rbp), %rdi
callq 0x5df00
leaq -0x120(%rbp), %rdi
callq 0x5df00
jmp 0xe252b
jmp 0xe24cf
movq 0x125eea(%rip), %rax    # 0x2083c0
movq (%rax), %rdi
callq 0x59d40
movq %rax, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x5b570
movb %al, -0x309(%rbp)
jmp 0xe24f5
movb -0x309(%rbp), %al
testb $0x1, %al
jne 0xe2501
jmp 0xe2514
movq 0x125eb8(%rip), %rax    # 0x2083c0
movq (%rax), %rdi
callq 0x5bb20
jmp 0xe2512
jmp 0xe2514
leaq -0xb0(%rbp), %rdi
callq 0x5df00
leaq -0x40(%rbp), %rdi
callq 0x5df00
jmp 0xe2545
leaq -0xb0(%rbp), %rdi
callq 0x5df00
leaq -0x40(%rbp), %rdi
callq 0x5df00
jmp 0xe2a80
movq -0x18(%rbp), %rdi
leaq 0xa8c80(%rip), %rsi     # 0x18b1d0
callq 0x5c7f0
testb $0x1, %al
jne 0xe255b
jmp 0xe257c
movq 0x125e5e(%rip), %rax    # 0x2083c0
cmpq $0x0, (%rax)
je 0xe257c
movq 0x125e51(%rip), %rax    # 0x2083c0
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movq (%rdi), %rax
callq *0x10(%rax)
movq -0x18(%rbp), %rdi
leaq 0xa8c49(%rip), %rsi     # 0x18b1d0
callq 0x5dd80
testb $0x1, %al
jne 0xe2595
jmp 0xe299b
movq -0x298(%rbp), %rax
movq 0x78(%rax), %rdi
addq $0x40, %rdi
callq 0x5c990
cmpl $0x0, %eax
jne 0xe299b
movq -0x298(%rbp), %rax
movq 0x78(%rax), %rdi
addq $0x98, %rdi
callq 0x5c990
cmpl $0x0, %eax
jne 0xe299b
movq -0x298(%rbp), %rsi
addq $0x8, %rsi
leaq -0x1c8(%rbp), %rdi
callq 0xe1200
leaq -0x1c8(%rbp), %rax
movq %rax, -0x170(%rbp)
movl $0x0, -0x1cc(%rbp)
movl $0xffffffff, -0x1d0(%rbp) # imm = 0xFFFFFFFF
xorl %eax, %eax
cmpl $0x0, -0x1cc(%rbp)
movb %al, -0x30a(%rbp)
jne 0xe2656
movl -0x1d0(%rbp), %eax
movl %eax, -0x314(%rbp)
movq -0x170(%rbp), %rdi
callq 0x5c990
movl %eax, -0x310(%rbp)
jmp 0xe263c
movl -0x314(%rbp), %eax
movl -0x310(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0x30a(%rbp)
movb -0x30a(%rbp), %al
testb $0x1, %al
jne 0xe2665
jmp 0xe297c
movq -0x170(%rbp), %rdi
movl -0x1d0(%rbp), %esi
incl %esi
movl %esi, -0x1d0(%rbp)
callq 0xe3120
movq %rax, -0x320(%rbp)
jmp 0xe2688
movq -0x320(%rbp), %rax
movq %rax, -0x1d8(%rbp)
cmpl $0x0, -0x1cc(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe26ab
jmp 0xe2966
movq -0x1d8(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0x5b330
jmp 0xe26c0
callq 0x59460
movq %rax, -0x328(%rbp)
jmp 0xe26ce
movq -0x328(%rbp), %rsi
leaq -0x220(%rbp), %rdi
callq 0x5c1f0
jmp 0xe26e3
leaq -0x208(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x5a710
movq %rax, -0x330(%rbp)
jmp 0xe26ff
movq -0x330(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5a710
movq %rax, -0x338(%rbp)
jmp 0xe2718
movq -0x338(%rbp), %rsi
leaq -0x1f0(%rbp), %rdi
callq 0x5b6d0
jmp 0xe272d
leaq -0x220(%rbp), %rdi
callq 0x5df00
leaq -0x208(%rbp), %rdi
callq 0x5df00
leaq -0x248(%rbp), %rdi
callq 0x5c470
jmp 0xe2753
movb $0x0, -0x269(%rbp)
leaq -0x248(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x59670
movl %eax, -0x33c(%rbp)
jmp 0xe2775
leaq -0x258(%rbp), %rdi
callq 0x5ca80
jmp 0xe2783
leaq -0x258(%rbp), %rdi
callq 0x59680
movl %eax, -0x340(%rbp)
jmp 0xe2797
movl -0x33c(%rbp), %ecx
movl -0x340(%rbp), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x341(%rbp)
jne 0xe280e
movq -0x298(%rbp), %rdi
movq 0x78(%rdi), %rdx
leaq -0x248(%rbp), %rsi
callq 0x5a060
movl %eax, -0x348(%rbp)
jmp 0xe27ce
leaq -0x268(%rbp), %rdi
callq 0x5ca80
jmp 0xe27dc
movb $0x1, -0x269(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x59680
movl %eax, -0x34c(%rbp)
jmp 0xe27f7
movl -0x348(%rbp), %eax
movl -0x34c(%rbp), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x341(%rbp)
movb -0x341(%rbp), %al
movb %al, -0x34d(%rbp)
testb $0x1, -0x269(%rbp)
jne 0xe2825
jmp 0xe2831
leaq -0x268(%rbp), %rdi
callq 0x5a410
leaq -0x258(%rbp), %rdi
callq 0x5a410
movb -0x34d(%rbp), %al
testb $0x1, %al
jne 0xe284c
jmp 0xe2906
movl $0xb, -0x270(%rbp)
jmp 0xe2910
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe298a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe2892
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x5df00
leaq -0x208(%rbp), %rdi
callq 0x5df00
jmp 0xe298a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe2958
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe294c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe28f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
testb $0x1, -0x269(%rbp)
jne 0xe28ea
jmp 0xe28f6
leaq -0x268(%rbp), %rdi
callq 0x5a410
jmp 0xe28f8
leaq -0x258(%rbp), %rdi
callq 0x5a410
jmp 0xe294c
movl $0x0, -0x270(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x59520
leaq -0x1f0(%rbp), %rdi
callq 0x5df00
movl -0x270(%rbp), %eax
testl %eax, %eax
je 0xe2936
jmp 0xe2934
jmp 0xe2966
jmp 0xe2938
movl -0x1cc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1cc(%rbp)
jmp 0xe2696
leaq -0x248(%rbp), %rdi
callq 0x59520
leaq -0x1f0(%rbp), %rdi
callq 0x5df00
jmp 0xe298a
jmp 0xe2968
movl -0x1cc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1cc(%rbp)
jmp 0xe260b
leaq -0x1c8(%rbp), %rdi
callq 0x65aa0
jmp 0xe299b
leaq -0x1c8(%rbp), %rdi
callq 0x65aa0
jmp 0xe2a80
leaq -0x280(%rbp), %rdi
movq %rdi, -0x360(%rbp)
callq 0x5ca80
movq -0x360(%rbp), %rdi
callq 0x59680
movl %eax, -0x354(%rbp)
jmp 0xe29c2
movl -0x354(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x5a410
jmp 0xe2a74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x5a410
jmp 0xe2a80
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe1fe8
jmp 0xe2a09
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe1f7c
leaq -0x290(%rbp), %rdi
movq %rdi, -0x370(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0x370(%rbp), %rdi
callq 0x59680
movl %eax, -0x364(%rbp)
jmp 0xe2a43
movl -0x364(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x5b5b0
jmp 0xe2a74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x5b5b0
jmp 0xe2a80
movl -0x4(%rbp), %eax
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x5b6b0
nopl (%rax)